[PATCH 2/3] mmc: meson_gx_mmc: use mmc_pwrseq instead of meson_mmc_pwrseq

Jaehoon Chung jh80.chung at samsung.com
Thu Feb 4 23:15:44 CET 2021


Hi Neil,

On 2/4/21 11:05 PM, Neil Armstrong wrote:
> On 01/02/2021 10:28, Jaehoon Chung wrote:
>> Use mmc_pwrseq instead of meson_mmc_pwrseq.
>>
>> Signed-off-by: Jaehoon Chung <jh80.chung at samsung.com>
>> ---
>>  drivers/mmc/meson_gx_mmc.c | 41 +++-----------------------------------
>>  1 file changed, 3 insertions(+), 38 deletions(-)
>>
>> diff --git a/drivers/mmc/meson_gx_mmc.c b/drivers/mmc/meson_gx_mmc.c
>> index 8b6dfa3b9603..0ef140562cd2 100644
>> --- a/drivers/mmc/meson_gx_mmc.c
>> +++ b/drivers/mmc/meson_gx_mmc.c
>> @@ -292,12 +292,11 @@ static int meson_mmc_probe(struct udevice *dev)
>>  
>>  	mmc_set_clock(mmc, cfg->f_min, MMC_CLK_ENABLE);
>>  
>> -#ifdef CONFIG_PWRSEQ
>> +#ifdef CONFIG_MMC_PWRSEQ
>>  	/* Enable power if needed */
>> -	ret = uclass_get_device_by_phandle(UCLASS_PWRSEQ, dev, "mmc-pwrseq",
>> -					   &pwr_dev);
>> +	ret = mmc_pwrseq_get_power(dev, cfg);
>>  	if (!ret) {
>> -		ret = pwrseq_set_power(pwr_dev, true);
>> +		ret = pwrseq_set_power(cfg->pwr_dev, true);
>>  		if (ret)
>>  			return ret;
>>  	}
>> @@ -342,37 +341,3 @@ U_BOOT_DRIVER(meson_mmc) = {
>>  	.of_to_plat = meson_mmc_of_to_plat,
>>  	.plat_auto	= sizeof(struct meson_mmc_plat),
>>  };
>> -
>> -#ifdef CONFIG_PWRSEQ
>> -static int meson_mmc_pwrseq_set_power(struct udevice *dev, bool enable)
>> -{
>> -	struct gpio_desc reset;
>> -	int ret;
>> -
>> -	ret = gpio_request_by_name(dev, "reset-gpios", 0, &reset, GPIOD_IS_OUT);
>> -	if (ret)
>> -		return ret;
>> -	dm_gpio_set_value(&reset, 1);
>> -	udelay(1);
>> -	dm_gpio_set_value(&reset, 0);
>> -	udelay(200);
>> -
>> -	return 0;
>> -}
>> -
>> -static const struct pwrseq_ops meson_mmc_pwrseq_ops = {
>> -	.set_power	= meson_mmc_pwrseq_set_power,
>> -};
>> -
>> -static const struct udevice_id meson_mmc_pwrseq_ids[] = {
>> -	{ .compatible = "mmc-pwrseq-emmc" },
>> -	{ }
>> -};
>> -
>> -U_BOOT_DRIVER(meson_mmc_pwrseq_drv) = {
>> -	.name		= "mmc_pwrseq_emmc",
>> -	.id		= UCLASS_PWRSEQ,
>> -	.of_match	= meson_mmc_pwrseq_ids,
>> -	.ops		= &meson_mmc_pwrseq_ops,
>> -};
>> -#endif
>>
> 
> Acked-by: Neil Armstrong <narmstrong at baylibre.com>
> 
> You should probably also update the amlogic defconfigs in this patchset, no ?

Amlogic defconfigs are already enabled CONFIG_PWRSEQ.
CONFIG_MMC_PWRSEQ is depends on CONFIG_PWRSEQ and it will be enabled by default.
So it didn't need to update any defconfig..

But Now after listened your mention, my thinking is changed.
Because some boards can be used only CONFIG_PWRSEQ without CONFIG_MMC_PWRSEQ.

Thanks for pointing out. I will update amlogic defconfigs.

If i misunderstood something, let me know, plz.

Best Regards,
Jaehoon Chung

> 
> Neil
> 



More information about the U-Boot mailing list