Re: [PATCH 2/2 v1] Input: cy8ctma140 - add driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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: signature.asc
Description: PGP signature


[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux