diff options
Diffstat (limited to 'drivers/video/omap2/dss/dsi.c')
-rw-r--r-- | drivers/video/omap2/dss/dsi.c | 42 |
1 files changed, 31 insertions, 11 deletions
diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c index 713e1d9ac0ec..ae6bf1d46c97 100644 --- a/drivers/video/omap2/dss/dsi.c +++ b/drivers/video/omap2/dss/dsi.c | |||
@@ -274,7 +274,8 @@ struct dsi_data { | |||
274 | struct clk *dss_clk; | 274 | struct clk *dss_clk; |
275 | struct clk *sys_clk; | 275 | struct clk *sys_clk; |
276 | 276 | ||
277 | void (*dsi_mux_pads)(bool enable); | 277 | int (*enable_pads)(int dsi_id, unsigned lane_mask); |
278 | void (*disable_pads)(int dsi_id, unsigned lane_mask); | ||
278 | 279 | ||
279 | struct dsi_clock_info current_cinfo; | 280 | struct dsi_clock_info current_cinfo; |
280 | 281 | ||
@@ -2355,6 +2356,24 @@ static int dsi_cio_wait_tx_clk_esc_reset(struct omap_dss_device *dssdev) | |||
2355 | return 0; | 2356 | return 0; |
2356 | } | 2357 | } |
2357 | 2358 | ||
2359 | static unsigned dsi_get_lane_mask(struct omap_dss_device *dssdev) | ||
2360 | { | ||
2361 | unsigned lanes = 0; | ||
2362 | |||
2363 | if (dssdev->phy.dsi.clk_lane != 0) | ||
2364 | lanes |= 1 << (dssdev->phy.dsi.clk_lane - 1); | ||
2365 | if (dssdev->phy.dsi.data1_lane != 0) | ||
2366 | lanes |= 1 << (dssdev->phy.dsi.data1_lane - 1); | ||
2367 | if (dssdev->phy.dsi.data2_lane != 0) | ||
2368 | lanes |= 1 << (dssdev->phy.dsi.data2_lane - 1); | ||
2369 | if (dssdev->phy.dsi.data3_lane != 0) | ||
2370 | lanes |= 1 << (dssdev->phy.dsi.data3_lane - 1); | ||
2371 | if (dssdev->phy.dsi.data4_lane != 0) | ||
2372 | lanes |= 1 << (dssdev->phy.dsi.data4_lane - 1); | ||
2373 | |||
2374 | return lanes; | ||
2375 | } | ||
2376 | |||
2358 | static int dsi_cio_init(struct omap_dss_device *dssdev) | 2377 | static int dsi_cio_init(struct omap_dss_device *dssdev) |
2359 | { | 2378 | { |
2360 | struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev); | 2379 | struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev); |
@@ -2365,8 +2384,9 @@ static int dsi_cio_init(struct omap_dss_device *dssdev) | |||
2365 | 2384 | ||
2366 | DSSDBGF(); | 2385 | DSSDBGF(); |
2367 | 2386 | ||
2368 | if (dsi->dsi_mux_pads) | 2387 | r = dsi->enable_pads(dsidev->id, dsi_get_lane_mask(dssdev)); |
2369 | dsi->dsi_mux_pads(true); | 2388 | if (r) |
2389 | return r; | ||
2370 | 2390 | ||
2371 | dsi_enable_scp_clk(dsidev); | 2391 | dsi_enable_scp_clk(dsidev); |
2372 | 2392 | ||
@@ -2462,19 +2482,18 @@ err_cio_pwr: | |||
2462 | dsi_cio_disable_lane_override(dsidev); | 2482 | dsi_cio_disable_lane_override(dsidev); |
2463 | err_scp_clk_dom: | 2483 | err_scp_clk_dom: |
2464 | dsi_disable_scp_clk(dsidev); | 2484 | dsi_disable_scp_clk(dsidev); |
2465 | if (dsi->dsi_mux_pads) | 2485 | dsi->disable_pads(dsidev->id, dsi_get_lane_mask(dssdev)); |
2466 | dsi->dsi_mux_pads(false); | ||
2467 | return r; | 2486 | return r; |
2468 | } | 2487 | } |
2469 | 2488 | ||
2470 | static void dsi_cio_uninit(struct platform_device *dsidev) | 2489 | static void dsi_cio_uninit(struct omap_dss_device *dssdev) |
2471 | { | 2490 | { |
2491 | struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev); | ||
2472 | struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); | 2492 | struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); |
2473 | 2493 | ||
2474 | dsi_cio_power(dsidev, DSI_COMPLEXIO_POWER_OFF); | 2494 | dsi_cio_power(dsidev, DSI_COMPLEXIO_POWER_OFF); |
2475 | dsi_disable_scp_clk(dsidev); | 2495 | dsi_disable_scp_clk(dsidev); |
2476 | if (dsi->dsi_mux_pads) | 2496 | dsi->disable_pads(dsidev->id, dsi_get_lane_mask(dssdev)); |
2477 | dsi->dsi_mux_pads(false); | ||
2478 | } | 2497 | } |
2479 | 2498 | ||
2480 | static void dsi_config_tx_fifo(struct platform_device *dsidev, | 2499 | static void dsi_config_tx_fifo(struct platform_device *dsidev, |
@@ -4161,7 +4180,7 @@ static int dsi_display_init_dsi(struct omap_dss_device *dssdev) | |||
4161 | 4180 | ||
4162 | return 0; | 4181 | return 0; |
4163 | err3: | 4182 | err3: |
4164 | dsi_cio_uninit(dsidev); | 4183 | dsi_cio_uninit(dssdev); |
4165 | err2: | 4184 | err2: |
4166 | dss_select_dispc_clk_source(OMAP_DSS_CLK_SRC_FCK); | 4185 | dss_select_dispc_clk_source(OMAP_DSS_CLK_SRC_FCK); |
4167 | dss_select_dsi_clk_source(dsi_module, OMAP_DSS_CLK_SRC_FCK); | 4186 | dss_select_dsi_clk_source(dsi_module, OMAP_DSS_CLK_SRC_FCK); |
@@ -4190,7 +4209,7 @@ static void dsi_display_uninit_dsi(struct omap_dss_device *dssdev, | |||
4190 | 4209 | ||
4191 | dss_select_dispc_clk_source(OMAP_DSS_CLK_SRC_FCK); | 4210 | dss_select_dispc_clk_source(OMAP_DSS_CLK_SRC_FCK); |
4192 | dss_select_dsi_clk_source(dsi_module, OMAP_DSS_CLK_SRC_FCK); | 4211 | dss_select_dsi_clk_source(dsi_module, OMAP_DSS_CLK_SRC_FCK); |
4193 | dsi_cio_uninit(dsidev); | 4212 | dsi_cio_uninit(dssdev); |
4194 | dsi_pll_uninit(dsidev, disconnect_lanes); | 4213 | dsi_pll_uninit(dsidev, disconnect_lanes); |
4195 | } | 4214 | } |
4196 | 4215 | ||
@@ -4481,7 +4500,8 @@ static int omap_dsihw_probe(struct platform_device *dsidev) | |||
4481 | 4500 | ||
4482 | dss_plat_data = dsidev->dev.platform_data; | 4501 | dss_plat_data = dsidev->dev.platform_data; |
4483 | board_info = dss_plat_data->board_data; | 4502 | board_info = dss_plat_data->board_data; |
4484 | dsi->dsi_mux_pads = board_info->dsi_mux_pads; | 4503 | dsi->enable_pads = board_info->dsi_enable_pads; |
4504 | dsi->disable_pads = board_info->dsi_disable_pads; | ||
4485 | 4505 | ||
4486 | spin_lock_init(&dsi->irq_lock); | 4506 | spin_lock_init(&dsi->irq_lock); |
4487 | spin_lock_init(&dsi->errors_lock); | 4507 | spin_lock_init(&dsi->errors_lock); |