Re: [PATCH 6/6] Input: edt-ft5x06 - add supply voltage support

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

 



On 19-09-17 19:35, Andy Shevchenko wrote:
> On Tue, Sep 17, 2019 at 05:58:08PM +0200, Marco Felsch wrote:
> > Currently the driver do not care about the regulator which supplies the
> > controller. This can lead into problems since we support (deep-)sleep
> > because the regulator can be turned off before we send the (deep-)sleep
> > command to the controller. Using a own regulator improves the power
> > consumption during sleep even more.
> 
> > +	tsdata->vdd = devm_regulator_get(&client->dev, "vdd");
> > +	if (IS_ERR(tsdata->vdd)) {
> > +		error = PTR_ERR(tsdata->vdd);
> > +		if (error == -EPROBE_DEFER)
> > +			return error;
> 
> Before it worked w/o regulator. You have to make it optional.

devm_regulator_get will return a dummy regulator if no one is specified
so it is optional.

Regards,
  Marco


> 
> > +		dev_err(&client->dev,
> > +			"Failed to request vdd-supply, error %d\n", error);
> > +		return error;
> > +	}
> > +
> > +	error = regulator_enable(tsdata->vdd);
> > +	if (error) {
> > +		dev_err(&client->dev,
> > +			"Failed to enable vdd-supply, error %d\n", error);
> > +		return error;
> > +	}
> 
> -- 
> With Best Regards,
> Andy Shevchenko
> 
> 
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux