aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
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)