diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/video/omap2/dss/core.c | 35 | ||||
-rw-r--r-- | drivers/video/omap2/dss/dispc.c | 21 | ||||
-rw-r--r-- | drivers/video/omap2/dss/dsi.c | 17 | ||||
-rw-r--r-- | drivers/video/omap2/dss/dss.h | 3 | ||||
-rw-r--r-- | drivers/video/omap2/dss/hdmi.c | 2 |
5 files changed, 43 insertions, 35 deletions
diff --git a/drivers/video/omap2/dss/core.c b/drivers/video/omap2/dss/core.c index 64cb8aa49b26..b37b6f484c08 100644 --- a/drivers/video/omap2/dss/core.c +++ b/drivers/video/omap2/dss/core.c | |||
@@ -87,6 +87,41 @@ struct regulator *dss_get_vdds_sdi(void) | |||
87 | return reg; | 87 | return reg; |
88 | } | 88 | } |
89 | 89 | ||
90 | int dss_get_ctx_loss_count(struct device *dev) | ||
91 | { | ||
92 | struct omap_dss_board_info *board_data = core.pdev->dev.platform_data; | ||
93 | int cnt; | ||
94 | |||
95 | if (!board_data->get_context_loss_count) | ||
96 | return -ENOENT; | ||
97 | |||
98 | cnt = board_data->get_context_loss_count(dev); | ||
99 | |||
100 | WARN_ONCE(cnt < 0, "get_context_loss_count failed: %d\n", cnt); | ||
101 | |||
102 | return cnt; | ||
103 | } | ||
104 | |||
105 | int dss_dsi_enable_pads(int dsi_id, unsigned lane_mask) | ||
106 | { | ||
107 | struct omap_dss_board_info *board_data = core.pdev->dev.platform_data; | ||
108 | |||
109 | if (!board_data->dsi_enable_pads) | ||
110 | return -ENOENT; | ||
111 | |||
112 | return board_data->dsi_enable_pads(dsi_id, lane_mask); | ||
113 | } | ||
114 | |||
115 | void dss_dsi_disable_pads(int dsi_id, unsigned lane_mask) | ||
116 | { | ||
117 | struct omap_dss_board_info *board_data = core.pdev->dev.platform_data; | ||
118 | |||
119 | if (!board_data->dsi_enable_pads) | ||
120 | return; | ||
121 | |||
122 | return board_data->dsi_disable_pads(dsi_id, lane_mask); | ||
123 | } | ||
124 | |||
90 | int dss_set_min_bus_tput(struct device *dev, unsigned long tput) | 125 | int dss_set_min_bus_tput(struct device *dev, unsigned long tput) |
91 | { | 126 | { |
92 | struct omap_dss_board_info *pdata = core.pdev->dev.platform_data; | 127 | struct omap_dss_board_info *pdata = core.pdev->dev.platform_data; |
diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c index 727e15b29a14..2c43119b5ade 100644 --- a/drivers/video/omap2/dss/dispc.c +++ b/drivers/video/omap2/dss/dispc.c | |||
@@ -131,23 +131,6 @@ static inline u32 dispc_read_reg(const u16 idx) | |||
131 | return __raw_readl(dispc.base + idx); | 131 | return __raw_readl(dispc.base + idx); |
132 | } | 132 | } |
133 | 133 | ||
134 | static int dispc_get_ctx_loss_count(void) | ||
135 | { | ||
136 | struct device *dev = &dispc.pdev->dev; | ||
137 | struct omap_display_platform_data *pdata = dev->platform_data; | ||
138 | struct omap_dss_board_info *board_data = pdata->board_data; | ||
139 | int cnt; | ||
140 | |||
141 | if (!board_data->get_context_loss_count) | ||
142 | return -ENOENT; | ||
143 | |||
144 | cnt = board_data->get_context_loss_count(dev); | ||
145 | |||
146 | WARN_ONCE(cnt < 0, "get_context_loss_count failed: %d\n", cnt); | ||
147 | |||
148 | return cnt; | ||
149 | } | ||
150 | |||
151 | #define SR(reg) \ | 134 | #define SR(reg) \ |
152 | dispc.ctx[DISPC_##reg / sizeof(u32)] = dispc_read_reg(DISPC_##reg) | 135 | dispc.ctx[DISPC_##reg / sizeof(u32)] = dispc_read_reg(DISPC_##reg) |
153 | #define RR(reg) \ | 136 | #define RR(reg) \ |
@@ -251,7 +234,7 @@ static void dispc_save_context(void) | |||
251 | if (dss_has_feature(FEAT_CORE_CLK_DIV)) | 234 | if (dss_has_feature(FEAT_CORE_CLK_DIV)) |
252 | SR(DIVISOR); | 235 | SR(DIVISOR); |
253 | 236 | ||
254 | dispc.ctx_loss_cnt = dispc_get_ctx_loss_count(); | 237 | dispc.ctx_loss_cnt = dss_get_ctx_loss_count(&dispc.pdev->dev); |
255 | dispc.ctx_valid = true; | 238 | dispc.ctx_valid = true; |
256 | 239 | ||
257 | DSSDBG("context saved, ctx_loss_count %d\n", dispc.ctx_loss_cnt); | 240 | DSSDBG("context saved, ctx_loss_count %d\n", dispc.ctx_loss_cnt); |
@@ -266,7 +249,7 @@ static void dispc_restore_context(void) | |||
266 | if (!dispc.ctx_valid) | 249 | if (!dispc.ctx_valid) |
267 | return; | 250 | return; |
268 | 251 | ||
269 | ctx = dispc_get_ctx_loss_count(); | 252 | ctx = dss_get_ctx_loss_count(&dispc.pdev->dev); |
270 | 253 | ||
271 | if (ctx >= 0 && ctx == dispc.ctx_loss_cnt) | 254 | if (ctx >= 0 && ctx == dispc.ctx_loss_cnt) |
272 | return; | 255 | return; |
diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c index a243e65b870f..d18c8e290c85 100644 --- a/drivers/video/omap2/dss/dsi.c +++ b/drivers/video/omap2/dss/dsi.c | |||
@@ -261,9 +261,6 @@ struct dsi_data { | |||
261 | struct clk *dss_clk; | 261 | struct clk *dss_clk; |
262 | struct clk *sys_clk; | 262 | struct clk *sys_clk; |
263 | 263 | ||
264 | int (*enable_pads)(int dsi_id, unsigned lane_mask); | ||
265 | void (*disable_pads)(int dsi_id, unsigned lane_mask); | ||
266 | |||
267 | struct dsi_clock_info current_cinfo; | 264 | struct dsi_clock_info current_cinfo; |
268 | 265 | ||
269 | bool vdds_dsi_enabled; | 266 | bool vdds_dsi_enabled; |
@@ -2306,7 +2303,7 @@ static int dsi_cio_init(struct omap_dss_device *dssdev) | |||
2306 | 2303 | ||
2307 | DSSDBGF(); | 2304 | DSSDBGF(); |
2308 | 2305 | ||
2309 | r = dsi->enable_pads(dsi_get_dsidev_id(dsidev), dsi_get_lane_mask(dssdev)); | 2306 | r = dss_dsi_enable_pads(dsi_get_dsidev_id(dsidev), dsi_get_lane_mask(dssdev)); |
2310 | if (r) | 2307 | if (r) |
2311 | return r; | 2308 | return r; |
2312 | 2309 | ||
@@ -2416,21 +2413,20 @@ err_cio_pwr: | |||
2416 | dsi_cio_disable_lane_override(dsidev); | 2413 | dsi_cio_disable_lane_override(dsidev); |
2417 | err_scp_clk_dom: | 2414 | err_scp_clk_dom: |
2418 | dsi_disable_scp_clk(dsidev); | 2415 | dsi_disable_scp_clk(dsidev); |
2419 | dsi->disable_pads(dsi_get_dsidev_id(dsidev), dsi_get_lane_mask(dssdev)); | 2416 | dss_dsi_disable_pads(dsi_get_dsidev_id(dsidev), dsi_get_lane_mask(dssdev)); |
2420 | return r; | 2417 | return r; |
2421 | } | 2418 | } |
2422 | 2419 | ||
2423 | static void dsi_cio_uninit(struct omap_dss_device *dssdev) | 2420 | static void dsi_cio_uninit(struct omap_dss_device *dssdev) |
2424 | { | 2421 | { |
2425 | struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev); | 2422 | struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev); |
2426 | struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); | ||
2427 | 2423 | ||
2428 | /* DDR_CLK_ALWAYS_ON */ | 2424 | /* DDR_CLK_ALWAYS_ON */ |
2429 | REG_FLD_MOD(dsidev, DSI_CLK_CTRL, 0, 13, 13); | 2425 | REG_FLD_MOD(dsidev, DSI_CLK_CTRL, 0, 13, 13); |
2430 | 2426 | ||
2431 | dsi_cio_power(dsidev, DSI_COMPLEXIO_POWER_OFF); | 2427 | dsi_cio_power(dsidev, DSI_COMPLEXIO_POWER_OFF); |
2432 | dsi_disable_scp_clk(dsidev); | 2428 | dsi_disable_scp_clk(dsidev); |
2433 | dsi->disable_pads(dsi_get_dsidev_id(dsidev), dsi_get_lane_mask(dssdev)); | 2429 | dss_dsi_disable_pads(dsi_get_dsidev_id(dsidev), dsi_get_lane_mask(dssdev)); |
2434 | } | 2430 | } |
2435 | 2431 | ||
2436 | static void dsi_config_tx_fifo(struct platform_device *dsidev, | 2432 | static void dsi_config_tx_fifo(struct platform_device *dsidev, |
@@ -4645,8 +4641,6 @@ static void dsi_put_clocks(struct platform_device *dsidev) | |||
4645 | /* DSI1 HW IP initialisation */ | 4641 | /* DSI1 HW IP initialisation */ |
4646 | static int omap_dsihw_probe(struct platform_device *dsidev) | 4642 | static int omap_dsihw_probe(struct platform_device *dsidev) |
4647 | { | 4643 | { |
4648 | struct omap_display_platform_data *dss_plat_data; | ||
4649 | struct omap_dss_board_info *board_info; | ||
4650 | u32 rev; | 4644 | u32 rev; |
4651 | int r, i, dsi_module = dsi_get_dsidev_id(dsidev); | 4645 | int r, i, dsi_module = dsi_get_dsidev_id(dsidev); |
4652 | struct resource *dsi_mem; | 4646 | struct resource *dsi_mem; |
@@ -4660,11 +4654,6 @@ static int omap_dsihw_probe(struct platform_device *dsidev) | |||
4660 | dsi_pdev_map[dsi_module] = dsidev; | 4654 | dsi_pdev_map[dsi_module] = dsidev; |
4661 | dev_set_drvdata(&dsidev->dev, dsi); | 4655 | dev_set_drvdata(&dsidev->dev, dsi); |
4662 | 4656 | ||
4663 | dss_plat_data = dsidev->dev.platform_data; | ||
4664 | board_info = dss_plat_data->board_data; | ||
4665 | dsi->enable_pads = board_info->dsi_enable_pads; | ||
4666 | dsi->disable_pads = board_info->dsi_disable_pads; | ||
4667 | |||
4668 | spin_lock_init(&dsi->irq_lock); | 4657 | spin_lock_init(&dsi->irq_lock); |
4669 | spin_lock_init(&dsi->errors_lock); | 4658 | spin_lock_init(&dsi->errors_lock); |
4670 | dsi->errors = 0; | 4659 | dsi->errors = 0; |
diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h index 8e9e9a5765fa..848fc9cd65d4 100644 --- a/drivers/video/omap2/dss/dss.h +++ b/drivers/video/omap2/dss/dss.h | |||
@@ -159,6 +159,9 @@ struct platform_device; | |||
159 | struct bus_type *dss_get_bus(void); | 159 | struct bus_type *dss_get_bus(void); |
160 | struct regulator *dss_get_vdds_dsi(void); | 160 | struct regulator *dss_get_vdds_dsi(void); |
161 | struct regulator *dss_get_vdds_sdi(void); | 161 | struct regulator *dss_get_vdds_sdi(void); |
162 | int dss_get_ctx_loss_count(struct device *dev); | ||
163 | int dss_dsi_enable_pads(int dsi_id, unsigned lane_mask); | ||
164 | void dss_dsi_disable_pads(int dsi_id, unsigned lane_mask); | ||
162 | int dss_set_min_bus_tput(struct device *dev, unsigned long tput); | 165 | int dss_set_min_bus_tput(struct device *dev, unsigned long tput); |
163 | 166 | ||
164 | /* apply */ | 167 | /* apply */ |
diff --git a/drivers/video/omap2/dss/hdmi.c b/drivers/video/omap2/dss/hdmi.c index 32ad7124a952..043eac676786 100644 --- a/drivers/video/omap2/dss/hdmi.c +++ b/drivers/video/omap2/dss/hdmi.c | |||
@@ -63,7 +63,6 @@ | |||
63 | 63 | ||
64 | static struct { | 64 | static struct { |
65 | struct mutex lock; | 65 | struct mutex lock; |
66 | struct omap_display_platform_data *pdata; | ||
67 | struct platform_device *pdev; | 66 | struct platform_device *pdev; |
68 | struct hdmi_ip_data ip_data; | 67 | struct hdmi_ip_data ip_data; |
69 | 68 | ||
@@ -797,7 +796,6 @@ static int omapdss_hdmihw_probe(struct platform_device *pdev) | |||
797 | struct resource *hdmi_mem; | 796 | struct resource *hdmi_mem; |
798 | int r; | 797 | int r; |
799 | 798 | ||
800 | hdmi.pdata = pdev->dev.platform_data; | ||
801 | hdmi.pdev = pdev; | 799 | hdmi.pdev = pdev; |
802 | 800 | ||
803 | mutex_init(&hdmi.lock); | 801 | mutex_init(&hdmi.lock); |