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: 9380915 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 DEDEB600CA for ; Tue, 18 Oct 2016 00:18:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CAC8D28325 for ; Tue, 18 Oct 2016 00:18:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BCF6728FF0; Tue, 18 Oct 2016 00:18:13 +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=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 5D2B428325 for ; Tue, 18 Oct 2016 00:18:13 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bwI51-0001H1-2H; Tue, 18 Oct 2016 00:16:31 +0000 Received: from mail-pf0-x22b.google.com ([2607:f8b0:400e:c00::22b]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bwI4v-0001EQ-TY for linux-arm-kernel@lists.infradead.org; Tue, 18 Oct 2016 00:16:27 +0000 Received: by mail-pf0-x22b.google.com with SMTP id r16so61422625pfg.1 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=FXyNsD81tD8xvYt3S8qM7C4GSyuaTH9xgiouLmOff6BP7BV3jpkhtrIKa2wwOR8hCL Pj8B9bYiUrolLuCxYcWBv5GU0jt1GuKb0ARKVoblyEUrjGYrEqY0LgNT0SJrhKRw9Ms3 GQmwaxhYRltbfGGXoXVHzZVfVVLd+/pB6vhkTBDsl2iHaVL1qkV8xoEv7jWPKFbhSTYg x5mThMKWl8WdYiGdcYw3Ym1ZUZP6UCtGY/H5ywJoMohQfGbJN215fJZLi4n7tflklkg6 1GugPEXFe2V3VtjIyrZmj9aY9q19cPX17AFi499otAeJEXsT240lMMV0aGGAgYNQNBIz KGqg== X-Gm-Message-State: AA6/9RkxcKbCQJrcZ/zcMXIX8I6of7g02AkLya1AKWk2XQSJVbd2Z/jC0Y+G6sMUzOuA4/Cj 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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20161017_171626_051104_F2D3B222 X-CRM114-Status: GOOD ( 12.26 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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)