Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 310334
b: refs/heads/master
c: 53f576a
h: refs/heads/master
v: v3
  • Loading branch information
Tomi Valkeinen committed May 11, 2012
1 parent 528837e commit be675a4
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 966eaed08c40b49de19273b2b1ad1af4bf014862
refs/heads/master: 53f576a8dc5729e719c862aba2ed3430867bd5cb
57 changes: 57 additions & 0 deletions trunk/arch/arm/mach-omap2/display.c
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,46 @@ static struct platform_device *create_dss_pdev(const char *pdev_name,
return ERR_PTR(r);
}

static struct platform_device *create_simple_dss_pdev(const char *pdev_name,
int pdev_id, void *pdata, int pdata_len,
struct platform_device *parent)
{
struct platform_device *pdev;
int r;

pdev = platform_device_alloc(pdev_name, pdev_id);
if (!pdev) {
pr_err("Could not create pdev for %s\n", pdev_name);
r = -ENOMEM;
goto err;
}

if (parent != NULL)
pdev->dev.parent = &parent->dev;

if (pdev->id != -1)
dev_set_name(&pdev->dev, "%s.%d", pdev->name, pdev->id);
else
dev_set_name(&pdev->dev, "%s", pdev->name);

r = platform_device_add_data(pdev, pdata, pdata_len);
if (r) {
pr_err("Could not set pdata for %s\n", pdev_name);
goto err;
}

r = omap_device_register(pdev);
if (r) {
pr_err("Could not register omap_device for %s\n", pdev_name);
goto err;
}

return pdev;

err:
return ERR_PTR(r);
}

int __init omap_display_init(struct omap_dss_board_info *board_data)
{
int r = 0;
Expand Down Expand Up @@ -312,6 +352,23 @@ int __init omap_display_init(struct omap_dss_board_info *board_data)
}
}

/* Create devices for DPI and SDI */

pdev = create_simple_dss_pdev("omapdss_dpi", -1, NULL, 0, dss_pdev);
if (IS_ERR(pdev)) {
pr_err("Could not build platform_device for omapdss_dpi\n");
return PTR_ERR(pdev);
}

if (cpu_is_omap34xx()) {
pdev = create_simple_dss_pdev("omapdss_sdi", -1, NULL, 0,
dss_pdev);
if (IS_ERR(pdev)) {
pr_err("Could not build platform_device for omapdss_sdi\n");
return PTR_ERR(pdev);
}
}

return 0;
}

Expand Down

0 comments on commit be675a4

Please sign in to comment.