From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Douglas Anderson <dianders@chromium.org>
Cc: Bjorn Andersson <andersson@kernel.org>,
Rob Herring <robh+dt@kernel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
Jiri Kosina <jikos@kernel.org>,
Benjamin Tissoires <benjamin.tissoires@redhat.com>,
linux-input@vger.kernel.org, linux-arm-msm@vger.kernel.org,
devicetree@vger.kernel.org, Stephen Kitt <steve@sk2.org>,
Konrad Dybcio <konrad.dybcio@linaro.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 6/7] HID: i2c-hid: goodix: Add mainboard-vddio-supply
Date: Mon, 6 Feb 2023 20:02:11 -0800 [thread overview]
Message-ID: <Y+HNQ/md9sUAqkU2@google.com> (raw)
In-Reply-To: <20230206184744.6.Ic234b931025d1f920ce9e06fff294643943a65ad@changeid>
On Mon, Feb 06, 2023 at 06:48:15PM -0800, Douglas Anderson wrote:
> As talked about in the patch ("dt-bindings: HID: i2c-hid: goodix: Add
> mainboard-vddio-supply") we may need to power up a 1.8V rail on the
> host associated with touchscreen IO. Let's add support in the driver
> for it.
>
> Signed-off-by: Douglas Anderson <dianders@chromium.org>
Reviewed-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> ---
> Unfortunately, I haven't been able to actually test this on real
> hardware yet. However, the change is very simple, I believe it is
> correct, and it doesn't break other boards I've tested it on.
>
> drivers/hid/i2c-hid/i2c-hid-of-goodix.c | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/drivers/hid/i2c-hid/i2c-hid-of-goodix.c b/drivers/hid/i2c-hid/i2c-hid-of-goodix.c
> index 584d833dc0aa..0060e3dcd775 100644
> --- a/drivers/hid/i2c-hid/i2c-hid-of-goodix.c
> +++ b/drivers/hid/i2c-hid/i2c-hid-of-goodix.c
> @@ -26,6 +26,7 @@ struct i2c_hid_of_goodix {
> struct i2chid_ops ops;
>
> struct regulator *vdd;
> + struct regulator *vddio;
> struct gpio_desc *reset_gpio;
> const struct goodix_i2c_hid_timing_data *timings;
> };
> @@ -40,6 +41,10 @@ static int goodix_i2c_hid_power_up(struct i2chid_ops *ops)
> if (ret)
> return ret;
>
> + ret = regulator_enable(ihid_goodix->vddio);
> + if (ret)
> + return ret;
> +
> if (ihid_goodix->timings->post_power_delay_ms)
> msleep(ihid_goodix->timings->post_power_delay_ms);
>
> @@ -56,6 +61,7 @@ static void goodix_i2c_hid_power_down(struct i2chid_ops *ops)
> container_of(ops, struct i2c_hid_of_goodix, ops);
>
> gpiod_set_value_cansleep(ihid_goodix->reset_gpio, 1);
> + regulator_disable(ihid_goodix->vddio);
> regulator_disable(ihid_goodix->vdd);
> }
>
> @@ -81,6 +87,10 @@ static int i2c_hid_of_goodix_probe(struct i2c_client *client)
> if (IS_ERR(ihid_goodix->vdd))
> return PTR_ERR(ihid_goodix->vdd);
>
> + ihid_goodix->vddio = devm_regulator_get(&client->dev, "mainboard-vddio");
> + if (IS_ERR(ihid_goodix->vddio))
> + return PTR_ERR(ihid_goodix->vddio);
> +
> ihid_goodix->timings = device_get_match_data(&client->dev);
>
> return i2c_hid_core_probe(client, &ihid_goodix->ops, 0x0001, 0);
> --
> 2.39.1.519.gcb327c4b5f-goog
>
--
Dmitry
next prev parent reply other threads:[~2023-02-07 4:02 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-07 2:48 [PATCH 0/7] arm: qcom: Fix touchscreen voltage for sc7280-herobrine boards Douglas Anderson
2023-02-07 2:48 ` [PATCH 1/7] arm64: dts: qcom: sc7280: On QCard, regulator L3C should be 1.8V Douglas Anderson
2023-02-07 18:12 ` Matthias Kaehlcke
2023-02-07 2:48 ` [PATCH 2/7] arm64: dts: qcom: sc7280: Add 3ms ramp to herobrine's pp3300_left_in_mlb Douglas Anderson
2023-02-07 18:15 ` Matthias Kaehlcke
2023-02-07 2:48 ` [PATCH 3/7] arm64: dts: qcom: sc7280: Hook up the touchscreen IO rail on villager Douglas Anderson
2023-02-07 18:18 ` Matthias Kaehlcke
2023-02-07 2:48 ` [PATCH 4/7] HID: i2c-hid: goodix: Stop tying the reset line to the regulator Douglas Anderson
2023-02-07 3:58 ` Dmitry Torokhov
2023-02-07 18:31 ` Matthias Kaehlcke
2023-02-07 2:48 ` [PATCH 5/7] dt-bindings: HID: i2c-hid: goodix: Add mainboard-vddio-supply Douglas Anderson
2023-02-07 4:01 ` Dmitry Torokhov
2023-02-07 21:19 ` Rob Herring
2023-02-07 2:48 ` [PATCH 6/7] " Douglas Anderson
2023-02-07 4:02 ` Dmitry Torokhov [this message]
2023-02-07 18:46 ` Matthias Kaehlcke
2023-02-07 2:48 ` [PATCH 7/7] arm64: dts: qcom: sc7280: Hook up the touchscreen IO rail on evoker Douglas Anderson
2023-02-07 18:47 ` Matthias Kaehlcke
2023-02-09 4:22 ` (subset) [PATCH 0/7] arm: qcom: Fix touchscreen voltage for sc7280-herobrine boards Bjorn Andersson
2023-02-09 13:50 ` Benjamin Tissoires
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Y+HNQ/md9sUAqkU2@google.com \
--to=dmitry.torokhov@gmail.com \
--cc=andersson@kernel.org \
--cc=benjamin.tissoires@redhat.com \
--cc=devicetree@vger.kernel.org \
--cc=dianders@chromium.org \
--cc=jikos@kernel.org \
--cc=konrad.dybcio@linaro.org \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=robh+dt@kernel.org \
--cc=steve@sk2.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®