diff options
| author | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2012-05-11 08:10:10 -0400 |
|---|---|---|
| committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2012-05-11 08:10:10 -0400 |
| commit | 38137c8f0ce8dfaea467884cb2eb45de8df1bdfc (patch) | |
| tree | 4985e69beb92a6f9ed9e280dc1e6d5d6c3efb645 | |
| parent | 3a028bb99d1f1e5c444060a176cbd4bf93530df3 (diff) | |
| parent | af461d64e11f81db4a7619dd574fe779ae3a0884 (diff) | |
Merge branch 'dss-devtree-cleanup'
Merge OMAP DSS cleanups that restructure the omapdss driver to facilitate
implementing device tree support in the future.
| -rw-r--r-- | arch/arm/mach-omap2/display.c | 192 | ||||
| -rw-r--r-- | drivers/video/omap2/displays/panel-tfp410.c | 76 | ||||
| -rw-r--r-- | drivers/video/omap2/dss/core.c | 243 | ||||
| -rw-r--r-- | drivers/video/omap2/dss/dispc.c | 50 | ||||
| -rw-r--r-- | drivers/video/omap2/dss/display.c | 40 | ||||
| -rw-r--r-- | drivers/video/omap2/dss/dpi.c | 68 | ||||
| -rw-r--r-- | drivers/video/omap2/dss/dsi.c | 148 | ||||
| -rw-r--r-- | drivers/video/omap2/dss/dss.c | 44 | ||||
| -rw-r--r-- | drivers/video/omap2/dss/dss.h | 113 | ||||
| -rw-r--r-- | drivers/video/omap2/dss/hdmi.c | 85 | ||||
| -rw-r--r-- | drivers/video/omap2/dss/rfbi.c | 60 | ||||
| -rw-r--r-- | drivers/video/omap2/dss/sdi.c | 61 | ||||
| -rw-r--r-- | drivers/video/omap2/dss/venc.c | 62 | ||||
| -rw-r--r-- | drivers/video/omap2/omapfb/omapfb-main.c | 9 | ||||
| -rw-r--r-- | include/video/omapdss.h | 5 |
15 files changed, 688 insertions, 568 deletions
diff --git a/arch/arm/mach-omap2/display.c b/arch/arm/mach-omap2/display.c index 60cded4738a0..54d49ddb9b81 100644 --- a/arch/arm/mach-omap2/display.c +++ b/arch/arm/mach-omap2/display.c | |||
| @@ -185,16 +185,128 @@ static int omap_dss_set_min_bus_tput(struct device *dev, unsigned long tput) | |||
| 185 | return omap_pm_set_min_bus_tput(dev, OCP_INITIATOR_AGENT, tput); | 185 | return omap_pm_set_min_bus_tput(dev, OCP_INITIATOR_AGENT, tput); |
| 186 | } | 186 | } |
| 187 | 187 | ||
| 188 | static struct platform_device *create_dss_pdev(const char *pdev_name, | ||
| 189 | int pdev_id, const char *oh_name, void *pdata, int pdata_len, | ||
| 190 | struct platform_device *parent) | ||
| 191 | { | ||
| 192 | struct platform_device *pdev; | ||
| 193 | struct omap_device *od; | ||
| 194 | struct omap_hwmod *ohs[1]; | ||
| 195 | struct omap_hwmod *oh; | ||
| 196 | int r; | ||
| 197 | |||
| 198 | oh = omap_hwmod_lookup(oh_name); | ||
| 199 | if (!oh) { | ||
| 200 | pr_err("Could not look up %s\n", oh_name); | ||
| 201 | r = -ENODEV; | ||
| 202 | goto err; | ||
| 203 | } | ||
| 204 | |||
| 205 | pdev = platform_device_alloc(pdev_name, pdev_id); | ||
| 206 | if (!pdev) { | ||
| 207 | pr_err("Could not create pdev for %s\n", pdev_name); | ||
| 208 | r = -ENOMEM; | ||
| 209 | goto err; | ||
| 210 | } | ||
| 211 | |||
| 212 | if (parent != NULL) | ||
| 213 | pdev->dev.parent = &parent->dev; | ||
| 214 | |||
| 215 | if (pdev->id != -1) | ||
| 216 | dev_set_name(&pdev->dev, "%s.%d", pdev->name, pdev->id); | ||
| 217 | else | ||
| 218 | dev_set_name(&pdev->dev, "%s", pdev->name); | ||
| 219 | |||
| 220 | ohs[0] = oh; | ||
| 221 | od = omap_device_alloc(pdev, ohs, 1, NULL, 0); | ||
| 222 | if (!od) { | ||
| 223 | pr_err("Could not alloc omap_device for %s\n", pdev_name); | ||
| 224 | r = -ENOMEM; | ||
| 225 | goto err; | ||
| 226 | } | ||
| 227 | |||
| 228 | r = platform_device_add_data(pdev, pdata, pdata_len); | ||
| 229 | if (r) { | ||
| 230 | pr_err("Could not set pdata for %s\n", pdev_name); | ||
| 231 | goto err; | ||
| 232 | } | ||
| 233 | |||
| 234 | r = omap_device_register(pdev); | ||
| 235 | if (r) { | ||
| 236 | pr_err("Could not register omap_device for %s\n", pdev_name); | ||
| 237 | goto err; | ||
| 238 | } | ||
| 239 | |||
| 240 | return pdev; | ||
| 241 | |||
| 242 | err: | ||
| 243 | return ERR_PTR(r); | ||
| 244 | } | ||
| 245 | |||
| 246 | static struct platform_device *create_simple_dss_pdev(const char *pdev_name, | ||
| 247 | int pdev_id, void *pdata, int pdata_len, | ||
| 248 | struct platform_device *parent) | ||
| 249 | { | ||
| 250 | struct platform_device *pdev; | ||
| 251 | int r; | ||
| 252 | |||
| 253 | pdev = platform_device_alloc(pdev_name, pdev_id); | ||
| 254 | if (!pdev) { | ||
| 255 | pr_err("Could not create pdev for %s\n", pdev_name); | ||
| 256 | r = -ENOMEM; | ||
| 257 | goto err; | ||
| 258 | } | ||
| 259 | |||
| 260 | if (parent != NULL) | ||
| 261 | pdev->dev.parent = &parent->dev; | ||
| 262 | |||
| 263 | if (pdev->id != -1) | ||
| 264 | dev_set_name(&pdev->dev, "%s.%d", pdev->name, pdev->id); | ||
| 265 | else | ||
| 266 | dev_set_name(&pdev->dev, "%s", pdev->name); | ||
| 267 | |||
| 268 | r = platform_device_add_data(pdev, pdata, pdata_len); | ||
| 269 | if (r) { | ||
| 270 | pr_err("Could not set pdata for %s\n", pdev_name); | ||
| 271 | goto err; | ||
| 272 | } | ||
| 273 | |||
| 274 | r = omap_device_register(pdev); | ||
| 275 | if (r) { | ||
| 276 | pr_err("Could not register omap_device for %s\n", pdev_name); | ||
| 277 | goto err; | ||
| 278 | } | ||
| 279 | |||
| 280 | return pdev; | ||
| 281 | |||
| 282 | err: | ||
| 283 | return ERR_PTR(r); | ||
| 284 | } | ||
| 285 | |||
| 188 | int __init omap_display_init(struct omap_dss_board_info *board_data) | 286 | int __init omap_display_init(struct omap_dss_board_info *board_data) |
| 189 | { | 287 | { |
| 190 | int r = 0; | 288 | int r = 0; |
| 191 | struct omap_hwmod *oh; | ||
| 192 | struct platform_device *pdev; | 289 | struct platform_device *pdev; |
| 193 | int i, oh_count; | 290 | int i, oh_count; |
| 194 | struct omap_display_platform_data pdata; | ||
| 195 | const struct omap_dss_hwmod_data *curr_dss_hwmod; | 291 | const struct omap_dss_hwmod_data *curr_dss_hwmod; |
| 292 | struct platform_device *dss_pdev; | ||
| 293 | |||
| 294 | /* create omapdss device */ | ||
| 196 | 295 | ||
| 197 | memset(&pdata, 0, sizeof(pdata)); | 296 | board_data->dsi_enable_pads = omap_dsi_enable_pads; |
| 297 | board_data->dsi_disable_pads = omap_dsi_disable_pads; | ||
| 298 | board_data->get_context_loss_count = omap_pm_get_dev_context_loss_count; | ||
| 299 | board_data->set_min_bus_tput = omap_dss_set_min_bus_tput; | ||
| 300 | |||
| 301 | omap_display_device.dev.platform_data = board_data; | ||
| 302 | |||
| 303 | r = platform_device_register(&omap_display_device); | ||
| 304 | if (r < 0) { | ||
| 305 | pr_err("Unable to register omapdss device\n"); | ||
| 306 | return r; | ||
| 307 | } | ||
| 308 | |||
| 309 | /* create devices for dss hwmods */ | ||
| 198 | 310 | ||
| 199 | if (cpu_is_omap24xx()) { | 311 | if (cpu_is_omap24xx()) { |
| 200 | curr_dss_hwmod = omap2_dss_hwmod_data; | 312 | curr_dss_hwmod = omap2_dss_hwmod_data; |
| @@ -207,40 +319,58 @@ int __init omap_display_init(struct omap_dss_board_info *board_data) | |||
| 207 | oh_count = ARRAY_SIZE(omap4_dss_hwmod_data); | 319 | oh_count = ARRAY_SIZE(omap4_dss_hwmod_data); |
| 208 | } | 320 | } |
| 209 | 321 | ||
| 210 | if (board_data->dsi_enable_pads == NULL) | 322 | /* |
| 211 | board_data->dsi_enable_pads = omap_dsi_enable_pads; | 323 | * First create the pdev for dss_core, which is used as a parent device |
| 212 | if (board_data->dsi_disable_pads == NULL) | 324 | * by the other dss pdevs. Note: dss_core has to be the first item in |
| 213 | board_data->dsi_disable_pads = omap_dsi_disable_pads; | 325 | * the hwmod list. |
| 214 | 326 | */ | |
| 215 | pdata.board_data = board_data; | 327 | dss_pdev = create_dss_pdev(curr_dss_hwmod[0].dev_name, |
| 216 | pdata.board_data->get_context_loss_count = | 328 | curr_dss_hwmod[0].id, |
| 217 | omap_pm_get_dev_context_loss_count; | 329 | curr_dss_hwmod[0].oh_name, |
| 218 | pdata.board_data->set_min_bus_tput = omap_dss_set_min_bus_tput; | 330 | board_data, sizeof(*board_data), |
| 219 | 331 | NULL); | |
| 220 | for (i = 0; i < oh_count; i++) { | 332 | |
| 221 | oh = omap_hwmod_lookup(curr_dss_hwmod[i].oh_name); | 333 | if (IS_ERR(dss_pdev)) { |
| 222 | if (!oh) { | 334 | pr_err("Could not build omap_device for %s\n", |
| 223 | pr_err("Could not look up %s\n", | 335 | curr_dss_hwmod[0].oh_name); |
| 224 | curr_dss_hwmod[i].oh_name); | 336 | |
| 225 | return -ENODEV; | 337 | return PTR_ERR(dss_pdev); |
| 338 | } | ||
| 339 | |||
| 340 | for (i = 1; i < oh_count; i++) { | ||
| 341 | pdev = create_dss_pdev(curr_dss_hwmod[i].dev_name, | ||
| 342 | curr_dss_hwmod[i].id, | ||
| 343 | curr_dss_hwmod[i].oh_name, | ||
| 344 | board_data, sizeof(*board_data), | ||
| 345 | dss_pdev); | ||
| 346 | |||
| 347 | if (IS_ERR(pdev)) { | ||
| 348 | pr_err("Could not build omap_device for %s\n", | ||
| 349 | curr_dss_hwmod[i].oh_name); | ||
| 350 | |||
| 351 | return PTR_ERR(pdev); | ||
| 226 | } | ||
