usb: host: max3421-hcd: fix mask of IO control register
authorJaewon Kim <jaewon02.kim@gmail.com>
Thu, 21 Jul 2016 13:20:53 +0000 (22:20 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 9 Aug 2016 14:14:18 +0000 (16:14 +0200)
GPIO control register is divided into IOPINS1 and IOPINS2.
And low 4-bit of register is controls output.

So, this patch fixes wrong mask of GPIO output.

Signed-off-by: Jaewon Kim <jaewon02.kim@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/max3421-hcd.c

index c369c29e496d735e77f3be32226c479e6871e846..2f7690092a7ffb6e67ca893d9d491f48da6be8d3 100644 (file)
@@ -1675,7 +1675,7 @@ max3421_gpout_set_value(struct usb_hcd *hcd, u8 pin_number, u8 value)
        if (pin_number > 7)
                return;
 
-       mask = 1u << pin_number;
+       mask = 1u << (pin_number % 4);
        idx = pin_number / 4;
 
        if (value)