[PATCH 7/7 v2] ASoC: rsrc-card: use asoc_simple_card_parse_card_name()

2016-07-11 Thread Kuninori Morimoto

From: Kuninori Morimoto 

Signed-off-by: Kuninori Morimoto 
---
v1 -> v2

 - no change

 sound/soc/sh/rcar/rsrc-card.c | 8 +++-
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/sound/soc/sh/rcar/rsrc-card.c b/sound/soc/sh/rcar/rsrc-card.c
index 239a13a..fa37f84 100644
--- a/sound/soc/sh/rcar/rsrc-card.c
+++ b/sound/soc/sh/rcar/rsrc-card.c
@@ -395,9 +395,6 @@ static int rsrc_card_parse_of(struct device_node *node,
   "audio-routing");
}
 
-   /* Parse the card name from DT */
-   snd_soc_of_parse_card_name(&priv->snd_card, "card-name");
-
/* sampling rate convert */
of_property_read_u32(node, "convert-rate", &priv->convert_rate);
 
@@ -413,8 +410,9 @@ static int rsrc_card_parse_of(struct device_node *node,
if (ret < 0)
return ret;
 
-   if (!priv->snd_card.name)
-   priv->snd_card.name = priv->snd_card.dai_link->name;
+   ret = asoc_simple_card_parse_card_name(&priv->snd_card, "card-");
+   if (ret < 0)
+   return ret;
 
return 0;
 }
-- 
1.9.1



[PATCH 6/7 v2] ASoC: simple-card: use asoc_simple_card_parse_card_name()

2016-07-11 Thread Kuninori Morimoto

From: Kuninori Morimoto 

Signed-off-by: Kuninori Morimoto 
---
v1 -> v2

 - no change

 sound/soc/generic/simple-card.c | 11 +++
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c
index 07469cd..43295f0 100644
--- a/sound/soc/generic/simple-card.c
+++ b/sound/soc/generic/simple-card.c
@@ -427,9 +427,6 @@ static int asoc_simple_card_parse_of(struct device_node 
*node,
if (!node)
return -EINVAL;
 
-   /* Parse the card name from DT */
-   snd_soc_of_parse_card_name(&priv->snd_card, PREFIX "name");
-
/* The off-codec widgets */
if (of_property_read_bool(node, PREFIX "widgets")) {
ret = snd_soc_of_parse_audio_simple_widgets(&priv->snd_card,
@@ -451,9 +448,6 @@ static int asoc_simple_card_parse_of(struct device_node 
*node,
if (ret == 0)
priv->mclk_fs = val;
 
-   dev_dbg(dev, "New simple-card: %s\n", priv->snd_card.name ?
-   priv->snd_card.name : "");
-
/* Single/Muti DAI link(s) & New style of DT node */
if (of_get_child_by_name(node, PREFIX "dai-link")) {
struct device_node *np = NULL;
@@ -476,8 +470,9 @@ static int asoc_simple_card_parse_of(struct device_node 
*node,
return ret;
}
 
-   if (!priv->snd_card.name)
-   priv->snd_card.name = priv->snd_card.dai_link->name;
+   ret = asoc_simple_card_parse_card_name(&priv->snd_card, PREFIX);
+   if (ret)
+   return ret;
 
return 0;
 }
-- 
1.9.1



[PATCH 5/7 v2] ASoC: simple-card-utils: add asoc_simple_card_parse_card_name()

2016-07-11 Thread Kuninori Morimoto
From: Kuninori Morimoto 

simple-card needs to get its card name.
This patch makes this method simple style standard.

Signed-off-by: Kuninori Morimoto 
---
v1 -> v2

 - no change

 include/sound/simple_card_utils.h |  2 ++
 sound/soc/generic/simple-card-utils.c | 20 
 2 files changed, 22 insertions(+)

diff --git a/include/sound/simple_card_utils.h 
b/include/sound/simple_card_utils.h
index b88a8dc..86088ae 100644
--- a/include/sound/simple_card_utils.h
+++ b/include/sound/simple_card_utils.h
@@ -30,5 +30,7 @@ int asoc_simple_card_parse_daifmt(struct device *dev,
 int asoc_simple_card_set_dailink_name(struct device *dev,
  struct snd_soc_dai_link *dai_link,
  const char *fmt, ...);
+int asoc_simple_card_parse_card_name(struct snd_soc_card *card,
+char *prefix);
 
 #endif /* __SIMPLE_CARD_CORE_H */
diff --git a/sound/soc/generic/simple-card-utils.c 
b/sound/soc/generic/simple-card-utils.c
index 48c7366..d89a9a1 100644
--- a/sound/soc/generic/simple-card-utils.c
+++ b/sound/soc/generic/simple-card-utils.c
@@ -75,3 +75,23 @@ int asoc_simple_card_set_dailink_name(struct device *dev,
return ret;
 }
 EXPORT_SYMBOL_GPL(asoc_simple_card_set_dailink_name);
+
+int asoc_simple_card_parse_card_name(struct snd_soc_card *card,
+char *prefix)
+{
+   char prop[128];
+   int ret;
+
+   snprintf(prop, sizeof(prop), "%sname", prefix);
+
+   /* Parse the card name from DT */
+   ret = snd_soc_of_parse_card_name(card, prop);
+   if (ret < 0)
+   return ret;
+
+   if (!card->name && card->dai_link)
+   card->name = card->dai_link->name;
+
+   return 0;
+}
+EXPORT_SYMBOL_GPL(asoc_simple_card_parse_card_name);
-- 
1.9.1



[PATCH 4/7 v2] ASoC: rsrc-card: use asoc_simple_dai instead of rsrc_card_dai

2016-07-11 Thread Kuninori Morimoto
From: Kuninori Morimoto 

Signed-off-by: Kuninori Morimoto 
---
v1 -> v2

 - no change

 sound/soc/sh/rcar/rsrc-card.c | 25 -
 1 file changed, 8 insertions(+), 17 deletions(-)

diff --git a/sound/soc/sh/rcar/rsrc-card.c b/sound/soc/sh/rcar/rsrc-card.c
index 81914ca..239a13a 100644
--- a/sound/soc/sh/rcar/rsrc-card.c
+++ b/sound/soc/sh/rcar/rsrc-card.c
@@ -47,21 +47,12 @@ static const struct of_device_id rsrc_card_of_match[] = {
 };
 MODULE_DEVICE_TABLE(of, rsrc_card_of_match);
 
-struct rsrc_card_dai {
-   unsigned int sysclk;
-   unsigned int tx_slot_mask;
-   unsigned int rx_slot_mask;
-   int slots;
-   int slot_width;
-   struct clk *clk;
-};
-
 #define IDX_CPU0
 #define IDX_CODEC  1
 struct rsrc_card_priv {
struct snd_soc_card snd_card;
struct snd_soc_codec_conf codec_conf;
-   struct rsrc_card_dai *dai_props;
+   struct asoc_simple_dai *dai_props;
struct snd_soc_dai_link *dai_link;
u32 convert_rate;
u32 convert_channels;
@@ -75,7 +66,7 @@ static int rsrc_card_startup(struct snd_pcm_substream 
*substream)
 {
struct snd_soc_pcm_runtime *rtd = substream->private_data;
struct rsrc_card_priv *priv =   snd_soc_card_get_drvdata(rtd->card);
-   struct rsrc_card_dai *dai_props =
+   struct asoc_simple_dai *dai_props =
rsrc_priv_to_props(priv, rtd->num);
 
return clk_prepare_enable(dai_props->clk);
@@ -85,7 +76,7 @@ static void rsrc_card_shutdown(struct snd_pcm_substream 
*substream)
 {
struct snd_soc_pcm_runtime *rtd = substream->private_data;
struct rsrc_card_priv *priv =   snd_soc_card_get_drvdata(rtd->card);
-   struct rsrc_card_dai *dai_props =
+   struct asoc_simple_dai *dai_props =
rsrc_priv_to_props(priv, rtd->num);
 
clk_disable_unprepare(dai_props->clk);
@@ -101,7 +92,7 @@ static int rsrc_card_dai_init(struct snd_soc_pcm_runtime 
*rtd)
struct rsrc_card_priv *priv = snd_soc_card_get_drvdata(rtd->card);
struct snd_soc_dai *dai;
struct snd_soc_dai_link *dai_link;
-   struct rsrc_card_dai *dai_props;
+   struct asoc_simple_dai *dai_props;
int num = rtd->num;
int ret;
 
@@ -163,7 +154,7 @@ static int rsrc_card_parse_links(struct device_node *np,
 {
struct device *dev = rsrc_priv_to_dev(priv);
struct snd_soc_dai_link *dai_link = rsrc_priv_to_link(priv, idx);
-   struct rsrc_card_dai *dai_props = rsrc_priv_to_props(priv, idx);
+   struct asoc_simple_dai *dai_props = rsrc_priv_to_props(priv, idx);
struct of_phandle_args args;
int ret;
 
@@ -267,7 +258,7 @@ static int rsrc_card_parse_clk(struct device_node *np,
   int idx, bool is_fe)
 {
struct snd_soc_dai_link *dai_link = rsrc_priv_to_link(priv, idx);
-   struct rsrc_card_dai *dai_props = rsrc_priv_to_props(priv, idx);
+   struct asoc_simple_dai *dai_props = rsrc_priv_to_props(priv, idx);
struct clk *clk;
struct device_node *of_np = is_fe ? dai_link->cpu_of_node :
dai_link->codec_of_node;
@@ -304,7 +295,7 @@ static int rsrc_card_dai_sub_link_of(struct device_node 
*node,
 {
struct device *dev = rsrc_priv_to_dev(priv);
struct snd_soc_dai_link *dai_link = rsrc_priv_to_link(priv, idx);
-   struct rsrc_card_dai *dai_props = rsrc_priv_to_props(priv, idx);
+   struct asoc_simple_dai *dai_props = rsrc_priv_to_props(priv, idx);
int ret;
 
ret = rsrc_card_parse_links(np, priv, idx, is_fe);
@@ -371,7 +362,7 @@ static int rsrc_card_parse_of(struct device_node *node,
  struct device *dev)
 {
const struct rsrc_card_of_data *of_data = of_device_get_match_data(dev);
-   struct rsrc_card_dai *props;
+   struct asoc_simple_dai *props;
struct snd_soc_dai_link *links;
int ret;
int num;
-- 
1.9.1



[PATCH 3/7 v2] ASoC: rsrc-card: use asoc_simple_card_parse_dailink_name()

2016-07-11 Thread Kuninori Morimoto
From: Kuninori Morimoto 

Signed-off-by: Kuninori Morimoto 
---
v1 -> v2

 - no change

 sound/soc/sh/rcar/rsrc-card.c | 26 +-
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/sound/soc/sh/rcar/rsrc-card.c b/sound/soc/sh/rcar/rsrc-card.c
index c065a6d..81914ca 100644
--- a/sound/soc/sh/rcar/rsrc-card.c
+++ b/sound/soc/sh/rcar/rsrc-card.c
@@ -47,7 +47,6 @@ static const struct of_device_id rsrc_card_of_match[] = {
 };
 MODULE_DEVICE_TABLE(of, rsrc_card_of_match);
 
-#define DAI_NAME_NUM   32
 struct rsrc_card_dai {
unsigned int sysclk;
unsigned int tx_slot_mask;
@@ -55,7 +54,6 @@ struct rsrc_card_dai {
int slots;
int slot_width;
struct clk *clk;
-   char dai_name[DAI_NAME_NUM];
 };
 
 #define IDX_CPU0
@@ -163,6 +161,7 @@ static int rsrc_card_parse_links(struct device_node *np,
 struct rsrc_card_priv *priv,
 int idx, bool is_fe)
 {
+   struct device *dev = rsrc_priv_to_dev(priv);
struct snd_soc_dai_link *dai_link = rsrc_priv_to_link(priv, idx);
struct rsrc_card_dai *dai_props = rsrc_priv_to_props(priv, idx);
struct of_phandle_args args;
@@ -200,9 +199,11 @@ static int rsrc_card_parse_links(struct device_node *np,
if (ret < 0)
return ret;
 
-   /* set dai_name */
-   snprintf(dai_props->dai_name, DAI_NAME_NUM, "fe.%s",
-dai_link->cpu_dai_name);
+   ret = asoc_simple_card_set_dailink_name(dev, dai_link,
+   "fe.%s",
+   dai_link->cpu_dai_name);
+   if (ret < 0)
+   return ret;
 
/*
 * In soc_bind_dai_link() will check cpu name after
@@ -216,7 +217,6 @@ static int rsrc_card_parse_links(struct device_node *np,
if (!args.args_count)
dai_link->cpu_dai_name = NULL;
} else {
-   struct device *dev = rsrc_priv_to_dev(priv);
const struct rsrc_card_of_data *of_data;
 
of_data = of_device_get_match_data(dev);
@@ -234,6 +234,12 @@ static int rsrc_card_parse_links(struct device_node *np,
if (ret < 0)
return ret;
 
+   ret = asoc_simple_card_set_dailink_name(dev, dai_link,
+   "be.%s",
+   
dai_link->codec_dai_name);
+   if (ret < 0)
+   return ret;
+
/* additional name prefix */
if (of_data) {
priv->codec_conf.of_node = dai_link->codec_of_node;
@@ -244,18 +250,12 @@ static int rsrc_card_parse_links(struct device_node *np,
  dai_link->codec_of_node,
  "audio-prefix");
}
-
-   /* set dai_name */
-   snprintf(dai_props->dai_name, DAI_NAME_NUM, "be.%s",
-dai_link->codec_dai_name);
}
 
/* Simple Card assumes platform == cpu */
dai_link->platform_of_node  = dai_link->cpu_of_node;
dai_link->dpcm_playback = 1;
dai_link->dpcm_capture  = 1;
-   dai_link->name  = dai_props->dai_name;
-   dai_link->stream_name   = dai_props->dai_name;
dai_link->ops   = &rsrc_card_ops;
dai_link->init  = rsrc_card_dai_init;
 
@@ -316,7 +316,7 @@ static int rsrc_card_dai_sub_link_of(struct device_node 
*node,
return ret;
 
dev_dbg(dev, "\t%s / %04x / %d\n",
-   dai_props->dai_name,
+   dai_link->name,
dai_link->dai_fmt,
dai_props->sysclk);
 
-- 
1.9.1



[PATCH 2/7 v2] ASoC: simple-card: use asoc_simple_card_parse_dailink_name()

2016-07-11 Thread Kuninori Morimoto
From: Kuninori Morimoto 

Signed-off-by: Kuninori Morimoto 
---
v1 -> v2

 - no change

 sound/soc/generic/simple-card.c | 17 +
 1 file changed, 5 insertions(+), 12 deletions(-)

diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c
index e3a32d3..07469cd 100644
--- a/sound/soc/generic/simple-card.c
+++ b/sound/soc/generic/simple-card.c
@@ -319,7 +319,6 @@ static int asoc_simple_card_dai_link_of(struct device_node 
*node,
struct device_node *cpu = NULL;
struct device_node *plat = NULL;
struct device_node *codec = NULL;
-   char *name;
char prop[128];
char *prefix = "";
int ret, cpu_args;
@@ -380,19 +379,13 @@ static int asoc_simple_card_dai_link_of(struct 
device_node *node,
if (!dai_link->platform_of_node)
dai_link->platform_of_node = dai_link->cpu_of_node;
 
-   /* DAI link name is created from CPU/CODEC dai name */
-   name = devm_kzalloc(dev,
-   strlen(dai_link->cpu_dai_name)   +
-   strlen(dai_link->codec_dai_name) + 2,
-   GFP_KERNEL);
-   if (!name) {
-   ret = -ENOMEM;
+   ret = asoc_simple_card_set_dailink_name(dev, dai_link,
+   "%s-%s",
+   dai_link->cpu_dai_name,
+   dai_link->codec_dai_name);
+   if (ret < 0)
goto dai_link_of_err;
-   }
 
-   sprintf(name, "%s-%s", dai_link->cpu_dai_name,
-   dai_link->codec_dai_name);
-   dai_link->name = dai_link->stream_name = name;
dai_link->ops = &asoc_simple_card_ops;
dai_link->init = asoc_simple_card_dai_init;
 
-- 
1.9.1



[PATCH 1/7 v2] ASoC: simple-card-utils: add asoc_simple_card_set_dailink_name()

2016-07-11 Thread Kuninori Morimoto
From: Kuninori Morimoto 

Current simple-card is creating dai_link->name / dai_link->stream_name.
These are based on CPU + Codec name, or "fe.CPU" or "be.Codec" if it
was DPCM.
This patch adds asoc_simple_card_set_dailink_name() and set dailink
name as common method.

Signed-off-by: Kuninori Morimoto 
---
v1 - v2

 - use 2 assignments for name settings

 include/sound/simple_card_utils.h |  3 +++
 sound/soc/generic/simple-card-utils.c | 23 +++
 2 files changed, 26 insertions(+)

diff --git a/include/sound/simple_card_utils.h 
b/include/sound/simple_card_utils.h
index 50aa7b2..b88a8dc 100644
--- a/include/sound/simple_card_utils.h
+++ b/include/sound/simple_card_utils.h
@@ -27,5 +27,8 @@ int asoc_simple_card_parse_daifmt(struct device *dev,
  struct device_node *codec,
  char *prefix,
  unsigned int *retfmt);
+int asoc_simple_card_set_dailink_name(struct device *dev,
+ struct snd_soc_dai_link *dai_link,
+ const char *fmt, ...);
 
 #endif /* __SIMPLE_CARD_CORE_H */
diff --git a/sound/soc/generic/simple-card-utils.c 
b/sound/soc/generic/simple-card-utils.c
index 3f6b725..48c7366 100644
--- a/sound/soc/generic/simple-card-utils.c
+++ b/sound/soc/generic/simple-card-utils.c
@@ -52,3 +52,26 @@ int asoc_simple_card_parse_daifmt(struct device *dev,
return 0;
 }
 EXPORT_SYMBOL_GPL(asoc_simple_card_parse_daifmt);
+
+int asoc_simple_card_set_dailink_name(struct device *dev,
+ struct snd_soc_dai_link *dai_link,
+ const char *fmt, ...)
+{
+   va_list ap;
+   char *name = NULL;
+   int ret = -ENOMEM;
+
+   va_start(ap, fmt);
+   name = devm_kvasprintf(dev, GFP_KERNEL, fmt, ap);
+   va_end(ap);
+
+   if (name) {
+   ret = 0;
+
+   dai_link->name  = name;
+   dai_link->stream_name   = name;
+   }
+
+   return ret;
+}
+EXPORT_SYMBOL_GPL(asoc_simple_card_set_dailink_name);
-- 
1.9.1



[PATCH 0/7 v2] ASoC: simple: dailink_name and card_name

2016-07-11 Thread Kuninori Morimoto

Hi Mark

These are v2 of dailink_name and card_name cleanup patches for simple-card.
1) - 3) : for dailink_name
4)  : tidyup
5) - 7) : for card_name

Kuninori Morimoto (7):
  1) ASoC: simple-card-utils: add asoc_simple_card_set_dailink_name()
  2) ASoC: simple-card: use asoc_simple_card_parse_dailink_name()
  3) ASoC: rsrc-card: use asoc_simple_card_parse_dailink_name()
  4) ASoC: rsrc-card: use asoc_simple_dai instead of rsrc_card_dai
  5) ASoC: simple-card-utils: add asoc_simple_card_parse_card_name()
  6) ASoC: simple-card: use asoc_simple_card_parse_card_name()
  7) ASoC: rsrc-card: use asoc_simple_card_parse_card_name()

 include/sound/simple_card_utils.h |  5 +++
 sound/soc/generic/simple-card-utils.c | 43 +
 sound/soc/generic/simple-card.c   | 28 +
 sound/soc/sh/rcar/rsrc-card.c | 59 ++-
 4 files changed, 80 insertions(+), 55 deletions(-)

-- 
1.9.1



[PATCH 1/2] ARM: dts: r8a7792: add PLL1 divided by 2 clock

2016-07-11 Thread Sergei Shtylyov
Despite the QSPI clock has PLL1/VCOx1/4 clock as a parent, the latter
hasn't been added to the R8A7792 device tree  -- fix this overlook at
last...

Signed-off-by: Sergei Shtylyov 

---
 arch/arm/boot/dts/r8a7792.dtsi |7 +++
 1 file changed, 7 insertions(+)

Index: renesas/arch/arm/boot/dts/r8a7792.dtsi
===
--- renesas.orig/arch/arm/boot/dts/r8a7792.dtsi
+++ renesas/arch/arm/boot/dts/r8a7792.dtsi
@@ -469,6 +469,13 @@
};
 
/* Fixed factor clocks */
+   pll1_div2_clk: pll1_div2 {
+   compatible = "fixed-factor-clock";
+   clocks = <&cpg_clocks R8A7792_CLK_PLL1>;
+   #clock-cells = <0>;
+   clock-div = <2>;
+   clock-mult = <1>;
+   };
zs_clk: zs {
compatible = "fixed-factor-clock";
clocks = <&cpg_clocks R8A7792_CLK_PLL1>;



[PATCH 2/2] ARM: dts: r8a7792: remove ADSP clock

2016-07-11 Thread Sergei Shtylyov
Simon Horman told  me  that R8A7792 had ADSP clock (based on the most recent
R-Car gen2 manual) but when I  got that manual as well, this claim proved
to be false: R8A7792 is the only gen2 SoC that doesn't  have ADSP at all.
Remove that  clock  for good...

Signed-off-by: Sergei Shtylyov 

---
 arch/arm/boot/dts/r8a7792.dtsi|2 +-
 include/dt-bindings/clock/r8a7792-clock.h |1 -
 2 files changed, 1 insertion(+), 2 deletions(-)

Index: renesas/arch/arm/boot/dts/r8a7792.dtsi
===
--- renesas.orig/arch/arm/boot/dts/r8a7792.dtsi
+++ renesas/arch/arm/boot/dts/r8a7792.dtsi
@@ -464,7 +464,7 @@
clocks = <&extal_clk>;
#clock-cells = <1>;
clock-output-names = "main", "pll0", "pll1", "pll3",
-"lb", "qspi", "z", "adsp";
+"lb", "qspi", "z";
#power-domain-cells = <0>;
};
 
Index: renesas/include/dt-bindings/clock/r8a7792-clock.h
===
--- renesas.orig/include/dt-bindings/clock/r8a7792-clock.h
+++ renesas/include/dt-bindings/clock/r8a7792-clock.h
@@ -18,7 +18,6 @@
 #define R8A7792_CLK_LB 4
 #define R8A7792_CLK_QSPI   5
 #define R8A7792_CLK_Z  6
-#define R8A7792_CLK_ADSP   7
 
 /* MSTP0 */
 #define R8A7792_CLK_MSIOF0 0



[PATCH 0/2] R8A7792 clock fixes

2016-07-11 Thread Sergei Shtylyov
Hello.

   Here's the set of 2 patches against Simon Horman's 'renesas.git' repo,
'renesas-devel-20160711-v4.7-rc7' tag. I've found a couple of issues in the
R8A7792 DT clock descriptions, so these patches are targeted as fixes for 4.8.

[1/2] ARM: dts: r8a7792: add PLL1 divided by 2 clock
[2/2] ARM: dts: r8a7792: remove ADSP clock

WBR, Sergei



Re: [PATCH v3 5/6] pwm: add R-Car H3 device tree bindings

2016-07-11 Thread Thierry Reding
On Thu, Mar 31, 2016 at 01:39:15PM +0200, Ulrich Hecht wrote:
> Signed-off-by: Ulrich Hecht 
> Acked-by: Geert Uytterhoeven 
> ---
>  Documentation/devicetree/bindings/pwm/renesas,pwm-rcar.txt | 1 +
>  1 file changed, 1 insertion(+)

Applied, thanks.

Thierry


signature.asc
Description: PGP signature


Re: [PATCH v3 1/6] pwm: rcar: Use ARCH_RENESAS

2016-07-11 Thread Thierry Reding
On Thu, Mar 31, 2016 at 01:39:11PM +0200, Ulrich Hecht wrote:
> From: Ryo Kodama 
> 
> Replace ARCH_RCAR_GEN{1,2} with ARCH_RENESAS in order to support R-Car Gen3.
> 
> Signed-off-by: Ryo Kodama 
> Signed-off-by: Harunobu Kurokawa 
> Signed-off-by: Ulrich Hecht 
> Acked-by: Geert Uytterhoeven 
> ---
>  drivers/pwm/Kconfig | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Applied, thanks.

Thierry


signature.asc
Description: PGP signature


Re: [PATCH 5/7] bus: vexpress-config: add missing of_node_put after calling of_parse_phandle

2016-07-11 Thread Liviu Dudau
On Fri, Jul 01, 2016 at 05:41:59PM +0800, Peter Chen wrote:
> of_node_put needs to be called when the device node which is got
> from of_parse_phandle has finished using.
> 
> Cc: Liviu Dudau 
> Cc: Sudeep Holla 
> Cc: Lorenzo Pieralisi 
> Signed-off-by: Peter Chen 

Acked-by: Liviu Dudau 

> ---
>  drivers/bus/vexpress-config.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/bus/vexpress-config.c b/drivers/bus/vexpress-config.c
> index c3cb76b..9efdf1d 100644
> --- a/drivers/bus/vexpress-config.c
> +++ b/drivers/bus/vexpress-config.c
> @@ -178,6 +178,7 @@ static int vexpress_config_populate(struct device_node 
> *node)
>  
>   parent = class_find_device(vexpress_config_class, NULL, bridge,
>   vexpress_config_node_match);
> + of_node_put(bridge);
>   if (WARN_ON(!parent))
>   return -ENODEV;
>  
> -- 
> 1.9.1
> 
> 
> ___
> linux-arm-kernel mailing list
> linux-arm-ker...@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
> 

-- 

| I would like to |
| fix the world,  |
| but they're not |
| giving me the   |
 \ source code!  /
  ---
¯\_(ツ)_/¯


RE: [RFC] pci: Provide a domain limited version of pdev_fixup_irq

2016-07-11 Thread Phil Edworthy
Note that kbuild test failed because domain_nr is only available when we
have CONFIG_PCI_DOMAINS_GENERIC defined, so the patch will definitely
have to change.

Phil

On 08 July 2016 12:50, Phil Edworthy wrote:
> Hi Bjorn,
> 
> I've marked this as RFC as I guess there might be a better way to do
> this, but I'm not sure how. I would appreciate your thoughts on this.
> 
> Thanks
> Phil
> 
> ---
> pdev_fixup_irq() performs interrupt swizzling on all PCI devices,
> no matter that the device may be on a completely unrelated PCI
> Host controller.
> 
> When you have multiple PCI Host controllers, pdev_fixup_irq() can
> clobber the dev->irq of devices it should not be changing.
> This has been seen when performing suspend/resume on boards with
> two R-Car PCIe Host controllers, resulting in a NULL ptr access
> in __pci_restore_msi_state. This happens because dev->irq has been
> overwritten with 0, and irq_get_msi_desc(dev->irq) returns NULL.
> 
> This patch introduces a new function, pci_fixup_irqs_local(), that
> performs the same operation as pdev_fixup_irq(), but only changes
> the dev->irq of device on the same domain.
> 
> Signed-off-by: Phil Edworthy 
> ---
>  drivers/pci/setup-irq.c | 25 ++---
>  include/linux/pci.h |  3 +++
>  2 files changed, 25 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/pci/setup-irq.c b/drivers/pci/setup-irq.c
> index 95c225b..90ea8fa 100644
> --- a/drivers/pci/setup-irq.c
> +++ b/drivers/pci/setup-irq.c
> @@ -22,7 +22,8 @@ void __weak pcibios_update_irq(struct pci_dev *dev, int
> irq)
>   pci_write_config_byte(dev, PCI_INTERRUPT_LINE, irq);
>  }
> 
> -static void pdev_fixup_irq(struct pci_dev *dev,
> +static void pdev_fixup_irq(int domain_nr,
> +struct pci_dev *dev,
>  u8 (*swizzle)(struct pci_dev *, u8 *),
>  int (*map_irq)(const struct pci_dev *, u8, u8))
>  {
> @@ -48,8 +49,15 @@ static void pdev_fixup_irq(struct pci_dev *dev,
>   if (irq == -1)
>   irq = 0;
>   }
> - dev->irq = irq;
> + /* Since pci_fixup_irqs() can be called more than once due to multiple
> +  * host controllers, and we scan all PCI devices, not just those
> +  * attached to this controller, make sure we don't clobber dev->irq
> +  * that has nothing to do with this domain.
> +  */
> + if (domain_nr >= 0 && dev->bus->domain_nr != domain_nr)
> + return;
> 
> + dev->irq = irq;
>   dev_dbg(&dev->dev, "fixup irq: got %d\n", dev->irq);
> 
>   /* Always tell the device, so the driver knows what is
> @@ -63,6 +71,17 @@ void pci_fixup_irqs(u8 (*swizzle)(struct pci_dev *, u8 *),
>   struct pci_dev *dev = NULL;
> 
>   for_each_pci_dev(dev)
> - pdev_fixup_irq(dev, swizzle, map_irq);
> + pdev_fixup_irq(-1, dev, swizzle, map_irq);
>  }
>  EXPORT_SYMBOL_GPL(pci_fixup_irqs);
> +
> +void pci_fixup_irqs_local(struct pci_bus *bus,
> + u8 (*swizzle)(struct pci_dev *, u8 *),
> + int (*map_irq)(const struct pci_dev *, u8, u8))
> +{
> + struct pci_dev *dev = NULL;
> +
> + for_each_pci_dev(dev)
> + pdev_fixup_irq(bus->domain_nr, dev, swizzle, map_irq);
> +}
> +EXPORT_SYMBOL_GPL(pci_fixup_irqs_local);
> diff --git a/include/linux/pci.h b/include/linux/pci.h
> index 8badb66..37a97df 100644
> --- a/include/linux/pci.h
> +++ b/include/linux/pci.h
> @@ -1134,6 +1134,9 @@ void pdev_enable_device(struct pci_dev *);
>  int pci_enable_resources(struct pci_dev *, int mask);
>  void pci_fixup_irqs(u8 (*)(struct pci_dev *, u8 *),
>   int (*)(const struct pci_dev *, u8, u8));
> +void pci_fixup_irqs_local(struct pci_bus *,
> + u8 (*)(struct pci_dev *, u8 *),
> + int (*)(const struct pci_dev *, u8, u8));
>  #define HAVE_PCI_REQ_REGIONS 2
>  int __must_check pci_request_regions(struct pci_dev *, const char *);
>  int __must_check pci_request_regions_exclusive(struct pci_dev *, const char 
> *);
> --
> 2.5.0



Re: [PATCH -next] sh-pfc: Use PTR_ERR_OR_ZERO() to simplify the code

2016-07-11 Thread Linus Walleij
On Wed, Jul 6, 2016 at 2:03 PM,   wrote:

> From: Wei Yongjun 
>
> Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR.
>
> Signed-off-by: Wei Yongjun 

Patch applied with Laurent's ACK.

(Not expecting Geert to collect patches for me this late in the merge
cycle.)

Yours,
Linus Walleij


Re: [PATCH] gpio: rcar: add R8A7792 support

2016-07-11 Thread Linus Walleij
On Thu, Jul 7, 2016 at 4:11 PM, Sergei Shtylyov
 wrote:

> Renesas  R8A7792 SoC is a member of the R-Car gen2 family, add support for
> its GPIO controllers.
>
> Signed-off-by: Sergei Shtylyov 

Patch applied.

Yours,
Linus Walleij