Commit 1f28f6f0 authored by Li Yang's avatar Li Yang Committed by Greg Kroah-Hartman

usb: gadget: fsl: properly remove remnant of MXC support

Commit a390bef7 ("usb: gadget: fsl_mxc_udc: Remove the driver")
didn't remove all the MXC related stuff which can cause build problem
for LS1021 when enabled again in Kconfig.  This patch remove all the
remnants.
Reviewed-by: default avatarFabio Estevam <festevam@gmail.com>
Acked-by: default avatarArnd Bergmann <arnd@arndb.de>
Signed-off-by: default avatarLi Yang <leoyang.li@nxp.com>
Link: https://lore.kernel.org/r/20210612003128.372238-1-leoyang.li@nxp.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 66165dba
...@@ -36,7 +36,6 @@ ...@@ -36,7 +36,6 @@
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/fsl_devices.h> #include <linux/fsl_devices.h>
#include <linux/dmapool.h> #include <linux/dmapool.h>
#include <linux/delay.h>
#include <linux/of_device.h> #include <linux/of_device.h>
#include <asm/byteorder.h> #include <asm/byteorder.h>
...@@ -323,13 +322,11 @@ static int dr_controller_setup(struct fsl_udc *udc) ...@@ -323,13 +322,11 @@ static int dr_controller_setup(struct fsl_udc *udc)
fsl_writel(tmp, &dr_regs->endptctrl[ep_num]); fsl_writel(tmp, &dr_regs->endptctrl[ep_num]);
} }
/* Config control enable i/o output, cpu endian register */ /* Config control enable i/o output, cpu endian register */
#ifndef CONFIG_ARCH_MXC
if (udc->pdata->have_sysif_regs) { if (udc->pdata->have_sysif_regs) {
ctrl = __raw_readl(&usb_sys_regs->control); ctrl = __raw_readl(&usb_sys_regs->control);
ctrl |= USB_CTRL_IOENB; ctrl |= USB_CTRL_IOENB;
__raw_writel(ctrl, &usb_sys_regs->control); __raw_writel(ctrl, &usb_sys_regs->control);
} }
#endif
#if defined(CONFIG_PPC32) && !defined(CONFIG_NOT_COHERENT_CACHE) #if defined(CONFIG_PPC32) && !defined(CONFIG_NOT_COHERENT_CACHE)
/* Turn on cache snooping hardware, since some PowerPC platforms /* Turn on cache snooping hardware, since some PowerPC platforms
...@@ -2153,7 +2150,6 @@ static int fsl_proc_read(struct seq_file *m, void *v) ...@@ -2153,7 +2150,6 @@ static int fsl_proc_read(struct seq_file *m, void *v)
tmp_reg = fsl_readl(&dr_regs->endpointprime); tmp_reg = fsl_readl(&dr_regs->endpointprime);
seq_printf(m, "EP Prime Reg = [0x%x]\n\n", tmp_reg); seq_printf(m, "EP Prime Reg = [0x%x]\n\n", tmp_reg);
#ifndef CONFIG_ARCH_MXC
if (udc->pdata->have_sysif_regs) { if (udc->pdata->have_sysif_regs) {
tmp_reg = usb_sys_regs->snoop1; tmp_reg = usb_sys_regs->snoop1;
seq_printf(m, "Snoop1 Reg : = [0x%x]\n\n", tmp_reg); seq_printf(m, "Snoop1 Reg : = [0x%x]\n\n", tmp_reg);
...@@ -2161,7 +2157,6 @@ static int fsl_proc_read(struct seq_file *m, void *v) ...@@ -2161,7 +2157,6 @@ static int fsl_proc_read(struct seq_file *m, void *v)
tmp_reg = usb_sys_regs->control; tmp_reg = usb_sys_regs->control;
seq_printf(m, "General Control Reg : = [0x%x]\n\n", tmp_reg); seq_printf(m, "General Control Reg : = [0x%x]\n\n", tmp_reg);
} }
#endif
/* ------fsl_udc, fsl_ep, fsl_request structure information ----- */ /* ------fsl_udc, fsl_ep, fsl_request structure information ----- */
ep = &udc->eps[0]; ep = &udc->eps[0];
...@@ -2412,28 +2407,21 @@ static int fsl_udc_probe(struct platform_device *pdev) ...@@ -2412,28 +2407,21 @@ static int fsl_udc_probe(struct platform_device *pdev)
*/ */
if (pdata->init && pdata->init(pdev)) { if (pdata->init && pdata->init(pdev)) {
ret = -ENODEV; ret = -ENODEV;
goto err_iounmap_noclk; goto err_iounmap;
} }
/* Set accessors only after pdata->init() ! */ /* Set accessors only after pdata->init() ! */
fsl_set_accessors(pdata); fsl_set_accessors(pdata);
#ifndef CONFIG_ARCH_MXC
if (pdata->have_sysif_regs) if (pdata->have_sysif_regs)
usb_sys_regs = (void *)dr_regs + USB_DR_SYS_OFFSET; usb_sys_regs = (void *)dr_regs + USB_DR_SYS_OFFSET;
#endif
/* Initialize USB clocks */
ret = fsl_udc_clk_init(pdev);
if (ret < 0)
goto err_iounmap_noclk;
/* Read Device Controller Capability Parameters register */ /* Read Device Controller Capability Parameters register */
dccparams = fsl_readl(&dr_regs->dccparams); dccparams = fsl_readl(&dr_regs->dccparams);
if (!(dccparams & DCCPARAMS_DC)) { if (!(dccparams & DCCPARAMS_DC)) {
ERR("This SOC doesn't support device role\n"); ERR("This SOC doesn't support device role\n");
ret = -ENODEV; ret = -ENODEV;
goto err_iounmap; goto err_exit;
} }
/* Get max device endpoints */ /* Get max device endpoints */
/* DEN is bidirectional ep number, max_ep doubles the number */ /* DEN is bidirectional ep number, max_ep doubles the number */
...@@ -2442,7 +2430,7 @@ static int fsl_udc_probe(struct platform_device *pdev) ...@@ -2442,7 +2430,7 @@ static int fsl_udc_probe(struct platform_device *pdev)
ret = platform_get_irq(pdev, 0); ret = platform_get_irq(pdev, 0);
if (ret <= 0) { if (ret <= 0) {
ret = ret ? : -ENODEV; ret = ret ? : -ENODEV;
goto err_iounmap; goto err_exit;
} }
udc_controller->irq = ret; udc_controller->irq = ret;
...@@ -2451,7 +2439,7 @@ static int fsl_udc_probe(struct platform_device *pdev) ...@@ -2451,7 +2439,7 @@ static int fsl_udc_probe(struct platform_device *pdev)
if (ret != 0) { if (ret != 0) {
ERR("cannot request irq %d err %d\n", ERR("cannot request irq %d err %d\n",
udc_controller->irq, ret); udc_controller->irq, ret);
goto err_iounmap; goto err_exit;
} }
/* Initialize the udc structure including QH member and other member */ /* Initialize the udc structure including QH member and other member */
...@@ -2467,10 +2455,6 @@ static int fsl_udc_probe(struct platform_device *pdev) ...@@ -2467,10 +2455,6 @@ static int fsl_udc_probe(struct platform_device *pdev)
dr_controller_setup(udc_controller); dr_controller_setup(udc_controller);
} }
ret = fsl_udc_clk_finalize(pdev);
if (ret)
goto err_free_irq;
/* Setup gadget structure */ /* Setup gadget structure */
udc_controller->gadget.ops = &fsl_gadget_ops; udc_controller->gadget.ops = &fsl_gadget_ops;
udc_controller->gadget.max_speed = USB_SPEED_HIGH; udc_controller->gadget.max_speed = USB_SPEED_HIGH;
...@@ -2530,11 +2514,10 @@ static int fsl_udc_probe(struct platform_device *pdev) ...@@ -2530,11 +2514,10 @@ static int fsl_udc_probe(struct platform_device *pdev)
dma_pool_destroy(udc_controller->td_pool); dma_pool_destroy(udc_controller->td_pool);
err_free_irq: err_free_irq:
free_irq(udc_controller->irq, udc_controller); free_irq(udc_controller->irq, udc_controller);
err_iounmap: err_exit:
if (pdata->exit) if (pdata->exit)
pdata->exit(pdev); pdata->exit(pdev);
fsl_udc_clk_release(); err_iounmap:
err_iounmap_noclk:
iounmap(dr_regs); iounmap(dr_regs);
err_release_mem_region: err_release_mem_region:
if (pdata->operating_mode == FSL_USB2_DR_DEVICE) if (pdata->operating_mode == FSL_USB2_DR_DEVICE)
...@@ -2561,8 +2544,6 @@ static int fsl_udc_remove(struct platform_device *pdev) ...@@ -2561,8 +2544,6 @@ static int fsl_udc_remove(struct platform_device *pdev)
udc_controller->done = &done; udc_controller->done = &done;
usb_del_gadget_udc(&udc_controller->gadget); usb_del_gadget_udc(&udc_controller->gadget);
fsl_udc_clk_release();
/* DR has been stopped in usb_gadget_unregister_driver() */ /* DR has been stopped in usb_gadget_unregister_driver() */
remove_proc_file(); remove_proc_file();
...@@ -2677,10 +2658,6 @@ static int fsl_udc_otg_resume(struct device *dev) ...@@ -2677,10 +2658,6 @@ static int fsl_udc_otg_resume(struct device *dev)
--------------------------------------------------------------------------*/ --------------------------------------------------------------------------*/
static const struct platform_device_id fsl_udc_devtype[] = { static const struct platform_device_id fsl_udc_devtype[] = {
{ {
.name = "imx-udc-mx27",
}, {
.name = "imx-udc-mx51",
}, {
.name = "fsl-usb2-udc", .name = "fsl-usb2-udc",
}, { }, {
/* sentinel */ /* sentinel */
...@@ -2689,7 +2666,6 @@ static const struct platform_device_id fsl_udc_devtype[] = { ...@@ -2689,7 +2666,6 @@ static const struct platform_device_id fsl_udc_devtype[] = {
MODULE_DEVICE_TABLE(platform, fsl_udc_devtype); MODULE_DEVICE_TABLE(platform, fsl_udc_devtype);
static struct platform_driver udc_driver = { static struct platform_driver udc_driver = {
.remove = fsl_udc_remove, .remove = fsl_udc_remove,
/* Just for FSL i.mx SoC currently */
.id_table = fsl_udc_devtype, .id_table = fsl_udc_devtype,
/* these suspend and resume are not usb suspend and resume */ /* these suspend and resume are not usb suspend and resume */
.suspend = fsl_udc_suspend, .suspend = fsl_udc_suspend,
......
...@@ -588,23 +588,4 @@ static inline struct ep_queue_head *get_qh_by_ep(struct fsl_ep *ep) ...@@ -588,23 +588,4 @@ static inline struct ep_queue_head *get_qh_by_ep(struct fsl_ep *ep)
USB_DIR_IN) ? 1 : 0]; USB_DIR_IN) ? 1 : 0];
} }
struct platform_device;
#ifdef CONFIG_ARCH_MXC
int fsl_udc_clk_init(struct platform_device *pdev);
int fsl_udc_clk_finalize(struct platform_device *pdev);
void fsl_udc_clk_release(void);
#else
static inline int fsl_udc_clk_init(struct platform_device *pdev)
{
return 0;
}
static inline int fsl_udc_clk_finalize(struct platform_device *pdev)
{
return 0;
}
static inline void fsl_udc_clk_release(void)
{
}
#endif
#endif #endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment