Commit 9da51974 authored by John Youn's avatar John Youn Committed by Felipe Balbi

usb: dwc2: Cleanup some checkpatch issues

This commmit is the result of running checkpatch --fix.

The results were verified for correctness. Some of the fixes result in
line over 80 char which we will fix manually later.

The following is a summary of what was done by checkpatch:
* Remove externs on function prototypes.
* Replace symbolic permissions with octal.
* Align code to open parens.
* Replace 'unsigned' with 'unsigned int'.
* Remove unneccessary blank lines.
* Add blank lines after declarations.
* Add spaces around operators.
* Remove unnecessary spaces after casts.
* Replace 'x == NULL' with '!x'.
* Replace kzalloc() with kcalloc().
* Concatenate multi-line strings.
* Use the BIT() macro.
Signed-off-by: default avatarJohn Youn <johnyoun@synopsys.com>
Signed-off-by: default avatarFelipe Balbi <felipe.balbi@linux.intel.com>
parent 33e4c1a9
...@@ -104,7 +104,7 @@ static int dwc2_restore_global_registers(struct dwc2_hsotg *hsotg) ...@@ -104,7 +104,7 @@ static int dwc2_restore_global_registers(struct dwc2_hsotg *hsotg)
gr = &hsotg->gr_backup; gr = &hsotg->gr_backup;
if (!gr->valid) { if (!gr->valid) {
dev_err(hsotg->dev, "%s: no global registers to restore\n", dev_err(hsotg->dev, "%s: no global registers to restore\n",
__func__); __func__);
return -EINVAL; return -EINVAL;
} }
gr->valid = false; gr->valid = false;
...@@ -155,21 +155,21 @@ int dwc2_exit_hibernation(struct dwc2_hsotg *hsotg, bool restore) ...@@ -155,21 +155,21 @@ int dwc2_exit_hibernation(struct dwc2_hsotg *hsotg, bool restore)
ret = dwc2_restore_global_registers(hsotg); ret = dwc2_restore_global_registers(hsotg);
if (ret) { if (ret) {
dev_err(hsotg->dev, "%s: failed to restore registers\n", dev_err(hsotg->dev, "%s: failed to restore registers\n",
__func__); __func__);
return ret; return ret;
} }
if (dwc2_is_host_mode(hsotg)) { if (dwc2_is_host_mode(hsotg)) {
ret = dwc2_restore_host_registers(hsotg); ret = dwc2_restore_host_registers(hsotg);
if (ret) { if (ret) {
dev_err(hsotg->dev, "%s: failed to restore host registers\n", dev_err(hsotg->dev, "%s: failed to restore host registers\n",
__func__); __func__);
return ret; return ret;
} }
} else { } else {
ret = dwc2_restore_device_registers(hsotg); ret = dwc2_restore_device_registers(hsotg);
if (ret) { if (ret) {
dev_err(hsotg->dev, "%s: failed to restore device registers\n", dev_err(hsotg->dev, "%s: failed to restore device registers\n",
__func__); __func__);
return ret; return ret;
} }
} }
...@@ -195,7 +195,7 @@ int dwc2_enter_hibernation(struct dwc2_hsotg *hsotg) ...@@ -195,7 +195,7 @@ int dwc2_enter_hibernation(struct dwc2_hsotg *hsotg)
ret = dwc2_backup_global_registers(hsotg); ret = dwc2_backup_global_registers(hsotg);
if (ret) { if (ret) {
dev_err(hsotg->dev, "%s: failed to backup global registers\n", dev_err(hsotg->dev, "%s: failed to backup global registers\n",
__func__); __func__);
return ret; return ret;
} }
...@@ -203,14 +203,14 @@ int dwc2_enter_hibernation(struct dwc2_hsotg *hsotg) ...@@ -203,14 +203,14 @@ int dwc2_enter_hibernation(struct dwc2_hsotg *hsotg)
ret = dwc2_backup_host_registers(hsotg); ret = dwc2_backup_host_registers(hsotg);
if (ret) { if (ret) {
dev_err(hsotg->dev, "%s: failed to backup host registers\n", dev_err(hsotg->dev, "%s: failed to backup host registers\n",
__func__); __func__);
return ret; return ret;
} }
} else { } else {
ret = dwc2_backup_device_registers(hsotg); ret = dwc2_backup_device_registers(hsotg);
if (ret) { if (ret) {
dev_err(hsotg->dev, "%s: failed to backup device registers\n", dev_err(hsotg->dev, "%s: failed to backup device registers\n",
__func__); __func__);
return ret; return ret;
} }
} }
...@@ -793,7 +793,7 @@ void dwc2_disable_global_interrupts(struct dwc2_hsotg *hsotg) ...@@ -793,7 +793,7 @@ void dwc2_disable_global_interrupts(struct dwc2_hsotg *hsotg)
} }
/* Returns the controller's GHWCFG2.OTG_MODE. */ /* Returns the controller's GHWCFG2.OTG_MODE. */
unsigned dwc2_op_mode(struct dwc2_hsotg *hsotg) unsigned int dwc2_op_mode(struct dwc2_hsotg *hsotg)
{ {
u32 ghwcfg2 = dwc2_readl(hsotg->regs + GHWCFG2); u32 ghwcfg2 = dwc2_readl(hsotg->regs + GHWCFG2);
...@@ -804,7 +804,7 @@ unsigned dwc2_op_mode(struct dwc2_hsotg *hsotg) ...@@ -804,7 +804,7 @@ unsigned dwc2_op_mode(struct dwc2_hsotg *hsotg)
/* Returns true if the controller is capable of DRD. */ /* Returns true if the controller is capable of DRD. */
bool dwc2_hw_is_otg(struct dwc2_hsotg *hsotg) bool dwc2_hw_is_otg(struct dwc2_hsotg *hsotg)
{ {
unsigned op_mode = dwc2_op_mode(hsotg); unsigned int op_mode = dwc2_op_mode(hsotg);
return (op_mode == GHWCFG2_OP_MODE_HNP_SRP_CAPABLE) || return (op_mode == GHWCFG2_OP_MODE_HNP_SRP_CAPABLE) ||
(op_mode == GHWCFG2_OP_MODE_SRP_ONLY_CAPABLE) || (op_mode == GHWCFG2_OP_MODE_SRP_ONLY_CAPABLE) ||
...@@ -814,7 +814,7 @@ bool dwc2_hw_is_otg(struct dwc2_hsotg *hsotg) ...@@ -814,7 +814,7 @@ bool dwc2_hw_is_otg(struct dwc2_hsotg *hsotg)
/* Returns true if the controller is host-only. */ /* Returns true if the controller is host-only. */
bool dwc2_hw_is_host(struct dwc2_hsotg *hsotg) bool dwc2_hw_is_host(struct dwc2_hsotg *hsotg)
{ {
unsigned op_mode = dwc2_op_mode(hsotg); unsigned int op_mode = dwc2_op_mode(hsotg);
return (op_mode == GHWCFG2_OP_MODE_SRP_CAPABLE_HOST) || return (op_mode == GHWCFG2_OP_MODE_SRP_CAPABLE_HOST) ||
(op_mode == GHWCFG2_OP_MODE_NO_SRP_CAPABLE_HOST); (op_mode == GHWCFG2_OP_MODE_NO_SRP_CAPABLE_HOST);
...@@ -823,7 +823,7 @@ bool dwc2_hw_is_host(struct dwc2_hsotg *hsotg) ...@@ -823,7 +823,7 @@ bool dwc2_hw_is_host(struct dwc2_hsotg *hsotg)
/* Returns true if the controller is device-only. */ /* Returns true if the controller is device-only. */
bool dwc2_hw_is_device(struct dwc2_hsotg *hsotg) bool dwc2_hw_is_device(struct dwc2_hsotg *hsotg)
{ {
unsigned op_mode = dwc2_op_mode(hsotg); unsigned int op_mode = dwc2_op_mode(hsotg);
return (op_mode == GHWCFG2_OP_MODE_SRP_CAPABLE_DEVICE) || return (op_mode == GHWCFG2_OP_MODE_SRP_CAPABLE_DEVICE) ||
(op_mode == GHWCFG2_OP_MODE_NO_SRP_CAPABLE_DEVICE); (op_mode == GHWCFG2_OP_MODE_NO_SRP_CAPABLE_DEVICE);
......
...@@ -1101,37 +1101,37 @@ static inline bool dwc2_is_hs_iot(struct dwc2_hsotg *hsotg) ...@@ -1101,37 +1101,37 @@ static inline bool dwc2_is_hs_iot(struct dwc2_hsotg *hsotg)
* The following functions support initialization of the core driver component * The following functions support initialization of the core driver component
* and the DWC_otg controller * and the DWC_otg controller
*/ */
extern int dwc2_core_reset(struct dwc2_hsotg *hsotg); int dwc2_core_reset(struct dwc2_hsotg *hsotg);
extern int dwc2_core_reset_and_force_dr_mode(struct dwc2_hsotg *hsotg); int dwc2_core_reset_and_force_dr_mode(struct dwc2_hsotg *hsotg);
extern int dwc2_enter_hibernation(struct dwc2_hsotg *hsotg); int dwc2_enter_hibernation(struct dwc2_hsotg *hsotg);
extern int dwc2_exit_hibernation(struct dwc2_hsotg *hsotg, bool restore); int dwc2_exit_hibernation(struct dwc2_hsotg *hsotg, bool restore);
bool dwc2_force_mode_if_needed(struct dwc2_hsotg *hsotg, bool host); bool dwc2_force_mode_if_needed(struct dwc2_hsotg *hsotg, bool host);
void dwc2_clear_force_mode(struct dwc2_hsotg *hsotg); void dwc2_clear_force_mode(struct dwc2_hsotg *hsotg);
void dwc2_force_dr_mode(struct dwc2_hsotg *hsotg); void dwc2_force_dr_mode(struct dwc2_hsotg *hsotg);
extern bool dwc2_is_controller_alive(struct dwc2_hsotg *hsotg); bool dwc2_is_controller_alive(struct dwc2_hsotg *hsotg);
/* /*
* Common core Functions. * Common core Functions.
* The following functions support managing the DWC_otg controller in either * The following functions support managing the DWC_otg controller in either
* device or host mode. * device or host mode.
*/ */
extern void dwc2_read_packet(struct dwc2_hsotg *hsotg, u8 *dest, u16 bytes); void dwc2_read_packet(struct dwc2_hsotg *hsotg, u8 *dest, u16 bytes);
extern void dwc2_flush_tx_fifo(struct dwc2_hsotg *hsotg, const int num); void dwc2_flush_tx_fifo(struct dwc2_hsotg *hsotg, const int num);
extern void dwc2_flush_rx_fifo(struct dwc2_hsotg *hsotg); void dwc2_flush_rx_fifo(struct dwc2_hsotg *hsotg);
extern void dwc2_enable_global_interrupts(struct dwc2_hsotg *hcd); void dwc2_enable_global_interrupts(struct dwc2_hsotg *hcd);
extern void dwc2_disable_global_interrupts(struct dwc2_hsotg *hcd); void dwc2_disable_global_interrupts(struct dwc2_hsotg *hcd);
/* This function should be called on every hardware interrupt. */ /* This function should be called on every hardware interrupt. */
extern irqreturn_t dwc2_handle_common_intr(int irq, void *dev); irqreturn_t dwc2_handle_common_intr(int irq, void *dev);
/* The device ID match table */ /* The device ID match table */
extern const struct of_device_id dwc2_of_match_table[]; extern const struct of_device_id dwc2_of_match_table[];
extern int dwc2_lowlevel_hw_enable(struct dwc2_hsotg *hsotg); int dwc2_lowlevel_hw_enable(struct dwc2_hsotg *hsotg);
extern int dwc2_lowlevel_hw_disable(struct dwc2_hsotg *hsotg); int dwc2_lowlevel_hw_disable(struct dwc2_hsotg *hsotg);
/* Parameters */ /* Parameters */
int dwc2_get_hwparams(struct dwc2_hsotg *hsotg); int dwc2_get_hwparams(struct dwc2_hsotg *hsotg);
...@@ -1145,7 +1145,7 @@ int dwc2_init_params(struct dwc2_hsotg *hsotg); ...@@ -1145,7 +1145,7 @@ int dwc2_init_params(struct dwc2_hsotg *hsotg);
* are read in and cached so they always read directly from the * are read in and cached so they always read directly from the
* GHWCFG2 register. * GHWCFG2 register.
*/ */
unsigned dwc2_op_mode(struct dwc2_hsotg *hsotg); unsigned int dwc2_op_mode(struct dwc2_hsotg *hsotg);
bool dwc2_hw_is_otg(struct dwc2_hsotg *hsotg); bool dwc2_hw_is_otg(struct dwc2_hsotg *hsotg);
bool dwc2_hw_is_host(struct dwc2_hsotg *hsotg); bool dwc2_hw_is_host(struct dwc2_hsotg *hsotg);
bool dwc2_hw_is_device(struct dwc2_hsotg *hsotg); bool dwc2_hw_is_device(struct dwc2_hsotg *hsotg);
...@@ -1157,6 +1157,7 @@ static inline int dwc2_is_host_mode(struct dwc2_hsotg *hsotg) ...@@ -1157,6 +1157,7 @@ static inline int dwc2_is_host_mode(struct dwc2_hsotg *hsotg)
{ {
return (dwc2_readl(hsotg->regs + GINTSTS) & GINTSTS_CURMODE_HOST) != 0; return (dwc2_readl(hsotg->regs + GINTSTS) & GINTSTS_CURMODE_HOST) != 0;
} }
static inline int dwc2_is_device_mode(struct dwc2_hsotg *hsotg) static inline int dwc2_is_device_mode(struct dwc2_hsotg *hsotg)
{ {
return (dwc2_readl(hsotg->regs + GINTSTS) & GINTSTS_CURMODE_HOST) == 0; return (dwc2_readl(hsotg->regs + GINTSTS) & GINTSTS_CURMODE_HOST) == 0;
...@@ -1165,26 +1166,26 @@ static inline int dwc2_is_device_mode(struct dwc2_hsotg *hsotg) ...@@ -1165,26 +1166,26 @@ static inline int dwc2_is_device_mode(struct dwc2_hsotg *hsotg)
/* /*
* Dump core registers and SPRAM * Dump core registers and SPRAM
*/ */
extern void dwc2_dump_dev_registers(struct dwc2_hsotg *hsotg); void dwc2_dump_dev_registers(struct dwc2_hsotg *hsotg);
extern void dwc2_dump_host_registers(struct dwc2_hsotg *hsotg); void dwc2_dump_host_registers(struct dwc2_hsotg *hsotg);
extern void dwc2_dump_global_registers(struct dwc2_hsotg *hsotg); void dwc2_dump_global_registers(struct dwc2_hsotg *hsotg);
/* /*
* Return OTG version - either 1.3 or 2.0 * Return OTG version - either 1.3 or 2.0
*/ */
extern u16 dwc2_get_otg_version(struct dwc2_hsotg *hsotg); u16 dwc2_get_otg_version(struct dwc2_hsotg *hsotg);
/* Gadget defines */ /* Gadget defines */
#if IS_ENABLED(CONFIG_USB_DWC2_PERIPHERAL) || IS_ENABLED(CONFIG_USB_DWC2_DUAL_ROLE) #if IS_ENABLED(CONFIG_USB_DWC2_PERIPHERAL) || IS_ENABLED(CONFIG_USB_DWC2_DUAL_ROLE)
extern int dwc2_hsotg_remove(struct dwc2_hsotg *hsotg); int dwc2_hsotg_remove(struct dwc2_hsotg *hsotg);
extern int dwc2_hsotg_suspend(struct dwc2_hsotg *dwc2); int dwc2_hsotg_suspend(struct dwc2_hsotg *dwc2);
extern int dwc2_hsotg_resume(struct dwc2_hsotg *dwc2); int dwc2_hsotg_resume(struct dwc2_hsotg *dwc2);
extern int dwc2_gadget_init(struct dwc2_hsotg *hsotg, int irq); int dwc2_gadget_init(struct dwc2_hsotg *hsotg, int irq);
extern void dwc2_hsotg_core_init_disconnected(struct dwc2_hsotg *dwc2, void dwc2_hsotg_core_init_disconnected(struct dwc2_hsotg *dwc2,
bool reset); bool reset);
extern void dwc2_hsotg_core_connect(struct dwc2_hsotg *hsotg); void dwc2_hsotg_core_connect(struct dwc2_hsotg *hsotg);
extern void dwc2_hsotg_disconnect(struct dwc2_hsotg *dwc2); void dwc2_hsotg_disconnect(struct dwc2_hsotg *dwc2);
extern int dwc2_hsotg_set_test_mode(struct dwc2_hsotg *hsotg, int testmode); int dwc2_hsotg_set_test_mode(struct dwc2_hsotg *hsotg, int testmode);
#define dwc2_is_device_connected(hsotg) (hsotg->connected) #define dwc2_is_device_connected(hsotg) (hsotg->connected)
int dwc2_backup_device_registers(struct dwc2_hsotg *hsotg); int dwc2_backup_device_registers(struct dwc2_hsotg *hsotg);
int dwc2_restore_device_registers(struct dwc2_hsotg *hsotg); int dwc2_restore_device_registers(struct dwc2_hsotg *hsotg);
...@@ -1198,11 +1199,11 @@ static inline int dwc2_hsotg_resume(struct dwc2_hsotg *dwc2) ...@@ -1198,11 +1199,11 @@ static inline int dwc2_hsotg_resume(struct dwc2_hsotg *dwc2)
static inline int dwc2_gadget_init(struct dwc2_hsotg *hsotg, int irq) static inline int dwc2_gadget_init(struct dwc2_hsotg *hsotg, int irq)
{ return 0; } { return 0; }
static inline void dwc2_hsotg_core_init_disconnected(struct dwc2_hsotg *dwc2, static inline void dwc2_hsotg_core_init_disconnected(struct dwc2_hsotg *dwc2,
bool reset) {} bool reset) {}
static inline void dwc2_hsotg_core_connect(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 void dwc2_hsotg_disconnect(struct dwc2_hsotg *dwc2) {}
static inline int dwc2_hsotg_set_test_mode(struct dwc2_hsotg *hsotg, static inline int dwc2_hsotg_set_test_mode(struct dwc2_hsotg *hsotg,
int testmode) int testmode)
{ return 0; } { return 0; }
#define dwc2_is_device_connected(hsotg) (0) #define dwc2_is_device_connected(hsotg) (0)
static inline int dwc2_backup_device_registers(struct dwc2_hsotg *hsotg) static inline int dwc2_backup_device_registers(struct dwc2_hsotg *hsotg)
...@@ -1212,11 +1213,11 @@ static inline int dwc2_restore_device_registers(struct dwc2_hsotg *hsotg) ...@@ -1212,11 +1213,11 @@ static inline int dwc2_restore_device_registers(struct dwc2_hsotg *hsotg)
#endif #endif
#if IS_ENABLED(CONFIG_USB_DWC2_HOST) || IS_ENABLED(CONFIG_USB_DWC2_DUAL_ROLE) #if IS_ENABLED(CONFIG_USB_DWC2_HOST) || IS_ENABLED(CONFIG_USB_DWC2_DUAL_ROLE)
extern int dwc2_hcd_get_frame_number(struct dwc2_hsotg *hsotg); int dwc2_hcd_get_frame_number(struct dwc2_hsotg *hsotg);
extern int dwc2_hcd_get_future_frame_number(struct dwc2_hsotg *hsotg, int us); int dwc2_hcd_get_future_frame_number(struct dwc2_hsotg *hsotg, int us);
extern void dwc2_hcd_connect(struct dwc2_hsotg *hsotg); void dwc2_hcd_connect(struct dwc2_hsotg *hsotg);
extern void dwc2_hcd_disconnect(struct dwc2_hsotg *hsotg, bool force); void dwc2_hcd_disconnect(struct dwc2_hsotg *hsotg, bool force);
extern void dwc2_hcd_start(struct dwc2_hsotg *hsotg); void dwc2_hcd_start(struct dwc2_hsotg *hsotg);
int dwc2_backup_host_registers(struct dwc2_hsotg *hsotg); int dwc2_backup_host_registers(struct dwc2_hsotg *hsotg);
int dwc2_restore_host_registers(struct dwc2_hsotg *hsotg); int dwc2_restore_host_registers(struct dwc2_hsotg *hsotg);
#else #else
......
...@@ -317,7 +317,7 @@ static void dwc2_handle_session_req_intr(struct dwc2_hsotg *hsotg) ...@@ -317,7 +317,7 @@ static void dwc2_handle_session_req_intr(struct dwc2_hsotg *hsotg)
dwc2_writel(GINTSTS_SESSREQINT, hsotg->regs + GINTSTS); dwc2_writel(GINTSTS_SESSREQINT, hsotg->regs + GINTSTS);
dev_dbg(hsotg->dev, "Session request interrupt - lx_state=%d\n", dev_dbg(hsotg->dev, "Session request interrupt - lx_state=%d\n",
hsotg->lx_state); hsotg->lx_state);
if (dwc2_is_device_mode(hsotg)) { if (dwc2_is_device_mode(hsotg)) {
if (hsotg->lx_state == DWC2_L2) { if (hsotg->lx_state == DWC2_L2) {
...@@ -437,7 +437,7 @@ static void dwc2_handle_usb_suspend_intr(struct dwc2_hsotg *hsotg) ...@@ -437,7 +437,7 @@ static void dwc2_handle_usb_suspend_intr(struct dwc2_hsotg *hsotg)
/* Ignore suspend request before enumeration */ /* Ignore suspend request before enumeration */
if (!dwc2_is_device_connected(hsotg)) { if (!dwc2_is_device_connected(hsotg)) {
dev_dbg(hsotg->dev, dev_dbg(hsotg->dev,
"ignore suspend request before enumeration\n"); "ignore suspend request before enumeration\n");
return; return;
} }
...@@ -445,7 +445,7 @@ static void dwc2_handle_usb_suspend_intr(struct dwc2_hsotg *hsotg) ...@@ -445,7 +445,7 @@ static void dwc2_handle_usb_suspend_intr(struct dwc2_hsotg *hsotg)
if (ret) { if (ret) {
if (ret != -ENOTSUPP) if (ret != -ENOTSUPP)
dev_err(hsotg->dev, dev_err(hsotg->dev,
"enter hibernation failed\n"); "enter hibernation failed\n");
goto skip_power_saving; goto skip_power_saving;
} }
......
...@@ -17,8 +17,8 @@ ...@@ -17,8 +17,8 @@
#include "core.h" #include "core.h"
#ifdef CONFIG_DEBUG_FS #ifdef CONFIG_DEBUG_FS
extern int dwc2_debugfs_init(struct dwc2_hsotg *); int dwc2_debugfs_init(struct dwc2_hsotg *);
extern void dwc2_debugfs_exit(struct dwc2_hsotg *); void dwc2_debugfs_exit(struct dwc2_hsotg *);
#else #else
static inline int dwc2_debugfs_init(struct dwc2_hsotg *hsotg) static inline int dwc2_debugfs_init(struct dwc2_hsotg *hsotg)
{ return 0; } { return 0; }
......
...@@ -137,7 +137,7 @@ static int state_show(struct seq_file *seq, void *v) ...@@ -137,7 +137,7 @@ static int state_show(struct seq_file *seq, void *v)
int idx; int idx;
seq_printf(seq, "DCFG=0x%08x, DCTL=0x%08x, DSTS=0x%08x\n", seq_printf(seq, "DCFG=0x%08x, DCTL=0x%08x, DSTS=0x%08x\n",
dwc2_readl(regs + DCFG), dwc2_readl(regs + DCFG),
dwc2_readl(regs + DCTL), dwc2_readl(regs + DCTL),
dwc2_readl(regs + DSTS)); dwc2_readl(regs + DSTS));
...@@ -338,23 +338,23 @@ static void dwc2_hsotg_create_debug(struct dwc2_hsotg *hsotg) ...@@ -338,23 +338,23 @@ static void dwc2_hsotg_create_debug(struct dwc2_hsotg *hsotg)
{ {
struct dentry *root; struct dentry *root;
struct dentry *file; struct dentry *file;
unsigned epidx; unsigned int epidx;
root = hsotg->debug_root; root = hsotg->debug_root;
/* create general state file */ /* create general state file */
file = debugfs_create_file("state", S_IRUGO, root, hsotg, &state_fops); file = debugfs_create_file("state", 0444, root, hsotg, &state_fops);
if (IS_ERR(file)) if (IS_ERR(file))
dev_err(hsotg->dev, "%s: failed to create state\n", __func__); dev_err(hsotg->dev, "%s: failed to create state\n", __func__);
file = debugfs_create_file("testmode", S_IRUGO | S_IWUSR, root, hsotg, file = debugfs_create_file("testmode", 0644, root, hsotg,
&testmode_fops); &testmode_fops);
if (IS_ERR(file)) if (IS_ERR(file))
dev_err(hsotg->dev, "%s: failed to create testmode\n", dev_err(hsotg->dev, "%s: failed to create testmode\n",
__func__); __func__);
file = debugfs_create_file("fifo", S_IRUGO, root, hsotg, &fifo_fops); file = debugfs_create_file("fifo", 0444, root, hsotg, &fifo_fops);
if (IS_ERR(file)) if (IS_ERR(file))
dev_err(hsotg->dev, "%s: failed to create fifo\n", __func__); dev_err(hsotg->dev, "%s: failed to create fifo\n", __func__);
...@@ -364,8 +364,8 @@ static void dwc2_hsotg_create_debug(struct dwc2_hsotg *hsotg) ...@@ -364,8 +364,8 @@ static void dwc2_hsotg_create_debug(struct dwc2_hsotg *hsotg)
ep = hsotg->eps_out[epidx]; ep = hsotg->eps_out[epidx];
if (ep) { if (ep) {
file = debugfs_create_file(ep->name, S_IRUGO, file = debugfs_create_file(ep->name, 0444,
root, ep, &ep_fops); root, ep, &ep_fops);
if (IS_ERR(file)) if (IS_ERR(file))
dev_err(hsotg->dev, "failed to create %s debug file\n", dev_err(hsotg->dev, "failed to create %s debug file\n",
ep->name); ep->name);
...@@ -377,8 +377,8 @@ static void dwc2_hsotg_create_debug(struct dwc2_hsotg *hsotg) ...@@ -377,8 +377,8 @@ static void dwc2_hsotg_create_debug(struct dwc2_hsotg *hsotg)
ep = hsotg->eps_in[epidx]; ep = hsotg->eps_in[epidx];
if (ep) { if (ep) {
file = debugfs_create_file(ep->name, S_IRUGO, file = debugfs_create_file(ep->name, 0444,
root, ep, &ep_fops); root, ep, &ep_fops);
if (IS_ERR(file)) if (IS_ERR(file))
dev_err(hsotg->dev, "failed to create %s debug file\n", dev_err(hsotg->dev, "failed to create %s debug file\n",
ep->name); ep->name);
...@@ -750,8 +750,8 @@ int dwc2_debugfs_init(struct dwc2_hsotg *hsotg) ...@@ -750,8 +750,8 @@ int dwc2_debugfs_init(struct dwc2_hsotg *hsotg)
hsotg->regset->nregs = ARRAY_SIZE(dwc2_regs); hsotg->regset->nregs = ARRAY_SIZE(dwc2_regs);
hsotg->regset->base = hsotg->regs; hsotg->regset->base = hsotg->regs;
file = debugfs_create_regset32("regdump", S_IRUGO, hsotg->debug_root, file = debugfs_create_regset32("regdump", 0444, hsotg->debug_root,
hsotg->regset); hsotg->regset);
if (!file) { if (!file) {
ret = -ENOMEM; ret = -ENOMEM;
goto err1; goto err1;
......
This diff is collapsed.
...@@ -2577,7 +2577,7 @@ static void dwc2_free_dma_aligned_buffer(struct urb *urb) ...@@ -2577,7 +2577,7 @@ static void dwc2_free_dma_aligned_buffer(struct urb *urb)
return; return;
temp = container_of(urb->transfer_buffer, temp = container_of(urb->transfer_buffer,
struct dma_aligned_buffer, data); struct dma_aligned_buffer, data);
if (usb_urb_dir_in(urb)) if (usb_urb_dir_in(urb))
memcpy(temp->old_xfer_buffer, temp->data, memcpy(temp->old_xfer_buffer, temp->data,
...@@ -2621,7 +2621,7 @@ static int dwc2_alloc_dma_aligned_buffer(struct urb *urb, gfp_t mem_flags) ...@@ -2621,7 +2621,7 @@ static int dwc2_alloc_dma_aligned_buffer(struct urb *urb, gfp_t mem_flags)
} }
static int dwc2_map_urb_for_dma(struct usb_hcd *hcd, struct urb *urb, static int dwc2_map_urb_for_dma(struct usb_hcd *hcd, struct urb *urb,
gfp_t mem_flags) gfp_t mem_flags)
{ {
int ret; int ret;
...@@ -2718,7 +2718,7 @@ static int dwc2_assign_and_init_hc(struct dwc2_hsotg *hsotg, struct dwc2_qh *qh) ...@@ -2718,7 +2718,7 @@ static int dwc2_assign_and_init_hc(struct dwc2_hsotg *hsotg, struct dwc2_qh *qh)
chan->multi_count = 1; chan->multi_count = 1;
if (urb->actual_length > urb->length && if (urb->actual_length > urb->length &&
!dwc2_hcd_is_pipe_in(&urb->pipe_info)) !dwc2_hcd_is_pipe_in(&urb->pipe_info))
urb->actual_length = urb->length; urb->actual_length = urb->length;
if (hsotg->params.host_dma > 0) if (hsotg->params.host_dma > 0)
...@@ -2989,7 +2989,7 @@ static void dwc2_process_periodic_channels(struct dwc2_hsotg *hsotg) ...@@ -2989,7 +2989,7 @@ static void dwc2_process_periodic_channels(struct dwc2_hsotg *hsotg)
* the middle of multiple high-bandwidth packets getting queued. * the middle of multiple high-bandwidth packets getting queued.
*/ */
if (hsotg->params.host_dma <= 0 && if (hsotg->params.host_dma <= 0 &&
qh->channel->multi_count > 1) qh->channel->multi_count > 1)
hsotg->queuing_high_bandwidth = 1; hsotg->queuing_high_bandwidth = 1;
fspcavail = (tx_status & TXSTS_FSPCAVAIL_MASK) >> fspcavail = (tx_status & TXSTS_FSPCAVAIL_MASK) >>
...@@ -4047,7 +4047,7 @@ static struct dwc2_hsotg *dwc2_hcd_to_hsotg(struct usb_hcd *hcd) ...@@ -4047,7 +4047,7 @@ static struct dwc2_hsotg *dwc2_hcd_to_hsotg(struct usb_hcd *hcd)
{ {
struct wrapper_priv_data *p; struct wrapper_priv_data *p;
p = (struct wrapper_priv_data *) &hcd->hcd_priv; p = (struct wrapper_priv_data *)&hcd->hcd_priv;
return p->hsotg; return p->hsotg;
} }
...@@ -4082,7 +4082,7 @@ struct dwc2_tt *dwc2_host_get_tt_info(struct dwc2_hsotg *hsotg, void *context, ...@@ -4082,7 +4082,7 @@ struct dwc2_tt *dwc2_host_get_tt_info(struct dwc2_hsotg *hsotg, void *context,
*ttport = urb->dev->ttport; *ttport = urb->dev->ttport;
dwc_tt = urb->dev->tt->hcpriv; dwc_tt = urb->dev->tt->hcpriv;
if (dwc_tt == NULL) { if (!dwc_tt) {
size_t bitmap_size; size_t bitmap_size;
/* /*
...@@ -4096,7 +4096,7 @@ struct dwc2_tt *dwc2_host_get_tt_info(struct dwc2_hsotg *hsotg, void *context, ...@@ -4096,7 +4096,7 @@ struct dwc2_tt *dwc2_host_get_tt_info(struct dwc2_hsotg *hsotg, void *context,
dwc_tt = kzalloc(sizeof(*dwc_tt) + bitmap_size, dwc_tt = kzalloc(sizeof(*dwc_tt) + bitmap_size,
mem_flags); mem_flags);
if (dwc_tt == NULL) if (!dwc_tt)
return NULL; return NULL;
dwc_tt->usb_tt = urb->dev->tt; dwc_tt->usb_tt = urb->dev->tt;
...@@ -4123,7 +4123,7 @@ struct dwc2_tt *dwc2_host_get_tt_info(struct dwc2_hsotg *hsotg, void *context, ...@@ -4123,7 +4123,7 @@ struct dwc2_tt *dwc2_host_get_tt_info(struct dwc2_hsotg *hsotg, void *context,
void dwc2_host_put_tt_info(struct dwc2_hsotg *hsotg, struct dwc2_tt *dwc_tt) void dwc2_host_put_tt_info(struct dwc2_hsotg *hsotg, struct dwc2_tt *dwc_tt)
{ {
/* Model kfree and make put of NULL a no-op */ /* Model kfree and make put of NULL a no-op */
if (dwc_tt == NULL) if (!dwc_tt)
return; return;
WARN_ON(dwc_tt->refcount < 1); WARN_ON(dwc_tt->refcount < 1);
...@@ -4206,7 +4206,6 @@ void dwc2_host_complete(struct dwc2_hsotg *hsotg, struct dwc2_qtd *qtd, ...@@ -4206,7 +4206,6 @@ void dwc2_host_complete(struct dwc2_hsotg *hsotg, struct dwc2_qtd *qtd,
usb_pipein(urb->pipe) ? "IN" : "OUT", status, usb_pipein(urb->pipe) ? "IN" : "OUT", status,
urb->actual_length); urb->actual_length);
if (usb_pipetype(urb->pipe) == PIPE_ISOCHRONOUS) { if (usb_pipetype(urb->pipe) == PIPE_ISOCHRONOUS) {
urb->error_count = dwc2_hcd_urb_get_error_count(qtd->urb); urb->error_count = dwc2_hcd_urb_get_error_count(qtd->urb);
for (i = 0; i < urb->number_of_packets; ++i) { for (i = 0; i < urb->number_of_packets; ++i) {
...@@ -4237,7 +4236,7 @@ void dwc2_host_complete(struct dwc2_hsotg *hsotg, struct dwc2_qtd *qtd, ...@@ -4237,7 +4236,7 @@ void dwc2_host_complete(struct dwc2_hsotg *hsotg, struct dwc2_qtd *qtd,
if (ep) if (ep)
dwc2_free_bus_bandwidth(dwc2_hsotg_to_hcd(hsotg), dwc2_free_bus_bandwidth(dwc2_hsotg_to_hcd(hsotg),
dwc2_hcd_get_ep_bandwidth(hsotg, ep), dwc2_hcd_get_ep_bandwidth(hsotg, ep),
urb); urb);
} }
...@@ -4584,7 +4583,7 @@ static int _dwc2_hcd_urb_enqueue(struct usb_hcd *hcd, struct urb *urb, ...@@ -4584,7 +4583,7 @@ static int _dwc2_hcd_urb_enqueue(struct usb_hcd *hcd, struct urb *urb,
dwc2_dump_urb_info(hcd, urb, "urb_enqueue"); dwc2_dump_urb_info(hcd, urb, "urb_enqueue");
} }
if (ep == NULL) if (!ep)
return -EINVAL; return -EINVAL;
if (usb_pipetype(urb->pipe) == PIPE_ISOCHRONOUS || if (usb_pipetype(urb->pipe) == PIPE_ISOCHRONOUS ||
...@@ -4654,7 +4653,7 @@ static int _dwc2_hcd_urb_enqueue(struct usb_hcd *hcd, struct urb *urb, ...@@ -4654,7 +4653,7 @@ static int _dwc2_hcd_urb_enqueue(struct usb_hcd *hcd, struct urb *urb,
urb->iso_frame_desc[i].length); urb->iso_frame_desc[i].length);
urb->hcpriv = dwc2_urb; urb->hcpriv = dwc2_urb;
qh = (struct dwc2_qh *) ep->hcpriv; qh = (struct dwc2_qh *)ep->hcpriv;
/* Create QH for the endpoint if it doesn't exist */ /* Create QH for the endpoint if it doesn't exist */
if (!qh) { if (!qh) {
qh = dwc2_hcd_qh_create(hsotg, dwc2_urb, mem_flags); qh = dwc2_hcd_qh_create(hsotg, dwc2_urb, mem_flags);
...@@ -4683,7 +4682,7 @@ static int _dwc2_hcd_urb_enqueue(struct usb_hcd *hcd, struct urb *urb, ...@@ -4683,7 +4682,7 @@ static int _dwc2_hcd_urb_enqueue(struct usb_hcd *hcd, struct urb *urb,
if (alloc_bandwidth) { if (alloc_bandwidth) {
dwc2_allocate_bus_bandwidth(hcd, dwc2_allocate_bus_bandwidth(hcd,
dwc2_hcd_get_ep_bandwidth(hsotg, ep), dwc2_hcd_get_ep_bandwidth(hsotg, ep),
urb); urb);
} }
...@@ -4709,7 +4708,7 @@ static int _dwc2_hcd_urb_enqueue(struct usb_hcd *hcd, struct urb *urb, ...@@ -4709,7 +4708,7 @@ static int _dwc2_hcd_urb_enqueue(struct usb_hcd *hcd, struct urb *urb,
dwc2_hcd_qh_unlink(hsotg, qh); dwc2_hcd_qh_unlink(hsotg, qh);
/* Free each QTD in the QH's QTD list */ /* Free each QTD in the QH's QTD list */
list_for_each_entry_safe(qtd2, qtd2_tmp, &qh->qtd_list, list_for_each_entry_safe(qtd2, qtd2_tmp, &qh->qtd_list,
qtd_list_entry) qtd_list_entry)
dwc2_hcd_qtd_unlink_and_free(hsotg, qtd2, qh); dwc2_hcd_qtd_unlink_and_free(hsotg, qtd2, qh);
dwc2_hcd_qh_free(hsotg, qh); dwc2_hcd_qh_free(hsotg, qh);
} }
...@@ -4908,7 +4907,7 @@ static void dwc2_hcd_free(struct dwc2_hsotg *hsotg) ...@@ -4908,7 +4907,7 @@ static void dwc2_hcd_free(struct dwc2_hsotg *hsotg)
for (i = 0; i < MAX_EPS_CHANNELS; i++) { for (i = 0; i < MAX_EPS_CHANNELS; i++) {
struct dwc2_host_chan *chan = hsotg->hc_ptr_array[i]; struct dwc2_host_chan *chan = hsotg->hc_ptr_array[i];
if (chan != NULL) { if (chan) {
dev_dbg(hsotg->dev, "HCD Free channel #%i, chan=%p\n", dev_dbg(hsotg->dev, "HCD Free channel #%i, chan=%p\n",
i, chan); i, chan);
hsotg->hc_ptr_array[i] = NULL; hsotg->hc_ptr_array[i] = NULL;
...@@ -4997,7 +4996,7 @@ int dwc2_hcd_init(struct dwc2_hsotg *hsotg, int irq) ...@@ -4997,7 +4996,7 @@ int dwc2_hcd_init(struct dwc2_hsotg *hsotg, int irq)
/* Check if the bus driver or platform code has setup a dma_mask */ /* Check if the bus driver or platform code has setup a dma_mask */
if (hsotg->params.host_dma > 0 && if (hsotg->params.host_dma > 0 &&
hsotg->dev->dma_mask == NULL) { !hsotg->dev->dma_mask) {
dev_warn(hsotg->dev, dev_warn(hsotg->dev,
"dma_mask not set, disabling DMA\n"); "dma_mask not set, disabling DMA\n");
hsotg->params.host_dma = false; hsotg->params.host_dma = false;
...@@ -5021,7 +5020,7 @@ int dwc2_hcd_init(struct dwc2_hsotg *hsotg, int irq) ...@@ -5021,7 +5020,7 @@ int dwc2_hcd_init(struct dwc2_hsotg *hsotg, int irq)
hcd->has_tt = 1; hcd->has_tt = 1;
((struct wrapper_priv_data *) &hcd->hcd_priv)->hsotg = hsotg; ((struct wrapper_priv_data *)&hcd->hcd_priv)->hsotg = hsotg;
hsotg->priv = hcd; hsotg->priv = hcd;
/* /*
...@@ -5069,7 +5068,7 @@ int dwc2_hcd_init(struct dwc2_hsotg *hsotg, int irq) ...@@ -5069,7 +5068,7 @@ int dwc2_hcd_init(struct dwc2_hsotg *hsotg, int irq)
for (i = 0; i < num_channels; i++) { for (i = 0; i < num_channels; i++) {
channel = kzalloc(sizeof(*channel), GFP_KERNEL); channel = kzalloc(sizeof(*channel), GFP_KERNEL);
if (channel == NULL) if (!channel)
goto error3; goto error3;
channel->hc_num = i; channel->hc_num = i;
INIT_LIST_HEAD(&channel->split_order_list_entry); INIT_LIST_HEAD(&channel->split_order_list_entry);
......
...@@ -521,29 +521,29 @@ static inline u8 dwc2_hcd_is_pipe_out(struct dwc2_hcd_pipe_info *pipe) ...@@ -521,29 +521,29 @@ static inline u8 dwc2_hcd_is_pipe_out(struct dwc2_hcd_pipe_info *pipe)
return !dwc2_hcd_is_pipe_in(pipe); return !dwc2_hcd_is_pipe_in(pipe);
} }
extern int dwc2_hcd_init(struct dwc2_hsotg *hsotg, int irq); int dwc2_hcd_init(struct dwc2_hsotg *hsotg, int irq);
extern void dwc2_hcd_remove(struct dwc2_hsotg *hsotg); void dwc2_hcd_remove(struct dwc2_hsotg *hsotg);
/* Transaction Execution Functions */ /* Transaction Execution Functions */
extern enum dwc2_transaction_type dwc2_hcd_select_transactions( enum dwc2_transaction_type dwc2_hcd_select_transactions(
struct dwc2_hsotg *hsotg); struct dwc2_hsotg *hsotg);
extern void dwc2_hcd_queue_transactions(struct dwc2_hsotg *hsotg, void dwc2_hcd_queue_transactions(struct dwc2_hsotg *hsotg,
enum dwc2_transaction_type tr_type); enum dwc2_transaction_type tr_type);
/* Schedule Queue Functions */ /* Schedule Queue Functions */
/* Implemented in hcd_queue.c */ /* Implemented in hcd_queue.c */
extern struct dwc2_qh *dwc2_hcd_qh_create(struct dwc2_hsotg *hsotg, struct dwc2_qh *dwc2_hcd_qh_create(struct dwc2_hsotg *hsotg,
struct dwc2_hcd_urb *urb, struct dwc2_hcd_urb *urb,
gfp_t mem_flags); gfp_t mem_flags);
extern void dwc2_hcd_qh_free(struct dwc2_hsotg *hsotg, struct dwc2_qh *qh); void dwc2_hcd_qh_free(struct dwc2_hsotg *hsotg, struct dwc2_qh *qh);
extern int dwc2_hcd_qh_add(struct dwc2_hsotg *hsotg, struct dwc2_qh *qh); int dwc2_hcd_qh_add(struct dwc2_hsotg *hsotg, struct dwc2_qh *qh);
extern void dwc2_hcd_qh_unlink(struct dwc2_hsotg *hsotg, struct dwc2_qh *qh); void dwc2_hcd_qh_unlink(struct dwc2_hsotg *hsotg, struct dwc2_qh *qh);
extern void dwc2_hcd_qh_deactivate(struct dwc2_hsotg *hsotg, struct dwc2_qh *qh, void dwc2_hcd_qh_deactivate(struct dwc2_hsotg *hsotg, struct dwc2_qh *qh,
int sched_csplit); int sched_csplit);
extern void dwc2_hcd_qtd_init(struct dwc2_qtd *qtd, struct dwc2_hcd_urb *urb); void dwc2_hcd_qtd_init(struct dwc2_qtd *qtd, struct dwc2_hcd_urb *urb);
extern int dwc2_hcd_qtd_add(struct dwc2_hsotg *hsotg, struct dwc2_qtd *qtd, int dwc2_hcd_qtd_add(struct dwc2_hsotg *hsotg, struct dwc2_qtd *qtd,
struct dwc2_qh *qh); struct dwc2_qh *qh);
/* Unlinks and frees a QTD */ /* Unlinks and frees a QTD */
static inline void dwc2_hcd_qtd_unlink_and_free(struct dwc2_hsotg *hsotg, static inline void dwc2_hcd_qtd_unlink_and_free(struct dwc2_hsotg *hsotg,
...@@ -556,15 +556,15 @@ static inline void dwc2_hcd_qtd_unlink_and_free(struct dwc2_hsotg *hsotg, ...@@ -556,15 +556,15 @@ static inline void dwc2_hcd_qtd_unlink_and_free(struct dwc2_hsotg *hsotg,
} }
/* Descriptor DMA support functions */ /* Descriptor DMA support functions */
extern void dwc2_hcd_start_xfer_ddma(struct dwc2_hsotg *hsotg, void dwc2_hcd_start_xfer_ddma(struct dwc2_hsotg *hsotg,
struct dwc2_qh *qh); struct dwc2_qh *qh);
extern void dwc2_hcd_complete_xfer_ddma(struct dwc2_hsotg *hsotg, void dwc2_hcd_complete_xfer_ddma(struct dwc2_hsotg *hsotg,
struct dwc2_host_chan *chan, int chnum, struct dwc2_host_chan *chan, int chnum,
enum dwc2_halt_status halt_status); enum dwc2_halt_status halt_status);
extern int dwc2_hcd_qh_init_ddma(struct dwc2_hsotg *hsotg, struct dwc2_qh *qh, int dwc2_hcd_qh_init_ddma(struct dwc2_hsotg *hsotg, struct dwc2_qh *qh,
gfp_t mem_flags); gfp_t mem_flags);
extern void dwc2_hcd_qh_free_ddma(struct dwc2_hsotg *hsotg, struct dwc2_qh *qh); void dwc2_hcd_qh_free_ddma(struct dwc2_hsotg *hsotg, struct dwc2_qh *qh);
/* Check if QH is non-periodic */ /* Check if QH is non-periodic */
#define dwc2_qh_is_non_per(_qh_ptr_) \ #define dwc2_qh_is_non_per(_qh_ptr_) \
...@@ -732,8 +732,8 @@ static inline u16 dwc2_hcd_get_ep_bandwidth(struct dwc2_hsotg *hsotg, ...@@ -732,8 +732,8 @@ static inline u16 dwc2_hcd_get_ep_bandwidth(struct dwc2_hsotg *hsotg,
return qh->host_us; return qh->host_us;
} }
extern void dwc2_hcd_save_data_toggle(struct dwc2_hsotg *hsotg, void dwc2_hcd_save_data_toggle(struct dwc2_hsotg *hsotg,
struct dwc2_host_chan *chan, int chnum, struct dwc2_host_chan *chan, int chnum,
struct dwc2_qtd *qtd); struct dwc2_qtd *qtd);
/* HCD Core API */ /* HCD Core API */
...@@ -746,14 +746,14 @@ extern void dwc2_hcd_save_data_toggle(struct dwc2_hsotg *hsotg, ...@@ -746,14 +746,14 @@ extern void dwc2_hcd_save_data_toggle(struct dwc2_hsotg *hsotg,
* Returns IRQ_HANDLED if interrupt is handled * Returns IRQ_HANDLED if interrupt is handled
* Return IRQ_NONE if interrupt is not handled * Return IRQ_NONE if interrupt is not handled
*/ */
extern irqreturn_t dwc2_handle_hcd_intr(struct dwc2_hsotg *hsotg); irqreturn_t dwc2_handle_hcd_intr(struct dwc2_hsotg *hsotg);
/** /**
* dwc2_hcd_stop() - Halts the DWC_otg host mode operation * dwc2_hcd_stop() - Halts the DWC_otg host mode operation
* *
* @hsotg: The DWC2 HCD * @hsotg: The DWC2 HCD
*/ */
extern void dwc2_hcd_stop(struct dwc2_hsotg *hsotg); void dwc2_hcd_stop(struct dwc2_hsotg *hsotg);
/** /**
* dwc2_hcd_is_b_host() - Returns 1 if core currently is acting as B host, * dwc2_hcd_is_b_host() - Returns 1 if core currently is acting as B host,
...@@ -761,7 +761,7 @@ extern void dwc2_hcd_stop(struct dwc2_hsotg *hsotg); ...@@ -761,7 +761,7 @@ extern void dwc2_hcd_stop(struct dwc2_hsotg *hsotg);
* *
* @hsotg: The DWC2 HCD * @hsotg: The DWC2 HCD
*/ */
extern int dwc2_hcd_is_b_host(struct dwc2_hsotg *hsotg); int dwc2_hcd_is_b_host(struct dwc2_hsotg *hsotg);
/** /**
* dwc2_hcd_dump_state() - Dumps hsotg state * dwc2_hcd_dump_state() - Dumps hsotg state
...@@ -771,7 +771,7 @@ extern int dwc2_hcd_is_b_host(struct dwc2_hsotg *hsotg); ...@@ -771,7 +771,7 @@ extern int dwc2_hcd_is_b_host(struct dwc2_hsotg *hsotg);
* NOTE: This function will be removed once the peripheral controller code * NOTE: This function will be removed once the peripheral controller code
* is integrated and the driver is stable * is integrated and the driver is stable
*/ */
extern void dwc2_hcd_dump_state(struct dwc2_hsotg *hsotg); void dwc2_hcd_dump_state(struct dwc2_hsotg *hsotg);
/** /**
* dwc2_hcd_dump_frrem() - Dumps the average frame remaining at SOF * dwc2_hcd_dump_frrem() - Dumps the average frame remaining at SOF
...@@ -784,7 +784,7 @@ extern void dwc2_hcd_dump_state(struct dwc2_hsotg *hsotg); ...@@ -784,7 +784,7 @@ extern void dwc2_hcd_dump_state(struct dwc2_hsotg *hsotg);
* NOTE: This function will be removed once the peripheral controller code * NOTE: This function will be removed once the peripheral controller code
* is integrated and the driver is stable * is integrated and the driver is stable
*/ */
extern void dwc2_hcd_dump_frrem(struct dwc2_hsotg *hsotg); void dwc2_hcd_dump_frrem(struct dwc2_hsotg *hsotg);
/* URB interface */ /* URB interface */
...@@ -793,15 +793,15 @@ extern void dwc2_hcd_dump_frrem(struct dwc2_hsotg *hsotg); ...@@ -793,15 +793,15 @@ extern void dwc2_hcd_dump_frrem(struct dwc2_hsotg *hsotg);
#define URB_SEND_ZERO_PACKET 0x2 #define URB_SEND_ZERO_PACKET 0x2
/* Host driver callbacks */ /* Host driver callbacks */
extern struct dwc2_tt *dwc2_host_get_tt_info(struct dwc2_hsotg *hsotg, struct dwc2_tt *dwc2_host_get_tt_info(struct dwc2_hsotg *hsotg,
void *context, gfp_t mem_flags, void *context, gfp_t mem_flags,
int *ttport); int *ttport);
extern void dwc2_host_put_tt_info(struct dwc2_hsotg *hsotg, void dwc2_host_put_tt_info(struct dwc2_hsotg *hsotg,
struct dwc2_tt *dwc_tt); struct dwc2_tt *dwc_tt);
extern int dwc2_host_get_speed(struct dwc2_hsotg *hsotg, void *context); int dwc2_host_get_speed(struct dwc2_hsotg *hsotg, void *context);
extern void dwc2_host_complete(struct dwc2_hsotg *hsotg, struct dwc2_qtd *qtd, void dwc2_host_complete(struct dwc2_hsotg *hsotg, struct dwc2_qtd *qtd,
int status); int status);
#ifdef DEBUG #ifdef DEBUG
/* /*
......
...@@ -106,7 +106,7 @@ static int dwc2_desc_list_alloc(struct dwc2_hsotg *hsotg, struct dwc2_qh *qh, ...@@ -106,7 +106,7 @@ static int dwc2_desc_list_alloc(struct dwc2_hsotg *hsotg, struct dwc2_qh *qh,
qh->desc_list_sz, qh->desc_list_sz,
DMA_TO_DEVICE); DMA_TO_DEVICE);
qh->n_bytes = kzalloc(sizeof(u32) * dwc2_max_desc_num(qh), flags); qh->n_bytes = kcalloc(dwc2_max_desc_num(qh), sizeof(u32), flags);
if (!qh->n_bytes) { if (!qh->n_bytes) {
dma_unmap_single(hsotg->dev, qh->desc_list_dma, dma_unmap_single(hsotg->dev, qh->desc_list_dma,
qh->desc_list_sz, qh->desc_list_sz,
...@@ -175,7 +175,6 @@ static void dwc2_frame_list_free(struct dwc2_hsotg *hsotg) ...@@ -175,7 +175,6 @@ static void dwc2_frame_list_free(struct dwc2_hsotg *hsotg)
hsotg->frame_list = NULL; hsotg->frame_list = NULL;
spin_unlock_irqrestore(&hsotg->lock, flags); spin_unlock_irqrestore(&hsotg->lock, flags);
} }
static void dwc2_per_sched_enable(struct dwc2_hsotg *hsotg, u32 fr_list_en) static void dwc2_per_sched_enable(struct dwc2_hsotg *hsotg, u32 fr_list_en)
...@@ -570,7 +569,7 @@ static void dwc2_fill_host_isoc_dma_desc(struct dwc2_hsotg *hsotg, ...@@ -570,7 +569,7 @@ static void dwc2_fill_host_isoc_dma_desc(struct dwc2_hsotg *hsotg,
#endif #endif
dma_sync_single_for_device(hsotg->dev, dma_sync_single_for_device(hsotg->dev,
qh->desc_list_dma + qh->desc_list_dma +
(idx * sizeof(struct dwc2_dma_desc)), (idx * sizeof(struct dwc2_dma_desc)),
sizeof(struct dwc2_dma_desc), sizeof(struct dwc2_dma_desc),
DMA_TO_DEVICE); DMA_TO_DEVICE);
...@@ -776,7 +775,7 @@ static void dwc2_init_non_isoc_dma_desc(struct dwc2_hsotg *hsotg, ...@@ -776,7 +775,7 @@ static void dwc2_init_non_isoc_dma_desc(struct dwc2_hsotg *hsotg,
n_desc - 1, n_desc - 1,
&qh->desc_list[n_desc - 1]); &qh->desc_list[n_desc - 1]);
dma_sync_single_for_device(hsotg->dev, dma_sync_single_for_device(hsotg->dev,
qh->desc_list_dma + qh->desc_list_dma +
((n_desc - 1) * ((n_desc - 1) *
sizeof(struct dwc2_dma_desc)), sizeof(struct dwc2_dma_desc)),
sizeof(struct dwc2_dma_desc), sizeof(struct dwc2_dma_desc),
...@@ -816,7 +815,7 @@ static void dwc2_init_non_isoc_dma_desc(struct dwc2_hsotg *hsotg, ...@@ -816,7 +815,7 @@ static void dwc2_init_non_isoc_dma_desc(struct dwc2_hsotg *hsotg,
dev_vdbg(hsotg->dev, "set A bit in desc 0 (%p)\n", dev_vdbg(hsotg->dev, "set A bit in desc 0 (%p)\n",
&qh->desc_list[0]); &qh->desc_list[0]);
dma_sync_single_for_device(hsotg->dev, dma_sync_single_for_device(hsotg->dev,
qh->desc_list_dma, qh->desc_list_dma,
sizeof(struct dwc2_dma_desc), sizeof(struct dwc2_dma_desc),
DMA_TO_DEVICE); DMA_TO_DEVICE);
} }
...@@ -1064,7 +1063,7 @@ static void dwc2_complete_isoc_xfer_ddma(struct dwc2_hsotg *hsotg, ...@@ -1064,7 +1063,7 @@ static void dwc2_complete_isoc_xfer_ddma(struct dwc2_hsotg *hsotg,
} }
static int dwc2_update_non_isoc_urb_state_ddma(struct dwc2_hsotg *hsotg, static int dwc2_update_non_isoc_urb_state_ddma(struct dwc2_hsotg *hsotg,
struct dwc2_host_chan *chan, struct dwc2_host_chan *chan,
struct dwc2_qtd *qtd, struct dwc2_qtd *qtd,
struct dwc2_dma_desc *dma_desc, struct dwc2_dma_desc *dma_desc,
enum dwc2_halt_status halt_status, enum dwc2_halt_status halt_status,
......
...@@ -60,7 +60,7 @@ static void dwc2_track_missed_sofs(struct dwc2_hsotg *hsotg) ...@@ -60,7 +60,7 @@ static void dwc2_track_missed_sofs(struct dwc2_hsotg *hsotg)
if (expected != curr_frame_number) if (expected != curr_frame_number)
dwc2_sch_vdbg(hsotg, "MISSED SOF %04x != %04x\n", dwc2_sch_vdbg(hsotg, "MISSED SOF %04x != %04x\n",
expected, curr_frame_number); expected, curr_frame_number);
#ifdef CONFIG_USB_DWC2_TRACK_MISSED_SOFS #ifdef CONFIG_USB_DWC2_TRACK_MISSED_SOFS
if (hsotg->frame_num_idx < FRAME_NUM_ARRAY_SIZE) { if (hsotg->frame_num_idx < FRAME_NUM_ARRAY_SIZE) {
...@@ -163,7 +163,7 @@ static void dwc2_sof_intr(struct dwc2_hsotg *hsotg) ...@@ -163,7 +163,7 @@ static void dwc2_sof_intr(struct dwc2_hsotg *hsotg)
* (micro)frame * (micro)frame
*/ */
list_move_tail(&qh->qh_list_entry, list_move_tail(&qh->qh_list_entry,
&hsotg->periodic_sched_ready); &hsotg->periodic_sched_ready);
} }
} }
tr_type = dwc2_hcd_select_transactions(hsotg); tr_type = dwc2_hcd_select_transactions(hsotg);
...@@ -442,7 +442,7 @@ static u32 dwc2_get_actual_xfer_length(struct dwc2_hsotg *hsotg, ...@@ -442,7 +442,7 @@ static u32 dwc2_get_actual_xfer_length(struct dwc2_hsotg *hsotg,
count = (hctsiz & TSIZ_XFERSIZE_MASK) >> count = (hctsiz & TSIZ_XFERSIZE_MASK) >>
TSIZ_XFERSIZE_SHIFT; TSIZ_XFERSIZE_SHIFT;
length = chan->xfer_len - count; length = chan->xfer_len - count;
if (short_read != NULL) if (short_read)
*short_read = (count != 0); *short_read = (count != 0);
} else if (chan->qh->do_split) { } else if (chan->qh->do_split) {
length = qtd->ssplit_out_xfer_count; length = qtd->ssplit_out_xfer_count;
...@@ -823,7 +823,7 @@ static void dwc2_halt_channel(struct dwc2_hsotg *hsotg, ...@@ -823,7 +823,7 @@ static void dwc2_halt_channel(struct dwc2_hsotg *hsotg,
* processed. * processed.
*/ */
list_move_tail(&chan->qh->qh_list_entry, list_move_tail(&chan->qh->qh_list_entry,
&hsotg->periodic_sched_assigned); &hsotg->periodic_sched_assigned);
/* /*
* Make sure the Periodic Tx FIFO Empty interrupt is * Make sure the Periodic Tx FIFO Empty interrupt is
...@@ -1078,7 +1078,7 @@ static void dwc2_hc_xfercomp_intr(struct dwc2_hsotg *hsotg, ...@@ -1078,7 +1078,7 @@ static void dwc2_hc_xfercomp_intr(struct dwc2_hsotg *hsotg,
dev_vdbg(hsotg->dev, " Isochronous transfer complete\n"); dev_vdbg(hsotg->dev, " Isochronous transfer complete\n");
if (qtd->isoc_split_pos == DWC2_HCSPLT_XACTPOS_ALL) if (qtd->isoc_split_pos == DWC2_HCSPLT_XACTPOS_ALL)
halt_status = dwc2_update_isoc_urb_state(hsotg, chan, halt_status = dwc2_update_isoc_urb_state(hsotg, chan,
chnum, qtd, DWC2_HC_XFER_COMPLETE); chnum, qtd, DWC2_HC_XFER_COMPLETE);
dwc2_complete_periodic_xfer(hsotg, chan, chnum, qtd, dwc2_complete_periodic_xfer(hsotg, chan, chnum, qtd,
halt_status); halt_status);
break; break;
...@@ -1369,7 +1369,7 @@ static void dwc2_hc_nyet_intr(struct dwc2_hsotg *hsotg, ...@@ -1369,7 +1369,7 @@ static void dwc2_hc_nyet_intr(struct dwc2_hsotg *hsotg,
DWC2_HC_XFER_URB_COMPLETE); DWC2_HC_XFER_URB_COMPLETE);
} else { } else {
dwc2_release_channel(hsotg, chan, qtd, dwc2_release_channel(hsotg, chan, qtd,
DWC2_HC_XFER_NO_HALT_STATUS); DWC2_HC_XFER_NO_HALT_STATUS);
} }
goto handle_nyet_done; goto handle_nyet_done;
} }
...@@ -1485,7 +1485,7 @@ static void dwc2_hc_babble_intr(struct dwc2_hsotg *hsotg, ...@@ -1485,7 +1485,7 @@ static void dwc2_hc_babble_intr(struct dwc2_hsotg *hsotg,
enum dwc2_halt_status halt_status; enum dwc2_halt_status halt_status;
halt_status = dwc2_update_isoc_urb_state(hsotg, chan, chnum, halt_status = dwc2_update_isoc_urb_state(hsotg, chan, chnum,
qtd, DWC2_HC_XFER_BABBLE_ERR); qtd, DWC2_HC_XFER_BABBLE_ERR);
dwc2_halt_channel(hsotg, chan, qtd, halt_status); dwc2_halt_channel(hsotg, chan, qtd, halt_status);
} }
...@@ -1620,7 +1620,6 @@ static void dwc2_hc_xacterr_intr(struct dwc2_hsotg *hsotg, ...@@ -1620,7 +1620,6 @@ static void dwc2_hc_xacterr_intr(struct dwc2_hsotg *hsotg,
case USB_ENDPOINT_XFER_BULK: case USB_ENDPOINT_XFER_BULK:
qtd->error_count++; qtd->error_count++;
if (!chan->qh->ping_state) { if (!chan->qh->ping_state) {
dwc2_update_urb_state_abn(hsotg, chan, chnum, qtd->urb, dwc2_update_urb_state_abn(hsotg, chan, chnum, qtd->urb,
qtd, DWC2_HC_XFER_XACT_ERR); qtd, DWC2_HC_XFER_XACT_ERR);
dwc2_hcd_save_data_toggle(hsotg, chan, chnum, qtd); dwc2_hcd_save_data_toggle(hsotg, chan, chnum, qtd);
...@@ -1645,7 +1644,7 @@ static void dwc2_hc_xacterr_intr(struct dwc2_hsotg *hsotg, ...@@ -1645,7 +1644,7 @@ static void dwc2_hc_xacterr_intr(struct dwc2_hsotg *hsotg,
enum dwc2_halt_status halt_status; enum dwc2_halt_status halt_status;
halt_status = dwc2_update_isoc_urb_state(hsotg, chan, halt_status = dwc2_update_isoc_urb_state(hsotg, chan,
chnum, qtd, DWC2_HC_XFER_XACT_ERR); chnum, qtd, DWC2_HC_XFER_XACT_ERR);
dwc2_halt_channel(hsotg, chan, qtd, halt_status); dwc2_halt_channel(hsotg, chan, qtd, halt_status);
} }
break; break;
...@@ -1680,7 +1679,7 @@ static void dwc2_hc_frmovrun_intr(struct dwc2_hsotg *hsotg, ...@@ -1680,7 +1679,7 @@ static void dwc2_hc_frmovrun_intr(struct dwc2_hsotg *hsotg,
break; break;
case USB_ENDPOINT_XFER_ISOC: case USB_ENDPOINT_XFER_ISOC:
halt_status = dwc2_update_isoc_urb_state(hsotg, chan, chnum, halt_status = dwc2_update_isoc_urb_state(hsotg, chan, chnum,
qtd, DWC2_HC_XFER_FRAME_OVERRUN); qtd, DWC2_HC_XFER_FRAME_OVERRUN);
dwc2_halt_channel(hsotg, chan, qtd, halt_status); dwc2_halt_channel(hsotg, chan, qtd, halt_status);
break; break;
} }
...@@ -1906,7 +1905,7 @@ static void dwc2_hc_chhltd_intr_dma(struct dwc2_hsotg *hsotg, ...@@ -1906,7 +1905,7 @@ static void dwc2_hc_chhltd_intr_dma(struct dwc2_hsotg *hsotg,
"%s: Halt channel %d (assume incomplete periodic transfer)\n", "%s: Halt channel %d (assume incomplete periodic transfer)\n",
__func__, chnum); __func__, chnum);
dwc2_halt_channel(hsotg, chan, qtd, dwc2_halt_channel(hsotg, chan, qtd,
DWC2_HC_XFER_PERIODIC_INCOMPLETE); DWC2_HC_XFER_PERIODIC_INCOMPLETE);
} else { } else {
dev_err(hsotg->dev, dev_err(hsotg->dev,
"%s: Channel %d - ChHltd set, but reason is unknown\n", "%s: Channel %d - ChHltd set, but reason is unknown\n",
...@@ -1970,7 +1969,7 @@ static bool dwc2_check_qtd_still_ok(struct dwc2_qtd *qtd, struct dwc2_qh *qh) ...@@ -1970,7 +1969,7 @@ static bool dwc2_check_qtd_still_ok(struct dwc2_qtd *qtd, struct dwc2_qh *qh)
{ {
struct dwc2_qtd *cur_head; struct dwc2_qtd *cur_head;
if (qh == NULL) if (!qh)
return false; return false;
cur_head = list_first_entry(&qh->qtd_list, struct dwc2_qtd, cur_head = list_first_entry(&qh->qtd_list, struct dwc2_qtd,
......
...@@ -82,8 +82,8 @@ static int dwc2_periodic_channel_available(struct dwc2_hsotg *hsotg) ...@@ -82,8 +82,8 @@ static int dwc2_periodic_channel_available(struct dwc2_hsotg *hsotg)
status = 0; status = 0;
} else { } else {
dev_dbg(hsotg->dev, dev_dbg(hsotg->dev,
"%s: Total channels: %d, Periodic: %d, " "%s: Total channels: %d, Periodic: %d, Non-periodic: %d\n",
"Non-periodic: %d\n", __func__, num_channels, __func__, num_channels,
hsotg->periodic_channels, hsotg->non_periodic_channels); hsotg->periodic_channels, hsotg->non_periodic_channels);
status = -ENOSPC; status = -ENOSPC;
} }
...@@ -485,7 +485,6 @@ static void pmap_print(unsigned long *map, int bits_per_period, ...@@ -485,7 +485,6 @@ static void pmap_print(unsigned long *map, int bits_per_period,
} }
} }
struct dwc2_qh_print_data { struct dwc2_qh_print_data {
struct dwc2_hsotg *hsotg; struct dwc2_hsotg *hsotg;
struct dwc2_qh *qh; struct dwc2_qh *qh;
...@@ -587,7 +586,7 @@ static int dwc2_ls_pmap_schedule(struct dwc2_hsotg *hsotg, struct dwc2_qh *qh, ...@@ -587,7 +586,7 @@ static int dwc2_ls_pmap_schedule(struct dwc2_hsotg *hsotg, struct dwc2_qh *qh,
unsigned long *map = dwc2_get_ls_map(hsotg, qh); unsigned long *map = dwc2_get_ls_map(hsotg, qh);
int slice; int slice;
if (map == NULL) if (!map)
return -EINVAL; return -EINVAL;
/* /*
...@@ -626,7 +625,7 @@ static void dwc2_ls_pmap_unschedule(struct dwc2_hsotg *hsotg, ...@@ -626,7 +625,7 @@ static void dwc2_ls_pmap_unschedule(struct dwc2_hsotg *hsotg,
unsigned long *map = dwc2_get_ls_map(hsotg, qh); unsigned long *map = dwc2_get_ls_map(hsotg, qh);
/* Schedule should have failed, so no worries about no error code */ /* Schedule should have failed, so no worries about no error code */
if (map == NULL) if (!map)
return; return;
pmap_unschedule(map, DWC2_LS_PERIODIC_SLICES_PER_FRAME, pmap_unschedule(map, DWC2_LS_PERIODIC_SLICES_PER_FRAME,
...@@ -1182,7 +1181,7 @@ static void dwc2_pick_first_frame(struct dwc2_hsotg *hsotg, struct dwc2_qh *qh) ...@@ -1182,7 +1181,7 @@ static void dwc2_pick_first_frame(struct dwc2_hsotg *hsotg, struct dwc2_qh *qh)
qh->start_active_frame = next_active_frame; qh->start_active_frame = next_active_frame;
dwc2_sch_vdbg(hsotg, "QH=%p First fn=%04x nxt=%04x\n", dwc2_sch_vdbg(hsotg, "QH=%p First fn=%04x nxt=%04x\n",
qh, frame_number, qh->next_active_frame); qh, frame_number, qh->next_active_frame);
} }
/** /**
...@@ -1501,7 +1500,6 @@ static void dwc2_qh_init(struct dwc2_hsotg *hsotg, struct dwc2_qh *qh, ...@@ -1501,7 +1500,6 @@ static void dwc2_qh_init(struct dwc2_hsotg *hsotg, struct dwc2_qh *qh,
device_ns += dwc_tt->usb_tt->think_time; device_ns += dwc_tt->usb_tt->think_time;
qh->device_us = NS_TO_US(device_ns); qh->device_us = NS_TO_US(device_ns);
qh->device_interval = urb->interval; qh->device_interval = urb->interval;
qh->host_interval = urb->interval * (do_split ? 8 : 1); qh->host_interval = urb->interval * (do_split ? 8 : 1);
...@@ -1587,7 +1585,7 @@ static void dwc2_qh_init(struct dwc2_hsotg *hsotg, struct dwc2_qh *qh, ...@@ -1587,7 +1585,7 @@ static void dwc2_qh_init(struct dwc2_hsotg *hsotg, struct dwc2_qh *qh,
* Return: Pointer to the newly allocated QH, or NULL on error * Return: Pointer to the newly allocated QH, or NULL on error
*/ */
struct dwc2_qh *dwc2_hcd_qh_create(struct dwc2_hsotg *hsotg, struct dwc2_qh *dwc2_hcd_qh_create(struct dwc2_hsotg *hsotg,
struct dwc2_hcd_urb *urb, struct dwc2_hcd_urb *urb,
gfp_t mem_flags) gfp_t mem_flags)
{ {
struct dwc2_qh *qh; struct dwc2_qh *qh;
...@@ -1741,7 +1739,7 @@ void dwc2_hcd_qh_unlink(struct dwc2_hsotg *hsotg, struct dwc2_qh *qh) ...@@ -1741,7 +1739,7 @@ void dwc2_hcd_qh_unlink(struct dwc2_hsotg *hsotg, struct dwc2_qh *qh)
* Return: number missed by (or 0 if we didn't miss). * Return: number missed by (or 0 if we didn't miss).
*/ */
static int dwc2_next_for_periodic_split(struct dwc2_hsotg *hsotg, static int dwc2_next_for_periodic_split(struct dwc2_hsotg *hsotg,
struct dwc2_qh *qh, u16 frame_number) struct dwc2_qh *qh, u16 frame_number)
{ {
u16 old_frame = qh->next_active_frame; u16 old_frame = qh->next_active_frame;
u16 prev_frame_number = dwc2_frame_num_dec(frame_number, 1); u16 prev_frame_number = dwc2_frame_num_dec(frame_number, 1);
...@@ -1804,7 +1802,7 @@ static int dwc2_next_for_periodic_split(struct dwc2_hsotg *hsotg, ...@@ -1804,7 +1802,7 @@ static int dwc2_next_for_periodic_split(struct dwc2_hsotg *hsotg,
* Return: number missed by (or 0 if we didn't miss). * Return: number missed by (or 0 if we didn't miss).
*/ */
static int dwc2_next_periodic_start(struct dwc2_hsotg *hsotg, static int dwc2_next_periodic_start(struct dwc2_hsotg *hsotg,
struct dwc2_qh *qh, u16 frame_number) struct dwc2_qh *qh, u16 frame_number)
{ {
int missed = 0; int missed = 0;
u16 interval = qh->host_interval; u16 interval = qh->host_interval;
...@@ -1926,7 +1924,7 @@ void dwc2_hcd_qh_deactivate(struct dwc2_hsotg *hsotg, struct dwc2_qh *qh, ...@@ -1926,7 +1924,7 @@ void dwc2_hcd_qh_deactivate(struct dwc2_hsotg *hsotg, struct dwc2_qh *qh,
missed = dwc2_next_periodic_start(hsotg, qh, frame_number); missed = dwc2_next_periodic_start(hsotg, qh, frame_number);
dwc2_sch_vdbg(hsotg, dwc2_sch_vdbg(hsotg,
"QH=%p next(%d) fn=%04x, sch=%04x=>%04x (%+d) miss=%d %s\n", "QH=%p next(%d) fn=%04x, sch=%04x=>%04x (%+d) miss=%d %s\n",
qh, sched_next_periodic_split, frame_number, old_frame, qh, sched_next_periodic_split, frame_number, old_frame,
qh->next_active_frame, qh->next_active_frame,
dwc2_frame_num_dec(qh->next_active_frame, old_frame), dwc2_frame_num_dec(qh->next_active_frame, old_frame),
......
This diff is collapsed.
...@@ -1131,27 +1131,27 @@ static void dwc2_set_parameters(struct dwc2_hsotg *hsotg, ...@@ -1131,27 +1131,27 @@ static void dwc2_set_parameters(struct dwc2_hsotg *hsotg,
dwc2_set_param_dma_desc_fs_enable(hsotg, params->dma_desc_fs_enable); dwc2_set_param_dma_desc_fs_enable(hsotg, params->dma_desc_fs_enable);
dwc2_set_param_host_support_fs_ls_low_power(hsotg, dwc2_set_param_host_support_fs_ls_low_power(hsotg,
params->host_support_fs_ls_low_power); params->host_support_fs_ls_low_power);
dwc2_set_param_enable_dynamic_fifo(hsotg, dwc2_set_param_enable_dynamic_fifo(hsotg,
params->enable_dynamic_fifo); params->enable_dynamic_fifo);
dwc2_set_param_max_transfer_size(hsotg, dwc2_set_param_max_transfer_size(hsotg,
params->max_transfer_size); params->max_transfer_size);
dwc2_set_param_max_packet_count(hsotg, dwc2_set_param_max_packet_count(hsotg,
params->max_packet_count); params->max_packet_count);
dwc2_set_param_host_channels(hsotg, params->host_channels); dwc2_set_param_host_channels(hsotg, params->host_channels);
dwc2_set_param_phy_type(hsotg, params->phy_type); dwc2_set_param_phy_type(hsotg, params->phy_type);
dwc2_set_param_speed(hsotg, params->speed); dwc2_set_param_speed(hsotg, params->speed);
dwc2_set_param_host_ls_low_power_phy_clk(hsotg, dwc2_set_param_host_ls_low_power_phy_clk(hsotg,
params->host_ls_low_power_phy_clk); params->host_ls_low_power_phy_clk);
dwc2_set_param_phy_ulpi_ddr(hsotg, params->phy_ulpi_ddr); dwc2_set_param_phy_ulpi_ddr(hsotg, params->phy_ulpi_ddr);
dwc2_set_param_phy_ulpi_ext_vbus(hsotg, dwc2_set_param_phy_ulpi_ext_vbus(hsotg,
params->phy_ulpi_ext_vbus); params->phy_ulpi_ext_vbus);
dwc2_set_param_phy_utmi_width(hsotg, params->phy_utmi_width); dwc2_set_param_phy_utmi_width(hsotg, params->phy_utmi_width);
dwc2_set_param_ulpi_fs_ls(hsotg, params->ulpi_fs_ls); dwc2_set_param_ulpi_fs_ls(hsotg, params->ulpi_fs_ls);
dwc2_set_param_ts_dline(hsotg, params->ts_dline); dwc2_set_param_ts_dline(hsotg, params->ts_dline);
dwc2_set_param_i2c_enable(hsotg, params->i2c_enable); dwc2_set_param_i2c_enable(hsotg, params->i2c_enable);
dwc2_set_param_en_multiple_tx_fifo(hsotg, dwc2_set_param_en_multiple_tx_fifo(hsotg,
params->en_multiple_tx_fifo); params->en_multiple_tx_fifo);
dwc2_set_param_reload_ctl(hsotg, params->reload_ctl); dwc2_set_param_reload_ctl(hsotg, params->reload_ctl);
dwc2_set_param_ahbcfg(hsotg, params->ahbcfg); dwc2_set_param_ahbcfg(hsotg, params->ahbcfg);
dwc2_set_param_otg_ver(hsotg, params->otg_ver); dwc2_set_param_otg_ver(hsotg, params->otg_ver);
......
...@@ -87,7 +87,7 @@ static void dwc2_pci_remove(struct pci_dev *pci) ...@@ -87,7 +87,7 @@ static void dwc2_pci_remove(struct pci_dev *pci)
} }
static int dwc2_pci_probe(struct pci_dev *pci, static int dwc2_pci_probe(struct pci_dev *pci,
const struct pci_device_id *id) const struct pci_device_id *id)
{ {
struct resource res[2]; struct resource res[2];
struct platform_device *dwc2; struct platform_device *dwc2;
......
...@@ -111,7 +111,7 @@ static int dwc2_get_dr_mode(struct dwc2_hsotg *hsotg) ...@@ -111,7 +111,7 @@ static int dwc2_get_dr_mode(struct dwc2_hsotg *hsotg)
if (mode != hsotg->dr_mode) { if (mode != hsotg->dr_mode) {
dev_warn(hsotg->dev, dev_warn(hsotg->dev,
"Configuration mismatch. dr_mode forced to %s\n", "Configuration mismatch. dr_mode forced to %s\n",
mode == USB_DR_MODE_HOST ? "host" : "device"); mode == USB_DR_MODE_HOST ? "host" : "device");
hsotg->dr_mode = mode; hsotg->dr_mode = mode;
......
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