* [PATCH 2/6] ASoC: rsrc-card: add convert channels support
[not found] <877fht7376.wl%kuninori.morimoto.gx@renesas.com>
@ 2016-02-25 5:51 ` Kuninori Morimoto
2016-03-02 17:39 ` Rob Herring
0 siblings, 1 reply; 4+ messages in thread
From: Kuninori Morimoto @ 2016-02-25 5:51 UTC (permalink / raw)
To: Mark Brown
Cc: Simon, Linux-Renesas, Linux-DT, Linux-ALSA, Liam Girdwood,
Laurent
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Renesas sound device has CTU (= Channel Transfer Unit), and
sound card needs its support.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
.../bindings/sound/renesas,rsrc-card.txt | 1 +
sound/soc/sh/rcar/rsrc-card.c | 22 ++++++++++++++++------
2 files changed, 17 insertions(+), 6 deletions(-)
diff --git a/Documentation/devicetree/bindings/sound/renesas,rsrc-card.txt b/Documentation/devicetree/bindings/sound/renesas,rsrc-card.txt
index 2b2caa2..5abebf7 100644
--- a/Documentation/devicetree/bindings/sound/renesas,rsrc-card.txt
+++ b/Documentation/devicetree/bindings/sound/renesas,rsrc-card.txt
@@ -30,6 +30,7 @@ Optional subnode properties:
- frame-inversion : bool property. Add this if the
dai-link uses frame clock inversion.
- convert-rate : platform specified sampling rate convert
+- convert-channels : platform specified channel size convert
- audio-prefix : see audio-routing
- audio-routing : A list of the connections between audio components.
Each entry is a pair of strings, the first being the connection's sink,
diff --git a/sound/soc/sh/rcar/rsrc-card.c b/sound/soc/sh/rcar/rsrc-card.c
index 8a357fd..ecf5d47 100644
--- a/sound/soc/sh/rcar/rsrc-card.c
+++ b/sound/soc/sh/rcar/rsrc-card.c
@@ -66,6 +66,7 @@ struct rsrc_card_priv {
struct snd_soc_dai_link *dai_link;
int dai_num;
u32 convert_rate;
+ u32 convert_channels;
};
#define rsrc_priv_to_dev(priv) ((priv)->snd_card.dev)
@@ -145,11 +146,16 @@ static int rsrc_card_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd,
struct rsrc_card_priv *priv = snd_soc_card_get_drvdata(rtd->card);
struct snd_interval *rate = hw_param_interval(params,
SNDRV_PCM_HW_PARAM_RATE);
+ struct snd_interval *channels = hw_param_interval(params,
+ SNDRV_PCM_HW_PARAM_CHANNELS);
- if (!priv->convert_rate)
- return 0;
+ if (priv->convert_rate)
+ rate->min =
+ rate->max = priv->convert_rate;
- rate->min = rate->max = priv->convert_rate;
+ if (priv->convert_channels)
+ channels->min =
+ channels->max = priv->convert_channels;
return 0;
}
@@ -437,9 +443,13 @@ static int rsrc_card_parse_of(struct device_node *node,
/* sampling rate convert */
of_property_read_u32(node, "convert-rate", &priv->convert_rate);
- dev_dbg(dev, "New rsrc-audio-card: %s (%d)\n",
- priv->snd_card.name ? priv->snd_card.name : "",
- priv->convert_rate);
+ /* channels transfer */
+ of_property_read_u32(node, "convert-channels", &priv->convert_channels);
+
+ dev_dbg(dev, "New rsrc-audio-card: %s\n",
+ priv->snd_card.name ? priv->snd_card.name : "");
+ dev_dbg(dev, "SRC : convert_rate %d\n", priv->convert_rate);
+ dev_dbg(dev, "CTU : convert_channels %d\n", priv->convert_channels);
ret = rsrc_card_dai_link_of(node, priv);
if (ret < 0)
--
1.9.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 2/6] ASoC: rsrc-card: add convert channels support
2016-02-25 5:51 ` [PATCH 2/6] ASoC: rsrc-card: add convert channels support Kuninori Morimoto
@ 2016-03-02 17:39 ` Rob Herring
2016-03-03 8:15 ` Kuninori Morimoto
0 siblings, 1 reply; 4+ messages in thread
From: Rob Herring @ 2016-03-02 17:39 UTC (permalink / raw)
To: Kuninori Morimoto
Cc: Mark Brown, Simon, Linux-Renesas, Linux-DT, Linux-ALSA,
Liam Girdwood, Laurent
On Thu, Feb 25, 2016 at 05:51:44AM +0000, Kuninori Morimoto wrote:
>
> From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
>
> Renesas sound device has CTU (= Channel Transfer Unit), and
> sound card needs its support.
>
> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> ---
> .../bindings/sound/renesas,rsrc-card.txt | 1 +
> sound/soc/sh/rcar/rsrc-card.c | 22 ++++++++++++++++------
> 2 files changed, 17 insertions(+), 6 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/sound/renesas,rsrc-card.txt b/Documentation/devicetree/bindings/sound/renesas,rsrc-card.txt
> index 2b2caa2..5abebf7 100644
> --- a/Documentation/devicetree/bindings/sound/renesas,rsrc-card.txt
> +++ b/Documentation/devicetree/bindings/sound/renesas,rsrc-card.txt
> @@ -30,6 +30,7 @@ Optional subnode properties:
> - frame-inversion : bool property. Add this if the
> dai-link uses frame clock inversion.
> - convert-rate : platform specified sampling rate convert
> +- convert-channels : platform specified channel size convert
This needs a better description (as did convert-rate). What is the type?
What are valid values?
> - audio-prefix : see audio-routing
> - audio-routing : A list of the connections between audio components.
> Each entry is a pair of strings, the first being the connection's sink,
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 2/6] ASoC: rsrc-card: add convert channels support
2016-03-02 17:39 ` Rob Herring
@ 2016-03-03 8:15 ` Kuninori Morimoto
2016-03-05 4:24 ` Mark Brown
0 siblings, 1 reply; 4+ messages in thread
From: Kuninori Morimoto @ 2016-03-03 8:15 UTC (permalink / raw)
To: Rob Herring
Cc: Linux-DT, Linux-ALSA, Simon, Liam Girdwood, Linux-Renesas,
Mark Brown, Laurent
Hi Mark, Rob
thank you for your review
> > - convert-rate : platform specified sampling rate convert
> > +- convert-channels : platform specified channel size convert
>
> This needs a better description (as did convert-rate). What is the type?
> What are valid values?
OK, I will fixit
Mark, can I send additional patch ?
or is v2 patch better ?
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 2/6] ASoC: rsrc-card: add convert channels support
2016-03-03 8:15 ` Kuninori Morimoto
@ 2016-03-05 4:24 ` Mark Brown
0 siblings, 0 replies; 4+ messages in thread
From: Mark Brown @ 2016-03-05 4:24 UTC (permalink / raw)
To: Kuninori Morimoto
Cc: Rob Herring, Simon, Linux-Renesas, Linux-DT, Linux-ALSA,
Liam Girdwood, Laurent
[-- Attachment #1: Type: text/plain, Size: 163 bytes --]
On Thu, Mar 03, 2016 at 08:15:19AM +0000, Kuninori Morimoto wrote:
> Mark, can I send additional patch ?
> or is v2 patch better ?
An incremental patch is fine.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 473 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-03-05 4:24 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <877fht7376.wl%kuninori.morimoto.gx@renesas.com>
2016-02-25 5:51 ` [PATCH 2/6] ASoC: rsrc-card: add convert channels support Kuninori Morimoto
2016-03-02 17:39 ` Rob Herring
2016-03-03 8:15 ` Kuninori Morimoto
2016-03-05 4:24 ` Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).