From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1A4ABC433EF for ; Fri, 22 Oct 2021 10:36:37 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 65AB46112F for ; Fri, 22 Oct 2021 10:36:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 65AB46112F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 3443983409; Fri, 22 Oct 2021 12:36:34 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id 6BC5B83461; Fri, 22 Oct 2021 12:36:32 +0200 (CEST) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by phobos.denx.de (Postfix) with ESMTP id AF225832E9 for ; Fri, 22 Oct 2021 12:36:28 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=andre.przywara@arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id C7FB91063; Fri, 22 Oct 2021 03:36:27 -0700 (PDT) Received: from donnerap.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 8867A3F70D; Fri, 22 Oct 2021 03:36:26 -0700 (PDT) Date: Fri, 22 Oct 2021 11:36:24 +0100 From: Andre Przywara To: Jaehoon Chung Cc: Samuel Holland , u-boot@lists.denx.de, Jagan Teki , Andy Shevchenko , Icenowy Zheng , Jernej Skrabec , Peng Fan , Simon Glass Subject: Re: [PATCH 4/4] mmc: sunxi: Use DM_GPIO flags to set pull-up Message-ID: <20211022113624.40811c6b@donnerap.cambridge.arm.com> In-Reply-To: <4b6862fd-a008-4603-81c3-67148e0d7888@samsung.com> References: <20211021045258.30757-1-samuel@sholland.org> <20211021045258.30757-5-samuel@sholland.org> <8362c608-dbbf-aa74-38df-a2c23e732ed9@samsung.com> <20211022100025.1232eee4@donnerap.cambridge.arm.com> <4b6862fd-a008-4603-81c3-67148e0d7888@samsung.com> Organization: ARM X-Mailer: Claws Mail 3.17.5 (GTK+ 2.24.32; aarch64-unknown-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean On Fri, 22 Oct 2021 19:10:20 +0900 Jaehoon Chung wrote: > Hi Andre, > > On 10/22/21 6:00 PM, Andre Przywara wrote: > > On Fri, 22 Oct 2021 06:58:48 +0900 > > Jaehoon Chung 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 > >>> --- > >>> > >>> 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)? Yes, please, any testing on any kind of Allwinner board is warmly welcomed. There are 160 supported Allwinner boards in the tree, and even though I have probably more of them than I want, it's only a fraction of them. And experience show that some boards are subtly broken. Also feel free to report any other broken things you see when testing! Thanks, Andre > > Best Regards, > Jaehoon Chung > > > > > Cheers, > > Andre > > > >> > >> Best Regards, > >> Jaehoon Chung > >> > >>> > >>> upriv->mmc = &plat->mmc; > >>> > >>> > >> > > > > >