1. 04 Sep, 2024 2 commits
    • Andres Salomon's avatar
      platform/x86:dell-laptop: remove duplicate code w/ battery function · 66cb96af
      Andres Salomon authored
      The dell battery patch added dell_send_request_for_tokenid() and
      dell_set_std_token_value(), which encapsulates a very common pattern
      when SMBIOS queries are addressed to token->location. This calls them
      in various places outside of the dell laptop code, allowing us to delete
      a bunch of code.
      
      Also some very minor cleanups:
        - mark the kbd init functions as __init
        - don't read buffer.output unless dell_send_request() was successful.
        - actually return errors from micmute_led_set/mute_led_set instead of
          always returning 0.
      
      Only minor behavior changes; the delayed read of buffer.output and
      actually returning errors for the brightness_set_blocking hooks.
      Signed-off-by: default avatarAndres Salomon <dilinger@queued.net>
      Reviewed-by: default avatarPali Rohár <pali@kernel.org>
      Link: https://lore.kernel.org/r/20240820033335.4f68b162@5400Reviewed-by: default avatarHans de Goede <hdegoede@redhat.com>
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      66cb96af
    • Andres Salomon's avatar
      platform/x86:dell-laptop: Add knobs to change battery charge settings · ab58016c
      Andres Salomon authored
      The Dell BIOS allows you to set custom charging modes, which is useful
      in particular for extending battery life. This adds support for tweaking
      those various settings from Linux via sysfs knobs. One might, for
      example, have their laptop plugged into power at their desk the vast
      majority of the time and choose fairly aggressive battery-saving
      settings (eg, only charging once the battery drops below 50% and only
      charging up to 80%). When leaving for a trip, it would be more useful
      to instead switch to a standard charging mode (top off at 100%, charge
      any time power is available). Rebooting into the BIOS to change the
      charging mode settings is a hassle.
      
      For the Custom charging type mode, we reuse the common
      charge_control_{start,end}_threshold sysfs power_supply entries. The
      BIOS also has a bunch of other charging modes (with varying levels of
      usefulness), so this also adds a 'charge_type' sysfs entry that maps the
      standard values to Dell-specific ones.
      
      This work is based on a patch by Perry Yuan <perry_yuan@dell.com> and
      Limonciello Mario <Mario_Limonciello@Dell.com> submitted back in 2020.
      
      Hans de Goede:
      s/charge_type/charge_types/ since charge_types_show() used the new
      charge_types power-supply property output format.
      Signed-off-by: default avatarAndres Salomon <dilinger@queued.net>
      Reviewed-by: default avatarPali Rohár <pali@kernel.org>
      Link: https://lore.kernel.org/r/20240820033005.09e03af1@5400Reviewed-by: default avatarHans de Goede <hdegoede@redhat.com>
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      ab58016c
  2. 26 Aug, 2024 2 commits
  3. 24 Aug, 2024 1 commit
  4. 19 Aug, 2024 10 commits
  5. 12 Aug, 2024 21 commits
  6. 08 Aug, 2024 4 commits