diff mbox series

[v2,1/2] arm64: dts: allwinner: a64-amarula-relic: Add GT5663 CTP node

Message ID 20190418083543.11695-1-jagan@amarulasolutions.com (mailing list archive)
State New, archived
Headers show
Series [v2,1/2] arm64: dts: allwinner: a64-amarula-relic: Add GT5663 CTP node | expand

Commit Message

Jagan Teki April 18, 2019, 8:35 a.m. UTC
Add Goodix GT5663 capacitive touch controller node on
Amarula A64-Relic board.

The CTP connected to board with,
- SDA, SCK from i2c1
- GPIO-LD0 as AVDD28 supply
- PH4 gpio as interrupt pin
- PH8 gpio as reset pin
- X axis is inverted
- Y axis is inverted

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
---
Changes for v2:
- drop i2c1, bias-pull-up 

 .../allwinner/sun50i-a64-amarula-relic.dts    | 25 +++++++++++++++++++
 1 file changed, 25 insertions(+)

Comments

Maxime Ripard April 18, 2019, 11:23 a.m. UTC | #1
On Thu, Apr 18, 2019 at 02:05:42PM +0530, Jagan Teki wrote:
> Add Goodix GT5663 capacitive touch controller node on
> Amarula A64-Relic board.
>
> The CTP connected to board with,
> - SDA, SCK from i2c1
> - GPIO-LD0 as AVDD28 supply
> - PH4 gpio as interrupt pin
> - PH8 gpio as reset pin
> - X axis is inverted
> - Y axis is inverted
>
> Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
> ---
> Changes for v2:
> - drop i2c1, bias-pull-up
>
>  .../allwinner/sun50i-a64-amarula-relic.dts    | 25 +++++++++++++++++++
>  1 file changed, 25 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-amarula-relic.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-amarula-relic.dts
> index 3575db216016..3819ce396073 100644
> --- a/arch/arm64/boot/dts/allwinner/sun50i-a64-amarula-relic.dts
> +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-amarula-relic.dts
> @@ -49,6 +49,24 @@
>  	bias-pull-up;
>  };
>
> +&i2c1 {
> +	pinctrl-names = "default";
> +	pinctrl-0 = <&i2c1_pins>;

That's the default already

> +	status = "okay";
> +
> +	touchscreen@5d {
> +		compatible = "goodix,gt5663";
> +		reg = <0x5d>;
> +		AVDD28-supply = <&reg_ldo_io0>;			/* VCC-CTP: GPIO0-LDO */
> +		interrupt-parent = <&pio>;
> +		interrupts = <7 4 IRQ_TYPE_EDGE_FALLING>;
> +		irq-gpios = <&pio 7 4 GPIO_ACTIVE_HIGH>;	/* CTP-INT: PH4 */
> +		reset-gpios = <&pio 7 8 GPIO_ACTIVE_HIGH>;	/* CTP-RST: PH8 */
> +		touchscreen-inverted-x;
> +		touchscreen-inverted-y;
> +	};
> +};
> +
>  &mmc1 {
>  	pinctrl-names = "default";
>  	pinctrl-0 = <&mmc1_pins>;
> @@ -212,6 +230,13 @@
>  	regulator-name = "vdd-cpus";
>  };
>
> +&reg_ldo_io0 {
> +	regulator-min-microvolt = <3300000>;
> +	regulator-max-microvolt = <3300000>;

The name of that regulator is AVDD28, which indicates that it would be
a 2.8V regulator?

Maxime

--
Maxime Ripard, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
Jagan Teki April 18, 2019, 12:30 p.m. UTC | #2
On Thu, Apr 18, 2019 at 4:54 PM Maxime Ripard <maxime.ripard@bootlin.com> wrote:
>
> On Thu, Apr 18, 2019 at 02:05:42PM +0530, Jagan Teki wrote:
> > Add Goodix GT5663 capacitive touch controller node on
> > Amarula A64-Relic board.
> >
> > The CTP connected to board with,
> > - SDA, SCK from i2c1
> > - GPIO-LD0 as AVDD28 supply
> > - PH4 gpio as interrupt pin
> > - PH8 gpio as reset pin
> > - X axis is inverted
> > - Y axis is inverted
> >
> > Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
> > ---
> > Changes for v2:
> > - drop i2c1, bias-pull-up
> >
> >  .../allwinner/sun50i-a64-amarula-relic.dts    | 25 +++++++++++++++++++
> >  1 file changed, 25 insertions(+)
> >
> > diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-amarula-relic.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-amarula-relic.dts
> > index 3575db216016..3819ce396073 100644
> > --- a/arch/arm64/boot/dts/allwinner/sun50i-a64-amarula-relic.dts
> > +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-amarula-relic.dts
> > @@ -49,6 +49,24 @@
> >       bias-pull-up;
> >  };
> >
> > +&i2c1 {
> > +     pinctrl-names = "default";
> > +     pinctrl-0 = <&i2c1_pins>;
>
> That's the default already

Yes, and i2c1 node in sun50i-a64.dtsi is not attaching pinctrl. So I
attached here.
Maxime Ripard April 18, 2019, 12:57 p.m. UTC | #3
On Thu, Apr 18, 2019 at 06:00:27PM +0530, Jagan Teki wrote:
> On Thu, Apr 18, 2019 at 4:54 PM Maxime Ripard <maxime.ripard@bootlin.com> wrote:
> >
> > On Thu, Apr 18, 2019 at 02:05:42PM +0530, Jagan Teki wrote:
> > > Add Goodix GT5663 capacitive touch controller node on
> > > Amarula A64-Relic board.
> > >
> > > The CTP connected to board with,
> > > - SDA, SCK from i2c1
> > > - GPIO-LD0 as AVDD28 supply
> > > - PH4 gpio as interrupt pin
> > > - PH8 gpio as reset pin
> > > - X axis is inverted
> > > - Y axis is inverted
> > >
> > > Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
> > > ---
> > > Changes for v2:
> > > - drop i2c1, bias-pull-up
> > >
> > >  .../allwinner/sun50i-a64-amarula-relic.dts    | 25 +++++++++++++++++++
> > >  1 file changed, 25 insertions(+)
> > >
> > > diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-amarula-relic.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-amarula-relic.dts
> > > index 3575db216016..3819ce396073 100644
> > > --- a/arch/arm64/boot/dts/allwinner/sun50i-a64-amarula-relic.dts
> > > +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-amarula-relic.dts
> > > @@ -49,6 +49,24 @@
> > >       bias-pull-up;
> > >  };
> > >
> > > +&i2c1 {
> > > +     pinctrl-names = "default";
> > > +     pinctrl-0 = <&i2c1_pins>;
> >
> > That's the default already
>
> Yes, and i2c1 node in sun50i-a64.dtsi is not attaching pinctrl. So I
> attached here.

If that's the only muxing option, it should then.

Maxime

--
Maxime Ripard, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
diff mbox series

Patch

diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-amarula-relic.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-amarula-relic.dts
index 3575db216016..3819ce396073 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-amarula-relic.dts
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-amarula-relic.dts
@@ -49,6 +49,24 @@ 
 	bias-pull-up;
 };
 
+&i2c1 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&i2c1_pins>;
+	status = "okay";
+
+	touchscreen@5d {
+		compatible = "goodix,gt5663";
+		reg = <0x5d>;
+		AVDD28-supply = <&reg_ldo_io0>;			/* VCC-CTP: GPIO0-LDO */
+		interrupt-parent = <&pio>;
+		interrupts = <7 4 IRQ_TYPE_EDGE_FALLING>;
+		irq-gpios = <&pio 7 4 GPIO_ACTIVE_HIGH>;	/* CTP-INT: PH4 */
+		reset-gpios = <&pio 7 8 GPIO_ACTIVE_HIGH>;	/* CTP-RST: PH8 */
+		touchscreen-inverted-x;
+		touchscreen-inverted-y;
+	};
+};
+
 &mmc1 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&mmc1_pins>;
@@ -212,6 +230,13 @@ 
 	regulator-name = "vdd-cpus";
 };
 
+&reg_ldo_io0 {
+	regulator-min-microvolt = <3300000>;
+	regulator-max-microvolt = <3300000>;
+	regulator-name = "vcc-ctp";
+	status = "okay";
+};
+
 &reg_rtc_ldo {
 	regulator-name = "vcc-rtc";
 };