Date: Mon, 7 Sep 2015 19:37:26 -0300 From: Luiz Otavio O Souza <loos.br@gmail.com> To: Ian Lepore <ian@freebsd.org> Cc: Luiz Otavio O Souza <loos@freebsd.org>, src-committers <src-committers@freebsd.org>, svn-src-all <svn-src-all@freebsd.org>, svn-src-head <svn-src-head@freebsd.org> Subject: Re: svn commit: r287542 - head/sys/dev/rccgpio Message-ID: <CAJ8CS7rp4N93WAW1tWbExFs0Dai9OMhzdj2yzCJzsoVA8NOwQQ@mail.gmail.com> In-Reply-To: <1441664320.68284.76.camel@freebsd.org> References: <201509072159.t87LxBsw097287@repo.freebsd.org> <1441664320.68284.76.camel@freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Sep 7, 2015 at 7:18 PM, Ian Lepore wrote: > On Mon, 2015-09-07 at 21:59 +0000, Luiz Otavio O Souza wrote: >> Author: loos >> Date: Mon Sep 7 21:59:11 2015 >> New Revision: 287542 >> URL: https://svnweb.freebsd.org/changeset/base/287542 >> >> Log: >> Fix off-by-one bugs. >> >> While here, only set the GPIO pin state for output pins. >> > > It's not a good idea to forbid setting output state on an input pin, > because it's a technique that's often used to preset the drive state of > a pin before changing it to be an output pin. That way a pin that > powers on to a default state of input-pulled-high can be set to drive > high before making it output, and you avoid any transitions on the pin > (which might be important if the pin is connected to, say, the > power-control input of a PMIC). > > Most hardware allows setting the output-state register bits for a pin > even if the pin is currently assigned as input. I guess if the hardware > has no way to do that, then returning EINVAL might make sense. > > -- Ian This driver is 'special', it only give access to 4 user LEDs and a reset switch. All the pins are locked in they intended setting (one input and four outputs)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAJ8CS7rp4N93WAW1tWbExFs0Dai9OMhzdj2yzCJzsoVA8NOwQQ>