1. 06 4月, 2022 1 次提交
  2. 16 3月, 2022 1 次提交
  3. 02 3月, 2022 1 次提交
    • H
      Input: soc_button_array - add support for Microsoft Surface 3 (MSHW0028) buttons · 60c7353c
      Hans de Goede 提交于
      The drivers/platform/surface/surface3_button.c code is alsmost a 1:1 copy
      of the soc_button_array code.
      
      The only big difference is that it binds to an i2c_client rather then to
      a platform_device. The cause of this is the ACPI resources for the MSHW0028
      device containing a bogus I2cSerialBusV2 resource which causes the kernel
      to instantiate an i2c_client for it instead of a platform_device.
      
      Add "MSHW0028" to the ignore_serial_bus_ids[] list in drivers/apci/scan.c,
      so that a platform_device will be instantiated and add support for
      the MSHW0028 HID to soc_button_array.
      
      This fully replaces surface3_button, which will be removed in a separate
      commit (since it binds to the now no longer created i2c_client it no
      longer does anyyhing after this commit).
      
      Note the MSHW0028 id is used by Microsoft to describe the tablet buttons on
      both the Surface 3 and the Surface 3 Pro and the actual API/implementation
      for the Surface 3 Pro is quite different. The changes in this commit should
      not impact the separate surfacepro3_button driver:
      
      1. Because of the bogus I2cSerialBusV2 resource problem that driver binds
         to the acpi_device itself, so instantiating a platform_device instead of
         an i2c_client does not matter.
      
      2. The soc_button_array driver will not bind to the MSHW0028 device on
         the Surface 3 Pro, because it has no GPIO resources.
      Signed-off-by: NHans de Goede <hdegoede@redhat.com>
      Reviewed-by: Maximilian Luz <luzmaximilian@gmail.com
      Reviewed-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      Acked-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Acked-by: NDmitry Torokhov <dmitry.torokhov@gmail.com>
      Link: https://lore.kernel.org/r/20220224110241.9613-2-hdegoede@redhat.com
      60c7353c
  4. 19 2月, 2022 1 次提交
  5. 03 2月, 2022 2 次提交
  6. 12 1月, 2022 3 次提交
  7. 31 12月, 2021 1 次提交
    • H
      ACPI: scan: Create platform device for BCM4752 and LNV4752 ACPI nodes · f85196bd
      Hans de Goede 提交于
      BCM4752 and LNV4752 ACPI nodes describe a Broadcom 4752 GPS module
      attached to an UART of the system.
      
      The GPS modules talk a custom protocol which only works with a closed-
      source Android gpsd daemon which knows this protocol.
      
      The ACPI nodes also describe GPIOs to turn the GPS on/off these are
      handled by the net/rfkill/rfkill-gpio.c code. This handling predates the
      addition of enumeration of ACPI instantiated serdevs to the kernel and
      was broken by that addition, because the ACPI scan code now no longer
      instantiates platform_device-s for these nodes.
      
      Rename the i2c_multi_instantiate_ids HID list to ignore_serial_bus_ids
      and add the BCM4752 and LNV4752 HIDs, so that rfkill-gpio gets
      a platform_device to bind to again; and so that a tty cdev for gpsd
      gets created for these.
      
      Fixes: e361d1f8 ("ACPI / scan: Fix enumeration for special UART devices")
      Signed-off-by: NHans de Goede <hdegoede@redhat.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      f85196bd
  8. 30 12月, 2021 1 次提交
  9. 18 12月, 2021 1 次提交
  10. 13 12月, 2021 1 次提交
    • H
      ACPI: delay enumeration of devices with a _DEP pointing to an INT3472 device · 9d9bcae4
      Hans de Goede 提交于
      The clk and regulator frameworks expect clk/regulator consumer-devices
      to have info about the consumed clks/regulators described in the device's
      fw_node.
      
      To work around cases where this info is not present in the firmware tables,
      which is often the case on x86/ACPI devices, both frameworks allow the
      provider-driver to attach info about consumers to the clks/regulators
      when registering these.
      
      This causes problems with the probe ordering wrt drivers for consumers
      of these clks/regulators. Since the lookups are only registered when the
      provider-driver binds, trying to get these clks/regulators before then
      results in a -ENOENT error for clks and a dummy regulator for regulators.
      
      One case where we hit this issue is camera sensors such as e.g. the OV8865
      sensor found on the Microsoft Surface Go. The sensor uses clks, regulators
      and GPIOs provided by a TPS68470 PMIC which is described in an INT3472
      ACPI device. There is special platform code handling this and setting
      platform_data with the necessary consumer info on the MFD cells
      instantiated for the PMIC under: drivers/platform/x86/intel/int3472.
      
      For this to work properly the ov8865 driver must not bind to the I2C-client
      for the OV8865 sensor until after the TPS68470 PMIC gpio, regulator and
      clk MFD cells have all been fully setup.
      
      The OV8865 on the Microsoft Surface Go is just one example, all X86
      devices using the Intel IPU3 camera block found on recent Intel SoCs
      have similar issues where there is an INT3472 HID ACPI-device, which
      describes the clks and regulators, and the driver for this INT3472 device
      must be fully initialized before the sensor driver (any sensor driver)
      binds for things to work properly.
      
      On these devices the ACPI nodes describing the sensors all have a _DEP
      dependency on the matching INT3472 ACPI device (there is one per sensor).
      
      This allows solving the probe-ordering problem by delaying the enumeration
      (instantiation of the I2C-client in the ov8865 example) of ACPI-devices
      which have a _DEP dependency on an INT3472 device.
      
      The new acpi_dev_ready_for_enumeration() helper used for this is also
      exported because for devices, which have the enumeration_by_parent flag
      set, the parent-driver will do its own scan of child ACPI devices and
      it will try to enumerate those during its probe(). Code doing this such
      as e.g. the i2c-core-acpi.c code must call this new helper to ensure
      that it too delays the enumeration until all the _DEP dependencies are
      met on devices which have the new honor_deps flag set.
      Acked-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Reviewed-by: NAndy Shevchenko <andy.shevchenko@gmail.com>
      Signed-off-by: NHans de Goede <hdegoede@redhat.com>
      Link: https://lore.kernel.org/r/20211203102857.44539-2-hdegoede@redhat.com
      9d9bcae4
  11. 25 11月, 2021 1 次提交
  12. 18 11月, 2021 1 次提交
  13. 04 11月, 2021 1 次提交
  14. 17 10月, 2021 1 次提交
  15. 14 10月, 2021 1 次提交
  16. 08 9月, 2021 1 次提交
  17. 25 6月, 2021 3 次提交
  18. 22 6月, 2021 1 次提交
    • R
      ACPI: scan: Simplify acpi_table_events_fn() · 8d287e82
      Rafael J. Wysocki 提交于
      Notice that the table field of struct acpi_table_events_work is never
      read and its event field is always equal to ACPI_TABLE_EVENT_LOAD, so
      both of them are redundant.
      
      Accordingly, drop struct acpi_table_events_work and use struct
      work_struct directly instead of it, simplify acpi_scan_table_handler()
      and rename it to acpi_scan_table_notify().
      
      Moreover, make acpi_bus_table_handler() check the event code against
      ACPI_TABLE_EVENT_LOAD before calling acpi_scan_table_notify(), so it
      is not necessary to do that check in the latter.
      
      No intentional functional impact.
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      8d287e82
  19. 17 6月, 2021 6 次提交
  20. 10 6月, 2021 1 次提交
  21. 07 6月, 2021 4 次提交
  22. 31 5月, 2021 1 次提交
    • R
      ACPI: power: Rework turning off unused power resources · 6381195a
      Rafael J. Wysocki 提交于
      Make turning off unused power resources (after the enumeration of
      devices and during system-wide resume from S3) more straightforward
      by using the observation that the power resource state stored in
      struct acpi_power_resource can be used to determine whether or not
      the give power resource has any users.
      
      Namely, when the state of the power resource is unknown, its _STA
      method has never been evaluated (or the evaluation of it has failed)
      and its _ON and _OFF methods have never been executed (or they have
      failed to execute), so for all practical purposes it can be assumed
      to have no users (or to be unusable).  Therefore, instead of checking
      the number of power resource users, it is sufficient to check if its
      state is known.
      
      Moreover, if the last known state of a given power resource is "off",
      it is not necessary to turn it off, because it has been used to
      initialize the power state or the wakeup power resources list of at
      least one device and either its _STA method has returned 0 ("off"),
      or its _OFF method has been successfully executed already.
      
      Accordingly, modify acpi_turn_off_unused_power_resources() to do the
      above checks (which are suitable for both uses of it) instead of
      using the number of power resource users or evaluating its _STA
      method, drop its argument (which is not useful any more) and update
      its callers.
      
      Also drop the users field from struct acpi_power_resource as it is
      not useful any more.
      Tested-by: NDave Olsthoorn <dave@bewaar.me>
      Tested-by: NShujun Wang <wsj20369@163.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      6381195a
  23. 24 5月, 2021 1 次提交
  24. 17 5月, 2021 1 次提交
    • R
      ACPI: scan: Rearrange dep_unmet initialization · 6d279758
      Rafael J. Wysocki 提交于
      The dep_unmet field in struct acpi_device is used to store the
      number of unresolved _DEP dependencies (that is, operation region
      dependencies for which there are no drivers present) for the ACPI
      device object represented by it.
      
      That field is initialized to 1 for all ACPI device objects in
      acpi_add_single_object(), via acpi_init_device_object(), so as to
      avoid evaluating _STA prematurely for battery device objects in
      acpi_scan_init_status(), and it is "fixed up" in acpi_bus_check_add()
      after the acpi_add_single_object() called by it has returned.
      
      This is not particularly straightforward and causes dep_unmet to
      remain 1 for device objects without dependencies created by invoking
      acpi_add_single_object() directly, outside acpi_bus_check_add().
      
      For this reason, rearrange acpi_add_single_object() to initialize
      dep_unmet completely before calling acpi_scan_init_status(), which
      requires passing one extra bool argument to it, and update all of
      its callers accordingly.
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Reviewed-by: NHans de Goede <hdegoede@redhat.com>
      6d279758
  25. 11 5月, 2021 1 次提交
  26. 10 5月, 2021 1 次提交
  27. 30 4月, 2021 1 次提交