From: Tang Yun ping Date: Mon, 4 May 2015 01:56:14 +0000 (+0800) Subject: RK3368 DDR:Add lcdc type detect for mcu DCF X-Git-Tag: firefly_0821_release~4158^2~147 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=7f9d9341459b8bd167e9d0d54427a31bb1ee448a;p=firefly-linux-kernel-4.4.55.git RK3368 DDR:Add lcdc type detect for mcu DCF Signed-off-by: Tang Yun ping --- diff --git a/drivers/devfreq/ddr_rk3368.c b/drivers/devfreq/ddr_rk3368.c index 4c6614c8f162..d7ed33cd8d3a 100644 --- a/drivers/devfreq/ddr_rk3368.c +++ b/drivers/devfreq/ddr_rk3368.c @@ -246,9 +246,12 @@ end: static void ddr_init(u32 dram_speed_bin, u32 freq) { - printk(KERN_DEBUG pr_fmt("In Func:%s,dram_speed_bin:%d,freq:%d\n"), - __func__, dram_speed_bin, freq); - if (scpi_ddr_init(dram_speed_bin, freq)) + int lcdc_type; + + lcdc_type = rockchip_get_screen_type(); + printk(KERN_DEBUG pr_fmt("In Func:%s,dram_speed_bin:%d,freq:%d,lcdc_type:%d\n"), + __func__, dram_speed_bin, freq, lcdc_type); + if (scpi_ddr_init(dram_speed_bin, freq, lcdc_type)) pr_info("ddr init error\n"); else printk(KERN_DEBUG pr_fmt("%s out\n"), __func__); diff --git a/drivers/mailbox/scpi_protocol.c b/drivers/mailbox/scpi_protocol.c index 78885289123f..9ddb1221545a 100644 --- a/drivers/mailbox/scpi_protocol.c +++ b/drivers/mailbox/scpi_protocol.c @@ -400,13 +400,14 @@ static int scpi_get_version(u32 old, u32 *ver) return ret; } -int scpi_ddr_init(u32 dram_speed_bin, u32 freq) +int scpi_ddr_init(u32 dram_speed_bin, u32 freq, u32 lcdc_type) { struct scpi_data_buf sdata; struct rockchip_mbox_msg mdata; struct __packed1 { u32 dram_speed_bin; u32 freq; + u32 lcdc_type; } tx_buf; struct __packed2 { u32 status; @@ -414,6 +415,7 @@ int scpi_ddr_init(u32 dram_speed_bin, u32 freq) tx_buf.dram_speed_bin = (u32)dram_speed_bin; tx_buf.freq = (u32)freq; + tx_buf.lcdc_type = (u32)lcdc_type; SCPI_SETUP_DBUF(sdata, mdata, SCPI_CL_DDR, SCPI_DDR_INIT, tx_buf, rx_buf); diff --git a/include/linux/scpi_protocol.h b/include/linux/scpi_protocol.h index 4824827f260f..4df7c00a073b 100644 --- a/include/linux/scpi_protocol.h +++ b/include/linux/scpi_protocol.h @@ -37,7 +37,7 @@ struct scpi_opp *scpi_dvfs_get_opps(u8 domain); int scpi_get_sensor(char *name); int scpi_get_sensor_value(u16 sensor, u32 *val); -int scpi_ddr_init(u32 dram_speed_bin, u32 freq); +int scpi_ddr_init(u32 dram_speed_bin, u32 freq, u32 lcdc_type); int scpi_ddr_set_clk_rate(u32 rate); int scpi_ddr_round_rate(u32 m_hz); int scpi_ddr_set_auto_self_refresh(u32 en);