Skip to content

Commit 899c7b1

Browse files
committed
platform/x86: int3472: discrete: Log a warning if the pin-numbers don't match
The INT3472 discrete code assumes that the ACPI GPIO resources are in the same order as the pin-info _DSM entries. The returned pin-info includes the pin-number in bits 15-8. Add a check that this matches with the ACPI GPIO resource pin-number in case the assumption is not true with some ACPI tables. Reviewed-by: Daniel Scally <[email protected]> Reviewed-by: Ilpo Järvinen <[email protected]> Signed-off-by: Hans de Goede <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 45eaf2e commit 899c7b1

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

drivers/platform/x86/intel/int3472/discrete.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,8 @@ static int skl_int3472_handle_gpio_resources(struct acpi_resource *ares,
154154
{
155155
struct int3472_discrete_device *int3472 = data;
156156
struct acpi_resource_gpio *agpio;
157+
u8 active_value, pin, type;
157158
union acpi_object *obj;
158-
u8 active_value, type;
159159
const char *err_msg;
160160
const char *func;
161161
u32 polarity;
@@ -183,6 +183,12 @@ static int skl_int3472_handle_gpio_resources(struct acpi_resource *ares,
183183

184184
int3472_get_func_and_polarity(type, &func, &polarity);
185185

186+
pin = FIELD_GET(INT3472_GPIO_DSM_PIN, obj->integer.value);
187+
if (pin != agpio->pin_table[0])
188+
dev_warn(int3472->dev, "%s %s pin number mismatch _DSM %d resource %d\n",
189+
func, agpio->resource_source.string_ptr, pin,
190+
agpio->pin_table[0]);
191+
186192
active_value = FIELD_GET(INT3472_GPIO_DSM_SENSOR_ON_VAL, obj->integer.value);
187193
if (!active_value)
188194
polarity ^= GPIO_ACTIVE_LOW;

0 commit comments

Comments
 (0)