Re: [PATCH 2/4] ravb: Add optional PHY reset during system resume
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. 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
Re: [PATCH 22/48] ARM: dts: gr-peach: Add user led device nodes
Hello! On 9/29/2017 2:53 PM, Simon Horman wrote: From: Jacopo MondiAdd 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... + status = "okay"; + compatible = "gpio-leds"; + + led1 { + gpios = < 12 GPIO_ACTIVE_HIGH>; + }; + }; }; { MBR, Sergei
Re: [PATCH 20/22] arm64: dts: renesas: r8a77995: draak: enable EthernetAVB
Hello! On 9/29/2017 2:52 PM, Simon Horman wrote: From: Yoshihiro ShimodaThis 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. +"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
Re: [PATCH 4/6] ASoC: rsnd: CTU kctrl sets once
Hello! On 9/29/2017 3:10 AM, Kuninori Morimoto wrote: From: Kuninori MorimotoSame CTU might be used few times if system/platform is using MIX. For example below case. DAI0 playback = <>; DAI1 playback = <>; This case, ALSA will have CTU,0 and CTU,1 kcontrol interfaces, but these are same CTU. This is confusable. Again, confusing, This patch adds new flags and avoid such case. Signed-off-by: Kuninori Morimoto Tested-by: Hiroyuki Yokoyama --- sound/soc/sh/rcar/ctu.c | 8 1 file changed, 8 insertions(+) diff --git a/sound/soc/sh/rcar/ctu.c b/sound/soc/sh/rcar/ctu.c index e7f53f4..1536d9d 100644 --- a/sound/soc/sh/rcar/ctu.c +++ b/sound/soc/sh/rcar/ctu.c @@ -81,8 +81,11 @@ struct rsnd_ctu { struct rsnd_kctrl_cfg_m sv3; struct rsnd_kctrl_cfg_s reset; int channels; + u32 flags; }; +#define KCTRL_INITIALIZEED (1 << 0) + Again, one E is enough. :-) [...] MBR, Sergei
Re: [PATCH 1/6] ASoC: rsnd: add generic rsnd_flags_xxx() macro
Hello! On 9/29/2017 3:08 AM, Kuninori Morimoto wrote: From: Kuninori MorimotoSSI 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 --- 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..558200f 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 = ((p)->flags & ~f)) #define rsnd_flags_del(p, f) ((p)->flags &= ~f) [...] MBR, Sergei
Re: [PATCH 3/6] ASoC: rsnd: DVC kctrl sets once
Hello! On 9/29/2017 3:09 AM, Kuninori Morimoto wrote: From: Kuninori MorimotoSame 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 confusable. Confusing. This patch adds new flags and avoid such case. Signed-off-by: Kuninori Morimoto Tested-by: Hiroyuki Yokoyama --- 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..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. :-) [...] MBR, Sergei