* [PATCH v5 0/2] Add ili9882t bindings and timing @ 2023-06-09 6:36 Cong Yang 2023-06-09 6:36 ` [PATCH v5 1/2] dt-bindings: HID: i2c-hid: ilitek: Introduce bindings for Ilitek ili9882t Cong Yang 2023-06-09 6:36 ` [PATCH v5 2/2] HID: i2c-hid: elan: Add ili9882t timing Cong Yang 0 siblings, 2 replies; 8+ messages in thread From: Cong Yang @ 2023-06-09 6:36 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 v5: - PATCH 1/2: Add panel as a required in property and examples. - PATCH 2/2: Set a NULL to ili9882t_chip_data for vcc33-supply, then not use vcc33 regulator. - Link to v4: https://lore.kernel.org/all/20230608130147.2835818-1-yangcong5@huaqin.corp-partner.google.com/ 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 | 67 +++++++++++++++++++ drivers/hid/i2c-hid/i2c-hid-of-elan.c | 50 ++++++++++---- 2 files changed, 105 insertions(+), 12 deletions(-) create mode 100644 Documentation/devicetree/bindings/input/ilitek,ili9882t.yaml -- 2.25.1 ^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v5 1/2] dt-bindings: HID: i2c-hid: ilitek: Introduce bindings for Ilitek ili9882t 2023-06-09 6:36 [PATCH v5 0/2] Add ili9882t bindings and timing Cong Yang @ 2023-06-09 6:36 ` Cong Yang 2023-06-09 15:52 ` Krzysztof Kozlowski 2023-06-09 16:00 ` Krzysztof Kozlowski 2023-06-09 6:36 ` [PATCH v5 2/2] HID: i2c-hid: elan: Add ili9882t timing Cong Yang 1 sibling, 2 replies; 8+ messages in thread From: Cong Yang @ 2023-06-09 6:36 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 | 67 +++++++++++++++++++ 1 file changed, 67 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..c5d9e0e919f9 --- /dev/null +++ b/Documentation/devicetree/bindings/input/ilitek,ili9882t.yaml @@ -0,0 +1,67 @@ +# 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: + - Cong Yang <yangcong5@huaqin.corp-partner.google.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 + - panel + - 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>; + + panel = <&panel>; + 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 v5 1/2] dt-bindings: HID: i2c-hid: ilitek: Introduce bindings for Ilitek ili9882t 2023-06-09 6:36 ` [PATCH v5 1/2] dt-bindings: HID: i2c-hid: ilitek: Introduce bindings for Ilitek ili9882t Cong Yang @ 2023-06-09 15:52 ` Krzysztof Kozlowski 2023-06-09 16:00 ` Krzysztof Kozlowski 1 sibling, 0 replies; 8+ messages in thread From: Krzysztof Kozlowski @ 2023-06-09 15:52 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 09/06/2023 08:36, 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> > + > + reset-gpios: > + maxItems: 1 > + description: Reset GPIO. > + > + vccio-supply: > + description: The 1.8V supply to the touchscreen. > + > +required: > + - compatible > + - reg > + - interrupts > + - panel > + - vccio-supply > + > +additionalProperties: false My comment from previous version still applies. Best regards, Krzysztof ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v5 1/2] dt-bindings: HID: i2c-hid: ilitek: Introduce bindings for Ilitek ili9882t 2023-06-09 6:36 ` [PATCH v5 1/2] dt-bindings: HID: i2c-hid: ilitek: Introduce bindings for Ilitek ili9882t Cong Yang 2023-06-09 15:52 ` Krzysztof Kozlowski @ 2023-06-09 16:00 ` Krzysztof Kozlowski 2023-06-14 11:02 ` cong yang 1 sibling, 1 reply; 8+ messages in thread From: Krzysztof Kozlowski @ 2023-06-09 16:00 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 09/06/2023 08:36, 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> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> If there is going to be new version, then: A nit, subject: drop second/last, redundant "bindings for". The "dt-bindings" prefix is already stating that these are bindings. --- This is an automated instruction, just in case, because many review tags are being ignored. If you do not know the process, here is a short explanation: Please add Acked-by/Reviewed-by/Tested-by tags when posting new versions, under or above your Signed-off-by tag. Tools like b4 can help here. However, there's no need to repost patches *only* to add the tags. The upstream maintainer will do that for acks received on the version they apply. https://elixir.bootlin.com/linux/v5.17/source/Documentation/process/submitting-patches.rst#L540 Best regards, Krzysztof ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v5 1/2] dt-bindings: HID: i2c-hid: ilitek: Introduce bindings for Ilitek ili9882t 2023-06-09 16:00 ` Krzysztof Kozlowski @ 2023-06-14 11:02 ` cong yang 0 siblings, 0 replies; 8+ messages in thread From: cong yang @ 2023-06-14 11:02 UTC (permalink / raw) To: Krzysztof Kozlowski Cc: robh+dt, krzysztof.kozlowski+dt, conor+dt, dmitry.torokhov, jikos, benjamin.tissoires, dianders, hsinyi, linux-input, devicetree, linux-kernel Hi,Krzysztof On Sat, Jun 10, 2023 at 12:01 AM Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> wrote: > > On 09/06/2023 08:36, 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> > > > Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> > > If there is going to be new version, then: > A nit, subject: drop second/last, redundant "bindings for". The > "dt-bindings" prefix is already stating that these are bindings. As Doug said,makes sense to land if the panel follower patch series [1] lands. If Doug's series[1] land, i will update this and commit message link in V6. Thank you. > > > --- > > This is an automated instruction, just in case, because many review tags > are being ignored. If you do not know the process, here is a short > explanation: > > Please add Acked-by/Reviewed-by/Tested-by tags when posting new > versions, under or above your Signed-off-by tag. Tools like b4 can help > here. However, there's no need to repost patches *only* to add the tags. > The upstream maintainer will do that for acks received on the version > they apply. > > https://elixir.bootlin.com/linux/v5.17/source/Documentation/process/submitting-patches.rst#L540 > > Best regards, > Krzysztof > ^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v5 2/2] HID: i2c-hid: elan: Add ili9882t timing 2023-06-09 6:36 [PATCH v5 0/2] Add ili9882t bindings and timing Cong Yang 2023-06-09 6:36 ` [PATCH v5 1/2] dt-bindings: HID: i2c-hid: ilitek: Introduce bindings for Ilitek ili9882t Cong Yang @ 2023-06-09 6:36 ` Cong Yang 2023-06-09 16:14 ` Doug Anderson 1 sibling, 1 reply; 8+ messages in thread From: Cong Yang @ 2023-06-09 6:36 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. Because ili9882t touchscrgeen is a panel follower, and needs to use vccio-supply instead of vcc33-supply, so set it NULL to ili9882t_chip_data, then not use vcc33 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 | 50 ++++++++++++++++++++------- 1 file changed, 38 insertions(+), 12 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..5e52027ab60a 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 { @@ -38,9 +40,11 @@ static int elan_i2c_hid_power_up(struct i2chid_ops *ops) container_of(ops, struct i2c_hid_of_elan, ops); int ret; - ret = regulator_enable(ihid_elan->vcc33); - if (ret) - return ret; + if (ihid_elan->vcc33) { + ret = regulator_enable(ihid_elan->vcc33); + if (ret) + return ret; + } ret = regulator_enable(ihid_elan->vccio); if (ret) { @@ -52,8 +56,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,8 +68,12 @@ 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); + if (ihid_elan->vcc33) + regulator_disable(ihid_elan->vcc33); } static int i2c_hid_of_elan_probe(struct i2c_client *client) @@ -89,24 +97,42 @@ 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"); - if (IS_ERR(ihid_elan->vcc33)) - return PTR_ERR(ihid_elan->vcc33); - ihid_elan->chip_data = device_get_match_data(&client->dev); + if (ihid_elan->chip_data->main_supply_name) { + 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); + } + 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 v5 2/2] HID: i2c-hid: elan: Add ili9882t timing 2023-06-09 6:36 ` [PATCH v5 2/2] HID: i2c-hid: elan: Add ili9882t timing Cong Yang @ 2023-06-09 16:14 ` Doug Anderson 2023-06-09 16:14 ` Doug Anderson 0 siblings, 1 reply; 8+ messages in thread From: Doug Anderson @ 2023-06-09 16:14 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 11:36 PM Cong Yang <yangcong5@huaqin.corp-partner.google.com> wrote: > > 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. > > Because ili9882t touchscrgeen is a panel follower, and > needs to use vccio-supply instead of vcc33-supply, so set > it NULL to ili9882t_chip_data, then not use vcc33 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 | 50 ++++++++++++++++++++------- > 1 file changed, 38 insertions(+), 12 deletions(-) This seems reasonable to me now, but only makes sense to land if the panel follower patch series [1] lands. That series is currently at v2 and will at least need a v3. [1] https://lore.kernel.org/r/20230607215224.2067679-1-dianders@chromium.org ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v5 2/2] HID: i2c-hid: elan: Add ili9882t timing 2023-06-09 16:14 ` Doug Anderson @ 2023-06-09 16:14 ` Doug Anderson 0 siblings, 0 replies; 8+ messages in thread From: Doug Anderson @ 2023-06-09 16:14 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 Fri, Jun 9, 2023 at 9:14 AM Doug Anderson <dianders@chromium.org> wrote: > > Hi, > > On Thu, Jun 8, 2023 at 11:36 PM Cong Yang > <yangcong5@huaqin.corp-partner.google.com> wrote: > > > > 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. > > > > Because ili9882t touchscrgeen is a panel follower, and > > needs to use vccio-supply instead of vcc33-supply, so set > > it NULL to ili9882t_chip_data, then not use vcc33 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 | 50 ++++++++++++++++++++------- > > 1 file changed, 38 insertions(+), 12 deletions(-) > > This seems reasonable to me now, but only makes sense to land if the > panel follower patch series [1] lands. That series is currently at v2 > and will at least need a v3. > > [1] https://lore.kernel.org/r/20230607215224.2067679-1-dianders@chromium.org Oh, but I should have added: Reviewed-by: Douglas Anderson <dianders@chromium.org> ^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2023-06-14 11:02 UTC | newest] Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2023-06-09 6:36 [PATCH v5 0/2] Add ili9882t bindings and timing Cong Yang 2023-06-09 6:36 ` [PATCH v5 1/2] dt-bindings: HID: i2c-hid: ilitek: Introduce bindings for Ilitek ili9882t Cong Yang 2023-06-09 15:52 ` Krzysztof Kozlowski 2023-06-09 16:00 ` Krzysztof Kozlowski 2023-06-14 11:02 ` cong yang 2023-06-09 6:36 ` [PATCH v5 2/2] HID: i2c-hid: elan: Add ili9882t timing Cong Yang 2023-06-09 16:14 ` Doug Anderson 2023-06-09 16:14 ` 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).