* [PATCH 0/1] Use of shared resource in designware
@ 2018-02-16 7:43 Akshu Agrawal
2018-02-16 7:43 ` [PATCH 1/1] ASoC: dwc: Use devm_ioremap_shared_resource Akshu Agrawal
2018-02-16 11:47 ` [PATCH 0/1] Use of shared resource in designware Mark Brown
0 siblings, 2 replies; 4+ messages in thread
From: Akshu Agrawal @ 2018-02-16 7:43 UTC (permalink / raw)
To: broonie, alsa-devel; +Cc: tiwai, lgirdwood, akshu.agrawal
This patch will allow the driver to map same registers
to multiple instances of driver.
It is useful when playback and capture have same regsiters
and are required to be present on separate cpu dais.
This patch is dependant on "Add devm_ioremap_shared_resource()"
patch. https://patchwork.kernel.org/patch/10177127/
Akshu Agrawal (1):
ASoC: dwc: Use devm_ioremap_shared_resource
include/sound/designware_i2s.h | 1 +
sound/soc/dwc/dwc-i2s.c | 18 +++++++++++++++---
2 files changed, 16 insertions(+), 3 deletions(-)
--
1.9.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 1/1] ASoC: dwc: Use devm_ioremap_shared_resource
2018-02-16 7:43 [PATCH 0/1] Use of shared resource in designware Akshu Agrawal
@ 2018-02-16 7:43 ` Akshu Agrawal
2018-02-16 11:47 ` [PATCH 0/1] Use of shared resource in designware Mark Brown
1 sibling, 0 replies; 4+ messages in thread
From: Akshu Agrawal @ 2018-02-16 7:43 UTC (permalink / raw)
To: broonie, alsa-devel; +Cc: tiwai, lgirdwood, akshu.agrawal
In the event when resgiters are same, this patch checks shared
flag and uses devm_ioremap_shared_resource for mapping. This allows
us to have 2 separate cpu dais for playback and capture having same
register set.
Signed-off-by: Akshu Agrawal <akshu.agrawal@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
---
include/sound/designware_i2s.h | 1 +
sound/soc/dwc/dwc-i2s.c | 18 +++++++++++++++---
2 files changed, 16 insertions(+), 3 deletions(-)
diff --git a/include/sound/designware_i2s.h b/include/sound/designware_i2s.h
index 830f5ca..a43a3708 100644
--- a/include/sound/designware_i2s.h
+++ b/include/sound/designware_i2s.h
@@ -56,6 +56,7 @@ struct i2s_platform_data {
void *capture_dma_data;
bool (*filter)(struct dma_chan *chan, void *slave);
int (*i2s_clk_cfg)(struct i2s_clk_config_data *config);
+ bool shared;
};
struct i2s_dma_data {
diff --git a/sound/soc/dwc/dwc-i2s.c b/sound/soc/dwc/dwc-i2s.c
index e27e21f..1e7c285 100644
--- a/sound/soc/dwc/dwc-i2s.c
+++ b/sound/soc/dwc/dwc-i2s.c
@@ -629,9 +629,21 @@ static int dw_i2s_probe(struct platform_device *pdev)
dw_i2s_dai->resume = dw_i2s_resume;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- dev->i2s_base = devm_ioremap_resource(&pdev->dev, res);
- if (IS_ERR(dev->i2s_base))
- return PTR_ERR(dev->i2s_base);
+ /* For devices which use the same registers for playback
+ * and capture, we would set shared flag for registering
+ * the second cpu dai.
+ */
+ if (pdata && pdata->shared) {
+ dev->i2s_base =
+ devm_ioremap_shared_resource(&pdev->dev, res);
+ if (IS_ERR(dev->i2s_base))
+ return PTR_ERR(dev->i2s_base);
+ } else {
+ dev->i2s_base =
+ devm_ioremap_resource(&pdev->dev, res);
+ if (IS_ERR(dev->i2s_base))
+ return PTR_ERR(dev->i2s_base);
+ }
dev->dev = &pdev->dev;
--
1.9.1
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH 0/1] Use of shared resource in designware
2018-02-16 7:43 [PATCH 0/1] Use of shared resource in designware Akshu Agrawal
2018-02-16 7:43 ` [PATCH 1/1] ASoC: dwc: Use devm_ioremap_shared_resource Akshu Agrawal
@ 2018-02-16 11:47 ` Mark Brown
2018-02-19 3:56 ` Agrawal, Akshu
1 sibling, 1 reply; 4+ messages in thread
From: Mark Brown @ 2018-02-16 11:47 UTC (permalink / raw)
To: Akshu Agrawal; +Cc: tiwai, alsa-devel, lgirdwood
[-- Attachment #1.1: Type: text/plain, Size: 586 bytes --]
On Fri, Feb 16, 2018 at 01:13:28PM +0530, Akshu Agrawal wrote:
> This patch will allow the driver to map same registers
> to multiple instances of driver.
>
> It is useful when playback and capture have same regsiters
> and are required to be present on separate cpu dais.
Please don't send cover letters for single patches, if there is anything
that needs saying put it in the changelog of the patch or after the ---
if it's administrative stuff. This reduces mail volume and ensures that
any important information is recorded in the changelog rather than being
lost.
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
[-- Attachment #2: Type: text/plain, Size: 0 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 0/1] Use of shared resource in designware
2018-02-16 11:47 ` [PATCH 0/1] Use of shared resource in designware Mark Brown
@ 2018-02-19 3:56 ` Agrawal, Akshu
0 siblings, 0 replies; 4+ messages in thread
From: Agrawal, Akshu @ 2018-02-19 3:56 UTC (permalink / raw)
To: Mark Brown; +Cc: tiwai, alsa-devel, lgirdwood
On 2/16/2018 5:17 PM, Mark Brown wrote:
> On Fri, Feb 16, 2018 at 01:13:28PM +0530, Akshu Agrawal wrote:
>> This patch will allow the driver to map same registers
>> to multiple instances of driver.
>>
>> It is useful when playback and capture have same regsiters
>> and are required to be present on separate cpu dais.
>
> Please don't send cover letters for single patches, if there is anything
> that needs saying put it in the changelog of the patch or after the ---
> if it's administrative stuff. This reduces mail volume and ensures that
> any important information is recorded in the changelog rather than being
> lost.
>
Got it. The reason for making a cover letter was to let you all know
that its dependent on "Add devm_ioremap_shared_resource()"
patch. https://patchwork.kernel.org/patch/10177127/
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-02-19 3:56 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-16 7:43 [PATCH 0/1] Use of shared resource in designware Akshu Agrawal
2018-02-16 7:43 ` [PATCH 1/1] ASoC: dwc: Use devm_ioremap_shared_resource Akshu Agrawal
2018-02-16 11:47 ` [PATCH 0/1] Use of shared resource in designware Mark Brown
2018-02-19 3:56 ` Agrawal, Akshu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox