* [PATCH 1/2] ARM: dts: exynos: fix polarity of VBUS GPIO
@ 2022-09-27 22:05 Dmitry Torokhov
2022-09-27 22:05 ` [PATCH 2/2] usb: host: ehci-exynos: switch to using gpiod API Dmitry Torokhov
2022-09-30 12:25 ` (subset) [PATCH 1/2] ARM: dts: exynos: fix polarity of VBUS GPIO Krzysztof Kozlowski
0 siblings, 2 replies; 6+ messages in thread
From: Dmitry Torokhov @ 2022-09-27 22:05 UTC (permalink / raw)
To: Krzysztof Kozlowski, Alim Akhtar, Greg Kroah-Hartman
Cc: Alan Stern, linux-usb, linux-arm-kernel, linux-samsung-soc, linux-kernel
EHCI Oxynos (drivers/usb/host/ehci-exynos.c) drives VBUS GPIO high when
trying to power up the bus, therefore the GPIO in DTS must be marked as
"active high". This will be important when EHCI driver is converted to
gpiod API that respects declared polarities.
Fixes: 4e8991def565 ("ARM: dts: exynos: Enable AX88760 USB hub on Origen board")
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
arch/arm/boot/dts/exynos4412-origen.dts | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/boot/dts/exynos4412-origen.dts b/arch/arm/boot/dts/exynos4412-origen.dts
index 6db09dba07ff..a3905e27b9cd 100644
--- a/arch/arm/boot/dts/exynos4412-origen.dts
+++ b/arch/arm/boot/dts/exynos4412-origen.dts
@@ -95,7 +95,7 @@ &exynos_usbphy {
};
&ehci {
- samsung,vbus-gpio = <&gpx3 5 1>;
+ samsung,vbus-gpio = <&gpx3 5 GPIO_ACTIVE_HIGH>;
status = "okay";
phys = <&exynos_usbphy 2>, <&exynos_usbphy 3>;
phy-names = "hsic0", "hsic1";
--
2.38.0.rc1.362.ged0d419d3c-goog
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/2] usb: host: ehci-exynos: switch to using gpiod API
2022-09-27 22:05 [PATCH 1/2] ARM: dts: exynos: fix polarity of VBUS GPIO Dmitry Torokhov
@ 2022-09-27 22:05 ` Dmitry Torokhov
2022-09-28 6:55 ` Krzysztof Kozlowski
2022-09-28 15:15 ` Alan Stern
2022-09-30 12:25 ` (subset) [PATCH 1/2] ARM: dts: exynos: fix polarity of VBUS GPIO Krzysztof Kozlowski
1 sibling, 2 replies; 6+ messages in thread
From: Dmitry Torokhov @ 2022-09-27 22:05 UTC (permalink / raw)
To: Krzysztof Kozlowski, Alim Akhtar, Greg Kroah-Hartman
Cc: Alan Stern, linux-usb, linux-arm-kernel, linux-samsung-soc, linux-kernel
This patch switches the driver from using legacy gpio API to the newer
gpiod API.
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
drivers/usb/host/ehci-exynos.c | 17 +++++------------
1 file changed, 5 insertions(+), 12 deletions(-)
diff --git a/drivers/usb/host/ehci-exynos.c b/drivers/usb/host/ehci-exynos.c
index c8e152c2e0ce..a333231616f4 100644
--- a/drivers/usb/host/ehci-exynos.c
+++ b/drivers/usb/host/ehci-exynos.c
@@ -13,7 +13,7 @@
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/of.h>
-#include <linux/of_gpio.h>
+#include <linux/gpio/consumer.h>
#include <linux/phy/phy.h>
#include <linux/platform_device.h>
#include <linux/usb.h>
@@ -131,20 +131,13 @@ static void exynos_ehci_phy_disable(struct device *dev)
static void exynos_setup_vbus_gpio(struct device *dev)
{
+ struct gpio_desc *gpio;
int err;
- int gpio;
- if (!dev->of_node)
- return;
-
- gpio = of_get_named_gpio(dev->of_node, "samsung,vbus-gpio", 0);
- if (!gpio_is_valid(gpio))
- return;
-
- err = devm_gpio_request_one(dev, gpio, GPIOF_OUT_INIT_HIGH,
- "ehci_vbus_gpio");
+ gpio = devm_gpiod_get_optional(dev, "samsung,vbus", GPIOD_OUT_HIGH);
+ err = PTR_ERR_OR_ZERO(gpio);
if (err)
- dev_err(dev, "can't request ehci vbus gpio %d", gpio);
+ dev_err(dev, "can't request ehci vbus gpio: %d\n", err);
}
static int exynos_ehci_probe(struct platform_device *pdev)
--
2.38.0.rc1.362.ged0d419d3c-goog
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 2/2] usb: host: ehci-exynos: switch to using gpiod API
2022-09-27 22:05 ` [PATCH 2/2] usb: host: ehci-exynos: switch to using gpiod API Dmitry Torokhov
@ 2022-09-28 6:55 ` Krzysztof Kozlowski
2022-09-30 11:52 ` Greg Kroah-Hartman
2022-09-28 15:15 ` Alan Stern
1 sibling, 1 reply; 6+ messages in thread
From: Krzysztof Kozlowski @ 2022-09-28 6:55 UTC (permalink / raw)
To: Dmitry Torokhov, Alim Akhtar, Greg Kroah-Hartman
Cc: Alan Stern, linux-usb, linux-arm-kernel, linux-samsung-soc, linux-kernel
On 28/09/2022 00:05, Dmitry Torokhov wrote:
> This patch switches the driver from using legacy gpio API to the newer
> gpiod API.
>
> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> ---
Greg,
I'll take the DTS change via Samsung SoC tree.
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 2/2] usb: host: ehci-exynos: switch to using gpiod API
2022-09-27 22:05 ` [PATCH 2/2] usb: host: ehci-exynos: switch to using gpiod API Dmitry Torokhov
2022-09-28 6:55 ` Krzysztof Kozlowski
@ 2022-09-28 15:15 ` Alan Stern
1 sibling, 0 replies; 6+ messages in thread
From: Alan Stern @ 2022-09-28 15:15 UTC (permalink / raw)
To: Dmitry Torokhov
Cc: Krzysztof Kozlowski, Alim Akhtar, Greg Kroah-Hartman, linux-usb,
linux-arm-kernel, linux-samsung-soc, linux-kernel
On Tue, Sep 27, 2022 at 03:05:04PM -0700, Dmitry Torokhov wrote:
> This patch switches the driver from using legacy gpio API to the newer
> gpiod API.
>
> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> ---
Acked-by: Alan Stern <stern@rowland.harvard.edu>
> drivers/usb/host/ehci-exynos.c | 17 +++++------------
> 1 file changed, 5 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/usb/host/ehci-exynos.c b/drivers/usb/host/ehci-exynos.c
> index c8e152c2e0ce..a333231616f4 100644
> --- a/drivers/usb/host/ehci-exynos.c
> +++ b/drivers/usb/host/ehci-exynos.c
> @@ -13,7 +13,7 @@
> #include <linux/kernel.h>
> #include <linux/module.h>
> #include <linux/of.h>
> -#include <linux/of_gpio.h>
> +#include <linux/gpio/consumer.h>
> #include <linux/phy/phy.h>
> #include <linux/platform_device.h>
> #include <linux/usb.h>
> @@ -131,20 +131,13 @@ static void exynos_ehci_phy_disable(struct device *dev)
>
> static void exynos_setup_vbus_gpio(struct device *dev)
> {
> + struct gpio_desc *gpio;
> int err;
> - int gpio;
>
> - if (!dev->of_node)
> - return;
> -
> - gpio = of_get_named_gpio(dev->of_node, "samsung,vbus-gpio", 0);
> - if (!gpio_is_valid(gpio))
> - return;
> -
> - err = devm_gpio_request_one(dev, gpio, GPIOF_OUT_INIT_HIGH,
> - "ehci_vbus_gpio");
> + gpio = devm_gpiod_get_optional(dev, "samsung,vbus", GPIOD_OUT_HIGH);
> + err = PTR_ERR_OR_ZERO(gpio);
> if (err)
> - dev_err(dev, "can't request ehci vbus gpio %d", gpio);
> + dev_err(dev, "can't request ehci vbus gpio: %d\n", err);
> }
>
> static int exynos_ehci_probe(struct platform_device *pdev)
> --
> 2.38.0.rc1.362.ged0d419d3c-goog
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 2/2] usb: host: ehci-exynos: switch to using gpiod API
2022-09-28 6:55 ` Krzysztof Kozlowski
@ 2022-09-30 11:52 ` Greg Kroah-Hartman
0 siblings, 0 replies; 6+ messages in thread
From: Greg Kroah-Hartman @ 2022-09-30 11:52 UTC (permalink / raw)
To: Krzysztof Kozlowski
Cc: Dmitry Torokhov, Alim Akhtar, Alan Stern, linux-usb,
linux-arm-kernel, linux-samsung-soc, linux-kernel
On Wed, Sep 28, 2022 at 08:55:53AM +0200, Krzysztof Kozlowski wrote:
> On 28/09/2022 00:05, Dmitry Torokhov wrote:
> > This patch switches the driver from using legacy gpio API to the newer
> > gpiod API.
> >
> > Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> > ---
>
> Greg,
> I'll take the DTS change via Samsung SoC tree.
>
> Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Ok, thanks!
greg k-h
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: (subset) [PATCH 1/2] ARM: dts: exynos: fix polarity of VBUS GPIO
2022-09-27 22:05 [PATCH 1/2] ARM: dts: exynos: fix polarity of VBUS GPIO Dmitry Torokhov
2022-09-27 22:05 ` [PATCH 2/2] usb: host: ehci-exynos: switch to using gpiod API Dmitry Torokhov
@ 2022-09-30 12:25 ` Krzysztof Kozlowski
1 sibling, 0 replies; 6+ messages in thread
From: Krzysztof Kozlowski @ 2022-09-30 12:25 UTC (permalink / raw)
To: Alim Akhtar, Dmitry Torokhov, Greg Kroah-Hartman
Cc: Krzysztof Kozlowski, linux-usb, linux-kernel, linux-samsung-soc,
linux-arm-kernel, Alan Stern
On Tue, 27 Sep 2022 15:05:03 -0700, Dmitry Torokhov wrote:
> EHCI Oxynos (drivers/usb/host/ehci-exynos.c) drives VBUS GPIO high when
> trying to power up the bus, therefore the GPIO in DTS must be marked as
> "active high". This will be important when EHCI driver is converted to
> gpiod API that respects declared polarities.
>
>
Applied, thanks!
[1/2] ARM: dts: exynos: fix polarity of VBUS GPIO
https://git.kernel.org/krzk/linux/c/a08137bd1e0a7ce951dce9ce4a83e39d379b6e1b
Best regards,
--
Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2022-09-30 12:25 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-27 22:05 [PATCH 1/2] ARM: dts: exynos: fix polarity of VBUS GPIO Dmitry Torokhov
2022-09-27 22:05 ` [PATCH 2/2] usb: host: ehci-exynos: switch to using gpiod API Dmitry Torokhov
2022-09-28 6:55 ` Krzysztof Kozlowski
2022-09-30 11:52 ` Greg Kroah-Hartman
2022-09-28 15:15 ` Alan Stern
2022-09-30 12:25 ` (subset) [PATCH 1/2] ARM: dts: exynos: fix polarity of VBUS GPIO Krzysztof Kozlowski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).