All of lore.kernel.org
 help / color / mirror / Atom feed
From: jonsmirl@gmail.com (jonsmirl at gmail.com)
To: linux-arm-kernel@lists.infradead.org
Subject: device-tree vs gpio-leds gpio_blink_set
Date: Tue, 24 Apr 2012 08:39:07 -0400	[thread overview]
Message-ID: <CAKON4Oxa=h4DZapaOSX6=2soBDf1NMQhbkRdbzFcaim=a1T-ZQ@mail.gmail.com> (raw)
In-Reply-To: <CACRpkdZ4RSiqrHU60auvCx9xxZp5CQQzjis+Xz6EVMA+7-8_eg@mail.gmail.com>

On Tue, Apr 24, 2012 at 8:24 AM, Linus Walleij <linus.walleij@linaro.org> wrote:
> On Mon, Apr 23, 2012 at 7:49 PM, Mark Brown
> <broonie@opensource.wolfsonmicro.com> wrote:
>> On Mon, Apr 23, 2012 at 11:22:43AM +0000, Arnd Bergmann wrote:
>>> On Monday 23 April 2012, Arnaud Patard wrote:
>>
>>> > Does anyone know how to solve that ?
>>
>>> One way to solve it would be to add a blink function to gpiolib so
>>> that the gpio-led driver can access it through a common wrapper
>>> and we can make the orion_gpio_set_blink() function a pointer in
>>> the gpio_chip structure rather than an export from
>>> arch/arm/plat-orion/gpio.c. I've put a few people on Cc that might
>>> have an opion on this.

I have a board here with a NXP PCA9532 on i2c.
http://www.nxp.com/documents/data_sheet/PCA9532.pdf
drivers/leds/leds-pca9532.c

Pins can be:
GPIO
hardware blinking LED
PWM for backlight

It might even be an interrupt source, but I haven't dug into it that deep.

>>
>> Another idea would be to use pinctrl and represent the blink as a
>> special function. ?Not sure that's sensible though.
>
> I would rather say that anything automatically toggling
> a GPIO pin on/off at specified intervals is HW-controlled
> GPIO PWM.
>
> So this would be something that gets to be modeled in the
> PWM subsystem, but there is no such thing (I know Sascha et
> al was working on that at one point.)
>
> But in my dreams it would be in
> drivers/pwm/pwm-gpio.c and then anything that needs
> an auto-toggling GPIO pin could use that PWM interface.
> And only then it would be given hooks into the gpio driver,
> like with some #ifdef in the .h file for gpiolib that expose
> this hook only to the PWM subsystem.
>
> But I guess I won't have it my way :-)
>
> Currently, drivers/leds/leds-gpio.c has a
> platform-specific callback to set blink period. How do we
> replace that with something that can call generic code on
> a larger scale?
>
> Maybe it should go into gpiolib then, but I'm not sure at
> all.
>
> BTW: can leds-pwm.c use leds-gpio.c and exploit the blink
> callback there? (I hope so...)
>
> Yours,
> Linus Walleij
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel



-- 
Jon Smirl
jonsmirl at gmail.com

  parent reply	other threads:[~2012-04-24 12:39 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-23  7:27 device-tree vs gpio-leds gpio_blink_set Arnaud Patard (Rtp)
2012-04-23  7:27 ` [patch 1/1] orion/kirkwood/mv78xx0: add DT support to GPIO Arnaud Patard (Rtp)
2012-04-23 11:22 ` device-tree vs gpio-leds gpio_blink_set Arnd Bergmann
2012-04-23 17:49   ` Mark Brown
2012-04-24 12:24     ` Linus Walleij
2012-04-24 12:36       ` Mark Brown
2012-04-24 13:04         ` Thierry Reding
2012-04-24 12:39       ` jonsmirl at gmail.com [this message]
2012-04-24 12:41         ` jonsmirl at gmail.com
     [not found] <20120423115140.GA15792@lunn.ch>
2012-04-23 12:01 ` Arnaud Patard (Rtp)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAKON4Oxa=h4DZapaOSX6=2soBDf1NMQhbkRdbzFcaim=a1T-ZQ@mail.gmail.com' \
    --to=jonsmirl@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.