Re: [PATCH 2/4] ravb: Add optional PHY reset during system resume

2017-10-01 Thread Florian Fainelli


On 09/30/2017 01:23 PM, Sergei Shtylyov wrote:
> Hello!
> 
> On 09/28/2017 10:21 PM, Florian Fainelli wrote:
> 
> If the optional "reset-gpios" property is specified in DT, the generic
> MDIO bus code takes care of resetting the PHY during device probe.
> However, the PHY may still have to be reset explicitly after system
> resume.
>
> This allows to restore Ethernet operation after resume from s2ram on
> Salvator-XS, where the enable pin of the regulator providing PHY power
> is connected to PRESETn, and PSCI suspend powers down the SoC.
>
> Signed-off-by: Geert Uytterhoeven 
> ---
>   drivers/net/ethernet/renesas/ravb_main.c | 9 +
>   1 file changed, 9 insertions(+)
>
> diff --git a/drivers/net/ethernet/renesas/ravb_main.c
> b/drivers/net/ethernet/renesas/ravb_main.c
> index fdf30bfa403bf416..96d1d48e302f8c9a 100644
> --- a/drivers/net/ethernet/renesas/ravb_main.c
> +++ b/drivers/net/ethernet/renesas/ravb_main.c
> [...]
> @@ -2302,6 +2304,13 @@ static int __maybe_unused ravb_resume(struct
> device *dev)
>     * reopen device if it was running before system suspended.
>     */
>
> + /* PHY reset */
> + if (bus->reset_gpiod) {
> + gpiod_set_value_cansleep(bus->reset_gpiod, 1);
> + udelay(bus->reset_delay_us);
> + gpiod_set_value_cansleep(bus->reset_gpiod, 0);
> + }

 This is a clever hack, but unfortunately this is also misusing the MDIO
 bus reset line into a PHY reset line. As commented in patch 3, if this
 reset line is tied to the PHY, then this should be a PHY property and
>>>
>>> OK.
>>>
 you cannot (ab)use the MDIO bus GPIO reset logic anymore...
>>>
>>> And then I should add reset-gpios support to drivers/net/phy/micrel.c?
>>> Or is there already generic code to handle per-PHY reset? I couldn't
>>> find it.
>>
>> There is not such a thing unfortunately, but it would presumably be
> 
>    It's strange you don't remember about my (abandoned) patches to
> handle per=PHY reset GPIOs -- perhaps it's time to unearth them. Here
> they are:
> 
> http://patchwork.ozlabs.org/patch/616495/
> http://patchwork.ozlabs.org/patch/616501/
> 
>    I had v3 in the works before abandoning this series -- it doesn't
> apply now.

Should Geert pick-up where you left and address the feedback given in
v2, or do you plan to post a rebased v3?

> 
>> called within drivers/net/phy/mdio_bus.c during bus->reset() time
>> because you need the PHY reset to be deasserted before you can
>> successfully read/write from the PHY, and if you can't read/write from
>> the PHY, the MDIO bus layer cannot read the PHY ID, and therefore cannot
>> match a PHY device with its driver, so things don't work.
> 
>    I did this a bit differently...
> 
> [...]
> 
> MBR, Sergei

-- 
Florian


Re: [PATCH 22/48] ARM: dts: gr-peach: Add user led device nodes

2017-10-01 Thread jacopo mondi
Hi Seregei,

On Sat, Sep 30, 2017 at 01:36:18PM +0300, Sergei Shtylyov wrote:
> Hello!
>
> On 9/29/2017 2:53 PM, Simon Horman wrote:
>
> >From: Jacopo Mondi 
> >
> >Add device nodes for user leds on gr-peach board.
> >
> >Signed-off-by: Jacopo Mondi 
> >Reviewed-by: Geert Uytterhoeven 
> >Signed-off-by: Simon Horman 
> >---
> >  arch/arm/boot/dts/r7s72100-gr-peach.dts | 10 ++
> >  1 file changed, 10 insertions(+)
> >
> >diff --git a/arch/arm/boot/dts/r7s72100-gr-peach.dts 
> >b/arch/arm/boot/dts/r7s72100-gr-peach.dts
> >index bcfa6445bbaa..13d745bb56a5 100644
> >--- a/arch/arm/boot/dts/r7s72100-gr-peach.dts
> >+++ b/arch/arm/boot/dts/r7s72100-gr-peach.dts
> [...]
> >@@ -51,6 +52,15 @@
> > reg = <0x0060 0x0020>;
> > };
> > };
> >+
> >+leds {
>
>Not indented properly...

Thanks!

Simon, as you sent pull request already, will we need a patch on top
of this to fix it?

Thanks
  j
>
> >+status = "okay";
> >+compatible = "gpio-leds";
> >+
> >+led1 {
> >+gpios = < 12 GPIO_ACTIVE_HIGH>;
> >+};
> >+};
> >  };
> >   {
>
> MBR, Sergei


Re: [PATCH 3/6] ASoC: rsnd: DVC kctrl sets once

2017-10-01 Thread Kuninori Morimoto

Hi Sergei

> > diff --git a/sound/soc/sh/rcar/dvc.c b/sound/soc/sh/rcar/dvc.c
> > index 1743ade..b4c4ff2 100644
> > --- a/sound/soc/sh/rcar/dvc.c
> > +++ b/sound/soc/sh/rcar/dvc.c
> > @@ -44,8 +44,11 @@ struct rsnd_dvc {
> > struct rsnd_kctrl_cfg_s ren;/* Ramp Enable */
> > struct rsnd_kctrl_cfg_s rup;/* Ramp Rate Up */
> > struct rsnd_kctrl_cfg_s rdown;  /* Ramp Rate Down */
> > +   u32 flags;
> >   };
> >   +#define KCTRL_INITIALIZEED   (1 << 0)
> 
>One E is enough. :-)

Oops, indeed.
will fix

Best regards
---
Kuninori Morimoto


[PATCH 6/6 v3] ASoC: rsnd: add MIX Volume Ramp support

2017-10-01 Thread Kuninori Morimoto

From: Kuninori Morimoto 

Both DVC/MIX have Volume Ramp Control. This patch supprts MIX
Volume Ramp. One note is that main purpose of MIX Volume Ramp
is to reduce noise, thus, MIX Ramp range is very few if you
compare to DVC Volume Ramp (DVC = 5bit, MIX = 4bit).

You can use MIX Volume Ranp like below
amixer set "MIX Ramp Up Rate"   "0.125 dB/1 step"
amixer set "MIX Ramp Down Rate" "0.125 dB/1 step"
amixer set "MIX Ramp" on
aplay xxx.wav &
amixer set "MIX",0  80%  // DAI0 Volume Down
amixer set "MIX",1 100%  // DAI1 Volume Up

Signed-off-by: Kuninori Morimoto 
Tested-by: Hiroyuki Yokoyama 
---
v2 -> v3

 - INITIALIZEED -> INITIALIZED

 sound/soc/sh/rcar/core.c |   2 +-
 sound/soc/sh/rcar/mix.c  | 158 +--
 sound/soc/sh/rcar/rsnd.h |   1 +
 3 files changed, 154 insertions(+), 7 deletions(-)

diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c
index 670cc55..77003a7 100644
--- a/sound/soc/sh/rcar/core.c
+++ b/sound/soc/sh/rcar/core.c
@@ -1253,7 +1253,7 @@ struct rsnd_kctrl_cfg *rsnd_kctrl_init_s(struct 
rsnd_kctrl_cfg_s *cfg)
"1 dB/1 step",   /* 00111 */
"0.5 dB/1 step", /* 01000 */
"0.25 dB/1 step",/* 01001 */
-   "0.125 dB/1 step",   /* 01010 */
+   "0.125 dB/1 step",   /* 01010 = VOLUME_RAMP_MAX_MIX */
"0.125 dB/2 steps",  /* 01011 */
"0.125 dB/4 steps",  /* 01100 */
"0.125 dB/8 steps",  /* 01101 */
diff --git a/sound/soc/sh/rcar/mix.c b/sound/soc/sh/rcar/mix.c
index 6c4826c..912cfec 100644
--- a/sound/soc/sh/rcar/mix.c
+++ b/sound/soc/sh/rcar/mix.c
@@ -7,6 +7,33 @@
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
  */
+
+/*
+ * CTUnMIXn
+ * +--++--+
+ * [SRC3 / SRC6] -> |CTU n0| ->[MIX n0| ->
+ * [SRC4 / SRC9] -> |CTU n1| ->[MIX n1| ->
+ * [SRC0 / SRC1] -> |CTU n2| ->[MIX n2| ->
+ * [SRC2 / SRC5] -> |CTU n3| ->[MIX n3| ->
+ * +--++--+
+ *
+ * ex)
+ * DAI0 : playback = <>;
+ * DAI1 : playback = <>;
+ *
+ * MIX Volume
+ * amixer set "MIX",0  100%  // DAI0 Volume
+ * amixer set "MIX",1  100%  // DAI1 Volume
+ *
+ * Volume Ramp
+ * amixer set "MIX Ramp Up Rate"   "0.125 dB/1 step"
+ * amixer set "MIX Ramp Down Rate" "4 dB/1 step"
+ * amixer set "MIX Ramp" on
+ * aplay xxx.wav &
+ * amixer set "MIX",0  80%  // DAI0 Volume Down
+ * amixer set "MIX",1 100%  // DAI1 Volume Up
+ */
+
 #include "rsnd.h"
 
 #define MIX_NAME_SIZE  16
@@ -14,8 +41,27 @@
 
 struct rsnd_mix {
struct rsnd_mod mod;
+   struct rsnd_kctrl_cfg_s volumeA; /* MDBAR */
+   struct rsnd_kctrl_cfg_s volumeB; /* MDBBR */
+   struct rsnd_kctrl_cfg_s volumeC; /* MDBCR */
+   struct rsnd_kctrl_cfg_s volumeD; /* MDBDR */
+   struct rsnd_kctrl_cfg_s ren;/* Ramp Enable */
+   struct rsnd_kctrl_cfg_s rup;/* Ramp Rate Up */
+   struct rsnd_kctrl_cfg_s rdw;/* Ramp Rate Down */
+   u32 flags;
 };
 
+#define ONCE_KCTRL_INITIALIZED (1 << 0)
+#define HAS_VOLA   (1 << 1)
+#define HAS_VOLB   (1 << 2)
+#define HAS_VOLC   (1 << 3)
+#define HAS_VOLD   (1 << 4)
+
+#define VOL_MAX0x3ff
+
+#define rsnd_mod_to_mix(_mod)  \
+   container_of((_mod), struct rsnd_mix, mod)
+
 #define rsnd_mix_get(priv, id) ((struct rsnd_mix *)(priv->mix) + id)
 #define rsnd_mix_nr(priv) ((priv)->mix_nr)
 #define for_each_rsnd_mix(pos, priv, i)
\
@@ -36,26 +82,43 @@ static void rsnd_mix_halt(struct rsnd_mod *mod)
rsnd_mod_write(mod, MIX_SWRSR, 0);
 }
 
+#define rsnd_mix_get_vol(mix, X) \
+   rsnd_flags_has(mix, HAS_VOL##X) ? \
+   (VOL_MAX - mix->volume##X.cfg.val[0]) : 0
 static void rsnd_mix_volume_parameter(struct rsnd_dai_stream *io,
  struct rsnd_mod *mod)
 {
-   rsnd_mod_write(mod, MIX_MDBAR, 0);
-   rsnd_mod_write(mod, MIX_MDBBR, 0);
-   rsnd_mod_write(mod, MIX_MDBCR, 0);
-   rsnd_mod_write(mod, MIX_MDBDR, 0);
+   struct rsnd_priv *priv = rsnd_mod_to_priv(mod);
+   struct device *dev = rsnd_priv_to_dev(priv);
+   struct rsnd_mix *mix = rsnd_mod_to_mix(mod);
+   u32 volA = rsnd_mix_get_vol(mix, A);
+   u32 volB = rsnd_mix_get_vol(mix, B);
+   u32 volC = rsnd_mix_get_vol(mix, C);
+   u32 volD = rsnd_mix_get_vol(mix, D);
+
+   dev_dbg(dev, "MIX A/B/C/D = %02x/%02x/%02x/%02x\n",
+   volA, volB, volC, volD);
+
+   rsnd_mod_write(mod, MIX_MDBAR, volA);
+   rsnd_mod_write(mod, MIX_MDBBR, volB);
+   rsnd_mod_write(mod, 

[PATCH 3/6 v3] ASoC: rsnd: DVC kctrl sets once

2017-10-01 Thread Kuninori Morimoto

From: Kuninori Morimoto 

Same DVC might be used few times if system/platform is using MIX.
For example below case.

DAI0 playback = <>;
DAI1 playback = <>;

This case, ALSA will have DVC,0 and DVC,1 kcontrol interfaces,
but these are same DVC. This is confusing.
This patch adds new flags and avoid such case.

Signed-off-by: Kuninori Morimoto 
Tested-by: Hiroyuki Yokoyama 
---
v2 -> v3

 - INITIALIZEED -> INITIALIZED
 - confusable -> confusing

 sound/soc/sh/rcar/dvc.c | 8 
 1 file changed, 8 insertions(+)

diff --git a/sound/soc/sh/rcar/dvc.c b/sound/soc/sh/rcar/dvc.c
index 1743ade..bb22850 100644
--- a/sound/soc/sh/rcar/dvc.c
+++ b/sound/soc/sh/rcar/dvc.c
@@ -44,8 +44,11 @@ struct rsnd_dvc {
struct rsnd_kctrl_cfg_s ren;/* Ramp Enable */
struct rsnd_kctrl_cfg_s rup;/* Ramp Rate Up */
struct rsnd_kctrl_cfg_s rdown;  /* Ramp Rate Down */
+   u32 flags;
 };
 
+#define KCTRL_INITIALIZED  (1 << 0)
+
 #define rsnd_dvc_get(priv, id) ((struct rsnd_dvc *)(priv->dvc) + id)
 #define rsnd_dvc_nr(priv) ((priv)->dvc_nr)
 
@@ -254,6 +257,9 @@ static int rsnd_dvc_pcm_new(struct rsnd_mod *mod,
int channels = rsnd_rdai_channels_get(rdai);
int ret;
 
+   if (rsnd_flags_has(dvc, KCTRL_INITIALIZED))
+   return 0;
+
/* Volume */
ret = rsnd_kctrl_new_m(mod, io, rtd,
is_play ?
@@ -307,6 +313,8 @@ static int rsnd_dvc_pcm_new(struct rsnd_mod *mod,
if (ret < 0)
return ret;
 
+   rsnd_flags_set(dvc, KCTRL_INITIALIZED);
+
return 0;
 }
 
-- 
1.9.1



[PATCH 2/6 v3] ASoC: rsnd: use generic rsnd_flags_xxx() macro on ADG

2017-10-01 Thread Kuninori Morimoto

From: Kuninori Morimoto 

Signed-off-by: Kuninori Morimoto 
Tested-by: Hiroyuki Yokoyama 
---
v2 -> v3

 - no change

 sound/soc/sh/rcar/adg.c | 13 ++---
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/sound/soc/sh/rcar/adg.c b/sound/soc/sh/rcar/adg.c
index e11ce50..19213077 100644
--- a/sound/soc/sh/rcar/adg.c
+++ b/sound/soc/sh/rcar/adg.c
@@ -44,7 +44,6 @@ struct rsnd_adg {
 
 #define LRCLK_ASYNC(1 << 0)
 #define AUDIO_OUT_48   (1 << 1)
-#define adg_mode_flags(adg)(adg->flags)
 
 #define for_each_rsnd_clk(pos, adg, i) \
for (i = 0; \
@@ -366,8 +365,8 @@ int rsnd_adg_ssi_clk_try_start(struct rsnd_mod *ssi_mod, 
unsigned int rate)
 
rsnd_adg_set_ssi_clk(ssi_mod, data);
 
-   if (adg_mode_flags(adg) & LRCLK_ASYNC) {
-   if (adg_mode_flags(adg) & AUDIO_OUT_48)
+   if (rsnd_flags_has(adg, LRCLK_ASYNC)) {
+   if (rsnd_flags_has(adg, AUDIO_OUT_48))
ckr = 0x8000;
} else {
if (0 == (rate % 8000))
@@ -479,10 +478,10 @@ static void rsnd_adg_get_clkout(struct rsnd_priv *priv,
}
 
if (req_rate[0] % 48000 == 0)
-   adg->flags |= AUDIO_OUT_48;
+   rsnd_flags_set(adg, AUDIO_OUT_48);
 
if (of_get_property(np, "clkout-lr-asynchronous", NULL))
-   adg->flags |= LRCLK_ASYNC;
+   rsnd_flags_set(adg, LRCLK_ASYNC);
 
/*
 * This driver is assuming that AUDIO_CLKA/AUDIO_CLKB/AUDIO_CLKC
@@ -512,7 +511,7 @@ static void rsnd_adg_get_clkout(struct rsnd_priv *priv,
adg->rbga_rate_for_441khz = rate / div;
ckr |= brg_table[i] << 20;
if (req_441kHz_rate &&
-   !(adg_mode_flags(adg) & AUDIO_OUT_48))
+   !rsnd_flags_has(adg, AUDIO_OUT_48))
parent_clk_name = __clk_get_name(clk);
}
}
@@ -528,7 +527,7 @@ static void rsnd_adg_get_clkout(struct rsnd_priv *priv,
adg->rbgb_rate_for_48khz = rate / div;
ckr |= brg_table[i] << 16;
if (req_48kHz_rate &&
-   (adg_mode_flags(adg) & AUDIO_OUT_48))
+   rsnd_flags_has(adg, AUDIO_OUT_48))
parent_clk_name = __clk_get_name(clk);
}
}
-- 
1.9.1



[PATCH 0/6 v3] ASoC: rsnd: add MIX Volume Ramp support

2017-10-01 Thread Kuninori Morimoto

Hi Mark

These are v3 of MIX Volume Ramp support on Renesas R-Car sound.
0001 - 0005 are prepare/cleanup patch for it.

v2 -> v3
 - tidyup typo: INITIALIZEED -> INITIALIZED
 - flags macro

Kuninori Morimoto (6):
  ASoC: rsnd: add generic rsnd_flags_xxx() macro
  ASoC: rsnd: use generic rsnd_flags_xxx() macro on ADG
  ASoC: rsnd: DVC kctrl sets once
  ASoC: rsnd: CTU kctrl sets once
  ASoC: rsnd: makes volume ramp rate list generic
  ASoC: rsnd: add MIX Volume Ramp support

 sound/soc/sh/rcar/adg.c  |  13 ++--
 sound/soc/sh/rcar/core.c |  27 
 sound/soc/sh/rcar/ctu.c  |   8 +++
 sound/soc/sh/rcar/dvc.c  |  41 
 sound/soc/sh/rcar/mix.c  | 158 +--
 sound/soc/sh/rcar/rsnd.h |  12 +++-
 sound/soc/sh/rcar/ssi.c  |  27 
 7 files changed, 227 insertions(+), 59 deletions(-)

-- 
1.9.1



[PATCH 1/6 v3] ASoC: rsnd: add generic rsnd_flags_xxx() macro

2017-10-01 Thread Kuninori Morimoto

From: Kuninori Morimoto 

SSI is using rsnd_ssi_flags_xxx() macro to control flags.
But it is useful macro not only for SSI. This patch replace it
to more generic rsnd_flags_xxx().

Signed-off-by: Kuninori Morimoto 
Tested-by: Hiroyuki Yokoyama 
---
v2 -> v3

 - tidyup rsnd_flags_del()

 sound/soc/sh/rcar/rsnd.h |  4 
 sound/soc/sh/rcar/ssi.c  | 27 ---
 2 files changed, 16 insertions(+), 15 deletions(-)

diff --git a/sound/soc/sh/rcar/rsnd.h b/sound/soc/sh/rcar/rsnd.h
index c5de71f..beffbec 100644
--- a/sound/soc/sh/rcar/rsnd.h
+++ b/sound/soc/sh/rcar/rsnd.h
@@ -601,6 +601,10 @@ struct rsnd_priv {
 #define rsnd_is_gen1(priv) (((priv)->flags & RSND_GEN_MASK) == RSND_GEN1)
 #define rsnd_is_gen2(priv) (((priv)->flags & RSND_GEN_MASK) == RSND_GEN2)
 
+#define rsnd_flags_has(p, f) ((p)->flags & (f))
+#define rsnd_flags_set(p, f) ((p)->flags |= (f))
+#define rsnd_flags_del(p, f) ((p)->flags &= ~(f))
+
 /*
  * rsnd_kctrl
  */
diff --git a/sound/soc/sh/rcar/ssi.c b/sound/soc/sh/rcar/ssi.c
index 03c2a1f..4ed8871 100644
--- a/sound/soc/sh/rcar/ssi.c
+++ b/sound/soc/sh/rcar/ssi.c
@@ -101,9 +101,6 @@ struct rsnd_ssi {
 #define rsnd_ssi_get(priv, id) ((struct rsnd_ssi *)(priv->ssi) + id)
 #define rsnd_ssi_nr(priv) ((priv)->ssi_nr)
 #define rsnd_mod_to_ssi(_mod) container_of((_mod), struct rsnd_ssi, mod)
-#define rsnd_ssi_flags_has(p, f) ((p)->flags & f)
-#define rsnd_ssi_flags_set(p, f) ((p)->flags |= f)
-#define rsnd_ssi_flags_del(p, f) ((p)->flags = ((p)->flags & ~f))
 #define rsnd_ssi_is_parent(ssi, io) ((ssi) == rsnd_io_to_mod_ssip(io))
 #define rsnd_ssi_is_multi_slave(mod, io) \
(rsnd_ssi_multi_slaves(io) & (1 << rsnd_mod_id(mod)))
@@ -116,10 +113,10 @@ int rsnd_ssi_hdmi_port(struct rsnd_dai_stream *io)
struct rsnd_mod *mod = rsnd_io_to_mod_ssi(io);
struct rsnd_ssi *ssi = rsnd_mod_to_ssi(mod);
 
-   if (rsnd_ssi_flags_has(ssi, RSND_SSI_HDMI0))
+   if (rsnd_flags_has(ssi, RSND_SSI_HDMI0))
return RSND_SSI_HDMI_PORT0;
 
-   if (rsnd_ssi_flags_has(ssi, RSND_SSI_HDMI1))
+   if (rsnd_flags_has(ssi, RSND_SSI_HDMI1))
return RSND_SSI_HDMI_PORT1;
 
return 0;
@@ -134,7 +131,7 @@ int rsnd_ssi_use_busif(struct rsnd_dai_stream *io)
if (!rsnd_ssi_is_dma_mode(mod))
return 0;
 
-   if (!(rsnd_ssi_flags_has(ssi, RSND_SSI_NO_BUSIF)))
+   if (!(rsnd_flags_has(ssi, RSND_SSI_NO_BUSIF)))
use_busif = 1;
if (rsnd_io_to_mod_src(io))
use_busif = 1;
@@ -793,13 +790,13 @@ static int rsnd_ssi_common_probe(struct rsnd_mod *mod,
 * But it don't need to call request_irq() many times.
 * Let's control it by RSND_SSI_PROBED flag.
 */
-   if (!rsnd_ssi_flags_has(ssi, RSND_SSI_PROBED)) {
+   if (!rsnd_flags_has(ssi, RSND_SSI_PROBED)) {
ret = request_irq(ssi->irq,
  rsnd_ssi_interrupt,
  IRQF_SHARED,
  dev_name(dev), mod);
 
-   rsnd_ssi_flags_set(ssi, RSND_SSI_PROBED);
+   rsnd_flags_set(ssi, RSND_SSI_PROBED);
}
 
return ret;
@@ -817,10 +814,10 @@ static int rsnd_ssi_common_remove(struct rsnd_mod *mod,
return 0;
 
/* PIO will request IRQ again */
-   if (rsnd_ssi_flags_has(ssi, RSND_SSI_PROBED)) {
+   if (rsnd_flags_has(ssi, RSND_SSI_PROBED)) {
free_irq(ssi->irq, mod);
 
-   rsnd_ssi_flags_del(ssi, RSND_SSI_PROBED);
+   rsnd_flags_del(ssi, RSND_SSI_PROBED);
}
 
return 0;
@@ -1003,13 +1000,13 @@ static void __rsnd_ssi_parse_hdmi_connection(struct 
rsnd_priv *priv,
ssi  = rsnd_mod_to_ssi(mod);
 
if (strstr(remote_ep->full_name, "hdmi0")) {
-   rsnd_ssi_flags_set(ssi, RSND_SSI_HDMI0);
+   rsnd_flags_set(ssi, RSND_SSI_HDMI0);
dev_dbg(dev, "%s[%d] connected to HDMI0\n",
 rsnd_mod_name(mod), rsnd_mod_id(mod));
}
 
if (strstr(remote_ep->full_name, "hdmi1")) {
-   rsnd_ssi_flags_set(ssi, RSND_SSI_HDMI1);
+   rsnd_flags_set(ssi, RSND_SSI_HDMI1);
dev_dbg(dev, "%s[%d] connected to HDMI1\n",
rsnd_mod_name(mod), rsnd_mod_id(mod));
}
@@ -1042,7 +1039,7 @@ int __rsnd_ssi_is_pin_sharing(struct rsnd_mod *mod)
 {
struct rsnd_ssi *ssi = rsnd_mod_to_ssi(mod);
 
-   return !!(rsnd_ssi_flags_has(ssi, RSND_SSI_CLK_PIN_SHARE));
+   return !!(rsnd_flags_has(ssi, RSND_SSI_CLK_PIN_SHARE));
 }
 
 static u32 *rsnd_ssi_get_status(struct rsnd_dai_stream *io,
@@ -1128,10 +1125,10 @@ int rsnd_ssi_probe(struct rsnd_priv *priv)
}
 
if (of_get_property(np, "shared-pin", NULL))
-   

[PATCH] usb: renesas_usbhs: Fix DMAC sequence for receiving zero-length packet

2017-10-01 Thread Yoshihiro Shimoda
From: Kazuya Mizuguchi 

The DREQE bit of the DnFIFOSEL should be set to 1 after the DE bit of
USB-DMAC on R-Car SoCs is set to 1 after the USB-DMAC received a
zero-length packet. Otherwise, a transfer completion interruption
of USB-DMAC doesn't happen. Even if the driver changes the sequence,
normal operations (transmit/receive without zero-length packet) will
not cause any side-effects. So, this patch fixes the sequence anyway.

Signed-off-by: Kazuya Mizuguchi 
[shimoda: revise the commit log]
Fixes: e73a9891b3a1 ("usb: renesas_usbhs: add DMAEngine support")
Cc:  # v3.1+
Signed-off-by: Yoshihiro Shimoda 
---
 This patch is based on the lastest Felipe's usb.git / testing/fixes branch
(commit id = c3cdce45f8d3dfa5c3467894aa89798314920328).

 drivers/usb/renesas_usbhs/fifo.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/renesas_usbhs/fifo.c b/drivers/usb/renesas_usbhs/fifo.c
index 68f2690..50285b0 100644
--- a/drivers/usb/renesas_usbhs/fifo.c
+++ b/drivers/usb/renesas_usbhs/fifo.c
@@ -857,9 +857,9 @@ static void xfer_work(struct work_struct *work)
fifo->name, usbhs_pipe_number(pipe), pkt->length, pkt->zero);
 
usbhs_pipe_running(pipe, 1);
-   usbhsf_dma_start(pipe, fifo);
usbhs_pipe_set_trans_count_if_bulk(pipe, pkt->trans);
dma_async_issue_pending(chan);
+   usbhsf_dma_start(pipe, fifo);
usbhs_pipe_enable(pipe);
 
 xfer_work_end:
-- 
1.9.1



RE: [PATCH 20/22] arm64: dts: renesas: r8a77995: draak: enable EthernetAVB

2017-10-01 Thread Yoshihiro Shimoda
Hello,

> -Original Message-
> From: Sergei Shtylyov
> Sent: Saturday, September 30, 2017 7:24 PM
> 
> Hello!
> 
> On 9/29/2017 2:52 PM, Simon Horman wrote:
> 
> > From: Yoshihiro Shimoda 
> >
> > This patch enables EthernetAVB for R-Car D3 draak board.
> >
> > Signed-off-by: Yoshihiro Shimoda 
> > Reviewed-by: Geert Uytterhoeven 
> > Signed-off-by: Simon Horman 
> > ---
> >   arch/arm64/boot/dts/renesas/r8a77995-draak.dts | 25 
> > +
> >   1 file changed, 25 insertions(+)
> >
> > diff --git a/arch/arm64/boot/dts/renesas/r8a77995-draak.dts 
> > b/arch/arm64/boot/dts/renesas/r8a77995-draak.dts
> > index 7b776cb7e928..96b7ff5cc321 100644
> > --- a/arch/arm64/boot/dts/renesas/r8a77995-draak.dts
> > +++ b/arch/arm64/boot/dts/renesas/r8a77995-draak.dts
> [...]
> > @@ -37,6 +39,14 @@
> >   };
> >
> >{
> > +   avb0_pins: avb {
> > +   mux {
> > +   groups = "avb0_link", "avb0_phy_int", "avb0_mdc",
>^^
> Hum, I don't think it's compatible with routing the PHY interrupt via
> GPIO5_19 below. The driver doesn't support signalling via AVB_PHY_INT anyway.

Oops! You're correct. I should drop "avb0_phy_int".

Simon-san, may I send a follow-up patch to fix this?

Best regards,
Yoshihiro Shimoda

> > +"avb0_mii";
> > +   function = "avb0";
> > +   };
> > +   };
> > +
> > scif2_pins: scif2 {
> > groups = "scif2_data";
> > function = "scif2";
> > @@ -56,6 +66,21 @@
> > status = "okay";
> >   };
> >
> > + {
> > +   pinctrl-0 = <_pins>;
> > +   pinctrl-names = "default";
> > +   renesas,no-ether-link;
> > +   phy-handle = <>;
> > +   status = "okay";
> > +
> > +   phy0: ethernet-phy@0 {
> > +   rxc-skew-ps = <1500>;
> > +   reg = <0>;
> > +   interrupt-parent = <>;
> > +   interrupts = <19 IRQ_TYPE_LEVEL_LOW>;
> > +   };
> > +};
> > +
> >{
> > pinctrl-0 = <_pins>;
> > pinctrl-names = "default";
> 
> MBR, Sergei