From: Marek Belisko <marek.belisko@gmail.com>
To: lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.de
Cc: grant.likely@secretlab.ca, rob.herring@calxeda.com,
rob@landley.net, zonque@gmail.com,
devicetree-discuss@lists.ozlabs.org, linux-doc@vger.kernel.org,
linux-kernel@vger.kernel.org,
Marek Belisko <marek.belisko@streamunlimited.com>
Subject: [PATCH 1/1] ASoC: McASP: Add device tree binding for defining separate clock and sync used by tx and rx.
Date: Tue, 30 Apr 2013 12:07:18 +0200 [thread overview]
Message-ID: <1367316438-20267-1-git-send-email-marek.belisko@streamunlimited.com> (raw)
Add new property tx-rx-clk-separate which we can distinquish between common
and separate clock for tx and rx blocks.
Signed-off-by: Marek Belisko <marek.belisko@streamunlimited.com>
---
.../bindings/sound/davinci-mcasp-audio.txt | 2 ++
include/linux/platform_data/davinci_asp.h | 1 +
sound/soc/davinci/davinci-mcasp.c | 11 ++++++++++-
sound/soc/davinci/davinci-mcasp.h | 1 +
4 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/Documentation/devicetree/bindings/sound/davinci-mcasp-audio.txt b/Documentation/devicetree/bindings/sound/davinci-mcasp-audio.txt
index 374e145..9afd2a0 100644
--- a/Documentation/devicetree/bindings/sound/davinci-mcasp-audio.txt
+++ b/Documentation/devicetree/bindings/sound/davinci-mcasp-audio.txt
@@ -23,6 +23,8 @@ Optional properties:
- rx-num-evt : FIFO levels.
- sram-size-playback : size of sram to be allocated during playback
- sram-size-capture : size of sram to be allocated during capture
+- tx-rx-clk-separate : separate clock and frame sync used by transmit and
+ receive sections
Example:
diff --git a/include/linux/platform_data/davinci_asp.h b/include/linux/platform_data/davinci_asp.h
index 8db5ae0..da3099b 100644
--- a/include/linux/platform_data/davinci_asp.h
+++ b/include/linux/platform_data/davinci_asp.h
@@ -84,6 +84,7 @@ struct snd_platform_data {
u8 version;
u8 txnumevt;
u8 rxnumevt;
+ u8 tx_rx_clk_separate;
};
enum {
diff --git a/sound/soc/davinci/davinci-mcasp.c b/sound/soc/davinci/davinci-mcasp.c
index 2953c55..849a187 100644
--- a/sound/soc/davinci/davinci-mcasp.c
+++ b/sound/soc/davinci/davinci-mcasp.c
@@ -771,7 +771,12 @@ static void davinci_hw_param(struct davinci_audio_dev *dev, int stream)
for (i = 0; i < active_slots; i++)
mask |= (1 << i);
- mcasp_clr_bits(dev->base + DAVINCI_MCASP_ACLKXCTL_REG, TX_ASYNC);
+ if (dev->tx_rx_clk_separate == 1)
+ mcasp_set_bits(dev->base + DAVINCI_MCASP_ACLKXCTL_REG,
+ TX_ASYNC);
+ else
+ mcasp_clr_bits(dev->base + DAVINCI_MCASP_ACLKXCTL_REG,
+ TX_ASYNC);
if (stream == SNDRV_PCM_STREAM_PLAYBACK) {
/* bit stream is MSB first with no delay */
@@ -1121,6 +1126,9 @@ static struct snd_platform_data *davinci_mcasp_set_pdata_from_of(
if (ret >= 0)
pdata->sram_size_capture = val;
+ if (of_find_property(np, "tx-rx-clk-separate", NULL))
+ pdata->tx_rx_clk_separate = 1;
+
return pdata;
nodata:
@@ -1191,6 +1199,7 @@ static int davinci_mcasp_probe(struct platform_device *pdev)
dev->version = pdata->version;
dev->txnumevt = pdata->txnumevt;
dev->rxnumevt = pdata->rxnumevt;
+ dev->tx_rx_clk_separate = pdata->tx_rx_clk_separate;
dev->dev = &pdev->dev;
dma_data = &dev->dma_params[SNDRV_PCM_STREAM_PLAYBACK];
diff --git a/sound/soc/davinci/davinci-mcasp.h b/sound/soc/davinci/davinci-mcasp.h
index a9ac0c1..4440666 100644
--- a/sound/soc/davinci/davinci-mcasp.h
+++ b/sound/soc/davinci/davinci-mcasp.h
@@ -39,6 +39,7 @@ struct davinci_audio_dev {
u8 *serial_dir;
u8 version;
u16 bclk_lrclk_ratio;
+ u8 tx_rx_clk_separate;
/* McASP FIFO related */
u8 txnumevt;
--
1.7.9.5
next reply other threads:[~2013-04-30 10:07 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-30 10:07 Marek Belisko [this message]
2013-04-30 18:40 ` Mark Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1367316438-20267-1-git-send-email-marek.belisko@streamunlimited.com \
--to=marek.belisko@gmail.com \
--cc=broonie@kernel.org \
--cc=devicetree-discuss@lists.ozlabs.org \
--cc=grant.likely@secretlab.ca \
--cc=lgirdwood@gmail.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=marek.belisko@streamunlimited.com \
--cc=perex@perex.cz \
--cc=rob.herring@calxeda.com \
--cc=rob@landley.net \
--cc=tiwai@suse.de \
--cc=zonque@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®