1. 27 Sep, 2022 3 commits
  2. 22 Sep, 2022 7 commits
  3. 19 Sep, 2022 8 commits
  4. 15 Sep, 2022 14 commits
  5. 10 Sep, 2022 2 commits
  6. 09 Sep, 2022 6 commits
    • Vadim Pasternak's avatar
      platform/mellanox: mlxreg-lc: Make error handling flow consistent · 072aba58
      Vadim Pasternak authored
      Use 'goto' statement in error flow of mlxreg_lc_event_handler() at all
      places for consistency.
      
      This follow-up patch implementing comments from
      https://www.spinics.net/lists/platform-driver-x86/msg34587.htmlSigned-off-by: default avatarVadim Pasternak <vadimp@nvidia.com>
      Link: https://lore.kernel.org/r/20220904141113.49048-1-vadimp@nvidia.comReviewed-by: default avatarHans de Goede <hdegoede@redhat.com>
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      072aba58
    • Hans de Goede's avatar
      ACPI: video: Change disable_backlight_sysfs_if quirks to acpi_backlight=native · c5b94f5b
      Hans de Goede authored
      Some Toshibas have a broken acpi-video interface for brightness control
      and need a special firmware call on resume to turn the panel back on.
      So far these have been using the disable_backlight_sysfs_if workaround
      to deal with this.
      
      The recent x86/acpi backlight refactoring has broken this workaround:
      1. This workaround relies on acpi_video_get_backlight_type() returning
         acpi_video so that the acpi_video code actually runs; and
      2. this relies on the actual native GPU driver to offer the sysfs
         backlight interface to userspace.
      
      After the refactor this breaks since the native driver will no
      longer register its backlight-device if acpi_video_get_backlight_type()
      does not return native and making it return native breaks 1.
      
      Keeping the acpi_video backlight handling on resume active, while not
      using it to set the brightness, is necessary because it does a _BCM
      call on resume which is necessary to turn the panel back on on resume.
      
      Looking at the DSDT shows that this _BCM call results in a Toshiba
      HCI_SET HCI_LCD_BRIGHTNESS call, which turns the panel back on.
      
      This kind of special vendor specific handling really belongs in
      the vendor specific acpi driver. An earlier patch in this series
      modifies toshiba_acpi to make the necessary HCI_SET call on resume
      on affected models.
      
      With toshiba_acpi taking care of the HCI_SET call on resume,
      the acpi_video code no longer needs to call _BCM on resume.
      
      So instead of using the (now broken) disable_backlight_sysfs_if
      workaround, simply setting acpi_backlight=native to disable
      the broken apci-video interface is sufficient fix things now.
      
      After this there are no more users of the disable_backlight_sysfs_if
      flag and as discussed above the flag also no longer works as intended,
      so remove the disable_backlight_sysfs_if flag entirely.
      Acked-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Tested-by: default avatarArvid Norlander <lkml@vorpal.se>
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      c5b94f5b
    • Hans de Goede's avatar
      drivers/platform: toshiba_acpi: Call HCI_PANEL_POWER_ON on resume on some models · 3cb1f40d
      Hans de Goede authored
      Some Toshibas have a broken acpi-video interface for brightness control, so
      far these have been using a special workaround in drivers/acpi/acpi_video.c
      which gets activated by the disable_backlight_sysfs_if module-param/quirks.
      
      The recent x86/acpi backlight refactoring has broken this workaround:
      1. This workaround relies on acpi_video_get_backlight_type() returning
         acpi_video so that the acpi_video code actually runs; and
      2. this relies on the actual native GPU driver to offer the sysfs
         backlight interface to userspace.
      
      After the refactor this breaks since the native driver will no
      longer register its backlight-device if acpi_video_get_backlight_type()
      does not return native and making it return native breaks 1.
      
      Keeping the acpi_video backlight handling on resume active, while not
      using it to set the brightness, is necessary because it does a _BCM
      call on resume which is necessary to turn the panel back on on resume.
      
      Looking at the DSDT shows that this _BCM call results in a Toshiba
      HCI_SET HCI_LCD_BRIGHTNESS call, which turns the panel back on.
      
      This commit makes toshiba_acpi do a HCI_SET HCI_PANEL_POWER_ON call
      on resume on the affected models, so that the (now broken)
      acpi_video disable_backlight_sysfs_if workaround will no longer
      be necessary.
      
      Note this uses HCI_PANEL_POWER_ON instead of HCI_LCD_BRIGHTNESS
      to avoid changing the configured brightness level.
      Tested-by: default avatarArvid Norlander <lkml@vorpal.se>
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      3cb1f40d
    • Arvid Norlander's avatar
      docs: ABI: charge_control_end_threshold may not support all values · 18ef1bb0
      Arvid Norlander authored
      Some laptops (for example Toshiba Satellite Z830) only supports some fixed
      values. Allow for this and document the expected behaviour in such cases.
      Acked-by: default avatarSebastian Reichel <sebastian.reichel@collabora.com>
      Signed-off-by: default avatarArvid Norlander <lkml@vorpal.se>
      Link: https://lore.kernel.org/r/20220902180037.1728546-4-lkml@vorpal.seSigned-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      18ef1bb0
    • Arvid Norlander's avatar
      platform/x86: Battery charge mode in toshiba_acpi (sysfs) · 8ef5db9e
      Arvid Norlander authored
      This commit adds the ACPI battery hook which in turns adds the sysfs
      entries.
      
      Because the Toshiba laptops only support two modes (eco or normal), which
      in testing correspond to 80% and 100% we simply round to the nearest
      possible level when set.
      
      It is possible that Toshiba laptops other than the Z830 has different set
      points for the charging. If so, a quirk table could be introduced in the
      future for this. For now, assume that all laptops that support this feature
      work the same way.
      
      Tested on a Toshiba Satellite Z830.
      Signed-off-by: default avatarArvid Norlander <lkml@vorpal.se>
      Link: https://lore.kernel.org/r/20220902180037.1728546-3-lkml@vorpal.seReviewed-by: default avatarHans de Goede <hdegoede@redhat.com>
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      8ef5db9e
    • Arvid Norlander's avatar
      platform/x86: Battery charge mode in toshiba_acpi (internals) · 89655fbb
      Arvid Norlander authored
      This commit adds the internal functions to control the Toshiba laptop.
      
      Unlike for example ThinkPads where this control is granular here it is
      just off/on. When off it charges to 100%. When on it charges to about 80%.
      
      Controlling this setting is done via HCI register 0x00ba. Setting to value
      1 will result in limiting the charing to 80% of the battery capacity,
      while setting it to 0 will allow charging to 100%.
      
      Reading the current state is a bit weird, and needs a 1 set in the last
      position of the query for whatever reason. In addition, the read may
      return 0x8d20 (Data not available) rarely, so a retry mechanism is needed.
      
      According to the Windows program used to control the feature the setting
      will not take effect until the battery has been discharged to around 50%.
      However, in my testing it takes effect as soon as the charge drops below
      80%. On Windows Toshiba branded this feature as "Eco charging".
      Signed-off-by: default avatarArvid Norlander <lkml@vorpal.se>
      Link: https://lore.kernel.org/r/20220902180037.1728546-2-lkml@vorpal.seReviewed-by: default avatarHans de Goede <hdegoede@redhat.com>
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      89655fbb