aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/arm/mach-omap2/display.c39
-rw-r--r--drivers/video/omap2/dss/core.c35
-rw-r--r--drivers/video/omap2/dss/dispc.c21
-rw-r--r--drivers/video/omap2/dss/dsi.c17
-rw-r--r--drivers/video/omap2/dss/dss.h3
-rw-r--r--drivers/video/omap2/dss/hdmi.c2
-rw-r--r--include/video/omapdss.h5
7 files changed, 62 insertions, 60 deletions
diff --git a/arch/arm/mach-omap2/display.c b/arch/arm/mach-omap2/display.c
index 60cded4738a0..07232fd7ab17 100644
--- a/arch/arm/mach-omap2/display.c
+++ b/arch/arm/mach-omap2/display.c
@@ -191,10 +191,24 @@ int __init omap_display_init(struct omap_dss_board_info *board_data)
191 struct omap_hwmod *oh; 191 struct omap_hwmod *oh;
192 struct platform_device *pdev; 192 struct platform_device *pdev;
193 int i, oh_count; 193 int i, oh_count;
194 struct omap_display_platform_data pdata;
195 const struct omap_dss_hwmod_data *curr_dss_hwmod; 194 const struct omap_dss_hwmod_data *curr_dss_hwmod;
196 195
197 memset(&pdata, 0, sizeof(pdata)); 196 /* create omapdss device */
197
198 board_data->dsi_enable_pads = omap_dsi_enable_pads;
199 board_data->dsi_disable_pads = omap_dsi_disable_pads;
200 board_data->get_context_loss_count = omap_pm_get_dev_context_loss_count;
201 board_data->set_min_bus_tput = omap_dss_set_min_bus_tput;
202
203 omap_display_device.dev.platform_data = board_data;
204
205 r = platform_device_register(&omap_display_device);
206 if (r < 0) {
207 pr_err("Unable to register omapdss device\n");
208 return r;
209 }
210
211 /* create devices for dss hwmods */
198 212
199 if (cpu_is_omap24xx()) { 213 if (cpu_is_omap24xx()) {
200 curr_dss_hwmod = omap2_dss_hwmod_data; 214 curr_dss_hwmod = omap2_dss_hwmod_data;
@@ -207,16 +221,6 @@ int __init omap_display_init(struct omap_dss_board_info *board_data)
207 oh_count = ARRAY_SIZE(omap4_dss_hwmod_data); 221 oh_count = ARRAY_SIZE(omap4_dss_hwmod_data);
208 } 222 }
209 223
210 if (board_data->dsi_enable_pads == NULL)
211 board_data->dsi_enable_pads = omap_dsi_enable_pads;
212 if (board_data->dsi_disable_pads == NULL)
213 board_data->dsi_disable_pads = omap_dsi_disable_pads;
214
215 pdata.board_data = board_data;
216 pdata.board_data->get_context_loss_count =
217 omap_pm_get_dev_context_loss_count;
218 pdata.board_data->set_min_bus_tput = omap_dss_set_min_bus_tput;
219
220 for (i = 0; i < oh_count; i++) { 224 for (i = 0; i < oh_count; i++) {
221 oh = omap_hwmod_lookup(curr_dss_hwmod[i].oh_name); 225 oh = omap_hwmod_lookup(curr_dss_hwmod[i].oh_name);
222 if (!oh) { 226 if (!oh) {
@@ -226,21 +230,16 @@ int __init omap_display_init(struct omap_dss_board_info *board_data)
226 } 230 }
227 231
228 pdev = omap_device_build(curr_dss_hwmod[i].dev_name, 232 pdev = omap_device_build(curr_dss_hwmod[i].dev_name,
229 curr_dss_hwmod[i].id, oh, &pdata, 233 curr_dss_hwmod[i].id, oh,
230 sizeof(struct omap_display_platform_data), 234 NULL, 0,
231 NULL, 0, 0); 235 NULL, 0, 0);
232 236
233 if (WARN((IS_ERR(pdev)), "Could not build omap_device for %s\n", 237 if (WARN((IS_ERR(pdev)), "Could not build omap_device for %s\n",
234 curr_dss_hwmod[i].oh_name)) 238 curr_dss_hwmod[i].oh_name))
235 return -ENODEV; 239 return -ENODEV;
236 } 240 }
237 omap_display_device.dev.platform_data = board_data;
238 241
239 r = platform_device_register(&omap_display_device); 242 return 0;
240 if (r < 0)
241 printk(KERN_ERR "Unable to register OMAP-Display device\n");
242
243 return r;
244} 243}
245 244
246static void dispc_disable_outputs(void) 245static void dispc_disable_outputs(void)
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
90int 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
105int 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
115void 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
90int dss_set_min_bus_tput(struct device *dev, unsigned long tput) 125int 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
134static 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);
2417err_scp_clk_dom: 2414err_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
2423static void dsi_cio_uninit(struct omap_dss_device *dssdev) 2420static 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
2436static void dsi_config_tx_fifo(struct platform_device *dsidev, 2432static 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 */
4646static int omap_dsihw_probe(struct platform_device *dsidev) 4642static 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;
159struct bus_type *dss_get_bus(void); 159struct bus_type *dss_get_bus(void);
160struct regulator *dss_get_vdds_dsi(void); 160struct regulator *dss_get_vdds_dsi(void);
161struct regulator *dss_get_vdds_sdi(void); 161struct regulator *dss_get_vdds_sdi(void);
162int dss_get_ctx_loss_count(struct device *dev);
163int dss_dsi_enable_pads(int dsi_id, unsigned lane_mask);
164void dss_dsi_disable_pads(int dsi_id, unsigned lane_mask);
162int dss_set_min_bus_tput(struct device *dev, unsigned long tput); 165int 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
64static struct { 64static 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);
diff --git a/include/video/omapdss.h b/include/video/omapdss.h
index 1cbb2dd5fbba..1217df40cb7e 100644
--- a/include/video/omapdss.h
+++ b/include/video/omapdss.h
@@ -317,11 +317,6 @@ extern int omap_display_init(struct omap_dss_board_info *board_data);
317/* HDMI mux init*/ 317/* HDMI mux init*/
318extern int omap_hdmi_init(enum omap_hdmi_flags flags); 318extern int omap_hdmi_init(enum omap_hdmi_flags flags);
319 319
320struct omap_display_platform_data {
321 struct omap_dss_board_info *board_data;
322 /* TODO: Additional members to be added when PM is considered */
323};
324
325struct omap_video_timings { 320struct omap_video_timings {
326 /* Unit: pixels */ 321 /* Unit: pixels */
327 u16 x_res; 322 u16 x_res;