Merge branches 'acpi-pm', 'acpi-enumeration' and 'acpi-sysfs'

* acpi-pm:
ACPI / PM: Enable all wakeup GPEs in suspend-to-idle
ACPI / sleep: Drop acpi_suspend() which is not used

* acpi-enumeration:
ACPI: Add acpi_device_uid() for convenience
ACPI: Update GPIO documentation to mention _DSD

* acpi-sysfs:
ACPI / sysfs: Treat the count field of counter_show() as unsigned

+27 -21
+23 -3
Documentation/acpi/enumeration.txt
··· 254 254 ~~~~~~~~~~~~ 255 255 ACPI 5 introduced two new resources to describe GPIO connections: GpioIo 256 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 264 Method (_CRS, 0, NotSerialized) 260 265 { 261 266 Name (SBUF, ResourceTemplate() ··· 290 285 Return (SBUF) 291 286 } 292 287 288 + // ACPI 5.1 _DSD used for naming the GPIOs 289 + Name (_DSD, Package () 290 + { 291 + ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), 292 + Package () 293 + { 294 + Package () {"power-gpios", Package() {^DEV, 0, 0, 0 }}, 295 + Package () {"irq-gpios", Package() {^DEV, 1, 0, 0 }}, 296 + } 297 + }) 298 + ... 299 + 293 300 These GPIO numbers are controller relative and path "\\_SB.PCI0.GPI0" 294 301 specifies the path to the controller. In order to use these GPIOs in Linux 295 302 we need to translate them to the corresponding Linux GPIO descriptors. ··· 317 300 318 301 struct gpio_desc *irq_desc, *power_desc; 319 302 320 - irq_desc = gpiod_get_index(dev, NULL, 1); 303 + irq_desc = gpiod_get(dev, "irq"); 321 304 if (IS_ERR(irq_desc)) 322 305 /* handle error */ 323 306 324 - power_desc = gpiod_get_index(dev, NULL, 0); 307 + power_desc = gpiod_get(dev, "power"); 325 308 if (IS_ERR(power_desc)) 326 309 /* handle error */ 327 310 ··· 329 312 330 313 There are also devm_* versions of these functions which release the 331 314 descriptors once the device is released. 315 + 316 + See Documentation/acpi/gpio-properties.txt for more information about the 317 + _DSD binding related to GPIOs. 332 318 333 319 MFD devices 334 320 ~~~~~~~~~~~
+2 -15
drivers/acpi/sleep.c
··· 629 629 630 630 static int acpi_freeze_prepare(void) 631 631 { 632 + acpi_enable_wakeup_devices(ACPI_STATE_S0); 632 633 acpi_enable_all_wakeup_gpes(); 633 634 acpi_os_wait_events_complete(); 634 635 enable_irq_wake(acpi_gbl_FADT.sci_interrupt); ··· 638 637 639 638 static void acpi_freeze_restore(void) 640 639 { 640 + acpi_disable_wakeup_devices(ACPI_STATE_S0); 641 641 disable_irq_wake(acpi_gbl_FADT.sci_interrupt); 642 642 acpi_enable_all_runtime_gpes(); 643 643 } ··· 807 805 #else /* !CONFIG_HIBERNATION */ 808 806 static inline void acpi_sleep_hibernate_setup(void) {} 809 807 #endif /* !CONFIG_HIBERNATION */ 810 - 811 - int acpi_suspend(u32 acpi_state) 812 - { 813 - suspend_state_t states[] = { 814 - [1] = PM_SUSPEND_STANDBY, 815 - [3] = PM_SUSPEND_MEM, 816 - [5] = PM_SUSPEND_MAX 817 - }; 818 - 819 - if (acpi_state < 6 && states[acpi_state]) 820 - return pm_suspend(states[acpi_state]); 821 - if (acpi_state == 4) 822 - return hibernate(); 823 - return -EINVAL; 824 - } 825 808 826 809 static void acpi_power_off_prepare(void) 827 810 {
-2
drivers/acpi/sleep.h
··· 1 1 2 - extern int acpi_suspend(u32 state); 3 - 4 2 extern void acpi_enable_wakeup_devices(u8 sleep_state); 5 3 extern void acpi_disable_wakeup_devices(u8 sleep_state); 6 4
+1 -1
drivers/acpi/sysfs.c
··· 527 527 acpi_irq_not_handled; 528 528 all_counters[num_gpes + ACPI_NUM_FIXED_EVENTS + COUNT_GPE].count = 529 529 acpi_gpe_count; 530 - size = sprintf(buf, "%8d", all_counters[index].count); 530 + size = sprintf(buf, "%8u", all_counters[index].count); 531 531 532 532 /* "gpe_all" or "sci" */ 533 533 if (index >= num_gpes + ACPI_NUM_FIXED_EVENTS)
+1
include/acpi/acpi_bus.h
··· 252 252 #define acpi_device_bid(d) ((d)->pnp.bus_id) 253 253 #define acpi_device_adr(d) ((d)->pnp.bus_address) 254 254 const char *acpi_device_hid(struct acpi_device *device); 255 + #define acpi_device_uid(d) ((d)->pnp.unique_id) 255 256 #define acpi_device_name(d) ((d)->pnp.device_name) 256 257 #define acpi_device_class(d) ((d)->pnp.device_class) 257 258