ARM: dts: exynos: fix polarity of VBUS GPIO
Subsystems (4)
PATCH 1/2 ARM: dts: exynos: fix polarity of VBUS GPIO
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.
--- arch/arm/boot/dts/exynos4412-origen.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/exynos4412-origen.dts +1 -1
@@ -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";
Signature · 1 line
2.38.0.rc1.362.ged0d419d3c-goog
PATCH 2/2 usb: host: ehci-exynos: switch to using gpiod API
This patch switches the driver from using legacy gpio API to the newer gpiod API.
--- drivers/usb/host/ehci-exynos.c | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-)
drivers/usb/host/ehci-exynos.c +5 -12
@@ -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)
Signature · 1 line
2.38.0.rc1.362.ged0d419d3c-goog
Re: [PATCH 2/2] usb: host: ehci-exynos: switch to using gpiod API
Quoted 5 lines · Dmitry Torokhov
This patch switches the driver from using legacy gpio API to the newer gpiod API.
Signed-off-by Dmitry Torokhov <[email protected]>---
Greg,
I'll take the DTS change via Samsung SoC tree.
Best regards,
Krzysztof
Greg Kroah-Hartman
maintainerRe: [PATCH 2/2] usb: host: ehci-exynos: switch to using gpiod API
Quoted 11 lines · Krzysztof Kozlowski
Quoted 5 lines · Dmitry Torokhov
This patch switches the driver from using legacy gpio API to the newer gpiod API.
Signed-off-by Dmitry Torokhov <[email protected]>---
Greg,
I'll take the DTS change via Samsung SoC tree.
Ok, thanks!
greg k-h
Re: [PATCH 2/2] usb: host: ehci-exynos: switch to using gpiod API
In reply to Dmitry TorokhovQuoted 5 lines · Dmitry Torokhov
This patch switches the driver from using legacy gpio API to the newer gpiod API.
Signed-off-by Dmitry Torokhov <[email protected]>---
Quoted 44 lines
drivers/usb/host/ehci-exynos.c | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-)drivers/usb/host/ehci-exynos.c +5
-12@@ -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)Signature · 1 line
2.38.0.rc1.362.ged0d419d3c-goog
Krzysztof Kozlowski
AppliedRe: (subset) [PATCH 1/2] ARM: dts: exynos: fix polarity of VBUS GPIO
In reply to Dmitry TorokhovQuoted 6 lines · Dmitry Torokhov
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,
Signature · 1 line
Krzysztof Kozlowski <[email protected]>