From patchwork Sat Dec 21 06:50:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lubomir Rintel X-Patchwork-Id: 11306815 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DB15D1892 for ; Sat, 21 Dec 2019 06:50:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B8C8B2070B for ; Sat, 21 Dec 2019 06:50:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726186AbfLUGuV (ORCPT ); Sat, 21 Dec 2019 01:50:21 -0500 Received: from [167.172.186.51] ([167.172.186.51]:39638 "EHLO shell.v3.sk" rhost-flags-FAIL-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1725838AbfLUGuV (ORCPT ); Sat, 21 Dec 2019 01:50:21 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by zimbra.v3.sk (Postfix) with ESMTP id 3DF21DFC8A; Sat, 21 Dec 2019 06:50:23 +0000 (UTC) Received: from shell.v3.sk ([127.0.0.1]) by localhost (zimbra.v3.sk [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id XyUelJViFghl; Sat, 21 Dec 2019 06:50:20 +0000 (UTC) Received: from localhost (localhost.localdomain [127.0.0.1]) by zimbra.v3.sk (Postfix) with ESMTP id B77AADFCC9; Sat, 21 Dec 2019 06:50:20 +0000 (UTC) X-Virus-Scanned: amavisd-new at zimbra.v3.sk Received: from shell.v3.sk ([127.0.0.1]) by localhost (zimbra.v3.sk [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id JtPuZOI1Bivk; Sat, 21 Dec 2019 06:50:20 +0000 (UTC) Received: from furthur.lan (unknown [109.183.109.54]) by zimbra.v3.sk (Postfix) with ESMTPSA id 408C3DFC9C; Sat, 21 Dec 2019 06:50:20 +0000 (UTC) From: Lubomir Rintel To: Alan Stern Cc: Greg Kroah-Hartman , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Lubomir Rintel Subject: [PATCH v2 1/3] USB: EHCI: ehci-mv: add HSIC support Date: Sat, 21 Dec 2019 07:50:06 +0100 Message-Id: <20191221065008.266445-2-lkundrak@v3.sk> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191221065008.266445-1-lkundrak@v3.sk> References: <20191221065008.266445-1-lkundrak@v3.sk> MIME-Version: 1.0 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org Some special dance is needed to initialize the HSIC port. Signed-off-by: Lubomir Rintel --- drivers/usb/host/ehci-mv.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/usb/host/ehci-mv.c b/drivers/usb/host/ehci-mv.c index 66ec1fdf9fe7d..21eb32baf9380 100644 --- a/drivers/usb/host/ehci-mv.c +++ b/drivers/usb/host/ehci-mv.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include @@ -67,6 +68,8 @@ static int mv_ehci_reset(struct usb_hcd *hcd) { struct device *dev = hcd->self.controller; struct ehci_hcd_mv *ehci_mv = hcd_to_ehci_hcd_mv(hcd); + struct ehci_hcd *ehci = hcd_to_ehci(hcd); + u32 status; int retval; if (ehci_mv == NULL) { @@ -80,6 +83,14 @@ static int mv_ehci_reset(struct usb_hcd *hcd) if (retval) dev_err(dev, "ehci_setup failed %d\n", retval); + if (of_usb_get_phy_mode(dev->of_node) == USBPHY_INTERFACE_MODE_HSIC) { + status = ehci_readl(ehci, &ehci->regs->port_status[0]); + status |= PORT_TEST_FORCE; + ehci_writel(ehci, status, &ehci->regs->port_status[0]); + status &= ~PORT_TEST_FORCE; + ehci_writel(ehci, status, &ehci->regs->port_status[0]); + } + return retval; } From patchwork Sat Dec 21 06:50:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lubomir Rintel X-Patchwork-Id: 11306813 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AF63F13A4 for ; Sat, 21 Dec 2019 06:50:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8CD1521927 for ; Sat, 21 Dec 2019 06:50:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726098AbfLUGuU (ORCPT ); Sat, 21 Dec 2019 01:50:20 -0500 Received: from [167.172.186.51] ([167.172.186.51]:39616 "EHLO shell.v3.sk" rhost-flags-FAIL-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1725845AbfLUGuU (ORCPT ); Sat, 21 Dec 2019 01:50:20 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by zimbra.v3.sk (Postfix) with ESMTP id 540F2DFCCA; Sat, 21 Dec 2019 06:50:22 +0000 (UTC) Received: from shell.v3.sk ([127.0.0.1]) by localhost (zimbra.v3.sk [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id FGC-4VU70Q9e; Sat, 21 Dec 2019 06:50:21 +0000 (UTC) Received: from localhost (localhost.localdomain [127.0.0.1]) by zimbra.v3.sk (Postfix) with ESMTP id 4CFBADFC9F; Sat, 21 Dec 2019 06:50:21 +0000 (UTC) X-Virus-Scanned: amavisd-new at zimbra.v3.sk Received: from shell.v3.sk ([127.0.0.1]) by localhost (zimbra.v3.sk [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id niK8C99QG8XO; Sat, 21 Dec 2019 06:50:21 +0000 (UTC) Received: from furthur.lan (unknown [109.183.109.54]) by zimbra.v3.sk (Postfix) with ESMTPSA id A51B2DFC8A; Sat, 21 Dec 2019 06:50:20 +0000 (UTC) From: Lubomir Rintel To: Alan Stern Cc: Greg Kroah-Hartman , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Lubomir Rintel Subject: [PATCH v2 2/3] USB: EHCI: ehci-mv: make the PHY optional Date: Sat, 21 Dec 2019 07:50:07 +0100 Message-Id: <20191221065008.266445-3-lkundrak@v3.sk> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191221065008.266445-1-lkundrak@v3.sk> References: <20191221065008.266445-1-lkundrak@v3.sk> MIME-Version: 1.0 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org We may be using a NOP transceiver and those are treated specially by the USB core and return -ENODEV with devm_phy_get(). Signed-off-by: Lubomir Rintel --- drivers/usb/host/ehci-mv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/host/ehci-mv.c b/drivers/usb/host/ehci-mv.c index 21eb32baf9380..c8717f06cd8cb 100644 --- a/drivers/usb/host/ehci-mv.c +++ b/drivers/usb/host/ehci-mv.c @@ -127,7 +127,7 @@ static int mv_ehci_probe(struct platform_device *pdev) ehci_mv->set_vbus = pdata->set_vbus; } - ehci_mv->phy = devm_phy_get(&pdev->dev, "usb"); + ehci_mv->phy = devm_phy_optional_get(&pdev->dev, "usb"); if (IS_ERR(ehci_mv->phy)) { retval = PTR_ERR(ehci_mv->phy); if (retval != -EPROBE_DEFER) From patchwork Sat Dec 21 06:50:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lubomir Rintel X-Patchwork-Id: 11306817 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 14F47159A for ; Sat, 21 Dec 2019 06:50:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E3DF42070B for ; Sat, 21 Dec 2019 06:50:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726482AbfLUGuW (ORCPT ); Sat, 21 Dec 2019 01:50:22 -0500 Received: from [167.172.186.51] ([167.172.186.51]:39626 "EHLO shell.v3.sk" rhost-flags-FAIL-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1725907AbfLUGuW (ORCPT ); Sat, 21 Dec 2019 01:50:22 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by zimbra.v3.sk (Postfix) with ESMTP id 9DFC4DFC9F; Sat, 21 Dec 2019 06:50:22 +0000 (UTC) Received: from shell.v3.sk ([127.0.0.1]) by localhost (zimbra.v3.sk [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id 0QoOZXV2rgXD; Sat, 21 Dec 2019 06:50:21 +0000 (UTC) Received: from localhost (localhost.localdomain [127.0.0.1]) by zimbra.v3.sk (Postfix) with ESMTP id A9ABFDFC8A; Sat, 21 Dec 2019 06:50:21 +0000 (UTC) X-Virus-Scanned: amavisd-new at zimbra.v3.sk Received: from shell.v3.sk ([127.0.0.1]) by localhost (zimbra.v3.sk [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id WDwk2-J3pCBA; Sat, 21 Dec 2019 06:50:21 +0000 (UTC) Received: from furthur.lan (unknown [109.183.109.54]) by zimbra.v3.sk (Postfix) with ESMTPSA id 10F50DFCCB; Sat, 21 Dec 2019 06:50:21 +0000 (UTC) From: Lubomir Rintel To: Alan Stern Cc: Greg Kroah-Hartman , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Lubomir Rintel Subject: [PATCH v2 3/3] USB: EHCI: ehci-mv: drop pxa_ehci_type and some device IDs Date: Sat, 21 Dec 2019 07:50:08 +0100 Message-Id: <20191221065008.266445-4-lkundrak@v3.sk> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191221065008.266445-1-lkundrak@v3.sk> References: <20191221065008.266445-1-lkundrak@v3.sk> MIME-Version: 1.0 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org This is merely a cleanup. None of these is used anywhere. Signed-off-by: Lubomir Rintel --- Changes since v1: - Changed the wording a bit drivers/usb/host/ehci-mv.c | 6 ++---- include/linux/platform_data/mv_usb.h | 8 -------- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/drivers/usb/host/ehci-mv.c b/drivers/usb/host/ehci-mv.c index c8717f06cd8cb..91602e3492084 100644 --- a/drivers/usb/host/ehci-mv.c +++ b/drivers/usb/host/ehci-mv.c @@ -257,10 +257,8 @@ static int mv_ehci_remove(struct platform_device *pdev) MODULE_ALIAS("mv-ehci"); static const struct platform_device_id ehci_id_table[] = { - {"pxa-u2oehci", PXA_U2OEHCI}, - {"pxa-sph", PXA_SPH}, - {"mmp3-hsic", MMP3_HSIC}, - {"mmp3-fsic", MMP3_FSIC}, + {"pxa-u2oehci", 0}, + {"pxa-sph", 0}, {}, }; diff --git a/include/linux/platform_data/mv_usb.h b/include/linux/platform_data/mv_usb.h index 5376b6d799d5d..20d239c02bf3a 100644 --- a/include/linux/platform_data/mv_usb.h +++ b/include/linux/platform_data/mv_usb.h @@ -6,14 +6,6 @@ #ifndef __MV_PLATFORM_USB_H #define __MV_PLATFORM_USB_H -enum pxa_ehci_type { - EHCI_UNDEFINED = 0, - PXA_U2OEHCI, /* pxa 168, 9xx */ - PXA_SPH, /* pxa 168, 9xx SPH */ - MMP3_HSIC, /* mmp3 hsic */ - MMP3_FSIC, /* mmp3 fsic */ -}; - enum { MV_USB_MODE_OTG, MV_USB_MODE_HOST,