Skip to content

Commit

Permalink
OMAPDSS: omap_dss_register_device() doesn't take display index
Browse files Browse the repository at this point in the history
We used to have all the displays of the board in one list, and we made a
"displayX" directory in the sysfs, where X was the index of the display
in the list.

This doesn't work anymore with device tree, as there's no single list to
get the number from, and it doesn't work very well even with non-DT as
we need to do some tricks to get the index nowadays.

This patch changes omap_dss_register_device() so that it doesn't take
disp_num as a parameter anymore, but uses a private increasing counter
for the display number.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
  • Loading branch information
Tomi Valkeinen committed Sep 18, 2012
1 parent fda7c36 commit 8768a52
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 11 deletions.
9 changes: 5 additions & 4 deletions drivers/video/omap2/dss/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -450,16 +450,17 @@ static void omap_dss_dev_release(struct device *dev)
reset_device(dev, 0);
}

static int disp_num_counter;

int omap_dss_register_device(struct omap_dss_device *dssdev,
struct device *parent, int disp_num)
struct device *parent)
{
WARN_ON(!dssdev->driver_name);

reset_device(&dssdev->dev, 1);

dssdev->dev.bus = &dss_bus_type;
dssdev->dev.parent = parent;
dssdev->dev.release = omap_dss_dev_release;
dev_set_name(&dssdev->dev, "display%d", disp_num);
dev_set_name(&dssdev->dev, "display%d", disp_num_counter++);
return device_register(&dssdev->dev);
}

Expand Down
2 changes: 1 addition & 1 deletion drivers/video/omap2/dss/dpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ static void __init dpi_probe_pdata(struct platform_device *pdev)
continue;
}

r = omap_dss_register_device(dssdev, &pdev->dev, i);
r = omap_dss_register_device(dssdev, &pdev->dev);
if (r)
DSSERR("device %s register failed: %d\n",
dssdev->name, r);
Expand Down
2 changes: 1 addition & 1 deletion drivers/video/omap2/dss/dsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -5027,7 +5027,7 @@ static void __init dsi_probe_pdata(struct platform_device *dsidev)
continue;
}

r = omap_dss_register_device(dssdev, &dsidev->dev, i);
r = omap_dss_register_device(dssdev, &dsidev->dev);
if (r)
DSSERR("device %s register failed: %d\n",
dssdev->name, r);
Expand Down
2 changes: 1 addition & 1 deletion drivers/video/omap2/dss/dss.h
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ int dss_set_min_bus_tput(struct device *dev, unsigned long tput);
int dss_debugfs_create_file(const char *name, void (*write)(struct seq_file *));

int omap_dss_register_device(struct omap_dss_device *dssdev,
struct device *parent, int disp_num);
struct device *parent);
void omap_dss_unregister_device(struct omap_dss_device *dssdev);
void omap_dss_unregister_child_devices(struct device *parent);

Expand Down
2 changes: 1 addition & 1 deletion drivers/video/omap2/dss/hdmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -923,7 +923,7 @@ static void __init hdmi_probe_pdata(struct platform_device *pdev)
continue;
}

r = omap_dss_register_device(dssdev, &pdev->dev, i);
r = omap_dss_register_device(dssdev, &pdev->dev);
if (r)
DSSERR("device %s register failed: %d\n",
dssdev->name, r);
Expand Down
2 changes: 1 addition & 1 deletion drivers/video/omap2/dss/rfbi.c
Original file line number Diff line number Diff line change
Expand Up @@ -959,7 +959,7 @@ static void __init rfbi_probe_pdata(struct platform_device *pdev)
continue;
}

r = omap_dss_register_device(dssdev, &pdev->dev, i);
r = omap_dss_register_device(dssdev, &pdev->dev);
if (r)
DSSERR("device %s register failed: %d\n",
dssdev->name, r);
Expand Down
2 changes: 1 addition & 1 deletion drivers/video/omap2/dss/sdi.c
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ static void __init sdi_probe_pdata(struct platform_device *pdev)
continue;
}

r = omap_dss_register_device(dssdev, &pdev->dev, i);
r = omap_dss_register_device(dssdev, &pdev->dev);
if (r)
DSSERR("device %s register failed: %d\n",
dssdev->name, r);
Expand Down
2 changes: 1 addition & 1 deletion drivers/video/omap2/dss/venc.c
Original file line number Diff line number Diff line change
Expand Up @@ -752,7 +752,7 @@ static void __init venc_probe_pdata(struct platform_device *pdev)
continue;
}

r = omap_dss_register_device(dssdev, &pdev->dev, i);
r = omap_dss_register_device(dssdev, &pdev->dev);
if (r)
DSSERR("device %s register failed: %d\n",
dssdev->name, r);
Expand Down

0 comments on commit 8768a52

Please sign in to comment.