platform/x86: int3472/discrete: Refactor GPIO to sensor mapping
authorHans de Goede <hdegoede@redhat.com>
Fri, 27 Jan 2023 20:37:26 +0000 (21:37 +0100)
committerHans de Goede <hdegoede@redhat.com>
Fri, 3 Feb 2023 09:22:34 +0000 (10:22 +0100)
commit9b1785a2e2af522c2a64034a8716b7d47375ffec
tree1ce335e39a76564ed513a5bf471fd6eedb02e28f
parentb6e10ff6c23deb7f01d342875f7a69bae067c3c8
platform/x86: int3472/discrete: Refactor GPIO to sensor mapping

Add a helper function to map the type returned by the _DSM
method to a function name + the default polarity for that function.

And fold the INT3472_GPIO_TYPE_RESET and INT3472_GPIO_TYPE_POWERDOWN
cases into a single generic case.

This is a preparation patch for further GPIO mapping changes.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Link: https://lore.kernel.org/r/20230127203729.10205-3-hdegoede@redhat.com
drivers/platform/x86/intel/int3472/discrete.c