lkml.org 
[lkml]   [2012]   [Sep]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[ 258/262] gpio-lpc32xx: Fix value handling of gpio_direction_output()
    Date
    From: Greg KH <gregkh@linuxfoundation.org>

    3.5-stable review patch. If anyone has any objections, please let me know.

    ------------------

    From: Roland Stigge <stigge@antcom.de>

    commit b1268d3737c6316016026245eef276eda6b0a621 upstream.

    For GPIOs of gpio-lpc32xx, gpio_direction_output() ignores the value argument
    (initial value of output). This patch fixes this by setting the level
    accordingly.

    Signed-off-by: Roland Stigge <stigge@antcom.de>
    Acked-by: Alexandre Pereira da Silva <aletes.xgr@gmail.com>
    Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

    ---
    drivers/gpio/gpio-lpc32xx.c | 5 +++++
    1 file changed, 5 insertions(+)

    --- a/drivers/gpio/gpio-lpc32xx.c
    +++ b/drivers/gpio/gpio-lpc32xx.c
    @@ -307,6 +307,7 @@ static int lpc32xx_gpio_dir_output_p012(
    {
    struct lpc32xx_gpio_chip *group = to_lpc32xx_gpio(chip);

    + __set_gpio_level_p012(group, pin, value);
    __set_gpio_dir_p012(group, pin, 0);

    return 0;
    @@ -317,6 +318,7 @@ static int lpc32xx_gpio_dir_output_p3(st
    {
    struct lpc32xx_gpio_chip *group = to_lpc32xx_gpio(chip);

    + __set_gpio_level_p3(group, pin, value);
    __set_gpio_dir_p3(group, pin, 0);

    return 0;
    @@ -325,6 +327,9 @@ static int lpc32xx_gpio_dir_output_p3(st
    static int lpc32xx_gpio_dir_out_always(struct gpio_chip *chip, unsigned pin,
    int value)
    {
    + struct lpc32xx_gpio_chip *group = to_lpc32xx_gpio(chip);
    +
    + __set_gpo_level_p3(group, pin, value);
    return 0;
    }




    \
     
     \ /
      Last update: 2012-09-28 22:01    [W:6.967 / U:0.016 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site