Re: [PATCH] HID: i2c-hid: Add vddl regulator control

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

 



Quoting Dmitry Torokhov (2018-05-31 15:03:36)
> On Thu, May 31, 2018 at 1:42 PM, Stephen Boyd <swboyd@xxxxxxxxxxxx> wrote:
> > Some wacom w9013 devices have a vddl supply for "low voltage"
> > requirements. Add support in this driver to turn on this low voltage
> > supply.
> >
> > Cc: Benjamin Tissoires <benjamin.tissoires@xxxxxxxxxx>
> > Cc: Hans de Goede <hdegoede@xxxxxxxxxx>
> > Cc: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
> > Cc: Dmitry Torokhov <dtor@xxxxxxxxxxxx>
> > Cc: Doug Anderson <dianders@xxxxxxxxxxxx>
> > Cc: <devicetree@xxxxxxxxxxxxxxx>
> > Signed-off-by: Stephen Boyd <swboyd@xxxxxxxxxxxx>
> > ---
> >  .../bindings/input/hid-over-i2c.txt           |  3 ++-
> >  drivers/hid/i2c-hid/i2c-hid.c                 | 19 +++++++++++++++++++
> >  include/linux/platform_data/i2c-hid.h         |  2 ++
> >  3 files changed, 23 insertions(+), 1 deletion(-)
> >
> > diff --git a/Documentation/devicetree/bindings/input/hid-over-i2c.txt b/Documentation/devicetree/bindings/input/hid-over-i2c.txt
> > index 4d3da9d91de4..89e6ab89ba38 100644
> > --- a/Documentation/devicetree/bindings/input/hid-over-i2c.txt
> > +++ b/Documentation/devicetree/bindings/input/hid-over-i2c.txt
> > @@ -26,7 +26,8 @@ device-specific compatible properties, which should be used in addition to the
> >
> >  - compatible:
> >    * "wacom,w9013" (Wacom W9013 digitizer). Supports:
> > -    - vdd-supply
> > +    - vdd-supply (3.3V)
> > +    - vddl-supply (1.8V)
> >      - post-power-on-delay-ms
> >
> >  - vdd-supply: phandle of the regulator that provides the supply voltage.
> > diff --git a/drivers/hid/i2c-hid/i2c-hid.c b/drivers/hid/i2c-hid/i2c-hid.c
> > index 6e803f361249..b6f02f98fec6 100644
> > --- a/drivers/hid/i2c-hid/i2c-hid.c
> > +++ b/drivers/hid/i2c-hid/i2c-hid.c
> > @@ -1032,12 +1032,29 @@ static int i2c_hid_probe(struct i2c_client *client,
> >                 goto err;
> >         }
> >
> > +       ihid->pdata.supply_l = devm_regulator_get(&client->dev, "vddl");
> > +       if (IS_ERR(ihid->pdata.supply_l)) {
> > +               ret = PTR_ERR(ihid->pdata.supply_l);
> > +               if (ret != -EPROBE_DEFER)
> > +                       dev_err(&client->dev, "Failed to get regulator: %d\n",
> > +                               ret);
> > +               goto err;
> > +       }
> > +
> >         ret = regulator_enable(ihid->pdata.supply);
> >         if (ret < 0) {
> >                 dev_err(&client->dev, "Failed to enable regulator: %d\n",
> >                         ret);
> >                 goto err;
> >         }
> > +
> > +       ret = regulator_enable(ihid->pdata.supply_l);
> > +       if (ret < 0) {
> > +               dev_err(&client->dev, "Failed to enable low regulator: %d\n",
> > +                       ret);
> > +               goto err_regulator_l;
> > +       }
> > +
> 
> Since there don't seem to be any timing constraints between powering
> various supplies, maybe use bulk regulator API?
> 

Sure. I left it as is because this driver uses a platform data structure
and converting that to a bulk regulator looked more invasive. I'll
attempt to change it to bulk APIs.

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[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