aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2012-02-20 04:50:06 -0500
committerTomi Valkeinen <tomi.valkeinen@ti.com>2012-05-11 07:44:51 -0400
commit00928eaf52007ee4e1fb7dc860bc02a56c125bb4 (patch)
treef5e4b086bf57243d1d5b1ae7f38891c26b473263 /arch/arm
parente23d83b0c92bbe30d1fe9d5c0b972e50c6593946 (diff)
OMAPDSS: clean up the omapdss platform data mess
The omapdss pdata handling is a mess. This is more evident when trying to use device tree for DSS, as we don't have platform data anymore in that case. This patch cleans the pdata handling by: - Remove struct omap_display_platform_data. It was used just as a wrapper for struct omap_dss_board_info. - Pass the platform data only to omapdss device. The drivers for omap dss hwmods do not need the platform data. This should also work better for DT, as we can create omapdss device programmatically in generic omap boot code, and thus we can pass the pdata to it. - Create dss functions for get_ctx_loss_count and dsi_enable/disable_pads that the dss hwmod drivers can call. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/mach-omap2/display.c39
1 files changed, 19 insertions, 20 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)