All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/4] input: touchscreen: Add goodix GT5553 CTP support
@ 2018-12-15 15:17 Jagan Teki
  2018-12-15 15:17 ` [PATCH v3 1/4] dt-bindings: input: touchscreen: goodix: Document AVDD28-supply property Jagan Teki
                   ` (4 more replies)
  0 siblings, 5 replies; 23+ messages in thread
From: Jagan Teki @ 2018-12-15 15:17 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: Chen-Yu Tsai, linux-input, linux-kernel, Michael Trimarchi,
	linux-amarula, Jagan Teki

This patchset support goodix GT5553 CTP.

Changes for v3:
- add cover-letter
- s/ADVV28/AVDD28 on commit head
- fix few typo
Changes for v2:
- Rename vcc-supply with AVDD28-supply
- disable regulator in remove
- fix to setup regulator in probe code
- add chipdata
- drop example node in dt-bindings

Jagan Teki (4):
  dt-bindings: input: touchscreen: goodix: Document AVDD28-supply
    property
  Input: goodix - Add AVDD28-supply regulator support
  dt-bindings: input: touchscreen: goodix: Add GT5663 compatible
  Input: goodix - Add GT5663 CTP support

 .../bindings/input/touchscreen/goodix.txt     |  2 ++
 drivers/input/touchscreen/goodix.c            | 35 ++++++++++++++++---
 2 files changed, 32 insertions(+), 5 deletions(-)

-- 
2.18.0.321.gffc6fa0e3


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

* [PATCH v3 1/4] dt-bindings: input: touchscreen: goodix: Document AVDD28-supply property
  2018-12-15 15:17 [PATCH v3 0/4] input: touchscreen: Add goodix GT5553 CTP support Jagan Teki
@ 2018-12-15 15:17 ` Jagan Teki
  2019-01-07 22:58   ` Dmitry Torokhov
  2018-12-15 15:18 ` [PATCH v3 2/4] Input: goodix - Add AVDD28-supply regulator support Jagan Teki
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 23+ messages in thread
From: Jagan Teki @ 2018-12-15 15:17 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: Chen-Yu Tsai, linux-input, linux-kernel, Michael Trimarchi,
	linux-amarula, Jagan Teki

Most of the Goodix CTP controllers are supply with AVDD28 pin.
which need to supply for controllers like GT5663 on some boards
to trigger the power.

So, document the supply property so-that the require boards
that used on GT5663 can enable it via device tree.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
---
 Documentation/devicetree/bindings/input/touchscreen/goodix.txt | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/input/touchscreen/goodix.txt b/Documentation/devicetree/bindings/input/touchscreen/goodix.txt
index f7e95c52f3c7..c4622c983e08 100644
--- a/Documentation/devicetree/bindings/input/touchscreen/goodix.txt
+++ b/Documentation/devicetree/bindings/input/touchscreen/goodix.txt
@@ -23,6 +23,7 @@ Optional properties:
  - touchscreen-inverted-y  : Y axis is inverted (boolean)
  - touchscreen-swapped-x-y : X and Y axis are swapped (boolean)
                              (swapping is done after inverting the axis)
+ - AVDD28-supply	: Analog power supply regulator on AVDD28 pin
 
 Example:
 
-- 
2.18.0.321.gffc6fa0e3


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

* [PATCH v3 2/4] Input: goodix - Add AVDD28-supply regulator support
  2018-12-15 15:17 [PATCH v3 0/4] input: touchscreen: Add goodix GT5553 CTP support Jagan Teki
  2018-12-15 15:17 ` [PATCH v3 1/4] dt-bindings: input: touchscreen: goodix: Document AVDD28-supply property Jagan Teki
@ 2018-12-15 15:18 ` Jagan Teki
  2019-01-07 23:00   ` Dmitry Torokhov
  2018-12-15 15:18 ` [PATCH v3 3/4] dt-bindings: input: touchscreen: goodix: Add GT5663 compatible Jagan Teki
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 23+ messages in thread
From: Jagan Teki @ 2018-12-15 15:18 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: Chen-Yu Tsai, linux-input, linux-kernel, Michael Trimarchi,
	linux-amarula, Jagan Teki

Goodix CTP controllers have AVDD28 pin connected to voltage
regulator which may not be turned on by default, like for GT5663.

Add support for such ctp used boards by adding voltage regulator
handling code to goodix ctp driver.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
---
 drivers/input/touchscreen/goodix.c | 33 +++++++++++++++++++++++++-----
 1 file changed, 28 insertions(+), 5 deletions(-)

diff --git a/drivers/input/touchscreen/goodix.c b/drivers/input/touchscreen/goodix.c
index f2d9c2c41885..7371f6946098 100644
--- a/drivers/input/touchscreen/goodix.c
+++ b/drivers/input/touchscreen/goodix.c
@@ -27,6 +27,7 @@
 #include <linux/delay.h>
 #include <linux/irq.h>
 #include <linux/interrupt.h>
+#include <linux/regulator/consumer.h>
 #include <linux/slab.h>
 #include <linux/acpi.h>
 #include <linux/of.h>
@@ -47,6 +48,7 @@ struct goodix_ts_data {
 	struct touchscreen_properties prop;
 	unsigned int max_touch_num;
 	unsigned int int_trigger_type;
+	struct regulator *avdd28;
 	struct gpio_desc *gpiod_int;
 	struct gpio_desc *gpiod_rst;
 	u16 id;
@@ -786,25 +788,41 @@ static int goodix_ts_probe(struct i2c_client *client,
 	if (error)
 		return error;
 
+	ts->avdd28 = devm_regulator_get(&client->dev, "AVDD28");
+	if (IS_ERR(ts->avdd28)) {
+		error = PTR_ERR(ts->avdd28);
+		if (error != -EPROBE_DEFER)
+			dev_err(&client->dev,
+				"Failed to get AVDD28 regulator: %d\n", error);
+		return error;
+	}
+
+	/* power the controller */
+	error = regulator_enable(ts->avdd28);
+	if (error) {
+		dev_err(&client->dev, "Controller fail to enable AVDD28\n");
+		return error;
+	}
+
 	if (ts->gpiod_int && ts->gpiod_rst) {
 		/* reset the controller */
 		error = goodix_reset(ts);
 		if (error) {
 			dev_err(&client->dev, "Controller reset failed.\n");
-			return error;
+			goto error;
 		}
 	}
 
 	error = goodix_i2c_test(client);
 	if (error) {
 		dev_err(&client->dev, "I2C communication failure: %d\n", error);
-		return error;
+		goto error;
 	}
 
 	error = goodix_read_version(ts);
 	if (error) {
 		dev_err(&client->dev, "Read version failed.\n");
-		return error;
+		goto error;
 	}
 
 	ts->chip = goodix_get_chip_data(ts->id);
@@ -823,23 +841,28 @@ static int goodix_ts_probe(struct i2c_client *client,
 			dev_err(&client->dev,
 				"Failed to invoke firmware loader: %d\n",
 				error);
-			return error;
+			goto error;
 		}
 
 		return 0;
 	} else {
 		error = goodix_configure_dev(ts);
 		if (error)
-			return error;
+			goto error;
 	}
 
 	return 0;
+
+error:
+	regulator_disable(ts->avdd28);
+	return error;
 }
 
 static int goodix_ts_remove(struct i2c_client *client)
 {
 	struct goodix_ts_data *ts = i2c_get_clientdata(client);
 
+	regulator_disable(ts->avdd28);
 	if (ts->gpiod_int && ts->gpiod_rst)
 		wait_for_completion(&ts->firmware_loading_complete);
 
-- 
2.18.0.321.gffc6fa0e3


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

* [PATCH v3 3/4] dt-bindings: input: touchscreen: goodix: Add GT5663 compatible
  2018-12-15 15:17 [PATCH v3 0/4] input: touchscreen: Add goodix GT5553 CTP support Jagan Teki
  2018-12-15 15:17 ` [PATCH v3 1/4] dt-bindings: input: touchscreen: goodix: Document AVDD28-supply property Jagan Teki
  2018-12-15 15:18 ` [PATCH v3 2/4] Input: goodix - Add AVDD28-supply regulator support Jagan Teki
@ 2018-12-15 15:18 ` Jagan Teki
  2018-12-15 15:18 ` [PATCH v3 4/4] Input: goodix - Add GT5663 CTP support Jagan Teki
  2019-01-06 16:38 ` [PATCH v3 0/4] input: touchscreen: Add goodix GT5553 " Jagan Teki
  4 siblings, 0 replies; 23+ messages in thread
From: Jagan Teki @ 2018-12-15 15:18 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: Chen-Yu Tsai, linux-input, linux-kernel, Michael Trimarchi,
	linux-amarula, Jagan Teki

GT5663 is capacitive touch controller with customized smart
wakeup gestures, it support chipdata which is similar to
existing GT1151 and require AVDD28 supply for some boards.

Document the compatible for the same.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
---
 Documentation/devicetree/bindings/input/touchscreen/goodix.txt | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/input/touchscreen/goodix.txt b/Documentation/devicetree/bindings/input/touchscreen/goodix.txt
index c4622c983e08..59c89276e6bb 100644
--- a/Documentation/devicetree/bindings/input/touchscreen/goodix.txt
+++ b/Documentation/devicetree/bindings/input/touchscreen/goodix.txt
@@ -3,6 +3,7 @@ Device tree bindings for Goodix GT9xx series touchscreen controller
 Required properties:
 
  - compatible		: Should be "goodix,gt1151"
+				 or "goodix,gt5663"
 				 or "goodix,gt911"
 				 or "goodix,gt9110"
 				 or "goodix,gt912"
-- 
2.18.0.321.gffc6fa0e3


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

* [PATCH v3 4/4] Input: goodix - Add GT5663 CTP support
  2018-12-15 15:17 [PATCH v3 0/4] input: touchscreen: Add goodix GT5553 CTP support Jagan Teki
                   ` (2 preceding siblings ...)
  2018-12-15 15:18 ` [PATCH v3 3/4] dt-bindings: input: touchscreen: goodix: Add GT5663 compatible Jagan Teki
@ 2018-12-15 15:18 ` Jagan Teki
  2019-01-06 16:38 ` [PATCH v3 0/4] input: touchscreen: Add goodix GT5553 " Jagan Teki
  4 siblings, 0 replies; 23+ messages in thread
From: Jagan Teki @ 2018-12-15 15:18 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: Chen-Yu Tsai, linux-input, linux-kernel, Michael Trimarchi,
	linux-amarula, Jagan Teki

GT5663 is capacitive touch controller with customized smart
wakeup gestures.

Add support for it by adding compatible and supported chip data.

The chip data on GT5663 is similar to GT1151, like
- config data register has 0x8050 address
- config data register max len is 240
- config data checksum has 16-bit

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
---
 drivers/input/touchscreen/goodix.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/input/touchscreen/goodix.c b/drivers/input/touchscreen/goodix.c
index 7371f6946098..735ab8e246b6 100644
--- a/drivers/input/touchscreen/goodix.c
+++ b/drivers/input/touchscreen/goodix.c
@@ -218,6 +218,7 @@ static const struct goodix_chip_data *goodix_get_chip_data(u16 id)
 {
 	switch (id) {
 	case 1151:
+	case 5663:
 		return &gt1x_chip_data;
 
 	case 911:
@@ -965,6 +966,7 @@ MODULE_DEVICE_TABLE(acpi, goodix_acpi_match);
 #ifdef CONFIG_OF
 static const struct of_device_id goodix_of_match[] = {
 	{ .compatible = "goodix,gt1151" },
+	{ .compatible = "goodix,gt5663" },
 	{ .compatible = "goodix,gt911" },
 	{ .compatible = "goodix,gt9110" },
 	{ .compatible = "goodix,gt912" },
-- 
2.18.0.321.gffc6fa0e3


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

* Re: [PATCH v3 0/4] input: touchscreen: Add goodix GT5553 CTP support
  2018-12-15 15:17 [PATCH v3 0/4] input: touchscreen: Add goodix GT5553 CTP support Jagan Teki
                   ` (3 preceding siblings ...)
  2018-12-15 15:18 ` [PATCH v3 4/4] Input: goodix - Add GT5663 CTP support Jagan Teki
@ 2019-01-06 16:38 ` Jagan Teki
  4 siblings, 0 replies; 23+ messages in thread
From: Jagan Teki @ 2019-01-06 16:38 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: Chen-Yu Tsai, linux-input, linux-kernel, Michael Trimarchi,
	linux-amarula

On Sat, Dec 15, 2018 at 8:48 PM Jagan Teki <jagan@amarulasolutions.com> wrote:
>
> This patchset support goodix GT5553 CTP.
>
> Changes for v3:
> - add cover-letter
> - s/ADVV28/AVDD28 on commit head
> - fix few typo
> Changes for v2:
> - Rename vcc-supply with AVDD28-supply
> - disable regulator in remove
> - fix to setup regulator in probe code
> - add chipdata
> - drop example node in dt-bindings

Any comments?

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

* Re: [PATCH v3 1/4] dt-bindings: input: touchscreen: goodix: Document AVDD28-supply property
  2018-12-15 15:17 ` [PATCH v3 1/4] dt-bindings: input: touchscreen: goodix: Document AVDD28-supply property Jagan Teki
@ 2019-01-07 22:58   ` Dmitry Torokhov
  2019-01-09 13:37     ` Rob Herring
  0 siblings, 1 reply; 23+ messages in thread
From: Dmitry Torokhov @ 2019-01-07 22:58 UTC (permalink / raw)
  To: Jagan Teki, robh
  Cc: Chen-Yu Tsai, linux-input, linux-kernel, Michael Trimarchi,
	linux-amarula

On Sat, Dec 15, 2018 at 08:47:59PM +0530, Jagan Teki wrote:
> Most of the Goodix CTP controllers are supply with AVDD28 pin.
> which need to supply for controllers like GT5663 on some boards
> to trigger the power.
> 
> So, document the supply property so-that the require boards
> that used on GT5663 can enable it via device tree.
> 
> Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
> ---
>  Documentation/devicetree/bindings/input/touchscreen/goodix.txt | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/Documentation/devicetree/bindings/input/touchscreen/goodix.txt b/Documentation/devicetree/bindings/input/touchscreen/goodix.txt
> index f7e95c52f3c7..c4622c983e08 100644
> --- a/Documentation/devicetree/bindings/input/touchscreen/goodix.txt
> +++ b/Documentation/devicetree/bindings/input/touchscreen/goodix.txt
> @@ -23,6 +23,7 @@ Optional properties:
>   - touchscreen-inverted-y  : Y axis is inverted (boolean)
>   - touchscreen-swapped-x-y : X and Y axis are swapped (boolean)
>                               (swapping is done after inverting the axis)
> + - AVDD28-supply	: Analog power supply regulator on AVDD28 pin

I think we normally use lower case in DT bindings and rarely encode
voltage in the supply name unless we are dealing with several supplies
of the same kind, but I'll let Ron comment on this.

Thanks.

-- 
Dmitry

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

* Re: [PATCH v3 2/4] Input: goodix - Add AVDD28-supply regulator support
  2018-12-15 15:18 ` [PATCH v3 2/4] Input: goodix - Add AVDD28-supply regulator support Jagan Teki
@ 2019-01-07 23:00   ` Dmitry Torokhov
  2019-01-31 20:00     ` Jagan Teki
  0 siblings, 1 reply; 23+ messages in thread
From: Dmitry Torokhov @ 2019-01-07 23:00 UTC (permalink / raw)
  To: Jagan Teki
  Cc: Chen-Yu Tsai, linux-input, linux-kernel, Michael Trimarchi,
	linux-amarula

Hi Jagan,

On Sat, Dec 15, 2018 at 08:48:00PM +0530, Jagan Teki wrote:
> Goodix CTP controllers have AVDD28 pin connected to voltage
> regulator which may not be turned on by default, like for GT5663.
> 
> Add support for such ctp used boards by adding voltage regulator
> handling code to goodix ctp driver.
> 
> Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
> ---
>  drivers/input/touchscreen/goodix.c | 33 +++++++++++++++++++++++++-----
>  1 file changed, 28 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/input/touchscreen/goodix.c b/drivers/input/touchscreen/goodix.c
> index f2d9c2c41885..7371f6946098 100644
> --- a/drivers/input/touchscreen/goodix.c
> +++ b/drivers/input/touchscreen/goodix.c
> @@ -27,6 +27,7 @@
>  #include <linux/delay.h>
>  #include <linux/irq.h>
>  #include <linux/interrupt.h>
> +#include <linux/regulator/consumer.h>
>  #include <linux/slab.h>
>  #include <linux/acpi.h>
>  #include <linux/of.h>
> @@ -47,6 +48,7 @@ struct goodix_ts_data {
>  	struct touchscreen_properties prop;
>  	unsigned int max_touch_num;
>  	unsigned int int_trigger_type;
> +	struct regulator *avdd28;
>  	struct gpio_desc *gpiod_int;
>  	struct gpio_desc *gpiod_rst;
>  	u16 id;
> @@ -786,25 +788,41 @@ static int goodix_ts_probe(struct i2c_client *client,
>  	if (error)
>  		return error;
>  
> +	ts->avdd28 = devm_regulator_get(&client->dev, "AVDD28");
> +	if (IS_ERR(ts->avdd28)) {
> +		error = PTR_ERR(ts->avdd28);
> +		if (error != -EPROBE_DEFER)
> +			dev_err(&client->dev,
> +				"Failed to get AVDD28 regulator: %d\n", error);
> +		return error;
> +	}
> +
> +	/* power the controller */
> +	error = regulator_enable(ts->avdd28);
> +	if (error) {
> +		dev_err(&client->dev, "Controller fail to enable AVDD28\n");
> +		return error;
> +	}
> +
>  	if (ts->gpiod_int && ts->gpiod_rst) {
>  		/* reset the controller */
>  		error = goodix_reset(ts);
>  		if (error) {
>  			dev_err(&client->dev, "Controller reset failed.\n");
> -			return error;
> +			goto error;
>  		}
>  	}
>  
>  	error = goodix_i2c_test(client);
>  	if (error) {
>  		dev_err(&client->dev, "I2C communication failure: %d\n", error);
> -		return error;
> +		goto error;
>  	}
>  
>  	error = goodix_read_version(ts);
>  	if (error) {
>  		dev_err(&client->dev, "Read version failed.\n");
> -		return error;
> +		goto error;
>  	}
>  
>  	ts->chip = goodix_get_chip_data(ts->id);
> @@ -823,23 +841,28 @@ static int goodix_ts_probe(struct i2c_client *client,
>  			dev_err(&client->dev,
>  				"Failed to invoke firmware loader: %d\n",
>  				error);
> -			return error;
> +			goto error;
>  		}
>  
>  		return 0;
>  	} else {
>  		error = goodix_configure_dev(ts);
>  		if (error)
> -			return error;
> +			goto error;
>  	}
>  
>  	return 0;
> +
> +error:
> +	regulator_disable(ts->avdd28);
> +	return error;
>  }
>  
>  static int goodix_ts_remove(struct i2c_client *client)
>  {
>  	struct goodix_ts_data *ts = i2c_get_clientdata(client);
>  
> +	regulator_disable(ts->avdd28);

This may be disabling the regulator too early. Please use
devm_add_action_or_reset() to install a custom devm handler that would
disable the regulator in line with the rest of devm unwinding flow.

>  	if (ts->gpiod_int && ts->gpiod_rst)
>  		wait_for_completion(&ts->firmware_loading_complete);
>  
> -- 
> 2.18.0.321.gffc6fa0e3
> 

Thanks.

-- 
Dmitry

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

* Re: [PATCH v3 1/4] dt-bindings: input: touchscreen: goodix: Document AVDD28-supply property
  2019-01-07 22:58   ` Dmitry Torokhov
@ 2019-01-09 13:37     ` Rob Herring
  2019-01-18 16:01       ` Jagan Teki
  0 siblings, 1 reply; 23+ messages in thread
From: Rob Herring @ 2019-01-09 13:37 UTC (permalink / raw)
  To: Dmitry Torokhov, Jagan Teki
  Cc: Chen-Yu Tsai, linux-input, linux-kernel, Michael Trimarchi,
	linux-amarula

Please CC DT list if you want bindings reviewed.

On Wed, Jan 9, 2019 at 1:40 AM Dmitry Torokhov
<dmitry.torokhov@gmail.com> wrote:
>
> On Sat, Dec 15, 2018 at 08:47:59PM +0530, Jagan Teki wrote:
> > Most of the Goodix CTP controllers are supply with AVDD28 pin.
> > which need to supply for controllers like GT5663 on some boards
> > to trigger the power.
> >
> > So, document the supply property so-that the require boards
> > that used on GT5663 can enable it via device tree.
> >
> > Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
> > ---
> >  Documentation/devicetree/bindings/input/touchscreen/goodix.txt | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/Documentation/devicetree/bindings/input/touchscreen/goodix.txt b/Documentation/devicetree/bindings/input/touchscreen/goodix.txt
> > index f7e95c52f3c7..c4622c983e08 100644
> > --- a/Documentation/devicetree/bindings/input/touchscreen/goodix.txt
> > +++ b/Documentation/devicetree/bindings/input/touchscreen/goodix.txt
> > @@ -23,6 +23,7 @@ Optional properties:
> >   - touchscreen-inverted-y  : Y axis is inverted (boolean)
> >   - touchscreen-swapped-x-y : X and Y axis are swapped (boolean)
> >                               (swapping is done after inverting the axis)
> > + - AVDD28-supply     : Analog power supply regulator on AVDD28 pin
>
> I think we normally use lower case in DT bindings and rarely encode
> voltage in the supply name unless we are dealing with several supplies
> of the same kind, but I'll let Ron comment on this.

Yes on lowercase though there are some exceptions.

There's also a AVDD22 supply as well as DVDD12 and VDDIO. So we
probably need to keep the voltage, but the binding is incomplete.

Rob

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

* Re: [PATCH v3 1/4] dt-bindings: input: touchscreen: goodix: Document AVDD28-supply property
  2019-01-09 13:37     ` Rob Herring
@ 2019-01-18 16:01       ` Jagan Teki
  2019-01-21 16:16         ` Rob Herring
  0 siblings, 1 reply; 23+ messages in thread
From: Jagan Teki @ 2019-01-18 16:01 UTC (permalink / raw)
  To: Rob Herring, devicetree
  Cc: Dmitry Torokhov, Chen-Yu Tsai, linux-input, linux-kernel,
	Michael Trimarchi, linux-amarula

On Wed, Jan 9, 2019 at 7:08 PM Rob Herring <robh@kernel.org> wrote:
>
> Please CC DT list if you want bindings reviewed.

Sorry I forgot.

>
> On Wed, Jan 9, 2019 at 1:40 AM Dmitry Torokhov
> <dmitry.torokhov@gmail.com> wrote:
> >
> > On Sat, Dec 15, 2018 at 08:47:59PM +0530, Jagan Teki wrote:
> > > Most of the Goodix CTP controllers are supply with AVDD28 pin.
> > > which need to supply for controllers like GT5663 on some boards
> > > to trigger the power.
> > >
> > > So, document the supply property so-that the require boards
> > > that used on GT5663 can enable it via device tree.
> > >
> > > Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
> > > ---
> > >  Documentation/devicetree/bindings/input/touchscreen/goodix.txt | 1 +
> > >  1 file changed, 1 insertion(+)
> > >
> > > diff --git a/Documentation/devicetree/bindings/input/touchscreen/goodix.txt b/Documentation/devicetree/bindings/input/touchscreen/goodix.txt
> > > index f7e95c52f3c7..c4622c983e08 100644
> > > --- a/Documentation/devicetree/bindings/input/touchscreen/goodix.txt
> > > +++ b/Documentation/devicetree/bindings/input/touchscreen/goodix.txt
> > > @@ -23,6 +23,7 @@ Optional properties:
> > >   - touchscreen-inverted-y  : Y axis is inverted (boolean)
> > >   - touchscreen-swapped-x-y : X and Y axis are swapped (boolean)
> > >                               (swapping is done after inverting the axis)
> > > + - AVDD28-supply     : Analog power supply regulator on AVDD28 pin
> >
> > I think we normally use lower case in DT bindings and rarely encode
> > voltage in the supply name unless we are dealing with several supplies
> > of the same kind, but I'll let Ron comment on this.
>
> Yes on lowercase though there are some exceptions.
>
> There's also a AVDD22 supply as well as DVDD12 and VDDIO. So we
> probably need to keep the voltage, but the binding is incomplete.

What is incomplete here? can you please elaborate.

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

* Re: [PATCH v3 1/4] dt-bindings: input: touchscreen: goodix: Document AVDD28-supply property
  2019-01-18 16:01       ` Jagan Teki
@ 2019-01-21 16:16         ` Rob Herring
  2019-01-22 13:38           ` Jagan Teki
  0 siblings, 1 reply; 23+ messages in thread
From: Rob Herring @ 2019-01-21 16:16 UTC (permalink / raw)
  To: Jagan Teki
  Cc: devicetree, Dmitry Torokhov, Chen-Yu Tsai, linux-input,
	linux-kernel, Michael Trimarchi, linux-amarula

On Fri, Jan 18, 2019 at 10:01 AM Jagan Teki <jagan@amarulasolutions.com> wrote:
>
> On Wed, Jan 9, 2019 at 7:08 PM Rob Herring <robh@kernel.org> wrote:
> >
> > Please CC DT list if you want bindings reviewed.
>
> Sorry I forgot.
>
> >
> > On Wed, Jan 9, 2019 at 1:40 AM Dmitry Torokhov
> > <dmitry.torokhov@gmail.com> wrote:
> > >
> > > On Sat, Dec 15, 2018 at 08:47:59PM +0530, Jagan Teki wrote:
> > > > Most of the Goodix CTP controllers are supply with AVDD28 pin.
> > > > which need to supply for controllers like GT5663 on some boards
> > > > to trigger the power.
> > > >
> > > > So, document the supply property so-that the require boards
> > > > that used on GT5663 can enable it via device tree.
> > > >
> > > > Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
> > > > ---
> > > >  Documentation/devicetree/bindings/input/touchscreen/goodix.txt | 1 +
> > > >  1 file changed, 1 insertion(+)
> > > >
> > > > diff --git a/Documentation/devicetree/bindings/input/touchscreen/goodix.txt b/Documentation/devicetree/bindings/input/touchscreen/goodix.txt
> > > > index f7e95c52f3c7..c4622c983e08 100644
> > > > --- a/Documentation/devicetree/bindings/input/touchscreen/goodix.txt
> > > > +++ b/Documentation/devicetree/bindings/input/touchscreen/goodix.txt
> > > > @@ -23,6 +23,7 @@ Optional properties:
> > > >   - touchscreen-inverted-y  : Y axis is inverted (boolean)
> > > >   - touchscreen-swapped-x-y : X and Y axis are swapped (boolean)
> > > >                               (swapping is done after inverting the axis)
> > > > + - AVDD28-supply     : Analog power supply regulator on AVDD28 pin
> > >
> > > I think we normally use lower case in DT bindings and rarely encode
> > > voltage in the supply name unless we are dealing with several supplies
> > > of the same kind, but I'll let Ron comment on this.
> >
> > Yes on lowercase though there are some exceptions.
> >
> > There's also a AVDD22 supply as well as DVDD12 and VDDIO. So we
> > probably need to keep the voltage, but the binding is incomplete.
>
> What is incomplete here? can you please elaborate.

You are missing the 3 other supplies the chip has: AVDD22, DVDD12 and VDDIO.

Rob

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

* Re: [PATCH v3 1/4] dt-bindings: input: touchscreen: goodix: Document AVDD28-supply property
  2019-01-21 16:16         ` Rob Herring
@ 2019-01-22 13:38           ` Jagan Teki
  2019-01-24  4:32             ` Jagan Teki
  2019-02-13 21:51             ` Rob Herring
  0 siblings, 2 replies; 23+ messages in thread
From: Jagan Teki @ 2019-01-22 13:38 UTC (permalink / raw)
  To: Rob Herring
  Cc: devicetree, Dmitry Torokhov, Chen-Yu Tsai, linux-input,
	linux-kernel, Michael Trimarchi, linux-amarula

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

On Mon, Jan 21, 2019 at 9:46 PM Rob Herring <robh@kernel.org> wrote:
>
> On Fri, Jan 18, 2019 at 10:01 AM Jagan Teki <jagan@amarulasolutions.com> wrote:
> >
> > On Wed, Jan 9, 2019 at 7:08 PM Rob Herring <robh@kernel.org> wrote:
> > >
> > > Please CC DT list if you want bindings reviewed.
> >
> > Sorry I forgot.
> >
> > >
> > > On Wed, Jan 9, 2019 at 1:40 AM Dmitry Torokhov
> > > <dmitry.torokhov@gmail.com> wrote:
> > > >
> > > > On Sat, Dec 15, 2018 at 08:47:59PM +0530, Jagan Teki wrote:
> > > > > Most of the Goodix CTP controllers are supply with AVDD28 pin.
> > > > > which need to supply for controllers like GT5663 on some boards
> > > > > to trigger the power.
> > > > >
> > > > > So, document the supply property so-that the require boards
> > > > > that used on GT5663 can enable it via device tree.
> > > > >
> > > > > Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
> > > > > ---
> > > > >  Documentation/devicetree/bindings/input/touchscreen/goodix.txt | 1 +
> > > > >  1 file changed, 1 insertion(+)
> > > > >
> > > > > diff --git a/Documentation/devicetree/bindings/input/touchscreen/goodix.txt b/Documentation/devicetree/bindings/input/touchscreen/goodix.txt
> > > > > index f7e95c52f3c7..c4622c983e08 100644
> > > > > --- a/Documentation/devicetree/bindings/input/touchscreen/goodix.txt
> > > > > +++ b/Documentation/devicetree/bindings/input/touchscreen/goodix.txt
> > > > > @@ -23,6 +23,7 @@ Optional properties:
> > > > >   - touchscreen-inverted-y  : Y axis is inverted (boolean)
> > > > >   - touchscreen-swapped-x-y : X and Y axis are swapped (boolean)
> > > > >                               (swapping is done after inverting the axis)
> > > > > + - AVDD28-supply     : Analog power supply regulator on AVDD28 pin
> > > >
> > > > I think we normally use lower case in DT bindings and rarely encode
> > > > voltage in the supply name unless we are dealing with several supplies
> > > > of the same kind, but I'll let Ron comment on this.
> > >
> > > Yes on lowercase though there are some exceptions.
> > >
> > > There's also a AVDD22 supply as well as DVDD12 and VDDIO. So we
> > > probably need to keep the voltage, but the binding is incomplete.
> >
> > What is incomplete here? can you please elaborate.
>
> You are missing the 3 other supplies the chip has: AVDD22, DVDD12 and VDDIO.

Though it has other supplies, only AVDD28 is connected in the Host
interface design similar like 9. Reference Schematic on Page, 23 in
attached manual.

[-- Attachment #2: GT5663_v.01.pdf --]
[-- Type: application/pdf, Size: 2162399 bytes --]

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

* Re: [PATCH v3 1/4] dt-bindings: input: touchscreen: goodix: Document AVDD28-supply property
  2019-01-22 13:38           ` Jagan Teki
@ 2019-01-24  4:32             ` Jagan Teki
  2019-02-13 21:51             ` Rob Herring
  1 sibling, 0 replies; 23+ messages in thread
From: Jagan Teki @ 2019-01-24  4:32 UTC (permalink / raw)
  To: Rob Herring
  Cc: devicetree, Dmitry Torokhov, Chen-Yu Tsai, linux-input,
	linux-kernel, Michael Trimarchi, linux-amarula

+ DT ML

On Tue, Jan 22, 2019 at 7:08 PM Jagan Teki <jagan@amarulasolutions.com> wrote:
>
> On Mon, Jan 21, 2019 at 9:46 PM Rob Herring <robh@kernel.org> wrote:
> >
> > On Fri, Jan 18, 2019 at 10:01 AM Jagan Teki <jagan@amarulasolutions.com> wrote:
> > >
> > > On Wed, Jan 9, 2019 at 7:08 PM Rob Herring <robh@kernel.org> wrote:
> > > >
> > > > Please CC DT list if you want bindings reviewed.
> > >
> > > Sorry I forgot.
> > >
> > > >
> > > > On Wed, Jan 9, 2019 at 1:40 AM Dmitry Torokhov
> > > > <dmitry.torokhov@gmail.com> wrote:
> > > > >
> > > > > On Sat, Dec 15, 2018 at 08:47:59PM +0530, Jagan Teki wrote:
> > > > > > Most of the Goodix CTP controllers are supply with AVDD28 pin.
> > > > > > which need to supply for controllers like GT5663 on some boards
> > > > > > to trigger the power.
> > > > > >
> > > > > > So, document the supply property so-that the require boards
> > > > > > that used on GT5663 can enable it via device tree.
> > > > > >
> > > > > > Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
> > > > > > ---
> > > > > >  Documentation/devicetree/bindings/input/touchscreen/goodix.txt | 1 +
> > > > > >  1 file changed, 1 insertion(+)
> > > > > >
> > > > > > diff --git a/Documentation/devicetree/bindings/input/touchscreen/goodix.txt b/Documentation/devicetree/bindings/input/touchscreen/goodix.txt
> > > > > > index f7e95c52f3c7..c4622c983e08 100644
> > > > > > --- a/Documentation/devicetree/bindings/input/touchscreen/goodix.txt
> > > > > > +++ b/Documentation/devicetree/bindings/input/touchscreen/goodix.txt
> > > > > > @@ -23,6 +23,7 @@ Optional properties:
> > > > > >   - touchscreen-inverted-y  : Y axis is inverted (boolean)
> > > > > >   - touchscreen-swapped-x-y : X and Y axis are swapped (boolean)
> > > > > >                               (swapping is done after inverting the axis)
> > > > > > + - AVDD28-supply     : Analog power supply regulator on AVDD28 pin
> > > > >
> > > > > I think we normally use lower case in DT bindings and rarely encode
> > > > > voltage in the supply name unless we are dealing with several supplies
> > > > > of the same kind, but I'll let Ron comment on this.
> > > >
> > > > Yes on lowercase though there are some exceptions.
> > > >
> > > > There's also a AVDD22 supply as well as DVDD12 and VDDIO. So we
> > > > probably need to keep the voltage, but the binding is incomplete.
> > >
> > > What is incomplete here? can you please elaborate.
> >
> > You are missing the 3 other supplies the chip has: AVDD22, DVDD12 and VDDIO.
>
> Though it has other supplies, only AVDD28 is connected in the Host
> interface design similar like 9. Reference Schematic on Page, 23 in
> attached manual.

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

* Re: [PATCH v3 2/4] Input: goodix - Add AVDD28-supply regulator support
  2019-01-07 23:00   ` Dmitry Torokhov
@ 2019-01-31 20:00     ` Jagan Teki
  2019-02-01  8:18       ` Dmitry Torokhov
  0 siblings, 1 reply; 23+ messages in thread
From: Jagan Teki @ 2019-01-31 20:00 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: Chen-Yu Tsai, linux-input, linux-kernel, Michael Trimarchi,
	linux-amarula

On Wed, Jan 9, 2019 at 1:10 PM Dmitry Torokhov
<dmitry.torokhov@gmail.com> wrote:
>
> Hi Jagan,
>
> On Sat, Dec 15, 2018 at 08:48:00PM +0530, Jagan Teki wrote:
> > Goodix CTP controllers have AVDD28 pin connected to voltage
> > regulator which may not be turned on by default, like for GT5663.
> >
> > Add support for such ctp used boards by adding voltage regulator
> > handling code to goodix ctp driver.
> >
> > Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
> > ---
> >  drivers/input/touchscreen/goodix.c | 33 +++++++++++++++++++++++++-----
> >  1 file changed, 28 insertions(+), 5 deletions(-)
> >
> > diff --git a/drivers/input/touchscreen/goodix.c b/drivers/input/touchscreen/goodix.c
> > index f2d9c2c41885..7371f6946098 100644
> > --- a/drivers/input/touchscreen/goodix.c
> > +++ b/drivers/input/touchscreen/goodix.c
> > @@ -27,6 +27,7 @@
> >  #include <linux/delay.h>
> >  #include <linux/irq.h>
> >  #include <linux/interrupt.h>
> > +#include <linux/regulator/consumer.h>
> >  #include <linux/slab.h>
> >  #include <linux/acpi.h>
> >  #include <linux/of.h>
> > @@ -47,6 +48,7 @@ struct goodix_ts_data {
> >       struct touchscreen_properties prop;
> >       unsigned int max_touch_num;
> >       unsigned int int_trigger_type;
> > +     struct regulator *avdd28;
> >       struct gpio_desc *gpiod_int;
> >       struct gpio_desc *gpiod_rst;
> >       u16 id;
> > @@ -786,25 +788,41 @@ static int goodix_ts_probe(struct i2c_client *client,
> >       if (error)
> >               return error;
> >
> > +     ts->avdd28 = devm_regulator_get(&client->dev, "AVDD28");
> > +     if (IS_ERR(ts->avdd28)) {
> > +             error = PTR_ERR(ts->avdd28);
> > +             if (error != -EPROBE_DEFER)
> > +                     dev_err(&client->dev,
> > +                             "Failed to get AVDD28 regulator: %d\n", error);
> > +             return error;
> > +     }
> > +
> > +     /* power the controller */
> > +     error = regulator_enable(ts->avdd28);
> > +     if (error) {
> > +             dev_err(&client->dev, "Controller fail to enable AVDD28\n");
> > +             return error;
> > +     }
> > +
> >       if (ts->gpiod_int && ts->gpiod_rst) {
> >               /* reset the controller */
> >               error = goodix_reset(ts);
> >               if (error) {
> >                       dev_err(&client->dev, "Controller reset failed.\n");
> > -                     return error;
> > +                     goto error;
> >               }
> >       }
> >
> >       error = goodix_i2c_test(client);
> >       if (error) {
> >               dev_err(&client->dev, "I2C communication failure: %d\n", error);
> > -             return error;
> > +             goto error;
> >       }
> >
> >       error = goodix_read_version(ts);
> >       if (error) {
> >               dev_err(&client->dev, "Read version failed.\n");
> > -             return error;
> > +             goto error;
> >       }
> >
> >       ts->chip = goodix_get_chip_data(ts->id);
> > @@ -823,23 +841,28 @@ static int goodix_ts_probe(struct i2c_client *client,
> >                       dev_err(&client->dev,
> >                               "Failed to invoke firmware loader: %d\n",
> >                               error);
> > -                     return error;
> > +                     goto error;
> >               }
> >
> >               return 0;
> >       } else {
> >               error = goodix_configure_dev(ts);
> >               if (error)
> > -                     return error;
> > +                     goto error;
> >       }
> >
> >       return 0;
> > +
> > +error:
> > +     regulator_disable(ts->avdd28);
> > +     return error;
> >  }
> >
> >  static int goodix_ts_remove(struct i2c_client *client)
> >  {
> >       struct goodix_ts_data *ts = i2c_get_clientdata(client);
> >
> > +     regulator_disable(ts->avdd28);
>
> This may be disabling the regulator too early. Please use
> devm_add_action_or_reset() to install a custom devm handler that would
> disable the regulator in line with the rest of devm unwinding flow.

Like handler with only regulator_disable? and would that call from
suspend or not need?

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

* Re: [PATCH v3 2/4] Input: goodix - Add AVDD28-supply regulator support
  2019-01-31 20:00     ` Jagan Teki
@ 2019-02-01  8:18       ` Dmitry Torokhov
  0 siblings, 0 replies; 23+ messages in thread
From: Dmitry Torokhov @ 2019-02-01  8:18 UTC (permalink / raw)
  To: Jagan Teki
  Cc: Chen-Yu Tsai, linux-input, linux-kernel, Michael Trimarchi,
	linux-amarula

On Thu, Jan 31, 2019 at 12:00 PM Jagan Teki <jagan@amarulasolutions.com> wrote:
>
> On Wed, Jan 9, 2019 at 1:10 PM Dmitry Torokhov
> <dmitry.torokhov@gmail.com> wrote:
> >
> > Hi Jagan,
> >
> > On Sat, Dec 15, 2018 at 08:48:00PM +0530, Jagan Teki wrote:
> > > Goodix CTP controllers have AVDD28 pin connected to voltage
> > > regulator which may not be turned on by default, like for GT5663.
> > >
> > > Add support for such ctp used boards by adding voltage regulator
> > > handling code to goodix ctp driver.
> > >
> > > Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
> > > ---
> > >  drivers/input/touchscreen/goodix.c | 33 +++++++++++++++++++++++++-----
> > >  1 file changed, 28 insertions(+), 5 deletions(-)
> > >
> > > diff --git a/drivers/input/touchscreen/goodix.c b/drivers/input/touchscreen/goodix.c
> > > index f2d9c2c41885..7371f6946098 100644
> > > --- a/drivers/input/touchscreen/goodix.c
> > > +++ b/drivers/input/touchscreen/goodix.c
> > > @@ -27,6 +27,7 @@
> > >  #include <linux/delay.h>
> > >  #include <linux/irq.h>
> > >  #include <linux/interrupt.h>
> > > +#include <linux/regulator/consumer.h>
> > >  #include <linux/slab.h>
> > >  #include <linux/acpi.h>
> > >  #include <linux/of.h>
> > > @@ -47,6 +48,7 @@ struct goodix_ts_data {
> > >       struct touchscreen_properties prop;
> > >       unsigned int max_touch_num;
> > >       unsigned int int_trigger_type;
> > > +     struct regulator *avdd28;
> > >       struct gpio_desc *gpiod_int;
> > >       struct gpio_desc *gpiod_rst;
> > >       u16 id;
> > > @@ -786,25 +788,41 @@ static int goodix_ts_probe(struct i2c_client *client,
> > >       if (error)
> > >               return error;
> > >
> > > +     ts->avdd28 = devm_regulator_get(&client->dev, "AVDD28");
> > > +     if (IS_ERR(ts->avdd28)) {
> > > +             error = PTR_ERR(ts->avdd28);
> > > +             if (error != -EPROBE_DEFER)
> > > +                     dev_err(&client->dev,
> > > +                             "Failed to get AVDD28 regulator: %d\n", error);
> > > +             return error;
> > > +     }
> > > +
> > > +     /* power the controller */
> > > +     error = regulator_enable(ts->avdd28);
> > > +     if (error) {
> > > +             dev_err(&client->dev, "Controller fail to enable AVDD28\n");
> > > +             return error;
> > > +     }
> > > +
> > >       if (ts->gpiod_int && ts->gpiod_rst) {
> > >               /* reset the controller */
> > >               error = goodix_reset(ts);
> > >               if (error) {
> > >                       dev_err(&client->dev, "Controller reset failed.\n");
> > > -                     return error;
> > > +                     goto error;
> > >               }
> > >       }
> > >
> > >       error = goodix_i2c_test(client);
> > >       if (error) {
> > >               dev_err(&client->dev, "I2C communication failure: %d\n", error);
> > > -             return error;
> > > +             goto error;
> > >       }
> > >
> > >       error = goodix_read_version(ts);
> > >       if (error) {
> > >               dev_err(&client->dev, "Read version failed.\n");
> > > -             return error;
> > > +             goto error;
> > >       }
> > >
> > >       ts->chip = goodix_get_chip_data(ts->id);
> > > @@ -823,23 +841,28 @@ static int goodix_ts_probe(struct i2c_client *client,
> > >                       dev_err(&client->dev,
> > >                               "Failed to invoke firmware loader: %d\n",
> > >                               error);
> > > -                     return error;
> > > +                     goto error;
> > >               }
> > >
> > >               return 0;
> > >       } else {
> > >               error = goodix_configure_dev(ts);
> > >               if (error)
> > > -                     return error;
> > > +                     goto error;
> > >       }
> > >
> > >       return 0;
> > > +
> > > +error:
> > > +     regulator_disable(ts->avdd28);
> > > +     return error;
> > >  }
> > >
> > >  static int goodix_ts_remove(struct i2c_client *client)
> > >  {
> > >       struct goodix_ts_data *ts = i2c_get_clientdata(client);
> > >
> > > +     regulator_disable(ts->avdd28);
> >
> > This may be disabling the regulator too early. Please use
> > devm_add_action_or_reset() to install a custom devm handler that would
> > disable the regulator in line with the rest of devm unwinding flow.
>
> Like handler with only regulator_disable?

Right.

> and would that call from suspend or not need?

No, it will only be called when device is unbound from the driver or
when probe fails. If you need to control regulator in suspend/resume
you can do it with normal regulator_enable() and regulator_disable()
calls.

Thanks.

-- 
Dmitry

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

* Re: [PATCH v3 1/4] dt-bindings: input: touchscreen: goodix: Document AVDD28-supply property
  2019-01-22 13:38           ` Jagan Teki
  2019-01-24  4:32             ` Jagan Teki
@ 2019-02-13 21:51             ` Rob Herring
  2019-02-17  7:51               ` Jagan Teki
  1 sibling, 1 reply; 23+ messages in thread
From: Rob Herring @ 2019-02-13 21:51 UTC (permalink / raw)
  To: Jagan Teki
  Cc: devicetree, Dmitry Torokhov, Chen-Yu Tsai, linux-input,
	linux-kernel, Michael Trimarchi, linux-amarula

On Tue, Jan 22, 2019 at 7:39 AM Jagan Teki <jagan@amarulasolutions.com> wrote:
>
> On Mon, Jan 21, 2019 at 9:46 PM Rob Herring <robh@kernel.org> wrote:
> >
> > On Fri, Jan 18, 2019 at 10:01 AM Jagan Teki <jagan@amarulasolutions.com> wrote:
> > >
> > > On Wed, Jan 9, 2019 at 7:08 PM Rob Herring <robh@kernel.org> wrote:
> > > >
> > > > Please CC DT list if you want bindings reviewed.
> > >
> > > Sorry I forgot.
> > >
> > > >
> > > > On Wed, Jan 9, 2019 at 1:40 AM Dmitry Torokhov
> > > > <dmitry.torokhov@gmail.com> wrote:
> > > > >
> > > > > On Sat, Dec 15, 2018 at 08:47:59PM +0530, Jagan Teki wrote:
> > > > > > Most of the Goodix CTP controllers are supply with AVDD28 pin.
> > > > > > which need to supply for controllers like GT5663 on some boards
> > > > > > to trigger the power.
> > > > > >
> > > > > > So, document the supply property so-that the require boards
> > > > > > that used on GT5663 can enable it via device tree.
> > > > > >
> > > > > > Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
> > > > > > ---
> > > > > >  Documentation/devicetree/bindings/input/touchscreen/goodix.txt | 1 +
> > > > > >  1 file changed, 1 insertion(+)
> > > > > >
> > > > > > diff --git a/Documentation/devicetree/bindings/input/touchscreen/goodix.txt b/Documentation/devicetree/bindings/input/touchscreen/goodix.txt
> > > > > > index f7e95c52f3c7..c4622c983e08 100644
> > > > > > --- a/Documentation/devicetree/bindings/input/touchscreen/goodix.txt
> > > > > > +++ b/Documentation/devicetree/bindings/input/touchscreen/goodix.txt
> > > > > > @@ -23,6 +23,7 @@ Optional properties:
> > > > > >   - touchscreen-inverted-y  : Y axis is inverted (boolean)
> > > > > >   - touchscreen-swapped-x-y : X and Y axis are swapped (boolean)
> > > > > >                               (swapping is done after inverting the axis)
> > > > > > + - AVDD28-supply     : Analog power supply regulator on AVDD28 pin
> > > > >
> > > > > I think we normally use lower case in DT bindings and rarely encode
> > > > > voltage in the supply name unless we are dealing with several supplies
> > > > > of the same kind, but I'll let Ron comment on this.
> > > >
> > > > Yes on lowercase though there are some exceptions.
> > > >
> > > > There's also a AVDD22 supply as well as DVDD12 and VDDIO. So we
> > > > probably need to keep the voltage, but the binding is incomplete.
> > >
> > > What is incomplete here? can you please elaborate.
> >
> > You are missing the 3 other supplies the chip has: AVDD22, DVDD12 and VDDIO.
>
> Though it has other supplies, only AVDD28 is connected in the Host
> interface design similar like 9. Reference Schematic on Page, 23 in
> attached manual.

That is for a particular board design. It still has other supplies.
Just make the binding complete please. You can make them optional. I
don't care if the driver supports controlling all the supplies or not
(though Dmitry might).

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

* Re: [PATCH v3 1/4] dt-bindings: input: touchscreen: goodix: Document AVDD28-supply property
  2019-02-13 21:51             ` Rob Herring
@ 2019-02-17  7:51               ` Jagan Teki
  2019-02-17  9:15                 ` Jagan Teki
  0 siblings, 1 reply; 23+ messages in thread
From: Jagan Teki @ 2019-02-17  7:51 UTC (permalink / raw)
  To: Rob Herring, Dmitry Torokhov
  Cc: devicetree, Chen-Yu Tsai, linux-input, linux-kernel,
	Michael Trimarchi, linux-amarula

Hi Dmitry and Rob,

On Thu, Feb 14, 2019 at 3:21 AM Rob Herring <robh@kernel.org> wrote:
>
> On Tue, Jan 22, 2019 at 7:39 AM Jagan Teki <jagan@amarulasolutions.com> wrote:
> >
> > On Mon, Jan 21, 2019 at 9:46 PM Rob Herring <robh@kernel.org> wrote:
> > >
> > > On Fri, Jan 18, 2019 at 10:01 AM Jagan Teki <jagan@amarulasolutions.com> wrote:
> > > >
> > > > On Wed, Jan 9, 2019 at 7:08 PM Rob Herring <robh@kernel.org> wrote:
> > > > >
> > > > > Please CC DT list if you want bindings reviewed.
> > > >
> > > > Sorry I forgot.
> > > >
> > > > >
> > > > > On Wed, Jan 9, 2019 at 1:40 AM Dmitry Torokhov
> > > > > <dmitry.torokhov@gmail.com> wrote:
> > > > > >
> > > > > > On Sat, Dec 15, 2018 at 08:47:59PM +0530, Jagan Teki wrote:
> > > > > > > Most of the Goodix CTP controllers are supply with AVDD28 pin.
> > > > > > > which need to supply for controllers like GT5663 on some boards
> > > > > > > to trigger the power.
> > > > > > >
> > > > > > > So, document the supply property so-that the require boards
> > > > > > > that used on GT5663 can enable it via device tree.
> > > > > > >
> > > > > > > Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
> > > > > > > ---
> > > > > > >  Documentation/devicetree/bindings/input/touchscreen/goodix.txt | 1 +
> > > > > > >  1 file changed, 1 insertion(+)
> > > > > > >
> > > > > > > diff --git a/Documentation/devicetree/bindings/input/touchscreen/goodix.txt b/Documentation/devicetree/bindings/input/touchscreen/goodix.txt
> > > > > > > index f7e95c52f3c7..c4622c983e08 100644
> > > > > > > --- a/Documentation/devicetree/bindings/input/touchscreen/goodix.txt
> > > > > > > +++ b/Documentation/devicetree/bindings/input/touchscreen/goodix.txt
> > > > > > > @@ -23,6 +23,7 @@ Optional properties:
> > > > > > >   - touchscreen-inverted-y  : Y axis is inverted (boolean)
> > > > > > >   - touchscreen-swapped-x-y : X and Y axis are swapped (boolean)
> > > > > > >                               (swapping is done after inverting the axis)
> > > > > > > + - AVDD28-supply     : Analog power supply regulator on AVDD28 pin
> > > > > >
> > > > > > I think we normally use lower case in DT bindings and rarely encode
> > > > > > voltage in the supply name unless we are dealing with several supplies
> > > > > > of the same kind, but I'll let Ron comment on this.
> > > > >
> > > > > Yes on lowercase though there are some exceptions.
> > > > >
> > > > > There's also a AVDD22 supply as well as DVDD12 and VDDIO. So we
> > > > > probably need to keep the voltage, but the binding is incomplete.
> > > >
> > > > What is incomplete here? can you please elaborate.
> > >
> > > You are missing the 3 other supplies the chip has: AVDD22, DVDD12 and VDDIO.
> >
> > Though it has other supplies, only AVDD28 is connected in the Host
> > interface design similar like 9. Reference Schematic on Page, 23 in
> > attached manual.
>
> That is for a particular board design. It still has other supplies.
> Just make the binding complete please. You can make them optional. I
> don't care if the driver supports controlling all the supplies or not
> (though Dmitry might).

So, Can I make bulk get and enable in all 4 regulators global to
driver or specific to that chip, in either way the regulators which
are not used to process via dummy regulators (which we all know).

or regulator which are not using are get via devm_regulator_get_optional.

Any suggestions?

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

* Re: [PATCH v3 1/4] dt-bindings: input: touchscreen: goodix: Document AVDD28-supply property
  2019-02-17  7:51               ` Jagan Teki
@ 2019-02-17  9:15                 ` Jagan Teki
  2019-02-18  7:12                   ` Dmitry Torokhov
  0 siblings, 1 reply; 23+ messages in thread
From: Jagan Teki @ 2019-02-17  9:15 UTC (permalink / raw)
  To: Rob Herring, Dmitry Torokhov
  Cc: devicetree, Chen-Yu Tsai, linux-input, linux-kernel,
	Michael Trimarchi, linux-amarula

On Sun, Feb 17, 2019 at 1:21 PM Jagan Teki <jagan@amarulasolutions.com> wrote:
>
> Hi Dmitry and Rob,
>
> On Thu, Feb 14, 2019 at 3:21 AM Rob Herring <robh@kernel.org> wrote:
> >
> > On Tue, Jan 22, 2019 at 7:39 AM Jagan Teki <jagan@amarulasolutions.com> wrote:
> > >
> > > On Mon, Jan 21, 2019 at 9:46 PM Rob Herring <robh@kernel.org> wrote:
> > > >
> > > > On Fri, Jan 18, 2019 at 10:01 AM Jagan Teki <jagan@amarulasolutions.com> wrote:
> > > > >
> > > > > On Wed, Jan 9, 2019 at 7:08 PM Rob Herring <robh@kernel.org> wrote:
> > > > > >
> > > > > > Please CC DT list if you want bindings reviewed.
> > > > >
> > > > > Sorry I forgot.
> > > > >
> > > > > >
> > > > > > On Wed, Jan 9, 2019 at 1:40 AM Dmitry Torokhov
> > > > > > <dmitry.torokhov@gmail.com> wrote:
> > > > > > >
> > > > > > > On Sat, Dec 15, 2018 at 08:47:59PM +0530, Jagan Teki wrote:
> > > > > > > > Most of the Goodix CTP controllers are supply with AVDD28 pin.
> > > > > > > > which need to supply for controllers like GT5663 on some boards
> > > > > > > > to trigger the power.
> > > > > > > >
> > > > > > > > So, document the supply property so-that the require boards
> > > > > > > > that used on GT5663 can enable it via device tree.
> > > > > > > >
> > > > > > > > Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
> > > > > > > > ---
> > > > > > > >  Documentation/devicetree/bindings/input/touchscreen/goodix.txt | 1 +
> > > > > > > >  1 file changed, 1 insertion(+)
> > > > > > > >
> > > > > > > > diff --git a/Documentation/devicetree/bindings/input/touchscreen/goodix.txt b/Documentation/devicetree/bindings/input/touchscreen/goodix.txt
> > > > > > > > index f7e95c52f3c7..c4622c983e08 100644
> > > > > > > > --- a/Documentation/devicetree/bindings/input/touchscreen/goodix.txt
> > > > > > > > +++ b/Documentation/devicetree/bindings/input/touchscreen/goodix.txt
> > > > > > > > @@ -23,6 +23,7 @@ Optional properties:
> > > > > > > >   - touchscreen-inverted-y  : Y axis is inverted (boolean)
> > > > > > > >   - touchscreen-swapped-x-y : X and Y axis are swapped (boolean)
> > > > > > > >                               (swapping is done after inverting the axis)
> > > > > > > > + - AVDD28-supply     : Analog power supply regulator on AVDD28 pin
> > > > > > >
> > > > > > > I think we normally use lower case in DT bindings and rarely encode
> > > > > > > voltage in the supply name unless we are dealing with several supplies
> > > > > > > of the same kind, but I'll let Ron comment on this.
> > > > > >
> > > > > > Yes on lowercase though there are some exceptions.
> > > > > >
> > > > > > There's also a AVDD22 supply as well as DVDD12 and VDDIO. So we
> > > > > > probably need to keep the voltage, but the binding is incomplete.
> > > > >
> > > > > What is incomplete here? can you please elaborate.
> > > >
> > > > You are missing the 3 other supplies the chip has: AVDD22, DVDD12 and VDDIO.
> > >
> > > Though it has other supplies, only AVDD28 is connected in the Host
> > > interface design similar like 9. Reference Schematic on Page, 23 in
> > > attached manual.
> >
> > That is for a particular board design. It still has other supplies.
> > Just make the binding complete please. You can make them optional. I
> > don't care if the driver supports controlling all the supplies or not
> > (though Dmitry might).
>
> So, Can I make bulk get and enable in all 4 regulators global to
> driver or specific to that chip, in either way the regulators which
> are not used to process via dummy regulators (which we all know).
>
> or regulator which are not using are get via devm_regulator_get_optional.
>
> Any suggestions?

Just realized to go with bulk calls, please have a look at on v5 [1]

[1] https://patchwork.kernel.org/cover/10816901/

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

* Re: [PATCH v3 1/4] dt-bindings: input: touchscreen: goodix: Document AVDD28-supply property
  2019-02-17  9:15                 ` Jagan Teki
@ 2019-02-18  7:12                   ` Dmitry Torokhov
  2019-02-18  9:33                     ` Jagan Teki
  0 siblings, 1 reply; 23+ messages in thread
From: Dmitry Torokhov @ 2019-02-18  7:12 UTC (permalink / raw)
  To: Jagan Teki
  Cc: Rob Herring, devicetree, Chen-Yu Tsai, linux-input, linux-kernel,
	Michael Trimarchi, linux-amarula

On Sun, Feb 17, 2019 at 02:45:52PM +0530, Jagan Teki wrote:
> On Sun, Feb 17, 2019 at 1:21 PM Jagan Teki <jagan@amarulasolutions.com> wrote:
> >
> > Hi Dmitry and Rob,
> >
> > On Thu, Feb 14, 2019 at 3:21 AM Rob Herring <robh@kernel.org> wrote:
> > >
> > > On Tue, Jan 22, 2019 at 7:39 AM Jagan Teki <jagan@amarulasolutions.com> wrote:
> > > >
> > > > On Mon, Jan 21, 2019 at 9:46 PM Rob Herring <robh@kernel.org> wrote:
> > > > >
> > > > > On Fri, Jan 18, 2019 at 10:01 AM Jagan Teki <jagan@amarulasolutions.com> wrote:
> > > > > >
> > > > > > On Wed, Jan 9, 2019 at 7:08 PM Rob Herring <robh@kernel.org> wrote:
> > > > > > >
> > > > > > > Please CC DT list if you want bindings reviewed.
> > > > > >
> > > > > > Sorry I forgot.
> > > > > >
> > > > > > >
> > > > > > > On Wed, Jan 9, 2019 at 1:40 AM Dmitry Torokhov
> > > > > > > <dmitry.torokhov@gmail.com> wrote:
> > > > > > > >
> > > > > > > > On Sat, Dec 15, 2018 at 08:47:59PM +0530, Jagan Teki wrote:
> > > > > > > > > Most of the Goodix CTP controllers are supply with AVDD28 pin.
> > > > > > > > > which need to supply for controllers like GT5663 on some boards
> > > > > > > > > to trigger the power.
> > > > > > > > >
> > > > > > > > > So, document the supply property so-that the require boards
> > > > > > > > > that used on GT5663 can enable it via device tree.
> > > > > > > > >
> > > > > > > > > Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
> > > > > > > > > ---
> > > > > > > > >  Documentation/devicetree/bindings/input/touchscreen/goodix.txt | 1 +
> > > > > > > > >  1 file changed, 1 insertion(+)
> > > > > > > > >
> > > > > > > > > diff --git a/Documentation/devicetree/bindings/input/touchscreen/goodix.txt b/Documentation/devicetree/bindings/input/touchscreen/goodix.txt
> > > > > > > > > index f7e95c52f3c7..c4622c983e08 100644
> > > > > > > > > --- a/Documentation/devicetree/bindings/input/touchscreen/goodix.txt
> > > > > > > > > +++ b/Documentation/devicetree/bindings/input/touchscreen/goodix.txt
> > > > > > > > > @@ -23,6 +23,7 @@ Optional properties:
> > > > > > > > >   - touchscreen-inverted-y  : Y axis is inverted (boolean)
> > > > > > > > >   - touchscreen-swapped-x-y : X and Y axis are swapped (boolean)
> > > > > > > > >                               (swapping is done after inverting the axis)
> > > > > > > > > + - AVDD28-supply     : Analog power supply regulator on AVDD28 pin
> > > > > > > >
> > > > > > > > I think we normally use lower case in DT bindings and rarely encode
> > > > > > > > voltage in the supply name unless we are dealing with several supplies
> > > > > > > > of the same kind, but I'll let Ron comment on this.
> > > > > > >
> > > > > > > Yes on lowercase though there are some exceptions.
> > > > > > >
> > > > > > > There's also a AVDD22 supply as well as DVDD12 and VDDIO. So we
> > > > > > > probably need to keep the voltage, but the binding is incomplete.
> > > > > >
> > > > > > What is incomplete here? can you please elaborate.
> > > > >
> > > > > You are missing the 3 other supplies the chip has: AVDD22, DVDD12 and VDDIO.
> > > >
> > > > Though it has other supplies, only AVDD28 is connected in the Host
> > > > interface design similar like 9. Reference Schematic on Page, 23 in
> > > > attached manual.
> > >
> > > That is for a particular board design. It still has other supplies.
> > > Just make the binding complete please. You can make them optional. I
> > > don't care if the driver supports controlling all the supplies or not
> > > (though Dmitry might).
> >
> > So, Can I make bulk get and enable in all 4 regulators global to
> > driver or specific to that chip, in either way the regulators which
> > are not used to process via dummy regulators (which we all know).
> >
> > or regulator which are not using are get via devm_regulator_get_optional.
> >
> > Any suggestions?
> 
> Just realized to go with bulk calls, please have a look at on v5 [1]

I do not believe you can use bulk regulator API here as you need to
implement the power up timing scheme mentioned on p. 12 of the spec you
referenced earlier. And, because of that timing diagram, I believe if
you want to control AVDD supply, you also have to control VDDIO supply
as it has to be on only after enabling AVDD.

I also wonder if it is valid to have both AVDD28 and AVDD22 connected at
the same time.

Thanks.

-- 
Dmitry

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

* Re: [PATCH v3 1/4] dt-bindings: input: touchscreen: goodix: Document AVDD28-supply property
  2019-02-18  7:12                   ` Dmitry Torokhov
@ 2019-02-18  9:33                     ` Jagan Teki
  2019-02-18 19:30                       ` Jagan Teki
  0 siblings, 1 reply; 23+ messages in thread
From: Jagan Teki @ 2019-02-18  9:33 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: Rob Herring, devicetree, Chen-Yu Tsai, linux-input, linux-kernel,
	Michael Trimarchi, linux-amarula

Hi Dmitry,

On Mon, Feb 18, 2019 at 12:42 PM Dmitry Torokhov
<dmitry.torokhov@gmail.com> wrote:
>
> On Sun, Feb 17, 2019 at 02:45:52PM +0530, Jagan Teki wrote:
> > On Sun, Feb 17, 2019 at 1:21 PM Jagan Teki <jagan@amarulasolutions.com> wrote:
> > >
> > > Hi Dmitry and Rob,
> > >
> > > On Thu, Feb 14, 2019 at 3:21 AM Rob Herring <robh@kernel.org> wrote:
> > > >
> > > > On Tue, Jan 22, 2019 at 7:39 AM Jagan Teki <jagan@amarulasolutions.com> wrote:
> > > > >
> > > > > On Mon, Jan 21, 2019 at 9:46 PM Rob Herring <robh@kernel.org> wrote:
> > > > > >
> > > > > > On Fri, Jan 18, 2019 at 10:01 AM Jagan Teki <jagan@amarulasolutions.com> wrote:
> > > > > > >
> > > > > > > On Wed, Jan 9, 2019 at 7:08 PM Rob Herring <robh@kernel.org> wrote:
> > > > > > > >
> > > > > > > > Please CC DT list if you want bindings reviewed.
> > > > > > >
> > > > > > > Sorry I forgot.
> > > > > > >
> > > > > > > >
> > > > > > > > On Wed, Jan 9, 2019 at 1:40 AM Dmitry Torokhov
> > > > > > > > <dmitry.torokhov@gmail.com> wrote:
> > > > > > > > >
> > > > > > > > > On Sat, Dec 15, 2018 at 08:47:59PM +0530, Jagan Teki wrote:
> > > > > > > > > > Most of the Goodix CTP controllers are supply with AVDD28 pin.
> > > > > > > > > > which need to supply for controllers like GT5663 on some boards
> > > > > > > > > > to trigger the power.
> > > > > > > > > >
> > > > > > > > > > So, document the supply property so-that the require boards
> > > > > > > > > > that used on GT5663 can enable it via device tree.
> > > > > > > > > >
> > > > > > > > > > Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
> > > > > > > > > > ---
> > > > > > > > > >  Documentation/devicetree/bindings/input/touchscreen/goodix.txt | 1 +
> > > > > > > > > >  1 file changed, 1 insertion(+)
> > > > > > > > > >
> > > > > > > > > > diff --git a/Documentation/devicetree/bindings/input/touchscreen/goodix.txt b/Documentation/devicetree/bindings/input/touchscreen/goodix.txt
> > > > > > > > > > index f7e95c52f3c7..c4622c983e08 100644
> > > > > > > > > > --- a/Documentation/devicetree/bindings/input/touchscreen/goodix.txt
> > > > > > > > > > +++ b/Documentation/devicetree/bindings/input/touchscreen/goodix.txt
> > > > > > > > > > @@ -23,6 +23,7 @@ Optional properties:
> > > > > > > > > >   - touchscreen-inverted-y  : Y axis is inverted (boolean)
> > > > > > > > > >   - touchscreen-swapped-x-y : X and Y axis are swapped (boolean)
> > > > > > > > > >                               (swapping is done after inverting the axis)
> > > > > > > > > > + - AVDD28-supply     : Analog power supply regulator on AVDD28 pin
> > > > > > > > >
> > > > > > > > > I think we normally use lower case in DT bindings and rarely encode
> > > > > > > > > voltage in the supply name unless we are dealing with several supplies
> > > > > > > > > of the same kind, but I'll let Ron comment on this.
> > > > > > > >
> > > > > > > > Yes on lowercase though there are some exceptions.
> > > > > > > >
> > > > > > > > There's also a AVDD22 supply as well as DVDD12 and VDDIO. So we
> > > > > > > > probably need to keep the voltage, but the binding is incomplete.
> > > > > > >
> > > > > > > What is incomplete here? can you please elaborate.
> > > > > >
> > > > > > You are missing the 3 other supplies the chip has: AVDD22, DVDD12 and VDDIO.
> > > > >
> > > > > Though it has other supplies, only AVDD28 is connected in the Host
> > > > > interface design similar like 9. Reference Schematic on Page, 23 in
> > > > > attached manual.
> > > >
> > > > That is for a particular board design. It still has other supplies.
> > > > Just make the binding complete please. You can make them optional. I
> > > > don't care if the driver supports controlling all the supplies or not
> > > > (though Dmitry might).
> > >
> > > So, Can I make bulk get and enable in all 4 regulators global to
> > > driver or specific to that chip, in either way the regulators which
> > > are not used to process via dummy regulators (which we all know).
> > >
> > > or regulator which are not using are get via devm_regulator_get_optional.
> > >
> > > Any suggestions?
> >
> > Just realized to go with bulk calls, please have a look at on v5 [1]
>
> I do not believe you can use bulk regulator API here as you need to
> implement the power up timing scheme mentioned on p. 12 of the spec you
> referenced earlier. And, because of that timing diagram, I believe if
> you want to control AVDD supply, you also have to control VDDIO supply
> as it has to be on only after enabling AVDD.

AVDD here is AVDD28 it' is an out name of pin (mentioned in p. 23). So
the power scheme goes to enable AVDD28 and then VDDIO does that really
mean bulk of two regulators?

>
> I also wonder if it is valid to have both AVDD28 and AVDD22 connected at
> the same time.

Yes, DVDD12 and AVDD22 not been part of power-up schema at-least from
the datasheet. I'm thinking we can skip these until any of other
goodix CTP needed, what do you think Rob?

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

* Re: [PATCH v3 1/4] dt-bindings: input: touchscreen: goodix: Document AVDD28-supply property
  2019-02-18  9:33                     ` Jagan Teki
@ 2019-02-18 19:30                       ` Jagan Teki
  2019-02-19  8:15                         ` Dmitry Torokhov
  0 siblings, 1 reply; 23+ messages in thread
From: Jagan Teki @ 2019-02-18 19:30 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: Rob Herring, devicetree, Chen-Yu Tsai, linux-input, linux-kernel,
	Michael Trimarchi, linux-amarula

On Mon, Feb 18, 2019 at 3:03 PM Jagan Teki <jagan@amarulasolutions.com> wrote:
>
> Hi Dmitry,
>
> On Mon, Feb 18, 2019 at 12:42 PM Dmitry Torokhov
> <dmitry.torokhov@gmail.com> wrote:
> >
> > On Sun, Feb 17, 2019 at 02:45:52PM +0530, Jagan Teki wrote:
> > > On Sun, Feb 17, 2019 at 1:21 PM Jagan Teki <jagan@amarulasolutions.com> wrote:
> > > >
> > > > Hi Dmitry and Rob,
> > > >
> > > > On Thu, Feb 14, 2019 at 3:21 AM Rob Herring <robh@kernel.org> wrote:
> > > > >
> > > > > On Tue, Jan 22, 2019 at 7:39 AM Jagan Teki <jagan@amarulasolutions.com> wrote:
> > > > > >
> > > > > > On Mon, Jan 21, 2019 at 9:46 PM Rob Herring <robh@kernel.org> wrote:
> > > > > > >
> > > > > > > On Fri, Jan 18, 2019 at 10:01 AM Jagan Teki <jagan@amarulasolutions.com> wrote:
> > > > > > > >
> > > > > > > > On Wed, Jan 9, 2019 at 7:08 PM Rob Herring <robh@kernel.org> wrote:
> > > > > > > > >
> > > > > > > > > Please CC DT list if you want bindings reviewed.
> > > > > > > >
> > > > > > > > Sorry I forgot.
> > > > > > > >
> > > > > > > > >
> > > > > > > > > On Wed, Jan 9, 2019 at 1:40 AM Dmitry Torokhov
> > > > > > > > > <dmitry.torokhov@gmail.com> wrote:
> > > > > > > > > >
> > > > > > > > > > On Sat, Dec 15, 2018 at 08:47:59PM +0530, Jagan Teki wrote:
> > > > > > > > > > > Most of the Goodix CTP controllers are supply with AVDD28 pin.
> > > > > > > > > > > which need to supply for controllers like GT5663 on some boards
> > > > > > > > > > > to trigger the power.
> > > > > > > > > > >
> > > > > > > > > > > So, document the supply property so-that the require boards
> > > > > > > > > > > that used on GT5663 can enable it via device tree.
> > > > > > > > > > >
> > > > > > > > > > > Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
> > > > > > > > > > > ---
> > > > > > > > > > >  Documentation/devicetree/bindings/input/touchscreen/goodix.txt | 1 +
> > > > > > > > > > >  1 file changed, 1 insertion(+)
> > > > > > > > > > >
> > > > > > > > > > > diff --git a/Documentation/devicetree/bindings/input/touchscreen/goodix.txt b/Documentation/devicetree/bindings/input/touchscreen/goodix.txt
> > > > > > > > > > > index f7e95c52f3c7..c4622c983e08 100644
> > > > > > > > > > > --- a/Documentation/devicetree/bindings/input/touchscreen/goodix.txt
> > > > > > > > > > > +++ b/Documentation/devicetree/bindings/input/touchscreen/goodix.txt
> > > > > > > > > > > @@ -23,6 +23,7 @@ Optional properties:
> > > > > > > > > > >   - touchscreen-inverted-y  : Y axis is inverted (boolean)
> > > > > > > > > > >   - touchscreen-swapped-x-y : X and Y axis are swapped (boolean)
> > > > > > > > > > >                               (swapping is done after inverting the axis)
> > > > > > > > > > > + - AVDD28-supply     : Analog power supply regulator on AVDD28 pin
> > > > > > > > > >
> > > > > > > > > > I think we normally use lower case in DT bindings and rarely encode
> > > > > > > > > > voltage in the supply name unless we are dealing with several supplies
> > > > > > > > > > of the same kind, but I'll let Ron comment on this.
> > > > > > > > >
> > > > > > > > > Yes on lowercase though there are some exceptions.
> > > > > > > > >
> > > > > > > > > There's also a AVDD22 supply as well as DVDD12 and VDDIO. So we
> > > > > > > > > probably need to keep the voltage, but the binding is incomplete.
> > > > > > > >
> > > > > > > > What is incomplete here? can you please elaborate.
> > > > > > >
> > > > > > > You are missing the 3 other supplies the chip has: AVDD22, DVDD12 and VDDIO.
> > > > > >
> > > > > > Though it has other supplies, only AVDD28 is connected in the Host
> > > > > > interface design similar like 9. Reference Schematic on Page, 23 in
> > > > > > attached manual.
> > > > >
> > > > > That is for a particular board design. It still has other supplies.
> > > > > Just make the binding complete please. You can make them optional. I
> > > > > don't care if the driver supports controlling all the supplies or not
> > > > > (though Dmitry might).
> > > >
> > > > So, Can I make bulk get and enable in all 4 regulators global to
> > > > driver or specific to that chip, in either way the regulators which
> > > > are not used to process via dummy regulators (which we all know).
> > > >
> > > > or regulator which are not using are get via devm_regulator_get_optional.
> > > >
> > > > Any suggestions?
> > >
> > > Just realized to go with bulk calls, please have a look at on v5 [1]
> >
> > I do not believe you can use bulk regulator API here as you need to
> > implement the power up timing scheme mentioned on p. 12 of the spec you
> > referenced earlier. And, because of that timing diagram, I believe if
> > you want to control AVDD supply, you also have to control VDDIO supply
> > as it has to be on only after enabling AVDD.
>
> AVDD here is AVDD28 it' is an out name of pin (mentioned in p. 23). So
> the power scheme goes to enable AVDD28 and then VDDIO does that really
> mean bulk of two regulators?

The time between these two regulator operations is nearly 0, as per
power scheme diagram T1 >= 0us. I think I can use bulk since there is
no necessity of delay between these two regulator operations.

What do you think?

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

* Re: [PATCH v3 1/4] dt-bindings: input: touchscreen: goodix: Document AVDD28-supply property
  2019-02-18 19:30                       ` Jagan Teki
@ 2019-02-19  8:15                         ` Dmitry Torokhov
  2019-02-19  8:45                           ` Jagan Teki
  0 siblings, 1 reply; 23+ messages in thread
From: Dmitry Torokhov @ 2019-02-19  8:15 UTC (permalink / raw)
  To: Jagan Teki
  Cc: Rob Herring, devicetree, Chen-Yu Tsai, linux-input, linux-kernel,
	Michael Trimarchi, linux-amarula

On Tue, Feb 19, 2019 at 01:00:19AM +0530, Jagan Teki wrote:
> On Mon, Feb 18, 2019 at 3:03 PM Jagan Teki <jagan@amarulasolutions.com> wrote:
> >
> > Hi Dmitry,
> >
> > On Mon, Feb 18, 2019 at 12:42 PM Dmitry Torokhov
> > <dmitry.torokhov@gmail.com> wrote:
> > >
> > > On Sun, Feb 17, 2019 at 02:45:52PM +0530, Jagan Teki wrote:
> > > > On Sun, Feb 17, 2019 at 1:21 PM Jagan Teki <jagan@amarulasolutions.com> wrote:
> > > > >
> > > > > Hi Dmitry and Rob,
> > > > >
> > > > > On Thu, Feb 14, 2019 at 3:21 AM Rob Herring <robh@kernel.org> wrote:
> > > > > >
> > > > > > On Tue, Jan 22, 2019 at 7:39 AM Jagan Teki <jagan@amarulasolutions.com> wrote:
> > > > > > >
> > > > > > > On Mon, Jan 21, 2019 at 9:46 PM Rob Herring <robh@kernel.org> wrote:
> > > > > > > >
> > > > > > > > On Fri, Jan 18, 2019 at 10:01 AM Jagan Teki <jagan@amarulasolutions.com> wrote:
> > > > > > > > >
> > > > > > > > > On Wed, Jan 9, 2019 at 7:08 PM Rob Herring <robh@kernel.org> wrote:
> > > > > > > > > >
> > > > > > > > > > Please CC DT list if you want bindings reviewed.
> > > > > > > > >
> > > > > > > > > Sorry I forgot.
> > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > On Wed, Jan 9, 2019 at 1:40 AM Dmitry Torokhov
> > > > > > > > > > <dmitry.torokhov@gmail.com> wrote:
> > > > > > > > > > >
> > > > > > > > > > > On Sat, Dec 15, 2018 at 08:47:59PM +0530, Jagan Teki wrote:
> > > > > > > > > > > > Most of the Goodix CTP controllers are supply with AVDD28 pin.
> > > > > > > > > > > > which need to supply for controllers like GT5663 on some boards
> > > > > > > > > > > > to trigger the power.
> > > > > > > > > > > >
> > > > > > > > > > > > So, document the supply property so-that the require boards
> > > > > > > > > > > > that used on GT5663 can enable it via device tree.
> > > > > > > > > > > >
> > > > > > > > > > > > Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
> > > > > > > > > > > > ---
> > > > > > > > > > > >  Documentation/devicetree/bindings/input/touchscreen/goodix.txt | 1 +
> > > > > > > > > > > >  1 file changed, 1 insertion(+)
> > > > > > > > > > > >
> > > > > > > > > > > > diff --git a/Documentation/devicetree/bindings/input/touchscreen/goodix.txt b/Documentation/devicetree/bindings/input/touchscreen/goodix.txt
> > > > > > > > > > > > index f7e95c52f3c7..c4622c983e08 100644
> > > > > > > > > > > > --- a/Documentation/devicetree/bindings/input/touchscreen/goodix.txt
> > > > > > > > > > > > +++ b/Documentation/devicetree/bindings/input/touchscreen/goodix.txt
> > > > > > > > > > > > @@ -23,6 +23,7 @@ Optional properties:
> > > > > > > > > > > >   - touchscreen-inverted-y  : Y axis is inverted (boolean)
> > > > > > > > > > > >   - touchscreen-swapped-x-y : X and Y axis are swapped (boolean)
> > > > > > > > > > > >                               (swapping is done after inverting the axis)
> > > > > > > > > > > > + - AVDD28-supply     : Analog power supply regulator on AVDD28 pin
> > > > > > > > > > >
> > > > > > > > > > > I think we normally use lower case in DT bindings and rarely encode
> > > > > > > > > > > voltage in the supply name unless we are dealing with several supplies
> > > > > > > > > > > of the same kind, but I'll let Ron comment on this.
> > > > > > > > > >
> > > > > > > > > > Yes on lowercase though there are some exceptions.
> > > > > > > > > >
> > > > > > > > > > There's also a AVDD22 supply as well as DVDD12 and VDDIO. So we
> > > > > > > > > > probably need to keep the voltage, but the binding is incomplete.
> > > > > > > > >
> > > > > > > > > What is incomplete here? can you please elaborate.
> > > > > > > >
> > > > > > > > You are missing the 3 other supplies the chip has: AVDD22, DVDD12 and VDDIO.
> > > > > > >
> > > > > > > Though it has other supplies, only AVDD28 is connected in the Host
> > > > > > > interface design similar like 9. Reference Schematic on Page, 23 in
> > > > > > > attached manual.
> > > > > >
> > > > > > That is for a particular board design. It still has other supplies.
> > > > > > Just make the binding complete please. You can make them optional. I
> > > > > > don't care if the driver supports controlling all the supplies or not
> > > > > > (though Dmitry might).
> > > > >
> > > > > So, Can I make bulk get and enable in all 4 regulators global to
> > > > > driver or specific to that chip, in either way the regulators which
> > > > > are not used to process via dummy regulators (which we all know).
> > > > >
> > > > > or regulator which are not using are get via devm_regulator_get_optional.
> > > > >
> > > > > Any suggestions?
> > > >
> > > > Just realized to go with bulk calls, please have a look at on v5 [1]
> > >
> > > I do not believe you can use bulk regulator API here as you need to
> > > implement the power up timing scheme mentioned on p. 12 of the spec you
> > > referenced earlier. And, because of that timing diagram, I believe if
> > > you want to control AVDD supply, you also have to control VDDIO supply
> > > as it has to be on only after enabling AVDD.
> >
> > AVDD here is AVDD28 it' is an out name of pin (mentioned in p. 23). So
> > the power scheme goes to enable AVDD28 and then VDDIO does that really
> > mean bulk of two regulators?
> 
> The time between these two regulator operations is nearly 0, as per
> power scheme diagram T1 >= 0us. I think I can use bulk since there is
> no necessity of delay between these two regulator operations.
> 
> What do you think?

Does the bulk enable provide any guarantees as to the order of
operations? If it does not then I think we should ensure that they are
powered up/down in the right order.

Thanks.

-- 
Dmitry

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

* Re: [PATCH v3 1/4] dt-bindings: input: touchscreen: goodix: Document AVDD28-supply property
  2019-02-19  8:15                         ` Dmitry Torokhov
@ 2019-02-19  8:45                           ` Jagan Teki
  0 siblings, 0 replies; 23+ messages in thread
From: Jagan Teki @ 2019-02-19  8:45 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: Rob Herring, devicetree, Chen-Yu Tsai, linux-input, linux-kernel,
	Michael Trimarchi, linux-amarula

On Tue, Feb 19, 2019 at 1:45 PM Dmitry Torokhov
<dmitry.torokhov@gmail.com> wrote:
>
> On Tue, Feb 19, 2019 at 01:00:19AM +0530, Jagan Teki wrote:
> > On Mon, Feb 18, 2019 at 3:03 PM Jagan Teki <jagan@amarulasolutions.com> wrote:
> > >
> > > Hi Dmitry,
> > >
> > > On Mon, Feb 18, 2019 at 12:42 PM Dmitry Torokhov
> > > <dmitry.torokhov@gmail.com> wrote:
> > > >
> > > > On Sun, Feb 17, 2019 at 02:45:52PM +0530, Jagan Teki wrote:
> > > > > On Sun, Feb 17, 2019 at 1:21 PM Jagan Teki <jagan@amarulasolutions.com> wrote:
> > > > > >
> > > > > > Hi Dmitry and Rob,
> > > > > >
> > > > > > On Thu, Feb 14, 2019 at 3:21 AM Rob Herring <robh@kernel.org> wrote:
> > > > > > >
> > > > > > > On Tue, Jan 22, 2019 at 7:39 AM Jagan Teki <jagan@amarulasolutions.com> wrote:
> > > > > > > >
> > > > > > > > On Mon, Jan 21, 2019 at 9:46 PM Rob Herring <robh@kernel.org> wrote:
> > > > > > > > >
> > > > > > > > > On Fri, Jan 18, 2019 at 10:01 AM Jagan Teki <jagan@amarulasolutions.com> wrote:
> > > > > > > > > >
> > > > > > > > > > On Wed, Jan 9, 2019 at 7:08 PM Rob Herring <robh@kernel.org> wrote:
> > > > > > > > > > >
> > > > > > > > > > > Please CC DT list if you want bindings reviewed.
> > > > > > > > > >
> > > > > > > > > > Sorry I forgot.
> > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > > On Wed, Jan 9, 2019 at 1:40 AM Dmitry Torokhov
> > > > > > > > > > > <dmitry.torokhov@gmail.com> wrote:
> > > > > > > > > > > >
> > > > > > > > > > > > On Sat, Dec 15, 2018 at 08:47:59PM +0530, Jagan Teki wrote:
> > > > > > > > > > > > > Most of the Goodix CTP controllers are supply with AVDD28 pin.
> > > > > > > > > > > > > which need to supply for controllers like GT5663 on some boards
> > > > > > > > > > > > > to trigger the power.
> > > > > > > > > > > > >
> > > > > > > > > > > > > So, document the supply property so-that the require boards
> > > > > > > > > > > > > that used on GT5663 can enable it via device tree.
> > > > > > > > > > > > >
> > > > > > > > > > > > > Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
> > > > > > > > > > > > > ---
> > > > > > > > > > > > >  Documentation/devicetree/bindings/input/touchscreen/goodix.txt | 1 +
> > > > > > > > > > > > >  1 file changed, 1 insertion(+)
> > > > > > > > > > > > >
> > > > > > > > > > > > > diff --git a/Documentation/devicetree/bindings/input/touchscreen/goodix.txt b/Documentation/devicetree/bindings/input/touchscreen/goodix.txt
> > > > > > > > > > > > > index f7e95c52f3c7..c4622c983e08 100644
> > > > > > > > > > > > > --- a/Documentation/devicetree/bindings/input/touchscreen/goodix.txt
> > > > > > > > > > > > > +++ b/Documentation/devicetree/bindings/input/touchscreen/goodix.txt
> > > > > > > > > > > > > @@ -23,6 +23,7 @@ Optional properties:
> > > > > > > > > > > > >   - touchscreen-inverted-y  : Y axis is inverted (boolean)
> > > > > > > > > > > > >   - touchscreen-swapped-x-y : X and Y axis are swapped (boolean)
> > > > > > > > > > > > >                               (swapping is done after inverting the axis)
> > > > > > > > > > > > > + - AVDD28-supply     : Analog power supply regulator on AVDD28 pin
> > > > > > > > > > > >
> > > > > > > > > > > > I think we normally use lower case in DT bindings and rarely encode
> > > > > > > > > > > > voltage in the supply name unless we are dealing with several supplies
> > > > > > > > > > > > of the same kind, but I'll let Ron comment on this.
> > > > > > > > > > >
> > > > > > > > > > > Yes on lowercase though there are some exceptions.
> > > > > > > > > > >
> > > > > > > > > > > There's also a AVDD22 supply as well as DVDD12 and VDDIO. So we
> > > > > > > > > > > probably need to keep the voltage, but the binding is incomplete.
> > > > > > > > > >
> > > > > > > > > > What is incomplete here? can you please elaborate.
> > > > > > > > >
> > > > > > > > > You are missing the 3 other supplies the chip has: AVDD22, DVDD12 and VDDIO.
> > > > > > > >
> > > > > > > > Though it has other supplies, only AVDD28 is connected in the Host
> > > > > > > > interface design similar like 9. Reference Schematic on Page, 23 in
> > > > > > > > attached manual.
> > > > > > >
> > > > > > > That is for a particular board design. It still has other supplies.
> > > > > > > Just make the binding complete please. You can make them optional. I
> > > > > > > don't care if the driver supports controlling all the supplies or not
> > > > > > > (though Dmitry might).
> > > > > >
> > > > > > So, Can I make bulk get and enable in all 4 regulators global to
> > > > > > driver or specific to that chip, in either way the regulators which
> > > > > > are not used to process via dummy regulators (which we all know).
> > > > > >
> > > > > > or regulator which are not using are get via devm_regulator_get_optional.
> > > > > >
> > > > > > Any suggestions?
> > > > >
> > > > > Just realized to go with bulk calls, please have a look at on v5 [1]
> > > >
> > > > I do not believe you can use bulk regulator API here as you need to
> > > > implement the power up timing scheme mentioned on p. 12 of the spec you
> > > > referenced earlier. And, because of that timing diagram, I believe if
> > > > you want to control AVDD supply, you also have to control VDDIO supply
> > > > as it has to be on only after enabling AVDD.
> > >
> > > AVDD here is AVDD28 it' is an out name of pin (mentioned in p. 23). So
> > > the power scheme goes to enable AVDD28 and then VDDIO does that really
> > > mean bulk of two regulators?
> >
> > The time between these two regulator operations is nearly 0, as per
> > power scheme diagram T1 >= 0us. I think I can use bulk since there is
> > no necessity of delay between these two regulator operations.
> >
> > What do you think?
>
> Does the bulk enable provide any guarantees as to the order of
> operations? If it does not then I think we should ensure that they are
> powered up/down in the right order.

At-least I can saw from the log, async enables based on the definition
of supply arrays. Indeed the regulators with bulk calls enables based
on the supply array order, this is what I usually think.

[    3.676483] Goodix-TS 1-005d: 1-005d supply VDDIO not found, using
dummy regulator
[    3.693159] regulator_bulk_enable_async: Supply AVDD28
[    3.693162] regulator_bulk_enable_async: Supply VDDIO
[    3.806095] Goodix-TS 1-005d: ID 5663, version: 0100

Do we need to go reverse order for power-down? I couldn't see this
information on the datasheet. If yes then we need to go for normal
calls.

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

end of thread, other threads:[~2019-02-19  8:45 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-15 15:17 [PATCH v3 0/4] input: touchscreen: Add goodix GT5553 CTP support Jagan Teki
2018-12-15 15:17 ` [PATCH v3 1/4] dt-bindings: input: touchscreen: goodix: Document AVDD28-supply property Jagan Teki
2019-01-07 22:58   ` Dmitry Torokhov
2019-01-09 13:37     ` Rob Herring
2019-01-18 16:01       ` Jagan Teki
2019-01-21 16:16         ` Rob Herring
2019-01-22 13:38           ` Jagan Teki
2019-01-24  4:32             ` Jagan Teki
2019-02-13 21:51             ` Rob Herring
2019-02-17  7:51               ` Jagan Teki
2019-02-17  9:15                 ` Jagan Teki
2019-02-18  7:12                   ` Dmitry Torokhov
2019-02-18  9:33                     ` Jagan Teki
2019-02-18 19:30                       ` Jagan Teki
2019-02-19  8:15                         ` Dmitry Torokhov
2019-02-19  8:45                           ` Jagan Teki
2018-12-15 15:18 ` [PATCH v3 2/4] Input: goodix - Add AVDD28-supply regulator support Jagan Teki
2019-01-07 23:00   ` Dmitry Torokhov
2019-01-31 20:00     ` Jagan Teki
2019-02-01  8:18       ` Dmitry Torokhov
2018-12-15 15:18 ` [PATCH v3 3/4] dt-bindings: input: touchscreen: goodix: Add GT5663 compatible Jagan Teki
2018-12-15 15:18 ` [PATCH v3 4/4] Input: goodix - Add GT5663 CTP support Jagan Teki
2019-01-06 16:38 ` [PATCH v3 0/4] input: touchscreen: Add goodix GT5553 " Jagan Teki

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.