Skip to content

Commit

Permalink
Merge branch 'for-linus' of git://git.o-hand.com/linux-rpurdie-leds
Browse files Browse the repository at this point in the history
* 'for-linus' of git://git.o-hand.com/linux-rpurdie-leds:
  leds: Ensure led->trigger is set earlier
  leds: Add support for Philips PCA955x I2C LED drivers
  leds: Fix sparse warnings in leds-h1940 driver
  leds: mark led_classdev.default_trigger as const
  leds: fix unsigned value overflow in atmel pwm driver
  leds: Add pca9532 platform data for Thecus N2100
  leds: Add pca9532 led driver
  • Loading branch information
Linus Torvalds committed Jul 24, 2008
2 parents 4378dcc + fe3025b commit c54554d
Show file tree
Hide file tree
Showing 10 changed files with 860 additions and 6 deletions.
52 changes: 52 additions & 0 deletions arch/arm/mach-iop32x/n2100.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include <linux/mm.h>
#include <linux/init.h>
#include <linux/f75375s.h>
#include <linux/leds-pca9532.h>
#include <linux/delay.h>
#include <linux/kernel.h>
#include <linux/pci.h>
Expand Down Expand Up @@ -206,6 +207,53 @@ static struct f75375s_platform_data n2100_f75375s = {
.pwm_enable = { 0, 0 },
};

static struct pca9532_platform_data n2100_leds = {
.leds = {
{ .name = "n2100:red:satafail0",
.state = PCA9532_OFF,
.type = PCA9532_TYPE_LED,
},
{ .name = "n2100:red:satafail1",
.state = PCA9532_OFF,
.type = PCA9532_TYPE_LED,
},
{ .name = "n2100:blue:usb",
.state = PCA9532_OFF,
.type = PCA9532_TYPE_LED,
},
{ .type = PCA9532_TYPE_NONE },

{ .type = PCA9532_TYPE_NONE },
{ .type = PCA9532_TYPE_NONE },
{ .type = PCA9532_TYPE_NONE },
{ .name = "n2100:red:usb",
.state = PCA9532_OFF,
.type = PCA9532_TYPE_LED,
},

{ .type = PCA9532_TYPE_NONE }, /* power OFF gpio */
{ .type = PCA9532_TYPE_NONE }, /* reset gpio */
{ .type = PCA9532_TYPE_NONE },
{ .type = PCA9532_TYPE_NONE },

{ .type = PCA9532_TYPE_NONE },
{ .name = "n2100:orange:system",
.state = PCA9532_OFF,
.type = PCA9532_TYPE_LED,
},
{ .name = "n2100:red:system",
.state = PCA9532_OFF,
.type = PCA9532_TYPE_LED,
},
{ .name = "N2100 beeper" ,
.state = PCA9532_OFF,
.type = PCA9532_TYPE_N2100_BEEP,
},
},
.psc = { 0, 0 },
.pwm = { 0, 0 },
};

static struct i2c_board_info __initdata n2100_i2c_devices[] = {
{
I2C_BOARD_INFO("rs5c372b", 0x32),
Expand All @@ -214,6 +262,10 @@ static struct i2c_board_info __initdata n2100_i2c_devices[] = {
I2C_BOARD_INFO("f75375", 0x2e),
.platform_data = &n2100_f75375s,
},
{
I2C_BOARD_INFO("pca9532", 0x60),
.platform_data = &n2100_leds,
},
};

/*
Expand Down
16 changes: 16 additions & 0 deletions drivers/leds/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,14 @@ config LEDS_HP6XX
This option enables led support for the handheld
HP Jornada 620/660/680/690.

config LEDS_PCA9532
tristate "LED driver for PCA9532 dimmer"
depends on LEDS_CLASS && I2C && INPUT && EXPERIMENTAL
help
This option enables support for NXP pca9532
led controller. It is generally only usefull
as a platform driver

config LEDS_GPIO
tristate "LED Support for GPIO connected LEDs"
depends on LEDS_CLASS && GENERIC_GPIO
Expand Down Expand Up @@ -147,6 +155,14 @@ config LEDS_CLEVO_MAIL
To compile this driver as a module, choose M here: the
module will be called leds-clevo-mail.

config LEDS_PCA955X
tristate "LED Support for PCA955x I2C chips"
depends on LEDS_CLASS && I2C
help
This option enables support for LEDs connected to PCA955x
LED driver chips accessed via the I2C bus. Supported
devices include PCA9550, PCA9551, PCA9552, and PCA9553.

comment "LED Triggers"

config LEDS_TRIGGERS
Expand Down
2 changes: 2 additions & 0 deletions drivers/leds/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@ obj-$(CONFIG_LEDS_WRAP) += leds-wrap.o
obj-$(CONFIG_LEDS_H1940) += leds-h1940.o
obj-$(CONFIG_LEDS_COBALT_QUBE) += leds-cobalt-qube.o
obj-$(CONFIG_LEDS_COBALT_RAQ) += leds-cobalt-raq.o
obj-$(CONFIG_LEDS_PCA9532) += leds-pca9532.o
obj-$(CONFIG_LEDS_GPIO) += leds-gpio.o
obj-$(CONFIG_LEDS_CM_X270) += leds-cm-x270.o
obj-$(CONFIG_LEDS_CLEVO_MAIL) += leds-clevo-mail.o
obj-$(CONFIG_LEDS_HP6XX) += leds-hp6xx.o
obj-$(CONFIG_LEDS_FSG) += leds-fsg.o
obj-$(CONFIG_LEDS_PCA955X) += leds-pca955x.o

# LED Triggers
obj-$(CONFIG_LEDS_TRIGGER_TIMER) += ledtrig-timer.o
Expand Down
3 changes: 2 additions & 1 deletion drivers/leds/led-triggers.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,16 +111,17 @@ void led_trigger_set(struct led_classdev *led_cdev, struct led_trigger *trigger)
flags);
if (led_cdev->trigger->deactivate)
led_cdev->trigger->deactivate(led_cdev);
led_cdev->trigger = NULL;
led_set_brightness(led_cdev, LED_OFF);
}
if (trigger) {
write_lock_irqsave(&trigger->leddev_list_lock, flags);
list_add_tail(&led_cdev->trig_list, &trigger->led_cdevs);
write_unlock_irqrestore(&trigger->leddev_list_lock, flags);
led_cdev->trigger = trigger;
if (trigger->activate)
trigger->activate(led_cdev);
}
led_cdev->trigger = trigger;
}
EXPORT_SYMBOL_GPL(led_trigger_set);

Expand Down
2 changes: 1 addition & 1 deletion drivers/leds/leds-atmel-pwm.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ static int __init pwmled_probe(struct platform_device *pdev)
{
const struct gpio_led_platform_data *pdata;
struct pwmled *leds;
unsigned i;
int i;
int status;

pdata = pdev->dev.platform_data;
Expand Down
9 changes: 6 additions & 3 deletions drivers/leds/leds-h1940.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
/*
* Green led.
*/
void h1940_greenled_set(struct led_classdev *led_dev, enum led_brightness value)
static void h1940_greenled_set(struct led_classdev *led_dev,
enum led_brightness value)
{
switch (value) {
case LED_HALF:
Expand Down Expand Up @@ -52,7 +53,8 @@ static struct led_classdev h1940_greenled = {
/*
* Red led.
*/
void h1940_redled_set(struct led_classdev *led_dev, enum led_brightness value)
static void h1940_redled_set(struct led_classdev *led_dev,
enum led_brightness value)
{
switch (value) {
case LED_HALF:
Expand Down Expand Up @@ -82,7 +84,8 @@ static struct led_classdev h1940_redled = {
* Blue led.
* (it can only be blue flashing led)
*/
void h1940_blueled_set(struct led_classdev *led_dev, enum led_brightness value)
static void h1940_blueled_set(struct led_classdev *led_dev,
enum led_brightness value)
{
if (value) {
/* flashing Blue */
Expand Down
Loading

0 comments on commit c54554d

Please sign in to comment.