[Ce-android-mainline] timed gpio and timed output drivers
NeilBrown
neilb at suse.de
Wed Feb 29 22:02:43 UTC 2012
On Wed, 29 Feb 2012 13:34:03 -0700 Shuah Khan <shuahkhan at gmail.com> wrote:
> On Mon, Feb 27, 2012 at 4:43 PM, NeilBrown <neilb at suse.de> wrote:
> > On Mon, 27 Feb 2012 13:51:07 -0800 Colin Cross <ccross at android.com> wrote:
> >
> >> On Mon, Feb 27, 2012 at 7:26 AM, Shuah Khan <shuahkhan at gmail.com> wrote:
> >> > I saw a timed_gpio patch come through on lkml. Looks like this driver
> >> > is being used and patched. Could somebody from Andorid team comment
> >> > on the need for a special driver instead of using leds.
> >>
> >> It has been used in the past for vibrator control. The main feature
> >> it provides vs. leds is one shot timed enables, which prevents a
> >> userspace crash from leaving the vibrator on, which would kill the
> >> battery very quickly. Plus, putting the vibrator in /sys/class/leds
> >> is counterintuitive.
> >
> > Adding a one-shot trigger to 'leds' would probably be welcome and would make
> > leds completely usable.
> >
> > The 'counter-intuitive' aspect is unfortunate. With hind-sight, 'leds'
> > probably wasn't the best name. It might be possible to create a more generic
> > name while using the same code???
>
> >From what I heard so far, timed-gpio provides a missing feature and
> still useful on devices that don't connect vibrator to PWM pins.
leds drivers can be used on devices that don't connect to PWM pins.
There is a leds-gpio driver that can drive any device connected to a
GPIO.
> Enhancing leds to support one-shot trigger and/or creating more
> generic name sound outside the scope of the current work at hand.
Adding a one shot trigger, while nice, it not actually needed.
cd /sys/class/leds/WHATEVER
echo timer > trigger
echo 2147483648 > delay_off
echo 100 > delay_on
will give you a 100ms plus in the relevant GPIO. You then have 3 weeks to
clear the trigger so you don't get another one - not too hard (cron job
maybe).
>
> Hence, I am proposing going ahead with integrating timed-goio and
> timed-output drivers under drivers/gpio.
So the choice is between:
A/ small enhancement to a current interface to make it useful for you,
and more useful for others, or
B/ current interface isn't quite perfect, so create a completely new one,
and you choose B!!!!!
I think this is known as "the platform problem". You should read up on that.
NeilBrown
>
> Colin! Do you mind sharing any test suites you might have for this driver.
>
> Thanks,
> -- Shuah
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 828 bytes
Desc: not available
URL: <http://lists.linuxfoundation.org/pipermail/ce-android-mainline/attachments/20120301/79540be6/attachment.sig>
More information about the Ce-android-mainline
mailing list