Skip to content

Commit

Permalink
pinctrl-bcm2835: bcm2835_gpio_direction_output must set the value
Browse files Browse the repository at this point in the history
  • Loading branch information
Phil Elwell committed Feb 4, 2015
1 parent bac69e3 commit c288c0e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion drivers/pinctrl/pinctrl-bcm2835.c
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,14 @@ static int bcm2835_gpio_get(struct gpio_chip *chip, unsigned offset)
static int bcm2835_gpio_direction_output(struct gpio_chip *chip,
unsigned offset, int value)
{
return pinctrl_gpio_direction_output(chip->base + offset);
struct bcm2835_pinctrl *pc = dev_get_drvdata(chip->dev);
int ret;

ret = pinctrl_gpio_direction_output(chip->base + offset);
if (ret >= 0)
bcm2835_gpio_set_bit(pc, value ? GPSET0 : GPCLR0, offset);

return ret;
}

static void bcm2835_gpio_set(struct gpio_chip *chip, unsigned offset, int value)
Expand Down

4 comments on commit c288c0e

@notro
Copy link
Contributor

@notro notro commented on c288c0e Feb 4, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @pelwell , I used a workaround for this in an Intel 8080 bus driver that I started to work on (was put on hold when FBTFT entered staging).

Please send it upstream as well.

@pelwell
Copy link
Contributor

@pelwell pelwell commented on c288c0e Feb 4, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you have any hints on how to go about that?

@notro
Copy link
Contributor

@notro notro commented on c288c0e Feb 4, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have e-mail set up on my Linux machine, so I had to set my smtp server like this:

git config --global sendemail.smtpserver smtp.ebnett.no

I also had to change user.name to my full name, because I used 'notro' before and it messed up an email header (I don't remember exactly how).

You need to expand a bit on that commit message. A heading and description is required:
Maybe something like this:

pinctrl: bcm2835: set value in bcm2835_gpio_direction_output

Fix bcm2835_gpio_direction_output() to also set the output value.

Signed-off-by: Phil Elwell <phil@raspberrypi.org>

Then I prepared the last commit I had made:

git format-patch -1

You can use '-o' to put the patches somewhere else.

Who should receive it:

$ ./scripts/get_maintainer.pl < somepatch.patch

# I don't have the patch so instead:
$ ./scripts/get_maintainer.pl -f drivers/pinctrl/pinctrl-bcm2835.c
Linus Walleij <linus.walleij@linaro.org> (maintainer:PIN CONTROL SUBSY...)
Stephen Warren <swarren@wwwdotorg.org> (maintainer:BROADCOM BCM2835...)
Lee Jones <lee@kernel.org> (maintainer:BROADCOM BCM2835...)
Grant Likely <grant.likely@linaro.org> (maintainer:OPEN FIRMWARE AND...)
Rob Herring <robh+dt@kernel.org> (maintainer:OPEN FIRMWARE AND...)
linux-gpio@vger.kernel.org (open list:PIN CONTROL SUBSY...)
linux-rpi-kernel@lists.infradead.org (moderated list:BROADCOM BCM2835...)
linux-kernel@vger.kernel.org (open list)
devicetree@vger.kernel.org (open list:OPEN FIRMWARE AND...)

From this I would send it to:
To: linus.walleij@linaro.org
Cc: swarren@wwwdotorg.org
Cc: lee@kernel.org
Cc: linux-gpio@vger.kernel.org
Cc: linux-rpi-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org

Then finally send the patch:

git send-email --to ... -cc ... -cc ... somepatch.patch

Try sending it to yourself first to make sure everything is fine.

I've only sent 3 patches myself, so this is surely only a hint :-)

Refs:
http://kernelnewbies.org/PatchPhilosophy
https://burzalodowa.wordpress.com/2013/10/05/how-to-send-patches-with-git-send-email/
https://www.kernel.org/doc/Documentation/SubmittingPatches

@pelwell
Copy link
Contributor

@pelwell pelwell commented on c288c0e Feb 4, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Brilliant. Thanks - I'll see how I get on.

Please sign in to comment.