mbox series

[0/4] mmc: simplify WP/CD GPIO handling

Message ID cover.1575925023.git.mirq-linux@rere.qmqm.pl
Headers show
Series mmc: simplify WP/CD GPIO handling | expand

Message

Michał Mirosław Dec. 9, 2019, 9:09 p.m. UTC
This series removes convoluted handling of inverted CD and WP lines in
SD/MMC host drivers when using GPIOs.

First patch, sent separately earlier, adds gpiod_toggle_active_low() to
switch line inversion flag in the gpiod structure. Next two patches
modify WP and CD initialization to apply all the inversions onto gpiod's
active-low flag. Final patch removes now-unused argument from init functions.

x86 allyesconfig build-tested.

Michał Mirosław (4):
  gpio: add gpiod_toggle_active_low()
  mmc: rework wp-gpio handling
  mmc: rework cd-gpio handling
  mmc: remove mmc_gpiod_request_*(invert_gpio)

 drivers/gpio/gpiolib-of.c          | 21 -------------------
 drivers/gpio/gpiolib.c             | 11 ++++++++++
 drivers/mmc/core/host.c            | 33 ++++++++----------------------
 drivers/mmc/core/slot-gpio.c       | 30 ++++++++++-----------------
 drivers/mmc/host/davinci_mmc.c     |  4 ++--
 drivers/mmc/host/mmc_spi.c         |  4 ++--
 drivers/mmc/host/mmci.c            |  4 ++--
 drivers/mmc/host/pxamci.c          | 12 +++++------
 drivers/mmc/host/s3cmci.c          |  4 ++--
 drivers/mmc/host/sdhci-acpi.c      |  2 +-
 drivers/mmc/host/sdhci-esdhc-imx.c | 15 +++++++-------
 drivers/mmc/host/sdhci-pci-core.c  |  4 ++--
 drivers/mmc/host/sdhci-sirf.c      |  2 +-
 drivers/mmc/host/sdhci-spear.c     |  2 +-
 drivers/mmc/host/tmio_mmc_core.c   |  2 +-
 include/linux/gpio/consumer.h      |  7 +++++++
 include/linux/mmc/slot-gpio.h      |  5 ++---
 17 files changed, 67 insertions(+), 95 deletions(-)

Comments

Linus Walleij Dec. 11, 2019, 12:37 a.m. UTC | #1
On Mon, Dec 9, 2019 at 10:09 PM Michał Mirosław <mirq-linux@rere.qmqm.pl> wrote:

> This series removes convoluted handling of inverted CD and WP lines in
> SD/MMC host drivers when using GPIOs.
>
> First patch, sent separately earlier, adds gpiod_toggle_active_low() to
> switch line inversion flag in the gpiod structure. Next two patches
> modify WP and CD initialization to apply all the inversions onto gpiod's
> active-low flag. Final patch removes now-unused argument from init functions.

I like the approach, as much as I liked my own idea to centralize
all DT quirks and hide them in gpiolib-of.c I can see how this
makes it easier to solve the final hurdles in the MMC framework
and contain it better.

If it also works I'm happy for Ulf to merge all of this!

Yours,
Linus Walleij