[PATCH 09/28] leds-lp5521/5523: add specific max_channel

From: Kim, Milo
Date: Fri Oct 05 2012 - 04:14:39 EST


LP5521 has max 3 channels.
On the other hand, LP5523/55231 provides up to 9 channels.
A number of channels is used for validating platform data channel number
while initializing LEDs.(lp55xx_init_leds)
To support this, max_channel is configured in each driver.

Signed-off-by: Milo(Woogyom) Kim <milo.kim@xxxxxx>
---
drivers/leds/leds-lp5521.c | 1 +
drivers/leds/leds-lp5523.c | 3 +++
2 files changed, 4 insertions(+)

diff --git a/drivers/leds/leds-lp5521.c b/drivers/leds/leds-lp5521.c
index 1791655..4076f54 100644
--- a/drivers/leds/leds-lp5521.c
+++ b/drivers/leds/leds-lp5521.c
@@ -606,6 +606,7 @@ static void lp5521_unregister_sysfs(struct i2c_client *client)

/* Chip specific configurations */
static struct lp55xx_device_config lp5521_cfg = {
+ .max_channel = LP5521_MAX_LEDS,
.reset = {
.addr = LP5521_REG_RESET,
.val = LP5521_RESET,
diff --git a/drivers/leds/leds-lp5523.c b/drivers/leds/leds-lp5523.c
index 5d383b2..85521f8 100644
--- a/drivers/leds/leds-lp5523.c
+++ b/drivers/leds/leds-lp5523.c
@@ -38,6 +38,8 @@

#include "leds-lp55xx-common.h"

+#define LP5523_MAX_LEDS 9
+
#define LP5523_REG_ENABLE 0x00
#define LP5523_REG_OP_MODE 0x01
#define LP5523_REG_RATIOMETRIC_MSB 0x02
@@ -686,6 +688,7 @@ static void lp5523_set_mode(struct lp5523_engine *engine, u8 mode)

/* Chip specific configurations */
static struct lp55xx_device_config lp5523_cfg = {
+ .max_channel = LP5523_MAX_LEDS,
.reset = {
.addr = LP5523_REG_RESET,
.val = LP5523_RESET,
--
1.7.9.5


Best Regards,
Milo


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/