aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/omap2/dss/dsi.c
diff options
context:
space:
mode:
authorArchit Taneja <archit@ti.com>2011-05-12 07:56:24 -0400
committerTomi Valkeinen <tomi.valkeinen@ti.com>2011-05-12 12:30:26 -0400
commit1ffefe755c2681752a10ae50b2b17e70147bb194 (patch)
treea714387a1c5591169f1247ae2b2393f3e2465e6b /drivers/video/omap2/dss/dsi.c
parent41b21aebe6a9c06e0b906f14bcab7c49b9b72d7a (diff)
OMAP: DSS2: DSI: Add extra omap_dss_device argument in functions exported by dsi
Add pointer to omap_dss_device struct as an argument in the functions which are exported to dsi panel drivers. This argument will tell the DSI driver which DSI interface's data it has to choose. Signed-off-by: Archit Taneja <archit@ti.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/video/omap2/dss/dsi.c')
-rw-r--r--drivers/video/omap2/dss/dsi.c48
1 files changed, 28 insertions, 20 deletions
diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
index 162068f5f6f..6d7148890aa 100644
--- a/drivers/video/omap2/dss/dsi.c
+++ b/drivers/video/omap2/dss/dsi.c
@@ -354,13 +354,13 @@ void dsi_restore_context(void)
354{ 354{
355} 355}
356 356
357void dsi_bus_lock(void) 357void dsi_bus_lock(struct omap_dss_device *dssdev)
358{ 358{
359 down(&dsi.bus_lock); 359 down(&dsi.bus_lock);
360} 360}
361EXPORT_SYMBOL(dsi_bus_lock); 361EXPORT_SYMBOL(dsi_bus_lock);
362 362
363void dsi_bus_unlock(void) 363void dsi_bus_unlock(struct omap_dss_device *dssdev)
364{ 364{
365 up(&dsi.bus_lock); 365 up(&dsi.bus_lock);
366} 366}
@@ -2473,7 +2473,8 @@ static int dsi_vc_config_vp(int channel)
2473} 2473}
2474 2474
2475 2475
2476void omapdss_dsi_vc_enable_hs(int channel, bool enable) 2476void omapdss_dsi_vc_enable_hs(struct omap_dss_device *dssdev, int channel,
2477 bool enable)
2477{ 2478{
2478 DSSDBG("dsi_vc_enable_hs(%d, %d)\n", channel, enable); 2479 DSSDBG("dsi_vc_enable_hs(%d, %d)\n", channel, enable);
2479 2480
@@ -2587,7 +2588,7 @@ static int dsi_vc_send_bta(int channel)
2587 return 0; 2588 return 0;
2588} 2589}
2589 2590
2590int dsi_vc_send_bta_sync(int channel) 2591int dsi_vc_send_bta_sync(struct omap_dss_device *dssdev, int channel)
2591{ 2592{
2592 DECLARE_COMPLETION_ONSTACK(completion); 2593 DECLARE_COMPLETION_ONSTACK(completion);
2593 int r = 0; 2594 int r = 0;
@@ -2751,14 +2752,15 @@ static int dsi_vc_send_short(int channel, u8 data_type, u16 data, u8 ecc)
2751 return 0; 2752 return 0;
2752} 2753}
2753 2754
2754int dsi_vc_send_null(int channel) 2755int dsi_vc_send_null(struct omap_dss_device *dssdev, int channel)
2755{ 2756{
2756 u8 nullpkg[] = {0, 0, 0, 0}; 2757 u8 nullpkg[] = {0, 0, 0, 0};
2757 return dsi_vc_send_long(channel, DSI_DT_NULL_PACKET, nullpkg, 4, 0); 2758 return dsi_vc_send_long(channel, DSI_DT_NULL_PACKET, nullpkg, 4, 0);
2758} 2759}
2759EXPORT_SYMBOL(dsi_vc_send_null); 2760EXPORT_SYMBOL(dsi_vc_send_null);
2760 2761
2761int dsi_vc_dcs_write_nosync(int channel, u8 *data, int len) 2762int dsi_vc_dcs_write_nosync(struct omap_dss_device *dssdev, int channel,
2763 u8 *data, int len)
2762{ 2764{
2763 int r; 2765 int r;
2764 2766
@@ -2780,15 +2782,16 @@ int dsi_vc_dcs_write_nosync(int channel, u8 *data, int len)
2780} 2782}
2781EXPORT_SYMBOL(dsi_vc_dcs_write_nosync); 2783EXPORT_SYMBOL(dsi_vc_dcs_write_nosync);
2782 2784
2783int dsi_vc_dcs_write(int channel, u8 *data, int len) 2785int dsi_vc_dcs_write(struct omap_dss_device *dssdev, int channel, u8 *data,
2786 int len)
2784{ 2787{
2785 int r; 2788 int r;
2786 2789
2787 r = dsi_vc_dcs_write_nosync(channel, data, len); 2790 r = dsi_vc_dcs_write_nosync(dssdev, channel, data, len);
2788 if (r) 2791 if (r)
2789 goto err; 2792 goto err;
2790 2793
2791 r = dsi_vc_send_bta_sync(channel); 2794 r = dsi_vc_send_bta_sync(dssdev, channel);
2792 if (r) 2795 if (r)
2793 goto err; 2796 goto err;
2794 2797
@@ -2807,22 +2810,24 @@ err:
2807} 2810}
2808EXPORT_SYMBOL(dsi_vc_dcs_write); 2811EXPORT_SYMBOL(dsi_vc_dcs_write);
2809 2812
2810int dsi_vc_dcs_write_0(int channel, u8 dcs_cmd) 2813int dsi_vc_dcs_write_0(struct omap_dss_device *dssdev, int channel, u8 dcs_cmd)
2811{ 2814{
2812 return dsi_vc_dcs_write(channel, &dcs_cmd, 1); 2815 return dsi_vc_dcs_write(dssdev, channel, &dcs_cmd, 1);
2813} 2816}
2814EXPORT_SYMBOL(dsi_vc_dcs_write_0); 2817EXPORT_SYMBOL(dsi_vc_dcs_write_0);
2815 2818
2816int dsi_vc_dcs_write_1(int channel, u8 dcs_cmd, u8 param) 2819int dsi_vc_dcs_write_1(struct omap_dss_device *dssdev, int channel, u8 dcs_cmd,
2820 u8 param)
2817{ 2821{
2818 u8 buf[2]; 2822 u8 buf[2];
2819 buf[0] = dcs_cmd; 2823 buf[0] = dcs_cmd;
2820 buf[1] = param; 2824 buf[1] = param;
2821 return dsi_vc_dcs_write(channel, buf, 2); 2825 return dsi_vc_dcs_write(dssdev, channel, buf, 2);
2822} 2826}
2823EXPORT_SYMBOL(dsi_vc_dcs_write_1); 2827EXPORT_SYMBOL(dsi_vc_dcs_write_1);
2824 2828
2825int dsi_vc_dcs_read(int channel, u8 dcs_cmd, u8 *buf, int buflen) 2829int dsi_vc_dcs_read(struct omap_dss_device *dssdev, int channel, u8 dcs_cmd,
2830 u8 *buf, int buflen)
2826{ 2831{
2827 u32 val; 2832 u32 val;
2828 u8 dt; 2833 u8 dt;
@@ -2835,7 +2840,7 @@ int dsi_vc_dcs_read(int channel, u8 dcs_cmd, u8 *buf, int buflen)
2835 if (r) 2840 if (r)
2836 goto err; 2841 goto err;
2837 2842
2838 r = dsi_vc_send_bta_sync(channel); 2843 r = dsi_vc_send_bta_sync(dssdev, channel);
2839 if (r) 2844 if (r)
2840 goto err; 2845 goto err;
2841 2846
@@ -2929,11 +2934,12 @@ err:
2929} 2934}
2930EXPORT_SYMBOL(dsi_vc_dcs_read); 2935EXPORT_SYMBOL(dsi_vc_dcs_read);
2931 2936
2932int dsi_vc_dcs_read_1(int channel, u8 dcs_cmd, u8 *data) 2937int dsi_vc_dcs_read_1(struct omap_dss_device *dssdev, int channel, u8 dcs_cmd,
2938 u8 *data)
2933{ 2939{
2934 int r; 2940 int r;
2935 2941
2936 r = dsi_vc_dcs_read(channel, dcs_cmd, data, 1); 2942 r = dsi_vc_dcs_read(dssdev, channel, dcs_cmd, data, 1);
2937 2943
2938 if (r < 0) 2944 if (r < 0)
2939 return r; 2945 return r;
@@ -2945,12 +2951,13 @@ int dsi_vc_dcs_read_1(int channel, u8 dcs_cmd, u8 *data)
2945} 2951}
2946EXPORT_SYMBOL(dsi_vc_dcs_read_1); 2952EXPORT_SYMBOL(dsi_vc_dcs_read_1);
2947 2953
2948int dsi_vc_dcs_read_2(int channel, u8 dcs_cmd, u8 *data1, u8 *data2) 2954int dsi_vc_dcs_read_2(struct omap_dss_device *dssdev, int channel, u8 dcs_cmd,
2955 u8 *data1, u8 *data2)
2949{ 2956{
2950 u8 buf[2]; 2957 u8 buf[2];
2951 int r; 2958 int r;
2952 2959
2953 r = dsi_vc_dcs_read(channel, dcs_cmd, buf, 2); 2960 r = dsi_vc_dcs_read(dssdev, channel, dcs_cmd, buf, 2);
2954 2961
2955 if (r < 0) 2962 if (r < 0)
2956 return r; 2963 return r;
@@ -2965,7 +2972,8 @@ int dsi_vc_dcs_read_2(int channel, u8 dcs_cmd, u8 *data1, u8 *data2)
2965} 2972}
2966EXPORT_SYMBOL(dsi_vc_dcs_read_2); 2973EXPORT_SYMBOL(dsi_vc_dcs_read_2);
2967 2974
2968int dsi_vc_set_max_rx_packet_size(int channel, u16 len) 2975int dsi_vc_set_max_rx_packet_size(struct omap_dss_device *dssdev, int channel,
2976 u16 len)
2969{ 2977{
2970 return dsi_vc_send_short(channel, DSI_DT_SET_MAX_RET_PKG_SIZE, 2978 return dsi_vc_send_short(channel, DSI_DT_SET_MAX_RET_PKG_SIZE,
2971 len, 0); 2979 len, 0);