From 0cb49744ed147a9813fdd68d20ddc8f9d4142dc1 Mon Sep 17 00:00:00 2001 From: Dan Murphy Date: Wed, 2 Jun 2010 10:57:12 -0500 Subject: [PATCH] [ARM] tegra: stingray: Use generic CPCAP led driver in board file Modify the board file to initialize multiple instances of the CPCAP LED driver Add the privacy LED data to create a privacy LED entry. Change-Id: Ifbd022e743a38e02b70983ff65fc721b6b0744a9 Signed-off-by: Dan Murphy --- arch/arm/mach-tegra/board-stingray-spi.c | 49 ++++++++++++++++-------- 1 file changed, 33 insertions(+), 16 deletions(-) diff --git a/arch/arm/mach-tegra/board-stingray-spi.c b/arch/arm/mach-tegra/board-stingray-spi.c index bed0ad8cbb2b..948c2a9d5a24 100644 --- a/arch/arm/mach-tegra/board-stingray-spi.c +++ b/arch/arm/mach-tegra/board-stingray-spi.c @@ -206,18 +206,48 @@ static struct platform_device cpcap_whisper_device = { .platform_data = &whisper_pdata, }, }; + +static struct cpcap_led stingray_display_led = { + .cpcap_register = CPCAP_REG_KLC, + .cpcap_mask = 0x03FF, + .on_val = 0x00F5, + .off_val = 0x00F4, + .cpcap_duty_cycle = 0x2A0, + .cpcap_current = 0x0, + .class_name = LD_DISP_BUTTON_DEV, + .led_regulator = "sw5", +}; + static struct platform_device cpcap_disp_button_led = { - .name = LD_DISP_BUTTON_DEV, - .id = -1, + .name = LD_CPCAP_LED_DRV, + .id = 1, .dev = { - .platform_data = NULL, + .platform_data = &stingray_display_led, }, }; +static struct cpcap_led stingray_privacy_led ={ + .cpcap_register = CPCAP_REG_BLEDC, + .cpcap_mask = 0x03FF, + .on_val = 0x00F5, + .off_val = 0x00F4, + .cpcap_duty_cycle = 0x41, + .cpcap_current = 0x0, + .class_name = LD_PRIVACY_LED_DEV, + .led_regulator = "sw5", +}; +static struct platform_device cpcap_privacy_led = { + .name = LD_CPCAP_LED_DRV, + .id = 2, + .dev = { + .platform_data = &stingray_privacy_led, + }, +}; static struct platform_device *cpcap_devices[] = { &cpcap_validity_device, &cpcap_whisper_device, &cpcap_disp_button_led, + &cpcap_privacy_led, &cpcap_3mm5_device, }; @@ -535,18 +565,6 @@ static struct cpcap_adc_ato stingray_cpcap_adc_ato = { .atox_ps_factor_out = 0, }; -static struct cpcap_leds stingray_cpcap_leds = { - .button_led = { - .button_reg = CPCAP_REG_KLC, - .button_mask = 0x03FF, - .button_on = 0x00F5, - .button_off = 0x00F4, - }, - .rgb_led = { - .rgb_on = 0x0053, - }, -}; - static struct cpcap_platform_data stingray_cpcap_data = { .init = stingray_cpcap_spi_init, .init_len = ARRAY_SIZE(stingray_cpcap_spi_init), @@ -554,7 +572,6 @@ static struct cpcap_platform_data stingray_cpcap_data = { .regulator_off_mode_values = cpcap_regulator_off_mode_values, .regulator_init = cpcap_regulator, .adc_ato = &stingray_cpcap_adc_ato, - .leds = &stingray_cpcap_leds, .ac_changed = NULL, .batt_changed = NULL, .usb_changed = NULL, -- 2.34.1