From patchwork Tue Oct 18 00:16:02 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Boyd X-Patchwork-Id: 9380907 X-Patchwork-Delegate: agross@codeaurora.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 73275600CA for ; Tue, 18 Oct 2016 00:16:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5CAA728D5B for ; Tue, 18 Oct 2016 00:16:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4C02028F86; Tue, 18 Oct 2016 00:16:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B8A4228D5B for ; Tue, 18 Oct 2016 00:16:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932539AbcJRAQF (ORCPT ); Mon, 17 Oct 2016 20:16:05 -0400 Received: from mail-pf0-f179.google.com ([209.85.192.179]:35334 "EHLO mail-pf0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932901AbcJRAQF (ORCPT ); Mon, 17 Oct 2016 20:16:05 -0400 Received: by mail-pf0-f179.google.com with SMTP id s8so84990946pfj.2 for ; Mon, 17 Oct 2016 17:16:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=YW8uS6SQyRQebYO0Uq+RZPKlmJxu/qRvKVaNGajwEPY=; b=eBC+ZclK7iKzqkTkDBfMTf+oAD/O7OFrW73N2mUrXwNHF/x9WH35BWveqjI67Y8qWi tZxJS352O4UgJ1f9i07SK7GUkMzvmIHnzW7CvWGEEBTlaeNX5JihZXULHioDmIbEpgOG omRE2H/CXpZbAaZfHazhXPYGo7X4flxlF4YCg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=YW8uS6SQyRQebYO0Uq+RZPKlmJxu/qRvKVaNGajwEPY=; b=RF1LJHbSI9J2buClsg7451ybcdpmJOQgPnKeUCeMOq4HjCh6N/UBu/Tc4i5e4Knm8E QGcoiKhaS1APmtZyc+jy6oB3aalpNrynf58YI1COPOkGyZ01YUUxsW9gUgooGUSz49WJ 0bQKIFxTQpYoQAWd4hT1CmWzqaCHrgrUdOKOCDKwagYjGfMX7MzImHtNwG96vim3BWqk uAVWmk1R/aKBfhgzlEnsUet/l/X1pvVx5ODYpuBcZ+c6Am1+zaUYH0j+Jm+lyzsDY2ZF 7ZB9pHdh8uQ791dlxVG7Yjeygcqc7Yn14iM/kPHYqMRBggu75n/Mud5OE0ObEM3eqPRh B9/A== X-Gm-Message-State: AA6/9Rle4sL1HgNyKjgYu+vw0tvVJdpFxGoWes8qO4eRTGeQ5R4sXd8sJiH7dqsivz7m4+YN X-Received: by 10.98.211.147 with SMTP id z19mr188936pfk.149.1476749764362; Mon, 17 Oct 2016 17:16:04 -0700 (PDT) Received: from localhost.localdomain (i-global254.qualcomm.com. [199.106.103.254]) by smtp.gmail.com with ESMTPSA id d89sm28399965pfe.32.2016.10.17.17.16.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 17 Oct 2016 17:16:03 -0700 (PDT) From: Stephen Boyd To: Chanwoo Choi Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org Subject: [PATCH] extcon: qcom-spmi-misc: Sync the extcon state on interrupt Date: Mon, 17 Oct 2016 17:16:02 -0700 Message-Id: <20161018001602.18617-1-stephen.boyd@linaro.org> X-Mailer: git-send-email 2.10.0.297.gf6727b0 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- drivers/extcon/extcon-qcom-spmi-misc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/extcon/extcon-qcom-spmi-misc.c b/drivers/extcon/extcon-qcom-spmi-misc.c index ca957a5f4291..b8cde096a808 100644 --- a/drivers/extcon/extcon-qcom-spmi-misc.c +++ b/drivers/extcon/extcon-qcom-spmi-misc.c @@ -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)