diff options
| -rw-r--r-- | Documentation/acpi/enumeration.txt | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/Documentation/acpi/enumeration.txt b/Documentation/acpi/enumeration.txt index 9b121a569ab4..750401f91341 100644 --- a/Documentation/acpi/enumeration.txt +++ b/Documentation/acpi/enumeration.txt | |||
| @@ -254,8 +254,13 @@ GPIO support | |||
| 254 | ~~~~~~~~~~~~ | 254 | ~~~~~~~~~~~~ |
| 255 | ACPI 5 introduced two new resources to describe GPIO connections: GpioIo | 255 | ACPI 5 introduced two new resources to describe GPIO connections: GpioIo |
| 256 | and GpioInt. These resources are used be used to pass GPIO numbers used by | 256 | and GpioInt. These resources are used be used to pass GPIO numbers used by |
| 257 | the device to the driver. For example: | 257 | the device to the driver. ACPI 5.1 extended this with _DSD (Device |
| 258 | Specific Data) which made it possible to name the GPIOs among other things. | ||
| 258 | 259 | ||
| 260 | For example: | ||
| 261 | |||
| 262 | Device (DEV) | ||
| 263 | { | ||
| 259 | Method (_CRS, 0, NotSerialized) | 264 | Method (_CRS, 0, NotSerialized) |
| 260 | { | 265 | { |
| 261 | Name (SBUF, ResourceTemplate() | 266 | Name (SBUF, ResourceTemplate() |
| @@ -285,6 +290,18 @@ the device to the driver. For example: | |||
| 285 | Return (SBUF) | 290 | Return (SBUF) |
| 286 | } | 291 | } |
| 287 | 292 | ||
| 293 | // ACPI 5.1 _DSD used for naming the GPIOs | ||
| 294 | Name (_DSD, Package () | ||
| 295 | { | ||
| 296 | ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), | ||
| 297 | Package () | ||
| 298 | { | ||
| 299 | Package () {"power-gpios", Package() {^DEV, 0, 0, 0 }}, | ||
| 300 | Package () {"irq-gpios", Package() {^DEV, 1, 0, 0 }}, | ||
| 301 | } | ||
| 302 | }) | ||
| 303 | ... | ||
| 304 | |||
| 288 | These GPIO numbers are controller relative and path "\\_SB.PCI0.GPI0" | 305 | These GPIO numbers are controller relative and path "\\_SB.PCI0.GPI0" |
| 289 | specifies the path to the controller. In order to use these GPIOs in Linux | 306 | specifies the path to the controller. In order to use these GPIOs in Linux |
| 290 | we need to translate them to the corresponding Linux GPIO descriptors. | 307 | we need to translate them to the corresponding Linux GPIO descriptors. |
| @@ -300,11 +317,11 @@ a code like this: | |||
| 300 | 317 | ||
| 301 | struct gpio_desc *irq_desc, *power_desc; | 318 | struct gpio_desc *irq_desc, *power_desc; |
| 302 | 319 | ||
| 303 | irq_desc = gpiod_get_index(dev, NULL, 1); | 320 | irq_desc = gpiod_get(dev, "irq"); |
| 304 | if (IS_ERR(irq_desc)) | 321 | if (IS_ERR(irq_desc)) |
| 305 | /* handle error */ | 322 | /* handle error */ |
| 306 | 323 | ||
| 307 | power_desc = gpiod_get_index(dev, NULL, 0); | 324 | power_desc = gpiod_get(dev, "power"); |
| 308 | if (IS_ERR(power_desc)) | 325 | if (IS_ERR(power_desc)) |
| 309 | /* handle error */ | 326 | /* handle error */ |
| 310 | 327 | ||
| @@ -313,6 +330,9 @@ a code like this: | |||
| 313 | There are also devm_* versions of these functions which release the | 330 | There are also devm_* versions of these functions which release the |
| 314 | descriptors once the device is released. | 331 | descriptors once the device is released. |
| 315 | 332 | ||
| 333 | See Documentation/acpi/gpio-properties.txt for more information about the | ||
| 334 | _DSD binding related to GPIOs. | ||
| 335 | |||
| 316 | MFD devices | 336 | MFD devices |
| 317 | ~~~~~~~~~~~ | 337 | ~~~~~~~~~~~ |
| 318 | The MFD devices register their children as platform devices. For the child | 338 | The MFD devices register their children as platform devices. For the child |
