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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id EB814C77B61 for ; Fri, 28 Apr 2023 00:34:15 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 6462585FEF; Fri, 28 Apr 2023 02:33:53 +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 1C3B285E35; Fri, 28 Apr 2023 02:33:46 +0200 (CEST) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by phobos.denx.de (Postfix) with ESMTP id 8D43A860BB for ; Fri, 28 Apr 2023 02:33:42 +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 1A0B32F4; Thu, 27 Apr 2023 17:34:26 -0700 (PDT) Received: from slackpad.lan (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 365083F587; Thu, 27 Apr 2023 17:33:41 -0700 (PDT) Date: Fri, 28 Apr 2023 01:26:59 +0100 From: Andre Przywara To: Samuel Holland Cc: Jagan Teki , Jaehoon Chung , u-boot@lists.denx.de Subject: Re: [PATCH 3/3] gpio: axp/sunxi: Remove virtual VBUS detection GPIO Message-ID: <20230428012659.778e98ba@slackpad.lan> In-Reply-To: <20230122234623.1636-4-samuel@sholland.org> References: <20230122234623.1636-1-samuel@sholland.org> <20230122234623.1636-4-samuel@sholland.org> Organization: Arm Ltd. X-Mailer: Claws Mail 4.1.0 (GTK 3.24.31; x86_64-slackware-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.39 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.8 at phobos.denx.de X-Virus-Status: Clean On Sun, 22 Jan 2023 17:46:22 -0600 Samuel Holland wrote: > Now that this functionality is modeled using the device tree and > regulator uclass, the named GPIO is not referenced anywhere. Remove it. > > Signed-off-by: Samuel Holland There is indeed no config left that would set AXP0-VBUS-DETECT, so this code is indeed no longer needed: Reviewed-by: Andre Przywara Queued for sunxi/master. Cheers, Andre > --- > > arch/arm/include/asm/arch-sunxi/gpio.h | 1 - > drivers/gpio/axp_gpio.c | 21 ++++----------------- > drivers/gpio/sunxi_gpio.c | 6 +----- > include/axp209.h | 1 - > include/axp221.h | 1 - > include/axp809.h | 1 - > include/axp818.h | 1 - > 7 files changed, 5 insertions(+), 27 deletions(-) > > diff --git a/arch/arm/include/asm/arch-sunxi/gpio.h b/arch/arm/include/asm/arch-sunxi/gpio.h > index 437e86479c..6eaeece4e2 100644 > --- a/arch/arm/include/asm/arch-sunxi/gpio.h > +++ b/arch/arm/include/asm/arch-sunxi/gpio.h > @@ -209,7 +209,6 @@ enum sunxi_gpio_number { > > /* Virtual AXP0 GPIOs */ > #define SUNXI_GPIO_AXP0_PREFIX "AXP0-" > -#define SUNXI_GPIO_AXP0_VBUS_DETECT 4 > #define SUNXI_GPIO_AXP0_VBUS_ENABLE 5 > #define SUNXI_GPIO_AXP0_GPIO_COUNT 6 > > diff --git a/drivers/gpio/axp_gpio.c b/drivers/gpio/axp_gpio.c > index 35585dc8ac..49672193ff 100644 > --- a/drivers/gpio/axp_gpio.c > +++ b/drivers/gpio/axp_gpio.c > @@ -36,18 +36,11 @@ static int axp_gpio_direction_input(struct udevice *dev, unsigned pin) > { > u8 reg; > > - switch (pin) { > -#ifndef CONFIG_AXP152_POWER /* NA on axp152 */ > - case SUNXI_GPIO_AXP0_VBUS_DETECT: > - return 0; > -#endif > - default: > - reg = axp_get_gpio_ctrl_reg(pin); > - if (reg == 0) > - return -EINVAL; > + reg = axp_get_gpio_ctrl_reg(pin); > + if (reg == 0) > + return -EINVAL; > > - return pmic_bus_write(reg, AXP_GPIO_CTRL_INPUT); > - } > + return pmic_bus_write(reg, AXP_GPIO_CTRL_INPUT); > } > > static int axp_gpio_direction_output(struct udevice *dev, unsigned pin, > @@ -83,12 +76,6 @@ static int axp_gpio_get_value(struct udevice *dev, unsigned pin) > int ret; > > switch (pin) { > -#ifndef CONFIG_AXP152_POWER /* NA on axp152 */ > - case SUNXI_GPIO_AXP0_VBUS_DETECT: > - ret = pmic_bus_read(AXP_POWER_STATUS, &val); > - mask = AXP_POWER_STATUS_VBUS_PRESENT; > - break; > -#endif > #ifdef AXP_MISC_CTRL_N_VBUSEN_FUNC > /* Only available on later PMICs */ > case SUNXI_GPIO_AXP0_VBUS_ENABLE: > diff --git a/drivers/gpio/sunxi_gpio.c b/drivers/gpio/sunxi_gpio.c > index 1e85db179a..f0b42e4fdb 100644 > --- a/drivers/gpio/sunxi_gpio.c > +++ b/drivers/gpio/sunxi_gpio.c > @@ -117,11 +117,7 @@ int sunxi_name_to_gpio(const char *name) > #if !defined CONFIG_SPL_BUILD && defined CONFIG_AXP_GPIO > char lookup[8]; > > - if (strcasecmp(name, "AXP0-VBUS-DETECT") == 0) { > - sprintf(lookup, SUNXI_GPIO_AXP0_PREFIX "%d", > - SUNXI_GPIO_AXP0_VBUS_DETECT); > - name = lookup; > - } else if (strcasecmp(name, "AXP0-VBUS-ENABLE") == 0) { > + if (strcasecmp(name, "AXP0-VBUS-ENABLE") == 0) { > sprintf(lookup, SUNXI_GPIO_AXP0_PREFIX "%d", > SUNXI_GPIO_AXP0_VBUS_ENABLE); > name = lookup; > diff --git a/include/axp209.h b/include/axp209.h > index 414f88a32c..d8bf44f1fa 100644 > --- a/include/axp209.h > +++ b/include/axp209.h > @@ -77,7 +77,6 @@ enum axp209_reg { > #ifdef CONFIG_AXP209_POWER > #define AXP_POWER_STATUS 0x00 > #define AXP_POWER_STATUS_ALDO_IN BIT(0) > -#define AXP_POWER_STATUS_VBUS_PRESENT BIT(5) > #define AXP_GPIO0_CTRL 0x90 > #define AXP_GPIO1_CTRL 0x92 > #define AXP_GPIO2_CTRL 0x93 > diff --git a/include/axp221.h b/include/axp221.h > index 8dfcc5b5a2..32b988f3a9 100644 > --- a/include/axp221.h > +++ b/include/axp221.h > @@ -53,7 +53,6 @@ > #ifdef CONFIG_AXP221_POWER > #define AXP_POWER_STATUS 0x00 > #define AXP_POWER_STATUS_ALDO_IN BIT(0) > -#define AXP_POWER_STATUS_VBUS_PRESENT BIT(5) > #define AXP_VBUS_IPSOUT 0x30 > #define AXP_VBUS_IPSOUT_DRIVEBUS (1 << 2) > #define AXP_MISC_CTRL 0x8f > diff --git a/include/axp809.h b/include/axp809.h > index 8082e402e2..71a7cb2aaa 100644 > --- a/include/axp809.h > +++ b/include/axp809.h > @@ -47,7 +47,6 @@ > #ifdef CONFIG_AXP809_POWER > #define AXP_POWER_STATUS 0x00 > #define AXP_POWER_STATUS_ALDO_IN BIT(0) > -#define AXP_POWER_STATUS_VBUS_PRESENT BIT(5) > #define AXP_VBUS_IPSOUT 0x30 > #define AXP_VBUS_IPSOUT_DRIVEBUS (1 << 2) > #define AXP_MISC_CTRL 0x8f > diff --git a/include/axp818.h b/include/axp818.h > index 8ac517a2bf..08ac35d15f 100644 > --- a/include/axp818.h > +++ b/include/axp818.h > @@ -61,7 +61,6 @@ > #ifdef CONFIG_AXP818_POWER > #define AXP_POWER_STATUS 0x00 > #define AXP_POWER_STATUS_ALDO_IN BIT(0) > -#define AXP_POWER_STATUS_VBUS_PRESENT BIT(5) > #define AXP_VBUS_IPSOUT 0x30 > #define AXP_VBUS_IPSOUT_DRIVEBUS (1 << 2) > #define AXP_MISC_CTRL 0x8f