]> git.ipfire.org Git - people/arne_f/kernel.git/commitdiff
extcon: qcom-spmi-misc: Sync the extcon state on interrupt
authorStephen Boyd <stephen.boyd@linaro.org>
Tue, 18 Oct 2016 00:16:02 +0000 (17:16 -0700)
committerChanwoo Choi <cw00.choi@samsung.com>
Wed, 26 Oct 2016 07:04:29 +0000 (16:04 +0900)
The driver was changed after submission to use the new style APIs
like extcon_set_state(). Unfortunately, that only sets the state,
and doesn't notify any consumers that the cable state has
changed. Use extcon_set_state_sync() here instead so that we
notify cable consumers of the state change. This fixes USB
host-device role switching on the db8074 platform.

Fixes: 38085c987f52 ("extcon: Add support for qcom SPMI PMIC USB id detection hardware")
Signed-off-by: Stephen Boyd <stephen.boyd@linaro.org>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
drivers/extcon/extcon-qcom-spmi-misc.c

index ca957a5f4291228a77c85b65cf08f0fb690bf522..b8cde096a808f552fde97e0cb85c101ab4139881 100644 (file)
@@ -51,7 +51,7 @@ static void qcom_usb_extcon_detect_cable(struct work_struct *work)
        if (ret)
                return;
 
-       extcon_set_state(info->edev, EXTCON_USB_HOST, !id);
+       extcon_set_state_sync(info->edev, EXTCON_USB_HOST, !id);
 }
 
 static irqreturn_t qcom_usb_irq_handler(int irq, void *dev_id)