[Gta04-owner] Linux 3.2-rc2 on GTA04

Christoph Mair christoph.mair at gmail.com
Mon Nov 21 17:39:56 CET 2011


On Mon, Nov 21, 2011 at 5:00 PM, Dr. H. Nikolaus Schaller
<hns at goldelico.com> wrote:
>
> Am 21.11.2011 um 16:50 schrieb Christoph Mair:
>
>> On Mon, Nov 21, 2011 at 3:50 PM, Dr. H. Nikolaus Schaller
>> <hns at goldelico.com> wrote:
>>> Am 21.11.2011 um 12:32 schrieb NeilBrown:
>>
>>>> The next big thing I want to work on is proper integration of the LED
>>>> controller - with the 'wlan reset' line looking like a GPIO output rather
>>>> than an LED :-)
>>>
>>> Does this matter?
>> In my opinion: yes.
>>
>>> IMHO it is
>>>
>>>        echo "const1" >somepath and
>>>        echo "const2" >somepath
>>>
>>> So user space daemons should be able to be configured so that it matches
>>> whatever the hardware/kernel needs.
>>>
>>> My idea of the TCA6507 driver was to provide a general I2C LED driver similar
>>> to others. This makes it much more useful to others and raises chance of being
>>> accepted upstream.
>>>
>>> That we mis-use one of the outputs as a WLAN reset, should IMHO not be
>>> hard-coded in the kernel or drivers. It could change for future hardware revisions.
>>> E.g. if we use a WLAN module without reset. Or assign a real GPIO.
>> Nevertheless, if the TCA6507 driver would for example look for a
>> platform_data structure which defines which output is used as GPIO or
>> as LED, it sould be acceptable anyways.
>
> AFAIK, none of the existing LED drivers does this.
> So I would say: don't make it more complicated as it is :)
>
>> In my opinion, the main difference between a LED and a GPIO output is
>> the following: a GPIO does not have a brightness or (probably) should
>> not fade in or out. And this should be handled in software.
>
> Well, there are GPIOs that can also be programmed as PWM outputs.
> So we need some universal output driver that can be configured to behave
> as GPIO, PWM or LED (with different brightness and blinking patterns).
>
> If we want to harmonize that I think it will reach far beyond the GTA04 project...
>
> The main question is: what is a driver? A driver for a specific I2C chip (e.g. TCA6507)
> or for a function (GPIO, PWM, LED).
>
> Or do you just mean that the platform_data should configure each output
> to enable/disable the blinking function? So that nobody can make the WLAN
> reset blink?
I would suggest that the driver registers each output as either LED or
GPIO device, depending on some information (probably available as
platform_data) and maybe using LED as default if nothing is specified.
The TCA6507 would then act as a driver for a multifunction device.
The GPIO part just does not need to handle the blinking as the GPIO
framework does not know about such a function. The LED part should
expose the hardware-blinking feature to the upper layers so that it's
available to the led infrastructure.

> I thought Neil wanted to integrate it into the GPIO framework so that some
> TCA6507 outputs can be controlled as LEDs and others as GPIOs. But I may be
> wrong in my interpretation.
I'm quite sure this is the goal he wants to reach. It probably just
depends on how it's implemented.

Best regards,
  Christoph


More information about the Gta04-owner mailing list