From patchwork Tue Sep 4 15:18:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Loic Poulain X-Patchwork-Id: 10587495 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D480A16B1 for ; Tue, 4 Sep 2018 15:19:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C7C0229C49 for ; Tue, 4 Sep 2018 15:19:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C613829C7D; Tue, 4 Sep 2018 15:19:09 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=unavailable 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 58CB129C49 for ; Tue, 4 Sep 2018 15:19:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727602AbeIDToj (ORCPT ); Tue, 4 Sep 2018 15:44:39 -0400 Received: from mail-wm0-f54.google.com ([74.125.82.54]:55583 "EHLO mail-wm0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727220AbeIDToi (ORCPT ); Tue, 4 Sep 2018 15:44:38 -0400 Received: by mail-wm0-f54.google.com with SMTP id f21-v6so4849149wmc.5 for ; Tue, 04 Sep 2018 08:19: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=BZCgv7ZnNziCVwocxEfa9B5JEWHWfgm+orGzJkzoN1U=; b=GuPutQlk/s7bEGKqGuFigDaEuJwClH4ZX+lkyJHNAeRDhEUtsMnFUYPEzNFs2qxsr4 9Ai3XhCa4Ee7k/L052IR0vkhUXZNckDewQvoqMQk4sMKgAutoQdY5qYApebzx3+UDbZw /zM7yt4VgSOe6+dq9IQ7OnU+jZeGSV9BA6Alc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=BZCgv7ZnNziCVwocxEfa9B5JEWHWfgm+orGzJkzoN1U=; b=UVpYl4sUznU/XEIgkHBBy4kGQ6lBevX+X51wkODfh1gXHF684epwb//16iOSvVj7/w XbGEUts3uFE947XgEQwn0HzKvfezFh9fK9na6w2xuhtISBdRNcU1tyHFJrVEqYoYRO0A vfmvWQ4ggXXSisPvNsOOu2X2CYDC5sNuxugVZdr8THCctJPtQ9lJ53O6w67h42nGLBLE MM/Xrr4r97+xmxoN0FlSoZUFQnKPfEH4vrSak4BHV3J+9nZopX8161ECBto3FnERbOgj FobPwXviPqeMhho+AZaVN/GEQ3Qi1UsY+O8Ox43MbAnvyORCuP5PZhp2hE6ZKaZ7iaNp JJLQ== X-Gm-Message-State: APzg51DHPPebNOE8o3yaiXpdwB0mOFgVL4v7bK9ZFnqiSeFOs6oLcrq4 fFcX6LzOGiCh/g/HdChGPiVEcA== X-Google-Smtp-Source: ANB0VdayOIgsezq9judjzBbjGGqlw736Osg1cHvSfRpWP3lrtera6SrPVL0h2Qv2pDCkz0uSCqICvg== X-Received: by 2002:a1c:a745:: with SMTP id q66-v6mr8152425wme.49.1536074343417; Tue, 04 Sep 2018 08:19:03 -0700 (PDT) Received: from lpoulain-ThinkPad-T470p.home (AToulouse-654-1-394-222.w90-55.abo.wanadoo.fr. [90.55.193.222]) by smtp.gmail.com with ESMTPSA id l24-v6sm40255033wrb.65.2018.09.04.08.19.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 04 Sep 2018 08:19:02 -0700 (PDT) From: Loic Poulain To: Peter.Chen@nxp.com Cc: linux-usb@vger.kernel.org, linux-arm-msm@vger.kernel.org, david.brown@linaro.org, robh+dt@kernel.org, bjorn.andersson@linaro.org, andy.gross@linaro.org, andy.shevchenko@gmail.com, Loic Poulain Subject: [PATCH v3 1/6] usb: chipidea: Add dynamic pinctrl selection Date: Tue, 4 Sep 2018 17:18:55 +0200 Message-Id: <1536074340-14840-1-git-send-email-loic.poulain@linaro.org> X-Mailer: git-send-email 2.7.4 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Some hardware implementations require to configure pins differently according to the USB role (host/device), this can be an update of the pins routing or a simple GPIO value change. This patch introduces new optional "host" and "device" pinctrls. If these pinctrls are defined by the device, they are respectively selected on host/device role start. If a default pinctrl exist, it is restored on host/device role stop. Signed-off-by: Loic Poulain --- v2: includes ordering v3: no change drivers/usb/chipidea/core.c | 19 +++++++++++++++++++ drivers/usb/chipidea/host.c | 9 +++++++++ drivers/usb/chipidea/udc.c | 9 +++++++++ include/linux/usb/chipidea.h | 6 ++++++ 4 files changed, 43 insertions(+) diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c index 85fc6db..7bfcbb2 100644 --- a/drivers/usb/chipidea/core.c +++ b/drivers/usb/chipidea/core.c @@ -53,6 +53,7 @@ #include #include #include +#include #include #include #include @@ -723,6 +724,24 @@ static int ci_get_platdata(struct device *dev, else cable->connected = false; } + + platdata->pctl = devm_pinctrl_get(dev); + if (!IS_ERR(platdata->pctl)) { + struct pinctrl_state *p; + + p = pinctrl_lookup_state(platdata->pctl, "default"); + if (!IS_ERR(p)) + platdata->pins_default = p; + + p = pinctrl_lookup_state(platdata->pctl, "host"); + if (!IS_ERR(p)) + platdata->pins_host = p; + + p = pinctrl_lookup_state(platdata->pctl, "device"); + if (!IS_ERR(p)) + platdata->pins_device = p; + } + return 0; } diff --git a/drivers/usb/chipidea/host.c b/drivers/usb/chipidea/host.c index 4638d9b..d858a82 100644 --- a/drivers/usb/chipidea/host.c +++ b/drivers/usb/chipidea/host.c @@ -13,6 +13,7 @@ #include #include #include +#include #include "../host/ehci.h" @@ -153,6 +154,10 @@ static int host_start(struct ci_hdrc *ci) } } + if (ci->platdata->pins_host) + pinctrl_select_state(ci->platdata->pctl, + ci->platdata->pins_host); + ret = usb_add_hcd(hcd, 0, 0); if (ret) { goto disable_reg; @@ -197,6 +202,10 @@ static void host_stop(struct ci_hdrc *ci) } ci->hcd = NULL; ci->otg.host = NULL; + + if (ci->platdata->pins_host && ci->platdata->pins_default) + pinctrl_select_state(ci->platdata->pctl, + ci->platdata->pins_default); } diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c index 9852ec5..829e947 100644 --- a/drivers/usb/chipidea/udc.c +++ b/drivers/usb/chipidea/udc.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include @@ -1965,6 +1966,10 @@ void ci_hdrc_gadget_destroy(struct ci_hdrc *ci) static int udc_id_switch_for_device(struct ci_hdrc *ci) { + if (ci->platdata->pins_device) + pinctrl_select_state(ci->platdata->pctl, + ci->platdata->pins_device); + if (ci->is_otg) /* Clear and enable BSV irq */ hw_write_otgsc(ci, OTGSC_BSVIS | OTGSC_BSVIE, @@ -1983,6 +1988,10 @@ static void udc_id_switch_for_host(struct ci_hdrc *ci) hw_write_otgsc(ci, OTGSC_BSVIE | OTGSC_BSVIS, OTGSC_BSVIS); ci->vbus_active = 0; + + if (ci->platdata->pins_device && ci->platdata->pins_default) + pinctrl_select_state(ci->platdata->pctl, + ci->platdata->pins_default); } /** diff --git a/include/linux/usb/chipidea.h b/include/linux/usb/chipidea.h index 07f9936..63758c3 100644 --- a/include/linux/usb/chipidea.h +++ b/include/linux/usb/chipidea.h @@ -77,6 +77,12 @@ struct ci_hdrc_platform_data { struct ci_hdrc_cable vbus_extcon; struct ci_hdrc_cable id_extcon; u32 phy_clkgate_delay_us; + + /* pins */ + struct pinctrl *pctl; + struct pinctrl_state *pins_default; + struct pinctrl_state *pins_host; + struct pinctrl_state *pins_device; }; /* Default offset of capability registers */ From patchwork Tue Sep 4 15:18:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Loic Poulain X-Patchwork-Id: 10587503 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4225F14BD for ; Tue, 4 Sep 2018 15:19:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3629829BA3 for ; Tue, 4 Sep 2018 15:19:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2983029C49; Tue, 4 Sep 2018 15:19:11 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=unavailable 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 D6A3229BBF for ; Tue, 4 Sep 2018 15:19:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727621AbeIDTol (ORCPT ); Tue, 4 Sep 2018 15:44:41 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:53918 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727186AbeIDToj (ORCPT ); Tue, 4 Sep 2018 15:44:39 -0400 Received: by mail-wm0-f65.google.com with SMTP id b19-v6so4872280wme.3 for ; Tue, 04 Sep 2018 08:19:06 -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:in-reply-to:references; bh=jJ1U4kKx8193jG9tQkZcIBV20/yBv7/sRbP/e4dOMNo=; b=b9touJj3MiUmzSKoxvjisezPgsU3C5H0wSy7lfOqvv9Q74U+Z/gUKMyexrVuiQw4UH WmBROPhbnrKKnkfFKxZrf4ELH8B2Xoy3SoZCZ9heBKRTU57ep03fcJLrLGGOMNpiM0bh Veb16dMqI7pPx/6e79REJsa81mv80TAlyCVP8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=jJ1U4kKx8193jG9tQkZcIBV20/yBv7/sRbP/e4dOMNo=; b=oS2zDUplP1jc+hlRDQeM9fB8o5PqEKleeCIzNfPmsOXELLbtzjvnrqWvHskuGZs75S WjAA9Q8WOeOMZaMI9f/n0rViSXZLwNrQc6EWicFWX0ZGJjsnMPNNEh+ub6+pc+z/j045 nA3ehl8lfZHmzntaW+8r8o641nk6czhwBqh6GOFjm74ppy4Pwt9cOA9M3CHtEOUDM7qn D8qxg08JB5xLZJP325AC9YfmfxJoEOoEswGjVulnMrGuUzbVVuYi0u80ovQpBl0Gz+j/ gwUiLAJHVGhKj8/Cmw08ZFwqvTuVCT7lA8S2CAtUEKLGPW9qWyCZqEHab4U0npe8yQUO Bqkg== X-Gm-Message-State: APzg51DQOZ6eXG5aKftr+WAsR9ieZmCopw1WIKGU1crHpJRdYwsyj/f4 cr+5nRONdpfWWLyTveKx2EqW7g== X-Google-Smtp-Source: ANB0VdYvBdfoA3K0eECE7MoLKLoI/f+VHFy1iGpVkHv3kpqxdBD+8XnQccEGRiGtQyMuQUZy7rVYeg== X-Received: by 2002:a1c:b157:: with SMTP id a84-v6mr2873018wmf.18.1536074345443; Tue, 04 Sep 2018 08:19:05 -0700 (PDT) Received: from lpoulain-ThinkPad-T470p.home (AToulouse-654-1-394-222.w90-55.abo.wanadoo.fr. [90.55.193.222]) by smtp.gmail.com with ESMTPSA id l24-v6sm40255033wrb.65.2018.09.04.08.19.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 04 Sep 2018 08:19:04 -0700 (PDT) From: Loic Poulain To: Peter.Chen@nxp.com Cc: linux-usb@vger.kernel.org, linux-arm-msm@vger.kernel.org, david.brown@linaro.org, robh+dt@kernel.org, bjorn.andersson@linaro.org, andy.gross@linaro.org, andy.shevchenko@gmail.com, Loic Poulain Subject: [PATCH v3 2/6] doc: usb: ci-hdrc-usb2: Add pinctrl properties definition Date: Tue, 4 Sep 2018 17:18:56 +0200 Message-Id: <1536074340-14840-2-git-send-email-loic.poulain@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1536074340-14840-1-git-send-email-loic.poulain@linaro.org> References: <1536074340-14840-1-git-send-email-loic.poulain@linaro.org> Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Some hardware implementations require to configure pins differently according to the USB role (host/device), this can be an update of the pins routing or a simple GPIO value change. This patch introduces new optional "host" and "device" pinctrls. If these pinctrls are defined by the device, they are respectively selected on host/device role start. Signed-off-by: Loic Poulain --- v2: Add new pin modes documentation (host, device) v3: rebase on usb-next Documentation/devicetree/bindings/usb/ci-hdrc-usb2.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/devicetree/bindings/usb/ci-hdrc-usb2.txt b/Documentation/devicetree/bindings/usb/ci-hdrc-usb2.txt index 2e93181..529e518 100644 --- a/Documentation/devicetree/bindings/usb/ci-hdrc-usb2.txt +++ b/Documentation/devicetree/bindings/usb/ci-hdrc-usb2.txt @@ -80,6 +80,8 @@ Optional properties: controller. It's expected that a mux state of 0 indicates device mode and a mux state of 1 indicates host mode. - mux-control-names: Shall be "usb_switch" if mux-controls is specified. +- pinctrl-names: Names for optional pin modes in "default", "host", "device" +- pinctrl-n: alternate pin modes i.mx specific properties - fsl,usbmisc: phandler of non-core register device, with one From patchwork Tue Sep 4 15:18:57 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Loic Poulain X-Patchwork-Id: 10587497 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5DF5B14BD for ; Tue, 4 Sep 2018 15:19:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4F05F29BE1 for ; Tue, 4 Sep 2018 15:19:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4D4EE29C83; Tue, 4 Sep 2018 15:19:10 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 F04C429BE1 for ; Tue, 4 Sep 2018 15:19:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727620AbeIDTol (ORCPT ); Tue, 4 Sep 2018 15:44:41 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:53919 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727220AbeIDTol (ORCPT ); Tue, 4 Sep 2018 15:44:41 -0400 Received: by mail-wm0-f65.google.com with SMTP id b19-v6so4872357wme.3 for ; Tue, 04 Sep 2018 08:19:07 -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:in-reply-to:references; bh=Ie+UuyUnSDYUVvk6e0jmSvyTUxKfj3biwa8t/QSCAiY=; b=RMHttoOjLJnK/rpqgyhXWZKY2L7lwvSApNxb0eKaEyCOG75Dy2tGsmKARwCniiKApS Tze+au1ADXAI8xwxtA2S1vo9pNFEMy9GE1SEIeYt5yJR4MlaETolVl40efOFf7xuQNiC bz7ltheHoqFcfv6qQRhUWXL0cCTekztjCnowY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Ie+UuyUnSDYUVvk6e0jmSvyTUxKfj3biwa8t/QSCAiY=; b=ptK8xSBd0uFiDcEkD4BaIxdw9CWKl0cgpWT1Esm0C0/vXQIkHDh9oV70bgqOFBXCnY Gtjp6ulZh/3Bbh8eAit+09QqlxNRgYB+70YVHTz1gThfiACRwiN/c3DIO0VexVEUeWzz k/gubCT3JXHjcvgB1Eyy8dZhJxB6EWEzq+AKLlZhf7UV5l5+o+EAI+H3vyFH0MOlkMQM UE5ci7iLn9JuRNDhETGCpg+98KRD5m48IrrLl4OTKqPvPgd3vZeLUGXf7cChS7o2qclr IDokmw0QoxMHbGb5P2pRTqysMRjuJEbXuAewQp9k6oGZ1H+jPpX6bbq7u3Sz9MtW6it9 FQJA== X-Gm-Message-State: APzg51CGj9vQKsSsvdCHCCLEnXAFdzpSXBaC9iBD0lFBaZnn6pCu6oFl c23JiPMl0HOP8FoYNkcqzQ94eQ== X-Google-Smtp-Source: ANB0VdZw/SSz6Q6zU/uFmi43EWFFd/w/L3Yz2Zfgw3628VSkJ2dUYkEiDqdJCqfo+MbDjdP5+yoqEQ== X-Received: by 2002:a1c:f11a:: with SMTP id p26-v6mr8780741wmh.92.1536074347009; Tue, 04 Sep 2018 08:19:07 -0700 (PDT) Received: from lpoulain-ThinkPad-T470p.home (AToulouse-654-1-394-222.w90-55.abo.wanadoo.fr. [90.55.193.222]) by smtp.gmail.com with ESMTPSA id l24-v6sm40255033wrb.65.2018.09.04.08.19.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 04 Sep 2018 08:19:06 -0700 (PDT) From: Loic Poulain To: Peter.Chen@nxp.com Cc: linux-usb@vger.kernel.org, linux-arm-msm@vger.kernel.org, david.brown@linaro.org, robh+dt@kernel.org, bjorn.andersson@linaro.org, andy.gross@linaro.org, andy.shevchenko@gmail.com, Loic Poulain Subject: [PATCH v3 3/6] usb: chipidea: Prevent unbalanced IRQ disable Date: Tue, 4 Sep 2018 17:18:57 +0200 Message-Id: <1536074340-14840-3-git-send-email-loic.poulain@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1536074340-14840-1-git-send-email-loic.poulain@linaro.org> References: <1536074340-14840-1-git-send-email-loic.poulain@linaro.org> Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The ChipIdea IRQ is disabled before scheduling the otg work and re-enabled on otg work completion. However if the job is already scheduled we have to undo the effect of disable_irq int order to balance the IRQ disable-depth value. Fixes: be6b0c1bd0be ("usb: chipidea: using one inline function to cover queue work operations") Signed-off-by: Loic Poulain --- v2: v3: no change drivers/usb/chipidea/otg.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/usb/chipidea/otg.h b/drivers/usb/chipidea/otg.h index 7e7428e..4f8b817 100644 --- a/drivers/usb/chipidea/otg.h +++ b/drivers/usb/chipidea/otg.h @@ -17,7 +17,8 @@ void ci_handle_vbus_change(struct ci_hdrc *ci); static inline void ci_otg_queue_work(struct ci_hdrc *ci) { disable_irq_nosync(ci->irq); - queue_work(ci->wq, &ci->work); + if (queue_work(ci->wq, &ci->work) == false) + enable_irq(ci->irq); } #endif /* __DRIVERS_USB_CHIPIDEA_OTG_H */ From patchwork Tue Sep 4 15:18:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Loic Poulain X-Patchwork-Id: 10587507 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 812FA1669 for ; Tue, 4 Sep 2018 15:19:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7503129C7A for ; Tue, 4 Sep 2018 15:19:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 734DE29C83; Tue, 4 Sep 2018 15:19:12 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=unavailable 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 3078729C7A for ; Tue, 4 Sep 2018 15:19:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727635AbeIDTom (ORCPT ); Tue, 4 Sep 2018 15:44:42 -0400 Received: from mail-wr1-f65.google.com ([209.85.221.65]:43135 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727613AbeIDTom (ORCPT ); Tue, 4 Sep 2018 15:44:42 -0400 Received: by mail-wr1-f65.google.com with SMTP id k5-v6so4373043wre.10 for ; Tue, 04 Sep 2018 08:19:09 -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:in-reply-to:references; bh=DaoitWn4N4E8MxKe6c9On/izFsNnJ18tWXmCQk3yml4=; b=fa1LNNpXRiUjwIDuNA5uLZ6TgYcZTxhpgDq4ZIE7lYKoik1y+ZYlTXjdgEwblpAiVN 6cAmmsIejoGUQyqAI/6NlFIuccnQ/8ndhU51CkHkyl0rDpqN64cWY/mK/HNDw8z7B2J3 cYFbIT4PeXZCjTnNtIyo4joLyYLfb9RS1obsw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=DaoitWn4N4E8MxKe6c9On/izFsNnJ18tWXmCQk3yml4=; b=GksbhGXSmBLFjIgt+ev3y/Dq0l49mP0lDPXra0pAztqQYzCKVge77kPN0L4NtMcg95 8AWsKsu/+y/w8tjDEIpAh9FNKrhqs2CiYLTr5G+6uBxHLmIf6sITA13Yisk2jZVGyUIw Fq4CHQlc1l8GDE9gcrlVhmhRu8yrz6ccBCVWzFv7Z/QRGsv1us3sXnIC532EnSL/WIby Yl1ueESlHUKgsUwanMi+nyXb9tLuO1GmiaxVhcObRw9LDRLUpEzG7LbIhNJGSDp5N97h s3Ipr5fRJTBey5iup0R67XoTEFf1iScuNs45lZ0QM8R6/JamAgkWnOV4XJyGRaLp8GAt pvyg== X-Gm-Message-State: APzg51DVlvqZYewt9BdRKajW0RC2t/1QLE47KkpdYVJ7u2bclsWf/tSy kPBMBdAtUqeIEC3z8tG3kKGH/w== X-Google-Smtp-Source: ANB0VdY+95wNAQpYvuLVkyHHpKvuxHwAp4ABNQoxv5SwgoL7Of96DxzqM5nf+42Xkkxlgwvvw3HjYg== X-Received: by 2002:adf:be81:: with SMTP id i1-v6mr21422160wrh.235.1536074348497; Tue, 04 Sep 2018 08:19:08 -0700 (PDT) Received: from lpoulain-ThinkPad-T470p.home (AToulouse-654-1-394-222.w90-55.abo.wanadoo.fr. [90.55.193.222]) by smtp.gmail.com with ESMTPSA id l24-v6sm40255033wrb.65.2018.09.04.08.19.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 04 Sep 2018 08:19:07 -0700 (PDT) From: Loic Poulain To: Peter.Chen@nxp.com Cc: linux-usb@vger.kernel.org, linux-arm-msm@vger.kernel.org, david.brown@linaro.org, robh+dt@kernel.org, bjorn.andersson@linaro.org, andy.gross@linaro.org, andy.shevchenko@gmail.com, Loic Poulain Subject: [PATCH v3 4/6] usb: chipidea: Fix otg event handler Date: Tue, 4 Sep 2018 17:18:58 +0200 Message-Id: <1536074340-14840-4-git-send-email-loic.poulain@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1536074340-14840-1-git-send-email-loic.poulain@linaro.org> References: <1536074340-14840-1-git-send-email-loic.poulain@linaro.org> Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP At OTG work running time, it's possible that several events need to be addressed (e.g. ID and VBUS events). The current implementation handles only one event at a time which leads to ignoring the other one. Fix it. Signed-off-by: Loic Poulain --- v2: v3: no change drivers/usb/chipidea/otg.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/usb/chipidea/otg.c b/drivers/usb/chipidea/otg.c index db4ceff..f25d482 100644 --- a/drivers/usb/chipidea/otg.c +++ b/drivers/usb/chipidea/otg.c @@ -203,14 +203,17 @@ static void ci_otg_work(struct work_struct *work) } pm_runtime_get_sync(ci->dev); + if (ci->id_event) { ci->id_event = false; ci_handle_id_switch(ci); - } else if (ci->b_sess_valid_event) { + } + + if (ci->b_sess_valid_event) { ci->b_sess_valid_event = false; ci_handle_vbus_change(ci); - } else - dev_err(ci->dev, "unexpected event occurs at %s\n", __func__); + } + pm_runtime_put_sync(ci->dev); enable_irq(ci->irq); From patchwork Tue Sep 4 15:18:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Loic Poulain X-Patchwork-Id: 10587511 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 46B8514BD for ; Tue, 4 Sep 2018 15:19:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3AC7629BA3 for ; Tue, 4 Sep 2018 15:19:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2F6D029C6F; Tue, 4 Sep 2018 15:19:15 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=unavailable 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 151BF29BAD for ; Tue, 4 Sep 2018 15:19:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727640AbeIDTop (ORCPT ); Tue, 4 Sep 2018 15:44:45 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:36583 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727629AbeIDToo (ORCPT ); Tue, 4 Sep 2018 15:44:44 -0400 Received: by mail-wm0-f65.google.com with SMTP id j192-v6so4713515wmj.1 for ; Tue, 04 Sep 2018 08:19:10 -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:in-reply-to:references; bh=JUgb9vugJT+6B6QjtpmWBvMX+Wq5UlUI1pzbqQTz2N0=; b=PycRToe0oOvXjpgTCn7Ysl2ixJnrbemOp0tYouNO48u176Tn+sTEERxCOPgOcpvrK3 Khr0qj2AP9ZIJjI9K6PezWog8YLCSg7PG+d5i83AEwl3I13lGmvrWKTWYqe9TEdjBPtP y2FSme9twOy5JvrsclQGPg79UrblxbMYtAKOM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=JUgb9vugJT+6B6QjtpmWBvMX+Wq5UlUI1pzbqQTz2N0=; b=uCkLJzpOu8MBSzH1RuWen1r8SPhi0zHZnC8YxE2Kvce0NMee8NOBS/uohgfPs1t9ER yeUOIWbrmkqansLVwbLkL35rhCcxcxYHL2k33r+2/sJ0h7OT7x+qNKsLohgw+j06JQ/I CNj3TNc6bEVkd1hbiH7+P39Be6QIkivHMgOr3sNym1yksh5LNZEJMRmIJPvPmRALjBzI BCIZU1wn/X/3wa/Xmg5PBg+vpDg4FFiQ36crk8D9wlzjIJfP5m9LtS2KRaKcbjp2+UdF +blg/2ThAekB2olfQiH6FQq7Qvv7yFl5Czt5Tv2ODOYLFHfvmyrLARS6gt9N4Huq9Qqr U8Iw== X-Gm-Message-State: APzg51BzYeG8EIHE3FVV5RwjnqV5AoajwYbdzOIeV1hwG32M32iQi0Zw DFrPEPZbnKw+BYVFI9vbeyDipfUKT80= X-Google-Smtp-Source: ANB0VdYnfc4iZOTpqyi7FhScWptCSUW68ggB7PRjxLLSOz28/ZXYj4ughNMqSz5AJZgTVyoTcOfRdg== X-Received: by 2002:a1c:a386:: with SMTP id m128-v6mr2626711wme.139.1536074349982; Tue, 04 Sep 2018 08:19:09 -0700 (PDT) Received: from lpoulain-ThinkPad-T470p.home (AToulouse-654-1-394-222.w90-55.abo.wanadoo.fr. [90.55.193.222]) by smtp.gmail.com with ESMTPSA id l24-v6sm40255033wrb.65.2018.09.04.08.19.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 04 Sep 2018 08:19:09 -0700 (PDT) From: Loic Poulain To: Peter.Chen@nxp.com Cc: linux-usb@vger.kernel.org, linux-arm-msm@vger.kernel.org, david.brown@linaro.org, robh+dt@kernel.org, bjorn.andersson@linaro.org, andy.gross@linaro.org, andy.shevchenko@gmail.com, Loic Poulain Subject: [PATCH v3 5/6] phy: qcom-usb-hs: Fix unbalanced notifier registration Date: Tue, 4 Sep 2018 17:18:59 +0200 Message-Id: <1536074340-14840-5-git-send-email-loic.poulain@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1536074340-14840-1-git-send-email-loic.poulain@linaro.org> References: <1536074340-14840-1-git-send-email-loic.poulain@linaro.org> Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Phy power on/off cycle can happen several times during device life. We then need to balance the extcon notifier registration accordingly. Fixes: f0b5c2c96370 ("phy: qcom-usb-hs: Replace the extcon API") Signed-off-by: Loic Poulain --- v2: don't use devres version (power-on always followed by power-off) v3: no change drivers/phy/qualcomm/phy-qcom-usb-hs.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/phy/qualcomm/phy-qcom-usb-hs.c b/drivers/phy/qualcomm/phy-qcom-usb-hs.c index abbbe75..7153dde 100644 --- a/drivers/phy/qualcomm/phy-qcom-usb-hs.c +++ b/drivers/phy/qualcomm/phy-qcom-usb-hs.c @@ -160,8 +160,8 @@ static int qcom_usb_hs_phy_power_on(struct phy *phy) /* setup initial state */ qcom_usb_hs_phy_vbus_notifier(&uphy->vbus_notify, state, uphy->vbus_edev); - ret = devm_extcon_register_notifier(&ulpi->dev, uphy->vbus_edev, - EXTCON_USB, &uphy->vbus_notify); + ret = extcon_register_notifier(uphy->vbus_edev, EXTCON_USB, + &uphy->vbus_notify); if (ret) goto err_ulpi; } @@ -182,6 +182,11 @@ static int qcom_usb_hs_phy_power_off(struct phy *phy) { struct qcom_usb_hs_phy *uphy = phy_get_drvdata(phy); + if (uphy->vbus_edev) { + extcon_unregister_notifier(uphy->vbus_edev, EXTCON_USB, + &uphy->vbus_notify); + } + regulator_disable(uphy->v3p3); regulator_disable(uphy->v1p8); clk_disable_unprepare(uphy->sleep_clk); From patchwork Tue Sep 4 15:19:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Loic Poulain X-Patchwork-Id: 10587515 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7542716B1 for ; Tue, 4 Sep 2018 15:19:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 688CD29C6F for ; Tue, 4 Sep 2018 15:19:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5CA7829C75; Tue, 4 Sep 2018 15:19:16 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=unavailable 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 07C4A29BD2 for ; Tue, 4 Sep 2018 15:19:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727627AbeIDTor (ORCPT ); Tue, 4 Sep 2018 15:44:47 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:50328 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727615AbeIDToq (ORCPT ); Tue, 4 Sep 2018 15:44:46 -0400 Received: by mail-wm0-f67.google.com with SMTP id s12-v6so4893193wmc.0 for ; Tue, 04 Sep 2018 08:19:12 -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:in-reply-to:references; bh=+R5QIWV4I37qJVQpK/g9sdwS0+lLRSmTw9qWsWuijTI=; b=Aj1dR6y494zykVkkv+wTaasZgL8QCi+5eAnjdfP3nFd6Z5EoYrSt1CApGQm0hXDf/l Kon8Clo17O3sv5vDN0ycD5Z8RQaKj84Vz8J+irhq3ThsaFYnocZ05NSgWIwz40FVgRfk GJ71kTzxHZTSdCHgr1q3zonfjCmS/zgA1pKf4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=+R5QIWV4I37qJVQpK/g9sdwS0+lLRSmTw9qWsWuijTI=; b=hF6HTvzRNayRllcwEWAX0RwuqJhqS1kNvquXJqtlUpoXmED7QZcCCtQcnu9iUDvcTO 3M5x2TYbxn+9PdXTUKRzteJDeCzYifz5aA/l8IxFzyMl40MM8xmWvzOUD83sheXCCZld opAT31lAhAb96WwbtsXCodaeOM1cEUB0K7JTdlAKP/u9Br94s9wccNNGb25vqFP5Zhm7 hlJy6LB4zRtmpC83DcLsiYYIQZoN7y+efNC7TC7p4wR2wQHmUMzoIc6l+LiXCwWOfpj7 zATFUj3QbfjdB52LDq6Un5qo3tXcDZqrk02shDQjlb2EFo1Bb43QaaXow5Gjs0GeCOBK fvFw== X-Gm-Message-State: APzg51A2M8PrIt0Laaasj6QnHTTbWDAgtch8hEIqjxq66KBvNwVAxDBc OPK1a/kJumBq8kk4octSU1HCyA== X-Google-Smtp-Source: ANB0VdZ7SXZpg2yEupo9RQHJy0ZM+kcK9tVOD6dlj7bWhkOoa0PUCkQYjOVbaixcAYRXU5ONxpML5w== X-Received: by 2002:a1c:1252:: with SMTP id 79-v6mr8386529wms.70.1536074351937; Tue, 04 Sep 2018 08:19:11 -0700 (PDT) Received: from lpoulain-ThinkPad-T470p.home (AToulouse-654-1-394-222.w90-55.abo.wanadoo.fr. [90.55.193.222]) by smtp.gmail.com with ESMTPSA id l24-v6sm40255033wrb.65.2018.09.04.08.19.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 04 Sep 2018 08:19:11 -0700 (PDT) From: Loic Poulain To: Peter.Chen@nxp.com Cc: linux-usb@vger.kernel.org, linux-arm-msm@vger.kernel.org, david.brown@linaro.org, robh+dt@kernel.org, bjorn.andersson@linaro.org, andy.gross@linaro.org, andy.shevchenko@gmail.com, Loic Poulain Subject: [PATCH v3 6/6] arm: dts: qcom: db410c: Enable USB OTG support Date: Tue, 4 Sep 2018 17:19:00 +0200 Message-Id: <1536074340-14840-6-git-send-email-loic.poulain@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1536074340-14840-1-git-send-email-loic.poulain@linaro.org> References: <1536074340-14840-1-git-send-email-loic.poulain@linaro.org> Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The Dragonboard-410c is able to act either as USB Host or Device. The role can be determined at runtime via the USB_HS_ID pin which is derived from the micro-usb port VBUS pin. In Host role, SoC USB D+/D- are routed to the onboard USB 2.0 HUB. In Device role, SoC USB D+/D- are routed to the USB 2.0 micro B port. Routing is selected via USB_SW_SEL_PM gpio. In device role USB HUB can be held in reset. chipidea driver expects two extcon device pointers, one for the EXTCON_USB event and one for the EXTCON_USB_HOST event. Since the extcon-usb-gpio device is capable of generating both these events, point two times to this extcon device. Signed-off-by: Loic Poulain --- v2: no change v3: Point two times to the same extcon-usb-device arch/arm64/boot/dts/qcom/apq8016-sbc-pmic-pins.dtsi | 20 ++++++++++++++++++++ arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi | 11 ++++++----- 2 files changed, 26 insertions(+), 5 deletions(-) diff --git a/arch/arm64/boot/dts/qcom/apq8016-sbc-pmic-pins.dtsi b/arch/arm64/boot/dts/qcom/apq8016-sbc-pmic-pins.dtsi index ec2f0de..99787cc 100644 --- a/arch/arm64/boot/dts/qcom/apq8016-sbc-pmic-pins.dtsi +++ b/arch/arm64/boot/dts/qcom/apq8016-sbc-pmic-pins.dtsi @@ -8,6 +8,16 @@ pinconf { pins = "gpio3"; function = PMIC_GPIO_FUNC_NORMAL; + input-disable; + output-high; + }; + }; + + usb_hub_reset_pm_device: usb_hub_reset_pm_device { + pinconf { + pins = "gpio3"; + function = PMIC_GPIO_FUNC_NORMAL; + input-disable; output-low; }; }; @@ -22,6 +32,16 @@ }; }; + usb_sw_sel_pm_device: usb_sw_sel_pm_device { + pinconf { + pins = "gpio4"; + function = PMIC_GPIO_FUNC_NORMAL; + power-source = ; + input-disable; + output-low; + }; + }; + pm8916_gpios_leds: pm8916_gpios_leds { pinconf { pins = "gpio1", "gpio2"; diff --git a/arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi b/arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi index 78ce397..1f7dc1c 100644 --- a/arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi +++ b/arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi @@ -366,14 +366,15 @@ }; usb@78d9000 { - extcon = <&usb_id>; + extcon = <&usb_id>, <&usb_id>; status = "okay"; adp-disable; hnp-disable; srp-disable; - dr_mode = "host"; - pinctrl-names = "default"; - pinctrl-0 = <&usb_sw_sel_pm>; + dr_mode = "otg"; + pinctrl-names = "default", "device"; + pinctrl-0 = <&usb_sw_sel_pm &usb_hub_reset_pm>; + pinctrl-1 = <&usb_sw_sel_pm_device &usb_hub_reset_pm_device>; ulpi { phy { v1p8-supply = <&pm8916_l7>; @@ -512,7 +513,7 @@ usb_id: usb-id { compatible = "linux,extcon-usb-gpio"; - vbus-gpio = <&msmgpio 121 GPIO_ACTIVE_HIGH>; + id-gpio = <&msmgpio 121 GPIO_ACTIVE_HIGH>; pinctrl-names = "default"; pinctrl-0 = <&usb_id_default>; };