RE: [PATCH 7/7] devfreq: exynos-bus: add missing of_node_put after calling of_parse_phandle
> > - Original Message - > Sender : Peter Chen> Date : 2016-07-01 18:49 (GMT+9) > Title : [PATCH 7/7] devfreq: exynos-bus: add missing of_node_put after > calling of_parse_phandle > > of_node_put needs to be called when the device node which is got > from of_parse_phandle has finished using. > > Cc: Chanwoo Choi > Cc: MyungJoo Ham > Cc: Kyungmin Park > Cc: Kukjin Kim > Cc: Krzysztof Kozlowski > Signed-off-by: Peter Chen With the change (build error fix) of the following added, (I'll update) Signed-off-by: MyungJoo Ham Cheers, MyungJoo > --- > drivers/devfreq/exynos-bus.c | 9 ++--- > 1 file changed, 6 insertions(+), 3 deletions(-) > > diff --git a/drivers/devfreq/exynos-bus.c b/drivers/devfreq/exynos-bus.c > index 2363d0a..a38b5ec 100644 > --- a/drivers/devfreq/exynos-bus.c > +++ b/drivers/devfreq/exynos-bus.c > @@ -383,7 +383,7 @@ err_clk: > static int exynos_bus_probe(struct platform_device *pdev) > { > struct device *dev = >dev; > -struct device_node *np = dev->of_node; > +struct device_node *np = dev->of_node, node; + struct device_node *np = dev->of_node, *node; > struct devfreq_dev_profile *profile; > struct devfreq_simple_ondemand_data *ondemand_data; > struct devfreq_passive_data *passive_data; ...
RE: [PATCH 6/7] devfreq: add missing of_node_put after calling of_parse_phandle
> - Original Message - > Sender : Peter Chen> Date : 2016-07-01 18:49 (GMT+9) > Title : [PATCH 6/7] devfreq: add missing of_node_put after calling > of_parse_phandle > > of_node_put needs to be called when the device node which is got > from of_parse_phandle has finished using. > > Cc: MyungJoo Ham > Cc: Kyungmin Park > Signed-off-by: Peter Chen Thank you! Signed-off-by: MyungJoo Ham
[PATCH 7/7] ASoC: rsrc-card: use asoc_simple_card_parse_card_name()
From: Kuninori MorimotoSigned-off-by: Kuninori Morimoto --- 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(>snd_card, "card-name"); - /* sampling rate convert */ of_property_read_u32(node, "convert-rate", >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(>snd_card, "card-"); + if (ret < 0) + return ret; return 0; } -- 1.9.1
[PATCH 5/7] ASoC: simple-card-utils: add asoc_simple_card_parse_card_name()
From: Kuninori Morimotosimple-card needs to get its card name. This patch makes this method simple style standard. Signed-off-by: Kuninori Morimoto --- previous -> this - check card->dai_link 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 7f9014e..45eb093 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] ASoC: rsrc-card: use asoc_simple_dai instead of rsrc_card_dai
From: Kuninori MorimotoSigned-off-by: Kuninori Morimoto --- 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] ASoC: rsrc-card: use asoc_simple_card_parse_dailink_name()
From: Kuninori MorimotoSigned-off-by: Kuninori Morimoto --- 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 = _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] ASoC: simple-card: use asoc_simple_card_parse_dailink_name()
From: Kuninori MorimotoSigned-off-by: Kuninori Morimoto --- 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 = _simple_card_ops; dai_link->init = asoc_simple_card_dai_init; -- 1.9.1
[PATCH 1/7] ASoC: simple-card-utils: add asoc_simple_card_set_dailink_name()
From: Kuninori MorimotoCurrent 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 --- previous -> this - asoc_simple_card_set_dailink_name() doen't include DPCM specific naming 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..7f9014e 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 = + dai_link->stream_name = name; + } + + return ret; +} +EXPORT_SYMBOL_GPL(asoc_simple_card_set_dailink_name); -- 1.9.1
[PATCH 0/7] ASoC: simple: dailink_name and card_name
Hi Mark These are for dailink_name and card_name cleanup 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
Re: [PATCH 3/6] ASoC: simple-card-utils: add asoc_simple_card_parse_dailink_name()
Hi Mark > > Please let me know if your favored style is name format should be > > handled on each sound card, not in utils.c > > I can arrange it. > > I'd definitely prefer to limit the usage of DPCM in generic code so > keeping it in the card seems safer. As you wish !! I will do it in next version.
[PATCH v2 1/2] ARM: dts: r8a7792: add GPIO clocks
Describe the GPIO clocks in the R8A7792 device tree. Signed-off-by: Sergei ShtylyovReviewed-by: Geert Uytterhoeven --- Changes in version 2: - converted stray spaces to a tab; - added Geert's tag. arch/arm/boot/dts/r8a7792.dtsi | 21 + 1 file changed, 21 insertions(+) Index: renesas/arch/arm/boot/dts/r8a7792.dtsi === --- renesas.orig/arch/arm/boot/dts/r8a7792.dtsi +++ renesas/arch/arm/boot/dts/r8a7792.dtsi @@ -363,6 +363,27 @@ clock-output-names = "hscif1", "hscif0", "scif3", "scif2", "scif1", "scif0"; }; + mstp9_clks: mstp9_clks@e6150994 { + compatible = "renesas,r8a7792-mstp-clocks", +"renesas,cpg-mstp-clocks"; + reg = <0 0xe6150994 0 4>, <0 0xe61509a4 0 4>; + clocks = <_clk>, <_clk>, <_clk>, <_clk>, +<_clk>, <_clk>, <_clk>, <_clk>, +<_clk>, <_clk>, <_clk>, <_clk>; + #clock-cells = <1>; + clock-indices = < + R8A7792_CLK_GPIO7 R8A7792_CLK_GPIO6 + R8A7792_CLK_GPIO5 R8A7792_CLK_GPIO4 + R8A7792_CLK_GPIO3 R8A7792_CLK_GPIO2 + R8A7792_CLK_GPIO1 R8A7792_CLK_GPIO0 + R8A7792_CLK_GPIO11 R8A7792_CLK_GPIO10 + R8A7792_CLK_GPIO9 R8A7792_CLK_GPIO8 + >; + clock-output-names = + "gpio7", "gpio6", "gpio5", "gpio4", + "gpio3", "gpio2", "gpio1", "gpio0", + "gpio11", "gpio10", "gpio9", "gpio8"; + }; }; /* External root clock */
[PATCH] gpio: rcar: document R8A7792 support
Renesas R8A7792 SoC is a member of the R-Car gen2 family that is supported by the Renesas R-Car GPIO driver. Signed-off-by: Sergei Shtylyov--- The patch is against the 'devel' branch of Linus Walleij's 'linux-gpio.git' repo. Documentation/devicetree/bindings/gpio/renesas,gpio-rcar.txt |1 + 1 file changed, 1 insertion(+) Index: linux-gpio/Documentation/devicetree/bindings/gpio/renesas,gpio-rcar.txt === --- linux-gpio.orig/Documentation/devicetree/bindings/gpio/renesas,gpio-rcar.txt +++ linux-gpio/Documentation/devicetree/bindings/gpio/renesas,gpio-rcar.txt @@ -7,6 +7,7 @@ Required Properties: - "renesas,gpio-r8a7779": for R8A7779 (R-Car H1) compatible GPIO controller. - "renesas,gpio-r8a7790": for R8A7790 (R-Car H2) compatible GPIO controller. - "renesas,gpio-r8a7791": for R8A7791 (R-Car M2-W) compatible GPIO controller. +- "renesas,gpio-r8a7792": for R8A7792 (R-Car V2H) compatible GPIO controller. - "renesas,gpio-r8a7793": for R8A7793 (R-Car M2-N) compatible GPIO controller. - "renesas,gpio-r8a7794": for R8A7794 (R-Car E2) compatible GPIO controller. - "renesas,gpio-r8a7795": for R8A7795 (R-Car H3) compatible GPIO controller.
Re: [PATCH 3/7] arm: mach-u300: regulator: add missing of_node_put after calling of_parse_phandle
On Fri, Jul 1, 2016 at 11:41 AM, Peter Chenwrote: > of_node_put needs to be called when the device node which is got > from of_parse_phandle has finished using. > > Cc: Linus Walleij > Signed-off-by: Peter Chen Acked-by: Linus Walleij Yours, Linus Walleij
Re: [PATCH] pinctrl: sh-pfc: r8a7792: add EtherAVB pin groups
On Tue, Jul 5, 2016 at 5:46 PM, Geert Uytterhoevenwrote: > On Tue, Jul 5, 2016 at 4:54 PM, Linus Walleij > wrote: >> On Tue, Jul 5, 2016 at 8:57 AM, Geert Uytterhoeven >> wrote: >>> Hi Sergei, >>> >>> On Mon, Jul 4, 2016 at 9:52 PM, Sergei Shtylyov >>> wrote: Add the EtherAVB pin groups to the R8A7792 PFC driver. Signed-off-by: Sergei Shtylyov >>> >>> Reviewed-by: Geert Uytterhoeven >> >> Should I just apply it? >> >> It's late in the kernel cycle but I do not mind stuff like >> this so much. > > You can't, as I haven't send a pull request for the initial r8a7792 support > yet, > so this patch won't apply ;-) Bring it on. None of your stuff has ever bit me so I'm still happy to pull in some more Renesas stuff. Yours, Linus Walleij
Re: [PATCH 0/2] Add R8A7792 GPIO support
Hello. On 07/05/2016 12:10 AM, Sergei Shtylyov wrote: Here's the set of 2 patches against Simon Horman's 'renesas.git' repo, 'renesas-devel-20160704-v4.7-rc6' tag. We're adding the R8A7792 GPIO clocks and device nodes. These patches depend on the R8A7792/Blanche PFC patchset in order to compile and on the R8a7792 PFC driver patchset in order to work properly. [1/2] ARM: dts: r8a7792: add GPIO clocks [2/2] ARM: dts: r8a7792: add GPIO support Didn't run checkpatch.pl on this one. If I did, it would have found the stray spaces in the 1st patch, and undocumented binding in the 2nd... Will repost RSN! WBR, Sergei
Re: [PATCH] pinctrl: sh-pfc: r8a7792: add EtherAVB pin groups
Hi Linus, On Tue, Jul 5, 2016 at 4:54 PM, Linus Walleijwrote: > On Tue, Jul 5, 2016 at 8:57 AM, Geert Uytterhoeven > wrote: >> Hi Sergei, >> >> On Mon, Jul 4, 2016 at 9:52 PM, Sergei Shtylyov >> wrote: >>> Add the EtherAVB pin groups to the R8A7792 PFC driver. >>> >>> Signed-off-by: Sergei Shtylyov >> >> Reviewed-by: Geert Uytterhoeven > > Should I just apply it? > > It's late in the kernel cycle but I do not mind stuff like > this so much. You can't, as I haven't send a pull request for the initial r8a7792 support yet, so this patch won't apply ;-) Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds
Re: [PATCH v2] gpio: convince line to become input in irq helper
I sent a patch for the direction setter to be more careful, but it's no silver bullet for strange semantics. On Tue, Jul 5, 2016 at 12:07 PM, Geert Uytterhoevenwrote: > [1] gpio_rcar e6052000.gpio: sense irq = 11, type = 8 > ravb e680.ethernet eth0: Base address at 0xe680, > 2e:09:0a:00:83:1e, IRQ 131. > ... > [2] gpiochip_irq_reqres: gpiochip e6052000.gpio > [3] gpio_rcar e6052000.gpio: gpio_rcar_direction_input: 11 > [4] gpiochip_irq_reqres: desc->flags = 0x0 (...) > This configures the GPIO for plain input mode, cfr. [3] above, basically > undoing the configuration from [1]. Hence interrupts no longer come through, > and Ethernet fails. The driver is a bit fragile in that it relies on a certain call semantic, I guess it is not a widespread problem so we should be able to make a local fix if necessary. The .set_direction() call should set the direction. Why is it turning off interrupts as a side effect? What happens if you apply this, making the .request() function handle the pin setup and .set_direction() really just setting the direction? diff --git a/drivers/gpio/gpio-rcar.c b/drivers/gpio/gpio-rcar.c index 681c93fb9e70..68fb0147caf4 100644 --- a/drivers/gpio/gpio-rcar.c +++ b/drivers/gpio/gpio-rcar.c @@ -221,7 +221,20 @@ static void gpio_rcar_config_general_input_output_mode(struct gpio_chip *chip, struct gpio_rcar_priv *p = gpiochip_get_data(chip); unsigned long flags; -/* follow steps in the GPIO documentation for +spin_lock_irqsave(>lock, flags); + +/* Select Input Mode or Output Mode in INOUTSEL */ +gpio_rcar_modify_bit(p, INOUTSEL, gpio, output); + +spin_unlock_irqrestore(>lock, flags); +} + +static int gpio_rcar_request(struct gpio_chip *chip, unsigned offset) +{ +struct gpio_rcar_priv *p = gpiochip_get_data(chip); + +/* + * follow steps in the GPIO documentation for * "Setting General Output Mode" and * "Setting General Input Mode" */ @@ -234,14 +247,8 @@ static void gpio_rcar_config_general_input_output_mode(struct gpio_chip *chip, /* Select "General Input/Output Mode" in IOINTSEL */ gpio_rcar_modify_bit(p, IOINTSEL, gpio, false); -/* Select Input Mode or Output Mode in INOUTSEL */ -gpio_rcar_modify_bit(p, INOUTSEL, gpio, output); - spin_unlock_irqrestore(>lock, flags); -} -static int gpio_rcar_request(struct gpio_chip *chip, unsigned offset) -{ return pinctrl_request_gpio(chip->base + offset); } .request() is always called before .set_direction() when issuing gpiod_get() anyways, so the order required according to the comment will be satisfied when the GPIO is first requested, but if we're just using the interrupt, we still will be able to set the direction right. Yours, Linus Walleij
Re: [PATCH v2 3/3] ARM: dts: blanche: add Ethernet pins
On 07/05/2016 10:29 AM, Geert Uytterhoeven wrote: Add the (previously omitted) pin data for the SMSC LAN89218 Ethernet chip to the Blanche board's device tree: the chip's IRQ output is connected to the SoC's IRQ0 pin and its nCS input is connected to the SoC's EX_CS0# pin. Signed-off-by: Sergei Shtylyov--- arch/arm/boot/dts/r8a7792-blanche.dts | 15 +++ 1 file changed, 15 insertions(+) Index: renesas/arch/arm/boot/dts/r8a7792-blanche.dts === --- renesas.orig/arch/arm/boot/dts/r8a7792-blanche.dts +++ renesas/arch/arm/boot/dts/r8a7792-blanche.dts [...] @@ -67,6 +70,18 @@ groups = "scif3_data"; function = "scif3"; }; + + lan89218_pins: lan89218 { + intc { + groups = "intc_irq0"; + function = "intc"; + }; + lbsc { + groups = "lbsc_ex_cs0"; + function = "lbsc"; Don't you need pinctrl for the other LBSC pins, like the address and data lines (Ax and Dy)? Unlike the chip selects, the address/data lines are not "monopolized" by a single device, so I'm not sure what to do with them... Gr{oetje,eeting}s, Geert MBR, Sergei
Re: [PATCH 3/6] ASoC: simple-card-utils: add asoc_simple_card_parse_dailink_name()
On Tue, Jul 05, 2016 at 12:24:54AM +, Kuninori Morimoto wrote: > Please let me know if your favored style is name format should be > handled on each sound card, not in utils.c > I can arrange it. I'd definitely prefer to limit the usage of DPCM in generic code so keeping it in the card seems safer. signature.asc Description: PGP signature
Re: [PATCH 07/39 v2] ASoC: simple-card-utils: add asoc_simple_card_parse_card_name()
On Mon, Jul 04, 2016 at 08:59:53AM +, Kuninori Morimoto wrote: > > If we try to dereference card->dai_link without checking to see if it's > > set then we'll crash. > Ahh, do you mean we need like this ? > if (!card->name && card->dai_link) > card->name = card->dai_link->name; Yes, exactly. signature.asc Description: PGP signature
Re: [PATCH/RFC v2 5/5] mmc: renesas_sdhi: add support for R-Car Gen3 SDHI DMAC
On Thu, Jun 30, 2016 at 12:05 AM, Simon Hormanwrote: > --- a/drivers/mmc/host/sh_mobile_sdhi.c > +++ b/drivers/mmc/host/sh_mobile_sdhi.c > +static int sh_mobile_sdhi_init_dma(enum tmio_mmc_dmac_type dmac_type) > +{ > + switch (dmac_type) { > + case TMIO_MMC_INTERNAL_DMAC: > + return sdhi_internal_dmac_init_dma(); > + > + case TMIO_MMC_SYSC_DMAC: > + return sdhi_sysc_dmac_init_dma(); > + } > +} Depending on compiler version and optimization level: drivers/mmc/host/sh_mobile_sdhi.c:172:1: warning: control reaches end of non-void function [-Wreturn-type] Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds
Re: [PATCH] pinctrl: sh-pfc: r8a7792: add EtherAVB pin groups
Hello. On 7/5/2016 9:57 AM, Geert Uytterhoeven wrote: Add the EtherAVB pin groups to the R8A7792 PFC driver. Signed-off-by: Sergei ShtylyovReviewed-by: Geert Uytterhoeven However, you forgot to add the avb_avtp_match group. Is that intentional? No, it didn't get created in the original Renesas patch and I forgot about it. Gr{oetje,eeting}s, Geert MBR, Sergei
Re: [PATCH v2] gpio: convince line to become input in irq helper
Hi Linus, On Wed, Jun 22, 2016 at 11:25 PM, Linus Walleijwrote: > The generic IRQ helper library just checks if the IRQ line is > set as input before activating it for interrupts. As we > recently started to check things better with .get_dir() it > turns out that it's good to try to convince the line to become > an input before attempting to lock it as IRQ. > > Cc: Björn Andersson > Signed-off-by: Linus Walleij > --- > ChangeLog v1->v2: > - Propagate the error from .direction_input() so we can rely on > it being used. This patch (commit 7e7c059cb50c7c72 in gpio/for-next) breaks Ethernet on r8a7795/salvator-x: libphy: ravb_mii: probed [1] gpio_rcar e6052000.gpio: sense irq = 11, type = 8 ravb e680.ethernet eth0: Base address at 0xe680, 2e:09:0a:00:83:1e, IRQ 131. ... [2] gpiochip_irq_reqres: gpiochip e6052000.gpio [3] gpio_rcar e6052000.gpio: gpio_rcar_direction_input: 11 [4] gpiochip_irq_reqres: desc->flags = 0x0 ravb e680.ethernet eth0: limited PHY to 100Mbit/s Micrel KSZ9031 Gigabit PHY e680.etherne:00: attached PHY driver [Micrel KSZ9031 Gigabit PHY] (mii_bus:phy_addr=e680.etherne:00, irq=206) Waiting up to 110 more seconds for network. Waiting up to 100 more seconds for network. ... Reverting it fixes the issue. phy0 in arch/arm64/boot/dts/renesas/r8a7795-salvator-x.dts phy0: ethernet-phy@0 { ... interrupt-parent = <>; interrupts = <11 IRQ_TYPE_LEVEL_LOW>; }; sets up the GPIO for interrupt mode, cfr. [1] in the kernel output above. > --- > drivers/gpio/gpiolib.c | 19 +++ > 1 file changed, 19 insertions(+) > > diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c > index 5a21a6acf8af..b195ec406ff4 100644 > --- a/drivers/gpio/gpiolib.c > +++ b/drivers/gpio/gpiolib.c > @@ -1505,6 +1505,25 @@ static int gpiochip_irq_reqres(struct irq_data *d) > if (!try_module_get(chip->gpiodev->owner)) > return -ENODEV; > > + /* > +* If it is possible to switch this GPIO to an input > +* this is a good time to do it. > +*/ > + if (chip->direction_input) { > + struct gpio_desc *desc; > + int ret; > + > + desc = gpiochip_get_desc(chip, d->hwirq); > + if (IS_ERR(desc)) > + return PTR_ERR(desc); > + > + ret = chip->direction_input(chip, d->hwirq); This configures the GPIO for plain input mode, cfr. [3] above, basically undoing the configuration from [1]. Hence interrupts no longer come through, and Ethernet fails. > + if (ret) > + return ret; > + > + clear_bit(FLAG_IS_OUT, >flags); Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds
Re: [PATCH 2/2] ARM: dts: r8a7792: add EtherAVB support
On Mon, Jul 4, 2016 at 11:23 PM, Sergei Shtylyovwrote: > Define the generic R8A7792 part of the EtherAVB device node. > > Based on the commit 89aac8af1a60 ("ARM: dts: r8a7794: add EtherAVB support"). > > Signed-off-by: Sergei Shtylyov Reviewed-by: Geert Uytterhoeven Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds
Re: [PATCH 1/2] ARM: dts: r8a7792: add EtherAVB clocks
On Mon, Jul 4, 2016 at 11:22 PM, Sergei Shtylyovwrote: > Add the EtherAVB clock and its parent, HP clock to the R8A7792 device tree. > > Signed-off-by: Sergei Shtylyov Reviewed-by: Geert Uytterhoeven Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds
Re: [PATCH 2/2] ARM: dts: r8a7792: add GPIO support
On Mon, Jul 4, 2016 at 11:12 PM, Sergei Shtylyovwrote: > Describe all 12 GPIO controllers in the R8A7792 device tree. > > Signed-off-by: Sergei Shtylyov Reviewed-by: Geert Uytterhoeven Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds
Re: renesas-drivers-2016-06-28-v4.7-rc5
Hi Morimoto-san, On Tue, Jul 5, 2016 at 9:31 AM, Kuninori Morimotowrote: >> Currently I provide e.g.: >> >> topic/salvator-x-hdmi-prototype-drivers-v3-rebased2 >> topic/salvator-x-hdmi-prototype-integration-v3-rebased4 >> >> The drivers branch needs only a rebase when Laurent's for/renesas-drivers >> changes, while the integration branch needs a rebase after each >> renesas-drivers release. >> >> I'll merge both of them in >> topic/salvator-x-hdmi-prototype-v3--. >> Would that be OK for you? > > Thank you for your help. > New naming rule is easy to understand for me. > But, I wonder do we need -v3- ? > We don't use old prototype on latest branch, > so, and is very enough ? > Not a big deal though. Indeed, we don't need it, as we can identify the prototype patchset version from the individual topic/salvator-x-hdmi-prototype-drivers-v* and topic/salvator-x-hdmi-prototype-integration-v* branches that are included. Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds
Re: [PATCH 1/2] ARM: dts: r8a7792: add GPIO clocks
On Mon, Jul 4, 2016 at 11:11 PM, Sergei Shtylyovwrote: > Describe the GPIO clocks in the R8A7792 device tree. > > Signed-off-by: Sergei Shtylyov Reviewed-by: Geert Uytterhoeven Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds
Re: renesas-drivers-2016-06-28-v4.7-rc5
Hi Geert > Currently I provide e.g.: > > topic/salvator-x-hdmi-prototype-drivers-v3-rebased2 > topic/salvator-x-hdmi-prototype-integration-v3-rebased4 > > The drivers branch needs only a rebase when Laurent's for/renesas-drivers > changes, while the integration branch needs a rebase after each > renesas-drivers release. > > I'll merge both of them in > topic/salvator-x-hdmi-prototype-v3--. > Would that be OK for you? Thank you for your help. New naming rule is easy to understand for me. But, I wonder do we need -v3- ? We don't use old prototype on latest branch, so, and is very enough ? Not a big deal though.
Re: [PATCH v2 3/3] ARM: dts: blanche: add Ethernet pins
Hi Sergei, On Mon, Jul 4, 2016 at 10:55 PM, Sergei Shtylyovwrote: > Add the (previously omitted) pin data for the SMSC LAN89218 Ethernet chip > to the Blanche board's device tree: the chip's IRQ output is connected to > the SoC's IRQ0 pin and its nCS input is connected to the SoC's EX_CS0# pin. > > Signed-off-by: Sergei Shtylyov > > --- > arch/arm/boot/dts/r8a7792-blanche.dts | 15 +++ > 1 file changed, 15 insertions(+) > > Index: renesas/arch/arm/boot/dts/r8a7792-blanche.dts > === > --- renesas.orig/arch/arm/boot/dts/r8a7792-blanche.dts > +++ renesas/arch/arm/boot/dts/r8a7792-blanche.dts > @@ -50,6 +50,9 @@ > reg-io-width = <4>; > vddvario-supply = <_3v>; > vdd33a-supply = <_3v>; > + > + pinctrl-0 = <_pins>; > + pinctrl-names = "default"; > }; > }; > > @@ -67,6 +70,18 @@ > groups = "scif3_data"; > function = "scif3"; > }; > + > + lan89218_pins: lan89218 { > + intc { > + groups = "intc_irq0"; > + function = "intc"; > + }; > + lbsc { > + groups = "lbsc_ex_cs0"; > + function = "lbsc"; Don't you need pinctrl for the other LBSC pins, like the address and data lines (Ax and Dy)? Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds
Re: [PATCH] pinctrl: sh-pfc: r8a7792: add EtherAVB pin groups
Hi Sergei, On Mon, Jul 4, 2016 at 9:52 PM, Sergei Shtylyovwrote: > Add the EtherAVB pin groups to the R8A7792 PFC driver. > > Signed-off-by: Sergei Shtylyov Reviewed-by: Geert Uytterhoeven However, you forgot to add the avb_avtp_match group. Is that intentional? Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds
Re: renesas-drivers-2016-06-28-v4.7-rc5
Hi Morimoto-san, On Tue, Jul 5, 2016 at 3:40 AM, Kuninori Morimotowrote: >> I have pushed renesas-drivers-2016-06-28-v4.7-rc5 to >> https://git.kernel.org/cgit/linux/kernel/git/geert/renesas-drivers.git >> >> This tree is meant to ease development of platform support and drivers >> for Renesas ARM SoCs. It is created by merging (a) the for-next branches >> of various subsystem trees and (b) branches with driver code submitted >> or planned for submission to maintainers into the development branch of >> Simon Horman's renesas.git tree. >> >> Today's version is based on renesas-devel-20160627-v4.7-rc5. > > Can we have new version of below branches for -rc5 branch ? > Or for next new renesas-drivers ? > > salvator-x-hdmi-prototype-drivers-X > salvator-x-hdmi-prototype-integration-X > > My picky opinion is that > it is easy to understand that above additional branch has > same/similar naming of base branch... > > ex) salvator-x-hdmi-prototype-drivers-20160627-v4.7-rc5 Currently I provide e.g.: topic/salvator-x-hdmi-prototype-drivers-v3-rebased2 topic/salvator-x-hdmi-prototype-integration-v3-rebased4 The drivers branch needs only a rebase when Laurent's for/renesas-drivers changes, while the integration branch needs a rebase after each renesas-drivers release. I'll merge both of them in topic/salvator-x-hdmi-prototype-v3--. Would that be OK for you? Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds