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

From: Lu Baolu
Date: Tue Apr 26 2016 - 21:54:22 EST


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 are reported via ACPI
>> tables and (devm_)gpiod_get() hides the APCI complexity and returns
>> the gpiod according to "gpio_name".
> That's labelling that you might want to do on the supplier side or at
> system level.

The labeling is done at firmware level (ACPI 5.1). It uses _DSD
configuration object to give names to GPIOs. There are systems
which don't contain _DSD. On those platforms, Linux kernel
could do this instead.

Please refer to Documentation/acpi/gpio-properties.txt.

> Why does the device care?It's requesting the GPIO in
> its own context and it's only requesting one GPIO, with DT we're just
> always calling the GPIO "gpio" which works fine.

This driver is not bound to an ACPI device node directly. It's a child
of a mfd device, which is corresponding to a real ACPI device node.

I agree with you that we should not retrieve gpio name from the
device provider. Driver should have the knowledge of the gpio name.
(Please correct me if I didn't understand your point right. :-) )


Best regards,
Lu Baolu