LED driver for Intel NAS SS4200 series
RFC PATCH 1/1 LED driver for Intel NAS SS4200 series
This code is based on a driver that came in the "Open-source and GPL components" download here:
It was in a file called nasgpio.c inside of a second zip file called SS4200-E_Linux_SIO_Driver-v1.4.zip.
That code used an ioctl() call to operate the LEDs. It also created a new top-level /proc file just to let userspace locate which dynamic major number had been allocated to the device. I decided that the interface probably wasn't mergeable in that form. :)
I ripped out all of the hardware monitor support from nasgpio.c as well as the smbus code that controls the LED brightness. I then converted the code to use the existing LED interfaces rather than the ioctl(). I don't have any need for brightness control, and its code is *completely* separate from the on/off controls implemented here. If anyone else wants it, I'd be happy to look into adding it, but I don't care enough for now.
Except for the probe routines, I rewrote most of it. I also Note that I don't have any hardware documentation except for the original driver.
Thanks go to Arjan for his help in getting the original source for this released and for chasing down some licensing issues.
drivers/leds/Kconfig +9 -0
@@ -229,6 +229,15 @@ config LEDS_BD2802 This option enables support for BD2802GU RGB LED driver chips accessed via the I2C bus. +config LEDS_INTEL_SS4200 + tristate "LED driver for Intel NAS SS4200 series" + depends on LEDS_CLASS && PCI + help + This option enables support for the Intel SS4200 series of + Network Attached Storage servers. You may control the hard + drive or power LEDs on the front panel. Using this driver + can stop the front LED from blinking after startup. + comment "LED Triggers" config LEDS_TRIGGERS
drivers/leds/Makefile +1 -0
@@ -28,6 +28,7 @@ obj-$(CONFIG_LEDS_PCA955X) += leds-pca955x.o obj-$(CONFIG_LEDS_DA903X) += leds-da903x.o obj-$(CONFIG_LEDS_WM8350) += leds-wm8350.o obj-$(CONFIG_LEDS_PWM) += leds-pwm.o +obj-$(CONFIG_LEDS_INTEL_SS4200) += leds-ss4200.o # LED SPI Drivers obj-$(CONFIG_LEDS_DAC124S085) += leds-dac124s085.o
drivers/leds/leds-ss4200.c new file +506 -0
506 lines not on this page · raw message
-- Dave
Quoted 14 lines · Dave Hansen
This code is based on a driver that came in the "Open-source and GPL components" download here:
It was in a file called
nasgpio.cinside of a second zip file called SS4200-E_Linux_SIO_Driver-v1.4.zip.That code used an
ioctl()call to operate the LEDs. It also created a new top-level /proc file just to let userspace locate which dynamic major number had been allocated to the device. I decided that the interface probably wasn't mergeable in that form. :)
Quoted 7 lines
I ripped out all of the hardware monitor support from
nasgpio.cas well as the smbus code that controls the LED brightness. I then converted the code to use the existing LED interfaces rather than theioctl(). I don't have any need for brightness control, and its code is *completely* separate from the on/off controls implemented here. If anyone else wants it, I'd be happy to look into adding it, but I don't care enough for now.
At a quick review this looks good. One question: These LEDs appear to be attached to generic GPIOs on a southbridge that is probably in other devices? If so, how do we know they're connected to LEDs? Do we need to add some further check of what kind of device we're running on?
Cheers,
Richard
Signature · 2 lines
Richard Purdie Intel Open Source Technology Centre
Quoted 23 lines · Richard Purdie
Quoted 14 lines · Dave Hansen
This code is based on a driver that came in the "Open-source and GPL components" download here:
It was in a file called
nasgpio.cinside of a second zip file called SS4200-E_Linux_SIO_Driver-v1.4.zip.That code used an
ioctl()call to operate the LEDs. It also created a new top-level /proc file just to let userspace locate which dynamic major number had been allocated to the device. I decided that the interface probably wasn't mergeable in that form. :)Quoted 7 lines
I ripped out all of the hardware monitor support from
nasgpio.cas well as the smbus code that controls the LED brightness. I then converted the code to use the existing LED interfaces rather than theioctl(). I don't have any need for brightness control, and its code is *completely* separate from the on/off controls implemented here. If anyone else wants it, I'd be happy to look into adding it, but I don't care enough for now.
Quoted 4 lines
At a quick review this looks good. One question: These LEDs appear to be attached to generic GPIOs on a southbridge that is probably in other devices? If so, how do we know they're connected to LEDs? Do we need to add some further check of what kind of device we're running on?
Good question. I assumed that the PCI ids were a sufficient enough check. But, you're right, those PCI ids look like they're for all ICH7 boards.
Any suggestions on what kinds of checks we might add? This thing acts like a pretty generic normal PC. Do any of the other LED drivers have a similar problem?
-- Dave
Quoted 6 lines · Dave Hansen
Quoted 4 lines · Richard Purdie
At a quick review this looks good. One question: These LEDs appear to be attached to generic GPIOs on a southbridge that is probably in other devices? If so, how do we know they're connected to LEDs? Do we need to add some further check of what kind of device we're running on?
Quoted 7 lines
Good question. I assumed that the PCI ids were a sufficient enough check. But, you're right, those PCI ids look like they're for all ICH7 boards.
Any suggestions on what kinds of checks we might add? This thing acts like a pretty generic normal PC. Do any of the other LED drivers have a similar problem?
Yes. In this case can we check for a set of DMI IDs? The clevo mail driver has an example of that...
Cheers,
Richard
Signature · 2 lines
Richard Purdie Intel Open Source Technology Centre