linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] More simple-card dai node clock parameters
@ 2014-06-13 10:04 Jyri Sarha
  2014-06-13 10:04 ` [PATCH 1/3] ASoC: simple-card: Make u32 DT parameter handling 64-bit proof Jyri Sarha
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Jyri Sarha @ 2014-06-13 10:04 UTC (permalink / raw)
  To: alsa-devel, linux-omap, devicetree
  Cc: bcousson, peter.ujfalusi, broonie, liam.r.girdwood, detheridge,
	Jyri Sarha

These changes target to sii9022 HDMI audio support, but are
independent fixes and additions.

To cover more cases with simple-card it should be possible to select
all parameters for set_sysclk() callback. The default behavior is not
changed by these patches.

Jyri Sarha (3):
  ASoC: simple-card: Make u32 DT parameter handling 64-bit proof
  ASoC: simple-card: Add system-clock-direction DT parameter to dai
    nodes
  ASoC: simple-card: Add system-clock-id DT parameter to dai nodes

 .../devicetree/bindings/sound/simple-card.txt      |    3 ++
 include/sound/simple_card.h                        |    2 ++
 sound/soc/generic/simple-card.c                    |   31 +++++++++++++++-----
 3 files changed, 29 insertions(+), 7 deletions(-)

-- 
1.7.9.5


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH 1/3] ASoC: simple-card: Make u32 DT parameter handling 64-bit proof
  2014-06-13 10:04 [PATCH 0/3] More simple-card dai node clock parameters Jyri Sarha
@ 2014-06-13 10:04 ` Jyri Sarha
  2014-06-21 10:07   ` Mark Brown
  2014-06-13 10:04 ` [PATCH 2/3] ASoC: simple-card: Add system-clock-direction DT parameter to dai nodes Jyri Sarha
  2014-06-13 10:04 ` [PATCH 3/3] ASoC: simple-card: Add system-clock-id " Jyri Sarha
  2 siblings, 1 reply; 9+ messages in thread
From: Jyri Sarha @ 2014-06-13 10:04 UTC (permalink / raw)
  To: alsa-devel, linux-omap, devicetree
  Cc: bcousson, peter.ujfalusi, broonie, liam.r.girdwood, detheridge,
	Jyri Sarha

Passing unsigned int pointers as u32 ponters may be dangerous on 64-bit
system.

Signed-off-by: Jyri Sarha <jsarha@ti.com>
---
 sound/soc/generic/simple-card.c |   13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c
index 03a7fdc..159e517f 100644
--- a/sound/soc/generic/simple-card.c
+++ b/sound/soc/generic/simple-card.c
@@ -116,6 +116,7 @@ asoc_simple_card_sub_parse_of(struct device_node *np,
 {
 	struct device_node *node;
 	struct clk *clk;
+	u32 val;
 	int ret;
 
 	/*
@@ -151,10 +152,8 @@ asoc_simple_card_sub_parse_of(struct device_node *np,
 		}
 
 		dai->sysclk = clk_get_rate(clk);
-	} else if (of_property_read_bool(np, "system-clock-frequency")) {
-		of_property_read_u32(np,
-				     "system-clock-frequency",
-				     &dai->sysclk);
+	} else if (!of_property_read_u32(np, "system-clock-frequency", &val)) {
+		dai->sysclk = val;
 	} else {
 		clk = of_clk_get(node, 0);
 		if (!IS_ERR(clk))
@@ -303,6 +302,7 @@ static int asoc_simple_card_parse_of(struct device_node *node,
 {
 	struct snd_soc_dai_link *dai_link = priv->snd_card.dai_link;
 	struct simple_dai_props *dai_props = priv->dai_props;
+	u32 val;
 	int ret;
 
 	/* parsing the card name from DT */
@@ -325,8 +325,9 @@ static int asoc_simple_card_parse_of(struct device_node *node,
 	}
 
 	/* Factor to mclk, used in hw_params() */
-	of_property_read_u32(node, "simple-audio-card,mclk-fs",
-			     &priv->mclk_fs);
+	ret = of_property_read_u32(node, "simple-audio-card,mclk-fs", &val);
+	if (ret == 0)
+		priv->mclk_fs = val;
 
 	dev_dbg(dev, "New simple-card: %s\n", priv->snd_card.name ?
 		priv->snd_card.name : "");
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 2/3] ASoC: simple-card: Add system-clock-direction DT parameter to dai nodes
  2014-06-13 10:04 [PATCH 0/3] More simple-card dai node clock parameters Jyri Sarha
  2014-06-13 10:04 ` [PATCH 1/3] ASoC: simple-card: Make u32 DT parameter handling 64-bit proof Jyri Sarha
@ 2014-06-13 10:04 ` Jyri Sarha
  2014-06-13 10:04 ` [PATCH 3/3] ASoC: simple-card: Add system-clock-id " Jyri Sarha
  2 siblings, 0 replies; 9+ messages in thread
From: Jyri Sarha @ 2014-06-13 10:04 UTC (permalink / raw)
  To: alsa-devel, linux-omap, devicetree
  Cc: bcousson, peter.ujfalusi, broonie, liam.r.girdwood, detheridge,
	Jyri Sarha

Select dir parameters for set_sysclk calls in the card init phase.

Signed-off-by: Jyri Sarha <jsarha@ti.com>
---
 .../devicetree/bindings/sound/simple-card.txt      |    1 +
 include/sound/simple_card.h                        |    1 +
 sound/soc/generic/simple-card.c                    |   14 +++++++++++++-
 3 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/sound/simple-card.txt b/Documentation/devicetree/bindings/sound/simple-card.txt
index c2e9841..8460744 100644
--- a/Documentation/devicetree/bindings/sound/simple-card.txt
+++ b/Documentation/devicetree/bindings/sound/simple-card.txt
@@ -71,6 +71,7 @@ Optional CPU/CODEC subnodes properties:
 					  it can be specified via "clocks" if system has
 					  clock node (= common clock), or "system-clock-frequency"
 					  (if system doens't support common clock)
+- system-clock-direction		: "in" or "out", default "in"
 
 Example 1 - single DAI link:
 
diff --git a/include/sound/simple_card.h b/include/sound/simple_card.h
index 9b0ac77..6d74fef 100644
--- a/include/sound/simple_card.h
+++ b/include/sound/simple_card.h
@@ -18,6 +18,7 @@ struct asoc_simple_dai {
 	const char *name;
 	unsigned int fmt;
 	unsigned int sysclk;
+	int sysclk_dir;
 	int slots;
 	int slot_width;
 };
diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c
index 159e517f..8dd7957 100644
--- a/sound/soc/generic/simple-card.c
+++ b/sound/soc/generic/simple-card.c
@@ -64,7 +64,8 @@ static int __asoc_simple_card_dai_init(struct snd_soc_dai *dai,
 	}
 
 	if (set->sysclk) {
-		ret = snd_soc_dai_set_sysclk(dai, 0, set->sysclk, 0);
+		ret = snd_soc_dai_set_sysclk(dai, 0, set->sysclk,
+					     set->sysclk_dir);
 		if (ret && ret != -ENOTSUPP) {
 			dev_err(dai->dev, "simple-card: set_sysclk error\n");
 			goto err;
@@ -116,6 +117,7 @@ asoc_simple_card_sub_parse_of(struct device_node *np,
 {
 	struct device_node *node;
 	struct clk *clk;
+	const char *str;
 	u32 val;
 	int ret;
 
@@ -138,6 +140,16 @@ asoc_simple_card_sub_parse_of(struct device_node *np,
 	if (ret)
 		return ret;
 
+	ret = of_property_read_string(np, "system-clock-direction", &str);
+	if (ret == 0) {
+		if (!strcmp(str, "out"))
+			dai->sysclk_dir = SND_SOC_CLOCK_OUT;
+		else if (!strcmp(str, "in"))
+			dai->sysclk_dir = SND_SOC_CLOCK_IN;
+		else
+			return -EINVAL;
+	}
+
 	/*
 	 * dai->sysclk come from
 	 *  "clocks = <&xxx>" (if system has common clock)
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 3/3] ASoC: simple-card: Add system-clock-id DT parameter to dai nodes
  2014-06-13 10:04 [PATCH 0/3] More simple-card dai node clock parameters Jyri Sarha
  2014-06-13 10:04 ` [PATCH 1/3] ASoC: simple-card: Make u32 DT parameter handling 64-bit proof Jyri Sarha
  2014-06-13 10:04 ` [PATCH 2/3] ASoC: simple-card: Add system-clock-direction DT parameter to dai nodes Jyri Sarha
@ 2014-06-13 10:04 ` Jyri Sarha
  2014-06-13 12:24   ` satish kumar
  2014-06-21 10:09   ` Mark Brown
  2 siblings, 2 replies; 9+ messages in thread
From: Jyri Sarha @ 2014-06-13 10:04 UTC (permalink / raw)
  To: alsa-devel, linux-omap, devicetree
  Cc: bcousson, peter.ujfalusi, broonie, liam.r.girdwood, detheridge,
	Jyri Sarha

Select clk_id parameters for set_sysclk calls in the card init phase.

Signed-off-by: Jyri Sarha <jsarha@ti.com>
---
 .../devicetree/bindings/sound/simple-card.txt      |    2 ++
 include/sound/simple_card.h                        |    1 +
 sound/soc/generic/simple-card.c                    |    6 +++++-
 3 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/sound/simple-card.txt b/Documentation/devicetree/bindings/sound/simple-card.txt
index 8460744..8877130 100644
--- a/Documentation/devicetree/bindings/sound/simple-card.txt
+++ b/Documentation/devicetree/bindings/sound/simple-card.txt
@@ -72,6 +72,8 @@ Optional CPU/CODEC subnodes properties:
 					  clock node (= common clock), or "system-clock-frequency"
 					  (if system doens't support common clock)
 - system-clock-direction		: "in" or "out", default "in"
+- system-clock-id			: u32, clk_id parameter for set_sysclk,
+					  default 0
 
 Example 1 - single DAI link:
 
diff --git a/include/sound/simple_card.h b/include/sound/simple_card.h
index 6d74fef..f3c7a30 100644
--- a/include/sound/simple_card.h
+++ b/include/sound/simple_card.h
@@ -19,6 +19,7 @@ struct asoc_simple_dai {
 	unsigned int fmt;
 	unsigned int sysclk;
 	int sysclk_dir;
+	int sysclk_id;
 	int slots;
 	int slot_width;
 };
diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c
index 8dd7957..f840d9c 100644
--- a/sound/soc/generic/simple-card.c
+++ b/sound/soc/generic/simple-card.c
@@ -64,7 +64,7 @@ static int __asoc_simple_card_dai_init(struct snd_soc_dai *dai,
 	}
 
 	if (set->sysclk) {
-		ret = snd_soc_dai_set_sysclk(dai, 0, set->sysclk,
+		ret = snd_soc_dai_set_sysclk(dai, set->sysclk_id, set->sysclk,
 					     set->sysclk_dir);
 		if (ret && ret != -ENOTSUPP) {
 			dev_err(dai->dev, "simple-card: set_sysclk error\n");
@@ -150,6 +150,10 @@ asoc_simple_card_sub_parse_of(struct device_node *np,
 			return -EINVAL;
 	}
 
+	ret = of_property_read_u32(np, "system-clock-id", &val);
+	if (ret == 0)
+		dai->sysclk_id = val;
+
 	/*
 	 * dai->sysclk come from
 	 *  "clocks = <&xxx>" (if system has common clock)
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH 3/3] ASoC: simple-card: Add system-clock-id DT parameter to dai nodes
  2014-06-13 10:04 ` [PATCH 3/3] ASoC: simple-card: Add system-clock-id " Jyri Sarha
@ 2014-06-13 12:24   ` satish kumar
  2014-06-21 10:09   ` Mark Brown
  1 sibling, 0 replies; 9+ messages in thread
From: satish kumar @ 2014-06-13 12:24 UTC (permalink / raw)
  To: Jyri Sarha
  Cc: devicetree, alsa-devel, liam.r.girdwood, peter.ujfalusi,
	detheridge, broonie, bcousson, linux-omap@vger.kernel.org

Hi

I have panda board (omap4430 <http://www.ti.com/product/omap4430>) , I am
trying to debug omap4430 <http://www.ti.com/product/omap4430> board using
trace32 [Lauterbach].

Can you please provide procedure to debug u-boot code kernel code.

I had installed trace32 and PC is identifying trace32 through serial cable.

I wants to know steps to follow for debugging the boot code and kernel code.

I have gone through net, I came to know ,  need CMM scripts [board specfic
CMM scripts]

can you please provide the same and further steps to debug the code.


Thank you in advance.

Regards

Satish.G


On Fri, Jun 13, 2014 at 3:34 PM, Jyri Sarha <jsarha@ti.com> wrote:

> Select clk_id parameters for set_sysclk calls in the card init phase.
>
> Signed-off-by: Jyri Sarha <jsarha@ti.com>
> ---
>  .../devicetree/bindings/sound/simple-card.txt      |    2 ++
>  include/sound/simple_card.h                        |    1 +
>  sound/soc/generic/simple-card.c                    |    6 +++++-
>  3 files changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/Documentation/devicetree/bindings/sound/simple-card.txt
> b/Documentation/devicetree/bindings/sound/simple-card.txt
> index 8460744..8877130 100644
> --- a/Documentation/devicetree/bindings/sound/simple-card.txt
> +++ b/Documentation/devicetree/bindings/sound/simple-card.txt
> @@ -72,6 +72,8 @@ Optional CPU/CODEC subnodes properties:
>                                           clock node (= common clock), or
> "system-clock-frequency"
>                                           (if system doens't support
> common clock)
>  - system-clock-direction               : "in" or "out", default "in"
> +- system-clock-id                      : u32, clk_id parameter for
> set_sysclk,
> +                                         default 0
>
>  Example 1 - single DAI link:
>
> diff --git a/include/sound/simple_card.h b/include/sound/simple_card.h
> index 6d74fef..f3c7a30 100644
> --- a/include/sound/simple_card.h
> +++ b/include/sound/simple_card.h
> @@ -19,6 +19,7 @@ struct asoc_simple_dai {
>         unsigned int fmt;
>         unsigned int sysclk;
>         int sysclk_dir;
> +       int sysclk_id;
>         int slots;
>         int slot_width;
>  };
> diff --git a/sound/soc/generic/simple-card.c
> b/sound/soc/generic/simple-card.c
> index 8dd7957..f840d9c 100644
> --- a/sound/soc/generic/simple-card.c
> +++ b/sound/soc/generic/simple-card.c
> @@ -64,7 +64,7 @@ static int __asoc_simple_card_dai_init(struct
> snd_soc_dai *dai,
>         }
>
>         if (set->sysclk) {
> -               ret = snd_soc_dai_set_sysclk(dai, 0, set->sysclk,
> +               ret = snd_soc_dai_set_sysclk(dai, set->sysclk_id,
> set->sysclk,
>                                              set->sysclk_dir);
>                 if (ret && ret != -ENOTSUPP) {
>                         dev_err(dai->dev, "simple-card: set_sysclk
> error\n");
> @@ -150,6 +150,10 @@ asoc_simple_card_sub_parse_of(struct device_node *np,
>                         return -EINVAL;
>         }
>
> +       ret = of_property_read_u32(np, "system-clock-id", &val);
> +       if (ret == 0)
> +               dai->sysclk_id = val;
> +
>         /*
>          * dai->sysclk come from
>          *  "clocks = <&xxx>" (if system has common clock)
> --
> 1.7.9.5
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/3] ASoC: simple-card: Make u32 DT parameter handling 64-bit proof
  2014-06-13 10:04 ` [PATCH 1/3] ASoC: simple-card: Make u32 DT parameter handling 64-bit proof Jyri Sarha
@ 2014-06-21 10:07   ` Mark Brown
  0 siblings, 0 replies; 9+ messages in thread
From: Mark Brown @ 2014-06-21 10:07 UTC (permalink / raw)
  To: Jyri Sarha
  Cc: alsa-devel, linux-omap, devicetree, bcousson, peter.ujfalusi,
	liam.r.girdwood, detheridge

[-- Attachment #1: Type: text/plain, Size: 162 bytes --]

On Fri, Jun 13, 2014 at 01:04:36PM +0300, Jyri Sarha wrote:
> Passing unsigned int pointers as u32 ponters may be dangerous on 64-bit
> system.

Applied, thanks.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 3/3] ASoC: simple-card: Add system-clock-id DT parameter to dai nodes
  2014-06-13 10:04 ` [PATCH 3/3] ASoC: simple-card: Add system-clock-id " Jyri Sarha
  2014-06-13 12:24   ` satish kumar
@ 2014-06-21 10:09   ` Mark Brown
  2014-06-24  9:59     ` Jyri Sarha
  1 sibling, 1 reply; 9+ messages in thread
From: Mark Brown @ 2014-06-21 10:09 UTC (permalink / raw)
  To: Jyri Sarha
  Cc: alsa-devel, linux-omap, devicetree, bcousson, peter.ujfalusi,
	liam.r.girdwood, detheridge

[-- Attachment #1: Type: text/plain, Size: 432 bytes --]

On Fri, Jun 13, 2014 at 01:04:38PM +0300, Jyri Sarha wrote:
> Select clk_id parameters for set_sysclk calls in the card init phase.

This is making the ID defined by the drivers into ABI.  It's not clear
that this is something we want to do, and we certainly don't want to do
it without updating the driver bindings.  In principle what we want to
do here is have our clocks handled by the clock API, though that's not
trivial work.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 3/3] ASoC: simple-card: Add system-clock-id DT parameter to dai nodes
  2014-06-21 10:09   ` Mark Brown
@ 2014-06-24  9:59     ` Jyri Sarha
  2014-06-24 10:20       ` Mark Brown
  0 siblings, 1 reply; 9+ messages in thread
From: Jyri Sarha @ 2014-06-24  9:59 UTC (permalink / raw)
  To: Mark Brown
  Cc: alsa-devel, linux-omap, devicetree, bcousson, peter.ujfalusi,
	liam.r.girdwood, detheridge

On 06/21/2014 01:09 PM, Mark Brown wrote:
> On Fri, Jun 13, 2014 at 01:04:38PM +0300, Jyri Sarha wrote:
>> Select clk_id parameters for set_sysclk calls in the card init phase.
>
> This is making the ID defined by the drivers into ABI.  It's not clear
> that this is something we want to do, and we certainly don't want to do
> it without updating the driver bindings.  In principle what we want to
> do here is have our clocks handled by the clock API, though that's not
> trivial work.
>

I see, actually this is not something I would need anytime soon, but
how about the previous "Add system-clock-direction DT parameter to dai 
nodes" patch?

There is a clear common definitions for clock direction, so this should 
be ok, right?

If the clock direction patch would go in I would not need to add more 
stuff to already quite messy davinci-evm driver.

Best regards,
Jyri

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 3/3] ASoC: simple-card: Add system-clock-id DT parameter to dai nodes
  2014-06-24  9:59     ` Jyri Sarha
@ 2014-06-24 10:20       ` Mark Brown
  0 siblings, 0 replies; 9+ messages in thread
From: Mark Brown @ 2014-06-24 10:20 UTC (permalink / raw)
  To: Jyri Sarha
  Cc: alsa-devel, linux-omap, devicetree, bcousson, peter.ujfalusi,
	liam.r.girdwood, detheridge

[-- Attachment #1: Type: text/plain, Size: 669 bytes --]

On Tue, Jun 24, 2014 at 12:59:20PM +0300, Jyri Sarha wrote:

> I see, actually this is not something I would need anytime soon, but
> how about the previous "Add system-clock-direction DT parameter to dai
> nodes" patch?

> There is a clear common definitions for clock direction, so this should be
> ok, right?

> If the clock direction patch would go in I would not need to add more stuff
> to already quite messy davinci-evm driver.

Yeah, I'm still thinking about that one.  One thing I was wondering was
if we should agree a definition that's generic with the clock API but
then have an ASoC specific implementation for now until the clock API
gets further along.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2014-06-24 10:21 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-13 10:04 [PATCH 0/3] More simple-card dai node clock parameters Jyri Sarha
2014-06-13 10:04 ` [PATCH 1/3] ASoC: simple-card: Make u32 DT parameter handling 64-bit proof Jyri Sarha
2014-06-21 10:07   ` Mark Brown
2014-06-13 10:04 ` [PATCH 2/3] ASoC: simple-card: Add system-clock-direction DT parameter to dai nodes Jyri Sarha
2014-06-13 10:04 ` [PATCH 3/3] ASoC: simple-card: Add system-clock-id " Jyri Sarha
2014-06-13 12:24   ` satish kumar
2014-06-21 10:09   ` Mark Brown
2014-06-24  9:59     ` Jyri Sarha
2014-06-24 10:20       ` 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).