From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Cc: linmengbo0689@protonmail.com, alistair@alistair23.me,
devicetree@vger.kernel.org, krzysztof.kozlowski+dt@linaro.org,
linus.walleij@linaro.org, linux-input@vger.kernel.org,
linux-kernel@vger.kernel.org, robh+dt@kernel.org
Subject: Re: [PATCH 2/2] Input: cyttsp5 - add vddio regulator
Date: Thu, 17 Nov 2022 14:15:11 -0800 [thread overview]
Message-ID: <Y3ayb8b9vyQHRabc@google.com> (raw)
In-Reply-To: <4fe0c7c3-f5eb-4c01-8607-ce79a768cb06@wanadoo.fr>
On Thu, Nov 17, 2022 at 10:16:40PM +0100, Christophe JAILLET wrote:
> Le 17/11/2022 à 20:05, Lin, Meng-Bo a écrit :
> > The Samsung touchscreen controllers are often used with external pull-up
> > for the interrupt line and the I2C lines, so we might need to enable
> > a regulator to bring the lines into usable state. Otherwise, this might
> > cause spurious interrupts and reading from I2C will fail.
> >
> > Implement support for a "vddio-supply" that is enabled by the cyttsp5
> > driver so that the regulator gets enabled when needed.
> >
> > Signed-off-by: Lin, Meng-Bo <linmengbo0689-g/b1ySJe57IN+BqQ9rBEUg@public.gmane.org>
> > ---
> > drivers/input/touchscreen/cyttsp5.c | 19 ++++++++++++-------
> > 1 file changed, 12 insertions(+), 7 deletions(-)
> >
> > diff --git a/drivers/input/touchscreen/cyttsp5.c b/drivers/input/touchscreen/cyttsp5.c
> > index 24ab1df9fc07..d02fdb940edf 100644
> > --- a/drivers/input/touchscreen/cyttsp5.c
> > +++ b/drivers/input/touchscreen/cyttsp5.c
> > @@ -190,7 +190,7 @@ struct cyttsp5 {
> > int num_prv_rec;
> > struct regmap *regmap;
> > struct touchscreen_properties prop;
> > - struct regulator *vdd;
> > + struct regulator_bulk_data supplies[2];
> > };
> > /*
> > @@ -767,7 +767,7 @@ static void cyttsp5_cleanup(void *data)
> > {
> > struct cyttsp5 *ts = data;
> > - regulator_disable(ts->vdd);
> > + regulator_bulk_disable(ARRAY_SIZE(ts->supplies), ts->supplies);
> > }
> > static int cyttsp5_probe(struct device *dev, struct regmap *regmap, int irq,
> > @@ -790,9 +790,12 @@ static int cyttsp5_probe(struct device *dev, struct regmap *regmap, int irq,
> > init_completion(&ts->cmd_done);
> > /* Power up the device */
> > - ts->vdd = devm_regulator_get(dev, "vdd");
> > - if (IS_ERR(ts->vdd)) {
> > - error = PTR_ERR(ts->vdd);
> > + ts->supplies[0].supply = "vdd";
> > + ts->supplies[1].supply = "vddio";
> > + error = devm_regulator_bulk_get(dev, ARRAY_SIZE(ts->supplies),
> > + ts->supplies);
> > + if (error < 0) {
> > + dev_err(ts->dev, "Failed to get regulators, error %d\n", error);
>
> Hi,
>
> dev_err_probe()?
> I think that devm_regulator_bulk_get() can return -EPROBE_DEFER;
No, I'd rather we avoid dev_err_probe().
Thanks.
--
Dmitry
next prev parent reply other threads:[~2022-11-17 22:15 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-17 19:05 [PATCH 0/2] Input: cyttsp5 - add vddio regulator Lin, Meng-Bo
2022-11-17 19:05 ` [PATCH 1/2] dt-bindings: input: cyttsp5: document vddio-supply Lin, Meng-Bo
2022-11-18 8:11 ` Krzysztof Kozlowski
2022-11-18 23:27 ` Alistair
2022-11-17 19:05 ` [PATCH 2/2] Input: cyttsp5 - add vddio regulator Lin, Meng-Bo
2022-11-17 21:16 ` Christophe JAILLET
2022-11-17 22:15 ` Dmitry Torokhov [this message]
2022-11-17 22:17 ` Dmitry Torokhov
2022-11-17 22:39 ` Lin, Meng-Bo
2022-11-18 23:29 ` Alistair
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=Y3ayb8b9vyQHRabc@google.com \
--to=dmitry.torokhov@gmail.com \
--cc=alistair@alistair23.me \
--cc=christophe.jaillet@wanadoo.fr \
--cc=devicetree@vger.kernel.org \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=linmengbo0689@protonmail.com \
--cc=linus.walleij@linaro.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=robh+dt@kernel.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