Pull more ACPI updates from Rafael Wysocki: "These add support for a new ACPI device configuration object called _DSC, fix some issues including one recent regression, add two new items to quirk lists and clean up assorted pieces of code. Specifics: - Add support for new ACPI device configuration object called _DSC ("Deepest State for Configuration") to allow certain devices to be probed without changing their power states, document it and make two drivers use it (Sakari Ailus, Rajmohan Mani). - Fix device wakeup power reference counting broken recently by mistake (Rafael Wysocki). - Drop unused symbol and macros depending on it from acgcc.h (Rafael Wysocki). - Add HP ZHAN 66 Pro to the "no EC wakeup" quirk list (Binbin Zhou). - Add Xiaomi Mi Pad 2 to the backlight quirk list and drop an unused piece of data from all of the list entries (Hans de Goede). - Fix register read accesses handling in the Intel PMIC operation region driver (Hans de Goede). - Clean up static variables initialization in the EC driver (wangzhitong)" * tag 'acpi-5.16-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: Documentation: ACPI: Fix non-D0 probe _DSC object example ACPI: Drop ACPI_USE_BUILTIN_STDARG ifdef from acgcc.h ACPI: PM: Fix device wakeup power reference counting error ACPI: video: use platform backlight driver on Xiaomi Mi Pad 2 ACPI: video: Drop dmi_system_id.ident settings from video_detect_dmi_table[] ACPI: PMIC: Fix intel_pmic_regs_handler() read accesses ACPI: EC: Remove initialization of static variables to false ACPI: EC: Use ec_no_wakeup on HP ZHAN 66 Pro at24: Support probing while in non-zero ACPI D state media: i2c: imx319: Support device probe in non-zero ACPI D state ACPI: Add a convenience function to tell a device is in D0 state Documentation: ACPI: Document _DSC object usage for enum power state i2c: Allow an ACPI driver to manage the device's power state during probe ACPI: scan: Obtain device's desired enumeration power state
Showing the changes to include (4 of 16 files). Show all
Unified · Split
| @@ -278,6 +278,7 @@ struct acpi_device_power { · 277 unmodified lines | ||
| 278 | 278 | int state; /* Current state */ |
| 279 | 279 | struct acpi_device_power_flags flags; |
| 280 | 280 | struct acpi_device_power_state states[ACPI_D_STATE_COUNT]; /* Power states (D0-D3Cold) */ |
| 281 | + u8 state_for_enumeration; /* Deepest power state for enumeration */ | |
| 281 | 282 | }; |
| 282 | 283 | |
| 283 | 284 | struct acpi_dep_data { |
| @@ -10,25 +10,12 @@ · 9 unmodified lines | ||
| 10 | 10 | #ifndef __ACGCC_H__ |
| 11 | 11 | #define __ACGCC_H__ |
| 12 | 12 | |
| 13 | −/* | |
| 14 | − * Use compiler specific <stdarg.h> is a good practice for even when | |
| 15 | − * -nostdinc is specified (i.e., ACPI_USE_STANDARD_HEADERS undefined. | |
| 16 | − */ | |
| 17 | 13 | #ifndef va_arg |
| 18 | −#ifdef ACPI_USE_BUILTIN_STDARG | |
| 19 | −typedef __builtin_va_list va_list; | |
| 20 | −#define va_start(v, l) __builtin_va_start(v, l) | |
| 21 | −#define va_end(v) __builtin_va_end(v) | |
| 22 | −#define va_arg(v, l) __builtin_va_arg(v, l) | |
| 23 | −#define va_copy(d, s) __builtin_va_copy(d, s) | |
| 24 | −#else | |
| 25 | 14 | #ifdef __KERNEL__ |
| 26 | 15 | #include <linux/stdarg.h> |
| 27 | 16 | #else |
| 28 | −/* Used to build acpi tools */ | |
| 29 | 17 | #include <stdarg.h> |
| 30 | 18 | #endif /* __KERNEL__ */ |
| 31 | −#endif /* ACPI_USE_BUILTIN_STDARG */ | |
| 32 | 19 | #endif /* ! va_arg */ |
| 33 | 20 | |
| 34 | 21 | #define ACPI_INLINE __inline__ |
| @@ -1014,6 +1014,7 @@ int acpi_subsys_runtime_suspend(struct device *dev); · 1013 unmodified lines | ||
| 1014 | 1014 | int acpi_subsys_runtime_resume(struct device *dev); |
| 1015 | 1015 | int acpi_dev_pm_attach(struct device *dev, bool power_on); |
| 1016 | 1016 | bool acpi_storage_d3(struct device *dev); |
| 1017 | +bool acpi_dev_state_d0(struct device *dev); | |
| 1017 | 1018 | #else |
| 1018 | 1019 | static inline int acpi_subsys_runtime_suspend(struct device *dev) { return 0; } |
| 1019 | 1020 | static inline int acpi_subsys_runtime_resume(struct device *dev) { return 0; } |
| @@ -1025,6 +1026,10 @@ static inline bool acpi_storage_d3(struct device *dev) · 5 unmodified lines | ||
| 1025 | 1026 | { |
| 1026 | 1027 | return false; |
| 1027 | 1028 | } |
| 1029 | +static inline bool acpi_dev_state_d0(struct device *dev) | |
| 1030 | +{ | |
| 1031 | + return true; | |
| 1032 | +} | |
| 1028 | 1033 | #endif |
| 1029 | 1034 | |
| 1030 | 1035 | #if defined(CONFIG_ACPI) && defined(CONFIG_PM_SLEEP) |
| @@ -11,6 +11,7 @@ · 10 unmodified lines | ||
| 11 | 11 | #define _LINUX_I2C_H |
| 12 | 12 | |
| 13 | 13 | #include <linux/acpi.h> /* for acpi_handle */ |
| 14 | +#include <linux/bits.h> | |
| 14 | 15 | #include <linux/mod_devicetable.h> |
| 15 | 16 | #include <linux/device.h> /* for struct device */ |
| 16 | 17 | #include <linux/sched.h> /* for completion */ |
| @@ -222,6 +223,15 @@ enum i2c_alert_protocol { · 205 unmodified lines | ||
| 222 | 223 | I2C_PROTOCOL_SMBUS_HOST_NOTIFY, |
| 223 | 224 | }; |
| 224 | 225 | |
| 226 | +/** | |
| 227 | + * enum i2c_driver_flags - Flags for an I2C device driver | |
| 228 | + * | |
| 229 | + * @I2C_DRV_ACPI_WAIVE_D0_PROBE: Don't put the device in D0 state for probe | |
| 230 | + */ | |
| 231 | +enum i2c_driver_flags { | |
| 232 | + I2C_DRV_ACPI_WAIVE_D0_PROBE = BIT(0), | |
| 233 | +}; | |
| 234 | + | |
| 225 | 235 | /** |
| 226 | 236 | * struct i2c_driver - represent an I2C device driver |
| 227 | 237 | * @class: What kind of i2c device we instantiate (for detect) |
| @@ -236,6 +246,7 @@ enum i2c_alert_protocol { · 8 unmodified lines | ||
| 236 | 246 | * @detect: Callback for device detection |
| 237 | 247 | * @address_list: The I2C addresses to probe (for detect) |
| 238 | 248 | * @clients: List of detected clients we created (for i2c-core use only) |
| 249 | + * @flags: A bitmask of flags defined in &enum i2c_driver_flags | |
| 239 | 250 | * |
| 240 | 251 | * The driver.owner field should be set to the module owner of this driver. |
| 241 | 252 | * The driver.name field should be set to the name of this driver. |
| @@ -294,6 +305,8 @@ struct i2c_driver { · 52 unmodified lines | ||
| 294 | 305 | int (*detect)(struct i2c_client *client, struct i2c_board_info *info); |
| 295 | 306 | const unsigned short *address_list; |
| 296 | 307 | struct list_head clients; |
| 308 | + | |
| 309 | + u32 flags; | |
| 297 | 310 | }; |
| 298 | 311 | #define to_i2c_driver(d) container_of(d, struct i2c_driver, driver) |
| 299 | 312 | |
| @@ -1015,6 +1028,7 @@ u32 i2c_acpi_find_bus_speed(struct device *dev); · 715 unmodified lines | ||
| 1015 | 1028 | struct i2c_client *i2c_acpi_new_device(struct device *dev, int index, |
| 1016 | 1029 | struct i2c_board_info *info); |
| 1017 | 1030 | struct i2c_adapter *i2c_acpi_find_adapter_by_handle(acpi_handle handle); |
| 1031 | +bool i2c_acpi_waive_d0_probe(struct device *dev); | |
| 1018 | 1032 | #else |
| 1019 | 1033 | static inline bool i2c_acpi_get_i2c_resource(struct acpi_resource *ares, |
| 1020 | 1034 | struct acpi_resource_i2c_serialbus **i2c) |
| @@ -1038,6 +1052,10 @@ static inline struct i2c_adapter *i2c_acpi_find_adapter_by_handle(acpi_handle ha · 17 unmodified lines | ||
| 1038 | 1052 | { |
| 1039 | 1053 | return NULL; |
| 1040 | 1054 | } |
| 1055 | +static inline bool i2c_acpi_waive_d0_probe(struct device *dev) | |
| 1056 | +{ | |
| 1057 | + return false; | |
| 1058 | +} | |
| 1041 | 1059 | #endif /* CONFIG_ACPI */ |
| 1042 | 1060 | |
| 1043 | 1061 | #endif /* _LINUX_I2C_H */ |