aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2013-05-15 04:24:30 -0400
committerTomi Valkeinen <tomi.valkeinen@ti.com>2013-08-29 09:21:52 -0400
commit5cfc1c3cb6f0a5875ea18cc8ea6e0ac4bdde6b95 (patch)
tree09af4fef460e8b5878bd63507fcddc926249da49 /drivers/video
parent164ebdd1107ad1150033acd0e76e4f16456b5ca6 (diff)
OMAPDSS: DSI: remove code related to old panel model
Now that the old panel drivers have been removed, we can remove the old-model API and related code from the DSS encoder drivers. This patch removes the code from the DSI driver. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com> Reviewed-by: Archit Taneja <archit@ti.com>
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/omap2/dss/dsi.c271
1 files changed, 35 insertions, 236 deletions
diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
index 99a043b08f0d..3daaf7ea4281 100644
--- a/drivers/video/omap2/dss/dsi.c
+++ b/drivers/video/omap2/dss/dsi.c
@@ -205,6 +205,8 @@ static int dsi_display_init_dispc(struct platform_device *dsidev,
205static void dsi_display_uninit_dispc(struct platform_device *dsidev, 205static void dsi_display_uninit_dispc(struct platform_device *dsidev,
206 struct omap_overlay_manager *mgr); 206 struct omap_overlay_manager *mgr);
207 207
208static int dsi_vc_send_null(struct omap_dss_device *dssdev, int channel);
209
208#define DSI_MAX_NR_ISRS 2 210#define DSI_MAX_NR_ISRS 2
209#define DSI_MAX_NR_LANES 5 211#define DSI_MAX_NR_LANES 5
210 212
@@ -383,16 +385,7 @@ static inline struct dsi_data *dsi_get_dsidrv_data(struct platform_device *dside
383 385
384static inline struct platform_device *dsi_get_dsidev_from_dssdev(struct omap_dss_device *dssdev) 386static inline struct platform_device *dsi_get_dsidev_from_dssdev(struct omap_dss_device *dssdev)
385{ 387{
386 /* HACK: dssdev can be either the panel device, when using old API, or 388 return to_platform_device(dssdev->dev);
387 * the dsi device itself, when using the new API. So we solve this for
388 * now by checking the dssdev->id. This will be removed when the old API
389 * is removed.
390 */
391 if (dssdev->id == OMAP_DSS_OUTPUT_DSI1 ||
392 dssdev->id == OMAP_DSS_OUTPUT_DSI2)
393 return to_platform_device(dssdev->dev);
394
395 return to_platform_device(dssdev->output->dev);
396} 389}
397 390
398struct platform_device *dsi_get_dsidev_from_id(int module) 391struct platform_device *dsi_get_dsidev_from_id(int module)
@@ -432,23 +425,21 @@ static inline u32 dsi_read_reg(struct platform_device *dsidev,
432 return __raw_readl(dsi->base + idx.idx); 425 return __raw_readl(dsi->base + idx.idx);
433} 426}
434 427
435void dsi_bus_lock(struct omap_dss_device *dssdev) 428static void dsi_bus_lock(struct omap_dss_device *dssdev)
436{ 429{
437 struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev); 430 struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev);
438 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); 431 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev);
439 432
440 down(&dsi->bus_lock); 433 down(&dsi->bus_lock);
441} 434}
442EXPORT_SYMBOL(dsi_bus_lock);
443 435
444void dsi_bus_unlock(struct omap_dss_device *dssdev) 436static void dsi_bus_unlock(struct omap_dss_device *dssdev)
445{ 437{
446 struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev); 438 struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev);
447 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); 439 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev);
448 440
449 up(&dsi->bus_lock); 441 up(&dsi->bus_lock);
450} 442}
451EXPORT_SYMBOL(dsi_bus_unlock);
452 443
453static bool dsi_bus_is_locked(struct platform_device *dsidev) 444static bool dsi_bus_is_locked(struct platform_device *dsidev)
454{ 445{
@@ -2713,7 +2704,7 @@ static int dsi_vc_config_source(struct platform_device *dsidev, int channel,
2713 return 0; 2704 return 0;
2714} 2705}
2715 2706
2716void omapdss_dsi_vc_enable_hs(struct omap_dss_device *dssdev, int channel, 2707static void dsi_vc_enable_hs(struct omap_dss_device *dssdev, int channel,
2717 bool enable) 2708 bool enable)
2718{ 2709{
2719 struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev); 2710 struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev);
@@ -2737,7 +2728,6 @@ void omapdss_dsi_vc_enable_hs(struct omap_dss_device *dssdev, int channel,
2737 if (dsi->vm_timings.ddr_clk_always_on && enable) 2728 if (dsi->vm_timings.ddr_clk_always_on && enable)
2738 dsi_vc_send_null(dssdev, channel); 2729 dsi_vc_send_null(dssdev, channel);
2739} 2730}
2740EXPORT_SYMBOL(omapdss_dsi_vc_enable_hs);
2741 2731
2742static void dsi_vc_flush_long_data(struct platform_device *dsidev, int channel) 2732static void dsi_vc_flush_long_data(struct platform_device *dsidev, int channel)
2743{ 2733{
@@ -2842,7 +2832,7 @@ static int dsi_vc_send_bta(struct platform_device *dsidev, int channel)
2842 return 0; 2832 return 0;
2843} 2833}
2844 2834
2845int dsi_vc_send_bta_sync(struct omap_dss_device *dssdev, int channel) 2835static int dsi_vc_send_bta_sync(struct omap_dss_device *dssdev, int channel)
2846{ 2836{
2847 struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev); 2837 struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev);
2848 DECLARE_COMPLETION_ONSTACK(completion); 2838 DECLARE_COMPLETION_ONSTACK(completion);
@@ -2885,7 +2875,6 @@ err1:
2885err0: 2875err0:
2886 return r; 2876 return r;
2887} 2877}
2888EXPORT_SYMBOL(dsi_vc_send_bta_sync);
2889 2878
2890static inline void dsi_vc_write_long_header(struct platform_device *dsidev, 2879static inline void dsi_vc_write_long_header(struct platform_device *dsidev,
2891 int channel, u8 data_type, u16 len, u8 ecc) 2880 int channel, u8 data_type, u16 len, u8 ecc)
@@ -3011,14 +3000,13 @@ static int dsi_vc_send_short(struct platform_device *dsidev, int channel,
3011 return 0; 3000 return 0;
3012} 3001}
3013 3002
3014int dsi_vc_send_null(struct omap_dss_device *dssdev, int channel) 3003static int dsi_vc_send_null(struct omap_dss_device *dssdev, int channel)
3015{ 3004{
3016 struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev); 3005 struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev);
3017 3006
3018 return dsi_vc_send_long(dsidev, channel, MIPI_DSI_NULL_PACKET, NULL, 3007 return dsi_vc_send_long(dsidev, channel, MIPI_DSI_NULL_PACKET, NULL,
3019 0, 0); 3008 0, 0);
3020} 3009}
3021EXPORT_SYMBOL(dsi_vc_send_null);
3022 3010
3023static int dsi_vc_write_nosync_common(struct platform_device *dsidev, 3011static int dsi_vc_write_nosync_common(struct platform_device *dsidev,
3024 int channel, u8 *data, int len, enum dss_dsi_content_type type) 3012 int channel, u8 *data, int len, enum dss_dsi_content_type type)
@@ -3050,7 +3038,7 @@ static int dsi_vc_write_nosync_common(struct platform_device *dsidev,
3050 return r; 3038 return r;
3051} 3039}
3052 3040
3053int dsi_vc_dcs_write_nosync(struct omap_dss_device *dssdev, int channel, 3041static int dsi_vc_dcs_write_nosync(struct omap_dss_device *dssdev, int channel,
3054 u8 *data, int len) 3042 u8 *data, int len)
3055{ 3043{
3056 struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev); 3044 struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev);
@@ -3058,9 +3046,8 @@ int dsi_vc_dcs_write_nosync(struct omap_dss_device *dssdev, int channel,
3058 return dsi_vc_write_nosync_common(dsidev, channel, data, len, 3046 return dsi_vc_write_nosync_common(dsidev, channel, data, len,
3059 DSS_DSI_CONTENT_DCS); 3047 DSS_DSI_CONTENT_DCS);
3060} 3048}
3061EXPORT_SYMBOL(dsi_vc_dcs_write_nosync);
3062 3049
3063int dsi_vc_generic_write_nosync(struct omap_dss_device *dssdev, int channel, 3050static int dsi_vc_generic_write_nosync(struct omap_dss_device *dssdev, int channel,
3064 u8 *data, int len) 3051 u8 *data, int len)
3065{ 3052{
3066 struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev); 3053 struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev);
@@ -3068,7 +3055,6 @@ int dsi_vc_generic_write_nosync(struct omap_dss_device *dssdev, int channel,
3068 return dsi_vc_write_nosync_common(dsidev, channel, data, len, 3055 return dsi_vc_write_nosync_common(dsidev, channel, data, len,
3069 DSS_DSI_CONTENT_GENERIC); 3056 DSS_DSI_CONTENT_GENERIC);
3070} 3057}
3071EXPORT_SYMBOL(dsi_vc_generic_write_nosync);
3072 3058
3073static int dsi_vc_write_common(struct omap_dss_device *dssdev, int channel, 3059static int dsi_vc_write_common(struct omap_dss_device *dssdev, int channel,
3074 u8 *data, int len, enum dss_dsi_content_type type) 3060 u8 *data, int len, enum dss_dsi_content_type type)
@@ -3099,60 +3085,19 @@ err:
3099 return r; 3085 return r;
3100} 3086}
3101 3087
3102int dsi_vc_dcs_write(struct omap_dss_device *dssdev, int channel, u8 *data, 3088static int dsi_vc_dcs_write(struct omap_dss_device *dssdev, int channel, u8 *data,
3103 int len) 3089 int len)
3104{ 3090{
3105 return dsi_vc_write_common(dssdev, channel, data, len, 3091 return dsi_vc_write_common(dssdev, channel, data, len,
3106 DSS_DSI_CONTENT_DCS); 3092 DSS_DSI_CONTENT_DCS);
3107} 3093}
3108EXPORT_SYMBOL(dsi_vc_dcs_write);
3109 3094
3110int dsi_vc_generic_write(struct omap_dss_device *dssdev, int channel, u8 *data, 3095static int dsi_vc_generic_write(struct omap_dss_device *dssdev, int channel, u8 *data,
3111 int len) 3096 int len)
3112{ 3097{
3113 return dsi_vc_write_common(dssdev, channel, data, len, 3098 return dsi_vc_write_common(dssdev, channel, data, len,
3114 DSS_DSI_CONTENT_GENERIC); 3099 DSS_DSI_CONTENT_GENERIC);
3115} 3100}
3116EXPORT_SYMBOL(dsi_vc_generic_write);
3117
3118int dsi_vc_dcs_write_0(struct omap_dss_device *dssdev, int channel, u8 dcs_cmd)
3119{
3120 return dsi_vc_dcs_write(dssdev, channel, &dcs_cmd, 1);
3121}
3122EXPORT_SYMBOL(dsi_vc_dcs_write_0);
3123
3124int dsi_vc_generic_write_0(struct omap_dss_device *dssdev, int channel)
3125{
3126 return dsi_vc_generic_write(dssdev, channel, NULL, 0);
3127}
3128EXPORT_SYMBOL(dsi_vc_generic_write_0);
3129
3130int dsi_vc_dcs_write_1(struct omap_dss_device *dssdev, int channel, u8 dcs_cmd,
3131 u8 param)
3132{
3133 u8 buf[2];
3134 buf[0] = dcs_cmd;
3135 buf[1] = param;
3136 return dsi_vc_dcs_write(dssdev, channel, buf, 2);
3137}
3138EXPORT_SYMBOL(dsi_vc_dcs_write_1);
3139
3140int dsi_vc_generic_write_1(struct omap_dss_device *dssdev, int channel,
3141 u8 param)
3142{
3143 return dsi_vc_generic_write(dssdev, channel, &param, 1);
3144}
3145EXPORT_SYMBOL(dsi_vc_generic_write_1);
3146
3147int dsi_vc_generic_write_2(struct omap_dss_device *dssdev, int channel,
3148 u8 param1, u8 param2)
3149{
3150 u8 buf[2];
3151 buf[0] = param1;
3152 buf[1] = param2;
3153 return dsi_vc_generic_write(dssdev, channel, buf, 2);
3154}
3155EXPORT_SYMBOL(dsi_vc_generic_write_2);
3156 3101
3157static int dsi_vc_dcs_send_read_request(struct platform_device *dsidev, 3102static int dsi_vc_dcs_send_read_request(struct platform_device *dsidev,
3158 int channel, u8 dcs_cmd) 3103 int channel, u8 dcs_cmd)
@@ -3319,7 +3264,7 @@ err:
3319 return r; 3264 return r;
3320} 3265}
3321 3266
3322int dsi_vc_dcs_read(struct omap_dss_device *dssdev, int channel, u8 dcs_cmd, 3267static int dsi_vc_dcs_read(struct omap_dss_device *dssdev, int channel, u8 dcs_cmd,
3323 u8 *buf, int buflen) 3268 u8 *buf, int buflen)
3324{ 3269{
3325 struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev); 3270 struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev);
@@ -3348,7 +3293,6 @@ err:
3348 DSSERR("dsi_vc_dcs_read(ch %d, cmd 0x%02x) failed\n", channel, dcs_cmd); 3293 DSSERR("dsi_vc_dcs_read(ch %d, cmd 0x%02x) failed\n", channel, dcs_cmd);
3349 return r; 3294 return r;
3350} 3295}
3351EXPORT_SYMBOL(dsi_vc_dcs_read);
3352 3296
3353static int dsi_vc_generic_read(struct omap_dss_device *dssdev, int channel, 3297static int dsi_vc_generic_read(struct omap_dss_device *dssdev, int channel,
3354 u8 *reqdata, int reqlen, u8 *buf, int buflen) 3298 u8 *reqdata, int reqlen, u8 *buf, int buflen)
@@ -3377,56 +3321,7 @@ static int dsi_vc_generic_read(struct omap_dss_device *dssdev, int channel,
3377 return 0; 3321 return 0;
3378} 3322}
3379 3323
3380int dsi_vc_generic_read_0(struct omap_dss_device *dssdev, int channel, u8 *buf, 3324static int dsi_vc_set_max_rx_packet_size(struct omap_dss_device *dssdev, int channel,
3381 int buflen)
3382{
3383 int r;
3384
3385 r = dsi_vc_generic_read(dssdev, channel, NULL, 0, buf, buflen);
3386 if (r) {
3387 DSSERR("dsi_vc_generic_read_0(ch %d) failed\n", channel);
3388 return r;
3389 }
3390
3391 return 0;
3392}
3393EXPORT_SYMBOL(dsi_vc_generic_read_0);
3394
3395int dsi_vc_generic_read_1(struct omap_dss_device *dssdev, int channel, u8 param,
3396 u8 *buf, int buflen)
3397{
3398 int r;
3399
3400 r = dsi_vc_generic_read(dssdev, channel, &param, 1, buf, buflen);
3401 if (r) {
3402 DSSERR("dsi_vc_generic_read_1(ch %d) failed\n", channel);
3403 return r;
3404 }
3405
3406 return 0;
3407}
3408EXPORT_SYMBOL(dsi_vc_generic_read_1);
3409
3410int dsi_vc_generic_read_2(struct omap_dss_device *dssdev, int channel,
3411 u8 param1, u8 param2, u8 *buf, int buflen)
3412{
3413 int r;
3414 u8 reqdata[2];
3415
3416 reqdata[0] = param1;
3417 reqdata[1] = param2;
3418
3419 r = dsi_vc_generic_read(dssdev, channel, reqdata, 2, buf, buflen);
3420 if (r) {
3421 DSSERR("dsi_vc_generic_read_2(ch %d) failed\n", channel);
3422 return r;
3423 }
3424
3425 return 0;
3426}
3427EXPORT_SYMBOL(dsi_vc_generic_read_2);
3428
3429int dsi_vc_set_max_rx_packet_size(struct omap_dss_device *dssdev, int channel,
3430 u16 len) 3325 u16 len)
3431{ 3326{
3432 struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev); 3327 struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev);
@@ -3434,7 +3329,6 @@ int dsi_vc_set_max_rx_packet_size(struct omap_dss_device *dssdev, int channel,
3434 return dsi_vc_send_short(dsidev, channel, 3329 return dsi_vc_send_short(dsidev, channel,
3435 MIPI_DSI_SET_MAXIMUM_RETURN_PACKET_SIZE, len, 0); 3330 MIPI_DSI_SET_MAXIMUM_RETURN_PACKET_SIZE, len, 0);
3436} 3331}
3437EXPORT_SYMBOL(dsi_vc_set_max_rx_packet_size);
3438 3332
3439static int dsi_enter_ulps(struct platform_device *dsidev) 3333static int dsi_enter_ulps(struct platform_device *dsidev)
3440{ 3334{
@@ -4068,7 +3962,7 @@ static void dsi_proto_timings(struct platform_device *dsidev)
4068 } 3962 }
4069} 3963}
4070 3964
4071int omapdss_dsi_configure_pins(struct omap_dss_device *dssdev, 3965static int dsi_configure_pins(struct omap_dss_device *dssdev,
4072 const struct omap_dsi_pin_config *pin_cfg) 3966 const struct omap_dsi_pin_config *pin_cfg)
4073{ 3967{
4074 struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev); 3968 struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev);
@@ -4134,9 +4028,8 @@ int omapdss_dsi_configure_pins(struct omap_dss_device *dssdev,
4134 4028
4135 return 0; 4029 return 0;
4136} 4030}
4137EXPORT_SYMBOL(omapdss_dsi_configure_pins);
4138 4031
4139int dsi_enable_video_output(struct omap_dss_device *dssdev, int channel) 4032static int dsi_enable_video_output(struct omap_dss_device *dssdev, int channel)
4140{ 4033{
4141 struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev); 4034 struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev);
4142 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); 4035 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev);
@@ -4206,9 +4099,8 @@ err_pix_fmt:
4206err_init_dispc: 4099err_init_dispc:
4207 return r; 4100 return r;
4208} 4101}
4209EXPORT_SYMBOL(dsi_enable_video_output);
4210 4102
4211void dsi_disable_video_output(struct omap_dss_device *dssdev, int channel) 4103static void dsi_disable_video_output(struct omap_dss_device *dssdev, int channel)
4212{ 4104{
4213 struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev); 4105 struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev);
4214 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); 4106 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev);
@@ -4229,7 +4121,6 @@ void dsi_disable_video_output(struct omap_dss_device *dssdev, int channel)
4229 4121
4230 dsi_display_uninit_dispc(dsidev, mgr); 4122 dsi_display_uninit_dispc(dsidev, mgr);
4231} 4123}
4232EXPORT_SYMBOL(dsi_disable_video_output);
4233 4124
4234static void dsi_update_screen_dispc(struct platform_device *dsidev) 4125static void dsi_update_screen_dispc(struct platform_device *dsidev)
4235{ 4126{
@@ -4369,7 +4260,7 @@ static void dsi_framedone_irq_callback(void *data)
4369 dsi_handle_framedone(dsidev, 0); 4260 dsi_handle_framedone(dsidev, 0);
4370} 4261}
4371 4262
4372int omap_dsi_update(struct omap_dss_device *dssdev, int channel, 4263static int dsi_update(struct omap_dss_device *dssdev, int channel,
4373 void (*callback)(int, void *), void *data) 4264 void (*callback)(int, void *), void *data)
4374{ 4265{
4375 struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev); 4266 struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev);
@@ -4394,7 +4285,6 @@ int omap_dsi_update(struct omap_dss_device *dssdev, int channel,
4394 4285
4395 return 0; 4286 return 0;
4396} 4287}
4397EXPORT_SYMBOL(omap_dsi_update);
4398 4288
4399/* Display funcs */ 4289/* Display funcs */
4400 4290
@@ -4589,7 +4479,7 @@ static void dsi_display_uninit_dsi(struct platform_device *dsidev,
4589 dsi_pll_uninit(dsidev, disconnect_lanes); 4479 dsi_pll_uninit(dsidev, disconnect_lanes);
4590} 4480}
4591 4481
4592int omapdss_dsi_display_enable(struct omap_dss_device *dssdev) 4482static int dsi_display_enable(struct omap_dss_device *dssdev)
4593{ 4483{
4594 struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev); 4484 struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev);
4595 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); 4485 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev);
@@ -4625,9 +4515,8 @@ err_get_dsi:
4625 DSSDBG("dsi_display_enable FAILED\n"); 4515 DSSDBG("dsi_display_enable FAILED\n");
4626 return r; 4516 return r;
4627} 4517}
4628EXPORT_SYMBOL(omapdss_dsi_display_enable);
4629 4518
4630void omapdss_dsi_display_disable(struct omap_dss_device *dssdev, 4519static void dsi_display_disable(struct omap_dss_device *dssdev,
4631 bool disconnect_lanes, bool enter_ulps) 4520 bool disconnect_lanes, bool enter_ulps)
4632{ 4521{
4633 struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev); 4522 struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev);
@@ -4651,9 +4540,8 @@ void omapdss_dsi_display_disable(struct omap_dss_device *dssdev,
4651 4540
4652 mutex_unlock(&dsi->lock); 4541 mutex_unlock(&dsi->lock);
4653} 4542}
4654EXPORT_SYMBOL(omapdss_dsi_display_disable);
4655 4543
4656int omapdss_dsi_enable_te(struct omap_dss_device *dssdev, bool enable) 4544static int dsi_enable_te(struct omap_dss_device *dssdev, bool enable)
4657{ 4545{
4658 struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev); 4546 struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev);
4659 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); 4547 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev);
@@ -4661,7 +4549,6 @@ int omapdss_dsi_enable_te(struct omap_dss_device *dssdev, bool enable)
4661 dsi->te_enabled = enable; 4549 dsi->te_enabled = enable;
4662 return 0; 4550 return 0;
4663} 4551}
4664EXPORT_SYMBOL(omapdss_dsi_enable_te);
4665 4552
4666#ifdef PRINT_VERBOSE_VM_TIMINGS 4553#ifdef PRINT_VERBOSE_VM_TIMINGS
4667static void print_dsi_vm(const char *str, 4554static void print_dsi_vm(const char *str,
@@ -5136,7 +5023,7 @@ static bool dsi_vm_calc(struct dsi_data *dsi,
5136 dsi_vm_calc_pll_cb, ctx); 5023 dsi_vm_calc_pll_cb, ctx);
5137} 5024}
5138 5025
5139int omapdss_dsi_set_config(struct omap_dss_device *dssdev, 5026static int dsi_set_config(struct omap_dss_device *dssdev,
5140 const struct omap_dss_dsi_config *config) 5027 const struct omap_dss_dsi_config *config)
5141{ 5028{
5142 struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev); 5029 struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev);
@@ -5184,7 +5071,6 @@ err:
5184 5071
5185 return r; 5072 return r;
5186} 5073}
5187EXPORT_SYMBOL(omapdss_dsi_set_config);
5188 5074
5189/* 5075/*
5190 * Return a hardcoded channel for the DSI output. This should work for 5076 * Return a hardcoded channel for the DSI output. This should work for
@@ -5235,7 +5121,7 @@ static enum omap_channel dsi_get_channel(int module_id)
5235 } 5121 }
5236} 5122}
5237 5123
5238int omap_dsi_request_vc(struct omap_dss_device *dssdev, int *channel) 5124static int dsi_request_vc(struct omap_dss_device *dssdev, int *channel)
5239{ 5125{
5240 struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev); 5126 struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev);
5241 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); 5127 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev);
@@ -5252,9 +5138,8 @@ int omap_dsi_request_vc(struct omap_dss_device *dssdev, int *channel)
5252 DSSERR("cannot get VC for display %s", dssdev->name); 5138 DSSERR("cannot get VC for display %s", dssdev->name);
5253 return -ENOSPC; 5139 return -ENOSPC;
5254} 5140}
5255EXPORT_SYMBOL(omap_dsi_request_vc);
5256 5141
5257int omap_dsi_set_vc_id(struct omap_dss_device *dssdev, int channel, int vc_id) 5142static int dsi_set_vc_id(struct omap_dss_device *dssdev, int channel, int vc_id)
5258{ 5143{
5259 struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev); 5144 struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev);
5260 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); 5145 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev);
@@ -5279,9 +5164,8 @@ int omap_dsi_set_vc_id(struct omap_dss_device *dssdev, int channel, int vc_id)
5279 5164
5280 return 0; 5165 return 0;
5281} 5166}
5282EXPORT_SYMBOL(omap_dsi_set_vc_id);
5283 5167
5284void omap_dsi_release_vc(struct omap_dss_device *dssdev, int channel) 5168static void dsi_release_vc(struct omap_dss_device *dssdev, int channel)
5285{ 5169{
5286 struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev); 5170 struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev);
5287 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); 5171 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev);
@@ -5292,7 +5176,6 @@ void omap_dsi_release_vc(struct omap_dss_device *dssdev, int channel)
5292 dsi->vc[channel].vc_id = 0; 5176 dsi->vc[channel].vc_id = 0;
5293 } 5177 }
5294} 5178}
5295EXPORT_SYMBOL(omap_dsi_release_vc);
5296 5179
5297void dsi_wait_pll_hsdiv_dispc_active(struct platform_device *dsidev) 5180void dsi_wait_pll_hsdiv_dispc_active(struct platform_device *dsidev)
5298{ 5181{
@@ -5348,79 +5231,6 @@ static int dsi_get_clocks(struct platform_device *dsidev)
5348 return 0; 5231 return 0;
5349} 5232}
5350 5233
5351static struct omap_dss_device *dsi_find_dssdev(struct platform_device *pdev)
5352{
5353 struct omap_dss_board_info *pdata = pdev->dev.platform_data;
5354 struct dsi_data *dsi = dsi_get_dsidrv_data(pdev);
5355 const char *def_disp_name = omapdss_get_default_display_name();
5356 struct omap_dss_device *def_dssdev;
5357 int i;
5358
5359 def_dssdev = NULL;
5360
5361 for (i = 0; i < pdata->num_devices; ++i) {
5362 struct omap_dss_device *dssdev = pdata->devices[i];
5363
5364 if (dssdev->type != OMAP_DISPLAY_TYPE_DSI)
5365 continue;
5366
5367 if (dssdev->phy.dsi.module != dsi->module_id)
5368 continue;
5369
5370 if (def_dssdev == NULL)
5371 def_dssdev = dssdev;
5372
5373 if (def_disp_name != NULL &&
5374 strcmp(dssdev->name, def_disp_name) == 0) {
5375 def_dssdev = dssdev;
5376 break;
5377 }
5378 }
5379
5380 return def_dssdev;
5381}
5382
5383static int dsi_probe_pdata(struct platform_device *dsidev)
5384{
5385 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev);
5386 struct omap_dss_device *plat_dssdev;
5387 struct omap_dss_device *dssdev;
5388 int r;
5389
5390 plat_dssdev = dsi_find_dssdev(dsidev);
5391
5392 if (!plat_dssdev)
5393 return 0;
5394
5395 r = dsi_regulator_init(dsidev);
5396 if (r)
5397 return r;
5398
5399 dssdev = dss_alloc_and_init_device(&dsidev->dev);
5400 if (!dssdev)
5401 return -ENOMEM;
5402
5403 dss_copy_device_pdata(dssdev, plat_dssdev);
5404
5405 r = omapdss_output_set_device(&dsi->output, dssdev);
5406 if (r) {
5407 DSSERR("failed to connect output to new device: %s\n",
5408 dssdev->name);
5409 dss_put_device(dssdev);
5410 return r;
5411 }
5412
5413 r = dss_add_device(dssdev);
5414 if (r) {
5415 DSSERR("device %s register failed: %d\n", dssdev->name, r);
5416 omapdss_output_unset_device(&dsi->output);
5417 dss_put_device(dssdev);
5418 return r;
5419 }
5420
5421 return 0;
5422}
5423
5424static int dsi_connect(struct omap_dss_device *dssdev, 5234static int dsi_connect(struct omap_dss_device *dssdev,
5425 struct omap_dss_device *dst) 5235 struct omap_dss_device *dst)
5426{ 5236{
@@ -5472,24 +5282,24 @@ static const struct omapdss_dsi_ops dsi_ops = {
5472 .bus_lock = dsi_bus_lock, 5282 .bus_lock = dsi_bus_lock,
5473 .bus_unlock = dsi_bus_unlock, 5283 .bus_unlock = dsi_bus_unlock,
5474 5284
5475 .enable = omapdss_dsi_display_enable, 5285 .enable = dsi_display_enable,
5476 .disable = omapdss_dsi_display_disable, 5286 .disable = dsi_display_disable,
5477 5287
5478 .enable_hs = omapdss_dsi_vc_enable_hs, 5288 .enable_hs = dsi_vc_enable_hs,
5479 5289
5480 .configure_pins = omapdss_dsi_configure_pins, 5290 .configure_pins = dsi_configure_pins,
5481 .set_config = omapdss_dsi_set_config, 5291 .set_config = dsi_set_config,
5482 5292
5483 .enable_video_output = dsi_enable_video_output, 5293 .enable_video_output = dsi_enable_video_output,
5484 .disable_video_output = dsi_disable_video_output, 5294 .disable_video_output = dsi_disable_video_output,
5485 5295
5486 .update = omap_dsi_update, 5296 .update = dsi_update,
5487 5297
5488 .enable_te = omapdss_dsi_enable_te, 5298 .enable_te = dsi_enable_te,
5489 5299
5490 .request_vc = omap_dsi_request_vc, 5300 .request_vc = dsi_request_vc,
5491 .set_vc_id = omap_dsi_set_vc_id, 5301 .set_vc_id = dsi_set_vc_id,
5492 .release_vc = omap_dsi_release_vc, 5302 .release_vc = dsi_release_vc,
5493 5303
5494 .dcs_write = dsi_vc_dcs_write, 5304 .dcs_write = dsi_vc_dcs_write,
5495 .dcs_write_nosync = dsi_vc_dcs_write_nosync, 5305 .dcs_write_nosync = dsi_vc_dcs_write_nosync,
@@ -5627,12 +5437,6 @@ static int omap_dsihw_probe(struct platform_device *dsidev)
5627 5437
5628 dsi_init_output(dsidev); 5438 dsi_init_output(dsidev);
5629 5439
5630 if (dsidev->dev.platform_data) {
5631 r = dsi_probe_pdata(dsidev);
5632 if (r)
5633 goto err_probe;
5634 }
5635
5636 dsi_runtime_put(dsidev); 5440 dsi_runtime_put(dsidev);
5637 5441
5638 if (dsi->module_id == 0) 5442 if (dsi->module_id == 0)
@@ -5648,9 +5452,6 @@ static int omap_dsihw_probe(struct platform_device *dsidev)
5648#endif 5452#endif
5649 return 0; 5453 return 0;
5650 5454
5651err_probe:
5652 dsi_runtime_put(dsidev);
5653 dsi_uninit_output(dsidev);
5654err_runtime_get: 5455err_runtime_get:
5655 pm_runtime_disable(&dsidev->dev); 5456 pm_runtime_disable(&dsidev->dev);
5656 return r; 5457 return r;
@@ -5662,8 +5463,6 @@ static int __exit omap_dsihw_remove(struct platform_device *dsidev)
5662 5463
5663 WARN_ON(dsi->scp_clk_refcount > 0); 5464 WARN_ON(dsi->scp_clk_refcount > 0);
5664 5465
5665 dss_unregister_child_devices(&dsidev->dev);
5666
5667 dsi_uninit_output(dsidev); 5466 dsi_uninit_output(dsidev);
5668 5467
5669 pm_runtime_disable(&dsidev->dev); 5468 pm_runtime_disable(&dsidev->dev);