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

Commit 85b656cf authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull LED subsystem changes from Bryan Wu:
 "LED subsystem updates for 3.13 are basically cleanup and also add a
  new driver for PCA9685"

* 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/cooloney/linux-leds:
  leds: lp55xx: handle enable pin in driver
  leds-gpio: of: led should not be created if its status is disabled
  of: introduce of_get_available_child_count
  leds: Added driver for the NXP PCA9685 I2C chip
  leds: pwm: Remove redundant of_match_ptr
  leds: Include linux/of.h header
  leds: dac124s085: Remove redundant spi_set_drvdata
  leds: lp55xx: enable setting default trigger
  leds: blinkm: Remove redundant break
parents 2b684c07 30dae2f9
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -10,6 +10,7 @@ Each child has own specific current settings
- max-cur: Maximun current at each led channel.

Optional properties:
- enable-gpio: GPIO attached to the chip's enable pin
- label: Used for naming LEDs
- pwr-sel: LP8501 specific property. Power selection for output channels.
         0: D1~9 are connected to VDD
@@ -17,12 +18,15 @@ Optional properties:
         2: D1~6 with VOUT, D7~9 with VDD
         3: D1~9 are connected to VOUT

Alternatively, each child can have specific channel name
- chan-name: Name of each channel name
Alternatively, each child can have a specific channel name and trigger:
- chan-name (optional): name of channel
- linux,default-trigger (optional): see
  Documentation/devicetree/bindings/leds/common.txt

example 1) LP5521
3 LED channels, external clock used. Channel names are 'lp5521_pri:channel0',
'lp5521_pri:channel1' and 'lp5521_pri:channel2'
'lp5521_pri:channel1' and 'lp5521_pri:channel2', with a heartbeat trigger
on channel 0.

lp5521@32 {
	compatible = "national,lp5521";
@@ -33,6 +37,7 @@ lp5521@32 {
	chan0 {
		led-cur = /bits/ 8 <0x2f>;
		max-cur = /bits/ 8 <0x5f>;
		linux,default-trigger = "heartbeat";
	};

	chan1 {
+1 −19
Original line number Diff line number Diff line
@@ -213,29 +213,11 @@ static struct lp55xx_led_config rx51_lp5523_led_config[] = {
	}
};

static int rx51_lp5523_setup(void)
{
	return gpio_request_one(RX51_LP5523_CHIP_EN_GPIO, GPIOF_DIR_OUT,
			"lp5523_enable");
}

static void rx51_lp5523_release(void)
{
	gpio_free(RX51_LP5523_CHIP_EN_GPIO);
}

static void rx51_lp5523_enable(bool state)
{
	gpio_set_value(RX51_LP5523_CHIP_EN_GPIO, !!state);
}

static struct lp55xx_platform_data rx51_lp5523_platform_data = {
	.led_config		= rx51_lp5523_led_config,
	.num_channels		= ARRAY_SIZE(rx51_lp5523_led_config),
	.clock_mode		= LP55XX_CLOCK_AUTO,
	.setup_resources	= rx51_lp5523_setup,
	.release_resources	= rx51_lp5523_release,
	.enable			= rx51_lp5523_enable,
	.enable_gpio		= RX51_LP5523_CHIP_EN_GPIO,
};
#endif

+10 −0
Original line number Diff line number Diff line
@@ -300,6 +300,16 @@ config LEDS_PCA963X
	  LED driver chip accessed via the I2C bus. Supported
	  devices include PCA9633 and PCA9634

config LEDS_PCA9685
	tristate "LED support for PCA9685 I2C chip"
	depends on LEDS_CLASS
	depends on I2C
	help
	  This option enables support for LEDs connected to the PCA9685
	  LED driver chip accessed via the I2C bus.
	  The PCA9685 offers 12-bit PWM (4095 levels of brightness) on
	  16 individual channels.

config LEDS_WM831X_STATUS
	tristate "LED support for status LEDs on WM831x PMICs"
	depends on LEDS_CLASS
+1 −0
Original line number Diff line number Diff line
@@ -36,6 +36,7 @@ obj-$(CONFIG_LEDS_OT200) += leds-ot200.o
obj-$(CONFIG_LEDS_FSG)			+= leds-fsg.o
obj-$(CONFIG_LEDS_PCA955X)		+= leds-pca955x.o
obj-$(CONFIG_LEDS_PCA963X)		+= leds-pca963x.o
obj-$(CONFIG_LEDS_PCA9685)		+= leds-pca9685.o
obj-$(CONFIG_LEDS_DA903X)		+= leds-da903x.o
obj-$(CONFIG_LEDS_DA9052)		+= leds-da9052.o
obj-$(CONFIG_LEDS_WM831X_STATUS)	+= leds-wm831x-status.o
+0 −3
Original line number Diff line number Diff line
@@ -161,13 +161,10 @@ static ssize_t show_color_common(struct device *dev, char *buf, int color)
	switch (color) {
	case RED:
		return scnprintf(buf, PAGE_SIZE, "%02X\n", data->red);
		break;
	case GREEN:
		return scnprintf(buf, PAGE_SIZE, "%02X\n", data->green);
		break;
	case BLUE:
		return scnprintf(buf, PAGE_SIZE, "%02X\n", data->blue);
		break;
	default:
		return -EINVAL;
	}
Loading