From patchwork Sun Jan 28 20:22:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Blumenstingl X-Patchwork-Id: 10187965 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 C9FD16056A for ; Sun, 28 Jan 2018 20:23:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B86112870B for ; Sun, 28 Jan 2018 20:23:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ACB7B2870F; Sun, 28 Jan 2018 20:23:51 +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.2 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, DKIM_VALID, FREEMAIL_FROM, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 226D42870B for ; Sun, 28 Jan 2018 20:23:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=pNpIgaSqJO8Rh5bKrKYX5pzsdnmvoLojnqOqnAUT3D4=; b=qaKilSWIxUiMKJVCyDrE3oS/qB MD6vMHoVxAPRmFwIKPc2KfUnOaDH0DaWix3qkXx9qOhu8yQjmcBmJeBxeE7TamYwi/4mbmharEjcb NoCA/1ZhEoNsXuCFpRCBhynofafDg+UypyRcQiYK5iCsS/3I9GAcBNdMkasubNAMT+FvS51NOyw0N Rc6jUUVod5rtmFLrVMf6mgEDdvyhT/Jibg0Og+nA6TXkqRwftmXCw6i0sQ/b6RvwOExXaRZEdFXrI +Y6MxHxS3gAh9H+Ko7DmVAMuQG4YtaOYjAYIHuQfwETGhfylN+5HSPwbqIdeIjtzLkxL/rlbjnXv+ AnTPuzdg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1eftUK-00084x-7g; Sun, 28 Jan 2018 20:23:40 +0000 Received: from mail-wr0-x243.google.com ([2a00:1450:400c:c0c::243]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1eftUB-0007va-PM for linux-amlogic@lists.infradead.org; Sun, 28 Jan 2018 20:23:34 +0000 Received: by mail-wr0-x243.google.com with SMTP id 36so5029670wrh.1 for ; Sun, 28 Jan 2018 12:23:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=9udj6hxwvESJb6UI6VV6T9v8Th4B9yE0q+hfx2rxXX8=; b=gyMCJuo7i/NFBU2WmbSY3h1z6qiYg38fbeWz8dPJ0RqnyX0NdkKuwSteoVteI6yLJD NGmzuQzX6tkLEcyeiOoARQCwjI99Dn/0yu5IRp6H9Yqx5Hwm3cmHDZytxkZGGfYZlK/n 9GtDrZ661+X7wYzJi+H4BmCoMt8szCS6xL13oHdo475yvFKWm/zzVib9B10EST2NkZLp 1qx7o8d/0ILgCxPke+DZbZMNJnWcDM593WxDA5E2rIx8nCovlK8+YlAu07BoaP8czKzt D2DXE6FLlI5V2vXEizpllcWbChswJpS61UBAfA0DW5i+/2qjUZ7te3urNmkVMDZcPPU3 hA1A== 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=9udj6hxwvESJb6UI6VV6T9v8Th4B9yE0q+hfx2rxXX8=; b=qMo4M64Ihgp1X9H4eC8pfQgVnBQRx702lZJ/D3iUmjRLhY54lcrTPSunMCQgO9+w37 kYQT06uo6GI9w9HnWcSkfzfVhwPK01PzOgSkWjIgXO2H2/gFY2gPYxm8PnEuDxe5NehE iKwuaSEeVx5vjCXvDVjkGHlgGUyweDA2IdqasWUGz5NFRT4thBjfLLh6PL+qak3HxbYg bLjLhi6k/ncxkpB7B0HxQOyy5kVt7/Sot6FpaslkhyblOfyyDEKhj5IUAlRSBvDYxfL0 pbHSWoVS3MYRfYm/j9WEC9z/ITqU9yEMVjMCQbo7dG8CpKtLmEi/5uFZX8uhZyk34hJ6 dL7g== X-Gm-Message-State: AKwxytey0hH8LF1wlA8mISF72BHUMbaSukLecGXcaB9e6MJ2j/oZDa6l BGZH/ckjiV5U6miz7q8luTQ= X-Google-Smtp-Source: AH8x227kSGtXSXhhH2hD/HdB4orhRNA1yxXOldA+O3LtAoXieoqFUw+wPngGCKSVwatgcJZmmdbDwQ== X-Received: by 10.223.152.172 with SMTP id w41mr17362191wrb.12.1517170999957; Sun, 28 Jan 2018 12:23:19 -0800 (PST) Received: from blackbox.darklights.net (p5DD9B288.dip0.t-ipconnect.de. [93.217.178.136]) by smtp.googlemail.com with ESMTPSA id f8sm5687369wmc.3.2018.01.28.12.23.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 28 Jan 2018 12:23:19 -0800 (PST) From: Martin Blumenstingl To: robh+dt@kernel.org, mark.rutland@arm.com, kishon@ti.com, devicetree@vger.kernel.org, linux-amlogic@lists.infradead.org Subject: [PATCH 3/5] phy: amlogic: phy-meson-gxl-usb2: default to host mode Date: Sun, 28 Jan 2018 21:22:43 +0100 Message-Id: <20180128202245.25021-4-martin.blumenstingl@googlemail.com> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180128202245.25021-1-martin.blumenstingl@googlemail.com> References: <20180128202245.25021-1-martin.blumenstingl@googlemail.com> X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: narmstrong@baylibre.com, Martin Blumenstingl , khilman@baylibre.com, yixun.lan@amlogic.com, carlo@caione.org, jbrunet@baylibre.com MIME-Version: 1.0 Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+patchwork-linux-amlogic=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The USB2 PHY can switch between PHY_MODE_USB_HOST and PHY_MODE_USB_DEVICE. However, it cannot do it on it's own since it requires re-routing of the corresponding USB pins from dwc3 (which is used for host-mode) to dwc2 (which is used for device-mode). Thus we don't need to auto-detect the mode based on the USB controller, which simplifies the driver code. Signed-off-by: Martin Blumenstingl --- drivers/phy/amlogic/Kconfig | 1 - drivers/phy/amlogic/phy-meson-gxl-usb2.c | 15 ++------------- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/drivers/phy/amlogic/Kconfig b/drivers/phy/amlogic/Kconfig index 2f690d24203a..23fe1cda2f70 100644 --- a/drivers/phy/amlogic/Kconfig +++ b/drivers/phy/amlogic/Kconfig @@ -18,7 +18,6 @@ config PHY_MESON_GXL_USB2 default ARCH_MESON depends on OF && (ARCH_MESON || COMPILE_TEST) depends on USB_SUPPORT - select USB_COMMON select GENERIC_PHY select REGMAP_MMIO help diff --git a/drivers/phy/amlogic/phy-meson-gxl-usb2.c b/drivers/phy/amlogic/phy-meson-gxl-usb2.c index 303b2b46af3c..ee3c2c0c8572 100644 --- a/drivers/phy/amlogic/phy-meson-gxl-usb2.c +++ b/drivers/phy/amlogic/phy-meson-gxl-usb2.c @@ -20,7 +20,6 @@ #include #include #include -#include /* bits [31:27] are read-only */ #define U2P_R0 0x0 @@ -253,18 +252,8 @@ static int phy_meson_gxl_usb2_probe(struct platform_device *pdev) if (IS_ERR(base)) return PTR_ERR(base); - switch (of_usb_get_dr_mode_by_phy(dev->of_node, -1)) { - case USB_DR_MODE_PERIPHERAL: - priv->mode = PHY_MODE_USB_DEVICE; - break; - case USB_DR_MODE_OTG: - priv->mode = PHY_MODE_USB_OTG; - break; - case USB_DR_MODE_HOST: - default: - priv->mode = PHY_MODE_USB_HOST; - break; - } + /* start in host mode */ + priv->mode = PHY_MODE_USB_HOST; priv->regmap = devm_regmap_init_mmio(dev, base, &phy_meson_gxl_usb2_regmap_conf);