aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/remoteproc
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/remoteproc')
-rw-r--r--drivers/remoteproc/rpres.c23
-rw-r--r--drivers/remoteproc/rpres_dev.c40
2 files changed, 51 insertions, 12 deletions
diff --git a/drivers/remoteproc/rpres.c b/drivers/remoteproc/rpres.c
index c52e6a1..e839f70 100644
--- a/drivers/remoteproc/rpres.c
+++ b/drivers/remoteproc/rpres.c
@@ -165,10 +165,25 @@ static int __devexit rpres_remove(struct platform_device *pdev)
return 0;
}
+static struct platform_device_id rpres_id_table[] = {
+ {
+ .name = "iva",
+ },
+ {
+ .name = "fdif",
+ },
+ {
+ .name = "rpres",
+ },
+ { },
+};
+MODULE_DEVICE_TABLE(platform, rpres_id_table);
+
static struct platform_driver omap_rpres_driver = {
- .probe = rpres_probe,
- .remove = __devexit_p(rpres_remove),
- .driver = {
+ .id_table = rpres_id_table,
+ .probe = rpres_probe,
+ .remove = __devexit_p(rpres_remove),
+ .driver = {
.name = "rpres",
.owner = THIS_MODULE,
},
@@ -178,7 +193,7 @@ static int __init rpres_init(void)
{
return platform_driver_register(&omap_rpres_driver);
}
-module_init(rpres_init);
+late_initcall(rpres_init);
static void __exit rpres_exit(void)
{
diff --git a/drivers/remoteproc/rpres_dev.c b/drivers/remoteproc/rpres_dev.c
index 782e1b7..cd28453 100644
--- a/drivers/remoteproc/rpres_dev.c
+++ b/drivers/remoteproc/rpres_dev.c
@@ -127,6 +127,7 @@ static struct rpres_platform_data rpres_data[] = {
.name = "rpres_iva",
.oh_name = "iva",
.ops = &ivahd_ops,
+ .get_dev = omap2_get_iva_device,
},
{
.name = "rpres_iva_seq0",
@@ -148,6 +149,7 @@ static struct rpres_platform_data rpres_data[] = {
.name = "rpres_fdif",
.oh_name = "fdif",
.ops = &fdif_ops,
+ .get_dev = omap4_get_fdif_device,
},
{
.name = "rpres_sl2if",
@@ -158,11 +160,13 @@ static struct rpres_platform_data rpres_data[] = {
static int __init init(void)
{
- int i;
+ int i, ret;
struct omap_hwmod *oh;
struct omap_device_pm_latency *ohl = rpres_latency;
int ohl_cnt = ARRAY_SIZE(rpres_latency);
struct omap_device *od;
+ struct device *dev;
+ struct platform_device *pdev;
for (i = 0; i < ARRAY_SIZE(rpres_data); i++) {
oh = omap_hwmod_lookup(rpres_data[i].oh_name);
@@ -171,13 +175,33 @@ static int __init init(void)
continue;
}
rpres_data[i].oh = oh;
- od = omap_device_build("rpres", i, oh,
- &rpres_data[i],
- sizeof(struct rpres_platform_data),
- ohl, ohl_cnt, false);
- if (IS_ERR(od))
- pr_err("Error building device for %s\n",
- rpres_data[i].name);
+
+ if (rpres_data[i].get_dev) {
+ dev = rpres_data[i].get_dev();
+ if (!dev) {
+ pr_err("No dev for %s\n", rpres_data[i].name);
+ continue;
+ }
+ pdev = to_platform_device(dev);
+ ret = platform_device_add_data(pdev, &rpres_data[i],
+ sizeof(struct rpres_platform_data));
+ if (ret) {
+ pr_err("Error pdev add for %s\n",
+ rpres_data[i].name);
+ continue;
+ }
+ od = to_omap_device(pdev);
+ od->pm_lats = ohl;
+ od->pm_lats_cnt = ohl_cnt;
+ } else {
+ od = omap_device_build("rpres", i, oh,
+ &rpres_data[i],
+ sizeof(struct rpres_platform_data),
+ ohl, ohl_cnt, false);
+ if (IS_ERR(od))
+ pr_err("Error building device for %s\n",
+ rpres_data[i].name);
+ }
}
return 0;
}