Re: support for Intel Atom based QNAP LEDs/buttons/buzzer in Linux?

From: Guenter Roeck
Date: Fri Jun 21 2013 - 16:45:22 EST


On Thu, Jun 20, 2013 at 02:42:07PM -0700, Greg KH wrote:
> On Thu, Jun 20, 2013 at 11:28:26PM +0200, Christoph Anton Mitterer wrote:
> > Hey Greg.
> >
> > On Wed, 2013-06-19 at 19:59 -0700, Greg KH wrote:
> > > If you can dig the code out into a stand-alone form that I can make into
> > > a patch for the drivers/staging/ tree, I'll be glad to take it.
> > Well I don't think my kernel/hardware development skills are enough for
> > that... especially as Guenter already said that the code shouldn't be
> > part of hwmon/it87 ... but rather a separate gpio driver...
>
> Fair enough.
>
The best/cleanest option would be to have a mfd core driver for the IT87xx
variants and client drivers for hwmon, gpio, etc. Given that this might be
a bit complicated, another option would be to add gpio support into the
it87 driver itself. Unfortunately, I won't have time to do any of that.

What is worse is that the QNAP folks hacked the kernel all over the place.
There isn't just GPIO access added to the it87 driver (without using the gpio
subsystem), but platform initialization as well as code to access LEDs
and power buttonswere added to it as well. Overall they have hundreds of
patches on top of a 3.4.6 kernel. So we are not only talking about adding
support for the GPIO pins of IT87xx, and adding LED support as well as power
button handling on top of that, but about digging through a whole lot of
changes all over the place to find what is relevant.

The bad thing about it is really that many of the changes they made would be
beneficial to have in the upstream kernel, only it would probably take
man-years to clean it all up and get it there. Now the code isn't upstream,
they have a maintenance nightmare, and no one benefits from it :(.

Guenter

> > > Or, if
> > > you get a contact at QNAP, I'll be glad to help out there as well
> > Well I've asked them again,... no reply so far.
> > The only direct contact I know (from the sources of their drivers) is
> > Wokes Wang, which I've CCed. Perhaps he can help.
>
> That would be great. Also, do you have a pointer to the git tree for
> the hardware again, I can't seem to find it. I can dig through the tree
> to see if I can make something "self-contained", if you are willing to
> test it out.
>
> thanks,
>
> greg k-h
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/