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

Commit c16bfeb2 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull LED subsystem updates from Bryan Wu:
 - lp55xx device tree updates
 - mc13xxx driver updates
 - some clean up

* 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/cooloney/linux-leds:
  leds: mc13783: Fix "uninitialized variable" warning
  leds: Convert led class driver from legacy pm ops to dev_pm_ops
  leds: leds-mc13783: Add MC13892 LED support
  leds: leds-mc13783: Prepare driver to support MC13892 LEDs
  leds: renesas-tpu: cleanup a small type issue
  leds: use platform_{get,set}_drvdata()
  leds: leds-gpio: Let device core handle pinctrl
  leds: lp5562: Properly setup of_device_id table
  leds: lp5523: Properly setup of_device_id table
  leds: lp5521: Properly setup of_device_id table
  leds: lp5562: support the device tree feature
  leds: lp55xx: support dynamic channel settings in the device tree structure
  leds: leds-ns2: remove unnecessary platform_set_drvdata()
  leds: leds-mc13783: remove unnecessary platform_set_drvdata()
  leds: leds-gpio: remove unnecessary platform_set_drvdata()
  leds: atmel-pwm: remove unnecessary platform_set_drvdata()
  leds: lp55xx: add support for Device Tree bindings
parents 1286da8b cf3b1c2b
Loading
Loading
Loading
Loading
+147 −0
Original line number Diff line number Diff line
Binding for TI/National Semiconductor LP55xx Led Drivers

Required properties:
- compatible: "national,lp5521" or "national,lp5523" or "ti,lp5562"
- reg: I2C slave address
- clock-mode: Input clock mode, (0: automode, 1: internal, 2: external)

Each child has own specific current settings
- led-cur: Current setting at each led channel (mA x10, 0 if led is not connected)
- max-cur: Maximun current at each led channel.

Optional properties:
- label: Used for naming LEDs

Alternatively, each child can have specific channel name
- chan-name: Name of each channel name

example 1) LP5521
3 LED channels, external clock used. Channel names are 'lp5521_pri:channel0',
'lp5521_pri:channel1' and 'lp5521_pri:channel2'

lp5521@32 {
	compatible = "national,lp5521";
	reg = <0x32>;
	label = "lp5521_pri";
	clock-mode = /bits/ 8 <2>;

	chan0 {
		led-cur = /bits/ 8 <0x2f>;
		max-cur = /bits/ 8 <0x5f>;
	};

	chan1 {
		led-cur = /bits/ 8 <0x2f>;
		max-cur = /bits/ 8 <0x5f>;
	};

	chan2 {
		led-cur = /bits/ 8 <0x2f>;
		max-cur = /bits/ 8 <0x5f>;
	};
};

example 2) LP5523
9 LED channels with specific name. Internal clock used.
The I2C slave address is configurable with ASEL1 and ASEL0 pins.
Available addresses are 32/33/34/35h.

ASEL1    ASEL0    Address
-------------------------
 GND      GND       32h
 GND      VEN       33h
 VEN      GND       34h
 VEN      VEN       35h

lp5523@32 {
	compatible = "national,lp5523";
	reg = <0x32>;
	clock-mode = /bits/ 8 <1>;

	chan0 {
		chan-name = "d1";
		led-cur = /bits/ 8 <0x14>;
		max-cur = /bits/ 8 <0x20>;
	};

	chan1 {
		chan-name = "d2";
		led-cur = /bits/ 8 <0x14>;
		max-cur = /bits/ 8 <0x20>;
	};

	chan2 {
		chan-name = "d3";
		led-cur = /bits/ 8 <0x14>;
		max-cur = /bits/ 8 <0x20>;
	};

	chan3 {
		chan-name = "d4";
		led-cur = /bits/ 8 <0x14>;
		max-cur = /bits/ 8 <0x20>;
	};

	chan4 {
		chan-name = "d5";
		led-cur = /bits/ 8 <0x14>;
		max-cur = /bits/ 8 <0x20>;
	};

	chan5 {
		chan-name = "d6";
		led-cur = /bits/ 8 <0x14>;
		max-cur = /bits/ 8 <0x20>;
	};

	chan6 {
		chan-name = "d7";
		led-cur = /bits/ 8 <0x14>;
		max-cur = /bits/ 8 <0x20>;
	};

	chan7 {
		chan-name = "d8";
		led-cur = /bits/ 8 <0x14>;
		max-cur = /bits/ 8 <0x20>;
	};

	chan8 {
		chan-name = "d9";
		led-cur = /bits/ 8 <0x14>;
		max-cur = /bits/ 8 <0x20>;
	};
};

example 3) LP5562
4 channels are defined.

lp5562@30 {
	compatible = "ti,lp5562";
	reg = <0x30>;
	clock-mode = /bits/8 <2>;

	chan0 {
		chan-name = "R";
		led-cur = /bits/ 8 <0x20>;
		max-cur = /bits/ 8 <0x60>;
	};

	chan1 {
		chan-name = "G";
		led-cur = /bits/ 8 <0x20>;
		max-cur = /bits/ 8 <0x60>;
	};

	chan2 {
		chan-name = "B";
		led-cur = /bits/ 8 <0x20>;
		max-cur = /bits/ 8 <0x60>;
	};

	chan3 {
		chan-name = "W";
		led-cur = /bits/ 8 <0x20>;
		max-cur = /bits/ 8 <0x60>;
	};
};
+5 −4
Original line number Diff line number Diff line
@@ -268,10 +268,11 @@ static struct mc13xxx_led_platform_data moboard_led[] = {
static struct mc13xxx_leds_platform_data moboard_leds = {
	.num_leds = ARRAY_SIZE(moboard_led),
	.led = moboard_led,
	.flags = MC13783_LED_SLEWLIMTC,
	.abmode = MC13783_LED_AB_DISABLED,
	.tc1_period = MC13783_LED_PERIOD_10MS,
	.tc2_period = MC13783_LED_PERIOD_10MS,
	.led_control[0]	= MC13783_LED_C0_ENABLE | MC13783_LED_C0_ABMODE(0),
	.led_control[1]	= MC13783_LED_C1_SLEWLIM,
	.led_control[2]	= MC13783_LED_C2_SLEWLIM,
	.led_control[3]	= MC13783_LED_C3_PERIOD(0),
	.led_control[4]	= MC13783_LED_C3_PERIOD(0),
};

static struct mc13xxx_buttons_platform_data moboard_buttons = {
+3 −3
Original line number Diff line number Diff line
@@ -388,12 +388,12 @@ config LEDS_DELL_NETBOOKS
	  notebooks that have an external LED.

config LEDS_MC13783
	tristate "LED Support for MC13783 PMIC"
	tristate "LED Support for MC13XXX PMIC"
	depends on LEDS_CLASS
	depends on MFD_MC13783
	depends on MFD_MC13XXX
	help
	  This option enable support for on-chip LED drivers found
	  on Freescale Semiconductor MC13783 PMIC.
	  on Freescale Semiconductor MC13783/MC13892 PMIC.

config LEDS_NS2
	tristate "LED support for Network Space v2 GPIO LEDs"
+7 −3
Original line number Diff line number Diff line
@@ -156,7 +156,7 @@ void led_classdev_resume(struct led_classdev *led_cdev)
}
EXPORT_SYMBOL_GPL(led_classdev_resume);

static int led_suspend(struct device *dev, pm_message_t state)
static int led_suspend(struct device *dev)
{
	struct led_classdev *led_cdev = dev_get_drvdata(dev);

@@ -176,6 +176,11 @@ static int led_resume(struct device *dev)
	return 0;
}

static const struct dev_pm_ops leds_class_dev_pm_ops = {
	.suspend        = led_suspend,
	.resume         = led_resume,
};

/**
 * led_classdev_register - register a new object of led_classdev class.
 * @parent: The device to register.
@@ -252,8 +257,7 @@ static int __init leds_init(void)
	leds_class = class_create(THIS_MODULE, "leds");
	if (IS_ERR(leds_class))
		return PTR_ERR(leds_class);
	leds_class->suspend = led_suspend;
	leds_class->resume = led_resume;
	leds_class->pm = &leds_class_dev_pm_ops;
	leds_class->dev_attrs = led_class_attrs;
	return 0;
}
+1 −1
Original line number Diff line number Diff line
@@ -204,7 +204,7 @@ static int pm860x_led_probe(struct platform_device *pdev)
		sprintf(data->name, "led1-blue");
		break;
	}
	dev_set_drvdata(&pdev->dev, data);
	platform_set_drvdata(pdev, data);
	data->chip = chip;
	data->i2c = (chip->id == CHIP_PM8606) ? chip->client : chip->companion;
	data->port = pdev->id;
Loading