* [PATCH v4 0/2] Add ili9882t bindings and timing @ 2023-06-08 13:01 Cong Yang 2023-06-08 13:01 ` [PATCH v4 1/2] dt-bindings: HID: i2c-hid: ilitek: Introduce bindings for Ilitek ili9882t Cong Yang 2023-06-08 13:01 ` [PATCH v4 2/2] HID: i2c-hid: elan: Add ili9882t timing Cong Yang 0 siblings, 2 replies; 8+ messages in thread From: Cong Yang @ 2023-06-08 13:01 UTC (permalink / raw) To: robh+dt, krzysztof.kozlowski+dt, conor+dt, dmitry.torokhov, jikos, benjamin.tissoires, dianders, hsinyi Cc: linux-input, devicetree, linux-kernel, Cong Yang Add bindings for Ilitek. The ili9882t touch screen chip same as Elan eKTH6915 controller has a reset gpio. The difference is that ilitek9882 needs to use vccio-supply instead of vcc33-supply. From Dmitry suggestion, it would make more sense to distinguish the binging of ili9882 and eKTH6915. From The datasheet specifies there should be 60ms between touch SDA sleep and panel RESX. so we can add the 65 ms delay in i2c_hid_core_suspend. Changes in v4: - PATCH 1/2: Remove compatible items and add reset maxItems. - PATCH 1/2: Refer to the panel description in Doug serias[1]. [1] https://lore.kernel.org/all/20230607144931.v2.1.Id68e30343bb1e11470582a9078b086176cfec46b@changeid/ - PATCH 2/2: Set a "null" to ili9882t_chip_data for vcc33-supply, then using dummy regulator. - Link to v3: https://lore.kernel.org/all/20230607133458.4075667-1-yangcong5@huaqin.corp-partner.google.com/ Changes in v3: - PATCH 1/2: Introduce bindings for Ilitek. - Link to v2: https://lore.kernel.org/all/20230605060524.1178164-1-yangcong5@huaqin.corp-partner.google.com/ Changes in v2: - PATCH 1/2: fix ran make dt_binding_check warnings/errors. - PATCH 1/2: remove oneOf,just enum. - Link to v1: https://lore.kernel.org/all/20230602140948.2138668-1-yangcong5@huaqin.corp-partner.google.com/ Cong Yang (2): dt-bindings: HID: i2c-hid: ilitek: Introduce bindings for Ilitek ili9882t HID: i2c-hid: elan: Add ili9882t timing .../bindings/input/ilitek,ili9882t.yaml | 66 +++++++++++++++++++ drivers/hid/i2c-hid/i2c-hid-of-elan.c | 33 ++++++++-- 2 files changed, 92 insertions(+), 7 deletions(-) create mode 100644 Documentation/devicetree/bindings/input/ilitek,ili9882t.yaml -- 2.25.1 ^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v4 1/2] dt-bindings: HID: i2c-hid: ilitek: Introduce bindings for Ilitek ili9882t 2023-06-08 13:01 [PATCH v4 0/2] Add ili9882t bindings and timing Cong Yang @ 2023-06-08 13:01 ` Cong Yang 2023-06-08 13:37 ` Doug Anderson 2023-06-09 15:50 ` Krzysztof Kozlowski 2023-06-08 13:01 ` [PATCH v4 2/2] HID: i2c-hid: elan: Add ili9882t timing Cong Yang 1 sibling, 2 replies; 8+ messages in thread From: Cong Yang @ 2023-06-08 13:01 UTC (permalink / raw) To: robh+dt, krzysztof.kozlowski+dt, conor+dt, dmitry.torokhov, jikos, benjamin.tissoires, dianders, hsinyi Cc: linux-input, devicetree, linux-kernel, Cong Yang The ili9882t touch screen chip same as Elan eKTH6915 controller has a reset gpio. The difference is that ili9882t needs to use vccio-supply instead of vcc33-supply. Doug's series[1] allows panels and touchscreens to power on/off together, let's add a phandle for this. [1]: https://lore.kernel.org/r/20230607215224.2067679-1-dianders@chromium.org Signed-off-by: Cong Yang <yangcong5@huaqin.corp-partner.google.com> --- .../bindings/input/ilitek,ili9882t.yaml | 66 +++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 Documentation/devicetree/bindings/input/ilitek,ili9882t.yaml diff --git a/Documentation/devicetree/bindings/input/ilitek,ili9882t.yaml b/Documentation/devicetree/bindings/input/ilitek,ili9882t.yaml new file mode 100644 index 000000000000..89584264d6a2 --- /dev/null +++ b/Documentation/devicetree/bindings/input/ilitek,ili9882t.yaml @@ -0,0 +1,66 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/input/ilitek,ili9882t.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Ilitek ili9882t touchscreen controller + +maintainers: + - Dmitry Torokhov <dmitry.torokhov@gmail.com> + +description: + Supports the Ilitek ili9882t touchscreen controller. + This touchscreen controller uses the i2c-hid protocol with a reset GPIO. + +allOf: + - $ref: /schemas/input/touchscreen/touchscreen.yaml# + +properties: + compatible: + const: ilitek,ili9882t + + reg: + const: 0x41 + + interrupts: + maxItems: 1 + + panel: true + + reset-gpios: + maxItems: 1 + description: Reset GPIO. + + + vccio-supply: + description: The 1.8V supply to the touchscreen. + +required: + - compatible + - reg + - interrupts + - vccio-supply + +additionalProperties: false + +examples: + - | + #include <dt-bindings/gpio/gpio.h> + #include <dt-bindings/interrupt-controller/irq.h> + + i2c { + #address-cells = <1>; + #size-cells = <0>; + + touchscreen: touchscreen@41 { + compatible = "ilitek,ili9882t"; + reg = <0x41>; + + interrupt-parent = <&pio>; + interrupts = <12 IRQ_TYPE_LEVEL_LOW>; + + reset-gpios = <&pio 60 GPIO_ACTIVE_LOW>; + vccio-supply = <&mt6366_vio18_reg>; + }; + }; -- 2.25.1 ^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH v4 1/2] dt-bindings: HID: i2c-hid: ilitek: Introduce bindings for Ilitek ili9882t 2023-06-08 13:01 ` [PATCH v4 1/2] dt-bindings: HID: i2c-hid: ilitek: Introduce bindings for Ilitek ili9882t Cong Yang @ 2023-06-08 13:37 ` Doug Anderson 2023-06-09 15:50 ` Krzysztof Kozlowski 1 sibling, 0 replies; 8+ messages in thread From: Doug Anderson @ 2023-06-08 13:37 UTC (permalink / raw) To: Cong Yang Cc: robh+dt, krzysztof.kozlowski+dt, conor+dt, dmitry.torokhov, jikos, benjamin.tissoires, hsinyi, linux-input, devicetree, linux-kernel Hi, On Thu, Jun 8, 2023 at 6:02 AM Cong Yang <yangcong5@huaqin.corp-partner.google.com> wrote: > > @@ -0,0 +1,66 @@ > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) > +%YAML 1.2 > +--- > +$id: http://devicetree.org/schemas/input/ilitek,ili9882t.yaml# > +$schema: http://devicetree.org/meta-schemas/core.yaml# > + > +title: Ilitek ili9882t touchscreen controller > + > +maintainers: > + - Dmitry Torokhov <dmitry.torokhov@gmail.com> Has Dmitry agreed to be the maintainer here? Traditionally when adding a new file one lists themselves. > +description: > + Supports the Ilitek ili9882t touchscreen controller. > + This touchscreen controller uses the i2c-hid protocol with a reset GPIO. > + > +allOf: > + - $ref: /schemas/input/touchscreen/touchscreen.yaml# > + > +properties: > + compatible: > + const: ilitek,ili9882t > + > + reg: > + const: 0x41 > + > + interrupts: > + maxItems: 1 > + > + panel: true > + > + reset-gpios: > + maxItems: 1 > + description: Reset GPIO. > + > + > + vccio-supply: > + description: The 1.8V supply to the touchscreen. Why two blank lines between reset-gpios and vccio-supply? > +required: > + - compatible > + - reg > + - interrupts > + - vccio-supply I think you want "panel" as a required property too, right? > +examples: > + - | > + #include <dt-bindings/gpio/gpio.h> > + #include <dt-bindings/interrupt-controller/irq.h> > + > + i2c { > + #address-cells = <1>; > + #size-cells = <0>; > + > + touchscreen: touchscreen@41 { > + compatible = "ilitek,ili9882t"; > + reg = <0x41>; > + > + interrupt-parent = <&pio>; > + interrupts = <12 IRQ_TYPE_LEVEL_LOW>; > + > + reset-gpios = <&pio 60 GPIO_ACTIVE_LOW>; > + vccio-supply = <&mt6366_vio18_reg>; ...and "panel" would also need to go in the above example. ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v4 1/2] dt-bindings: HID: i2c-hid: ilitek: Introduce bindings for Ilitek ili9882t 2023-06-08 13:01 ` [PATCH v4 1/2] dt-bindings: HID: i2c-hid: ilitek: Introduce bindings for Ilitek ili9882t Cong Yang 2023-06-08 13:37 ` Doug Anderson @ 2023-06-09 15:50 ` Krzysztof Kozlowski 2023-06-09 15:56 ` Doug Anderson 1 sibling, 1 reply; 8+ messages in thread From: Krzysztof Kozlowski @ 2023-06-09 15:50 UTC (permalink / raw) To: Cong Yang, robh+dt, krzysztof.kozlowski+dt, conor+dt, dmitry.torokhov, jikos, benjamin.tissoires, dianders, hsinyi Cc: linux-input, devicetree, linux-kernel On 08/06/2023 15:01, Cong Yang wrote: > The ili9882t touch screen chip same as Elan eKTH6915 controller > has a reset gpio. The difference is that ili9882t needs to use > vccio-supply instead of vcc33-supply. Doug's series[1] allows panels > and touchscreens to power on/off together, let's add a phandle for this. > > [1]: https://lore.kernel.org/r/20230607215224.2067679-1-dianders@chromium.org > > Signed-off-by: Cong Yang <yangcong5@huaqin.corp-partner.google.com> > --- > .../bindings/input/ilitek,ili9882t.yaml | 66 +++++++++++++++++++ > 1 file changed, 66 insertions(+) > create mode 100644 Documentation/devicetree/bindings/input/ilitek,ili9882t.yaml > > diff --git a/Documentation/devicetree/bindings/input/ilitek,ili9882t.yaml b/Documentation/devicetree/bindings/input/ilitek,ili9882t.yaml > new file mode 100644 > index 000000000000..89584264d6a2 > --- /dev/null > +++ b/Documentation/devicetree/bindings/input/ilitek,ili9882t.yaml > @@ -0,0 +1,66 @@ > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) > +%YAML 1.2 > +--- > +$id: http://devicetree.org/schemas/input/ilitek,ili9882t.yaml# > +$schema: http://devicetree.org/meta-schemas/core.yaml# > + > +title: Ilitek ili9882t touchscreen controller > + > +maintainers: > + - Dmitry Torokhov <dmitry.torokhov@gmail.com> This usually should not be subsystem maintainer. > + > +description: > + Supports the Ilitek ili9882t touchscreen controller. > + This touchscreen controller uses the i2c-hid protocol with a reset GPIO. > + > +allOf: > + - $ref: /schemas/input/touchscreen/touchscreen.yaml# > + > +properties: > + compatible: > + const: ilitek,ili9882t > + > + reg: > + const: 0x41 > + > + interrupts: > + maxItems: 1 > + > + panel: true > + > + reset-gpios: > + maxItems: 1 > + description: Reset GPIO. > + > + Just one blank line. > + vccio-supply: > + description: The 1.8V supply to the touchscreen. > + > +required: > + - compatible > + - reg > + - interrupts > + - vccio-supply > + > +additionalProperties: false Why do you disallow all properties from toouchscreen.yaml? Aren't they applicable? Best regards, Krzysztof ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v4 1/2] dt-bindings: HID: i2c-hid: ilitek: Introduce bindings for Ilitek ili9882t 2023-06-09 15:50 ` Krzysztof Kozlowski @ 2023-06-09 15:56 ` Doug Anderson 2023-06-09 15:59 ` Krzysztof Kozlowski 0 siblings, 1 reply; 8+ messages in thread From: Doug Anderson @ 2023-06-09 15:56 UTC (permalink / raw) To: Krzysztof Kozlowski Cc: Cong Yang, robh+dt, krzysztof.kozlowski+dt, conor+dt, dmitry.torokhov, jikos, benjamin.tissoires, hsinyi, linux-input, devicetree, linux-kernel Hi, On Fri, Jun 9, 2023 at 8:50 AM Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> wrote: > > > + vccio-supply: > > + description: The 1.8V supply to the touchscreen. > > + > > +required: > > + - compatible > > + - reg > > + - interrupts > > + - vccio-supply > > + > > +additionalProperties: false > > Why do you disallow all properties from toouchscreen.yaml? Aren't they > applicable? This matches what hid-over-i2c.yaml does. It only picks `touchscreen-inverted-x` and `touchscreen-inverted-y` from the common file, which aren't needed here. I assume that the rest of the things from the common file can be probed using the i2c-hid protocol? -Doug ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v4 1/2] dt-bindings: HID: i2c-hid: ilitek: Introduce bindings for Ilitek ili9882t 2023-06-09 15:56 ` Doug Anderson @ 2023-06-09 15:59 ` Krzysztof Kozlowski 0 siblings, 0 replies; 8+ messages in thread From: Krzysztof Kozlowski @ 2023-06-09 15:59 UTC (permalink / raw) To: Doug Anderson Cc: Cong Yang, robh+dt, krzysztof.kozlowski+dt, conor+dt, dmitry.torokhov, jikos, benjamin.tissoires, hsinyi, linux-input, devicetree, linux-kernel On 09/06/2023 17:56, Doug Anderson wrote: > Hi, > > On Fri, Jun 9, 2023 at 8:50 AM Krzysztof Kozlowski > <krzysztof.kozlowski@linaro.org> wrote: >> >>> + vccio-supply: >>> + description: The 1.8V supply to the touchscreen. >>> + >>> +required: >>> + - compatible >>> + - reg >>> + - interrupts >>> + - vccio-supply >>> + >>> +additionalProperties: false >> >> Why do you disallow all properties from toouchscreen.yaml? Aren't they >> applicable? > > This matches what hid-over-i2c.yaml does. It only picks > `touchscreen-inverted-x` and `touchscreen-inverted-y` from the common > file, which aren't needed here. I assume that the rest of the things > from the common file can be probed using the i2c-hid protocol? OK Best regards, Krzysztof ^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v4 2/2] HID: i2c-hid: elan: Add ili9882t timing 2023-06-08 13:01 [PATCH v4 0/2] Add ili9882t bindings and timing Cong Yang 2023-06-08 13:01 ` [PATCH v4 1/2] dt-bindings: HID: i2c-hid: ilitek: Introduce bindings for Ilitek ili9882t Cong Yang @ 2023-06-08 13:01 ` Cong Yang 2023-06-08 13:38 ` Doug Anderson 1 sibling, 1 reply; 8+ messages in thread From: Cong Yang @ 2023-06-08 13:01 UTC (permalink / raw) To: robh+dt, krzysztof.kozlowski+dt, conor+dt, dmitry.torokhov, jikos, benjamin.tissoires, dianders, hsinyi Cc: linux-input, devicetree, linux-kernel, Cong Yang The ili9882t is a TDDI IC (Touch with Display Driver). The datasheet specifies there should be 60ms between touch SDA sleep and panel RESX. Doug's series[1] allows panels and touchscreens to power on/off together, so we can add the 65 ms delay in i2c_hid_core_suspend before panel_unprepare. Beacuse ilitek9882 touchscrgeen is a panel follower, and needs to use vccio-supply instead of vcc33-supply, so set it "null" to ili9882t_chip_data, then using dummy regulator. [1]: https://lore.kernel.org/r/20230607215224.2067679-1-dianders@chromium.org Signed-off-by: Cong Yang <yangcong5@huaqin.corp-partner.google.com> --- drivers/hid/i2c-hid/i2c-hid-of-elan.c | 33 +++++++++++++++++++++------ 1 file changed, 26 insertions(+), 7 deletions(-) diff --git a/drivers/hid/i2c-hid/i2c-hid-of-elan.c b/drivers/hid/i2c-hid/i2c-hid-of-elan.c index 76ddc8be1cbb..40e6b8ebe8d1 100644 --- a/drivers/hid/i2c-hid/i2c-hid-of-elan.c +++ b/drivers/hid/i2c-hid/i2c-hid-of-elan.c @@ -18,9 +18,11 @@ #include "i2c-hid.h" struct elan_i2c_hid_chip_data { - unsigned int post_gpio_reset_delay_ms; + unsigned int post_gpio_reset_on_delay_ms; + unsigned int post_gpio_reset_off_delay_ms; unsigned int post_power_delay_ms; u16 hid_descriptor_address; + const char *main_supply_name; }; struct i2c_hid_of_elan { @@ -52,8 +54,8 @@ static int elan_i2c_hid_power_up(struct i2chid_ops *ops) msleep(ihid_elan->chip_data->post_power_delay_ms); gpiod_set_value_cansleep(ihid_elan->reset_gpio, 0); - if (ihid_elan->chip_data->post_gpio_reset_delay_ms) - msleep(ihid_elan->chip_data->post_gpio_reset_delay_ms); + if (ihid_elan->chip_data->post_gpio_reset_on_delay_ms) + msleep(ihid_elan->chip_data->post_gpio_reset_on_delay_ms); return 0; } @@ -64,6 +66,9 @@ static void elan_i2c_hid_power_down(struct i2chid_ops *ops) container_of(ops, struct i2c_hid_of_elan, ops); gpiod_set_value_cansleep(ihid_elan->reset_gpio, 1); + if (ihid_elan->chip_data->post_gpio_reset_off_delay_ms) + msleep(ihid_elan->chip_data->post_gpio_reset_off_delay_ms); + regulator_disable(ihid_elan->vccio); regulator_disable(ihid_elan->vcc33); } @@ -89,24 +94,38 @@ static int i2c_hid_of_elan_probe(struct i2c_client *client) if (IS_ERR(ihid_elan->vccio)) return PTR_ERR(ihid_elan->vccio); - ihid_elan->vcc33 = devm_regulator_get(&client->dev, "vcc33"); + ihid_elan->chip_data = device_get_match_data(&client->dev); + + ihid_elan->vcc33 = devm_regulator_get(&client->dev, ihid_elan->chip_data->main_supply_name); if (IS_ERR(ihid_elan->vcc33)) return PTR_ERR(ihid_elan->vcc33); - ihid_elan->chip_data = device_get_match_data(&client->dev); - return i2c_hid_core_probe(client, &ihid_elan->ops, ihid_elan->chip_data->hid_descriptor_address, 0); } static const struct elan_i2c_hid_chip_data elan_ekth6915_chip_data = { .post_power_delay_ms = 1, - .post_gpio_reset_delay_ms = 300, + .post_gpio_reset_on_delay_ms = 300, + .hid_descriptor_address = 0x0001, + .main_supply_name = "vcc33", +}; + +static const struct elan_i2c_hid_chip_data ilitek_ili9882t_chip_data = { + .post_power_delay_ms = 1, + .post_gpio_reset_on_delay_ms = 200, + .post_gpio_reset_off_delay_ms = 65, .hid_descriptor_address = 0x0001, + /* this touchscreen is tightly integrated with the panel and assumes + * that the relevant power rails (other than the IO rail) have already + * been turned on by the panel driver because we're a panel follower. + */ + .main_supply_name = "null", }; static const struct of_device_id elan_i2c_hid_of_match[] = { { .compatible = "elan,ekth6915", .data = &elan_ekth6915_chip_data }, + { .compatible = "ilitek,ili9882t", .data = &ilitek_ili9882t_chip_data }, { } }; MODULE_DEVICE_TABLE(of, elan_i2c_hid_of_match); -- 2.25.1 ^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH v4 2/2] HID: i2c-hid: elan: Add ili9882t timing 2023-06-08 13:01 ` [PATCH v4 2/2] HID: i2c-hid: elan: Add ili9882t timing Cong Yang @ 2023-06-08 13:38 ` Doug Anderson 0 siblings, 0 replies; 8+ messages in thread From: Doug Anderson @ 2023-06-08 13:38 UTC (permalink / raw) To: Cong Yang Cc: robh+dt, krzysztof.kozlowski+dt, conor+dt, dmitry.torokhov, jikos, benjamin.tissoires, hsinyi, linux-input, devicetree, linux-kernel Hi, On Thu, Jun 8, 2023 at 6:02 AM Cong Yang <yangcong5@huaqin.corp-partner.google.com> wrote: > > +static const struct elan_i2c_hid_chip_data ilitek_ili9882t_chip_data = { > + .post_power_delay_ms = 1, > + .post_gpio_reset_on_delay_ms = 200, > + .post_gpio_reset_off_delay_ms = 65, > .hid_descriptor_address = 0x0001, > + /* this touchscreen is tightly integrated with the panel and assumes > + * that the relevant power rails (other than the IO rail) have already > + * been turned on by the panel driver because we're a panel follower. > + */ I don't think the above is the right block comment style for this file. The first "/*" should be on a line on its own. > + .main_supply_name = "null", This should actually be NULL without the quotes. ...then you should change the code not to try to grab the regulator in that case. ^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2023-06-09 16:00 UTC | newest] Thread overview: 8+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2023-06-08 13:01 [PATCH v4 0/2] Add ili9882t bindings and timing Cong Yang 2023-06-08 13:01 ` [PATCH v4 1/2] dt-bindings: HID: i2c-hid: ilitek: Introduce bindings for Ilitek ili9882t Cong Yang 2023-06-08 13:37 ` Doug Anderson 2023-06-09 15:50 ` Krzysztof Kozlowski 2023-06-09 15:56 ` Doug Anderson 2023-06-09 15:59 ` Krzysztof Kozlowski 2023-06-08 13:01 ` [PATCH v4 2/2] HID: i2c-hid: elan: Add ili9882t timing Cong Yang 2023-06-08 13:38 ` Doug Anderson
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).