LED driver for Intel NAS SS4200 series (v4)
PATCH 1/1 LED driver for Intel NAS SS4200 series (v4)
Changes from last version
* Changed logging functions to use cleaner helpers
Previous changes:
* 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:
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 | 555 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 565 insertions(+), 0 deletions(-) create mode 100644 drivers/leds/leds-ss4200.c
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 && 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
@@ -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 +555 -0
555 lines not on this page · raw message
Signature · 1 line
1.6.5.rc2
drivers/leds/leds-ss4200.c
Quoted 3 lines · Dave Hansen
Changes from last version
* Changed logging functions to use cleaner helpersdrivers/leds/leds-ss4200.c +0
-0
[]
drivers/leds/leds-ss4200.c line 35
Quoted 4 lines
drivers/leds/leds-ss4200.c +4
-0+#ifdef pr_fmt +#undef pr_fmt +#endif +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt
Hi Dave.
Thanks for doing this.
Minor nit: I think the preferred style is to
put the #define pr_fmt before any #include.
cheers, Joe