linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Linus Walleij <linus.walleij@linaro.org>,
	Linux Input <linux-input@vger.kernel.org>,
	Henrik Rydberg <rydberg@bitmath.org>
Subject: Re: [PATCH 2/2 v1] Input: cy8ctma140 - add driver
Date: Mon, 16 Mar 2020 11:41:48 +0000	[thread overview]
Message-ID: <20200316114148.GA5010@sirena.org.uk> (raw)
In-Reply-To: <20200315222248.GE192640@dtor-ws>

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

On Sun, Mar 15, 2020 at 03:22:48PM -0700, Dmitry Torokhov wrote:
> On Sun, Mar 15, 2020 at 05:12:29PM +0100, Linus Walleij wrote:

> > > > +     /* According to datasheet this should be in the 2.7-3.6 V range */
> > > > +     ret = regulator_set_voltage(ts->vcpin, 2700000, 3600000);
> > > > +     if (ret) {
> > > > +             dev_err(dev, "failed to set VCPIN voltage\n");
> > > > +             return ret;
> > > > +     }

> > > Shouldn't this already be in DT? We typically do not configure voltage
> > > on various rail unless in very specific circumstances.

> > This is the consumer range, and DT has no facility to put
> > restrictions on the consumer voltage window.

> > I think it is pretty natural to do in the code.

> That means we will have essentially a boilerplate code in many many
> drivers.

> If we indeed want to do this (although I am not sure if practically this
> makes much sense - nobody creates a rail delivering 24 volts by default
> and saying "oh well, when driver loads it will request us to lower the
> voltage down to 1.5V that components attached to the rail require") can
> we consider adding consumer side constraints to the DT so that
> regulator_get() can set the voltage right there and driver does not have
> to? I am just trying to limit the amount of custom code in the drivers.

Consumers shouldn't be setting the voltage at runtime unless they are
actively managing it and will be changing it repeatedly for some reason,
if it's just a case of ensuring that the supply voltage is within spec
for the device that's the job of the machine constraints.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2020-03-16 11:41 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-10 14:28 [PATCH 1/2 v1] dt-bindings: touchscreen: Add CY8CTMA140 bindings Linus Walleij
2020-03-10 14:28 ` [PATCH 2/2 v1] Input: cy8ctma140 - add driver Linus Walleij
2020-03-10 17:08   ` Dmitry Torokhov
2020-03-10 17:09     ` Dmitry Torokhov
2020-03-15 16:12     ` Linus Walleij
2020-03-15 22:22       ` Dmitry Torokhov
2020-03-16 11:41         ` Mark Brown [this message]
2020-03-23 21:32 ` [PATCH 1/2 v1] dt-bindings: touchscreen: Add CY8CTMA140 bindings Rob Herring

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=20200316114148.GA5010@sirena.org.uk \
    --to=broonie@kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-input@vger.kernel.org \
    --cc=rydberg@bitmath.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;
as well as URLs for NNTP newsgroup(s).