Commit 4f5dfdd2 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull LED updates from Jacek Anaszewski:
 "This time we're removing more than adding:

  Removed drivers:

    leds-versatile:
      - all users of the Versatile LED driver are deleted and replaced
        with the very generic leds-syscon

    leds-sead3:
      - SEAD3 is using the generic leds-syscon & regmap based
        register-bit-led driver

  LED class drivers improvements:

    ledtrig-gpio:
      - use threaded IRQ, which both simplifies the code because we can
        drop the workqueue indirection, and it enables using the trigger
        for GPIOs that work with threaded IRQs themselves
      - refresh LED state after GPIO change since the new GPIO may have
        a different state than the old one

    leds-lp55xx:
      - make various arrays static const

    leds-pca963x:
      - add bindings to invert polarity"

* tag 'leds_for_4.13' of git://git.kernel.org/pub/scm/linux/kernel/git/j.anaszewski/linux-leds:
  leds: lp55xx: make various arrays static const
  leds: Remove SEAD-3 driver
  leds: trigger: gpio: Use threaded IRQ
  leds: trigger: gpio: Refresh LED state after GPIO change
  leds: Delete obsolete Versatile driver
  leds: pca963x: Add bindings to invert polarity
parents 0b49ce5a 4d1707c1
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -10,6 +10,7 @@ Optional properties:
- nxp,period-scale : In some configurations, the chip blinks faster than expected.
		     This parameter provides a scaling ratio (fixed point, decimal divided
		     by 1000) to compensate, e.g. 1300=1.3x and 750=0.75x.
- nxp,inverted-out: invert the polarity of the generated PWM

Each led is represented as a sub-node of the nxp,pca963x device.

+0 −18
Original line number Diff line number Diff line
@@ -590,16 +590,6 @@ config LEDS_KTD2692

	  Say Y to enable this driver.

config LEDS_SEAD3
	tristate "LED support for the MIPS SEAD 3 board"
	depends on LEDS_CLASS && MIPS_SEAD3
	help
	  Say Y here to include support for the FLED and PLED LEDs on SEAD3 eval
	  boards.

	  This driver can also be built as a module. If so the module
	  will be called leds-sead3.

config LEDS_IS31FL319X
	tristate "LED Support for ISSI IS31FL319x I2C LED controller family"
	depends on LEDS_CLASS && I2C && OF
@@ -651,14 +641,6 @@ config LEDS_SYSCON
	  devices. This will only work with device tree enabled
	  devices.

config LEDS_VERSATILE
	tristate "LED support for the ARM Versatile and RealView"
	depends on ARCH_REALVIEW || ARCH_VERSATILE
	depends on LEDS_CLASS
	help
	  This option enabled support for the LEDs on the ARM Versatile
	  and RealView boards. Say Y to enabled these.

config LEDS_PM8058
	tristate "LED Support for the Qualcomm PM8058 PMIC"
	depends on MFD_PM8XXX
+0 −2
Original line number Diff line number Diff line
@@ -62,11 +62,9 @@ obj-$(CONFIG_LEDS_MAX8997) += leds-max8997.o
obj-$(CONFIG_LEDS_LM355x)		+= leds-lm355x.o
obj-$(CONFIG_LEDS_BLINKM)		+= leds-blinkm.o
obj-$(CONFIG_LEDS_SYSCON)		+= leds-syscon.o
obj-$(CONFIG_LEDS_VERSATILE)		+= leds-versatile.o
obj-$(CONFIG_LEDS_MENF21BMC)		+= leds-menf21bmc.o
obj-$(CONFIG_LEDS_KTD2692)		+= leds-ktd2692.o
obj-$(CONFIG_LEDS_POWERNV)		+= leds-powernv.o
obj-$(CONFIG_LEDS_SEAD3)		+= leds-sead3.o
obj-$(CONFIG_LEDS_IS31FL319X)		+= leds-is31fl319x.o
obj-$(CONFIG_LEDS_IS31FL32XX)		+= leds-is31fl32xx.o
obj-$(CONFIG_LEDS_PM8058)		+= leds-pm8058.o
+5 −5
Original line number Diff line number Diff line
@@ -168,13 +168,13 @@ static int lp5523_post_init_device(struct lp55xx_chip *chip)
static void lp5523_load_engine(struct lp55xx_chip *chip)
{
	enum lp55xx_engine_index idx = chip->engine_idx;
	u8 mask[] = {
	static const u8 mask[] = {
		[LP55XX_ENGINE_1] = LP5523_MODE_ENG1_M,
		[LP55XX_ENGINE_2] = LP5523_MODE_ENG2_M,
		[LP55XX_ENGINE_3] = LP5523_MODE_ENG3_M,
	};

	u8 val[] = {
	static const u8 val[] = {
		[LP55XX_ENGINE_1] = LP5523_LOAD_ENG1,
		[LP55XX_ENGINE_2] = LP5523_LOAD_ENG2,
		[LP55XX_ENGINE_3] = LP5523_LOAD_ENG3,
@@ -188,7 +188,7 @@ static void lp5523_load_engine(struct lp55xx_chip *chip)
static void lp5523_load_engine_and_select_page(struct lp55xx_chip *chip)
{
	enum lp55xx_engine_index idx = chip->engine_idx;
	u8 page_sel[] = {
	static const u8 page_sel[] = {
		[LP55XX_ENGINE_1] = LP5523_PAGE_ENG1,
		[LP55XX_ENGINE_2] = LP5523_PAGE_ENG2,
		[LP55XX_ENGINE_3] = LP5523_PAGE_ENG3,
@@ -208,7 +208,7 @@ static void lp5523_stop_all_engines(struct lp55xx_chip *chip)
static void lp5523_stop_engine(struct lp55xx_chip *chip)
{
	enum lp55xx_engine_index idx = chip->engine_idx;
	u8 mask[] = {
	static const u8 mask[] = {
		[LP55XX_ENGINE_1] = LP5523_MODE_ENG1_M,
		[LP55XX_ENGINE_2] = LP5523_MODE_ENG2_M,
		[LP55XX_ENGINE_3] = LP5523_MODE_ENG3_M,
@@ -505,7 +505,7 @@ static int lp5523_load_mux(struct lp55xx_chip *chip, u16 mux, int nr)
{
	struct lp55xx_engine *engine = &chip->engines[nr - 1];
	int ret;
	u8 mux_page[] = {
	static const u8 mux_page[] = {
		[LP55XX_ENGINE_1] = LP5523_PAGE_MUX1,
		[LP55XX_ENGINE_2] = LP5523_PAGE_MUX2,
		[LP55XX_ENGINE_3] = LP5523_PAGE_MUX3,
+15 −2
Original line number Diff line number Diff line
@@ -342,6 +342,12 @@ pca963x_dt_init(struct i2c_client *client, struct pca963x_chipdef *chip)
	if (of_property_read_u32(np, "nxp,period-scale", &chip->scaling))
		chip->scaling = 1000;

	/* default to non-inverted output, unless inverted is specified */
	if (of_property_read_bool(np, "nxp,inverted-out"))
		pdata->dir = PCA963X_INVERTED;
	else
		pdata->dir = PCA963X_NORMAL;

	return pdata;
}

@@ -452,11 +458,18 @@ static int pca963x_probe(struct i2c_client *client,
	i2c_smbus_write_byte_data(client, PCA963X_MODE1, BIT(4));

	if (pdata) {
		u8 mode2 = i2c_smbus_read_byte_data(pca963x->chip->client,
						    PCA963X_MODE2);
		/* Configure output: open-drain or totem pole (push-pull) */
		if (pdata->outdrv == PCA963X_OPEN_DRAIN)
			i2c_smbus_write_byte_data(client, PCA963X_MODE2, 0x01);
			mode2 |= 0x01;
		else
			i2c_smbus_write_byte_data(client, PCA963X_MODE2, 0x05);
			mode2 |= 0x05;
		/* Configure direction: normal or inverted */
		if (pdata->dir == PCA963X_INVERTED)
			mode2 |= 0x10;
		i2c_smbus_write_byte_data(pca963x->chip->client, PCA963X_MODE2,
					  mode2);
	}

	return 0;
Loading