aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/remoteproc/omap_remoteproc.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-07-26 19:19:08 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-07-26 19:19:08 -0400
commita9197f903f72a81393932d452379c8847fade544 (patch)
treed5c6acae9e45efb664288be0d4ad99849ac0e20c /drivers/remoteproc/omap_remoteproc.c
parente2aed8dfa50bb061747eeb14e6af099554a03b76 (diff)
parent6bb697b6b06041d2d0affc862b17b4b443a107e0 (diff)
Merge tag 'remoteproc-for-3.6' of git://git.kernel.org/pub/scm/linux/kernel/git/ohad/remoteproc
Pull remoteproc update from Ohad Ben-Cohen: - custom binary format support from Sjur Brændeland - groundwork for recovery and runtime pm support - some cleanups and API simplifications Fix up conflicts in drivers/remoteproc/remoteproc_core.c due to clashes with earlier cleanups by Sjur Brændeland (with part of the cleanups moved into the new remoteproc_elf_loader.c file). * tag 'remoteproc-for-3.6' of git://git.kernel.org/pub/scm/linux/kernel/git/ohad/remoteproc: MAINTAINERS: add remoteproc's git remoteproc: Support custom firmware handlers remoteproc: Move Elf related functions to separate file remoteproc: Add function rproc_get_boot_addr remoteproc: Pass struct fw to load_segments and find_rsc_table. remoteproc: adopt the driver core's alloc/add/del/put naming remoteproc: remove the get_by_name/put API remoteproc: support non-iommu carveout assignment remoteproc: simplify unregister/free interfaces remoteproc: remove the now-redundant kref remoteproc: maintain a generic child device for each rproc remoteproc: allocate vrings on demand, free when not needed
Diffstat (limited to 'drivers/remoteproc/omap_remoteproc.c')
-rw-r--r--drivers/remoteproc/omap_remoteproc.c26
1 files changed, 16 insertions, 10 deletions
diff --git a/drivers/remoteproc/omap_remoteproc.c b/drivers/remoteproc/omap_remoteproc.c
index de138e30d3e6..a1f7ac1f8cf6 100644
--- a/drivers/remoteproc/omap_remoteproc.c
+++ b/drivers/remoteproc/omap_remoteproc.c
@@ -66,7 +66,7 @@ static int omap_rproc_mbox_callback(struct notifier_block *this,
66{ 66{
67 mbox_msg_t msg = (mbox_msg_t) data; 67 mbox_msg_t msg = (mbox_msg_t) data;
68 struct omap_rproc *oproc = container_of(this, struct omap_rproc, nb); 68 struct omap_rproc *oproc = container_of(this, struct omap_rproc, nb);
69 struct device *dev = oproc->rproc->dev; 69 struct device *dev = oproc->rproc->dev.parent;
70 const char *name = oproc->rproc->name; 70 const char *name = oproc->rproc->name;
71 71
72 dev_dbg(dev, "mbox msg: 0x%x\n", msg); 72 dev_dbg(dev, "mbox msg: 0x%x\n", msg);
@@ -92,12 +92,13 @@ static int omap_rproc_mbox_callback(struct notifier_block *this,
92static void omap_rproc_kick(struct rproc *rproc, int vqid) 92static void omap_rproc_kick(struct rproc *rproc, int vqid)
93{ 93{
94 struct omap_rproc *oproc = rproc->priv; 94 struct omap_rproc *oproc = rproc->priv;
95 struct device *dev = rproc->dev.parent;
95 int ret; 96 int ret;
96 97
97 /* send the index of the triggered virtqueue in the mailbox payload */ 98 /* send the index of the triggered virtqueue in the mailbox payload */
98 ret = omap_mbox_msg_send(oproc->mbox, vqid); 99 ret = omap_mbox_msg_send(oproc->mbox, vqid);
99 if (ret) 100 if (ret)
100 dev_err(rproc->dev, "omap_mbox_msg_send failed: %d\n", ret); 101 dev_err(dev, "omap_mbox_msg_send failed: %d\n", ret);
101} 102}
102 103
103/* 104/*
@@ -110,7 +111,8 @@ static void omap_rproc_kick(struct rproc *rproc, int vqid)
110static int omap_rproc_start(struct rproc *rproc) 111static int omap_rproc_start(struct rproc *rproc)
111{ 112{
112 struct omap_rproc *oproc = rproc->priv; 113 struct omap_rproc *oproc = rproc->priv;
113 struct platform_device *pdev = to_platform_device(rproc->dev); 114 struct device *dev = rproc->dev.parent;
115 struct platform_device *pdev = to_platform_device(dev);
114 struct omap_rproc_pdata *pdata = pdev->dev.platform_data; 116 struct omap_rproc_pdata *pdata = pdev->dev.platform_data;
115 int ret; 117 int ret;
116 118
@@ -120,7 +122,7 @@ static int omap_rproc_start(struct rproc *rproc)
120 oproc->mbox = omap_mbox_get(pdata->mbox_name, &oproc->nb); 122 oproc->mbox = omap_mbox_get(pdata->mbox_name, &oproc->nb);
121 if (IS_ERR(oproc->mbox)) { 123 if (IS_ERR(oproc->mbox)) {
122 ret = PTR_ERR(oproc->mbox); 124 ret = PTR_ERR(oproc->mbox);
123 dev_err(rproc->dev, "omap_mbox_get failed: %d\n", ret); 125 dev_err(dev, "omap_mbox_get failed: %d\n", ret);
124 return ret; 126 return ret;
125 } 127 }
126 128
@@ -133,13 +135,13 @@ static int omap_rproc_start(struct rproc *rproc)
133 */ 135 */
134 ret = omap_mbox_msg_send(oproc->mbox, RP_MBOX_ECHO_REQUEST); 136 ret = omap_mbox_msg_send(oproc->mbox, RP_MBOX_ECHO_REQUEST);
135 if (ret) { 137 if (ret) {
136 dev_err(rproc->dev, "omap_mbox_get failed: %d\n", ret); 138 dev_err(dev, "omap_mbox_get failed: %d\n", ret);
137 goto put_mbox; 139 goto put_mbox;
138 } 140 }
139 141
140 ret = pdata->device_enable(pdev); 142 ret = pdata->device_enable(pdev);
141 if (ret) { 143 if (ret) {
142 dev_err(rproc->dev, "omap_device_enable failed: %d\n", ret); 144 dev_err(dev, "omap_device_enable failed: %d\n", ret);
143 goto put_mbox; 145 goto put_mbox;
144 } 146 }
145 147
@@ -153,7 +155,8 @@ put_mbox:
153/* power off the remote processor */ 155/* power off the remote processor */
154static int omap_rproc_stop(struct rproc *rproc) 156static int omap_rproc_stop(struct rproc *rproc)
155{ 157{
156 struct platform_device *pdev = to_platform_device(rproc->dev); 158 struct device *dev = rproc->dev.parent;
159 struct platform_device *pdev = to_platform_device(dev);
157 struct omap_rproc_pdata *pdata = pdev->dev.platform_data; 160 struct omap_rproc_pdata *pdata = pdev->dev.platform_data;
158 struct omap_rproc *oproc = rproc->priv; 161 struct omap_rproc *oproc = rproc->priv;
159 int ret; 162 int ret;
@@ -196,14 +199,14 @@ static int __devinit omap_rproc_probe(struct platform_device *pdev)
196 199
197 platform_set_drvdata(pdev, rproc); 200 platform_set_drvdata(pdev, rproc);
198 201
199 ret = rproc_register(rproc); 202 ret = rproc_add(rproc);
200 if (ret) 203 if (ret)
201 goto free_rproc; 204 goto free_rproc;
202 205
203 return 0; 206 return 0;
204 207
205free_rproc: 208free_rproc:
206 rproc_free(rproc); 209 rproc_put(rproc);
207 return ret; 210 return ret;
208} 211}
209 212
@@ -211,7 +214,10 @@ static int __devexit omap_rproc_remove(struct platform_device *pdev)
211{ 214{
212 struct rproc *rproc = platform_get_drvdata(pdev); 215 struct rproc *rproc = platform_get_drvdata(pdev);
213 216
214 return rproc_unregister(rproc); 217 rproc_del(rproc);
218 rproc_put(rproc);
219
220 return 0;
215} 221}
216 222
217static struct platform_driver omap_rproc_driver = { 223static struct platform_driver omap_rproc_driver = {