Commit 04632698 authored by Daniel Baluta's avatar Daniel Baluta Committed by Shawn Guo

firmware: imx: Save channel name for further use

We want to request / free channels on demand later in order
to save power.

For this for each channel we save the name and use it to
reference the channel later.
Signed-off-by: default avatarDaniel Baluta <daniel.baluta@nxp.com>
Reviewed-by: default avatarPaul Olaru <paul.olaru@nxp.com>
Signed-off-by: default avatarShawn Guo <shawnguo@kernel.org>
parent 4d3f4f03
...@@ -79,6 +79,7 @@ static int imx_dsp_setup_channels(struct imx_dsp_ipc *dsp_ipc) ...@@ -79,6 +79,7 @@ static int imx_dsp_setup_channels(struct imx_dsp_ipc *dsp_ipc)
return -ENOMEM; return -ENOMEM;
dsp_chan = &dsp_ipc->chans[i]; dsp_chan = &dsp_ipc->chans[i];
dsp_chan->name = chan_name;
cl = &dsp_chan->cl; cl = &dsp_chan->cl;
cl->dev = dev; cl->dev = dev;
cl->tx_block = false; cl->tx_block = false;
...@@ -97,16 +98,14 @@ static int imx_dsp_setup_channels(struct imx_dsp_ipc *dsp_ipc) ...@@ -97,16 +98,14 @@ static int imx_dsp_setup_channels(struct imx_dsp_ipc *dsp_ipc)
} }
dev_dbg(dev, "request mbox chan %s\n", chan_name); dev_dbg(dev, "request mbox chan %s\n", chan_name);
/* chan_name is not used anymore by framework */
kfree(chan_name);
} }
return 0; return 0;
out: out:
kfree(chan_name);
for (j = 0; j < i; j++) { for (j = 0; j < i; j++) {
dsp_chan = &dsp_ipc->chans[j]; dsp_chan = &dsp_ipc->chans[j];
mbox_free_channel(dsp_chan->ch); mbox_free_channel(dsp_chan->ch);
kfree(dsp_chan->name);
} }
return ret; return ret;
...@@ -147,6 +146,7 @@ static int imx_dsp_remove(struct platform_device *pdev) ...@@ -147,6 +146,7 @@ static int imx_dsp_remove(struct platform_device *pdev)
for (i = 0; i < DSP_MU_CHAN_NUM; i++) { for (i = 0; i < DSP_MU_CHAN_NUM; i++) {
dsp_chan = &dsp_ipc->chans[i]; dsp_chan = &dsp_ipc->chans[i];
mbox_free_channel(dsp_chan->ch); mbox_free_channel(dsp_chan->ch);
kfree(dsp_chan->name);
} }
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment