usb: ohci-omap: Fix descriptor conversion
authorLinus Walleij <linus.walleij@linaro.org>
Mon, 30 Nov 2020 08:30:33 +0000 (09:30 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 4 Dec 2020 15:03:52 +0000 (16:03 +0100)
There were a bunch of issues with the patch converting the
OMAP1 OSK board to use descriptors for controlling the USB
host:

- The chip label was incorrect
- The GPIO offset was off-by-one
- The code should use sleeping accessors

This patch tries to fix all issues at the same time.

Cc: Aaro Koskinen <aaro.koskinen@iki.fi>
Reported-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Fixes: 15d157e87443 ("usb: ohci-omap: Convert to use GPIO descriptors")
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20201130083033.29435-1-linus.walleij@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/arm/mach-omap1/board-osk.c
drivers/usb/host/ohci-omap.c

index 144b9caa935c42053cb030ff3eb5cb77284873eb..a720259099edfb4bd5c226b104a761dae341dfca 100644 (file)
@@ -288,7 +288,7 @@ static struct gpiod_lookup_table osk_usb_gpio_table = {
        .dev_id = "ohci",
        .table = {
                /* Power GPIO on the I2C-attached TPS65010 */
-               GPIO_LOOKUP("i2c-tps65010", 1, "power", GPIO_ACTIVE_HIGH),
+               GPIO_LOOKUP("tps65010", 0, "power", GPIO_ACTIVE_HIGH),
                GPIO_LOOKUP(OMAP_GPIO_LABEL, 9, "overcurrent",
                            GPIO_ACTIVE_HIGH),
        },
index 9ccdf2c216b513f7af5fc34c688dfeed88e17f51..6374501ba1390d16e496ead39cb7274a60cc2bf2 100644 (file)
@@ -91,14 +91,14 @@ static int omap_ohci_transceiver_power(struct ohci_omap_priv *priv, int on)
                                | ((1 << 5/*usb1*/) | (1 << 3/*usb2*/)),
                               INNOVATOR_FPGA_CAM_USB_CONTROL);
                else if (priv->power)
-                       gpiod_set_value(priv->power, 0);
+                       gpiod_set_value_cansleep(priv->power, 0);
        } else {
                if (machine_is_omap_innovator() && cpu_is_omap1510())
                        __raw_writeb(__raw_readb(INNOVATOR_FPGA_CAM_USB_CONTROL)
                                & ~((1 << 5/*usb1*/) | (1 << 3/*usb2*/)),
                               INNOVATOR_FPGA_CAM_USB_CONTROL);
                else if (priv->power)
-                       gpiod_set_value(priv->power, 1);
+                       gpiod_set_value_cansleep(priv->power, 1);
        }
 
        return 0;