forked from Minki/linux
usb: dwc2: rename all s3c_* to dwc2_*
this driver has long ago became dwc2.ko with both peripheral and host roles, there's no point in keeping the old function names. Acked-by: John Youn <johnyoun@synopsys.com> Tested-by: John Youn <johnyoun@synopsys.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
This commit is contained in:
parent
db2be4e9e3
commit
1f91b4cc03
@ -809,7 +809,7 @@ static const struct gpio_led_platform_data gpio_leds_pdata = {
|
||||
.num_leds = ARRAY_SIZE(gpio_leds),
|
||||
};
|
||||
|
||||
static struct s3c_hsotg_plat crag6410_hsotg_pdata;
|
||||
static struct dwc2_hsotg_plat crag6410_hsotg_pdata;
|
||||
|
||||
static void __init crag6410_machine_init(void)
|
||||
{
|
||||
@ -835,7 +835,7 @@ static void __init crag6410_machine_init(void)
|
||||
s3c_i2c0_set_platdata(&i2c0_pdata);
|
||||
s3c_i2c1_set_platdata(&i2c1_pdata);
|
||||
s3c_fb_set_platdata(&crag6410_lcd_pdata);
|
||||
s3c_hsotg_set_platdata(&crag6410_hsotg_pdata);
|
||||
dwc2_hsotg_set_platdata(&crag6410_hsotg_pdata);
|
||||
|
||||
i2c_register_board_info(0, i2c_devs0, ARRAY_SIZE(i2c_devs0));
|
||||
i2c_register_board_info(1, i2c_devs1, ARRAY_SIZE(i2c_devs1));
|
||||
|
@ -189,7 +189,7 @@ static struct s3c_hwmon_pdata smartq_hwmon_pdata __initdata = {
|
||||
},
|
||||
};
|
||||
|
||||
static struct s3c_hsotg_plat smartq_hsotg_pdata;
|
||||
static struct dwc2_hsotg_plat smartq_hsotg_pdata;
|
||||
|
||||
static int __init smartq_lcd_setup_gpio(void)
|
||||
{
|
||||
@ -382,7 +382,7 @@ void __init smartq_map_io(void)
|
||||
void __init smartq_machine_init(void)
|
||||
{
|
||||
s3c_i2c0_set_platdata(NULL);
|
||||
s3c_hsotg_set_platdata(&smartq_hsotg_pdata);
|
||||
dwc2_hsotg_set_platdata(&smartq_hsotg_pdata);
|
||||
s3c_hwmon_set_platdata(&smartq_hwmon_pdata);
|
||||
s3c_sdhci1_set_platdata(&smartq_internal_hsmmc_pdata);
|
||||
s3c_sdhci2_set_platdata(&smartq_internal_hsmmc_pdata);
|
||||
|
@ -628,7 +628,7 @@ static struct platform_pwm_backlight_data smdk6410_bl_data = {
|
||||
.enable_gpio = -1,
|
||||
};
|
||||
|
||||
static struct s3c_hsotg_plat smdk6410_hsotg_pdata;
|
||||
static struct dwc2_hsotg_plat smdk6410_hsotg_pdata;
|
||||
|
||||
static void __init smdk6410_map_io(void)
|
||||
{
|
||||
@ -659,7 +659,7 @@ static void __init smdk6410_machine_init(void)
|
||||
s3c_i2c0_set_platdata(NULL);
|
||||
s3c_i2c1_set_platdata(NULL);
|
||||
s3c_fb_set_platdata(&smdk6410_lcd_pdata);
|
||||
s3c_hsotg_set_platdata(&smdk6410_hsotg_pdata);
|
||||
dwc2_hsotg_set_platdata(&smdk6410_hsotg_pdata);
|
||||
|
||||
samsung_keypad_set_platdata(&smdk6410_keypad_data);
|
||||
|
||||
|
@ -1042,11 +1042,11 @@ struct platform_device s3c_device_usb_hsotg = {
|
||||
},
|
||||
};
|
||||
|
||||
void __init s3c_hsotg_set_platdata(struct s3c_hsotg_plat *pd)
|
||||
void __init dwc2_hsotg_set_platdata(struct dwc2_hsotg_plat *pd)
|
||||
{
|
||||
struct s3c_hsotg_plat *npd;
|
||||
struct dwc2_hsotg_plat *npd;
|
||||
|
||||
npd = s3c_set_platdata(pd, sizeof(struct s3c_hsotg_plat),
|
||||
npd = s3c_set_platdata(pd, sizeof(struct dwc2_hsotg_plat),
|
||||
&s3c_device_usb_hsotg);
|
||||
|
||||
if (!npd->phy_init)
|
||||
|
@ -58,8 +58,8 @@ static inline void do_write(u32 value, void *addr)
|
||||
/* Maximum number of Endpoints/HostChannels */
|
||||
#define MAX_EPS_CHANNELS 16
|
||||
|
||||
/* s3c-hsotg declarations */
|
||||
static const char * const s3c_hsotg_supply_names[] = {
|
||||
/* dwc2-hsotg declarations */
|
||||
static const char * const dwc2_hsotg_supply_names[] = {
|
||||
"vusb_d", /* digital USB supply, 1.2V */
|
||||
"vusb_a", /* analog USB supply, 1.1V */
|
||||
};
|
||||
@ -85,10 +85,10 @@ static const char * const s3c_hsotg_supply_names[] = {
|
||||
#define EP0_MPS_LIMIT 64
|
||||
|
||||
struct dwc2_hsotg;
|
||||
struct s3c_hsotg_req;
|
||||
struct dwc2_hsotg_req;
|
||||
|
||||
/**
|
||||
* struct s3c_hsotg_ep - driver endpoint definition.
|
||||
* struct dwc2_hsotg_ep - driver endpoint definition.
|
||||
* @ep: The gadget layer representation of the endpoint.
|
||||
* @name: The driver generated name for the endpoint.
|
||||
* @queue: Queue of requests for this endpoint.
|
||||
@ -127,11 +127,11 @@ struct s3c_hsotg_req;
|
||||
* as in shared-fifo mode periodic in acts like a single-frame packet
|
||||
* buffer than a fifo)
|
||||
*/
|
||||
struct s3c_hsotg_ep {
|
||||
struct dwc2_hsotg_ep {
|
||||
struct usb_ep ep;
|
||||
struct list_head queue;
|
||||
struct dwc2_hsotg *parent;
|
||||
struct s3c_hsotg_req *req;
|
||||
struct dwc2_hsotg_req *req;
|
||||
struct dentry *debugfs;
|
||||
|
||||
unsigned long total_data;
|
||||
@ -155,12 +155,12 @@ struct s3c_hsotg_ep {
|
||||
};
|
||||
|
||||
/**
|
||||
* struct s3c_hsotg_req - data transfer request
|
||||
* struct dwc2_hsotg_req - data transfer request
|
||||
* @req: The USB gadget request
|
||||
* @queue: The list of requests for the endpoint this is queued for.
|
||||
* @saved_req_buf: variable to save req.buf when bounce buffers are used.
|
||||
*/
|
||||
struct s3c_hsotg_req {
|
||||
struct dwc2_hsotg_req {
|
||||
struct usb_request req;
|
||||
struct list_head queue;
|
||||
void *saved_req_buf;
|
||||
@ -693,7 +693,7 @@ struct dwc2_hsotg {
|
||||
|
||||
struct phy *phy;
|
||||
struct usb_phy *uphy;
|
||||
struct regulator_bulk_data supplies[ARRAY_SIZE(s3c_hsotg_supply_names)];
|
||||
struct regulator_bulk_data supplies[ARRAY_SIZE(dwc2_hsotg_supply_names)];
|
||||
|
||||
spinlock_t lock;
|
||||
struct mutex init_mutex;
|
||||
@ -796,7 +796,7 @@ struct dwc2_hsotg {
|
||||
#if IS_ENABLED(CONFIG_USB_DWC2_PERIPHERAL) || IS_ENABLED(CONFIG_USB_DWC2_DUAL_ROLE)
|
||||
/* Gadget structures */
|
||||
struct usb_gadget_driver *driver;
|
||||
struct s3c_hsotg_plat *plat;
|
||||
struct dwc2_hsotg_plat *plat;
|
||||
|
||||
u32 phyif;
|
||||
int fifo_mem;
|
||||
@ -815,8 +815,8 @@ struct dwc2_hsotg {
|
||||
unsigned int enabled:1;
|
||||
unsigned int connected:1;
|
||||
unsigned long last_rst;
|
||||
struct s3c_hsotg_ep *eps_in[MAX_EPS_CHANNELS];
|
||||
struct s3c_hsotg_ep *eps_out[MAX_EPS_CHANNELS];
|
||||
struct dwc2_hsotg_ep *eps_in[MAX_EPS_CHANNELS];
|
||||
struct dwc2_hsotg_ep *eps_out[MAX_EPS_CHANNELS];
|
||||
u32 g_using_dma;
|
||||
u32 g_rx_fifo_sz;
|
||||
u32 g_np_g_tx_fifo_sz;
|
||||
@ -1104,30 +1104,30 @@ extern u16 dwc2_get_otg_version(struct dwc2_hsotg *hsotg);
|
||||
|
||||
/* Gadget defines */
|
||||
#if IS_ENABLED(CONFIG_USB_DWC2_PERIPHERAL) || IS_ENABLED(CONFIG_USB_DWC2_DUAL_ROLE)
|
||||
extern int s3c_hsotg_remove(struct dwc2_hsotg *hsotg);
|
||||
extern int s3c_hsotg_suspend(struct dwc2_hsotg *dwc2);
|
||||
extern int s3c_hsotg_resume(struct dwc2_hsotg *dwc2);
|
||||
extern int dwc2_hsotg_remove(struct dwc2_hsotg *hsotg);
|
||||
extern int dwc2_hsotg_suspend(struct dwc2_hsotg *dwc2);
|
||||
extern int dwc2_hsotg_resume(struct dwc2_hsotg *dwc2);
|
||||
extern int dwc2_gadget_init(struct dwc2_hsotg *hsotg, int irq);
|
||||
extern void s3c_hsotg_core_init_disconnected(struct dwc2_hsotg *dwc2,
|
||||
extern void dwc2_hsotg_core_init_disconnected(struct dwc2_hsotg *dwc2,
|
||||
bool reset);
|
||||
extern void s3c_hsotg_core_connect(struct dwc2_hsotg *hsotg);
|
||||
extern void s3c_hsotg_disconnect(struct dwc2_hsotg *dwc2);
|
||||
extern int s3c_hsotg_set_test_mode(struct dwc2_hsotg *hsotg, int testmode);
|
||||
extern void dwc2_hsotg_core_connect(struct dwc2_hsotg *hsotg);
|
||||
extern void dwc2_hsotg_disconnect(struct dwc2_hsotg *dwc2);
|
||||
extern int dwc2_hsotg_set_test_mode(struct dwc2_hsotg *hsotg, int testmode);
|
||||
#define dwc2_is_device_connected(hsotg) (hsotg->connected)
|
||||
#else
|
||||
static inline int s3c_hsotg_remove(struct dwc2_hsotg *dwc2)
|
||||
static inline int dwc2_hsotg_remove(struct dwc2_hsotg *dwc2)
|
||||
{ return 0; }
|
||||
static inline int s3c_hsotg_suspend(struct dwc2_hsotg *dwc2)
|
||||
static inline int dwc2_hsotg_suspend(struct dwc2_hsotg *dwc2)
|
||||
{ return 0; }
|
||||
static inline int s3c_hsotg_resume(struct dwc2_hsotg *dwc2)
|
||||
static inline int dwc2_hsotg_resume(struct dwc2_hsotg *dwc2)
|
||||
{ return 0; }
|
||||
static inline int dwc2_gadget_init(struct dwc2_hsotg *hsotg, int irq)
|
||||
{ return 0; }
|
||||
static inline void s3c_hsotg_core_init_disconnected(struct dwc2_hsotg *dwc2,
|
||||
static inline void dwc2_hsotg_core_init_disconnected(struct dwc2_hsotg *dwc2,
|
||||
bool reset) {}
|
||||
static inline void s3c_hsotg_core_connect(struct dwc2_hsotg *hsotg) {}
|
||||
static inline void s3c_hsotg_disconnect(struct dwc2_hsotg *dwc2) {}
|
||||
static inline int s3c_hsotg_set_test_mode(struct dwc2_hsotg *hsotg,
|
||||
static inline void dwc2_hsotg_core_connect(struct dwc2_hsotg *hsotg) {}
|
||||
static inline void dwc2_hsotg_disconnect(struct dwc2_hsotg *dwc2) {}
|
||||
static inline int dwc2_hsotg_set_test_mode(struct dwc2_hsotg *hsotg,
|
||||
int testmode)
|
||||
{ return 0; }
|
||||
#define dwc2_is_device_connected(hsotg) (0)
|
||||
|
@ -129,7 +129,7 @@ static void dwc2_handle_otg_intr(struct dwc2_hsotg *hsotg)
|
||||
gotgctl = readl(hsotg->regs + GOTGCTL);
|
||||
|
||||
if (dwc2_is_device_mode(hsotg))
|
||||
s3c_hsotg_disconnect(hsotg);
|
||||
dwc2_hsotg_disconnect(hsotg);
|
||||
|
||||
if (hsotg->op_state == OTG_STATE_B_HOST) {
|
||||
hsotg->op_state = OTG_STATE_B_PERIPHERAL;
|
||||
@ -322,7 +322,7 @@ static void dwc2_handle_session_req_intr(struct dwc2_hsotg *hsotg)
|
||||
* Report disconnect if there is any previous session established
|
||||
*/
|
||||
if (dwc2_is_device_mode(hsotg))
|
||||
s3c_hsotg_disconnect(hsotg);
|
||||
dwc2_hsotg_disconnect(hsotg);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -57,7 +57,7 @@ static ssize_t testmode_write(struct file *file, const char __user *ubuf, size_t
|
||||
testmode = 0;
|
||||
|
||||
spin_lock_irqsave(&hsotg->lock, flags);
|
||||
s3c_hsotg_set_test_mode(hsotg, testmode);
|
||||
dwc2_hsotg_set_test_mode(hsotg, testmode);
|
||||
spin_unlock_irqrestore(&hsotg->lock, flags);
|
||||
return count;
|
||||
}
|
||||
@ -256,9 +256,9 @@ static const char *decode_direction(int is_in)
|
||||
*/
|
||||
static int ep_show(struct seq_file *seq, void *v)
|
||||
{
|
||||
struct s3c_hsotg_ep *ep = seq->private;
|
||||
struct dwc2_hsotg_ep *ep = seq->private;
|
||||
struct dwc2_hsotg *hsotg = ep->parent;
|
||||
struct s3c_hsotg_req *req;
|
||||
struct dwc2_hsotg_req *req;
|
||||
void __iomem *regs = hsotg->regs;
|
||||
int index = ep->index;
|
||||
int show_limit = 15;
|
||||
@ -326,7 +326,7 @@ static const struct file_operations ep_fops = {
|
||||
};
|
||||
|
||||
/**
|
||||
* s3c_hsotg_create_debug - create debugfs directory and files
|
||||
* dwc2_hsotg_create_debug - create debugfs directory and files
|
||||
* @hsotg: The driver state
|
||||
*
|
||||
* Create the debugfs files to allow the user to get information
|
||||
@ -334,7 +334,7 @@ static const struct file_operations ep_fops = {
|
||||
* with the same name as the device itself, in case we end up
|
||||
* with multiple blocks in future systems.
|
||||
*/
|
||||
static void s3c_hsotg_create_debug(struct dwc2_hsotg *hsotg)
|
||||
static void dwc2_hsotg_create_debug(struct dwc2_hsotg *hsotg)
|
||||
{
|
||||
struct dentry *root;
|
||||
struct dentry *file;
|
||||
@ -360,7 +360,7 @@ static void s3c_hsotg_create_debug(struct dwc2_hsotg *hsotg)
|
||||
|
||||
/* Create one file for each out endpoint */
|
||||
for (epidx = 0; epidx < hsotg->num_of_eps; epidx++) {
|
||||
struct s3c_hsotg_ep *ep;
|
||||
struct dwc2_hsotg_ep *ep;
|
||||
|
||||
ep = hsotg->eps_out[epidx];
|
||||
if (ep) {
|
||||
@ -373,7 +373,7 @@ static void s3c_hsotg_create_debug(struct dwc2_hsotg *hsotg)
|
||||
}
|
||||
/* Create one file for each in endpoint. EP0 is handled with out eps */
|
||||
for (epidx = 1; epidx < hsotg->num_of_eps; epidx++) {
|
||||
struct s3c_hsotg_ep *ep;
|
||||
struct dwc2_hsotg_ep *ep;
|
||||
|
||||
ep = hsotg->eps_in[epidx];
|
||||
if (ep) {
|
||||
@ -386,10 +386,10 @@ static void s3c_hsotg_create_debug(struct dwc2_hsotg *hsotg)
|
||||
}
|
||||
}
|
||||
#else
|
||||
static inline void s3c_hsotg_create_debug(struct dwc2_hsotg *hsotg) {}
|
||||
static inline void dwc2_hsotg_create_debug(struct dwc2_hsotg *hsotg) {}
|
||||
#endif
|
||||
|
||||
/* s3c_hsotg_delete_debug is removed as cleanup in done in dwc2_debugfs_exit */
|
||||
/* dwc2_hsotg_delete_debug is removed as cleanup in done in dwc2_debugfs_exit */
|
||||
|
||||
#define dump_register(nm) \
|
||||
{ \
|
||||
@ -737,7 +737,7 @@ int dwc2_debugfs_init(struct dwc2_hsotg *hsotg)
|
||||
}
|
||||
|
||||
/* Add gadget debugfs nodes */
|
||||
s3c_hsotg_create_debug(hsotg);
|
||||
dwc2_hsotg_create_debug(hsotg);
|
||||
|
||||
hsotg->regset = devm_kzalloc(hsotg->dev, sizeof(*hsotg->regset),
|
||||
GFP_KERNEL);
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1382,8 +1382,8 @@ static void dwc2_conn_id_status_change(struct work_struct *work)
|
||||
hsotg->op_state = OTG_STATE_B_PERIPHERAL;
|
||||
dwc2_core_init(hsotg, false, -1);
|
||||
dwc2_enable_global_interrupts(hsotg);
|
||||
s3c_hsotg_core_init_disconnected(hsotg, false);
|
||||
s3c_hsotg_core_connect(hsotg);
|
||||
dwc2_hsotg_core_init_disconnected(hsotg, false);
|
||||
dwc2_hsotg_core_connect(hsotg);
|
||||
} else {
|
||||
/* A-Device connector (Host Mode) */
|
||||
dev_dbg(hsotg->dev, "connId A\n");
|
||||
|
@ -130,7 +130,7 @@ static int dwc2_driver_remove(struct platform_device *dev)
|
||||
if (hsotg->hcd_enabled)
|
||||
dwc2_hcd_remove(hsotg);
|
||||
if (hsotg->gadget_enabled)
|
||||
s3c_hsotg_remove(hsotg);
|
||||
dwc2_hsotg_remove(hsotg);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -269,7 +269,7 @@ static int dwc2_driver_probe(struct platform_device *dev)
|
||||
retval = dwc2_hcd_init(hsotg, irq);
|
||||
if (retval) {
|
||||
if (hsotg->gadget_enabled)
|
||||
s3c_hsotg_remove(hsotg);
|
||||
dwc2_hsotg_remove(hsotg);
|
||||
return retval;
|
||||
}
|
||||
hsotg->hcd_enabled = 1;
|
||||
@ -288,7 +288,7 @@ static int __maybe_unused dwc2_suspend(struct device *dev)
|
||||
int ret = 0;
|
||||
|
||||
if (dwc2_is_device_mode(dwc2)) {
|
||||
ret = s3c_hsotg_suspend(dwc2);
|
||||
ret = dwc2_hsotg_suspend(dwc2);
|
||||
} else {
|
||||
if (dwc2->lx_state == DWC2_L0)
|
||||
return 0;
|
||||
@ -305,7 +305,7 @@ static int __maybe_unused dwc2_resume(struct device *dev)
|
||||
int ret = 0;
|
||||
|
||||
if (dwc2_is_device_mode(dwc2)) {
|
||||
ret = s3c_hsotg_resume(dwc2);
|
||||
ret = dwc2_hsotg_resume(dwc2);
|
||||
} else {
|
||||
phy_power_on(dwc2->phy);
|
||||
phy_init(dwc2->phy);
|
||||
|
@ -17,19 +17,19 @@
|
||||
|
||||
struct platform_device;
|
||||
|
||||
enum s3c_hsotg_dmamode {
|
||||
enum dwc2_hsotg_dmamode {
|
||||
S3C_HSOTG_DMA_NONE, /* do not use DMA at-all */
|
||||
S3C_HSOTG_DMA_ONLY, /* always use DMA */
|
||||
S3C_HSOTG_DMA_DRV, /* DMA is chosen by driver */
|
||||
};
|
||||
|
||||
/**
|
||||
* struct s3c_hsotg_plat - platform data for high-speed otg/udc
|
||||
* struct dwc2_hsotg_plat - platform data for high-speed otg/udc
|
||||
* @dma: Whether to use DMA or not.
|
||||
* @is_osc: The clock source is an oscillator, not a crystal
|
||||
*/
|
||||
struct s3c_hsotg_plat {
|
||||
enum s3c_hsotg_dmamode dma;
|
||||
struct dwc2_hsotg_plat {
|
||||
enum dwc2_hsotg_dmamode dma;
|
||||
unsigned int is_osc:1;
|
||||
int phy_type;
|
||||
|
||||
@ -37,6 +37,6 @@ struct s3c_hsotg_plat {
|
||||
int (*phy_exit)(struct platform_device *pdev, int type);
|
||||
};
|
||||
|
||||
extern void s3c_hsotg_set_platdata(struct s3c_hsotg_plat *pd);
|
||||
extern void dwc2_hsotg_set_platdata(struct dwc2_hsotg_plat *pd);
|
||||
|
||||
#endif /* __LINUX_USB_S3C_HSOTG_H */
|
||||
|
Loading…
Reference in New Issue
Block a user