RK3368 DDR:Add lcdc type detect for mcu DCF
authorTang Yun ping <typ@rock-chips.com>
Mon, 4 May 2015 01:56:14 +0000 (09:56 +0800)
committerTang Yun ping <typ@rock-chips.com>
Mon, 4 May 2015 06:11:32 +0000 (14:11 +0800)
Signed-off-by: Tang Yun ping <typ@rock-chips.com>
drivers/devfreq/ddr_rk3368.c
drivers/mailbox/scpi_protocol.c
include/linux/scpi_protocol.h

index 4c6614c8f162d415b752880934bbc7044e5d8f89..d7ed33cd8d3a4bbb07bf3c73fbabfc0baf1c7d19 100644 (file)
@@ -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__);
index 78885289123f7fd6055130455c6a60696767c243..9ddb1221545a049341b106f4a37b22352992c7bc 100644 (file)
@@ -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);
index 4824827f260f8bc1b296f28b35d54141a4b7136e..4df7c00a073b742947ab55173f79f559b78bc421 100644 (file)
@@ -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);