aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-exynos/midas-leds.c
blob: 2d6e1e2e3f5e231c4558513bcb5f8d7b100b1c12 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#include <linux/platform_device.h>
#include <linux/gpio.h>
#include <linux/i2c.h>
#include <linux/i2c-gpio.h>
#include <linux/leds-lp5521.h>

#include <plat/gpio-cfg.h>
#include <mach/regs-gpio.h>
#include <mach/gpio.h>
#include "midas.h"

#ifdef CONFIG_LEDS_LP5521
static struct lp5521_led_config lp5521_led_config[] = {
	{
		.name = "red",
		.chan_nr = 0,
		.led_current = 50,
		.max_current = 130,
	}, {
		.name = "green",
		.chan_nr = 1,
		.led_current = 30,
		.max_current = 130,
	}, {
		.name = "blue",
		.chan_nr = 2,
		.led_current = 30,
		.max_current = 130,
	},
};
#define LP5521_CONFIGS (LP5521_PWM_HF | LP5521_PWRSAVE_EN | \
LP5521_CP_MODE_AUTO | LP5521_R_TO_BATT | \
LP5521_CLK_INT)

static struct lp5521_platform_data lp5521_pdata = {
	.led_config = lp5521_led_config,
	.num_channels = ARRAY_SIZE(lp5521_led_config),
	.clock_mode = LP5521_CLOCK_INT,
	.update_config = LP5521_CONFIGS,
};
static struct i2c_board_info i2c_devs21_emul[] __initdata = {
	{
		I2C_BOARD_INFO("lp5521", 0x32),
		.platform_data = &lp5521_pdata,
	},
};

int __init plat_leds_init(void)
{
	i2c_add_devices(21, i2c_devs21_emul, ARRAY_SIZE(i2c_devs21_emul));
	return 0;
};
module_init(plat_leds_init);
#endif