linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 00/13] Support more devices on rockchip rv1108
@ 2017-08-11  3:36 Andy Yan
       [not found] ` <1502422578-30611-1-git-send-email-andy.yan-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
  2017-08-11  3:39 ` [PATCH v3 03/13] ARM: dts: rockchip: add i2c dt node " Andy Yan
  0 siblings, 2 replies; 10+ messages in thread
From: Andy Yan @ 2017-08-11  3:36 UTC (permalink / raw)
  To: heiko-4mtYJXux2i+zQB+pC5nmwQ
  Cc: robh+dt-DgEjT+Ai2ygdnm+yROfE0A, linux-pwm-u79uwXL29TY76Z2rM5mHXA,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA,
	linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-iio-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA, wsa-z923LK4zBo2bacvFa/9K2g,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	broonie-DgEjT+Ai2ygdnm+yROfE0A,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-spi-u79uwXL29TY76Z2rM5mHXA, Andy Yan

This series try to support i2c/spi/pwm/saradc/pmic/watchdog
on rockchip rv1108 soc.

As the clk tree part has been taken from Elaine's series, so
this part will be not included in my series from this version.

This version has no more changes, except the pwm  dt-bindings
followed by Rob's suggestion, and the Acked-by from Rob of other
dt-bindings.

Changes in v3:
- remove the clk tree part
- make the compatible string be: "rockchip,rv1108-pwm", "rockchip,rk3288-pwm"
  for rv1108 pwm

Changes in v2:
- add compatible string "rockchip,rv1108-pwm"
- add compatible string "rockchip,rv1108-saradc"

Andy Yan (13):
  dt-bindings: i2c: rk3x: add support for rv1108
  i2c: rk3x: add support for rv1108
  ARM: dts: rockchip: add i2c dt node for rv1108
  spi: rockchip: add compatible string for rv1108 spi
  ARM: dts: rockchip: add spi dt node for rv1108
  dt-bindings: pwm: add description for rv1108 pwm
  ARM: dts: rockchip: add pwm dt node for rv1108
  ARM: dts: rockchip: add watchdog dt node for rv1108
  dt-bindings: adc: add description for rv1108 saradc
  ARM: dts: rockchip: add saradc support for rv1108
  ARM: dts: rockchip: add pwm backlight for rv1108 evb
  ARM: dts: rockchip: add pmic rk805 dt node for rv1108 evb
  ARM: dts: rockchip: add accelerometer bma250e dt node for rv1108 evb

 Documentation/devicetree/bindings/i2c/i2c-rk3x.txt |   1 +
 .../bindings/iio/adc/rockchip-saradc.txt           |   1 +
 .../devicetree/bindings/pwm/pwm-rockchip.txt       |   3 +-
 .../devicetree/bindings/spi/spi-rockchip.txt       |   1 +
 arch/arm/boot/dts/rv1108-evb.dts                   | 158 +++++++++++++
 arch/arm/boot/dts/rv1108.dtsi                      | 249 +++++++++++++++++++++
 drivers/i2c/busses/i2c-rk3x.c                      |   9 +
 drivers/spi/spi-rockchip.c                         |   1 +
 8 files changed, 422 insertions(+), 1 deletion(-)

-- 
2.7.4

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH v3 01/13] dt-bindings: i2c: rk3x: add support for rv1108
       [not found] ` <1502422578-30611-1-git-send-email-andy.yan-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
@ 2017-08-11  3:38   ` Andy Yan
       [not found]     ` <1502422709-30672-1-git-send-email-andy.yan-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
  2017-08-11  3:39   ` [PATCH v3 02/13] " Andy Yan
  1 sibling, 1 reply; 10+ messages in thread
From: Andy Yan @ 2017-08-11  3:38 UTC (permalink / raw)
  To: heiko-4mtYJXux2i+zQB+pC5nmwQ
  Cc: robh+dt-DgEjT+Ai2ygdnm+yROfE0A, linux-i2c-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA, wsa-z923LK4zBo2bacvFa/9K2g,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA, Andy Yan

Add dt Document for i2c controller on rv1108

Signed-off-by: Andy Yan <andy.yan-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
Acked-by: Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>

---

Changes in v3: None
Changes in v2: None

 Documentation/devicetree/bindings/i2c/i2c-rk3x.txt | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/i2c/i2c-rk3x.txt b/Documentation/devicetree/bindings/i2c/i2c-rk3x.txt
index e18445d..22f2eeb 100644
--- a/Documentation/devicetree/bindings/i2c/i2c-rk3x.txt
+++ b/Documentation/devicetree/bindings/i2c/i2c-rk3x.txt
@@ -7,6 +7,7 @@ Required properties :
 
  - reg : Offset and length of the register set for the device
  - compatible: should be one of the following:
+   - "rockchip,rv1108-i2c": for rv1108
    - "rockchip,rk3066-i2c": for rk3066
    - "rockchip,rk3188-i2c": for rk3188
    - "rockchip,rk3228-i2c": for rk3228
-- 
2.7.4


--
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] 10+ messages in thread

* [PATCH v3 02/13] i2c: rk3x: add support for rv1108
       [not found] ` <1502422578-30611-1-git-send-email-andy.yan-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
  2017-08-11  3:38   ` [PATCH v3 01/13] dt-bindings: i2c: rk3x: add support for rv1108 Andy Yan
@ 2017-08-11  3:39   ` Andy Yan
  2017-08-12 14:01     ` Wolfram Sang
  2017-08-12 14:40     ` Wolfram Sang
  1 sibling, 2 replies; 10+ messages in thread
From: Andy Yan @ 2017-08-11  3:39 UTC (permalink / raw)
  To: heiko-4mtYJXux2i+zQB+pC5nmwQ
  Cc: robh+dt-DgEjT+Ai2ygdnm+yROfE0A, linux-i2c-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA, wsa-z923LK4zBo2bacvFa/9K2g,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA, Andy Yan

Support for the i2c controller on rv1108 soc.

Signed-off-by: Andy Yan <andy.yan-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
Reviewed-by: Heiko Stuebner <heiko-4mtYJXux2i+zQB+pC5nmwQ@public.gmane.org>
---

Changes in v3: None
Changes in v2: None

 drivers/i2c/busses/i2c-rk3x.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/i2c/busses/i2c-rk3x.c b/drivers/i2c/busses/i2c-rk3x.c
index df22066..fe23457 100644
--- a/drivers/i2c/busses/i2c-rk3x.c
+++ b/drivers/i2c/busses/i2c-rk3x.c
@@ -1131,6 +1131,11 @@ static const struct i2c_algorithm rk3x_i2c_algorithm = {
 	.functionality		= rk3x_i2c_func,
 };
 
+static const struct rk3x_i2c_soc_data rv1108_soc_data = {
+	.grf_offset = -1,
+	.calc_timings = rk3x_i2c_v1_calc_timings,
+};
+
 static const struct rk3x_i2c_soc_data rk3066_soc_data = {
 	.grf_offset = 0x154,
 	.calc_timings = rk3x_i2c_v0_calc_timings,
@@ -1158,6 +1163,10 @@ static const struct rk3x_i2c_soc_data rk3399_soc_data = {
 
 static const struct of_device_id rk3x_i2c_match[] = {
 	{
+		.compatible = "rockchip,rv1108-i2c",
+		.data = (void *)&rv1108_soc_data
+	},
+	{
 		.compatible = "rockchip,rk3066-i2c",
 		.data = (void *)&rk3066_soc_data
 	},
-- 
2.7.4


--
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] 10+ messages in thread

* [PATCH v3 03/13] ARM: dts: rockchip: add i2c dt node for rv1108
  2017-08-11  3:36 [PATCH v3 00/13] Support more devices on rockchip rv1108 Andy Yan
       [not found] ` <1502422578-30611-1-git-send-email-andy.yan-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
@ 2017-08-11  3:39 ` Andy Yan
       [not found]   ` <1502422790-30776-1-git-send-email-andy.yan-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
  1 sibling, 1 reply; 10+ messages in thread
From: Andy Yan @ 2017-08-11  3:39 UTC (permalink / raw)
  To: heiko; +Cc: robh+dt, linux-i2c, devicetree, wsa, linux-kernel, Andy Yan

There are four i2c controllers on rv1108, add
device tree node for them.

Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
---

Changes in v3: None
Changes in v2: None

 arch/arm/boot/dts/rv1108.dtsi | 72 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 72 insertions(+)

diff --git a/arch/arm/boot/dts/rv1108.dtsi b/arch/arm/boot/dts/rv1108.dtsi
index 8377eb9..663f2f2 100644
--- a/arch/arm/boot/dts/rv1108.dtsi
+++ b/arch/arm/boot/dts/rv1108.dtsi
@@ -52,6 +52,10 @@
 	interrupt-parent = <&gic>;
 
 	aliases {
+		i2c0 = &i2c0;
+		i2c1 = &i2c1;
+		i2c2 = &i2c2;
+		i2c3 = &i2c3;
 		serial0 = &uart0;
 		serial1 = &uart1;
 		serial2 = &uart2;
@@ -154,11 +158,67 @@
 		status = "disabled";
 	};
 
+	i2c1: i2c@10240000 {
+		compatible = "rockchip,rv1108-i2c";
+		reg = <0x10240000 0x1000>;
+		interrupts = <GIC_SPI 31 IRQ_TYPE_LEVEL_HIGH>;
+		rockchip,grf = <&grf>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+		clocks = <&cru SCLK_I2C1>, <&cru PCLK_I2C1>;
+		clock-names = "i2c", "pclk";
+		pinctrl-names = "default";
+		pinctrl-0 = <&i2c1_xfer>;
+		status = "disabled";
+	};
+
+	i2c2: i2c@10250000 {
+		compatible = "rockchip,rv1108-i2c";
+		reg = <0x10250000 0x1000>;
+		interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH>;
+		rockchip,grf = <&grf>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+		clocks = <&cru SCLK_I2C2>, <&cru PCLK_I2C2>;
+		clock-names = "i2c", "pclk";
+		pinctrl-names = "default";
+		pinctrl-0 = <&i2c2m1_xfer>;
+		status = "disabled";
+	};
+
+	i2c3: i2c@10260000 {
+		compatible = "rockchip,rv1108-i2c";
+		reg = <0x10260000 0x1000>;
+		interrupts = <GIC_SPI 33 IRQ_TYPE_LEVEL_HIGH>;
+		rockchip,grf = <&grf>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+		clocks = <&cru SCLK_I2C3>, <&cru PCLK_I2C3>;
+		clock-names = "i2c", "pclk";
+		pinctrl-names = "default";
+		pinctrl-0 = <&i2c3_xfer>;
+		status = "disabled";
+	};
+
 	grf: syscon@10300000 {
 		compatible = "rockchip,rv1108-grf", "syscon";
 		reg = <0x10300000 0x1000>;
 	};
 
+	i2c0: i2c@20000000 {
+		compatible = "rockchip,rv1108-i2c";
+		reg = <0x20000000 0x1000>;
+		interrupts = <GIC_SPI 30 IRQ_TYPE_LEVEL_HIGH>;
+		rockchip,grf = <&grf>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+		clocks = <&cru SCLK_I2C0_PMU>, <&cru PCLK_I2C0_PMU>;
+		clock-names = "i2c", "pclk";
+		pinctrl-names = "default";
+		pinctrl-0 = <&i2c0_xfer>;
+		status = "disabled";
+	};
+
 	pmugrf: syscon@20060000 {
 		compatible = "rockchip,rv1108-pmugrf", "syscon";
 		reg = <0x20060000 0x1000>;
@@ -343,6 +403,18 @@
 			input-enable;
 		};
 
+		pcfg_pull_none_smt: pcfg-pull-none-smt {
+			bias-disable;
+			input-schmitt-enable;
+		};
+
+		i2c0 {
+			i2c0_xfer: i2c0-xfer {
+				rockchip,pins = <0 RK_PB1 RK_FUNC_1 &pcfg_pull_none_smt>,
+						<0 RK_PB2 RK_FUNC_1 &pcfg_pull_none_smt>;
+			};
+		};
+
 		i2c1 {
 			i2c1_xfer: i2c1-xfer {
 				rockchip,pins = <2 RK_PD3 RK_FUNC_1 &pcfg_pull_up>,
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH v3 02/13] i2c: rk3x: add support for rv1108
  2017-08-11  3:39   ` [PATCH v3 02/13] " Andy Yan
@ 2017-08-12 14:01     ` Wolfram Sang
       [not found]       ` <CANbgqATBQ3-V=Z8MLmw2jtQwiF0LMgoakGe+wLypzwF3EJF++A@mail.gmail.com>
  2017-08-12 14:40     ` Wolfram Sang
  1 sibling, 1 reply; 10+ messages in thread
From: Wolfram Sang @ 2017-08-12 14:01 UTC (permalink / raw)
  To: Andy Yan; +Cc: heiko, robh+dt, linux-i2c, devicetree, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 294 bytes --]

Hi,

> +static const struct rk3x_i2c_soc_data rv1108_soc_data = {
> +	.grf_offset = -1,
> +	.calc_timings = rk3x_i2c_v1_calc_timings,
> +};
> +

I don't care super much, but why don't you reuse rk3399_soc_data()?
Or even use the rk3399 compatible as fallback value?

Kind regards,

   Wolfram


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v3 02/13] i2c: rk3x: add support for rv1108
       [not found]       ` <CANbgqATBQ3-V=Z8MLmw2jtQwiF0LMgoakGe+wLypzwF3EJF++A@mail.gmail.com>
@ 2017-08-12 14:38         ` Wolfram Sang
  0 siblings, 0 replies; 10+ messages in thread
From: Wolfram Sang @ 2017-08-12 14:38 UTC (permalink / raw)
  To: Andy Yan
  Cc: Andy Yan, Heiko Stuebner, robh+dt, linux-i2c, devicetree,
	linux-kernel

[-- Attachment #1: Type: text/plain, Size: 271 bytes --]


> Actually, there is one I2C controller(I2C2) has a different feature with
> all the other rockchip soc.The I2C2 is not used on my current board. But I
> plan to add this feature later。 So I give RV1108 a new compatible string
> here。

Makes sense. Thanks!


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v3 01/13] dt-bindings: i2c: rk3x: add support for rv1108
       [not found]     ` <1502422709-30672-1-git-send-email-andy.yan-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
@ 2017-08-12 14:40       ` Wolfram Sang
  0 siblings, 0 replies; 10+ messages in thread
From: Wolfram Sang @ 2017-08-12 14:40 UTC (permalink / raw)
  To: Andy Yan
  Cc: heiko-4mtYJXux2i+zQB+pC5nmwQ, robh+dt-DgEjT+Ai2ygdnm+yROfE0A,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA

[-- Attachment #1: Type: text/plain, Size: 299 bytes --]

On Fri, Aug 11, 2017 at 11:38:29AM +0800, Andy Yan wrote:
> Add dt Document for i2c controller on rv1108
> 
> Signed-off-by: Andy Yan <andy.yan-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
> Acked-by: Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
> 

Applied to for-next, thanks!


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v3 02/13] i2c: rk3x: add support for rv1108
  2017-08-11  3:39   ` [PATCH v3 02/13] " Andy Yan
  2017-08-12 14:01     ` Wolfram Sang
@ 2017-08-12 14:40     ` Wolfram Sang
  1 sibling, 0 replies; 10+ messages in thread
From: Wolfram Sang @ 2017-08-12 14:40 UTC (permalink / raw)
  To: Andy Yan; +Cc: heiko, robh+dt, linux-i2c, devicetree, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 248 bytes --]

On Fri, Aug 11, 2017 at 11:39:13AM +0800, Andy Yan wrote:
> Support for the i2c controller on rv1108 soc.
> 
> Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
> Reviewed-by: Heiko Stuebner <heiko@sntech.de>

Applied to for-next, thanks!


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v3 03/13] ARM: dts: rockchip: add i2c dt node for rv1108
       [not found]   ` <1502422790-30776-1-git-send-email-andy.yan-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
@ 2017-08-12 14:40     ` Wolfram Sang
  2017-08-13 12:07       ` Heiko Stuebner
  0 siblings, 1 reply; 10+ messages in thread
From: Wolfram Sang @ 2017-08-12 14:40 UTC (permalink / raw)
  To: Andy Yan
  Cc: heiko-4mtYJXux2i+zQB+pC5nmwQ, robh+dt-DgEjT+Ai2ygdnm+yROfE0A,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA

[-- Attachment #1: Type: text/plain, Size: 269 bytes --]

On Fri, Aug 11, 2017 at 11:39:50AM +0800, Andy Yan wrote:
> There are four i2c controllers on rv1108, add
> device tree node for them.
> 
> Signed-off-by: Andy Yan <andy.yan-TNX95d0MmH7DzftRWevZcw@public.gmane.org>

This usually needs to go via some arm tree.


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v3 03/13] ARM: dts: rockchip: add i2c dt node for rv1108
  2017-08-12 14:40     ` Wolfram Sang
@ 2017-08-13 12:07       ` Heiko Stuebner
  0 siblings, 0 replies; 10+ messages in thread
From: Heiko Stuebner @ 2017-08-13 12:07 UTC (permalink / raw)
  To: Andy Yan
  Cc: Wolfram Sang, robh+dt-DgEjT+Ai2ygdnm+yROfE0A,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA

Am Samstag, 12. August 2017, 16:40:47 CEST schrieb Wolfram Sang:
> On Fri, Aug 11, 2017 at 11:39:50AM +0800, Andy Yan wrote:
> > There are four i2c controllers on rv1108, add
> > device tree node for them.
> > 
> > Signed-off-by: Andy Yan <andy.yan-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
> 
> This usually needs to go via some arm tree.

correct, and with the driver side being applied I've now also
applied this devicetree patch for 4.14
[With some slight reordering of properties]


Thanks
Heiko
--
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] 10+ messages in thread

end of thread, other threads:[~2017-08-13 12:07 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-11  3:36 [PATCH v3 00/13] Support more devices on rockchip rv1108 Andy Yan
     [not found] ` <1502422578-30611-1-git-send-email-andy.yan-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
2017-08-11  3:38   ` [PATCH v3 01/13] dt-bindings: i2c: rk3x: add support for rv1108 Andy Yan
     [not found]     ` <1502422709-30672-1-git-send-email-andy.yan-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
2017-08-12 14:40       ` Wolfram Sang
2017-08-11  3:39   ` [PATCH v3 02/13] " Andy Yan
2017-08-12 14:01     ` Wolfram Sang
     [not found]       ` <CANbgqATBQ3-V=Z8MLmw2jtQwiF0LMgoakGe+wLypzwF3EJF++A@mail.gmail.com>
2017-08-12 14:38         ` Wolfram Sang
2017-08-12 14:40     ` Wolfram Sang
2017-08-11  3:39 ` [PATCH v3 03/13] ARM: dts: rockchip: add i2c dt node " Andy Yan
     [not found]   ` <1502422790-30776-1-git-send-email-andy.yan-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
2017-08-12 14:40     ` Wolfram Sang
2017-08-13 12:07       ` Heiko Stuebner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).