platform/x86: asus-wmi: Fix support for showing middle fan RPM
authorLuke D. Jones <luke@ljones.dev>
Tue, 15 Aug 2023 01:42:09 +0000 (13:42 +1200)
committerHans de Goede <hdegoede@redhat.com>
Mon, 21 Aug 2023 13:30:19 +0000 (15:30 +0200)
commitfa69653f87ee3d64cfbe0c1b8190214d71745edc
tree3a8b0f581038aa74737b965bc2fe1953fe1242e6
parentcd99ebe5b39a16cc74c34809786039f0b664e035
platform/x86: asus-wmi: Fix support for showing middle fan RPM

After the addition of the mid fan custom curve functionality various
incorrect behaviour was uncovered. This commit fixes these areas.

- Ensure mid fan attributes actually use the correct fan ID
- Correction to a bit mask for selecting the correct fan data
- Refactor the curve show/store functions to be cleaner and
  match each others layout

Fixes: 536fce82d729 ("platform/x86: asus-wmi: add support for showing middle fan RPM")
Signed-off-by: Luke D. Jones <luke@ljones.dev>
Link: https://lore.kernel.org/r/20230815014209.44903-1-luke@ljones.dev
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
drivers/platform/x86/asus-wmi.c