All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5] sun8i-a83t: Add touchscreen support on TBS A711
@ 2017-12-08 21:54 ` Mylène Josserand
  0 siblings, 0 replies; 33+ messages in thread
From: Mylène Josserand @ 2017-12-08 21:54 UTC (permalink / raw)
  To: robh+dt, mark.rutland, linux, maxime.ripard, wens,
	dmitry.torokhov, linux-input
  Cc: simon.budig, linux-kernel, devicetree, linux-arm-kernel,
	mylene.josserand, thomas.petazzoni

Hello everyone,

This patch series adds touchscreen support (FocalTech EDT-FT5x06
Polytouch) for TBS A711 (Allwinner sun8i-a83t SoC).
This touchscreen is using i2c so this series adds support of this bus
on A83T.

Series information:
   - Based on last linux-next (next-20171208)
   - Had dependencies on AXP209 Quentin Schultz's series:
   https://www.spinics.net/lists/linux-gpio/msg26913.htmlx

Patch 01: Add i2c0 node on a83t device tree.
Patch 02: Add i2c0 pin group.
Patch 03: Enable i2c0 on TBS A711.
Patch 04: Add support for regulator in the FocalTech touchscreen driver
because A711 tablet is using a regulator to power-up the touchscreen.
Patch 05: Add the touchscreen node in A711 TBS tablet.

Thank you in advance for any review.
Best regards,
Mylène

Mylène Josserand (5):
  arm: dts: sun8i: a83t: Add I2C0 node
  arm: dts: sun8i: a83t: Add I2C0 pins group
  arm: dts: sun8i: a83t: a711: Enable I2C0
  Input: edt-ft5x06 - Add support for regulator
  arm: dts: sun8i: a83t: a711: Add touchscreen node

 arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts | 18 +++++++++++++++++
 arch/arm/boot/dts/sun8i-a83t.dtsi         | 16 +++++++++++++++
 drivers/input/touchscreen/edt-ft5x06.c    | 33 +++++++++++++++++++++++++++++++
 3 files changed, 67 insertions(+)

-- 
2.11.0

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

* [PATCH 0/5] sun8i-a83t: Add touchscreen support on TBS A711
@ 2017-12-08 21:54 ` Mylène Josserand
  0 siblings, 0 replies; 33+ messages in thread
From: Mylène Josserand @ 2017-12-08 21:54 UTC (permalink / raw)
  To: robh+dt-DgEjT+Ai2ygdnm+yROfE0A, mark.rutland-5wv7dgnIgG8,
	linux-I+IVW8TIWO2tmTQ+vhA3Yw,
	maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8, wens-jdAy2FN1RRM,
	dmitry.torokhov-Re5JQEeQqe8AvxtiuMwx3w,
	linux-input-u79uwXL29TY76Z2rM5mHXA
  Cc: simon.budig-t93Ne7XHvje5bSeCtf/tX7NAH6kLmebB,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	mylene.josserand-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8,
	thomas.petazzoni-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8

Hello everyone,

This patch series adds touchscreen support (FocalTech EDT-FT5x06
Polytouch) for TBS A711 (Allwinner sun8i-a83t SoC).
This touchscreen is using i2c so this series adds support of this bus
on A83T.

Series information:
   - Based on last linux-next (next-20171208)
   - Had dependencies on AXP209 Quentin Schultz's series:
   https://www.spinics.net/lists/linux-gpio/msg26913.htmlx

Patch 01: Add i2c0 node on a83t device tree.
Patch 02: Add i2c0 pin group.
Patch 03: Enable i2c0 on TBS A711.
Patch 04: Add support for regulator in the FocalTech touchscreen driver
because A711 tablet is using a regulator to power-up the touchscreen.
Patch 05: Add the touchscreen node in A711 TBS tablet.

Thank you in advance for any review.
Best regards,
Mylène

Mylène Josserand (5):
  arm: dts: sun8i: a83t: Add I2C0 node
  arm: dts: sun8i: a83t: Add I2C0 pins group
  arm: dts: sun8i: a83t: a711: Enable I2C0
  Input: edt-ft5x06 - Add support for regulator
  arm: dts: sun8i: a83t: a711: Add touchscreen node

 arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts | 18 +++++++++++++++++
 arch/arm/boot/dts/sun8i-a83t.dtsi         | 16 +++++++++++++++
 drivers/input/touchscreen/edt-ft5x06.c    | 33 +++++++++++++++++++++++++++++++
 3 files changed, 67 insertions(+)

-- 
2.11.0

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

* [PATCH 0/5] sun8i-a83t: Add touchscreen support on TBS A711
@ 2017-12-08 21:54 ` Mylène Josserand
  0 siblings, 0 replies; 33+ messages in thread
From: Mylène Josserand @ 2017-12-08 21:54 UTC (permalink / raw)
  To: linux-arm-kernel

Hello everyone,

This patch series adds touchscreen support (FocalTech EDT-FT5x06
Polytouch) for TBS A711 (Allwinner sun8i-a83t SoC).
This touchscreen is using i2c so this series adds support of this bus
on A83T.

Series information:
   - Based on last linux-next (next-20171208)
   - Had dependencies on AXP209 Quentin Schultz's series:
   https://www.spinics.net/lists/linux-gpio/msg26913.htmlx

Patch 01: Add i2c0 node on a83t device tree.
Patch 02: Add i2c0 pin group.
Patch 03: Enable i2c0 on TBS A711.
Patch 04: Add support for regulator in the FocalTech touchscreen driver
because A711 tablet is using a regulator to power-up the touchscreen.
Patch 05: Add the touchscreen node in A711 TBS tablet.

Thank you in advance for any review.
Best regards,
Myl?ne

Myl?ne Josserand (5):
  arm: dts: sun8i: a83t: Add I2C0 node
  arm: dts: sun8i: a83t: Add I2C0 pins group
  arm: dts: sun8i: a83t: a711: Enable I2C0
  Input: edt-ft5x06 - Add support for regulator
  arm: dts: sun8i: a83t: a711: Add touchscreen node

 arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts | 18 +++++++++++++++++
 arch/arm/boot/dts/sun8i-a83t.dtsi         | 16 +++++++++++++++
 drivers/input/touchscreen/edt-ft5x06.c    | 33 +++++++++++++++++++++++++++++++
 3 files changed, 67 insertions(+)

-- 
2.11.0

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

* [PATCH 1/5] arm: dts: sun8i: a83t: Add I2C0 node
  2017-12-08 21:54 ` Mylène Josserand
@ 2017-12-08 21:54   ` Mylène Josserand
  -1 siblings, 0 replies; 33+ messages in thread
From: Mylène Josserand @ 2017-12-08 21:54 UTC (permalink / raw)
  To: robh+dt, mark.rutland, linux, maxime.ripard, wens,
	dmitry.torokhov, linux-input
  Cc: simon.budig, linux-kernel, devicetree, linux-arm-kernel,
	mylene.josserand, thomas.petazzoni

Add I2C0 node for A83T.

Signed-off-by: Mylène Josserand <mylene.josserand@free-electrons.com>
---
 arch/arm/boot/dts/sun8i-a83t.dtsi | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/arch/arm/boot/dts/sun8i-a83t.dtsi b/arch/arm/boot/dts/sun8i-a83t.dtsi
index 19acae1b4089..848cf3f19962 100644
--- a/arch/arm/boot/dts/sun8i-a83t.dtsi
+++ b/arch/arm/boot/dts/sun8i-a83t.dtsi
@@ -177,6 +177,17 @@
 			#dma-cells = <1>;
 		};
 
+		i2c0: i2c@01c2ac00 {
+			compatible = "allwinner,sun6i-a31-i2c";
+			reg = <0x01c2ac00 0x400>;
+			interrupts = <GIC_SPI 6 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&ccu CLK_BUS_I2C0>;
+			resets = <&ccu RST_BUS_I2C0>;
+			status = "disabled";
+			#address-cells = <1>;
+			#size-cells = <0>;
+		};
+
 		mmc0: mmc@1c0f000 {
 			compatible = "allwinner,sun8i-a83t-mmc",
 				     "allwinner,sun7i-a20-mmc";
-- 
2.11.0

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

* [PATCH 1/5] arm: dts: sun8i: a83t: Add I2C0 node
@ 2017-12-08 21:54   ` Mylène Josserand
  0 siblings, 0 replies; 33+ messages in thread
From: Mylène Josserand @ 2017-12-08 21:54 UTC (permalink / raw)
  To: linux-arm-kernel

Add I2C0 node for A83T.

Signed-off-by: Myl?ne Josserand <mylene.josserand@free-electrons.com>
---
 arch/arm/boot/dts/sun8i-a83t.dtsi | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/arch/arm/boot/dts/sun8i-a83t.dtsi b/arch/arm/boot/dts/sun8i-a83t.dtsi
index 19acae1b4089..848cf3f19962 100644
--- a/arch/arm/boot/dts/sun8i-a83t.dtsi
+++ b/arch/arm/boot/dts/sun8i-a83t.dtsi
@@ -177,6 +177,17 @@
 			#dma-cells = <1>;
 		};
 
+		i2c0: i2c at 01c2ac00 {
+			compatible = "allwinner,sun6i-a31-i2c";
+			reg = <0x01c2ac00 0x400>;
+			interrupts = <GIC_SPI 6 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&ccu CLK_BUS_I2C0>;
+			resets = <&ccu RST_BUS_I2C0>;
+			status = "disabled";
+			#address-cells = <1>;
+			#size-cells = <0>;
+		};
+
 		mmc0: mmc at 1c0f000 {
 			compatible = "allwinner,sun8i-a83t-mmc",
 				     "allwinner,sun7i-a20-mmc";
-- 
2.11.0

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

* [PATCH 2/5] arm: dts: sun8i: a83t: Add I2C0 pins group
  2017-12-08 21:54 ` Mylène Josserand
@ 2017-12-08 21:54   ` Mylène Josserand
  -1 siblings, 0 replies; 33+ messages in thread
From: Mylène Josserand @ 2017-12-08 21:54 UTC (permalink / raw)
  To: robh+dt, mark.rutland, linux, maxime.ripard, wens,
	dmitry.torokhov, linux-input
  Cc: simon.budig, linux-kernel, devicetree, linux-arm-kernel,
	mylene.josserand, thomas.petazzoni

Add pins group to configure it as I2C0.

Signed-off-by: Mylène Josserand <mylene.josserand@free-electrons.com>
---
 arch/arm/boot/dts/sun8i-a83t.dtsi | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/arch/arm/boot/dts/sun8i-a83t.dtsi b/arch/arm/boot/dts/sun8i-a83t.dtsi
index 848cf3f19962..3bce6bd3dc79 100644
--- a/arch/arm/boot/dts/sun8i-a83t.dtsi
+++ b/arch/arm/boot/dts/sun8i-a83t.dtsi
@@ -347,6 +347,11 @@
 			#interrupt-cells = <3>;
 			#gpio-cells = <3>;
 
+			i2c0_pins: i2c0-pins {
+				pins = "PH0", "PH1";
+				function = "i2c0";
+			};
+
 			mmc0_pins: mmc0-pins {
 				pins = "PF0", "PF1", "PF2",
 				       "PF3", "PF4", "PF5";
-- 
2.11.0

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

* [PATCH 2/5] arm: dts: sun8i: a83t: Add I2C0 pins group
@ 2017-12-08 21:54   ` Mylène Josserand
  0 siblings, 0 replies; 33+ messages in thread
From: Mylène Josserand @ 2017-12-08 21:54 UTC (permalink / raw)
  To: linux-arm-kernel

Add pins group to configure it as I2C0.

Signed-off-by: Myl?ne Josserand <mylene.josserand@free-electrons.com>
---
 arch/arm/boot/dts/sun8i-a83t.dtsi | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/arch/arm/boot/dts/sun8i-a83t.dtsi b/arch/arm/boot/dts/sun8i-a83t.dtsi
index 848cf3f19962..3bce6bd3dc79 100644
--- a/arch/arm/boot/dts/sun8i-a83t.dtsi
+++ b/arch/arm/boot/dts/sun8i-a83t.dtsi
@@ -347,6 +347,11 @@
 			#interrupt-cells = <3>;
 			#gpio-cells = <3>;
 
+			i2c0_pins: i2c0-pins {
+				pins = "PH0", "PH1";
+				function = "i2c0";
+			};
+
 			mmc0_pins: mmc0-pins {
 				pins = "PF0", "PF1", "PF2",
 				       "PF3", "PF4", "PF5";
-- 
2.11.0

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

* [PATCH 3/5] arm: dts: sun8i: a83t: a711: Enable I2C0
@ 2017-12-08 21:54   ` Mylène Josserand
  0 siblings, 0 replies; 33+ messages in thread
From: Mylène Josserand @ 2017-12-08 21:54 UTC (permalink / raw)
  To: robh+dt, mark.rutland, linux, maxime.ripard, wens,
	dmitry.torokhov, linux-input
  Cc: simon.budig, linux-kernel, devicetree, linux-arm-kernel,
	mylene.josserand, thomas.petazzoni

The A711 has a touchscreen connected by I2C0.
Enable only I2C0 node for the moment.

Signed-off-by: Mylène Josserand <mylene.josserand@free-electrons.com>
---
 arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts b/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts
index a021ee6da396..84cca1a48cea 100644
--- a/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts
+++ b/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts
@@ -105,6 +105,13 @@
 	status = "okay";
 };
 
+&i2c0 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&i2c0_pins>;
+	clock-frequency = <400000>;
+	status = "okay";
+};
+
 &mmc0 {
 	vmmc-supply = <&reg_dcdc1>;
 	pinctrl-names = "default";
-- 
2.11.0

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

* [PATCH 3/5] arm: dts: sun8i: a83t: a711: Enable I2C0
@ 2017-12-08 21:54   ` Mylène Josserand
  0 siblings, 0 replies; 33+ messages in thread
From: Mylène Josserand @ 2017-12-08 21:54 UTC (permalink / raw)
  To: robh+dt-DgEjT+Ai2ygdnm+yROfE0A, mark.rutland-5wv7dgnIgG8,
	linux-I+IVW8TIWO2tmTQ+vhA3Yw,
	maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8, wens-jdAy2FN1RRM,
	dmitry.torokhov-Re5JQEeQqe8AvxtiuMwx3w,
	linux-input-u79uwXL29TY76Z2rM5mHXA
  Cc: simon.budig-t93Ne7XHvje5bSeCtf/tX7NAH6kLmebB,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	mylene.josserand-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8,
	thomas.petazzoni-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8

The A711 has a touchscreen connected by I2C0.
Enable only I2C0 node for the moment.

Signed-off-by: Mylène Josserand <mylene.josserand-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
---
 arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts b/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts
index a021ee6da396..84cca1a48cea 100644
--- a/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts
+++ b/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts
@@ -105,6 +105,13 @@
 	status = "okay";
 };
 
+&i2c0 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&i2c0_pins>;
+	clock-frequency = <400000>;
+	status = "okay";
+};
+
 &mmc0 {
 	vmmc-supply = <&reg_dcdc1>;
 	pinctrl-names = "default";
-- 
2.11.0

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

* [PATCH 3/5] arm: dts: sun8i: a83t: a711: Enable I2C0
@ 2017-12-08 21:54   ` Mylène Josserand
  0 siblings, 0 replies; 33+ messages in thread
From: Mylène Josserand @ 2017-12-08 21:54 UTC (permalink / raw)
  To: linux-arm-kernel

The A711 has a touchscreen connected by I2C0.
Enable only I2C0 node for the moment.

Signed-off-by: Myl?ne Josserand <mylene.josserand@free-electrons.com>
---
 arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts b/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts
index a021ee6da396..84cca1a48cea 100644
--- a/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts
+++ b/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts
@@ -105,6 +105,13 @@
 	status = "okay";
 };
 
+&i2c0 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&i2c0_pins>;
+	clock-frequency = <400000>;
+	status = "okay";
+};
+
 &mmc0 {
 	vmmc-supply = <&reg_dcdc1>;
 	pinctrl-names = "default";
-- 
2.11.0

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

* [PATCH 4/5] Input: edt-ft5x06 - Add support for regulator
  2017-12-08 21:54 ` Mylène Josserand
@ 2017-12-08 21:54   ` Mylène Josserand
  -1 siblings, 0 replies; 33+ messages in thread
From: Mylène Josserand @ 2017-12-08 21:54 UTC (permalink / raw)
  To: robh+dt, mark.rutland, linux, maxime.ripard, wens,
	dmitry.torokhov, linux-input
  Cc: simon.budig, linux-kernel, devicetree, linux-arm-kernel,
	mylene.josserand, thomas.petazzoni

Add the support of regulator to use them as VCC source.

Signed-off-by: Mylène Josserand <mylene.josserand@free-electrons.com>
---
 drivers/input/touchscreen/edt-ft5x06.c | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/drivers/input/touchscreen/edt-ft5x06.c b/drivers/input/touchscreen/edt-ft5x06.c
index c53a3d7239e7..44b0e04a8f35 100644
--- a/drivers/input/touchscreen/edt-ft5x06.c
+++ b/drivers/input/touchscreen/edt-ft5x06.c
@@ -39,6 +39,7 @@
 #include <linux/input/mt.h>
 #include <linux/input/touchscreen.h>
 #include <linux/of_device.h>
+#include <linux/regulator/consumer.h>
 
 #define WORK_REGISTER_THRESHOLD		0x00
 #define WORK_REGISTER_REPORT_RATE	0x08
@@ -91,6 +92,7 @@ struct edt_ft5x06_ts_data {
 	struct touchscreen_properties prop;
 	u16 num_x;
 	u16 num_y;
+	struct regulator *supply;
 
 	struct gpio_desc *reset_gpio;
 	struct gpio_desc *wake_gpio;
@@ -993,6 +995,23 @@ static int edt_ft5x06_ts_probe(struct i2c_client *client,
 
 	tsdata->max_support_points = chip_data->max_support_points;
 
+	tsdata->supply = devm_regulator_get_optional(&client->dev, "power");
+	if (IS_ERR(tsdata->supply)) {
+		error = PTR_ERR(tsdata->supply);
+		dev_err(&client->dev, "failed to request regulator: %d\n",
+			error);
+		return error;
+	};
+
+	if (tsdata->supply) {
+		error = regulator_enable(tsdata->supply);
+		if (error < 0) {
+			dev_err(&client->dev, "failed to enable supply: %d\n",
+				error);
+			return error;
+		}
+	}
+
 	tsdata->reset_gpio = devm_gpiod_get_optional(&client->dev,
 						     "reset", GPIOD_OUT_HIGH);
 	if (IS_ERR(tsdata->reset_gpio)) {
@@ -1122,20 +1141,34 @@ static int edt_ft5x06_ts_remove(struct i2c_client *client)
 static int __maybe_unused edt_ft5x06_ts_suspend(struct device *dev)
 {
 	struct i2c_client *client = to_i2c_client(dev);
+	struct edt_ft5x06_ts_data *tsdata = i2c_get_clientdata(client);
 
 	if (device_may_wakeup(dev))
 		enable_irq_wake(client->irq);
 
+	if (tsdata->supply)
+		regulator_disable(tsdata->supply);
+
 	return 0;
 }
 
 static int __maybe_unused edt_ft5x06_ts_resume(struct device *dev)
 {
 	struct i2c_client *client = to_i2c_client(dev);
+	struct edt_ft5x06_ts_data *tsdata = i2c_get_clientdata(client);
+	int ret;
 
 	if (device_may_wakeup(dev))
 		disable_irq_wake(client->irq);
 
+	if (tsdata->supply) {
+		ret = regulator_enable(tsdata->supply);
+		if (ret < 0) {
+			dev_err(dev, "failed to enable supply: %d\n", ret);
+			return ret;
+		}
+	}
+
 	return 0;
 }
 
-- 
2.11.0

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

* [PATCH 4/5] Input: edt-ft5x06 - Add support for regulator
@ 2017-12-08 21:54   ` Mylène Josserand
  0 siblings, 0 replies; 33+ messages in thread
From: Mylène Josserand @ 2017-12-08 21:54 UTC (permalink / raw)
  To: linux-arm-kernel

Add the support of regulator to use them as VCC source.

Signed-off-by: Myl?ne Josserand <mylene.josserand@free-electrons.com>
---
 drivers/input/touchscreen/edt-ft5x06.c | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/drivers/input/touchscreen/edt-ft5x06.c b/drivers/input/touchscreen/edt-ft5x06.c
index c53a3d7239e7..44b0e04a8f35 100644
--- a/drivers/input/touchscreen/edt-ft5x06.c
+++ b/drivers/input/touchscreen/edt-ft5x06.c
@@ -39,6 +39,7 @@
 #include <linux/input/mt.h>
 #include <linux/input/touchscreen.h>
 #include <linux/of_device.h>
+#include <linux/regulator/consumer.h>
 
 #define WORK_REGISTER_THRESHOLD		0x00
 #define WORK_REGISTER_REPORT_RATE	0x08
@@ -91,6 +92,7 @@ struct edt_ft5x06_ts_data {
 	struct touchscreen_properties prop;
 	u16 num_x;
 	u16 num_y;
+	struct regulator *supply;
 
 	struct gpio_desc *reset_gpio;
 	struct gpio_desc *wake_gpio;
@@ -993,6 +995,23 @@ static int edt_ft5x06_ts_probe(struct i2c_client *client,
 
 	tsdata->max_support_points = chip_data->max_support_points;
 
+	tsdata->supply = devm_regulator_get_optional(&client->dev, "power");
+	if (IS_ERR(tsdata->supply)) {
+		error = PTR_ERR(tsdata->supply);
+		dev_err(&client->dev, "failed to request regulator: %d\n",
+			error);
+		return error;
+	};
+
+	if (tsdata->supply) {
+		error = regulator_enable(tsdata->supply);
+		if (error < 0) {
+			dev_err(&client->dev, "failed to enable supply: %d\n",
+				error);
+			return error;
+		}
+	}
+
 	tsdata->reset_gpio = devm_gpiod_get_optional(&client->dev,
 						     "reset", GPIOD_OUT_HIGH);
 	if (IS_ERR(tsdata->reset_gpio)) {
@@ -1122,20 +1141,34 @@ static int edt_ft5x06_ts_remove(struct i2c_client *client)
 static int __maybe_unused edt_ft5x06_ts_suspend(struct device *dev)
 {
 	struct i2c_client *client = to_i2c_client(dev);
+	struct edt_ft5x06_ts_data *tsdata = i2c_get_clientdata(client);
 
 	if (device_may_wakeup(dev))
 		enable_irq_wake(client->irq);
 
+	if (tsdata->supply)
+		regulator_disable(tsdata->supply);
+
 	return 0;
 }
 
 static int __maybe_unused edt_ft5x06_ts_resume(struct device *dev)
 {
 	struct i2c_client *client = to_i2c_client(dev);
+	struct edt_ft5x06_ts_data *tsdata = i2c_get_clientdata(client);
+	int ret;
 
 	if (device_may_wakeup(dev))
 		disable_irq_wake(client->irq);
 
+	if (tsdata->supply) {
+		ret = regulator_enable(tsdata->supply);
+		if (ret < 0) {
+			dev_err(dev, "failed to enable supply: %d\n", ret);
+			return ret;
+		}
+	}
+
 	return 0;
 }
 
-- 
2.11.0

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

* [PATCH 5/5] arm: dts: sun8i: a83t: a711: Add touchscreen node
  2017-12-08 21:54 ` Mylène Josserand
@ 2017-12-08 21:54   ` Mylène Josserand
  -1 siblings, 0 replies; 33+ messages in thread
From: Mylène Josserand @ 2017-12-08 21:54 UTC (permalink / raw)
  To: robh+dt, mark.rutland, linux, maxime.ripard, wens,
	dmitry.torokhov, linux-input
  Cc: simon.budig, linux-kernel, devicetree, linux-arm-kernel,
	mylene.josserand, thomas.petazzoni

Tha A711 tablet has a FocalTech EDT-FT5x06 Polytouch touchscreen.
It is connected via I2C0 so add his node in i2c0's node.

The reset line is PD5, the interrupt line is PL7 and the power
supply is the ldo_io0 regulator.

Signed-off-by: Mylène Josserand <mylene.josserand@free-electrons.com>
---
 arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts b/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts
index 84cca1a48cea..738359917a34 100644
--- a/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts
+++ b/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts
@@ -110,6 +110,17 @@
 	pinctrl-0 = <&i2c0_pins>;
 	clock-frequency = <400000>;
 	status = "okay";
+
+	polytouch: edt-ft5x06@38 {
+		compatible = "edt,edt-ft5x06";
+		reg = <0x38>;
+		interrupt-parent = <&r_pio>;
+		interrupts = <0 7 IRQ_TYPE_EDGE_FALLING>;
+		reset-gpios = <&pio 3 5 GPIO_ACTIVE_LOW>;
+		power-supply = <&reg_ldo_io0>;
+		touchscreen-size-x = <1024>;
+		touchscreen-size-y = <600>;
+	};
 };
 
 &mmc0 {
-- 
2.11.0

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

* [PATCH 5/5] arm: dts: sun8i: a83t: a711: Add touchscreen node
@ 2017-12-08 21:54   ` Mylène Josserand
  0 siblings, 0 replies; 33+ messages in thread
From: Mylène Josserand @ 2017-12-08 21:54 UTC (permalink / raw)
  To: linux-arm-kernel

Tha A711 tablet has a FocalTech EDT-FT5x06 Polytouch touchscreen.
It is connected via I2C0 so add his node in i2c0's node.

The reset line is PD5, the interrupt line is PL7 and the power
supply is the ldo_io0 regulator.

Signed-off-by: Myl?ne Josserand <mylene.josserand@free-electrons.com>
---
 arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts b/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts
index 84cca1a48cea..738359917a34 100644
--- a/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts
+++ b/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts
@@ -110,6 +110,17 @@
 	pinctrl-0 = <&i2c0_pins>;
 	clock-frequency = <400000>;
 	status = "okay";
+
+	polytouch: edt-ft5x06 at 38 {
+		compatible = "edt,edt-ft5x06";
+		reg = <0x38>;
+		interrupt-parent = <&r_pio>;
+		interrupts = <0 7 IRQ_TYPE_EDGE_FALLING>;
+		reset-gpios = <&pio 3 5 GPIO_ACTIVE_LOW>;
+		power-supply = <&reg_ldo_io0>;
+		touchscreen-size-x = <1024>;
+		touchscreen-size-y = <600>;
+	};
 };
 
 &mmc0 {
-- 
2.11.0

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

* Re: [PATCH 0/5] sun8i-a83t: Add touchscreen support on TBS A711
@ 2017-12-08 22:01   ` Mylene JOSSERAND
  0 siblings, 0 replies; 33+ messages in thread
From: Mylene JOSSERAND @ 2017-12-08 22:01 UTC (permalink / raw)
  To: robh+dt, mark.rutland, linux, maxime.ripard, wens,
	dmitry.torokhov, linux-input
  Cc: simon.budig, linux-kernel, devicetree, linux-arm-kernel,
	thomas.petazzoni

Hi,

Le Fri,  8 Dec 2017 22:54:14 +0100,
Mylène Josserand <mylene.josserand@free-electrons.com> a écrit :

> Hello everyone,
> 
> This patch series adds touchscreen support (FocalTech EDT-FT5x06
> Polytouch) for TBS A711 (Allwinner sun8i-a83t SoC).
> This touchscreen is using i2c so this series adds support of this bus
> on A83T.
> 
> Series information:
>    - Based on last linux-next (next-20171208)
>    - Had dependencies on AXP209 Quentin Schultz's series:
>    https://www.spinics.net/lists/linux-gpio/msg26913.htmlx

I forgot to mention a dependency on Maxime Ripard's patch that
reinstate AXP813 PMIC:
https://patchwork.kernel.org/patch/10077037/

Thanks,

Mylène

> 
> Patch 01: Add i2c0 node on a83t device tree.
> Patch 02: Add i2c0 pin group.
> Patch 03: Enable i2c0 on TBS A711.
> Patch 04: Add support for regulator in the FocalTech touchscreen
> driver because A711 tablet is using a regulator to power-up the
> touchscreen. Patch 05: Add the touchscreen node in A711 TBS tablet.
> 
> Thank you in advance for any review.
> Best regards,
> Mylène
> 
> Mylène Josserand (5):
>   arm: dts: sun8i: a83t: Add I2C0 node
>   arm: dts: sun8i: a83t: Add I2C0 pins group
>   arm: dts: sun8i: a83t: a711: Enable I2C0
>   Input: edt-ft5x06 - Add support for regulator
>   arm: dts: sun8i: a83t: a711: Add touchscreen node
> 
>  arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts | 18 +++++++++++++++++
>  arch/arm/boot/dts/sun8i-a83t.dtsi         | 16 +++++++++++++++
>  drivers/input/touchscreen/edt-ft5x06.c    | 33
> +++++++++++++++++++++++++++++++ 3 files changed, 67 insertions(+)
> 

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

* Re: [PATCH 0/5] sun8i-a83t: Add touchscreen support on TBS A711
@ 2017-12-08 22:01   ` Mylene JOSSERAND
  0 siblings, 0 replies; 33+ messages in thread
From: Mylene JOSSERAND @ 2017-12-08 22:01 UTC (permalink / raw)
  To: robh+dt-DgEjT+Ai2ygdnm+yROfE0A, mark.rutland-5wv7dgnIgG8,
	linux-I+IVW8TIWO2tmTQ+vhA3Yw,
	maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8, wens-jdAy2FN1RRM,
	dmitry.torokhov-Re5JQEeQqe8AvxtiuMwx3w,
	linux-input-u79uwXL29TY76Z2rM5mHXA
  Cc: simon.budig-t93Ne7XHvje5bSeCtf/tX7NAH6kLmebB,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	thomas.petazzoni-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8

Hi,

Le Fri,  8 Dec 2017 22:54:14 +0100,
Mylène Josserand <mylene.josserand-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org> a écrit :

> Hello everyone,
> 
> This patch series adds touchscreen support (FocalTech EDT-FT5x06
> Polytouch) for TBS A711 (Allwinner sun8i-a83t SoC).
> This touchscreen is using i2c so this series adds support of this bus
> on A83T.
> 
> Series information:
>    - Based on last linux-next (next-20171208)
>    - Had dependencies on AXP209 Quentin Schultz's series:
>    https://www.spinics.net/lists/linux-gpio/msg26913.htmlx

I forgot to mention a dependency on Maxime Ripard's patch that
reinstate AXP813 PMIC:
https://patchwork.kernel.org/patch/10077037/

Thanks,

Mylène

> 
> Patch 01: Add i2c0 node on a83t device tree.
> Patch 02: Add i2c0 pin group.
> Patch 03: Enable i2c0 on TBS A711.
> Patch 04: Add support for regulator in the FocalTech touchscreen
> driver because A711 tablet is using a regulator to power-up the
> touchscreen. Patch 05: Add the touchscreen node in A711 TBS tablet.
> 
> Thank you in advance for any review.
> Best regards,
> Mylène
> 
> Mylène Josserand (5):
>   arm: dts: sun8i: a83t: Add I2C0 node
>   arm: dts: sun8i: a83t: Add I2C0 pins group
>   arm: dts: sun8i: a83t: a711: Enable I2C0
>   Input: edt-ft5x06 - Add support for regulator
>   arm: dts: sun8i: a83t: a711: Add touchscreen node
> 
>  arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts | 18 +++++++++++++++++
>  arch/arm/boot/dts/sun8i-a83t.dtsi         | 16 +++++++++++++++
>  drivers/input/touchscreen/edt-ft5x06.c    | 33
> +++++++++++++++++++++++++++++++ 3 files changed, 67 insertions(+)
> 

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

* [PATCH 0/5] sun8i-a83t: Add touchscreen support on TBS A711
@ 2017-12-08 22:01   ` Mylene JOSSERAND
  0 siblings, 0 replies; 33+ messages in thread
From: Mylene JOSSERAND @ 2017-12-08 22:01 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

Le Fri,  8 Dec 2017 22:54:14 +0100,
Myl?ne Josserand <mylene.josserand@free-electrons.com> a ?crit :

> Hello everyone,
> 
> This patch series adds touchscreen support (FocalTech EDT-FT5x06
> Polytouch) for TBS A711 (Allwinner sun8i-a83t SoC).
> This touchscreen is using i2c so this series adds support of this bus
> on A83T.
> 
> Series information:
>    - Based on last linux-next (next-20171208)
>    - Had dependencies on AXP209 Quentin Schultz's series:
>    https://www.spinics.net/lists/linux-gpio/msg26913.htmlx

I forgot to mention a dependency on Maxime Ripard's patch that
reinstate AXP813 PMIC:
https://patchwork.kernel.org/patch/10077037/

Thanks,

Myl?ne

> 
> Patch 01: Add i2c0 node on a83t device tree.
> Patch 02: Add i2c0 pin group.
> Patch 03: Enable i2c0 on TBS A711.
> Patch 04: Add support for regulator in the FocalTech touchscreen
> driver because A711 tablet is using a regulator to power-up the
> touchscreen. Patch 05: Add the touchscreen node in A711 TBS tablet.
> 
> Thank you in advance for any review.
> Best regards,
> Myl?ne
> 
> Myl?ne Josserand (5):
>   arm: dts: sun8i: a83t: Add I2C0 node
>   arm: dts: sun8i: a83t: Add I2C0 pins group
>   arm: dts: sun8i: a83t: a711: Enable I2C0
>   Input: edt-ft5x06 - Add support for regulator
>   arm: dts: sun8i: a83t: a711: Add touchscreen node
> 
>  arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts | 18 +++++++++++++++++
>  arch/arm/boot/dts/sun8i-a83t.dtsi         | 16 +++++++++++++++
>  drivers/input/touchscreen/edt-ft5x06.c    | 33
> +++++++++++++++++++++++++++++++ 3 files changed, 67 insertions(+)
> 

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

* Re: [PATCH 4/5] Input: edt-ft5x06 - Add support for regulator
@ 2017-12-09  1:16     ` Dmitry Torokhov
  0 siblings, 0 replies; 33+ messages in thread
From: Dmitry Torokhov @ 2017-12-09  1:16 UTC (permalink / raw)
  To: Mylène Josserand
  Cc: robh+dt, mark.rutland, linux, maxime.ripard, wens, linux-input,
	simon.budig, linux-kernel, devicetree, linux-arm-kernel,
	thomas.petazzoni

Hi Mylène,

On Fri, Dec 08, 2017 at 10:54:18PM +0100, Mylène Josserand wrote:
> Add the support of regulator to use them as VCC source.
> 
> Signed-off-by: Mylène Josserand <mylene.josserand@free-electrons.com>
> ---
>  drivers/input/touchscreen/edt-ft5x06.c | 33 +++++++++++++++++++++++++++++++++
>  1 file changed, 33 insertions(+)
> 
> diff --git a/drivers/input/touchscreen/edt-ft5x06.c b/drivers/input/touchscreen/edt-ft5x06.c
> index c53a3d7239e7..44b0e04a8f35 100644
> --- a/drivers/input/touchscreen/edt-ft5x06.c
> +++ b/drivers/input/touchscreen/edt-ft5x06.c
> @@ -39,6 +39,7 @@
>  #include <linux/input/mt.h>
>  #include <linux/input/touchscreen.h>
>  #include <linux/of_device.h>
> +#include <linux/regulator/consumer.h>
>  
>  #define WORK_REGISTER_THRESHOLD		0x00
>  #define WORK_REGISTER_REPORT_RATE	0x08
> @@ -91,6 +92,7 @@ struct edt_ft5x06_ts_data {
>  	struct touchscreen_properties prop;
>  	u16 num_x;
>  	u16 num_y;
> +	struct regulator *supply;
>  
>  	struct gpio_desc *reset_gpio;
>  	struct gpio_desc *wake_gpio;
> @@ -993,6 +995,23 @@ static int edt_ft5x06_ts_probe(struct i2c_client *client,
>  
>  	tsdata->max_support_points = chip_data->max_support_points;
>  
> +	tsdata->supply = devm_regulator_get_optional(&client->dev, "power");

I'd prefer if we used devm_regulator_get() instead. On a
fully-constrained systems a missing regulator will be substituted with a
dummy one that you can then use in regulator_enable() and
regulator_disable(). The _optional regulator API is reserved for cases
where some of chip functionality is optional and you can engage it by
powering up parts of the chip. The reset is not such case: it is always
present, but may not be exposed to the OS to control.

I think the preference is to call the supply by the name is a datasheet,
something like "vcc" or "vdd", etc.

Thanks.

-- 
Dmitry

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

* Re: [PATCH 4/5] Input: edt-ft5x06 - Add support for regulator
@ 2017-12-09  1:16     ` Dmitry Torokhov
  0 siblings, 0 replies; 33+ messages in thread
From: Dmitry Torokhov @ 2017-12-09  1:16 UTC (permalink / raw)
  To: Mylène Josserand
  Cc: robh+dt-DgEjT+Ai2ygdnm+yROfE0A, mark.rutland-5wv7dgnIgG8,
	linux-I+IVW8TIWO2tmTQ+vhA3Yw,
	maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8, wens-jdAy2FN1RRM,
	linux-input-u79uwXL29TY76Z2rM5mHXA,
	simon.budig-t93Ne7XHvje5bSeCtf/tX7NAH6kLmebB,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	thomas.petazzoni-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8

Hi Mylène,

On Fri, Dec 08, 2017 at 10:54:18PM +0100, Mylène Josserand wrote:
> Add the support of regulator to use them as VCC source.
> 
> Signed-off-by: Mylène Josserand <mylene.josserand-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
> ---
>  drivers/input/touchscreen/edt-ft5x06.c | 33 +++++++++++++++++++++++++++++++++
>  1 file changed, 33 insertions(+)
> 
> diff --git a/drivers/input/touchscreen/edt-ft5x06.c b/drivers/input/touchscreen/edt-ft5x06.c
> index c53a3d7239e7..44b0e04a8f35 100644
> --- a/drivers/input/touchscreen/edt-ft5x06.c
> +++ b/drivers/input/touchscreen/edt-ft5x06.c
> @@ -39,6 +39,7 @@
>  #include <linux/input/mt.h>
>  #include <linux/input/touchscreen.h>
>  #include <linux/of_device.h>
> +#include <linux/regulator/consumer.h>
>  
>  #define WORK_REGISTER_THRESHOLD		0x00
>  #define WORK_REGISTER_REPORT_RATE	0x08
> @@ -91,6 +92,7 @@ struct edt_ft5x06_ts_data {
>  	struct touchscreen_properties prop;
>  	u16 num_x;
>  	u16 num_y;
> +	struct regulator *supply;
>  
>  	struct gpio_desc *reset_gpio;
>  	struct gpio_desc *wake_gpio;
> @@ -993,6 +995,23 @@ static int edt_ft5x06_ts_probe(struct i2c_client *client,
>  
>  	tsdata->max_support_points = chip_data->max_support_points;
>  
> +	tsdata->supply = devm_regulator_get_optional(&client->dev, "power");

I'd prefer if we used devm_regulator_get() instead. On a
fully-constrained systems a missing regulator will be substituted with a
dummy one that you can then use in regulator_enable() and
regulator_disable(). The _optional regulator API is reserved for cases
where some of chip functionality is optional and you can engage it by
powering up parts of the chip. The reset is not such case: it is always
present, but may not be exposed to the OS to control.

I think the preference is to call the supply by the name is a datasheet,
something like "vcc" or "vdd", etc.

Thanks.

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

* [PATCH 4/5] Input: edt-ft5x06 - Add support for regulator
@ 2017-12-09  1:16     ` Dmitry Torokhov
  0 siblings, 0 replies; 33+ messages in thread
From: Dmitry Torokhov @ 2017-12-09  1:16 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Myl?ne,

On Fri, Dec 08, 2017 at 10:54:18PM +0100, Myl?ne Josserand wrote:
> Add the support of regulator to use them as VCC source.
> 
> Signed-off-by: Myl?ne Josserand <mylene.josserand@free-electrons.com>
> ---
>  drivers/input/touchscreen/edt-ft5x06.c | 33 +++++++++++++++++++++++++++++++++
>  1 file changed, 33 insertions(+)
> 
> diff --git a/drivers/input/touchscreen/edt-ft5x06.c b/drivers/input/touchscreen/edt-ft5x06.c
> index c53a3d7239e7..44b0e04a8f35 100644
> --- a/drivers/input/touchscreen/edt-ft5x06.c
> +++ b/drivers/input/touchscreen/edt-ft5x06.c
> @@ -39,6 +39,7 @@
>  #include <linux/input/mt.h>
>  #include <linux/input/touchscreen.h>
>  #include <linux/of_device.h>
> +#include <linux/regulator/consumer.h>
>  
>  #define WORK_REGISTER_THRESHOLD		0x00
>  #define WORK_REGISTER_REPORT_RATE	0x08
> @@ -91,6 +92,7 @@ struct edt_ft5x06_ts_data {
>  	struct touchscreen_properties prop;
>  	u16 num_x;
>  	u16 num_y;
> +	struct regulator *supply;
>  
>  	struct gpio_desc *reset_gpio;
>  	struct gpio_desc *wake_gpio;
> @@ -993,6 +995,23 @@ static int edt_ft5x06_ts_probe(struct i2c_client *client,
>  
>  	tsdata->max_support_points = chip_data->max_support_points;
>  
> +	tsdata->supply = devm_regulator_get_optional(&client->dev, "power");

I'd prefer if we used devm_regulator_get() instead. On a
fully-constrained systems a missing regulator will be substituted with a
dummy one that you can then use in regulator_enable() and
regulator_disable(). The _optional regulator API is reserved for cases
where some of chip functionality is optional and you can engage it by
powering up parts of the chip. The reset is not such case: it is always
present, but may not be exposed to the OS to control.

I think the preference is to call the supply by the name is a datasheet,
something like "vcc" or "vdd", etc.

Thanks.

-- 
Dmitry

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

* Re: [PATCH 4/5] Input: edt-ft5x06 - Add support for regulator
  2017-12-09  1:16     ` Dmitry Torokhov
@ 2017-12-09  1:24       ` Dmitry Torokhov
  -1 siblings, 0 replies; 33+ messages in thread
From: Dmitry Torokhov @ 2017-12-09  1:24 UTC (permalink / raw)
  To: Mylène Josserand
  Cc: robh+dt, mark.rutland, linux, maxime.ripard, wens, linux-input,
	simon.budig, linux-kernel, devicetree, linux-arm-kernel,
	thomas.petazzoni

On Fri, Dec 08, 2017 at 05:16:29PM -0800, Dmitry Torokhov wrote:
> Hi Mylène,
> 
> On Fri, Dec 08, 2017 at 10:54:18PM +0100, Mylène Josserand wrote:
> > Add the support of regulator to use them as VCC source.
> > 
> > Signed-off-by: Mylène Josserand <mylene.josserand@free-electrons.com>
> > ---
> >  drivers/input/touchscreen/edt-ft5x06.c | 33 +++++++++++++++++++++++++++++++++
> >  1 file changed, 33 insertions(+)
> > 
> > diff --git a/drivers/input/touchscreen/edt-ft5x06.c b/drivers/input/touchscreen/edt-ft5x06.c
> > index c53a3d7239e7..44b0e04a8f35 100644
> > --- a/drivers/input/touchscreen/edt-ft5x06.c
> > +++ b/drivers/input/touchscreen/edt-ft5x06.c
> > @@ -39,6 +39,7 @@
> >  #include <linux/input/mt.h>
> >  #include <linux/input/touchscreen.h>
> >  #include <linux/of_device.h>
> > +#include <linux/regulator/consumer.h>
> >  
> >  #define WORK_REGISTER_THRESHOLD		0x00
> >  #define WORK_REGISTER_REPORT_RATE	0x08
> > @@ -91,6 +92,7 @@ struct edt_ft5x06_ts_data {
> >  	struct touchscreen_properties prop;
> >  	u16 num_x;
> >  	u16 num_y;
> > +	struct regulator *supply;
> >  
> >  	struct gpio_desc *reset_gpio;
> >  	struct gpio_desc *wake_gpio;
> > @@ -993,6 +995,23 @@ static int edt_ft5x06_ts_probe(struct i2c_client *client,
> >  
> >  	tsdata->max_support_points = chip_data->max_support_points;
> >  
> > +	tsdata->supply = devm_regulator_get_optional(&client->dev, "power");
> 
> I'd prefer if we used devm_regulator_get() instead. On a
> fully-constrained systems a missing regulator will be substituted with a
> dummy one that you can then use in regulator_enable() and
> regulator_disable(). The _optional regulator API is reserved for cases
> where some of chip functionality is optional and you can engage it by
> powering up parts of the chip. The reset is not such case: it is always
> present, but may not be exposed to the OS to control.
> 
> I think the preference is to call the supply by the name is a datasheet,
> something like "vcc" or "vdd", etc.

Looking at this some more, you need to make sure your new regulator
support plays well with reset/wake GPIOs. I.e. you probably want to
properly bring the chip out of reset in edt_ft5x06_ts_resume() and maybe
driver the reset line low in suspend to make sure you do not leak into
the unpowered chip?

Also, please update
Documentation/devicetree/bindings/input/touchscreen/edt-ft5x06.txt with
the additional binding data and cc device tree folks and Rob Herring.

Thanks.

-- 
Dmitry

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

* [PATCH 4/5] Input: edt-ft5x06 - Add support for regulator
@ 2017-12-09  1:24       ` Dmitry Torokhov
  0 siblings, 0 replies; 33+ messages in thread
From: Dmitry Torokhov @ 2017-12-09  1:24 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Dec 08, 2017 at 05:16:29PM -0800, Dmitry Torokhov wrote:
> Hi Myl?ne,
> 
> On Fri, Dec 08, 2017 at 10:54:18PM +0100, Myl?ne Josserand wrote:
> > Add the support of regulator to use them as VCC source.
> > 
> > Signed-off-by: Myl?ne Josserand <mylene.josserand@free-electrons.com>
> > ---
> >  drivers/input/touchscreen/edt-ft5x06.c | 33 +++++++++++++++++++++++++++++++++
> >  1 file changed, 33 insertions(+)
> > 
> > diff --git a/drivers/input/touchscreen/edt-ft5x06.c b/drivers/input/touchscreen/edt-ft5x06.c
> > index c53a3d7239e7..44b0e04a8f35 100644
> > --- a/drivers/input/touchscreen/edt-ft5x06.c
> > +++ b/drivers/input/touchscreen/edt-ft5x06.c
> > @@ -39,6 +39,7 @@
> >  #include <linux/input/mt.h>
> >  #include <linux/input/touchscreen.h>
> >  #include <linux/of_device.h>
> > +#include <linux/regulator/consumer.h>
> >  
> >  #define WORK_REGISTER_THRESHOLD		0x00
> >  #define WORK_REGISTER_REPORT_RATE	0x08
> > @@ -91,6 +92,7 @@ struct edt_ft5x06_ts_data {
> >  	struct touchscreen_properties prop;
> >  	u16 num_x;
> >  	u16 num_y;
> > +	struct regulator *supply;
> >  
> >  	struct gpio_desc *reset_gpio;
> >  	struct gpio_desc *wake_gpio;
> > @@ -993,6 +995,23 @@ static int edt_ft5x06_ts_probe(struct i2c_client *client,
> >  
> >  	tsdata->max_support_points = chip_data->max_support_points;
> >  
> > +	tsdata->supply = devm_regulator_get_optional(&client->dev, "power");
> 
> I'd prefer if we used devm_regulator_get() instead. On a
> fully-constrained systems a missing regulator will be substituted with a
> dummy one that you can then use in regulator_enable() and
> regulator_disable(). The _optional regulator API is reserved for cases
> where some of chip functionality is optional and you can engage it by
> powering up parts of the chip. The reset is not such case: it is always
> present, but may not be exposed to the OS to control.
> 
> I think the preference is to call the supply by the name is a datasheet,
> something like "vcc" or "vdd", etc.

Looking at this some more, you need to make sure your new regulator
support plays well with reset/wake GPIOs. I.e. you probably want to
properly bring the chip out of reset in edt_ft5x06_ts_resume() and maybe
driver the reset line low in suspend to make sure you do not leak into
the unpowered chip?

Also, please update
Documentation/devicetree/bindings/input/touchscreen/edt-ft5x06.txt with
the additional binding data and cc device tree folks and Rob Herring.

Thanks.

-- 
Dmitry

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

* Re: [PATCH 1/5] arm: dts: sun8i: a83t: Add I2C0 node
@ 2017-12-11  7:15     ` Maxime Ripard
  0 siblings, 0 replies; 33+ messages in thread
From: Maxime Ripard @ 2017-12-11  7:15 UTC (permalink / raw)
  To: Mylène Josserand
  Cc: robh+dt, mark.rutland, linux, wens, dmitry.torokhov, linux-input,
	simon.budig, linux-kernel, devicetree, linux-arm-kernel,
	thomas.petazzoni

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

Hi,

On Fri, Dec 08, 2017 at 10:54:15PM +0100, Mylène Josserand wrote:
> Add I2C0 node for A83T.
> 
> Signed-off-by: Mylène Josserand <mylene.josserand@free-electrons.com>
> ---
>  arch/arm/boot/dts/sun8i-a83t.dtsi | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/sun8i-a83t.dtsi b/arch/arm/boot/dts/sun8i-a83t.dtsi
> index 19acae1b4089..848cf3f19962 100644
> --- a/arch/arm/boot/dts/sun8i-a83t.dtsi
> +++ b/arch/arm/boot/dts/sun8i-a83t.dtsi
> @@ -177,6 +177,17 @@
>  			#dma-cells = <1>;
>  		};
>  
> +		i2c0: i2c@01c2ac00 {

Drop the leading 0, it generates a warning in dtc.

> +			compatible = "allwinner,sun6i-a31-i2c";

Can you add a SoC-specific compatible there please?

> +			reg = <0x01c2ac00 0x400>;

And you should order your nodes by physical address.

Thanks!
Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

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

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

* Re: [PATCH 1/5] arm: dts: sun8i: a83t: Add I2C0 node
@ 2017-12-11  7:15     ` Maxime Ripard
  0 siblings, 0 replies; 33+ messages in thread
From: Maxime Ripard @ 2017-12-11  7:15 UTC (permalink / raw)
  To: Mylène Josserand
  Cc: robh+dt-DgEjT+Ai2ygdnm+yROfE0A, mark.rutland-5wv7dgnIgG8,
	linux-I+IVW8TIWO2tmTQ+vhA3Yw, wens-jdAy2FN1RRM,
	dmitry.torokhov-Re5JQEeQqe8AvxtiuMwx3w,
	linux-input-u79uwXL29TY76Z2rM5mHXA,
	simon.budig-t93Ne7XHvje5bSeCtf/tX7NAH6kLmebB,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	thomas.petazzoni-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8

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

Hi,

On Fri, Dec 08, 2017 at 10:54:15PM +0100, Mylène Josserand wrote:
> Add I2C0 node for A83T.
> 
> Signed-off-by: Mylène Josserand <mylene.josserand-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
> ---
>  arch/arm/boot/dts/sun8i-a83t.dtsi | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/sun8i-a83t.dtsi b/arch/arm/boot/dts/sun8i-a83t.dtsi
> index 19acae1b4089..848cf3f19962 100644
> --- a/arch/arm/boot/dts/sun8i-a83t.dtsi
> +++ b/arch/arm/boot/dts/sun8i-a83t.dtsi
> @@ -177,6 +177,17 @@
>  			#dma-cells = <1>;
>  		};
>  
> +		i2c0: i2c@01c2ac00 {

Drop the leading 0, it generates a warning in dtc.

> +			compatible = "allwinner,sun6i-a31-i2c";

Can you add a SoC-specific compatible there please?

> +			reg = <0x01c2ac00 0x400>;

And you should order your nodes by physical address.

Thanks!
Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

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

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

* [PATCH 1/5] arm: dts: sun8i: a83t: Add I2C0 node
@ 2017-12-11  7:15     ` Maxime Ripard
  0 siblings, 0 replies; 33+ messages in thread
From: Maxime Ripard @ 2017-12-11  7:15 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

On Fri, Dec 08, 2017 at 10:54:15PM +0100, Myl?ne Josserand wrote:
> Add I2C0 node for A83T.
> 
> Signed-off-by: Myl?ne Josserand <mylene.josserand@free-electrons.com>
> ---
>  arch/arm/boot/dts/sun8i-a83t.dtsi | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/sun8i-a83t.dtsi b/arch/arm/boot/dts/sun8i-a83t.dtsi
> index 19acae1b4089..848cf3f19962 100644
> --- a/arch/arm/boot/dts/sun8i-a83t.dtsi
> +++ b/arch/arm/boot/dts/sun8i-a83t.dtsi
> @@ -177,6 +177,17 @@
>  			#dma-cells = <1>;
>  		};
>  
> +		i2c0: i2c at 01c2ac00 {

Drop the leading 0, it generates a warning in dtc.

> +			compatible = "allwinner,sun6i-a31-i2c";

Can you add a SoC-specific compatible there please?

> +			reg = <0x01c2ac00 0x400>;

And you should order your nodes by physical address.

Thanks!
Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20171211/14d2f804/attachment.sig>

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

* Re: [PATCH 5/5] arm: dts: sun8i: a83t: a711: Add touchscreen node
@ 2017-12-11  7:16     ` Maxime Ripard
  0 siblings, 0 replies; 33+ messages in thread
From: Maxime Ripard @ 2017-12-11  7:16 UTC (permalink / raw)
  To: Mylène Josserand
  Cc: robh+dt, mark.rutland, linux, wens, dmitry.torokhov, linux-input,
	simon.budig, linux-kernel, devicetree, linux-arm-kernel,
	thomas.petazzoni

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

Hi,

On Fri, Dec 08, 2017 at 10:54:19PM +0100, Mylène Josserand wrote:
> Tha A711 tablet has a FocalTech EDT-FT5x06 Polytouch touchscreen.
> It is connected via I2C0 so add his node in i2c0's node.
> 
> The reset line is PD5, the interrupt line is PL7 and the power
> supply is the ldo_io0 regulator.
> 
> Signed-off-by: Mylène Josserand <mylene.josserand@free-electrons.com>
> ---
>  arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts b/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts
> index 84cca1a48cea..738359917a34 100644
> --- a/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts
> +++ b/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts
> @@ -110,6 +110,17 @@
>  	pinctrl-0 = <&i2c0_pins>;
>  	clock-frequency = <400000>;
>  	status = "okay";
> +
> +	polytouch: edt-ft5x06@38 {

You're not using that label anywhere, so you can drop it, and the node
name must be the class of the device.

Thanks!
Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

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

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

* Re: [PATCH 5/5] arm: dts: sun8i: a83t: a711: Add touchscreen node
@ 2017-12-11  7:16     ` Maxime Ripard
  0 siblings, 0 replies; 33+ messages in thread
From: Maxime Ripard @ 2017-12-11  7:16 UTC (permalink / raw)
  To: Mylène Josserand
  Cc: robh+dt-DgEjT+Ai2ygdnm+yROfE0A, mark.rutland-5wv7dgnIgG8,
	linux-I+IVW8TIWO2tmTQ+vhA3Yw, wens-jdAy2FN1RRM,
	dmitry.torokhov-Re5JQEeQqe8AvxtiuMwx3w,
	linux-input-u79uwXL29TY76Z2rM5mHXA,
	simon.budig-t93Ne7XHvje5bSeCtf/tX7NAH6kLmebB,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	thomas.petazzoni-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8

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

Hi,

On Fri, Dec 08, 2017 at 10:54:19PM +0100, Mylène Josserand wrote:
> Tha A711 tablet has a FocalTech EDT-FT5x06 Polytouch touchscreen.
> It is connected via I2C0 so add his node in i2c0's node.
> 
> The reset line is PD5, the interrupt line is PL7 and the power
> supply is the ldo_io0 regulator.
> 
> Signed-off-by: Mylène Josserand <mylene.josserand-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
> ---
>  arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts b/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts
> index 84cca1a48cea..738359917a34 100644
> --- a/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts
> +++ b/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts
> @@ -110,6 +110,17 @@
>  	pinctrl-0 = <&i2c0_pins>;
>  	clock-frequency = <400000>;
>  	status = "okay";
> +
> +	polytouch: edt-ft5x06@38 {

You're not using that label anywhere, so you can drop it, and the node
name must be the class of the device.

Thanks!
Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

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

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

* [PATCH 5/5] arm: dts: sun8i: a83t: a711: Add touchscreen node
@ 2017-12-11  7:16     ` Maxime Ripard
  0 siblings, 0 replies; 33+ messages in thread
From: Maxime Ripard @ 2017-12-11  7:16 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

On Fri, Dec 08, 2017 at 10:54:19PM +0100, Myl?ne Josserand wrote:
> Tha A711 tablet has a FocalTech EDT-FT5x06 Polytouch touchscreen.
> It is connected via I2C0 so add his node in i2c0's node.
> 
> The reset line is PD5, the interrupt line is PL7 and the power
> supply is the ldo_io0 regulator.
> 
> Signed-off-by: Myl?ne Josserand <mylene.josserand@free-electrons.com>
> ---
>  arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts b/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts
> index 84cca1a48cea..738359917a34 100644
> --- a/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts
> +++ b/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts
> @@ -110,6 +110,17 @@
>  	pinctrl-0 = <&i2c0_pins>;
>  	clock-frequency = <400000>;
>  	status = "okay";
> +
> +	polytouch: edt-ft5x06 at 38 {

You're not using that label anywhere, so you can drop it, and the node
name must be the class of the device.

Thanks!
Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20171211/fc3bc50e/attachment-0001.sig>

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

* Re: [PATCH 3/5] arm: dts: sun8i: a83t: a711: Enable I2C0
  2017-12-08 21:54   ` Mylène Josserand
@ 2017-12-11  7:18     ` Maxime Ripard
  -1 siblings, 0 replies; 33+ messages in thread
From: Maxime Ripard @ 2017-12-11  7:18 UTC (permalink / raw)
  To: Mylène Josserand
  Cc: robh+dt, mark.rutland, linux, wens, dmitry.torokhov, linux-input,
	simon.budig, linux-kernel, devicetree, linux-arm-kernel,
	thomas.petazzoni

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

Hi,

On Fri, Dec 08, 2017 at 10:54:17PM +0100, Mylène Josserand wrote:
> The A711 has a touchscreen connected by I2C0.
> Enable only I2C0 node for the moment.
> 
> Signed-off-by: Mylène Josserand <mylene.josserand@free-electrons.com>
> ---
>  arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts b/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts
> index a021ee6da396..84cca1a48cea 100644
> --- a/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts
> +++ b/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts
> @@ -105,6 +105,13 @@
>  	status = "okay";
>  };
>  
> +&i2c0 {
> +	pinctrl-names = "default";
> +	pinctrl-0 = <&i2c0_pins>;

If there's only one set of pins, maybe we should force that muxing in
the DTSI?

Thanks!
Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

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

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

* [PATCH 3/5] arm: dts: sun8i: a83t: a711: Enable I2C0
@ 2017-12-11  7:18     ` Maxime Ripard
  0 siblings, 0 replies; 33+ messages in thread
From: Maxime Ripard @ 2017-12-11  7:18 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

On Fri, Dec 08, 2017 at 10:54:17PM +0100, Myl?ne Josserand wrote:
> The A711 has a touchscreen connected by I2C0.
> Enable only I2C0 node for the moment.
> 
> Signed-off-by: Myl?ne Josserand <mylene.josserand@free-electrons.com>
> ---
>  arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts b/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts
> index a021ee6da396..84cca1a48cea 100644
> --- a/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts
> +++ b/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts
> @@ -105,6 +105,13 @@
>  	status = "okay";
>  };
>  
> +&i2c0 {
> +	pinctrl-names = "default";
> +	pinctrl-0 = <&i2c0_pins>;

If there's only one set of pins, maybe we should force that muxing in
the DTSI?

Thanks!
Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20171211/3d651804/attachment.sig>

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

* Re: [PATCH 1/5] arm: dts: sun8i: a83t: Add I2C0 node
@ 2017-12-11  8:31       ` Chen-Yu Tsai
  0 siblings, 0 replies; 33+ messages in thread
From: Chen-Yu Tsai @ 2017-12-11  8:31 UTC (permalink / raw)
  To: Maxime Ripard
  Cc: Mylène Josserand, Rob Herring, Mark Rutland, Russell King,
	Chen-Yu Tsai, Dmitry Torokhov, linux-input, simon.budig,
	linux-kernel, devicetree, linux-arm-kernel, Thomas Petazzoni

On Mon, Dec 11, 2017 at 3:15 PM, Maxime Ripard
<maxime.ripard@free-electrons.com> wrote:
> Hi,
>
> On Fri, Dec 08, 2017 at 10:54:15PM +0100, Mylène Josserand wrote:
>> Add I2C0 node for A83T.
>>
>> Signed-off-by: Mylène Josserand <mylene.josserand@free-electrons.com>
>> ---
>>  arch/arm/boot/dts/sun8i-a83t.dtsi | 11 +++++++++++
>>  1 file changed, 11 insertions(+)
>>
>> diff --git a/arch/arm/boot/dts/sun8i-a83t.dtsi b/arch/arm/boot/dts/sun8i-a83t.dtsi
>> index 19acae1b4089..848cf3f19962 100644
>> --- a/arch/arm/boot/dts/sun8i-a83t.dtsi
>> +++ b/arch/arm/boot/dts/sun8i-a83t.dtsi
>> @@ -177,6 +177,17 @@
>>                       #dma-cells = <1>;
>>               };
>>
>> +             i2c0: i2c@01c2ac00 {
>
> Drop the leading 0, it generates a warning in dtc.
>
>> +                     compatible = "allwinner,sun6i-a31-i2c";
>
> Can you add a SoC-specific compatible there please?
>
>> +                     reg = <0x01c2ac00 0x400>;
>
> And you should order your nodes by physical address.

I have a similar patch in my A83T I2S branch:

https://github.com/wens/linux/commit/8b76a3e555b39a06f3f8182e4ff5645de4c4cbc3

ChenYu

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

* Re: [PATCH 1/5] arm: dts: sun8i: a83t: Add I2C0 node
@ 2017-12-11  8:31       ` Chen-Yu Tsai
  0 siblings, 0 replies; 33+ messages in thread
From: Chen-Yu Tsai @ 2017-12-11  8:31 UTC (permalink / raw)
  To: Maxime Ripard
  Cc: Mylène Josserand, Rob Herring, Mark Rutland, Russell King,
	Chen-Yu Tsai, Dmitry Torokhov,
	linux-input-u79uwXL29TY76Z2rM5mHXA,
	simon.budig-t93Ne7XHvje5bSeCtf/tX7NAH6kLmebB, linux-kernel,
	devicetree, linux-arm-kernel, Thomas Petazzoni

On Mon, Dec 11, 2017 at 3:15 PM, Maxime Ripard
<maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org> wrote:
> Hi,
>
> On Fri, Dec 08, 2017 at 10:54:15PM +0100, Mylène Josserand wrote:
>> Add I2C0 node for A83T.
>>
>> Signed-off-by: Mylène Josserand <mylene.josserand-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
>> ---
>>  arch/arm/boot/dts/sun8i-a83t.dtsi | 11 +++++++++++
>>  1 file changed, 11 insertions(+)
>>
>> diff --git a/arch/arm/boot/dts/sun8i-a83t.dtsi b/arch/arm/boot/dts/sun8i-a83t.dtsi
>> index 19acae1b4089..848cf3f19962 100644
>> --- a/arch/arm/boot/dts/sun8i-a83t.dtsi
>> +++ b/arch/arm/boot/dts/sun8i-a83t.dtsi
>> @@ -177,6 +177,17 @@
>>                       #dma-cells = <1>;
>>               };
>>
>> +             i2c0: i2c@01c2ac00 {
>
> Drop the leading 0, it generates a warning in dtc.
>
>> +                     compatible = "allwinner,sun6i-a31-i2c";
>
> Can you add a SoC-specific compatible there please?
>
>> +                     reg = <0x01c2ac00 0x400>;
>
> And you should order your nodes by physical address.

I have a similar patch in my A83T I2S branch:

https://github.com/wens/linux/commit/8b76a3e555b39a06f3f8182e4ff5645de4c4cbc3

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

* [PATCH 1/5] arm: dts: sun8i: a83t: Add I2C0 node
@ 2017-12-11  8:31       ` Chen-Yu Tsai
  0 siblings, 0 replies; 33+ messages in thread
From: Chen-Yu Tsai @ 2017-12-11  8:31 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Dec 11, 2017 at 3:15 PM, Maxime Ripard
<maxime.ripard@free-electrons.com> wrote:
> Hi,
>
> On Fri, Dec 08, 2017 at 10:54:15PM +0100, Myl?ne Josserand wrote:
>> Add I2C0 node for A83T.
>>
>> Signed-off-by: Myl?ne Josserand <mylene.josserand@free-electrons.com>
>> ---
>>  arch/arm/boot/dts/sun8i-a83t.dtsi | 11 +++++++++++
>>  1 file changed, 11 insertions(+)
>>
>> diff --git a/arch/arm/boot/dts/sun8i-a83t.dtsi b/arch/arm/boot/dts/sun8i-a83t.dtsi
>> index 19acae1b4089..848cf3f19962 100644
>> --- a/arch/arm/boot/dts/sun8i-a83t.dtsi
>> +++ b/arch/arm/boot/dts/sun8i-a83t.dtsi
>> @@ -177,6 +177,17 @@
>>                       #dma-cells = <1>;
>>               };
>>
>> +             i2c0: i2c at 01c2ac00 {
>
> Drop the leading 0, it generates a warning in dtc.
>
>> +                     compatible = "allwinner,sun6i-a31-i2c";
>
> Can you add a SoC-specific compatible there please?
>
>> +                     reg = <0x01c2ac00 0x400>;
>
> And you should order your nodes by physical address.

I have a similar patch in my A83T I2S branch:

https://github.com/wens/linux/commit/8b76a3e555b39a06f3f8182e4ff5645de4c4cbc3

ChenYu

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

end of thread, other threads:[~2017-12-11  8:31 UTC | newest]

Thread overview: 33+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-08 21:54 [PATCH 0/5] sun8i-a83t: Add touchscreen support on TBS A711 Mylène Josserand
2017-12-08 21:54 ` Mylène Josserand
2017-12-08 21:54 ` Mylène Josserand
2017-12-08 21:54 ` [PATCH 1/5] arm: dts: sun8i: a83t: Add I2C0 node Mylène Josserand
2017-12-08 21:54   ` Mylène Josserand
2017-12-11  7:15   ` Maxime Ripard
2017-12-11  7:15     ` Maxime Ripard
2017-12-11  7:15     ` Maxime Ripard
2017-12-11  8:31     ` Chen-Yu Tsai
2017-12-11  8:31       ` Chen-Yu Tsai
2017-12-11  8:31       ` Chen-Yu Tsai
2017-12-08 21:54 ` [PATCH 2/5] arm: dts: sun8i: a83t: Add I2C0 pins group Mylène Josserand
2017-12-08 21:54   ` Mylène Josserand
2017-12-08 21:54 ` [PATCH 3/5] arm: dts: sun8i: a83t: a711: Enable I2C0 Mylène Josserand
2017-12-08 21:54   ` Mylène Josserand
2017-12-08 21:54   ` Mylène Josserand
2017-12-11  7:18   ` Maxime Ripard
2017-12-11  7:18     ` Maxime Ripard
2017-12-08 21:54 ` [PATCH 4/5] Input: edt-ft5x06 - Add support for regulator Mylène Josserand
2017-12-08 21:54   ` Mylène Josserand
2017-12-09  1:16   ` Dmitry Torokhov
2017-12-09  1:16     ` Dmitry Torokhov
2017-12-09  1:16     ` Dmitry Torokhov
2017-12-09  1:24     ` Dmitry Torokhov
2017-12-09  1:24       ` Dmitry Torokhov
2017-12-08 21:54 ` [PATCH 5/5] arm: dts: sun8i: a83t: a711: Add touchscreen node Mylène Josserand
2017-12-08 21:54   ` Mylène Josserand
2017-12-11  7:16   ` Maxime Ripard
2017-12-11  7:16     ` Maxime Ripard
2017-12-11  7:16     ` Maxime Ripard
2017-12-08 22:01 ` [PATCH 0/5] sun8i-a83t: Add touchscreen support on TBS A711 Mylene JOSSERAND
2017-12-08 22:01   ` Mylene JOSSERAND
2017-12-08 22:01   ` Mylene JOSSERAND

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.