Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 79c54bc7 authored by Ajay Agarwal's avatar Ajay Agarwal Committed by Gerrit - the friendly Code Review server
Browse files

usb: gadget: Fix ci13xxx compilation issues



This change fixes the various compilation issues
present in ci13xxx gadget drivers.

Change-Id: Id06020ba2334fefa146b6182f9bbcafb8df24223
Signed-off-by: default avatarAjay Agarwal <ajaya@codeaurora.org>
parent 502a0b9a
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -125,9 +125,9 @@ static void ci13xxx_msm_connect(void)
			ULPI_MISC_A_VBUSVLDEXTSEL,
			ULPI_SET(ULPI_MISC_A));

		temp = readl_relaxed(USB_GENCONFIG2);
		temp |= GENCFG2_SESS_VLD_CTRL_EN;
		writel_relaxed(temp, USB_GENCONFIG2);
		temp = readl_relaxed(USB_GENCONFIG_2);
		temp |= GENCONFIG_2_SESS_VLD_CTRL_EN;
		writel_relaxed(temp, USB_GENCONFIG_2);

		temp = readl_relaxed(USB_USBCMD);
		temp |= USBCMD_SESS_VLD_CTRL;
@@ -229,7 +229,6 @@ static void ci13xxx_msm_notify_event(struct ci13xxx *udc, unsigned int event)
	case CI13XXX_CONTROLLER_UDC_STARTED_EVENT:
		dev_info(dev,
			 "CI13XXX_CONTROLLER_UDC_STARTED_EVENT received\n");
		udc->gadget.interrupt_num = _udc_ctxt.irq;
		break;
	default:
		dev_dbg(dev, "unknown ci13xxx_udc event\n");
+2 −16
Original line number Diff line number Diff line
@@ -2357,7 +2357,6 @@ static int _gadget_stop_activity(struct usb_gadget *gadget)
	udc->configured = 0;
	spin_unlock_irqrestore(udc->lock, flags);

	gadget->xfer_isr_count = 0;
	udc->driver->disconnect(gadget);

	spin_lock_irqsave(udc->lock, flags);
@@ -3552,8 +3551,7 @@ static int ci13xxx_pullup(struct usb_gadget *_gadget, int is_active)

static int ci13xxx_start(struct usb_gadget *gadget,
			 struct usb_gadget_driver *driver);
static int ci13xxx_stop(struct usb_gadget *gadget,
			struct usb_gadget_driver *driver);
static int ci13xxx_stop(struct usb_gadget *gadget);

/**
 * Device operations part of the API to the USB controller hardware,
@@ -3665,21 +3663,11 @@ static int ci13xxx_start(struct usb_gadget *gadget,
 *
 * Check usb_gadget_unregister_driver() at "usb_gadget.h" for details
 */
static int ci13xxx_stop(struct usb_gadget *gadget,
			struct usb_gadget_driver *driver)
static int ci13xxx_stop(struct usb_gadget *gadget)
{
	struct ci13xxx *udc = _udc;
	unsigned long flags;

	trace("%pK", driver);

	if (driver             == NULL ||
	    driver->unbind     == NULL ||
	    driver->setup      == NULL ||
	    driver->disconnect == NULL ||
	    driver             != udc->driver)
		return -EINVAL;

	spin_lock_irqsave(udc->lock, flags);

	if (!(udc->udc_driver->flags & CI13XXX_PULLUP_ON_VBUS) ||
@@ -3756,7 +3744,6 @@ static irqreturn_t udc_irq(void)
			isr_statistics.uei++;
		if (USBi_UI  & intr) {
			isr_statistics.ui++;
			udc->gadget.xfer_isr_count++;
			isr_tr_complete_handler(udc);
		}
		if (USBi_SLI & intr) {
@@ -3894,7 +3881,6 @@ static int udc_probe(struct ci13xxx_udc_driver *driver, struct device *dev,

	pdata = dev->platform_data;
	if (pdata) {
		udc->gadget.usb_core_id = pdata->usb_core_id;
		if (pdata->enable_axi_prefetch)
			udc->gadget.extra_buf_alloc = EXTRA_ALLOCATION_SIZE;
	}
+6 −0
Original line number Diff line number Diff line
@@ -468,6 +468,9 @@ struct usb_gadget_ops {
 * @deactivated: True if gadget is deactivated - in deactivated state it cannot
 *	be connected.
 * @connected: True if gadget is connected.
 * @bam2bam_func_enabled; Indicates function using bam2bam is enabled or not.
 * @extra_buf_alloc: Extra allocation size for AXI prefetch so that out of
 * boundary access is protected.
 *
 * Gadgets have a mostly-portable "gadget driver" implementing device
 * functions, handling all usb configurations and interfaces.  Gadget
@@ -521,6 +524,9 @@ struct usb_gadget {
	unsigned			deactivated:1;
	unsigned			connected:1;
	bool				remote_wakeup;
	bool				bam2bam_func_enabled;
	u32				extra_buf_alloc;
	bool				l1_supported;
};
#define work_to_gadget(w)	(container_of((w), struct usb_gadget, work))

+14 −0
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@

#define USB_AHBBURST         (MSM_USB_BASE + 0x0090)
#define USB_AHBMODE          (MSM_USB_BASE + 0x0098)
#define USB_GENCONFIG        (MSM_USB_BASE + 0x009C)
#define USB_GENCONFIG_2      (MSM_USB_BASE + 0x00a0)
#define ULPI_TX_PKT_EN_CLR_FIX	BIT(19)

@@ -39,6 +40,15 @@
#define USBCMD_RESET   2
#define USB_USBINTR          (MSM_USB_BASE + 0x0148)

#define USB_L1_EP_CTRL       (MSM_USB_BASE + 0x0250)
#define USB_L1_CONFIG        (MSM_USB_BASE + 0x0254)

#define L1_CONFIG_LPM_EN        BIT(4)
#define L1_CONFIG_REMOTE_WAKEUP BIT(5)
#define L1_CONFIG_GATE_SYS_CLK	BIT(7)
#define L1_CONFIG_PHY_LPM	BIT(10)
#define L1_CONFIG_PLL		BIT(11)

#define PORTSC_PHCD            (1 << 23) /* phy suspend mode */
#define PORTSC_PTS_MASK        (3 << 30)
#define PORTSC_PTS_ULPI        (2 << 30)
@@ -52,6 +62,10 @@
#define ULPI_DATA(n)          ((n) & 255)
#define ULPI_DATA_READ(n)     (((n) >> 8) & 255)

#define GENCONFIG_BAM_DISABLE (1 << 13)
#define GENCONFIG_TXFIFO_IDLE_FORCE_DISABLE (1 << 4)
#define GENCONFIG_ULPI_SERIAL_EN (1 << 5)

/* synopsys 28nm phy registers */
#define ULPI_PWR_CLK_MNG_REG	0x88
#define OTG_COMP_DISABLE	BIT(0)