Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c54554d3 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge branch 'for-linus' of git://git.o-hand.com/linux-rpurdie-leds

* '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
parents 4378dcca fe3025b5
Loading
Loading
Loading
Loading
+52 −0
Original line number Diff line number Diff line
@@ -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>
@@ -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),
@@ -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,
	},
};

/*
+16 −0
Original line number Diff line number Diff line
@@ -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
@@ -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
+2 −0
Original line number Diff line number Diff line
@@ -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
+2 −1
Original line number Diff line number Diff line
@@ -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);

+1 −1
Original line number Diff line number Diff line
@@ -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;
Loading