extcon: int3496: Set the id pin to direction-input if necessary
authorHans de Goede <hdegoede@redhat.com>
Mon, 13 Mar 2017 11:28:34 +0000 (12:28 +0100)
committerChanwoo Choi <cw00.choi@samsung.com>
Wed, 22 Mar 2017 09:29:48 +0000 (18:29 +0900)
commit70216fd937fea79c20705400540fa48f86ddf1c5
treedf18bb15ee80fbaf122229abcb5afd23c7c31e3a
parent408c5b41d215b317ab58c98b959454407ee4a53d
extcon: int3496: Set the id pin to direction-input if necessary

With the new more strict ACPI gpio code the dsdt's IoRestriction
flags are honored on gpiod_get, but in some dsdt's it is wrong,
so explicitly call gpiod_direction_input on the id gpio if
necessary.

This fixes the following errors when the int3496 code is used
together with the new more strict ACPI gpio code:

[ 2382.484415] gpio gpiochip1: (INT33FF:01): gpiochip_lock_as_irq: tried to flag a GPIO set as output for IRQ
[ 2382.484425] gpio gpiochip1: (INT33FF:01): unable to lock HW IRQ 3 for IRQ
[ 2382.484429] genirq: Failed to request resources for INT3496:00 (irq 174) on irqchip chv-gpio
[ 2382.484518] intel-int3496 INT3496:00: can't request IRQ for USB ID GPIO: -22
[ 2382.500359] intel-int3496: probe of INT3496:00 failed with error -22

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
drivers/extcon/extcon-intel-int3496.c