@@ -6,7 +6,7 @@ _DSD Device Properties Related to GPIO
66
77With the release of ACPI 5.1, the _DSD configuration object finally
88allows names to be given to GPIOs (and other things as well) returned
9- by _CRS. Previously, we were only able to use an integer index to find
9+ by _CRS. Previously we were only able to use an integer index to find
1010the corresponding GPIO, which is pretty error prone (it depends on
1111the _CRS output ordering, for example).
1212
@@ -49,11 +49,11 @@ index
4949pin
5050 Pin in the GpioIo()/GpioInt() resource. Typically this is zero.
5151active_low
52- If 1, the GPIO is marked as active_low .
52+ If 1, the GPIO is marked as active-low .
5353
5454Since ACPI GpioIo() resource does not have a field saying whether it is
55- active low or high, the "active_low" argument can be used here. Setting
56- it to 1 marks the GPIO as active low.
55+ active- low or active- high, the "active_low" argument can be used here.
56+ Setting it to 1 marks the GPIO as active- low.
5757
5858Note, active_low in _DSD does not make sense for GpioInt() resource and
5959must be 0. GpioInt() resource has its own means of defining it.
@@ -231,8 +231,8 @@ In those cases ACPI device identification objects, _HID, _CID, _CLS, _SUB, _HRV,
231231available to the driver can be used to identify the device and that is supposed
232232to be sufficient to determine the meaning and purpose of all of the GPIO lines
233233listed by the GpioIo()/GpioInt() resources returned by _CRS. In other words,
234- the driver is supposed to know what to use the GpioIo()/GpioInt() resources for
235- once it has identified the device. Having done that, it can simply assign names
234+ the driver is supposed to know what to use from the GpioIo()/GpioInt() resources
235+ for once it has identified the device. Having done that, it can simply assign names
236236to the GPIO lines it is going to use and provide the GPIO subsystem with a
237237mapping between those names and the ACPI GPIO resources corresponding to them.
238238
@@ -252,9 +252,9 @@ question would look like this::
252252 static const struct acpi_gpio_params shutdown_gpio = { 0, 0, false };
253253
254254 static const struct acpi_gpio_mapping bluetooth_acpi_gpios[] = {
255- { "reset-gpios", &reset_gpio, 1 },
256- { "shutdown-gpios", &shutdown_gpio, 1 },
257- { }
255+ { "reset-gpios", &reset_gpio, 1 },
256+ { "shutdown-gpios", &shutdown_gpio, 1 },
257+ { }
258258 };
259259
260260Next, the mapping table needs to be passed as the second argument to
@@ -270,7 +270,7 @@ Using the _CRS fallback
270270
271271If a device does not have _DSD or the driver does not create ACPI GPIO
272272mapping, the Linux GPIO framework refuses to return any GPIOs. This is
273- because the driver does not know what it actually gets. For example if we
273+ because the driver does not know what it actually gets. For example, if we
274274have a device like below::
275275
276276 Device (BTH)
@@ -292,7 +292,7 @@ The driver might expect to get the right GPIO when it does::
292292 ...error handling...
293293
294294but since there is no way to know the mapping between "reset" and
295- the GpioIo() in _CRS desc will hold ERR_PTR(-ENOENT).
295+ the GpioIo() in _CRS the desc will hold ERR_PTR(-ENOENT).
296296
297297The driver author can solve this by passing the mapping explicitly
298298(this is the recommended way and it's documented in the above chapter).
@@ -318,15 +318,15 @@ Case 1::
318318 desc = gpiod_get(dev, "non-null-connection-id", flags);
319319 desc = gpiod_get_index(dev, "non-null-connection-id", index, flags);
320320
321+ Case 1 assumes that corresponding ACPI device description must have
322+ defined device properties and will prevent from getting any GPIO resources
323+ otherwise.
324+
321325Case 2::
322326
323327 desc = gpiod_get(dev, NULL, flags);
324328 desc = gpiod_get_index(dev, NULL, index, flags);
325329
326- Case 1 assumes that corresponding ACPI device description must have
327- defined device properties and will prevent to getting any GPIO resources
328- otherwise.
329-
330330Case 2 explicitly tells GPIO core to look for resources in _CRS.
331331
332332Be aware that gpiod_get_index() in cases 1 and 2, assuming that there
0 commit comments