mmc: core: Rework cd-gpio handling
authorMichał Mirosław <mirq-linux@rere.qmqm.pl>
Wed, 11 Dec 2019 02:40:56 +0000 (03:40 +0100)
committerUlf Hansson <ulf.hansson@linaro.org>
Wed, 18 Dec 2019 12:36:53 +0000 (13:36 +0100)
commit0f7c815d83a20dbae8b736331eb1ffd0bc0497d7
tree51960fa94ae330a03ec98c93091d806623ddf141
parent9073d10b098973519044f5fcdc25586810b435da
mmc: core: Rework cd-gpio handling

There are a few places around the code that invert inverted and possibly
inverted CD line. That's really confusing. Squash them all into one place
in mmc_gpiod_request_cd(). MMC_CAP2_CD_ACTIVE_HIGH is used analogously to
WP line: in GPIO mode it is used only at probe time to switch polarity, for
native mode it is left as is.

Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Link: https://lore.kernel.org/r/db189b715596d63caf8c6a088bddc71dd69a879b.1576031637.git.mirq-linux@rere.qmqm.pl
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/gpio/gpiolib-of.c
drivers/mmc/core/host.c
drivers/mmc/core/slot-gpio.c