From: Peter Chen <peter.chen@nxp.com>
To: Fabio Estevam <festevam@gmail.com>
Cc: "balbi@kernel.org" <balbi@kernel.org>,
"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>
Subject: Re: [PATCH] usb: gadget: fsl_mxc_udc: Remove the driver
Date: Tue, 15 Dec 2020 04:39:52 +0000 [thread overview]
Message-ID: <20201215043922.GA2142@b29397-desktop> (raw)
In-Reply-To: <20201210205538.15025-1-festevam@gmail.com>
On 20-12-10 17:55:38, Fabio Estevam wrote:
> Since 5.10-rc1 i.MX is a devicetree-only platform, and this driver
> was only unsed by the old non-DT i.MX devices.
>
> Remove the driver as it has no users left.
>
> Signed-off-by: Fabio Estevam <festevam@gmail.com>
Acked-by: Peter Chen <peter.chen@nxp.com>
Peter
> ---
> drivers/usb/gadget/udc/Kconfig | 2 +-
> drivers/usb/gadget/udc/Makefile | 1 -
> drivers/usb/gadget/udc/fsl_mxc_udc.c | 122 ---------------------------
> 3 files changed, 1 insertion(+), 124 deletions(-)
> delete mode 100644 drivers/usb/gadget/udc/fsl_mxc_udc.c
>
> diff --git a/drivers/usb/gadget/udc/Kconfig b/drivers/usb/gadget/udc/Kconfig
> index 1a12aab208b4..8c614bb86c66 100644
> --- a/drivers/usb/gadget/udc/Kconfig
> +++ b/drivers/usb/gadget/udc/Kconfig
> @@ -90,7 +90,7 @@ config USB_BCM63XX_UDC
>
> config USB_FSL_USB2
> tristate "Freescale Highspeed USB DR Peripheral Controller"
> - depends on FSL_SOC || ARCH_MXC
> + depends on FSL_SOC
> help
> Some of Freescale PowerPC and i.MX processors have a High Speed
> Dual-Role(DR) USB controller, which supports device mode.
> diff --git a/drivers/usb/gadget/udc/Makefile b/drivers/usb/gadget/udc/Makefile
> index f5a7ce28aecd..a21f2224e7eb 100644
> --- a/drivers/usb/gadget/udc/Makefile
> +++ b/drivers/usb/gadget/udc/Makefile
> @@ -23,7 +23,6 @@ obj-$(CONFIG_USB_ATMEL_USBA) += atmel_usba_udc.o
> obj-$(CONFIG_USB_BCM63XX_UDC) += bcm63xx_udc.o
> obj-$(CONFIG_USB_FSL_USB2) += fsl_usb2_udc.o
> fsl_usb2_udc-y := fsl_udc_core.o
> -fsl_usb2_udc-$(CONFIG_ARCH_MXC) += fsl_mxc_udc.o
> obj-$(CONFIG_USB_TEGRA_XUDC) += tegra-xudc.o
> obj-$(CONFIG_USB_M66592) += m66592-udc.o
> obj-$(CONFIG_USB_R8A66597) += r8a66597-udc.o
> diff --git a/drivers/usb/gadget/udc/fsl_mxc_udc.c b/drivers/usb/gadget/udc/fsl_mxc_udc.c
> deleted file mode 100644
> index 5a321992decc..000000000000
> --- a/drivers/usb/gadget/udc/fsl_mxc_udc.c
> +++ /dev/null
> @@ -1,122 +0,0 @@
> -// SPDX-License-Identifier: GPL-2.0+
> -/*
> - * Copyright (C) 2009
> - * Guennadi Liakhovetski, DENX Software Engineering, <lg@denx.de>
> - *
> - * Description:
> - * Helper routines for i.MX3x SoCs from Freescale, needed by the fsl_usb2_udc.c
> - * driver to function correctly on these systems.
> - */
> -#include <linux/clk.h>
> -#include <linux/delay.h>
> -#include <linux/err.h>
> -#include <linux/fsl_devices.h>
> -#include <linux/mod_devicetable.h>
> -#include <linux/platform_device.h>
> -#include <linux/io.h>
> -
> -#include "fsl_usb2_udc.h"
> -
> -static struct clk *mxc_ahb_clk;
> -static struct clk *mxc_per_clk;
> -static struct clk *mxc_ipg_clk;
> -
> -/* workaround ENGcm09152 for i.MX35 */
> -#define MX35_USBPHYCTRL_OFFSET 0x600
> -#define USBPHYCTRL_OTGBASE_OFFSET 0x8
> -#define USBPHYCTRL_EVDO (1 << 23)
> -
> -int fsl_udc_clk_init(struct platform_device *pdev)
> -{
> - struct fsl_usb2_platform_data *pdata;
> - unsigned long freq;
> - int ret;
> -
> - pdata = dev_get_platdata(&pdev->dev);
> -
> - mxc_ipg_clk = devm_clk_get(&pdev->dev, "ipg");
> - if (IS_ERR(mxc_ipg_clk)) {
> - dev_err(&pdev->dev, "clk_get(\"ipg\") failed\n");
> - return PTR_ERR(mxc_ipg_clk);
> - }
> -
> - mxc_ahb_clk = devm_clk_get(&pdev->dev, "ahb");
> - if (IS_ERR(mxc_ahb_clk)) {
> - dev_err(&pdev->dev, "clk_get(\"ahb\") failed\n");
> - return PTR_ERR(mxc_ahb_clk);
> - }
> -
> - mxc_per_clk = devm_clk_get(&pdev->dev, "per");
> - if (IS_ERR(mxc_per_clk)) {
> - dev_err(&pdev->dev, "clk_get(\"per\") failed\n");
> - return PTR_ERR(mxc_per_clk);
> - }
> -
> - clk_prepare_enable(mxc_ipg_clk);
> - clk_prepare_enable(mxc_ahb_clk);
> - clk_prepare_enable(mxc_per_clk);
> -
> - /* make sure USB_CLK is running at 60 MHz +/- 1000 Hz */
> - if (!strcmp(pdev->id_entry->name, "imx-udc-mx27")) {
> - freq = clk_get_rate(mxc_per_clk);
> - if (pdata->phy_mode != FSL_USB2_PHY_ULPI &&
> - (freq < 59999000 || freq > 60001000)) {
> - dev_err(&pdev->dev, "USB_CLK=%lu, should be 60MHz\n", freq);
> - ret = -EINVAL;
> - goto eclkrate;
> - }
> - }
> -
> - return 0;
> -
> -eclkrate:
> - clk_disable_unprepare(mxc_ipg_clk);
> - clk_disable_unprepare(mxc_ahb_clk);
> - clk_disable_unprepare(mxc_per_clk);
> - mxc_per_clk = NULL;
> - return ret;
> -}
> -
> -int fsl_udc_clk_finalize(struct platform_device *pdev)
> -{
> - struct fsl_usb2_platform_data *pdata = dev_get_platdata(&pdev->dev);
> - int ret = 0;
> -
> - /* workaround ENGcm09152 for i.MX35 */
> - if (pdata->workaround & FLS_USB2_WORKAROUND_ENGCM09152) {
> - unsigned int v;
> - struct resource *res = platform_get_resource
> - (pdev, IORESOURCE_MEM, 0);
> - void __iomem *phy_regs = ioremap(res->start +
> - MX35_USBPHYCTRL_OFFSET, 512);
> - if (!phy_regs) {
> - dev_err(&pdev->dev, "ioremap for phy address fails\n");
> - ret = -EINVAL;
> - goto ioremap_err;
> - }
> -
> - v = readl(phy_regs + USBPHYCTRL_OTGBASE_OFFSET);
> - writel(v | USBPHYCTRL_EVDO,
> - phy_regs + USBPHYCTRL_OTGBASE_OFFSET);
> -
> - iounmap(phy_regs);
> - }
> -
> -
> -ioremap_err:
> - /* ULPI transceivers don't need usbpll */
> - if (pdata->phy_mode == FSL_USB2_PHY_ULPI) {
> - clk_disable_unprepare(mxc_per_clk);
> - mxc_per_clk = NULL;
> - }
> -
> - return ret;
> -}
> -
> -void fsl_udc_clk_release(void)
> -{
> - if (mxc_per_clk)
> - clk_disable_unprepare(mxc_per_clk);
> - clk_disable_unprepare(mxc_ahb_clk);
> - clk_disable_unprepare(mxc_ipg_clk);
> -}
> --
> 2.17.1
>
--
Thanks,
Peter Chen
prev parent reply other threads:[~2020-12-15 4:40 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-10 20:55 [PATCH] usb: gadget: fsl_mxc_udc: Remove the driver Fabio Estevam
2020-12-15 4:39 ` Peter Chen [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201215043922.GA2142@b29397-desktop \
--to=peter.chen@nxp.com \
--cc=balbi@kernel.org \
--cc=festevam@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-usb@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox