From patchwork Tue May 21 11:58:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 164715 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp1512089ili; Tue, 21 May 2019 05:03:58 -0700 (PDT) X-Google-Smtp-Source: APXvYqz9NVPT/9nry56kYIUkut9lVnb3hBwUuA2s7rdTSmx/bMpqGVXpO/iFETXff0SsvVSron6s X-Received: by 2002:a17:902:7591:: with SMTP id j17mr21983871pll.200.1558440238116; Tue, 21 May 2019 05:03:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558440238; cv=none; d=google.com; s=arc-20160816; b=NlyhcJXWvYU0NnQnZoFrjrhuI6JYOsZ4J5bVzMj0HxJ6uB8ylMgj4GGeJTWHPavUEL y9kMttsKQxveDOVBtMN5queURQ7P8CSCzxffpCfunmyG7CJcX+sSaU6XwFk+1xo0mNYk geyoefnpTLqPfVJXAknOiHL9rXykS0QVdOXgBLsb7Z+K/y5gLPN4fu4tlc5rERDZUCaP cq556epZy1slQSKm41m4TQ6fL9hgn8DEsA/jmlGdbc8RynP0ZbQhUj1emZhRJ6VJILHL kuvqob6f/SpJvsT+WbI77nS2UucfS+tNJ9MfXlLQmAiLM1BEtuvU/HAnmSo1o1YJZwIX 6hng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:cms-type:in-reply-to :message-id:date:subject:cc:to:from:content-transfer-encoding :mime-version:dkim-signature:dkim-filter; bh=CHPrUFU5Cx2/8C7het5Q6gacxBr3DSqd8aCWWckjr4k=; b=lCngL6iaIVA2zjbFA+5TJZs1uHuMdW8ulkjhGo90HKPwAG5Blj7Df2VWJwMbHQx0Sx ElLfc9SAy82Jj2PYuwFeIecDDbJ5W7LiO4GLekjxEztJ7zn6NzLvNdbhptmeH7bAokdo E0SnQL0X0hmIfCnW9NcsKrrtHP7KDh0opsra4nSnkA3XBtr8vKnDgnMzZQpwFSzf/QAv k379EQn9TTNS3Fvn1OZoygstl4c+Z7FItY/uPqmZ9etnL+PpUKYB3RBkjLfbJXQcUuaG trgAcpXjkK6mKDWOYjjhasCr2PCFOc0GD82Ue+vMJADVYXbw7b9xbKJ9uhVeW8hEqcfk AKNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=ISx+VM17; spf=pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-samsung-soc-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m189si23014061pfm.17.2019.05.21.05.03.57; Tue, 21 May 2019 05:03:58 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=ISx+VM17; spf=pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-samsung-soc-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728066AbfEUMD5 (ORCPT + 3 others); Tue, 21 May 2019 08:03:57 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:47511 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728045AbfEUMD5 (ORCPT ); Tue, 21 May 2019 08:03:57 -0400 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20190521120356euoutp0298469af9d2e3ee1206467c16dd80ec52~gsSNMDAeU2274322743euoutp02T for ; Tue, 21 May 2019 12:03:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20190521120356euoutp0298469af9d2e3ee1206467c16dd80ec52~gsSNMDAeU2274322743euoutp02T DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1558440236; bh=CHPrUFU5Cx2/8C7het5Q6gacxBr3DSqd8aCWWckjr4k=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=ISx+VM17AcI/IWORtry6RQhOT6uer+KemjxtKKLtphzpDp8rrTn6b/2qQC+QbHr+N VCu3N+z1zfR7tY4qBDI520z6ex5KwvxhtVlR+583mOelCuhjDx2X9uePwmcl7LRp2k xocqK8VnDSQRSOakQ4Se5x30OiYfG9YPILfZoqLg= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20190521120355eucas1p1cb595d69733fd52ed44f2893c2900090~gsSMRVO8F2855228552eucas1p1F; Tue, 21 May 2019 12:03:55 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id 11.3B.04377.A29E3EC5; Tue, 21 May 2019 13:03:54 +0100 (BST) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20190521120354eucas1p2a39ba06586ddd388a9c376a40327bb4c~gsSLeG_4H2602826028eucas1p2P; Tue, 21 May 2019 12:03:54 +0000 (GMT) X-AuditID: cbfec7f4-12dff70000001119-b5-5ce3e92afa46 Received: from eusync4.samsung.com ( [203.254.199.214]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 5A.DE.04140.A29E3EC5; Tue, 21 May 2019 13:03:54 +0100 (BST) MIME-version: 1.0 Content-transfer-encoding: 8BIT Content-type: text/plain; charset="UTF-8" Received: from AMDC2765.DIGITAL.local ([106.120.51.73]) by eusync4.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0PRU006F4RY90T20@eusync4.samsung.com>; Tue, 21 May 2019 13:03:53 +0100 (BST) From: Marek Szyprowski To: linux-usb@vger.kernel.org, linux-samsung-soc@vger.kernel.org Cc: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Greg Kroah-Hartman , Marek Szyprowski , Bartlomiej Zolnierkiewicz , Markus Reichl , =?utf-8?b?TcOlbnMgUnVsbGfDpXJk?= , Krzysztof Kozlowski , Peter Chen , Alan Stern , Rob Herring Subject: [PATCH 5/5] usb: exynos: Remove support for legacy PHY bindings Date: Tue, 21 May 2019 13:58:49 +0200 Message-id: <20190521115849.9882-6-m.szyprowski@samsung.com> X-Mailer: git-send-email 2.17.1 In-reply-to: <20190521115849.9882-1-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA02SbUhTcRTG++/uvjha3KbhH7WkUYGSmiF5Kw2NwhsYGEmBGbnyouKctqum liSKZbeUlYK2fMM3bGW+pLKMzObQcOEsZdhwkhnITP3inK9pzavkt+ec5wfnnIdDIJKnqBuR oEhllAqZXIqJhJ19y0Yfb+tk9DHT+kmqtawZpar0gyiVV9uMUUZjC04Nd5VjVJmxW0DVNOQj lFW/BKgmvQWnliZKBdTa+BhK5X/Q45RqdQgLEdPmsft0m+YRRn+seI3TM4YBnG6d0wroF5Yl QBe1awA933YggogSBcUy8oR0Rul3JkYUb6jsRFLsfhm63xo0B1iOcMCJgGQAtFprEA6ICAnZ CGDvZzvKF/MAtpavC7apPlsb4I0GACfHexCHISb3wqXicSEHCAIhPaH+W6KjjZBesON9M87z GwB+minY5DHSH3KzHObQLmQIrKsfwxwQQg4isHa5YHOaM0nDLm0v7tBC8jAcLjKh/LAgWG9t wPmNPOGrFn4JJzIYVuVOIXx/A4ONjUd5fQ5qqzYArz3gcPFjoWMYJPMAnBhswvniCYDDuWVb 1GnY2/8V5W/Y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jLr0qOLo/r/bJ1QpIJk8M3vWfZcjRl+poLf6/uev1ghpfm pcIURttdXNvZvOs2z9F42WryOGpK6YX80lmLa14vtLs5nXN2xo7rth8vzu40maw3nduDv67j CZfjcfFbz0sO/RNVuPNOWImlOCPRUIu5qDgRANDy9seNAgAA X-CMS-MailID: 20190521120354eucas1p2a39ba06586ddd388a9c376a40327bb4c CMS-TYPE: 201P X-CMS-RootMailID: 20190521120354eucas1p2a39ba06586ddd388a9c376a40327bb4c References: <20190521115849.9882-1-m.szyprowski@samsung.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org Exnyos EHCI/OHCI custom port device tree sub-nodes under EHCI/OHCI devices has been removed, so the code for handling them can be also removed. Once this has been done, we can also remove the workaround added by commit 01d4071486fe ("usb: exynos: add workaround for the USB device bindings conflict") and enable support for the generic USB device bindings. Suggested-by: Måns Rullgård Signed-off-by: Marek Szyprowski --- drivers/usb/host/ehci-exynos.c | 46 ---------------------------------- drivers/usb/host/ohci-exynos.c | 46 ---------------------------------- 2 files changed, 92 deletions(-) -- 2.17.1 diff --git a/drivers/usb/host/ehci-exynos.c b/drivers/usb/host/ehci-exynos.c index 2a551a807ec0..afde1ffa0824 100644 --- a/drivers/usb/host/ehci-exynos.c +++ b/drivers/usb/host/ehci-exynos.c @@ -39,7 +39,6 @@ static struct hc_driver __read_mostly exynos_ehci_hc_driver; struct exynos_ehci_hcd { struct clk *clk; - struct device_node *of_node; struct phy *phy[PHY_NUMBER]; }; @@ -48,10 +47,8 @@ struct exynos_ehci_hcd { static int exynos_ehci_get_phy(struct device *dev, struct exynos_ehci_hcd *exynos_ehci) { - struct device_node *child; struct phy *phy; int phy_number, num_phys; - int ret; /* Get PHYs for the controller */ num_phys = of_count_phandle_with_args(dev->of_node, "phys", @@ -62,39 +59,6 @@ static int exynos_ehci_get_phy(struct device *dev, return PTR_ERR(phy); exynos_ehci->phy[phy_number] = phy; } - if (num_phys) - return 0; - - /* Get PHYs using legacy bindings */ - for_each_available_child_of_node(dev->of_node, child) { - ret = of_property_read_u32(child, "reg", &phy_number); - if (ret) { - dev_err(dev, "Failed to parse device tree\n"); - of_node_put(child); - return ret; - } - - if (phy_number >= PHY_NUMBER) { - dev_err(dev, "Invalid number of PHYs\n"); - of_node_put(child); - return -EINVAL; - } - - phy = devm_of_phy_get(dev, child, NULL); - exynos_ehci->phy[phy_number] = phy; - if (IS_ERR(phy)) { - ret = PTR_ERR(phy); - if (ret == -EPROBE_DEFER) { - of_node_put(child); - return ret; - } else if (ret != -ENOSYS && ret != -ENODEV) { - dev_err(dev, - "Error retrieving usb2 phy: %d\n", ret); - of_node_put(child); - return ret; - } - } - } return 0; } @@ -216,13 +180,6 @@ static int exynos_ehci_probe(struct platform_device *pdev) ehci = hcd_to_ehci(hcd); ehci->caps = hcd->regs; - /* - * Workaround: reset of_node pointer to avoid conflict between Exynos - * EHCI port subnodes and generic USB device bindings - */ - exynos_ehci->of_node = pdev->dev.of_node; - pdev->dev.of_node = NULL; - /* DMA burst Enable */ writel(EHCI_INSNREG00_ENABLE_DMA_BURST, EHCI_INSNREG00(hcd->regs)); @@ -239,7 +196,6 @@ static int exynos_ehci_probe(struct platform_device *pdev) fail_add_hcd: exynos_ehci_phy_disable(&pdev->dev); - pdev->dev.of_node = exynos_ehci->of_node; fail_io: clk_disable_unprepare(exynos_ehci->clk); fail_clk: @@ -252,8 +208,6 @@ static int exynos_ehci_remove(struct platform_device *pdev) struct usb_hcd *hcd = platform_get_drvdata(pdev); struct exynos_ehci_hcd *exynos_ehci = to_exynos_ehci(hcd); - pdev->dev.of_node = exynos_ehci->of_node; - usb_remove_hcd(hcd); exynos_ehci_phy_disable(&pdev->dev); diff --git a/drivers/usb/host/ohci-exynos.c b/drivers/usb/host/ohci-exynos.c index 195ea5fa021e..8e9f4ef4e397 100644 --- a/drivers/usb/host/ohci-exynos.c +++ b/drivers/usb/host/ohci-exynos.c @@ -30,17 +30,14 @@ static struct hc_driver __read_mostly exynos_ohci_hc_driver; struct exynos_ohci_hcd { struct clk *clk; - struct device_node *of_node; struct phy *phy[PHY_NUMBER]; }; static int exynos_ohci_get_phy(struct device *dev, struct exynos_ohci_hcd *exynos_ohci) { - struct device_node *child; struct phy *phy; int phy_number, num_phys; - int ret; /* Get PHYs for the controller */ num_phys = of_count_phandle_with_args(dev->of_node, "phys", @@ -51,39 +48,6 @@ static int exynos_ohci_get_phy(struct device *dev, return PTR_ERR(phy); exynos_ohci->phy[phy_number] = phy; } - if (num_phys) - return 0; - - /* Get PHYs using legacy bindings */ - for_each_available_child_of_node(dev->of_node, child) { - ret = of_property_read_u32(child, "reg", &phy_number); - if (ret) { - dev_err(dev, "Failed to parse device tree\n"); - of_node_put(child); - return ret; - } - - if (phy_number >= PHY_NUMBER) { - dev_err(dev, "Invalid number of PHYs\n"); - of_node_put(child); - return -EINVAL; - } - - phy = devm_of_phy_get(dev, child, NULL); - exynos_ohci->phy[phy_number] = phy; - if (IS_ERR(phy)) { - ret = PTR_ERR(phy); - if (ret == -EPROBE_DEFER) { - of_node_put(child); - return ret; - } else if (ret != -ENOSYS && ret != -ENODEV) { - dev_err(dev, - "Error retrieving usb2 phy: %d\n", ret); - of_node_put(child); - return ret; - } - } - } return 0; } @@ -183,13 +147,6 @@ static int exynos_ohci_probe(struct platform_device *pdev) goto fail_io; } - /* - * Workaround: reset of_node pointer to avoid conflict between Exynos - * OHCI port subnodes and generic USB device bindings - */ - exynos_ohci->of_node = pdev->dev.of_node; - pdev->dev.of_node = NULL; - err = usb_add_hcd(hcd, irq, IRQF_SHARED); if (err) { dev_err(&pdev->dev, "Failed to add USB HCD\n"); @@ -200,7 +157,6 @@ static int exynos_ohci_probe(struct platform_device *pdev) fail_add_hcd: exynos_ohci_phy_disable(&pdev->dev); - pdev->dev.of_node = exynos_ohci->of_node; fail_io: clk_disable_unprepare(exynos_ohci->clk); fail_clk: @@ -213,8 +169,6 @@ static int exynos_ohci_remove(struct platform_device *pdev) struct usb_hcd *hcd = platform_get_drvdata(pdev); struct exynos_ohci_hcd *exynos_ohci = to_exynos_ohci(hcd); - pdev->dev.of_node = exynos_ohci->of_node; - usb_remove_hcd(hcd); exynos_ohci_phy_disable(&pdev->dev);