* [PATCH v2 0/3] mmc: sh_mobile_sdhi: fix missing r7s72100 clocks
@ 2017-01-17 19:59 ` Chris Brandt
0 siblings, 0 replies; 16+ messages in thread
From: Chris Brandt @ 2017-01-17 19:59 UTC (permalink / raw)
To: Ulf Hansson, Rob Herring, Mark Rutland, Simon Horman,
Wolfram Sang, Geert Uytterhoeven
Cc: devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-mmc-u79uwXL29TY76Z2rM5mHXA,
linux-renesas-soc-u79uwXL29TY76Z2rM5mHXA, Chris Brandt
At first this started out as a simple typo fix, until I realized
that the SDHI in the RZ/A1 has 2 clocks per channel and both need
to be turned on/off.
This patch series adds the ability to specify 2 clocks instead of
just 1, and does so for the RZ/A1 r7s72100.
This patch has been tested on an RZ/A1 RSK board. Card detect works
fine as well as bind/unbind.
Chris Brandt (3):
mmc: sh_mobile_sdhi: add support for 2 clocks
mmc: sh_mobile_sdhi: explain clock bindings
ARM: dts: r7s72100: update sdhi clock bindings
Documentation/devicetree/bindings/mmc/tmio_mmc.txt | 21 +++++++++++++++++++++
arch/arm/boot/dts/r7s72100.dtsi | 17 ++++++++++++-----
drivers/mmc/host/sh_mobile_sdhi.c | 11 +++++++++++
include/dt-bindings/clock/r7s72100-clock.h | 6 ++++--
4 files changed, 48 insertions(+), 7 deletions(-)
--
2.10.1
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH v2 0/3] mmc: sh_mobile_sdhi: fix missing r7s72100 clocks
@ 2017-01-17 19:59 ` Chris Brandt
0 siblings, 0 replies; 16+ messages in thread
From: Chris Brandt @ 2017-01-17 19:59 UTC (permalink / raw)
To: Ulf Hansson, Rob Herring, Mark Rutland, Simon Horman,
Wolfram Sang, Geert Uytterhoeven
Cc: devicetree, linux-mmc, linux-renesas-soc, Chris Brandt
At first this started out as a simple typo fix, until I realized
that the SDHI in the RZ/A1 has 2 clocks per channel and both need
to be turned on/off.
This patch series adds the ability to specify 2 clocks instead of
just 1, and does so for the RZ/A1 r7s72100.
This patch has been tested on an RZ/A1 RSK board. Card detect works
fine as well as bind/unbind.
Chris Brandt (3):
mmc: sh_mobile_sdhi: add support for 2 clocks
mmc: sh_mobile_sdhi: explain clock bindings
ARM: dts: r7s72100: update sdhi clock bindings
Documentation/devicetree/bindings/mmc/tmio_mmc.txt | 21 +++++++++++++++++++++
arch/arm/boot/dts/r7s72100.dtsi | 17 ++++++++++++-----
drivers/mmc/host/sh_mobile_sdhi.c | 11 +++++++++++
include/dt-bindings/clock/r7s72100-clock.h | 6 ++++--
4 files changed, 48 insertions(+), 7 deletions(-)
--
2.10.1
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH v2 1/3] mmc: sh_mobile_sdhi: add support for 2 clocks
2017-01-17 19:59 ` Chris Brandt
@ 2017-01-17 19:59 ` Chris Brandt
-1 siblings, 0 replies; 16+ messages in thread
From: Chris Brandt @ 2017-01-17 19:59 UTC (permalink / raw)
To: Ulf Hansson, Rob Herring, Mark Rutland, Simon Horman,
Wolfram Sang, Geert Uytterhoeven
Cc: devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-mmc-u79uwXL29TY76Z2rM5mHXA,
linux-renesas-soc-u79uwXL29TY76Z2rM5mHXA, Chris Brandt
Some controllers have 2 clock sources instead of 1, so they both need
to be turned on/off.
Signed-off-by: Chris Brandt <chris.brandt-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org>
---
drivers/mmc/host/sh_mobile_sdhi.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c
index 59db14b..5ad5744 100644
--- a/drivers/mmc/host/sh_mobile_sdhi.c
+++ b/drivers/mmc/host/sh_mobile_sdhi.c
@@ -143,6 +143,7 @@ MODULE_DEVICE_TABLE(of, sh_mobile_sdhi_of_match);
struct sh_mobile_sdhi {
struct clk *clk;
+ struct clk *clk2;
struct tmio_mmc_data mmc_data;
struct tmio_mmc_dma dma_priv;
struct pinctrl *pinctrl;
@@ -190,6 +191,10 @@ static int sh_mobile_sdhi_clk_enable(struct tmio_mmc_host *host)
if (ret < 0)
return ret;
+ ret = clk_prepare_enable(priv->clk2);
+ if (ret < 0)
+ return ret;
+
/*
* The clock driver may not know what maximum frequency
* actually works, so it should be set with the max-frequency
@@ -255,6 +260,8 @@ static void sh_mobile_sdhi_clk_disable(struct tmio_mmc_host *host)
struct sh_mobile_sdhi *priv = host_to_priv(host);
clk_disable_unprepare(priv->clk);
+ if (priv->clk2)
+ clk_disable_unprepare(priv->clk2);
}
static int sh_mobile_sdhi_card_busy(struct mmc_host *mmc)
@@ -572,6 +579,10 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev)
goto eprobe;
}
+ priv->clk2 = devm_clk_get(&pdev->dev, "carddetect");
+ if (IS_ERR(priv->clk2))
+ priv->clk2 = NULL;
+
priv->pinctrl = devm_pinctrl_get(&pdev->dev);
if (!IS_ERR(priv->pinctrl)) {
priv->pins_default = pinctrl_lookup_state(priv->pinctrl,
--
2.10.1
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH v2 1/3] mmc: sh_mobile_sdhi: add support for 2 clocks
@ 2017-01-17 19:59 ` Chris Brandt
0 siblings, 0 replies; 16+ messages in thread
From: Chris Brandt @ 2017-01-17 19:59 UTC (permalink / raw)
To: Ulf Hansson, Rob Herring, Mark Rutland, Simon Horman,
Wolfram Sang, Geert Uytterhoeven
Cc: devicetree, linux-mmc, linux-renesas-soc, Chris Brandt
Some controllers have 2 clock sources instead of 1, so they both need
to be turned on/off.
Signed-off-by: Chris Brandt <chris.brandt@renesas.com>
---
drivers/mmc/host/sh_mobile_sdhi.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c
index 59db14b..5ad5744 100644
--- a/drivers/mmc/host/sh_mobile_sdhi.c
+++ b/drivers/mmc/host/sh_mobile_sdhi.c
@@ -143,6 +143,7 @@ MODULE_DEVICE_TABLE(of, sh_mobile_sdhi_of_match);
struct sh_mobile_sdhi {
struct clk *clk;
+ struct clk *clk2;
struct tmio_mmc_data mmc_data;
struct tmio_mmc_dma dma_priv;
struct pinctrl *pinctrl;
@@ -190,6 +191,10 @@ static int sh_mobile_sdhi_clk_enable(struct tmio_mmc_host *host)
if (ret < 0)
return ret;
+ ret = clk_prepare_enable(priv->clk2);
+ if (ret < 0)
+ return ret;
+
/*
* The clock driver may not know what maximum frequency
* actually works, so it should be set with the max-frequency
@@ -255,6 +260,8 @@ static void sh_mobile_sdhi_clk_disable(struct tmio_mmc_host *host)
struct sh_mobile_sdhi *priv = host_to_priv(host);
clk_disable_unprepare(priv->clk);
+ if (priv->clk2)
+ clk_disable_unprepare(priv->clk2);
}
static int sh_mobile_sdhi_card_busy(struct mmc_host *mmc)
@@ -572,6 +579,10 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev)
goto eprobe;
}
+ priv->clk2 = devm_clk_get(&pdev->dev, "carddetect");
+ if (IS_ERR(priv->clk2))
+ priv->clk2 = NULL;
+
priv->pinctrl = devm_pinctrl_get(&pdev->dev);
if (!IS_ERR(priv->pinctrl)) {
priv->pins_default = pinctrl_lookup_state(priv->pinctrl,
--
2.10.1
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH v2 2/3] mmc: sh_mobile_sdhi: explain clock bindings
2017-01-17 19:59 ` Chris Brandt
(?)
@ 2017-01-17 19:59 ` Chris Brandt
2017-01-17 20:33 ` Wolfram Sang
[not found] ` <20170117195940.25092-3-chris.brandt-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org>
-1 siblings, 2 replies; 16+ messages in thread
From: Chris Brandt @ 2017-01-17 19:59 UTC (permalink / raw)
To: Ulf Hansson, Rob Herring, Mark Rutland, Simon Horman,
Wolfram Sang, Geert Uytterhoeven
Cc: devicetree, linux-mmc, linux-renesas-soc, Chris Brandt
In the case of a single clock source, you don't need names. However,
if the controller has 2 clock sources, you need to name them correctly
so the driver can find the 2nd one.
Signed-off-by: Chris Brandt <chris.brandt@renesas.com>
---
Documentation/devicetree/bindings/mmc/tmio_mmc.txt | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/Documentation/devicetree/bindings/mmc/tmio_mmc.txt b/Documentation/devicetree/bindings/mmc/tmio_mmc.txt
index a1650ed..258b98c 100644
--- a/Documentation/devicetree/bindings/mmc/tmio_mmc.txt
+++ b/Documentation/devicetree/bindings/mmc/tmio_mmc.txt
@@ -25,8 +25,29 @@ Required properties:
"renesas,sdhi-r8a7795" - SDHI IP on R8A7795 SoC
"renesas,sdhi-r8a7796" - SDHI IP on R8A7796 SoC
+- clocks: Most controllers only have 1 clock source per cahnnel. However, some
+ have 2. If 2 clocks are specified, you must name them as "core" and
+ "carddetect". If the controller only has 1 clock, naming is not
+ required.
+
Optional properties:
- toshiba,mmc-wrprotect-disable: write-protect detection is unavailable
- pinctrl-names: should be "default", "state_uhs"
- pinctrl-0: should contain default/high speed pin ctrl
- pinctrl-1: should contain uhs mode pin ctrl
+
+Example showing 2 clocks:
+ sdhi0: sd@e804e000 {
+ compatible = "renesas,sdhi-r7s72100";
+ reg = <0xe804e000 0x100>;
+ interrupts = <GIC_SPI 270 IRQ_TYPE_LEVEL_HIGH
+ GIC_SPI 271 IRQ_TYPE_LEVEL_HIGH
+ GIC_SPI 272 IRQ_TYPE_LEVEL_HIGH>;
+
+ clocks = <&mstp12_clks R7S72100_CLK_SDHI00>,
+ <&mstp12_clks R7S72100_CLK_SDHI01>;
+ clock-names = "core", "carddetect";
+ cap-sd-highspeed;
+ cap-sdio-irq;
+ status = "disabled";
+ };
--
2.10.1
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH v2 3/3] ARM: dts: r7s72100: update sdhi clock bindings
2017-01-17 19:59 ` Chris Brandt
@ 2017-01-17 19:59 ` Chris Brandt
-1 siblings, 0 replies; 16+ messages in thread
From: Chris Brandt @ 2017-01-17 19:59 UTC (permalink / raw)
To: Ulf Hansson, Rob Herring, Mark Rutland, Simon Horman,
Wolfram Sang, Geert Uytterhoeven
Cc: devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-mmc-u79uwXL29TY76Z2rM5mHXA,
linux-renesas-soc-u79uwXL29TY76Z2rM5mHXA, Chris Brandt
The SDHI controller in the RZ/A1 has 2 clock sources per channel and both
need to be enabled/disabled for proper operation. This fixes the fact that
the define for R7S72100_CLK_SDHI1 was not correct to begin with (typo), and
that all 4 clock sources need to be defined an used.
Signed-off-by: Chris Brandt <chris.brandt-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org>
---
v2:
* add missing clock sources instead of just fixing typo
---
arch/arm/boot/dts/r7s72100.dtsi | 17 ++++++++++++-----
include/dt-bindings/clock/r7s72100-clock.h | 6 ++++--
2 files changed, 16 insertions(+), 7 deletions(-)
diff --git a/arch/arm/boot/dts/r7s72100.dtsi b/arch/arm/boot/dts/r7s72100.dtsi
index 3dd427d..8e7e516 100644
--- a/arch/arm/boot/dts/r7s72100.dtsi
+++ b/arch/arm/boot/dts/r7s72100.dtsi
@@ -153,9 +153,12 @@
#clock-cells = <1>;
compatible = "renesas,r7s72100-mstp-clocks", "renesas,cpg-mstp-clocks";
reg = <0xfcfe0444 4>;
- clocks = <&p1_clk>, <&p1_clk>;
- clock-indices = <R7S72100_CLK_SDHI1 R7S72100_CLK_SDHI0>;
- clock-output-names = "sdhi1", "sdhi0";
+ clocks = <&p1_clk>, <&p1_clk>, <&p1_clk>, <&p1_clk>;
+ clock-indices = <
+ R7S72100_CLK_SDHI00 R7S72100_CLK_SDHI01
+ R7S72100_CLK_SDHI10 R7S72100_CLK_SDHI11
+ >;
+ clock-output-names = "sdhi00", "sdhi01", "sdhi10", "sdhi11";
};
};
@@ -478,7 +481,9 @@
GIC_SPI 271 IRQ_TYPE_LEVEL_HIGH
GIC_SPI 272 IRQ_TYPE_LEVEL_HIGH>;
- clocks = <&mstp12_clks R7S72100_CLK_SDHI0>;
+ clocks = <&mstp12_clks R7S72100_CLK_SDHI00>,
+ <&mstp12_clks R7S72100_CLK_SDHI01>;
+ clock-names = "core", "carddetect";
cap-sd-highspeed;
cap-sdio-irq;
status = "disabled";
@@ -491,7 +496,9 @@
GIC_SPI 274 IRQ_TYPE_LEVEL_HIGH
GIC_SPI 275 IRQ_TYPE_LEVEL_HIGH>;
- clocks = <&mstp12_clks R7S72100_CLK_SDHI1>;
+ clocks = <&mstp12_clks R7S72100_CLK_SDHI10>,
+ <&mstp12_clks R7S72100_CLK_SDHI11>;
+ clock-names = "core", "carddetect";
cap-sd-highspeed;
cap-sdio-irq;
status = "disabled";
diff --git a/include/dt-bindings/clock/r7s72100-clock.h b/include/dt-bindings/clock/r7s72100-clock.h
index 29e01ed..f2d8428 100644
--- a/include/dt-bindings/clock/r7s72100-clock.h
+++ b/include/dt-bindings/clock/r7s72100-clock.h
@@ -45,7 +45,9 @@
#define R7S72100_CLK_SPI4 3
/* MSTP12 */
-#define R7S72100_CLK_SDHI0 3
-#define R7S72100_CLK_SDHI1 2
+#define R7S72100_CLK_SDHI00 3
+#define R7S72100_CLK_SDHI01 2
+#define R7S72100_CLK_SDHI10 1
+#define R7S72100_CLK_SDHI11 0
#endif /* __DT_BINDINGS_CLOCK_R7S72100_H__ */
--
2.10.1
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH v2 3/3] ARM: dts: r7s72100: update sdhi clock bindings
@ 2017-01-17 19:59 ` Chris Brandt
0 siblings, 0 replies; 16+ messages in thread
From: Chris Brandt @ 2017-01-17 19:59 UTC (permalink / raw)
To: Ulf Hansson, Rob Herring, Mark Rutland, Simon Horman,
Wolfram Sang, Geert Uytterhoeven
Cc: devicetree, linux-mmc, linux-renesas-soc, Chris Brandt
The SDHI controller in the RZ/A1 has 2 clock sources per channel and both
need to be enabled/disabled for proper operation. This fixes the fact that
the define for R7S72100_CLK_SDHI1 was not correct to begin with (typo), and
that all 4 clock sources need to be defined an used.
Signed-off-by: Chris Brandt <chris.brandt@renesas.com>
---
v2:
* add missing clock sources instead of just fixing typo
---
arch/arm/boot/dts/r7s72100.dtsi | 17 ++++++++++++-----
include/dt-bindings/clock/r7s72100-clock.h | 6 ++++--
2 files changed, 16 insertions(+), 7 deletions(-)
diff --git a/arch/arm/boot/dts/r7s72100.dtsi b/arch/arm/boot/dts/r7s72100.dtsi
index 3dd427d..8e7e516 100644
--- a/arch/arm/boot/dts/r7s72100.dtsi
+++ b/arch/arm/boot/dts/r7s72100.dtsi
@@ -153,9 +153,12 @@
#clock-cells = <1>;
compatible = "renesas,r7s72100-mstp-clocks", "renesas,cpg-mstp-clocks";
reg = <0xfcfe0444 4>;
- clocks = <&p1_clk>, <&p1_clk>;
- clock-indices = <R7S72100_CLK_SDHI1 R7S72100_CLK_SDHI0>;
- clock-output-names = "sdhi1", "sdhi0";
+ clocks = <&p1_clk>, <&p1_clk>, <&p1_clk>, <&p1_clk>;
+ clock-indices = <
+ R7S72100_CLK_SDHI00 R7S72100_CLK_SDHI01
+ R7S72100_CLK_SDHI10 R7S72100_CLK_SDHI11
+ >;
+ clock-output-names = "sdhi00", "sdhi01", "sdhi10", "sdhi11";
};
};
@@ -478,7 +481,9 @@
GIC_SPI 271 IRQ_TYPE_LEVEL_HIGH
GIC_SPI 272 IRQ_TYPE_LEVEL_HIGH>;
- clocks = <&mstp12_clks R7S72100_CLK_SDHI0>;
+ clocks = <&mstp12_clks R7S72100_CLK_SDHI00>,
+ <&mstp12_clks R7S72100_CLK_SDHI01>;
+ clock-names = "core", "carddetect";
cap-sd-highspeed;
cap-sdio-irq;
status = "disabled";
@@ -491,7 +496,9 @@
GIC_SPI 274 IRQ_TYPE_LEVEL_HIGH
GIC_SPI 275 IRQ_TYPE_LEVEL_HIGH>;
- clocks = <&mstp12_clks R7S72100_CLK_SDHI1>;
+ clocks = <&mstp12_clks R7S72100_CLK_SDHI10>,
+ <&mstp12_clks R7S72100_CLK_SDHI11>;
+ clock-names = "core", "carddetect";
cap-sd-highspeed;
cap-sdio-irq;
status = "disabled";
diff --git a/include/dt-bindings/clock/r7s72100-clock.h b/include/dt-bindings/clock/r7s72100-clock.h
index 29e01ed..f2d8428 100644
--- a/include/dt-bindings/clock/r7s72100-clock.h
+++ b/include/dt-bindings/clock/r7s72100-clock.h
@@ -45,7 +45,9 @@
#define R7S72100_CLK_SPI4 3
/* MSTP12 */
-#define R7S72100_CLK_SDHI0 3
-#define R7S72100_CLK_SDHI1 2
+#define R7S72100_CLK_SDHI00 3
+#define R7S72100_CLK_SDHI01 2
+#define R7S72100_CLK_SDHI10 1
+#define R7S72100_CLK_SDHI11 0
#endif /* __DT_BINDINGS_CLOCK_R7S72100_H__ */
--
2.10.1
^ permalink raw reply related [flat|nested] 16+ messages in thread
* Re: [PATCH v2 1/3] mmc: sh_mobile_sdhi: add support for 2 clocks
2017-01-17 19:59 ` Chris Brandt
(?)
@ 2017-01-17 20:30 ` Wolfram Sang
2017-01-18 14:53 ` Chris Brandt
-1 siblings, 1 reply; 16+ messages in thread
From: Wolfram Sang @ 2017-01-17 20:30 UTC (permalink / raw)
To: Chris Brandt
Cc: Ulf Hansson, Rob Herring, Mark Rutland, Simon Horman,
Wolfram Sang, Geert Uytterhoeven, devicetree, linux-mmc,
linux-renesas-soc
Hi Chris,
> + struct clk *clk2;
I'd vote for 'clk_cd' since we are explicitly requesting that clock for
it.
> + ret = clk_prepare_enable(priv->clk2);
> + if (ret < 0)
> + return ret;
You need to disable clk when failing.
Regards,
Wolfram
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v2 2/3] mmc: sh_mobile_sdhi: explain clock bindings
2017-01-17 19:59 ` [PATCH v2 2/3] mmc: sh_mobile_sdhi: explain clock bindings Chris Brandt
@ 2017-01-17 20:33 ` Wolfram Sang
2017-01-18 14:58 ` Chris Brandt
[not found] ` <20170117195940.25092-3-chris.brandt-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org>
1 sibling, 1 reply; 16+ messages in thread
From: Wolfram Sang @ 2017-01-17 20:33 UTC (permalink / raw)
To: Chris Brandt
Cc: Ulf Hansson, Rob Herring, Mark Rutland, Simon Horman,
Wolfram Sang, Geert Uytterhoeven, devicetree, linux-mmc,
linux-renesas-soc
On Tue, Jan 17, 2017 at 02:59:39PM -0500, Chris Brandt wrote:
> In the case of a single clock source, you don't need names. However,
> if the controller has 2 clock sources, you need to name them correctly
> so the driver can find the 2nd one.
>
> Signed-off-by: Chris Brandt <chris.brandt@renesas.com>
> ---
> Documentation/devicetree/bindings/mmc/tmio_mmc.txt | 21 +++++++++++++++++++++
> 1 file changed, 21 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/mmc/tmio_mmc.txt b/Documentation/devicetree/bindings/mmc/tmio_mmc.txt
> index a1650ed..258b98c 100644
> --- a/Documentation/devicetree/bindings/mmc/tmio_mmc.txt
> +++ b/Documentation/devicetree/bindings/mmc/tmio_mmc.txt
> @@ -25,8 +25,29 @@ Required properties:
> "renesas,sdhi-r8a7795" - SDHI IP on R8A7795 SoC
> "renesas,sdhi-r8a7796" - SDHI IP on R8A7796 SoC
>
> +- clocks: Most controllers only have 1 clock source per cahnnel. However, some
channel.
> + have 2. If 2 clocks are specified, you must name them as "core" and
Maybe "However, some have a second clock dedicated to card detection."?
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v2 3/3] ARM: dts: r7s72100: update sdhi clock bindings
2017-01-17 19:59 ` Chris Brandt
@ 2017-01-18 8:41 ` Geert Uytterhoeven
-1 siblings, 0 replies; 16+ messages in thread
From: Geert Uytterhoeven @ 2017-01-18 8:41 UTC (permalink / raw)
To: Chris Brandt
Cc: Ulf Hansson, Rob Herring, Mark Rutland, Simon Horman,
Wolfram Sang, devicetree-u79uwXL29TY76Z2rM5mHXA, Linux MMC List,
Linux-Renesas
On Tue, Jan 17, 2017 at 8:59 PM, Chris Brandt <chris.brandt-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org> wrote:
> The SDHI controller in the RZ/A1 has 2 clock sources per channel and both
> need to be enabled/disabled for proper operation. This fixes the fact that
> the define for R7S72100_CLK_SDHI1 was not correct to begin with (typo), and
> that all 4 clock sources need to be defined an used.
>
> Signed-off-by: Chris Brandt <chris.brandt-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org>
Reviewed-by: Geert Uytterhoeven <geert+renesas-gXvu3+zWzMSzQB+pC5nmwQ@public.gmane.org>
Note that this depends on the acceptance of the DT binding doc update.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.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
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v2 3/3] ARM: dts: r7s72100: update sdhi clock bindings
@ 2017-01-18 8:41 ` Geert Uytterhoeven
0 siblings, 0 replies; 16+ messages in thread
From: Geert Uytterhoeven @ 2017-01-18 8:41 UTC (permalink / raw)
To: Chris Brandt
Cc: Ulf Hansson, Rob Herring, Mark Rutland, Simon Horman,
Wolfram Sang, devicetree, Linux MMC List, Linux-Renesas
On Tue, Jan 17, 2017 at 8:59 PM, Chris Brandt <chris.brandt@renesas.com> wrote:
> The SDHI controller in the RZ/A1 has 2 clock sources per channel and both
> need to be enabled/disabled for proper operation. This fixes the fact that
> the define for R7S72100_CLK_SDHI1 was not correct to begin with (typo), and
> that all 4 clock sources need to be defined an used.
>
> Signed-off-by: Chris Brandt <chris.brandt@renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Note that this depends on the acceptance of the DT binding doc update.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@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
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v2 2/3] mmc: sh_mobile_sdhi: explain clock bindings
2017-01-17 19:59 ` [PATCH v2 2/3] mmc: sh_mobile_sdhi: explain clock bindings Chris Brandt
@ 2017-01-18 8:44 ` Geert Uytterhoeven
[not found] ` <20170117195940.25092-3-chris.brandt-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org>
1 sibling, 0 replies; 16+ messages in thread
From: Geert Uytterhoeven @ 2017-01-18 8:44 UTC (permalink / raw)
To: Chris Brandt
Cc: Ulf Hansson, Rob Herring, Mark Rutland, Simon Horman,
Wolfram Sang, devicetree-u79uwXL29TY76Z2rM5mHXA, Linux MMC List,
Linux-Renesas
Hi Chris,
On Tue, Jan 17, 2017 at 8:59 PM, Chris Brandt <chris.brandt-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org> wrote:
> In the case of a single clock source, you don't need names. However,
> if the controller has 2 clock sources, you need to name them correctly
> so the driver can find the 2nd one.
>
> Signed-off-by: Chris Brandt <chris.brandt-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org>
> ---
> Documentation/devicetree/bindings/mmc/tmio_mmc.txt | 21 +++++++++++++++++++++
> 1 file changed, 21 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/mmc/tmio_mmc.txt b/Documentation/devicetree/bindings/mmc/tmio_mmc.txt
> index a1650ed..258b98c 100644
> --- a/Documentation/devicetree/bindings/mmc/tmio_mmc.txt
> +++ b/Documentation/devicetree/bindings/mmc/tmio_mmc.txt
> @@ -25,8 +25,29 @@ Required properties:
> "renesas,sdhi-r8a7795" - SDHI IP on R8A7795 SoC
> "renesas,sdhi-r8a7796" - SDHI IP on R8A7796 SoC
>
> +- clocks: Most controllers only have 1 clock source per cahnnel. However, some
> + have 2. If 2 clocks are specified, you must name them as "core" and
> + "carddetect". If the controller only has 1 clock, naming is not
Perhaps this clock should just be called "cd", as that's already an
established abbreviation for card detect in MMC DT bindings?
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.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
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v2 2/3] mmc: sh_mobile_sdhi: explain clock bindings
@ 2017-01-18 8:44 ` Geert Uytterhoeven
0 siblings, 0 replies; 16+ messages in thread
From: Geert Uytterhoeven @ 2017-01-18 8:44 UTC (permalink / raw)
To: Chris Brandt
Cc: Ulf Hansson, Rob Herring, Mark Rutland, Simon Horman,
Wolfram Sang, devicetree, Linux MMC List, Linux-Renesas
Hi Chris,
On Tue, Jan 17, 2017 at 8:59 PM, Chris Brandt <chris.brandt@renesas.com> wrote:
> In the case of a single clock source, you don't need names. However,
> if the controller has 2 clock sources, you need to name them correctly
> so the driver can find the 2nd one.
>
> Signed-off-by: Chris Brandt <chris.brandt@renesas.com>
> ---
> Documentation/devicetree/bindings/mmc/tmio_mmc.txt | 21 +++++++++++++++++++++
> 1 file changed, 21 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/mmc/tmio_mmc.txt b/Documentation/devicetree/bindings/mmc/tmio_mmc.txt
> index a1650ed..258b98c 100644
> --- a/Documentation/devicetree/bindings/mmc/tmio_mmc.txt
> +++ b/Documentation/devicetree/bindings/mmc/tmio_mmc.txt
> @@ -25,8 +25,29 @@ Required properties:
> "renesas,sdhi-r8a7795" - SDHI IP on R8A7795 SoC
> "renesas,sdhi-r8a7796" - SDHI IP on R8A7796 SoC
>
> +- clocks: Most controllers only have 1 clock source per cahnnel. However, some
> + have 2. If 2 clocks are specified, you must name them as "core" and
> + "carddetect". If the controller only has 1 clock, naming is not
Perhaps this clock should just be called "cd", as that's already an
established abbreviation for card detect in MMC DT bindings?
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@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
^ permalink raw reply [flat|nested] 16+ messages in thread
* RE: [PATCH v2 1/3] mmc: sh_mobile_sdhi: add support for 2 clocks
2017-01-17 20:30 ` Wolfram Sang
@ 2017-01-18 14:53 ` Chris Brandt
0 siblings, 0 replies; 16+ messages in thread
From: Chris Brandt @ 2017-01-18 14:53 UTC (permalink / raw)
To: Wolfram Sang
Cc: Ulf Hansson, Rob Herring, Mark Rutland, Simon Horman,
Wolfram Sang, Geert Uytterhoeven, devicetree, linux-mmc,
linux-renesas-soc
Hi Wolfram,
On Tuesday, January 17, 2017, Wolfram Sang wrote:
> Hi Chris,
>
> > + struct clk *clk2;
>
> I'd vote for 'clk_cd' since we are explicitly requesting that clock for it.
>
> > + ret = clk_prepare_enable(priv->clk2);
> > + if (ret < 0)
> > + return ret;
>
> You need to disable clk when failing.
>
> Regards,
>
> Wolfram
Thanks for the feedback. I will make those changes.
Chris
^ permalink raw reply [flat|nested] 16+ messages in thread
* RE: [PATCH v2 2/3] mmc: sh_mobile_sdhi: explain clock bindings
2017-01-17 20:33 ` Wolfram Sang
@ 2017-01-18 14:58 ` Chris Brandt
0 siblings, 0 replies; 16+ messages in thread
From: Chris Brandt @ 2017-01-18 14:58 UTC (permalink / raw)
To: Wolfram Sang
Cc: Ulf Hansson, Rob Herring, Mark Rutland, Simon Horman,
Wolfram Sang, Geert Uytterhoeven, devicetree, linux-mmc,
linux-renesas-soc
Hi Wolfram,
On Tuesday, January 17, 2017, Wolfram Sang wrote:
> > +- clocks: Most controllers only have 1 clock source per cahnnel.
> > +However, some
>
> channel.
>
> > + have 2. If 2 clocks are specified, you must name them as "core"
> > +and
>
> Maybe "However, some have a second clock dedicated to card detection."?
Thank you for fixing my crappy spelling and grammar ;)
I'm glad C code uses 'if' and 'else' instead of
contemplate (x>y)
X=1;
alternatively
y=1;
...then I'd be screwed!
Chris
^ permalink raw reply [flat|nested] 16+ messages in thread
* RE: [PATCH v2 2/3] mmc: sh_mobile_sdhi: explain clock bindings
2017-01-18 8:44 ` Geert Uytterhoeven
(?)
@ 2017-01-18 15:11 ` Chris Brandt
-1 siblings, 0 replies; 16+ messages in thread
From: Chris Brandt @ 2017-01-18 15:11 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: Ulf Hansson, Rob Herring, Mark Rutland, Simon Horman,
Wolfram Sang, devicetree, Linux MMC List, Linux-Renesas
Hi Geert,
On Wednesday, January 18, 2017, Geert Uytterhoeven wrote:
> > +- clocks: Most controllers only have 1 clock source per cahnnel.
> However, some
> > + have 2. If 2 clocks are specified, you must name them as
> "core" and
> > + "carddetect". If the controller only has 1 clock, naming is
> > +not
>
> Perhaps this clock should just be called "cd", as that's already an
> established abbreviation for card detect in MMC DT bindings?
OK, I'll change it.
Thanks,
Chris
^ permalink raw reply [flat|nested] 16+ messages in thread
end of thread, other threads:[~2017-01-18 15:11 UTC | newest]
Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-17 19:59 [PATCH v2 0/3] mmc: sh_mobile_sdhi: fix missing r7s72100 clocks Chris Brandt
2017-01-17 19:59 ` Chris Brandt
2017-01-17 19:59 ` [PATCH v2 2/3] mmc: sh_mobile_sdhi: explain clock bindings Chris Brandt
2017-01-17 20:33 ` Wolfram Sang
2017-01-18 14:58 ` Chris Brandt
[not found] ` <20170117195940.25092-3-chris.brandt-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org>
2017-01-18 8:44 ` Geert Uytterhoeven
2017-01-18 8:44 ` Geert Uytterhoeven
2017-01-18 15:11 ` Chris Brandt
[not found] ` <20170117195940.25092-1-chris.brandt-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org>
2017-01-17 19:59 ` [PATCH v2 1/3] mmc: sh_mobile_sdhi: add support for 2 clocks Chris Brandt
2017-01-17 19:59 ` Chris Brandt
2017-01-17 20:30 ` Wolfram Sang
2017-01-18 14:53 ` Chris Brandt
2017-01-17 19:59 ` [PATCH v2 3/3] ARM: dts: r7s72100: update sdhi clock bindings Chris Brandt
2017-01-17 19:59 ` Chris Brandt
[not found] ` <20170117195940.25092-4-chris.brandt-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org>
2017-01-18 8:41 ` Geert Uytterhoeven
2017-01-18 8:41 ` Geert Uytterhoeven
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.