Message ID | 529DDCE3.5020902@ti.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Tue, Dec 3, 2013 at 2:30 PM, Roger Quadros <rogerq@ti.com> wrote: (...) > This patch causes a regression with LED outputs (GPO) on twl4030 on 3.13-rc2. > As one of the LED GPO is used for USB host on beagleboard, it will cause failure > of USB host probe. (...) > Below is a proposed fix for this. Roger, Tony: what happened with this? Have you hashed this out? I ACK Roger's fixup too if that needs to be merged into the OMAP tree. Yours, Linus Walleij
* Linus Walleij <linus.walleij@linaro.org> [131209 05:10]: > On Tue, Dec 3, 2013 at 2:30 PM, Roger Quadros <rogerq@ti.com> wrote: > > (...) > > This patch causes a regression with LED outputs (GPO) on twl4030 on 3.13-rc2. > > As one of the LED GPO is used for USB host on beagleboard, it will cause failure > > of USB host probe. > (...) > > Below is a proposed fix for this. > > Roger, Tony: what happened with this? Have you hashed this out? > I ACK Roger's fixup too if that needs to be merged into the OMAP > tree. There's an updated version from Roger posted that I acked: [PATCH v2 1/1] gpio: twl4030: Fix regression for twl gpio LED output http://lkml.org/lkml/2013/12/5/65 I also commented on the dependencies there, but basically you can pick it up unless you want me to. Should be cc stable as well. Regards, Tony
On Mon, Dec 9, 2013 at 6:10 PM, Tony Lindgren <tony@atomide.com> wrote: > * Linus Walleij <linus.walleij@linaro.org> [131209 05:10]: >> On Tue, Dec 3, 2013 at 2:30 PM, Roger Quadros <rogerq@ti.com> wrote: >> >> (...) >> > This patch causes a regression with LED outputs (GPO) on twl4030 on 3.13-rc2. >> > As one of the LED GPO is used for USB host on beagleboard, it will cause failure >> > of USB host probe. >> (...) >> > Below is a proposed fix for this. >> >> Roger, Tony: what happened with this? Have you hashed this out? >> I ACK Roger's fixup too if that needs to be merged into the OMAP >> tree. > > There's an updated version from Roger posted that I acked: > > [PATCH v2 1/1] gpio: twl4030: Fix regression for twl gpio LED output > > http://lkml.org/lkml/2013/12/5/65 > > I also commented on the dependencies there, but basically you can > pick it up unless you want me to. Should be cc stable as well. OK I have picked this now, I'll add a CC to stable. Yours, Linus Walleij
* Linus Walleij <linus.walleij@linaro.org> [131210 04:18]: > On Mon, Dec 9, 2013 at 6:10 PM, Tony Lindgren <tony@atomide.com> wrote: > > * Linus Walleij <linus.walleij@linaro.org> [131209 05:10]: > >> On Tue, Dec 3, 2013 at 2:30 PM, Roger Quadros <rogerq@ti.com> wrote: > >> > >> (...) > >> > This patch causes a regression with LED outputs (GPO) on twl4030 on 3.13-rc2. > >> > As one of the LED GPO is used for USB host on beagleboard, it will cause failure > >> > of USB host probe. > >> (...) > >> > Below is a proposed fix for this. > >> > >> Roger, Tony: what happened with this? Have you hashed this out? > >> I ACK Roger's fixup too if that needs to be merged into the OMAP > >> tree. > > > > There's an updated version from Roger posted that I acked: > > > > [PATCH v2 1/1] gpio: twl4030: Fix regression for twl gpio LED output > > > > http://lkml.org/lkml/2013/12/5/65 > > > > I also commented on the dependencies there, but basically you can > > pick it up unless you want me to. Should be cc stable as well. > > OK I have picked this now, I'll add a CC to stable. Thanks! Tony
diff --git a/drivers/gpio/gpio-twl4030.c b/drivers/gpio/gpio-twl4030.c index b97d6a6..0999ed1 100644 --- a/drivers/gpio/gpio-twl4030.c +++ b/drivers/gpio/gpio-twl4030.c @@ -294,13 +294,13 @@ out: static int twl_direction_in(struct gpio_chip *chip, unsigned offset) { struct gpio_twl4030_priv *priv = to_gpio_twl4030(chip); - int ret; + int ret = 0; mutex_lock(&priv->mutex); if (offset < TWL4030_GPIO_MAX) - ret = twl4030_set_gpio_direction(offset, 1); + twl4030_set_gpio_direction(offset, 1); else - ret = -EINVAL; + ret = -EINVAL; /* LED outputs can't be set as input */ if (!ret) priv->direction &= ~BIT(offset); @@ -354,18 +354,21 @@ static void twl_set(struct gpio_chip *chip, unsigned offset, int value) static int twl_direction_out(struct gpio_chip *chip, unsigned offset, int value) { struct gpio_twl4030_priv *priv = to_gpio_twl4030(chip); - int ret = -EINVAL; mutex_lock(&priv->mutex); if (offset < TWL4030_GPIO_MAX) - ret = twl4030_set_gpio_direction(offset, 0); + twl4030_set_gpio_direction(offset, 0); + + /* + * LED gpio's i.e. offset >= TWL4030_GPIO_MAX are always output + */ priv->direction |= BIT(offset); mutex_unlock(&priv->mutex); twl_set(chip, offset, value); - return ret; + return 0; } static int twl_to_irq(struct gpio_chip *chip, unsigned offset)