Skip to contentSkip to conversation

LED driver for Intel NAS SS4200 series (v5)

PATCH In review Dave Hansen 2 participants 2 messages Oct 1, 2009 – Oct 3, 2009 LED

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 LED driver for Intel NAS SS4200 series (v5)

Changes from last version:
* Define pr_fmt before any headers to keep from having to undef it

Previous changes:
* Changed logging functions to use cleaner helpers
* created non-lock-taking __nasgpio_led_set_attr() and a lock-taking version with no '__'.
* added Kconfig dependency on DMI
* Added some 'static's to functions
* Added __devinit to init-time functions
* Add missed pci_disable_device() on probe error and device removal
* Added dmi-basd hardware detection, and modparam override for it
* replaced DRIVER_NAME with KBUILD_MODNAME

--

This code is based on a driver that came in the "Open-source and GPL components" download here:

http://downloadcenter.intel.com/SearchResult.aspx?lang=eng&ProductFamily=Server+Products&ProductLine=Intel%C2%AE+Storage+Systems&ProductProduct=Intel%C2%AE+Entry+Storage+System+SS4200-E&OSVersion=OS+Independent

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 +
 drivers/leds/Makefile      |    1 +
 drivers/leds/leds-ss4200.c |  552 ++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 562 insertions(+), 0 deletions(-)
 create mode 100644 drivers/leds/leds-ss4200.c
drivers/leds/Kconfig +9 -0
index 7c8e712..23409c1 100644
@@ -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 && DMI
+	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
index e8cdcf7..6af2f99 100644
@@ -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 +552 -0

552 lines not on this page · raw message

Signature · 1 line
1.6.5.rc2
#1 lore raw
Quoted 4 lines · Dave Hansen

Changes from last version:
* Define pr_fmt before any headers to keep from having to undef it

Quoted 12 lines

Previous changes:
* Changed logging functions to use cleaner helpers
* created non-lock-taking __nasgpio_led_set_attr() and a lock-taking version with no '__'.
* added Kconfig dependency on DMI
* Added some 'static's to functions
* Added __devinit to init-time functions
* Add missed pci_disable_device() on probe error and device removal
* Added dmi-basd hardware detection, and modparam override for it
* replaced DRIVER_NAME with KBUILD_MODNAME

Thanks for the updates, I've queued the updated version.

Cheers,

Richard

Signature · 2 lines
Richard Purdie
Intel Open Source Technology Centre