All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jaehoon Chung <jh80.chung@samsung.com>
To: Andre Przywara <andre.przywara@arm.com>
Cc: Samuel Holland <samuel@sholland.org>,
	u-boot@lists.denx.de, Jagan Teki <jagan@amarulasolutions.com>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Icenowy Zheng <icenowy@aosc.io>,
	Jernej Skrabec <jernej.skrabec@gmail.com>,
	Peng Fan <peng.fan@nxp.com>, Simon Glass <sjg@chromium.org>
Subject: Re: [PATCH 4/4] mmc: sunxi: Use DM_GPIO flags to set pull-up
Date: Fri, 22 Oct 2021 19:10:20 +0900	[thread overview]
Message-ID: <4b6862fd-a008-4603-81c3-67148e0d7888@samsung.com> (raw)
In-Reply-To: <20211022100025.1232eee4@donnerap.cambridge.arm.com>

Hi Andre,

On 10/22/21 6:00 PM, Andre Przywara wrote:
> On Fri, 22 Oct 2021 06:58:48 +0900
> Jaehoon Chung <jh80.chung@samsung.com> wrote:
> 
> Hi Jaehoon,
> 
> thanks for having a look!
> 
>> Hi,
>>
>> On 10/21/21 1:52 PM, Samuel Holland wrote:
>>> Now that the sunxi_gpio driver handles pull-up/down via the driver
>>> model, pin configuration does not need a platform-specific function.
>>>
>>> Signed-off-by: Samuel Holland <samuel@sholland.org>
>>> ---
>>>
>>>  drivers/mmc/sunxi_mmc.c | 8 ++------
>>>  1 file changed, 2 insertions(+), 6 deletions(-)
>>>
>>> diff --git a/drivers/mmc/sunxi_mmc.c b/drivers/mmc/sunxi_mmc.c
>>> index c170c16d5a..955b29826f 100644
>>> --- a/drivers/mmc/sunxi_mmc.c
>>> +++ b/drivers/mmc/sunxi_mmc.c
>>> @@ -700,12 +700,8 @@ static int sunxi_mmc_probe(struct udevice *dev)
>>>  		return ret;
>>>  
>>>  	/* This GPIO is optional */
>>> -	if (!gpio_request_by_name(dev, "cd-gpios", 0, &priv->cd_gpio,
>>> -				  GPIOD_IS_IN)) {
>>> -		int cd_pin = gpio_get_number(&priv->cd_gpio);
>>> -
>>> -		sunxi_gpio_set_pull(cd_pin, SUNXI_GPIO_PULL_UP);
>>> -	}
>>> +	gpio_request_by_name(dev, "cd-gpios", 0, &priv->cd_gpio,
>>> +			     GPIOD_IS_IN | GPIOD_PULL_UP);  
>>
>> Is it right to set the pull-up?
> 
> You mean, unconditionally? I mean it's just copying the current
> code, which does that (see the "minus" lines just above).

Yes, it looks like something strange. 
AFAIK, It can be changed that cd-gpios has dependent how to consist of H/W.
But it's not different with original behavior, as you mentioned.

> 
> But I think you have a point: I don't see any pull up specified in any DT,
> and I think most (if not all) boards have a discrete pull up resistor on
> that line.
> 
> But I don't dare to touch that code - at least for this series, as it
> works (TM) right now.
> After the full DM_PINCTRL series this might be another story, though.

Right. I understood exactly. Thanks for explanation.

P.S: Can I test sunxi patch with NeoPlus2 board(Allwinner H5)?

Best Regards,
Jaehoon Chung

> 
> Cheers,
> Andre
> 
>>
>> Best Regards,
>> Jaehoon Chung
>>
>>>  
>>>  	upriv->mmc = &plat->mmc;
>>>  
>>>   
>>
> 
> 


  reply	other threads:[~2021-10-22 10:09 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-21  4:52 [PATCH 0/4] gpio: sunxi: Handle pin configuration flags Samuel Holland
2021-10-21  4:52 ` [PATCH 1/4] sunxi: gpio: Return void from setter functions Samuel Holland
2021-11-05 13:53   ` Heinrich Schuchardt
2021-10-21  4:52 ` [PATCH 2/4] sunxi: gpio: Add per-bank drive and pull setters Samuel Holland
2021-11-05 14:12   ` Heinrich Schuchardt
2022-01-30  1:11     ` Andre Przywara
2021-10-21  4:52 ` [PATCH 3/4] gpio: sunxi: Implement .set_flags Samuel Holland
2021-10-24 19:53   ` Simon Glass
2021-11-05 14:43   ` Heinrich Schuchardt
2021-11-05 21:46     ` Samuel Holland
2022-01-30  1:18       ` Andre Przywara
2021-10-21  4:52 ` [PATCH 4/4] mmc: sunxi: Use DM_GPIO flags to set pull-up Samuel Holland
2021-10-21 21:58   ` Jaehoon Chung
2021-10-22  9:00     ` Andre Przywara
2021-10-22 10:10       ` Jaehoon Chung [this message]
2021-10-22 10:36         ` Andre Przywara
2021-11-05 15:52   ` Heinrich Schuchardt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4b6862fd-a008-4603-81c3-67148e0d7888@samsung.com \
    --to=jh80.chung@samsung.com \
    --cc=andre.przywara@arm.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=icenowy@aosc.io \
    --cc=jagan@amarulasolutions.com \
    --cc=jernej.skrabec@gmail.com \
    --cc=peng.fan@nxp.com \
    --cc=samuel@sholland.org \
    --cc=sjg@chromium.org \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.