diff options
author | Archit Taneja <archit@ti.com> | 2012-08-14 02:59:22 -0400 |
---|---|---|
committer | Archit Taneja <archit@ti.com> | 2012-09-26 06:59:07 -0400 |
commit | 9e7e9372225a5d70256beb13fbf3b077a437e5be (patch) | |
tree | a2a44c4c75c2e3ccc46c828d5d15263d21918022 | |
parent | e84dc1cc1503150e3bc37268a0b0f0bc0097622c (diff) |
OMAPDSS: DSI: Pass dsi platform device wherever possible
Many of the DSI functions receive the connected panel's omap_dss_device pointer
as an argument. The platform device pointer is then derived via omap_dss_device
pointers.
Most of these functions don't really require omap_dss_device pointer anymore
since we now keep copies of parameters in the driver data which were previously
available only via omap_dss_device. Replace the arguments with platform device
pointers for such functions.
Signed-off-by: Archit Taneja <archit@ti.com>
-rw-r--r-- | drivers/video/omap2/dss/dsi.c | 89 |
1 files changed, 39 insertions, 50 deletions
diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c index abe335abca53..5c82c918d2e3 100644 --- a/drivers/video/omap2/dss/dsi.c +++ b/drivers/video/omap2/dss/dsi.c | |||
@@ -2163,9 +2163,8 @@ static unsigned dsi_get_line_buf_size(struct platform_device *dsidev) | |||
2163 | } | 2163 | } |
2164 | } | 2164 | } |
2165 | 2165 | ||
2166 | static int dsi_set_lane_config(struct omap_dss_device *dssdev) | 2166 | static int dsi_set_lane_config(struct platform_device *dsidev) |
2167 | { | 2167 | { |
2168 | struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev); | ||
2169 | struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); | 2168 | struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); |
2170 | static const u8 offsets[] = { 0, 4, 8, 12, 16 }; | 2169 | static const u8 offsets[] = { 0, 4, 8, 12, 16 }; |
2171 | static const enum dsi_lane_function functions[] = { | 2170 | static const enum dsi_lane_function functions[] = { |
@@ -2307,10 +2306,9 @@ static void dsi_cio_timings(struct platform_device *dsidev) | |||
2307 | } | 2306 | } |
2308 | 2307 | ||
2309 | /* lane masks have lane 0 at lsb. mask_p for positive lines, n for negative */ | 2308 | /* lane masks have lane 0 at lsb. mask_p for positive lines, n for negative */ |
2310 | static void dsi_cio_enable_lane_override(struct omap_dss_device *dssdev, | 2309 | static void dsi_cio_enable_lane_override(struct platform_device *dsidev, |
2311 | unsigned mask_p, unsigned mask_n) | 2310 | unsigned mask_p, unsigned mask_n) |
2312 | { | 2311 | { |
2313 | struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev); | ||
2314 | struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); | 2312 | struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); |
2315 | int i; | 2313 | int i; |
2316 | u32 l; | 2314 | u32 l; |
@@ -2357,9 +2355,8 @@ static void dsi_cio_disable_lane_override(struct platform_device *dsidev) | |||
2357 | REG_FLD_MOD(dsidev, DSI_DSIPHY_CFG10, 0, 22, 17); | 2355 | REG_FLD_MOD(dsidev, DSI_DSIPHY_CFG10, 0, 22, 17); |
2358 | } | 2356 | } |
2359 | 2357 | ||
2360 | static int dsi_cio_wait_tx_clk_esc_reset(struct omap_dss_device *dssdev) | 2358 | static int dsi_cio_wait_tx_clk_esc_reset(struct platform_device *dsidev) |
2361 | { | 2359 | { |
2362 | struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev); | ||
2363 | struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); | 2360 | struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); |
2364 | int t, i; | 2361 | int t, i; |
2365 | bool in_use[DSI_MAX_NR_LANES]; | 2362 | bool in_use[DSI_MAX_NR_LANES]; |
@@ -2407,9 +2404,8 @@ static int dsi_cio_wait_tx_clk_esc_reset(struct omap_dss_device *dssdev) | |||
2407 | } | 2404 | } |
2408 | 2405 | ||
2409 | /* return bitmask of enabled lanes, lane0 being the lsb */ | 2406 | /* return bitmask of enabled lanes, lane0 being the lsb */ |
2410 | static unsigned dsi_get_lane_mask(struct omap_dss_device *dssdev) | 2407 | static unsigned dsi_get_lane_mask(struct platform_device *dsidev) |
2411 | { | 2408 | { |
2412 | struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev); | ||
2413 | struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); | 2409 | struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); |
2414 | unsigned mask = 0; | 2410 | unsigned mask = 0; |
2415 | int i; | 2411 | int i; |
@@ -2422,16 +2418,15 @@ static unsigned dsi_get_lane_mask(struct omap_dss_device *dssdev) | |||
2422 | return mask; | 2418 | return mask; |
2423 | } | 2419 | } |
2424 | 2420 | ||
2425 | static int dsi_cio_init(struct omap_dss_device *dssdev) | 2421 | static int dsi_cio_init(struct platform_device *dsidev) |
2426 | { | 2422 | { |
2427 | struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev); | ||
2428 | struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); | 2423 | struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); |
2429 | int r; | 2424 | int r; |
2430 | u32 l; | 2425 | u32 l; |
2431 | 2426 | ||
2432 | DSSDBGF(); | 2427 | DSSDBGF(); |
2433 | 2428 | ||
2434 | r = dss_dsi_enable_pads(dsi->module_id, dsi_get_lane_mask(dssdev)); | 2429 | r = dss_dsi_enable_pads(dsi->module_id, dsi_get_lane_mask(dsidev)); |
2435 | if (r) | 2430 | if (r) |
2436 | return r; | 2431 | return r; |
2437 | 2432 | ||
@@ -2448,7 +2443,7 @@ static int dsi_cio_init(struct omap_dss_device *dssdev) | |||
2448 | goto err_scp_clk_dom; | 2443 | goto err_scp_clk_dom; |
2449 | } | 2444 | } |
2450 | 2445 | ||
2451 | r = dsi_set_lane_config(dssdev); | 2446 | r = dsi_set_lane_config(dsidev); |
2452 | if (r) | 2447 | if (r) |
2453 | goto err_scp_clk_dom; | 2448 | goto err_scp_clk_dom; |
2454 | 2449 | ||
@@ -2483,7 +2478,7 @@ static int dsi_cio_init(struct omap_dss_device *dssdev) | |||
2483 | mask_p |= 1 << i; | 2478 | mask_p |= 1 << i; |
2484 | } | 2479 | } |
2485 | 2480 | ||
2486 | dsi_cio_enable_lane_override(dssdev, mask_p, 0); | 2481 | dsi_cio_enable_lane_override(dsidev, mask_p, 0); |
2487 | } | 2482 | } |
2488 | 2483 | ||
2489 | r = dsi_cio_power(dsidev, DSI_COMPLEXIO_POWER_ON); | 2484 | r = dsi_cio_power(dsidev, DSI_COMPLEXIO_POWER_ON); |
@@ -2500,7 +2495,7 @@ static int dsi_cio_init(struct omap_dss_device *dssdev) | |||
2500 | dsi_if_enable(dsidev, false); | 2495 | dsi_if_enable(dsidev, false); |
2501 | REG_FLD_MOD(dsidev, DSI_CLK_CTRL, 1, 20, 20); /* LP_CLK_ENABLE */ | 2496 | REG_FLD_MOD(dsidev, DSI_CLK_CTRL, 1, 20, 20); /* LP_CLK_ENABLE */ |
2502 | 2497 | ||
2503 | r = dsi_cio_wait_tx_clk_esc_reset(dssdev); | 2498 | r = dsi_cio_wait_tx_clk_esc_reset(dsidev); |
2504 | if (r) | 2499 | if (r) |
2505 | goto err_tx_clk_esc_rst; | 2500 | goto err_tx_clk_esc_rst; |
2506 | 2501 | ||
@@ -2541,13 +2536,12 @@ err_cio_pwr: | |||
2541 | dsi_cio_disable_lane_override(dsidev); | 2536 | dsi_cio_disable_lane_override(dsidev); |
2542 | err_scp_clk_dom: | 2537 | err_scp_clk_dom: |
2543 | dsi_disable_scp_clk(dsidev); | 2538 | dsi_disable_scp_clk(dsidev); |
2544 | dss_dsi_disable_pads(dsi->module_id, dsi_get_lane_mask(dssdev)); | 2539 | dss_dsi_disable_pads(dsi->module_id, dsi_get_lane_mask(dsidev)); |
2545 | return r; | 2540 | return r; |
2546 | } | 2541 | } |
2547 | 2542 | ||
2548 | static void dsi_cio_uninit(struct omap_dss_device *dssdev) | 2543 | static void dsi_cio_uninit(struct platform_device *dsidev) |
2549 | { | 2544 | { |
2550 | struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev); | ||
2551 | struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); | 2545 | struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); |
2552 | 2546 | ||
2553 | /* DDR_CLK_ALWAYS_ON */ | 2547 | /* DDR_CLK_ALWAYS_ON */ |
@@ -2555,7 +2549,7 @@ static void dsi_cio_uninit(struct omap_dss_device *dssdev) | |||
2555 | 2549 | ||
2556 | dsi_cio_power(dsidev, DSI_COMPLEXIO_POWER_OFF); | 2550 | dsi_cio_power(dsidev, DSI_COMPLEXIO_POWER_OFF); |
2557 | dsi_disable_scp_clk(dsidev); | 2551 | dsi_disable_scp_clk(dsidev); |
2558 | dss_dsi_disable_pads(dsi->module_id, dsi_get_lane_mask(dssdev)); | 2552 | dss_dsi_disable_pads(dsi->module_id, dsi_get_lane_mask(dsidev)); |
2559 | } | 2553 | } |
2560 | 2554 | ||
2561 | static void dsi_config_tx_fifo(struct platform_device *dsidev, | 2555 | static void dsi_config_tx_fifo(struct platform_device *dsidev, |
@@ -3148,10 +3142,9 @@ int dsi_vc_send_null(struct omap_dss_device *dssdev, int channel) | |||
3148 | } | 3142 | } |
3149 | EXPORT_SYMBOL(dsi_vc_send_null); | 3143 | EXPORT_SYMBOL(dsi_vc_send_null); |
3150 | 3144 | ||
3151 | static int dsi_vc_write_nosync_common(struct omap_dss_device *dssdev, | 3145 | static int dsi_vc_write_nosync_common(struct platform_device *dsidev, |
3152 | int channel, u8 *data, int len, enum dss_dsi_content_type type) | 3146 | int channel, u8 *data, int len, enum dss_dsi_content_type type) |
3153 | { | 3147 | { |
3154 | struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev); | ||
3155 | int r; | 3148 | int r; |
3156 | 3149 | ||
3157 | if (len == 0) { | 3150 | if (len == 0) { |
@@ -3182,7 +3175,9 @@ static int dsi_vc_write_nosync_common(struct omap_dss_device *dssdev, | |||
3182 | int dsi_vc_dcs_write_nosync(struct omap_dss_device *dssdev, int channel, | 3175 | int dsi_vc_dcs_write_nosync(struct omap_dss_device *dssdev, int channel, |
3183 | u8 *data, int len) | 3176 | u8 *data, int len) |
3184 | { | 3177 | { |
3185 | return dsi_vc_write_nosync_common(dssdev, channel, data, len, | 3178 | struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev); |
3179 | |||
3180 | return dsi_vc_write_nosync_common(dsidev, channel, data, len, | ||
3186 | DSS_DSI_CONTENT_DCS); | 3181 | DSS_DSI_CONTENT_DCS); |
3187 | } | 3182 | } |
3188 | EXPORT_SYMBOL(dsi_vc_dcs_write_nosync); | 3183 | EXPORT_SYMBOL(dsi_vc_dcs_write_nosync); |
@@ -3190,7 +3185,9 @@ EXPORT_SYMBOL(dsi_vc_dcs_write_nosync); | |||
3190 | int dsi_vc_generic_write_nosync(struct omap_dss_device *dssdev, int channel, | 3185 | int dsi_vc_generic_write_nosync(struct omap_dss_device *dssdev, int channel, |
3191 | u8 *data, int len) | 3186 | u8 *data, int len) |
3192 | { | 3187 | { |
3193 | return dsi_vc_write_nosync_common(dssdev, channel, data, len, | 3188 | struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev); |
3189 | |||
3190 | return dsi_vc_write_nosync_common(dsidev, channel, data, len, | ||
3194 | DSS_DSI_CONTENT_GENERIC); | 3191 | DSS_DSI_CONTENT_GENERIC); |
3195 | } | 3192 | } |
3196 | EXPORT_SYMBOL(dsi_vc_generic_write_nosync); | 3193 | EXPORT_SYMBOL(dsi_vc_generic_write_nosync); |
@@ -3201,7 +3198,7 @@ static int dsi_vc_write_common(struct omap_dss_device *dssdev, int channel, | |||
3201 | struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev); | 3198 | struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev); |
3202 | int r; | 3199 | int r; |
3203 | 3200 | ||
3204 | r = dsi_vc_write_nosync_common(dssdev, channel, data, len, type); | 3201 | r = dsi_vc_write_nosync_common(dsidev, channel, data, len, type); |
3205 | if (r) | 3202 | if (r) |
3206 | goto err; | 3203 | goto err; |
3207 | 3204 | ||
@@ -3279,10 +3276,9 @@ int dsi_vc_generic_write_2(struct omap_dss_device *dssdev, int channel, | |||
3279 | } | 3276 | } |
3280 | EXPORT_SYMBOL(dsi_vc_generic_write_2); | 3277 | EXPORT_SYMBOL(dsi_vc_generic_write_2); |
3281 | 3278 | ||
3282 | static int dsi_vc_dcs_send_read_request(struct omap_dss_device *dssdev, | 3279 | static int dsi_vc_dcs_send_read_request(struct platform_device *dsidev, |
3283 | int channel, u8 dcs_cmd) | 3280 | int channel, u8 dcs_cmd) |
3284 | { | 3281 | { |
3285 | struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev); | ||
3286 | struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); | 3282 | struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); |
3287 | int r; | 3283 | int r; |
3288 | 3284 | ||
@@ -3300,10 +3296,9 @@ static int dsi_vc_dcs_send_read_request(struct omap_dss_device *dssdev, | |||
3300 | return 0; | 3296 | return 0; |
3301 | } | 3297 | } |
3302 | 3298 | ||
3303 | static int dsi_vc_generic_send_read_request(struct omap_dss_device *dssdev, | 3299 | static int dsi_vc_generic_send_read_request(struct platform_device *dsidev, |
3304 | int channel, u8 *reqdata, int reqlen) | 3300 | int channel, u8 *reqdata, int reqlen) |
3305 | { | 3301 | { |
3306 | struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev); | ||
3307 | struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); | 3302 | struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); |
3308 | u16 data; | 3303 | u16 data; |
3309 | u8 data_type; | 3304 | u8 data_type; |
@@ -3452,7 +3447,7 @@ int dsi_vc_dcs_read(struct omap_dss_device *dssdev, int channel, u8 dcs_cmd, | |||
3452 | struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev); | 3447 | struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev); |
3453 | int r; | 3448 | int r; |
3454 | 3449 | ||
3455 | r = dsi_vc_dcs_send_read_request(dssdev, channel, dcs_cmd); | 3450 | r = dsi_vc_dcs_send_read_request(dsidev, channel, dcs_cmd); |
3456 | if (r) | 3451 | if (r) |
3457 | goto err; | 3452 | goto err; |
3458 | 3453 | ||
@@ -3483,7 +3478,7 @@ static int dsi_vc_generic_read(struct omap_dss_device *dssdev, int channel, | |||
3483 | struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev); | 3478 | struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev); |
3484 | int r; | 3479 | int r; |
3485 | 3480 | ||
3486 | r = dsi_vc_generic_send_read_request(dssdev, channel, reqdata, reqlen); | 3481 | r = dsi_vc_generic_send_read_request(dsidev, channel, reqdata, reqlen); |
3487 | if (r) | 3482 | if (r) |
3488 | return r; | 3483 | return r; |
3489 | 3484 | ||
@@ -3765,14 +3760,12 @@ static void dsi_set_hs_tx_timeout(struct platform_device *dsidev, | |||
3765 | (total_ticks * 1000) / (fck / 1000 / 1000)); | 3760 | (total_ticks * 1000) / (fck / 1000 / 1000)); |
3766 | } | 3761 | } |
3767 | 3762 | ||
3768 | static void dsi_config_vp_num_line_buffers(struct omap_dss_device *dssdev) | 3763 | static void dsi_config_vp_num_line_buffers(struct platform_device *dsidev) |
3769 | { | 3764 | { |
3770 | struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev); | ||
3771 | struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); | 3765 | struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); |
3772 | int num_line_buffers; | 3766 | int num_line_buffers; |
3773 | 3767 | ||
3774 | if (dsi->mode == OMAP_DSS_DSI_VIDEO_MODE) { | 3768 | if (dsi->mode == OMAP_DSS_DSI_VIDEO_MODE) { |
3775 | struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); | ||
3776 | int bpp = dsi_get_pixel_size(dsi->pix_fmt); | 3769 | int bpp = dsi_get_pixel_size(dsi->pix_fmt); |
3777 | unsigned line_buf_size = dsi_get_line_buf_size(dsidev); | 3770 | unsigned line_buf_size = dsi_get_line_buf_size(dsidev); |
3778 | struct omap_video_timings *timings = &dsi->timings; | 3771 | struct omap_video_timings *timings = &dsi->timings; |
@@ -3793,9 +3786,8 @@ static void dsi_config_vp_num_line_buffers(struct omap_dss_device *dssdev) | |||
3793 | REG_FLD_MOD(dsidev, DSI_CTRL, num_line_buffers, 13, 12); | 3786 | REG_FLD_MOD(dsidev, DSI_CTRL, num_line_buffers, 13, 12); |
3794 | } | 3787 | } |
3795 | 3788 | ||
3796 | static void dsi_config_vp_sync_events(struct omap_dss_device *dssdev) | 3789 | static void dsi_config_vp_sync_events(struct platform_device *dsidev) |
3797 | { | 3790 | { |
3798 | struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev); | ||
3799 | struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); | 3791 | struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); |
3800 | bool vsync_end = dsi->vm_timings.vp_vsync_end; | 3792 | bool vsync_end = dsi->vm_timings.vp_vsync_end; |
3801 | bool hsync_end = dsi->vm_timings.vp_hsync_end; | 3793 | bool hsync_end = dsi->vm_timings.vp_hsync_end; |
@@ -3812,9 +3804,8 @@ static void dsi_config_vp_sync_events(struct omap_dss_device *dssdev) | |||
3812 | dsi_write_reg(dsidev, DSI_CTRL, r); | 3804 | dsi_write_reg(dsidev, DSI_CTRL, r); |
3813 | } | 3805 | } |
3814 | 3806 | ||
3815 | static void dsi_config_blanking_modes(struct omap_dss_device *dssdev) | 3807 | static void dsi_config_blanking_modes(struct platform_device *dsidev) |
3816 | { | 3808 | { |
3817 | struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev); | ||
3818 | struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); | 3809 | struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); |
3819 | int blanking_mode = dsi->vm_timings.blanking_mode; | 3810 | int blanking_mode = dsi->vm_timings.blanking_mode; |
3820 | int hfp_blanking_mode = dsi->vm_timings.hfp_blanking_mode; | 3811 | int hfp_blanking_mode = dsi->vm_timings.hfp_blanking_mode; |
@@ -4069,11 +4060,11 @@ static int dsi_proto_config(struct omap_dss_device *dssdev) | |||
4069 | 4060 | ||
4070 | dsi_write_reg(dsidev, DSI_CTRL, r); | 4061 | dsi_write_reg(dsidev, DSI_CTRL, r); |
4071 | 4062 | ||
4072 | dsi_config_vp_num_line_buffers(dssdev); | 4063 | dsi_config_vp_num_line_buffers(dsidev); |
4073 | 4064 | ||
4074 | if (dsi->mode == OMAP_DSS_DSI_VIDEO_MODE) { | 4065 | if (dsi->mode == OMAP_DSS_DSI_VIDEO_MODE) { |
4075 | dsi_config_vp_sync_events(dssdev); | 4066 | dsi_config_vp_sync_events(dsidev); |
4076 | dsi_config_blanking_modes(dssdev); | 4067 | dsi_config_blanking_modes(dsidev); |
4077 | dsi_config_cmd_mode_interleaving(dssdev); | 4068 | dsi_config_cmd_mode_interleaving(dssdev); |
4078 | } | 4069 | } |
4079 | 4070 | ||
@@ -4085,9 +4076,8 @@ static int dsi_proto_config(struct omap_dss_device *dssdev) | |||
4085 | return 0; | 4076 | return 0; |
4086 | } | 4077 | } |
4087 | 4078 | ||
4088 | static void dsi_proto_timings(struct omap_dss_device *dssdev) | 4079 | static void dsi_proto_timings(struct platform_device *dsidev) |
4089 | { | 4080 | { |
4090 | struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev); | ||
4091 | struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); | 4081 | struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); |
4092 | unsigned tlpx, tclk_zero, tclk_prepare, tclk_trail; | 4082 | unsigned tlpx, tclk_zero, tclk_prepare, tclk_trail; |
4093 | unsigned tclk_pre, tclk_post; | 4083 | unsigned tclk_pre, tclk_post; |
@@ -4534,8 +4524,7 @@ static void dsi_framedone_timeout_work_callback(struct work_struct *work) | |||
4534 | 4524 | ||
4535 | static void dsi_framedone_irq_callback(void *data, u32 mask) | 4525 | static void dsi_framedone_irq_callback(void *data, u32 mask) |
4536 | { | 4526 | { |
4537 | struct omap_dss_device *dssdev = (struct omap_dss_device *) data; | 4527 | struct platform_device *dsidev = (struct platform_device *) data; |
4538 | struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev); | ||
4539 | struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); | 4528 | struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); |
4540 | 4529 | ||
4541 | /* Note: We get FRAMEDONE when DISPC has finished sending pixels and | 4530 | /* Note: We get FRAMEDONE when DISPC has finished sending pixels and |
@@ -4619,7 +4608,7 @@ static int dsi_display_init_dispc(struct omap_dss_device *dssdev) | |||
4619 | irq = dispc_mgr_get_framedone_irq(dssdev->manager->id); | 4608 | irq = dispc_mgr_get_framedone_irq(dssdev->manager->id); |
4620 | 4609 | ||
4621 | r = omap_dispc_register_isr(dsi_framedone_irq_callback, | 4610 | r = omap_dispc_register_isr(dsi_framedone_irq_callback, |
4622 | (void *) dssdev, irq); | 4611 | (void *) dsidev, irq); |
4623 | if (r) { | 4612 | if (r) { |
4624 | DSSERR("can't get FRAMEDONE irq\n"); | 4613 | DSSERR("can't get FRAMEDONE irq\n"); |
4625 | goto err; | 4614 | goto err; |
@@ -4660,7 +4649,7 @@ static int dsi_display_init_dispc(struct omap_dss_device *dssdev) | |||
4660 | err1: | 4649 | err1: |
4661 | if (dsi->mode == OMAP_DSS_DSI_CMD_MODE) | 4650 | if (dsi->mode == OMAP_DSS_DSI_CMD_MODE) |
4662 | omap_dispc_unregister_isr(dsi_framedone_irq_callback, | 4651 | omap_dispc_unregister_isr(dsi_framedone_irq_callback, |
4663 | (void *) dssdev, irq); | 4652 | (void *) dsidev, irq); |
4664 | err: | 4653 | err: |
4665 | return r; | 4654 | return r; |
4666 | } | 4655 | } |
@@ -4676,7 +4665,7 @@ static void dsi_display_uninit_dispc(struct omap_dss_device *dssdev) | |||
4676 | irq = dispc_mgr_get_framedone_irq(dssdev->manager->id); | 4665 | irq = dispc_mgr_get_framedone_irq(dssdev->manager->id); |
4677 | 4666 | ||
4678 | omap_dispc_unregister_isr(dsi_framedone_irq_callback, | 4667 | omap_dispc_unregister_isr(dsi_framedone_irq_callback, |
4679 | (void *) dssdev, irq); | 4668 | (void *) dsidev, irq); |
4680 | } | 4669 | } |
4681 | } | 4670 | } |
4682 | 4671 | ||
@@ -4726,13 +4715,13 @@ static int dsi_display_init_dsi(struct omap_dss_device *dssdev) | |||
4726 | 4715 | ||
4727 | DSSDBG("PLL OK\n"); | 4716 | DSSDBG("PLL OK\n"); |
4728 | 4717 | ||
4729 | r = dsi_cio_init(dssdev); | 4718 | r = dsi_cio_init(dsidev); |
4730 | if (r) | 4719 | if (r) |
4731 | goto err2; | 4720 | goto err2; |
4732 | 4721 | ||
4733 | _dsi_print_reset_status(dsidev); | 4722 | _dsi_print_reset_status(dsidev); |
4734 | 4723 | ||
4735 | dsi_proto_timings(dssdev); | 4724 | dsi_proto_timings(dsidev); |
4736 | dsi_set_lp_clk_divisor(dssdev); | 4725 | dsi_set_lp_clk_divisor(dssdev); |
4737 | 4726 | ||
4738 | if (1) | 4727 | if (1) |
@@ -4752,7 +4741,7 @@ static int dsi_display_init_dsi(struct omap_dss_device *dssdev) | |||
4752 | 4741 | ||
4753 | return 0; | 4742 | return 0; |
4754 | err3: | 4743 | err3: |
4755 | dsi_cio_uninit(dssdev); | 4744 | dsi_cio_uninit(dsidev); |
4756 | err2: | 4745 | err2: |
4757 | dss_select_dispc_clk_source(OMAP_DSS_CLK_SRC_FCK); | 4746 | dss_select_dispc_clk_source(OMAP_DSS_CLK_SRC_FCK); |
4758 | dss_select_dsi_clk_source(dsi->module_id, OMAP_DSS_CLK_SRC_FCK); | 4747 | dss_select_dsi_clk_source(dsi->module_id, OMAP_DSS_CLK_SRC_FCK); |
@@ -4783,7 +4772,7 @@ static void dsi_display_uninit_dsi(struct omap_dss_device *dssdev, | |||
4783 | dss_select_dispc_clk_source(OMAP_DSS_CLK_SRC_FCK); | 4772 | dss_select_dispc_clk_source(OMAP_DSS_CLK_SRC_FCK); |
4784 | dss_select_dsi_clk_source(dsi->module_id, OMAP_DSS_CLK_SRC_FCK); | 4773 | dss_select_dsi_clk_source(dsi->module_id, OMAP_DSS_CLK_SRC_FCK); |
4785 | dss_select_lcd_clk_source(dssdev->manager->id, OMAP_DSS_CLK_SRC_FCK); | 4774 | dss_select_lcd_clk_source(dssdev->manager->id, OMAP_DSS_CLK_SRC_FCK); |
4786 | dsi_cio_uninit(dssdev); | 4775 | dsi_cio_uninit(dsidev); |
4787 | dsi_pll_uninit(dsidev, disconnect_lanes); | 4776 | dsi_pll_uninit(dsidev, disconnect_lanes); |
4788 | } | 4777 | } |
4789 | 4778 | ||