Re: [PATCH] Input: ads7846: add regulator support

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

 



On Thu, Feb 4, 2010 at 4:24 PM, Mark Brown
<broonie@xxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
> On Thu, Feb 04, 2010 at 03:39:18PM +0200, Grazvydas Ignotas wrote:
>
>> The ADS7846/TSC2046 touchscreen controllers can (and usually are)
>> connected to various regulators for power, so add regulator support.
>> Make it optional for now to avoid breaking all current users of this
>> driver.
>
> This should not be required.  The regulator API stubs itself out when it
> is not built so all API calls report as successful.

ok

>
>> +     ts->reg = regulator_get(&spi->dev, "vcc");
>> +     if (!IS_ERR(ts->reg)) {
>> +             err = regulator_enable(ts->reg);
>> +             if (err)
>> +                     goto err_put_regulator;
>> +     }
>
> If the regulator API is not compiled in then the regulator_get() will
> return succesfully.  If the regulator API is in use then failure to
> acquire the regulator is a serious problem which really should be at a
> minimium be being communicated to the user.  For example, the regulator
> API may end up powering down regulators which it believes are unused or
> the regulator may not be powered by default and needs to be enabled.
>
> The updates to fix up the boards that need this are fairly
> straightforward and given that it's fairly easy to identify systems
> which are using the driver in mainline so I'd really prefer not to go
> down the route of trying to carry on in the face of error, it papers
> over stuff now but is not robust in the face of future changes.

What about warning and continuing only on ENODEV then? I really don't
want to be responsible for potentially breaking touchscreen on ~30
boards, where I have no idea about how things are wired up and how the
regulators should be set up.
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux