[ARM] Stingray panel board file: Add lp8550 board file data
authorDan Murphy <wldm10@motorola.com>
Tue, 8 Jun 2010 19:09:39 +0000 (14:09 -0500)
committerColin Cross <ccross@android.com>
Wed, 6 Oct 2010 23:33:07 +0000 (16:33 -0700)
Add LP8550 board file data.  This driver is only available for P1's

Change-Id: I5a6d250174085494111a944ba97bd5fb4c35b83c
Signed-off-by: Dan Murphy <wldm10@motorola.com>
arch/arm/mach-tegra/board-stingray-panel.c

index 52b06f39854344c0b845920f38343cb16be1d3ff..a7eaeeac9b0c073419e8e24273e0838b0804269d 100644 (file)
  */
 
 #include <linux/gpio.h>
+#include <linux/i2c.h>
 #include <linux/leds-auo-panel-backlight.h>
 #include <linux/resource.h>
+#include <linux/leds-lp8550.h>
 #include <linux/platform_device.h>
 #include <asm/mach-types.h>
 #include <mach/irqs.h>
 #include <mach/iomap.h>
 #include <mach/tegra_fb.h>
 
+#include "board-stingray.h"
 #include "gpio-names.h"
 
 #define STINGRAY_AUO_DISP_BL   TEGRA_GPIO_PD0
@@ -88,15 +91,56 @@ static struct platform_device stingray_panel_bl_driver = {
                .platform_data = &stingray_auo_backlight_data,
                },
 };
+struct lp8550_eeprom_data stingray_lp8550_eeprom_data[] = {
+       /* Set the backlight current to 15mA each step is .12mA */
+       {0x7f},
+       /* Boost freq 625khz, PWM controled w/constant current,
+       thermal deration disabled, no brightness slope */
+       {0xa0},
+       /* Adaptive mode for light loads, No advanced slope, 50% mode selected,
+       Adaptive mode enabled, Boost is enabled, Boost Imax is 2.5A */
+       {0x9f},
+       /* UVLO is disabled, phase shift PWM enabled, PWM Freq 19232 */
+       {0x3f},
+       /* LED current resistor disabled, LED Fault = 3.3V */
+       {0x08},
+       /* Vsync is enabled, Dither disabled, Boost voltage 20V */
+       {0x8a},
+       /* PLL 13-bit counter */
+       {0x64},
+       /* 1-bit hysteresis w/11 bit resolution, PWM output freq is set with
+       PWM_FREQ EEPROM bits */
+       {0x29},
+};
+
+struct lp8550_platform_data stingray_lp8550_backlight_data = {
+       .power_up_brightness = 0x80,
+       .dev_ctrl_config = 0x00,
+       .brightness_control = 0x80,
+       .dev_id = 0xfc,
+       .direct_ctrl = 0x01,
+       .eeprom_table = stingray_lp8550_eeprom_data,
+       .eeprom_tbl_sz = ARRAY_SIZE(stingray_lp8550_eeprom_data),
+};
+
+static struct i2c_board_info __initdata stingray_i2c_bus1_led_info[] = {
+        {
+               I2C_BOARD_INFO(LD_LP8550_NAME, 0x2c),
+               .platform_data = &stingray_lp8550_backlight_data,
+        },
+};
 
 int __init stingray_panel_init(void)
 {
-       /* Display backlight control */
-       tegra_gpio_enable(STINGRAY_AUO_DISP_BL);
-       gpio_request(STINGRAY_AUO_DISP_BL, "auo_disp_bl");
-       gpio_direction_output(STINGRAY_AUO_DISP_BL, 1);
-
-       platform_device_register(&stingray_panel_bl_driver);
+       if (stingray_revision() <= STINGRAY_REVISION_P1) {
+               tegra_gpio_enable(STINGRAY_AUO_DISP_BL);
+               gpio_request(STINGRAY_AUO_DISP_BL, "auo_disp_bl");
+               gpio_direction_output(STINGRAY_AUO_DISP_BL, 1);
+               platform_device_register(&stingray_panel_bl_driver);
+       } else {
+               i2c_register_board_info(0, stingray_i2c_bus1_led_info,
+                       ARRAY_SIZE(stingray_i2c_bus1_led_info));
+       }
 
        return platform_device_register(&tegra_fb_device);
 }