Re: [PATCH 1/6] mmc: core: Add mmc_gpiod_set_cd_config() function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On 4/8/24 5:16 PM, Andy Shevchenko wrote:
> On Sun, Apr 07, 2024 at 10:04:48PM +0200, Hans de Goede wrote:
>> Some mmc host drivers may need to fixup a card-detection GPIO's config
>> to e.g. enable the GPIO controllers builtin pull-up resistor on devices
>> where the firmware description of the GPIO is broken (e.g. GpioInt with
>> PullNone instead of PullUp in ACPI DSDT).
>>
>> Since this is the exception rather then the rule adding a config
>> parameter to mmc_gpiod_request_cd() seems undesirable, so instead
>> add a new mmc_gpiod_set_cd_config() function. This is simply a wrapper
>> to call gpiod_set_config() on the card-detect GPIO acquired through
>> mmc_gpiod_request_cd().
> 
> ...
> 
>>  int mmc_gpiod_request_cd(struct mmc_host *host, const char *con_id,
>>  			 unsigned int idx, bool override_active_level,
>>  			 unsigned int debounce);
>> +int mmc_gpiod_set_cd_config(struct mmc_host *host, unsigned long config);
> 
> A nit, can we group it with...
> 
>>  int mmc_gpiod_request_ro(struct mmc_host *host, const char *con_id,
>>  			 unsigned int idx, unsigned int debounce);
>>  void mmc_gpio_set_cd_isr(struct mmc_host *host,
> 
> ...this one, as request ops vs. set_cd ones?


I actually deliberately grouped it with mmc_gpiod_request_cd() since
it operates on the gpiod requested by that / since this is sorta an
alternative to just adding a config param to mmc_gpiod_request_cd()
mirroring the existing debounce parameter.

With that said I've no objections against moving it either. So whatever
you prefer.

Regards,

Hans







[Index of Archives]     [Linux Memonry Technology]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux