]> Git Repo - J-linux.git/commitdiff
Merge tag 'acpi-5.16-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael...
authorLinus Torvalds <[email protected]>
Wed, 10 Nov 2021 19:52:40 +0000 (11:52 -0800)
committerLinus Torvalds <[email protected]>
Wed, 10 Nov 2021 19:52:40 +0000 (11:52 -0800)
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

1  2 
drivers/i2c/i2c-core-acpi.c
include/linux/acpi.h

index 80631f93ad2fe32accd408a23b552b08632fbc06,c025919cdaaeeba0e4f9a1ace6980a5f64a7f770..92c1cc07ed468fd727b16a01c0bdfb965f4425e4
@@@ -398,20 -398,24 +398,20 @@@ u32 i2c_acpi_find_bus_speed(struct devi
  }
  EXPORT_SYMBOL_GPL(i2c_acpi_find_bus_speed);
  
 -static int i2c_acpi_find_match_adapter(struct device *dev, const void *data)
 -{
 -      struct i2c_adapter *adapter = i2c_verify_adapter(dev);
 -
 -      if (!adapter)
 -              return 0;
 -
 -      return ACPI_HANDLE(dev) == (acpi_handle)data;
 -}
 -
  struct i2c_adapter *i2c_acpi_find_adapter_by_handle(acpi_handle handle)
  {
 +      struct i2c_adapter *adapter;
        struct device *dev;
  
 -      dev = bus_find_device(&i2c_bus_type, NULL, handle,
 -                            i2c_acpi_find_match_adapter);
 +      dev = bus_find_device(&i2c_bus_type, NULL, handle, device_match_acpi_handle);
 +      if (!dev)
 +              return NULL;
 +
 +      adapter = i2c_verify_adapter(dev);
 +      if (!adapter)
 +              put_device(dev);
  
 -      return dev ? i2c_verify_adapter(dev) : NULL;
 +      return adapter;
  }
  EXPORT_SYMBOL_GPL(i2c_acpi_find_adapter_by_handle);
  
@@@ -522,6 -526,16 +522,16 @@@ struct i2c_client *i2c_acpi_new_device(
  }
  EXPORT_SYMBOL_GPL(i2c_acpi_new_device);
  
+ bool i2c_acpi_waive_d0_probe(struct device *dev)
+ {
+       struct i2c_driver *driver = to_i2c_driver(dev->driver);
+       struct acpi_device *adev = ACPI_COMPANION(dev);
+       return driver->flags & I2C_DRV_ACPI_WAIVE_D0_PROBE &&
+               adev && adev->power.state_for_enumeration >= adev->power.state;
+ }
+ EXPORT_SYMBOL_GPL(i2c_acpi_waive_d0_probe);
  #ifdef CONFIG_ACPI_I2C_OPREGION
  static int acpi_gsb_i2c_read_bytes(struct i2c_client *client,
                u8 cmd, u8 *data, u8 data_len)
diff --combined include/linux/acpi.h
index 375715b0535fb0ae7a7b85336e755bad98804087,df70fc27afd7555f76b19ca67af50593eb03e9fc..143ce7e0bee130a56eda16b5862cd82e5bcddf4b
@@@ -577,6 -577,7 +577,6 @@@ extern u32 osc_sb_native_usb4_control
  #define OSC_PCI_MSI_SUPPORT                   0x00000010
  #define OSC_PCI_EDR_SUPPORT                   0x00000080
  #define OSC_PCI_HPX_TYPE_3_SUPPORT            0x00000100
 -#define OSC_PCI_SUPPORT_MASKS                 0x0000019f
  
  /* PCI Host Bridge _OSC: Capabilities DWORD 3: Control Field */
  #define OSC_PCI_EXPRESS_NATIVE_HP_CONTROL     0x00000001
  #define OSC_PCI_EXPRESS_CAPABILITY_CONTROL    0x00000010
  #define OSC_PCI_EXPRESS_LTR_CONTROL           0x00000020
  #define OSC_PCI_EXPRESS_DPC_CONTROL           0x00000080
 -#define OSC_PCI_CONTROL_MASKS                 0x000000bf
  
  #define ACPI_GSB_ACCESS_ATTRIB_QUICK          0x00000002
  #define ACPI_GSB_ACCESS_ATTRIB_SEND_RCV         0x00000004
@@@ -1014,6 -1016,7 +1014,7 @@@ int acpi_subsys_runtime_suspend(struct 
  int acpi_subsys_runtime_resume(struct device *dev);
  int acpi_dev_pm_attach(struct device *dev, bool power_on);
  bool acpi_storage_d3(struct device *dev);
+ bool acpi_dev_state_d0(struct device *dev);
  #else
  static inline int acpi_subsys_runtime_suspend(struct device *dev) { return 0; }
  static inline int acpi_subsys_runtime_resume(struct device *dev) { return 0; }
@@@ -1025,6 -1028,10 +1026,10 @@@ static inline bool acpi_storage_d3(stru
  {
        return false;
  }
+ static inline bool acpi_dev_state_d0(struct device *dev)
+ {
+       return true;
+ }
  #endif
  
  #if defined(CONFIG_ACPI) && defined(CONFIG_PM_SLEEP)
This page took 0.066013 seconds and 4 git commands to generate.