summaryrefslogtreecommitdiff
path: root/drivers/usb/host/fhci-hub.c
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2022-08-31 11:29:32 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-09-01 17:08:29 +0300
commita4efdb8a423b4fa3671418bd3755ae79fbdedab0 (patch)
tree54212691c57e8ba8a642a6e80dc8d18bd87d43d2 /drivers/usb/host/fhci-hub.c
parent10174220f55ac2c9ea7bdf2dcebe422d24024aec (diff)
downloadlinux-a4efdb8a423b4fa3671418bd3755ae79fbdedab0.tar.xz
USB: FHCI: Switch to GPIO descriptors
This driver for the PPC Freescale SoC is using device tree accessors and imperative GPIO semantics control using the old GPIO API, switch it over to use GPIO descriptors. Cc: Li Yang <leoyang.li@nxp.com> Cc: linuxppc-dev@lists.ozlabs.org Cc: Zhao Qiang <qiang.zhao@freescale.com> Cc: Guilherme Maciel Ferreira <guilherme.maciel.ferreira@gmail.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20220831082932.488724-1-linus.walleij@linaro.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/host/fhci-hub.c')
-rw-r--r--drivers/usb/host/fhci-hub.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/drivers/usb/host/fhci-hub.c b/drivers/usb/host/fhci-hub.c
index c359dcdb9b13..5f48660ebdfa 100644
--- a/drivers/usb/host/fhci-hub.c
+++ b/drivers/usb/host/fhci-hub.c
@@ -19,7 +19,7 @@
#include <linux/io.h>
#include <linux/usb.h>
#include <linux/usb/hcd.h>
-#include <linux/gpio.h>
+#include <linux/gpio/consumer.h>
#include <soc/fsl/qe/qe.h>
#include "fhci.h"
@@ -38,13 +38,12 @@ static u8 root_hub_des[] = {
static void fhci_gpio_set_value(struct fhci_hcd *fhci, int gpio_nr, bool on)
{
- int gpio = fhci->gpios[gpio_nr];
- bool alow = fhci->alow_gpios[gpio_nr];
+ struct gpio_desc *gpiod = fhci->gpiods[gpio_nr];
- if (!gpio_is_valid(gpio))
+ if (!gpiod)
return;
- gpio_set_value(gpio, on ^ alow);
+ gpiod_set_value(gpiod, on);
mdelay(5);
}
@@ -129,9 +128,9 @@ void fhci_io_port_generate_reset(struct fhci_hcd *fhci)
{
fhci_dbg(fhci, "-> %s\n", __func__);
- gpio_direction_output(fhci->gpios[GPIO_USBOE], 0);
- gpio_direction_output(fhci->gpios[GPIO_USBTP], 0);
- gpio_direction_output(fhci->gpios[GPIO_USBTN], 0);
+ gpiod_direction_output(fhci->gpiods[GPIO_USBOE], 0);
+ gpiod_direction_output(fhci->gpiods[GPIO_USBTP], 0);
+ gpiod_direction_output(fhci->gpiods[GPIO_USBTN], 0);
mdelay(5);