Re: [PATCH v6 04/10] regulator: fixed: add support for ACPI interface

2016-04-28 Thread Lu Baolu
Hi, On 04/29/2016 01:15 AM, Mark Brown wrote: > On Thu, Apr 28, 2016 at 01:55:35PM +0800, Lu Baolu wrote: > >> How about below code? >> + gpiod = gpiod_get(dev, "vbus_en", GPIOD_ASIS); >> + if (IS_ERR(gpiod)) >> + return PTR_ERR(gpiod); >> + >> + config->gpio =

Re: [PATCH v6 04/10] regulator: fixed: add support for ACPI interface

2016-04-28 Thread Lu Baolu
Hi, On 04/29/2016 01:15 AM, Mark Brown wrote: > On Thu, Apr 28, 2016 at 01:55:35PM +0800, Lu Baolu wrote: > >> How about below code? >> + gpiod = gpiod_get(dev, "vbus_en", GPIOD_ASIS); >> + if (IS_ERR(gpiod)) >> + return PTR_ERR(gpiod); >> + >> + config->gpio =

Re: [PATCH v6 04/10] regulator: fixed: add support for ACPI interface

2016-04-28 Thread Mark Brown
On Thu, Apr 28, 2016 at 01:55:35PM +0800, Lu Baolu wrote: > How about below code? > + gpiod = gpiod_get(dev, "vbus_en", GPIOD_ASIS); > + if (IS_ERR(gpiod)) > + return PTR_ERR(gpiod); > + > + config->gpio = desc_to_gpio(gpiod); > + config->enable_high =

Re: [PATCH v6 04/10] regulator: fixed: add support for ACPI interface

2016-04-28 Thread Mark Brown
On Thu, Apr 28, 2016 at 01:55:35PM +0800, Lu Baolu wrote: > How about below code? > + gpiod = gpiod_get(dev, "vbus_en", GPIOD_ASIS); > + if (IS_ERR(gpiod)) > + return PTR_ERR(gpiod); > + > + config->gpio = desc_to_gpio(gpiod); > + config->enable_high =

Re: [PATCH v6 04/10] regulator: fixed: add support for ACPI interface

2016-04-27 Thread Lu Baolu
Hi, On 04/27/2016 08:33 PM, Mark Brown wrote: > On Wed, Apr 27, 2016 at 09:54:10AM +0800, Lu Baolu wrote: > >> Please refer to Documentation/acpi/gpio-properties.txt. > That's not visibly what your driver is doing, that is also recommending > using a static name which is what I'm asking for.

Re: [PATCH v6 04/10] regulator: fixed: add support for ACPI interface

2016-04-27 Thread Lu Baolu
Hi, On 04/27/2016 08:33 PM, Mark Brown wrote: > On Wed, Apr 27, 2016 at 09:54:10AM +0800, Lu Baolu wrote: > >> Please refer to Documentation/acpi/gpio-properties.txt. > That's not visibly what your driver is doing, that is also recommending > using a static name which is what I'm asking for.

Re: [PATCH v6 04/10] regulator: fixed: add support for ACPI interface

2016-04-27 Thread Mark Brown
On Wed, Apr 27, 2016 at 09:54:10AM +0800, Lu Baolu wrote: > Please refer to Documentation/acpi/gpio-properties.txt. That's not visibly what your driver is doing, that is also recommending using a static name which is what I'm asking for. > > Why does the device care?It's requesting the GPIO in

Re: [PATCH v6 04/10] regulator: fixed: add support for ACPI interface

2016-04-27 Thread Mark Brown
On Wed, Apr 27, 2016 at 09:54:10AM +0800, Lu Baolu wrote: > Please refer to Documentation/acpi/gpio-properties.txt. That's not visibly what your driver is doing, that is also recommending using a static name which is what I'm asking for. > > Why does the device care?It's requesting the GPIO in

Re: [PATCH v6 04/10] regulator: fixed: add support for ACPI interface

2016-04-26 Thread Lu Baolu
Hi, On 04/26/2016 06:23 PM, Mark Brown wrote: > On Tue, Apr 26, 2016 at 10:24:56AM +0800, Lu Baolu wrote: > >> The GPIO name might be different in different use cases. For my case, >> it is "vbus_en", but other cases should use the different name. >> On ACPI compatible platforms, GPIO resources

Re: [PATCH v6 04/10] regulator: fixed: add support for ACPI interface

2016-04-26 Thread Lu Baolu
Hi, On 04/26/2016 06:23 PM, Mark Brown wrote: > On Tue, Apr 26, 2016 at 10:24:56AM +0800, Lu Baolu wrote: > >> The GPIO name might be different in different use cases. For my case, >> it is "vbus_en", but other cases should use the different name. >> On ACPI compatible platforms, GPIO resources

Re: [PATCH v6 04/10] regulator: fixed: add support for ACPI interface

2016-04-26 Thread Mark Brown
On Tue, Apr 26, 2016 at 10:24:56AM +0800, Lu Baolu wrote: > The GPIO name might be different in different use cases. For my case, > it is "vbus_en", but other cases should use the different name. > On ACPI compatible platforms, GPIO resources are reported via ACPI > tables and (devm_)gpiod_get()

Re: [PATCH v6 04/10] regulator: fixed: add support for ACPI interface

2016-04-26 Thread Mark Brown
On Tue, Apr 26, 2016 at 10:24:56AM +0800, Lu Baolu wrote: > The GPIO name might be different in different use cases. For my case, > it is "vbus_en", but other cases should use the different name. > On ACPI compatible platforms, GPIO resources are reported via ACPI > tables and (devm_)gpiod_get()

Re: [PATCH v6 04/10] regulator: fixed: add support for ACPI interface

2016-04-25 Thread Lu Baolu
Hi Mark, On 04/26/2016 01:30 AM, Mark Brown wrote: > On Mon, Apr 25, 2016 at 04:04:50PM +0800, Lu Baolu wrote: > >> +ret = device_property_read_string(dev, "gpio-name", _name); >> +if (!ret) { >> +gpiod = gpiod_get(dev, gpio_name, GPIOD_ASIS); >> +if

Re: [PATCH v6 04/10] regulator: fixed: add support for ACPI interface

2016-04-25 Thread Lu Baolu
Hi Mark, On 04/26/2016 01:30 AM, Mark Brown wrote: > On Mon, Apr 25, 2016 at 04:04:50PM +0800, Lu Baolu wrote: > >> +ret = device_property_read_string(dev, "gpio-name", _name); >> +if (!ret) { >> +gpiod = gpiod_get(dev, gpio_name, GPIOD_ASIS); >> +if

Re: [PATCH v6 04/10] regulator: fixed: add support for ACPI interface

2016-04-25 Thread Mark Brown
On Mon, Apr 25, 2016 at 04:04:50PM +0800, Lu Baolu wrote: > + ret = device_property_read_string(dev, "gpio-name", _name); > + if (!ret) { > + gpiod = gpiod_get(dev, gpio_name, GPIOD_ASIS); > + if (!IS_ERR(gpiod)) { This doesn't look like it's a standard ACPI

Re: [PATCH v6 04/10] regulator: fixed: add support for ACPI interface

2016-04-25 Thread Mark Brown
On Mon, Apr 25, 2016 at 04:04:50PM +0800, Lu Baolu wrote: > + ret = device_property_read_string(dev, "gpio-name", _name); > + if (!ret) { > + gpiod = gpiod_get(dev, gpio_name, GPIOD_ASIS); > + if (!IS_ERR(gpiod)) { This doesn't look like it's a standard ACPI

[PATCH v6 04/10] regulator: fixed: add support for ACPI interface

2016-04-25 Thread Lu Baolu
Add support to retrieve fixed voltage configure information through ACPI interface. This is needed for Intel Bay Trail devices, where a GPIO is used to control the USB vbus. Signed-off-by: Lu Baolu --- drivers/regulator/fixed.c | 48

[PATCH v6 04/10] regulator: fixed: add support for ACPI interface

2016-04-25 Thread Lu Baolu
Add support to retrieve fixed voltage configure information through ACPI interface. This is needed for Intel Bay Trail devices, where a GPIO is used to control the USB vbus. Signed-off-by: Lu Baolu --- drivers/regulator/fixed.c | 48 +++ 1 file