diff options
Diffstat (limited to 'arch/arm/mach-omap2/board-4430sdp.c')
-rw-r--r-- | arch/arm/mach-omap2/board-4430sdp.c | 196 |
1 files changed, 185 insertions, 11 deletions
diff --git a/arch/arm/mach-omap2/board-4430sdp.c b/arch/arm/mach-omap2/board-4430sdp.c index 56702c5e577..44dc79a33f5 100644 --- a/arch/arm/mach-omap2/board-4430sdp.c +++ b/arch/arm/mach-omap2/board-4430sdp.c @@ -37,6 +37,8 @@ #include <plat/mmc.h> #include <plat/omap4-keypad.h> #include <plat/display.h> +#include <plat/nokia-dsi-panel.h> +#include <plat/syntm12xx.h> #include "mux.h" #include "hsmmc.h" @@ -50,6 +52,10 @@ #define OMAP4_SFH7741_ENABLE_GPIO 188 #define HDMI_GPIO_HPD 60 /* Hot plug pin for HDMI */ #define HDMI_GPIO_LS_OE 41 /* Level shifter for HDMI */ +#define LCD_BL_GPIO 27 +#define LED_PWM2ON 0x03 +#define LED_PWM2OFF 0x04 +#define TWL6030_TOGGLE3 0x92 static const int sdp4430_keymap[] = { KEY(0, 0, KEY_E), @@ -251,6 +257,44 @@ static struct spi_board_info sdp4430_spi_board_info[] __initdata = { }, }; +/* Begin Synaptic Touchscreen TM-01217 */ + +static char *tm12xx_idev_names[] = { + "Synaptic TM12XX TouchPoint 1", + "Synaptic TM12XX TouchPoint 2", + "Synaptic TM12XX TouchPoint 3", + "Synaptic TM12XX TouchPoint 4", + "Synaptic TM12XX TouchPoint 5", + "Synaptic TM12XX TouchPoint 6", + NULL, +}; + +static u8 tm12xx_button_map[] = { + KEY_F1, + KEY_F2, +}; + +static struct tm12xx_ts_platform_data tm12xx_platform_data[] = { + { /* Primary Controller */ + .gpio_intr = 35, + .idev_name = tm12xx_idev_names, + .button_map = tm12xx_button_map, + .num_buttons = ARRAY_SIZE(tm12xx_button_map), + .repeat = 0, + .swap_xy = 1, + }, + { /* Secondary Controller */ + .gpio_intr = 36, + .idev_name = tm12xx_idev_names, + .button_map = tm12xx_button_map, + .num_buttons = ARRAY_SIZE(tm12xx_button_map), + .repeat = 0, + .swap_xy = 1, + }, +}; + +/* End Synaptic Touchscreen TM-01217 */ + static int omap_ethernet_init(void) { int status; @@ -306,16 +350,55 @@ error1: return status; } -static struct platform_device sdp4430_lcd_device = { - .name = "sdp4430_lcd", +int dsi_set_backlight(struct omap_dss_device *dssdev, int level); + +static struct nokia_dsi_panel_data dsi1_panel = { + .name = "taal", + .reset_gpio = 102, + .use_ext_te = false, + .ext_te_gpio = 101, + .use_esd_check = false, + .set_backlight = dsi_set_backlight, +}; + +static struct omap_dss_device sdp4430_lcd_device = { + .name = "lcd", + .driver_name = "taal", + .type = OMAP_DISPLAY_TYPE_DSI, + .data = &dsi1_panel, + .phy.dsi = { + .clk_lane = 1, + .clk_pol = 0, + .data1_lane = 2, + .data1_pol = 0, + .data2_lane = 3, + .data2_pol = 0, + .div = { + .regn = 20, /* 1.92 MHz */ + .regm = 250, /* 240 MHz */ + .regm_dispc = 6, /* 160 MHz */ + .regm_dsi = 6, /* 160 MHz */ + + .lp_clk_div = 9, /* 8.88 MHz */ + + .lck_div = 1, /* 160 MHz */ + .pck_div = 4, /* 40 MHz */ + }, + }, + .channel = OMAP_DSS_CHANNEL_LCD, +}; + +static struct platform_device sdp4430_hdmi_audio_device = { + .name = "hdmi-audio-dai", .id = -1, }; static struct platform_device *sdp4430_devices[] __initdata = { - &sdp4430_lcd_device, &sdp4430_gpio_keys_device, &sdp4430_leds_gpio, &sdp4430_leds_pwm, + &sdp4430_lcd_device, + &sdp4430_hdmi_audio_device, }; static struct omap_lcd_config sdp4430_lcd_config __initdata = { @@ -378,6 +461,10 @@ static struct regulator_consumer_supply sdp4430_vmmc_supply[] = { .dev_name = "omap_hsmmc.0", }, }; +static struct regulator_consumer_supply sdp4430_vcxio_supply[] = { + REGULATOR_SUPPLY("vdds_dsi", "omapdss_dss"), + REGULATOR_SUPPLY("vdds_dsi", "omapdss_dsi1"), +}; static int omap4_twl6030_hsmmc_late_init(struct device *dev) { @@ -524,7 +611,10 @@ static struct regulator_init_data sdp4430_vcxio = { | REGULATOR_MODE_STANDBY, .valid_ops_mask = REGULATOR_CHANGE_MODE | REGULATOR_CHANGE_STATUS, + .always_on = true, }, + .num_consumer_supplies = ARRAY_SIZE(sdp4430_vcxio_supply), + .consumer_supplies = sdp4430_vcxio_supply, }; static struct regulator_init_data sdp4430_vdac = { @@ -556,6 +646,27 @@ static struct regulator_init_data sdp4430_clk32kg = { }, }; +static struct twl4030_codec_audio_data twl6040_audio = { + /* single-step ramp for headset and handsfree */ + .left_step_hs = 0x0f, + .right_step_hs = 0x0f, + .left_step_hf = 0x1d, + .right_step_hf = 0x1d, +}; + +static struct twl4030_codec_vibra_data twl6040_vibra = { + .max_timeout = 15000, + .initial_vibrate = 0, +}; + +static struct twl4030_codec_data twl6040_codec = { + .audio = &twl6040_audio, + .vibra = &twl6040_vibra, + .audpwron_gpio = 127, + .naudint_irq = OMAP44XX_IRQ_SYS_2N, + .irq_base = TWL6040_CODEC_IRQ_BASE, +}; + static struct twl4030_platform_data sdp4430_twldata = { .irq_base = TWL6030_IRQ_BASE, .irq_end = TWL6030_IRQ_END, @@ -572,7 +683,10 @@ static struct twl4030_platform_data sdp4430_twldata = { .vaux2 = &sdp4430_vaux2, .vaux3 = &sdp4430_vaux3, .clk32kg = &sdp4430_clk32kg, - .usb = &omap4_usbphy_data + .usb = &omap4_usbphy_data, + + /* children */ + .codec = &twl6040_codec, }; static struct i2c_board_info __initdata sdp4430_i2c_boardinfo[] = { @@ -583,8 +697,18 @@ static struct i2c_board_info __initdata sdp4430_i2c_boardinfo[] = { .platform_data = &sdp4430_twldata, }, }; +static struct i2c_board_info __initdata sdp4430_i2c_2_boardinfo[] = { + { + I2C_BOARD_INFO("tm12xx_ts_primary", 0x4b), + .platform_data = &tm12xx_platform_data[0], + }, +}; static struct i2c_board_info __initdata sdp4430_i2c_3_boardinfo[] = { { + I2C_BOARD_INFO("tm12xx_ts_secondary", 0x4b), + .platform_data = &tm12xx_platform_data[1], + }, + { I2C_BOARD_INFO("tmp105", 0x48), }, { @@ -596,6 +720,7 @@ static struct i2c_board_info __initdata sdp4430_i2c_4_boardinfo[] = { I2C_BOARD_INFO("hmc5843", 0x1e), }, }; + static int __init omap4_i2c_init(void) { /* @@ -604,8 +729,9 @@ static int __init omap4_i2c_init(void) */ omap_register_i2c_bus(1, 400, sdp4430_i2c_boardinfo, ARRAY_SIZE(sdp4430_i2c_boardinfo)); - omap_register_i2c_bus(2, 400, NULL, 0); - omap_register_i2c_bus(3, 400, sdp4430_i2c_3_boardinfo, + omap_register_i2c_bus(2, 400, sdp4430_i2c_2_boardinfo, + ARRAY_SIZE(sdp4430_i2c_2_boardinfo)); + omap_register_i2c_bus(3, 400, sdp4430_i2c_3_boardinfo, ARRAY_SIZE(sdp4430_i2c_3_boardinfo)); omap_register_i2c_bus(4, 400, sdp4430_i2c_4_boardinfo, ARRAY_SIZE(sdp4430_i2c_4_boardinfo)); @@ -631,6 +757,52 @@ static void __init omap_sfh7741prox_init(void) } } +int dsi_set_backlight(struct omap_dss_device *dssdev, int level) +{ + twl_i2c_write_u8(TWL_MODULE_PWM, 0x7F, LED_PWM2OFF); + + if (level > 1) { + if (level == 255) + level = 0x7F; + else + level = (~(level/2)) & 0x7F; + + twl_i2c_write_u8(TWL6030_MODULE_ID1, 0x30, TWL6030_TOGGLE3); + twl_i2c_write_u8(TWL_MODULE_PWM, level, LED_PWM2ON); + } else if (level <= 1) { + twl_i2c_write_u8(TWL6030_MODULE_ID1, 0x08, TWL6030_TOGGLE3); + twl_i2c_write_u8(TWL6030_MODULE_ID1, 0x38, TWL6030_TOGGLE3); + } + + return 0; +} + +static void sdp4430_lcd_init(void) +{ + u32 reg; + int status; + + reg = omap4_ctrl_pad_readl(OMAP4_CTRL_MODULE_PAD_CORE_CONTROL_DSIPHY); + reg |= OMAP4_DSI1_PIPD_MASK | OMAP4_DSI1_LANEENABLE_MASK; + omap4_ctrl_pad_writel(reg, OMAP4_CTRL_MODULE_PAD_CORE_CONTROL_DSIPHY); + + /* Panel Taal reset and backlight GPIO init */ + status = gpio_request_one(dsi1_panel.reset_gpio, GPIOF_DIR_OUT, + "lcd_reset_gpio"); + if (status) + pr_err("%s: Could not get lcd_reset_gpio\n", __func__); + + if (dsi1_panel.use_ext_te) + omap_mux_init_signal("gpmc_ncs4.gpio_101", + OMAP_PIN_INPUT_PULLUP); + + status = gpio_request_one(LCD_BL_GPIO, GPIOF_DIR_OUT, "lcd_bl_gpio"); + if (status) + pr_err("%s: Could not get lcd_bl_gpio\n", __func__); + + gpio_set_value(LCD_BL_GPIO, 0); +} + static void sdp4430_hdmi_mux_init(void) { /* PAD0_HDMI_HPD_PAD1_HDMI_CEC */ @@ -686,17 +858,19 @@ static struct omap_dss_device sdp4430_hdmi_device = { }; static struct omap_dss_device *sdp4430_dss_devices[] = { + &sdp4430_lcd_device, &sdp4430_hdmi_device, }; static struct omap_dss_board_info sdp4430_dss_data = { .num_devices = ARRAY_SIZE(sdp4430_dss_devices), .devices = sdp4430_dss_devices, - .default_device = &sdp4430_hdmi_device, + .default_device = &sdp4430_lcd_device, }; void omap_4430sdp_display_init(void) { + sdp4430_lcd_init(); sdp4430_hdmi_mux_init(); omap_display_init(&sdp4430_dss_data); } @@ -797,6 +971,10 @@ static void __init omap_4430sdp_init(void) usb_musb_init(&musb_board_data); + status = omap4_keypad_initialization(&sdp4430_keypad_data); + if(status) + pr_err("Keypad initialization failed: %d\n", status); + status = omap_ethernet_init(); if (status) { pr_err("Ethernet initialization failed: %d\n", status); @@ -806,10 +984,6 @@ static void __init omap_4430sdp_init(void) ARRAY_SIZE(sdp4430_spi_board_info)); } - status = omap4_keyboard_init(&sdp4430_keypad_data); - if (status) - pr_err("Keypad initialization failed: %d\n", status); - omap_4430sdp_display_init(); } |