• Linus Walleij's avatar
    mmc: omap_hsmmc: Delete platform data GPIO CD and WP · e63201f1
    Linus Walleij authored
    The OMAP HSMMC driver has some elaborate and hairy handling for
    passing GPIO card detect and write protect lines from a boardfile
    into the driver: the machine defines a struct omap2_hsmmc_info
    that is copied into struct omap_hsmmc_platform_data by
    omap_hsmmc_pdata_init() in arch/arm/mach-omap2/hsmmc.c.
    
    However the .gpio_cd and .gpio_wp fields are not copied from
    omap2_hsmmc_info to omap_hsmmc_platform_data by
    omap_hsmmc_pdata_init() so they remain unused. The only platform
    defining omap2_hsmmc_info also define both to -1, unused.
    
    It turn out there are no boardfiles passing any valid GPIO
    lines into the OMAP HSMMC driver at all. And since we are not
    going to add any more OMAP2 boardfiles, we can delete this
    card detect and write protect handling altogether.
    
    This seems to also fix a bug: the card detect callback
    mmc_gpio_get_cd() in the slot GPIO core needs to be called
    by drivers utilizing slot GPIO. It appears the the boardfile
    quirks were not doing this right, so this would only get
    called for boardfiles, i.e. since no boardfile was using it,
    never.
    
    Just assign mmc_gpio_get_cd() unconditionally to omap_hsmmc_ops
    .get_cd() so card detects from the device tree works.
    AFAICT card detect with GPIO lines assigned from
    mmc_of_parse() are not working at the moment, but that is
    no regression since it probably never worked.
    
    Cc: Tony Lindgren <tony@atomide.com>
    Cc: linux-omap@vger.kernel.org
    Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
    Acked-by: default avatarTony Lindgren <tony@atomide.com>
    Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
    e63201f1
pdata-quirks.c 17.4 KB