Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions arch/arm/mach-msm/htc/m4/board-m4.c
Original file line number Diff line number Diff line change
Expand Up @@ -3028,6 +3028,16 @@ static struct platform_device msm8930_device_ext_l2_vreg __devinitdata = {

#else

/* 8930 Phase 2 */
static struct platform_device msm8930_device_ext_5v_vreg __devinitdata = {
.name = GPIO_REGULATOR_DEV_NAME,
.id = 63,
.dev = {
.platform_data = &m4_gpio_regulator_pdata[
MSM8930_GPIO_VREG_ID_EXT_5V],
},
};

/* 8930 Phase 2 */
static struct platform_device msm8930_device_ext_otg_sw_vreg __devinitdata = {
.name = GPIO_REGULATOR_DEV_NAME,
Expand Down Expand Up @@ -3117,6 +3127,7 @@ static struct platform_device *common_devices[] __initdata = {
#endif
&msm8960_device_ssbi_pmic,
#ifdef MSM8930_PHASE_2
&msm8930_device_ext_5v_vreg,
&msm8930_device_ext_otg_sw_vreg,
#endif
#if defined(CONFIG_MSM_CAMERA) && defined(CONFIG_RAWCHIP)
Expand Down
43 changes: 17 additions & 26 deletions arch/arm/mach-msm/htc/m4/display/mipi_m4.c
Original file line number Diff line number Diff line change
Expand Up @@ -1177,14 +1177,16 @@ static struct dsi_cmd_desc cabc_moving_cmds[] = {
};
#endif

static int m4_send_display_cmds(struct dsi_cmd_desc *cmd, int cnt)
static int m4_send_display_cmds(struct dsi_cmd_desc *cmd, int cnt, bool clk_ctrl)
{
int ret = 0;
struct dcs_cmd_req cmdreq;

cmdreq.cmds = cmd;
cmdreq.cmds_cnt = cnt;
cmdreq.flags = CMD_REQ_COMMIT;
if(clk_ctrl)
cmdreq.flags |= CMD_CLK_CTRL;
cmdreq.rlen = 0;
cmdreq.cb = NULL;

Expand All @@ -1209,7 +1211,7 @@ static int mipi_m4_lcd_on(struct platform_device *pdev)
pinfo = &mfd->panel_info;
mipi = &mfd->panel_info.mipi;

m4_send_display_cmds(init_on_cmds, init_on_cmds_count);
m4_send_display_cmds(init_on_cmds, init_on_cmds_count, false);

atomic_set(&lcd_power_state, 1);

Expand All @@ -1235,6 +1237,7 @@ static int mipi_m4_lcd_off(struct platform_device *pdev)
static int mipi_m4_display_on(struct platform_device *pdev)
{
struct msm_fb_data_type *mfd;
bool clk_ctrl;

mfd = platform_get_drvdata(pdev);

Expand All @@ -1245,7 +1248,8 @@ static int mipi_m4_display_on(struct platform_device *pdev)

mipi_dsi_op_mode_config(DSI_CMD_MODE);

m4_send_display_cmds(display_on_cmds, display_on_cmds_count);
clk_ctrl = (mfd->panel_info.type == MIPI_CMD_PANEL);
m4_send_display_cmds(display_on_cmds, display_on_cmds_count, clk_ctrl);

return 0;
}
Expand All @@ -1255,6 +1259,7 @@ DEFINE_LED_TRIGGER(bkl_led_trigger);
static int mipi_m4_display_off(struct platform_device *pdev)
{
struct msm_fb_data_type *mfd;
bool clk_ctrl;

mfd = platform_get_drvdata(pdev);

Expand All @@ -1263,7 +1268,8 @@ static int mipi_m4_display_off(struct platform_device *pdev)
if (mfd->key != MFD_KEY)
return -EINVAL;

m4_send_display_cmds(display_off_cmds, display_off_cmds_count);
clk_ctrl = (mfd->panel_info.type == MIPI_CMD_PANEL);
m4_send_display_cmds(display_off_cmds, display_off_cmds_count, clk_ctrl);

if (wled_trigger_initialized)
led_trigger_event(bkl_led_trigger, 0);
Expand All @@ -1280,12 +1286,14 @@ static int mipi_m4_display_off(struct platform_device *pdev)
#ifdef CONFIG_MSM_CABC_VIDEO_ENHANCE
static void m4_set_cabc(struct msm_fb_data_type *mfd, int mode)
{
bool clk_ctrl = (mfd && mfd->panel_info_type == MIPI_CMD_PANEL);

pr_debug("%s: mode=%d\n", __FUNCTION__, mode);

if (mode == 0)
m4_send_display_cmds(cabc_UI_cmds, ARRAY_SIZE(cabc_UI_cmds));
m4_send_display_cmds(cabc_UI_cmds, ARRAY_SIZE(cabc_UI_cmds), clk_ctrl);
else
m4_send_display_cmds(cabc_moving_cmds, ARRAY_SIZE(cabc_moving_cmds));
m4_send_display_cmds(cabc_moving_cmds, ARRAY_SIZE(cabc_moving_cmds), clk_ctrl);
}
#endif

Expand Down Expand Up @@ -1324,6 +1332,8 @@ static unsigned char m4_shrink_pwm(int val)
static void m4_set_backlight(struct msm_fb_data_type *mfd)
{
struct mipi_panel_info *mipi;
bool clk_ctrl = (mfd && mfd->panel_info.type == MIPI_CMD_PANEL);

led_pwm1[1] = m4_shrink_pwm((unsigned char)(mfd->bl_level));

if (mipi_m4_pdata && (mipi_m4_pdata->enable_wled_bl_ctrl)
Expand All @@ -1348,7 +1358,7 @@ static void m4_set_backlight(struct msm_fb_data_type *mfd)
mipi_dsi_op_mode_config(DSI_CMD_MODE);
}

m4_send_display_cmds(backlight_cmds, backlight_cmds_count);
m4_send_display_cmds(backlight_cmds, backlight_cmds_count, clk_ctrl);

#ifdef CONFIG_BACKLIGHT_WLED_CABC
if (wled_trigger_initialized) {
Expand Down Expand Up @@ -1383,23 +1393,6 @@ static int __devinit mipi_m4_lcd_probe(struct platform_device *pdev)
return 0;
}

static struct mipi_dsi_panel_platform_data m4_pdata = {
.dlane_swap = 0,
#ifdef CONFIG_BACKLIGHT_WLED_CABC
.enable_wled_bl_ctrl = 0x0,
#else
.enable_wled_bl_ctrl = 0x1,
#endif
};

static struct platform_device mipi_dsi_m4_panel_device = {
.name = "mipi_m4",
.id = 0,
.dev = {
.platform_data = &m4_pdata,
}
};

static struct platform_driver this_driver = {
.probe = mipi_m4_lcd_probe,
.driver = {
Expand Down Expand Up @@ -1436,8 +1429,6 @@ int mipi_m4_device_register(struct msm_panel_info *pinfo,
wled_trigger_initialized = 1;
atomic_set(&lcd_power_state, 1);

platform_device_register(&mipi_dsi_m4_panel_device);

ret = platform_driver_register(&this_driver);
if (ret) {
pr_err("platform_driver_register() failed with ret %u\n", ret);
Expand Down