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

Commit ebcedaf8 authored by Jack Pham's avatar Jack Pham Committed by Azhar Shaikh
Browse files

usb: dwc3: msm: Remove last of dwc3_otg



The usb_phy structure embedded in dwc3_otg was only needed
to keep track of the host/peripheral states. Add a state
variable to dwc3_msm for the same effect.
The dwc3->dotg pointer is really indicating whether or not
device supports dual-role, so replace it with a simple boolean,
and remove the dwc3_otg_init/exit() functions.
Now we can finally remove what's left of dwc3_otg.h entirely.

Change-Id: Iee86503b876cc8912c9bbacbf778ea398ed7ec20
Signed-off-by: default avatarJack Pham <jackp@codeaurora.org>
Signed-off-by: default avatarAzhar Shaikh <azhars@codeaurora.org>
parent b099f39b
Loading
Loading
Loading
Loading
+1 −8
Original line number Diff line number Diff line
@@ -706,16 +706,11 @@ static int dwc3_core_init_mode(struct dwc3 *dwc)
		break;
	case USB_DR_MODE_OTG:
		dwc3_set_mode(dwc, DWC3_GCTL_PRTCAP_OTG);
		ret = dwc3_otg_init(dwc);
		if (ret) {
			dev_err(dev, "failed to initialize otg\n");
			return ret;
		}
		dwc->is_drd = true;

		ret = dwc3_host_init(dwc);
		if (ret) {
			dev_err(dev, "failed to initialize host\n");
			dwc3_otg_exit(dwc);
			return ret;
		}

@@ -723,7 +718,6 @@ static int dwc3_core_init_mode(struct dwc3 *dwc)
		if (ret) {
			dev_err(dev, "failed to initialize gadget\n");
			dwc3_host_exit(dwc);
			dwc3_otg_exit(dwc);
			return ret;
		}
		break;
@@ -747,7 +741,6 @@ static void dwc3_core_exit_mode(struct dwc3 *dwc)
	case USB_DR_MODE_OTG:
		dwc3_gadget_exit(dwc);
		dwc3_host_exit(dwc);
		dwc3_otg_exit(dwc);
		break;
	default:
		/* do nothing */
+2 −6
Original line number Diff line number Diff line
@@ -35,8 +35,6 @@

#include <linux/phy/phy.h>

#include "dwc3_otg.h"

#define DWC3_MSG_MAX	500

/* Global constants */
@@ -796,6 +794,7 @@ struct dwc3_scratchpad_array {
 * @setup_packet_pending: true when there's a Setup Packet in FIFO. Workaround
 * @start_config_issued: true when StartConfig command has been issued
 * @three_stage_setup: set if we perform a three phase setup
 * @is_drd: device supports dual-role or not
 * @err_evt_seen: previous event in queue was erratic error
 * @usb3_u1u2_disable: if true, disable U1U2 low power modes in Superspeed mode.
 * @hird_thresh: value to configure in DCTL[HIRD_Thresh]
@@ -827,7 +826,6 @@ struct dwc3 {

	struct device		*dev;

	struct dwc3_otg		*dotg;
	struct platform_device	*xhci;
	struct resource		xhci_resources[DWC3_XHCI_RESOURCES_NUM];

@@ -918,6 +916,7 @@ struct dwc3 {
	unsigned		setup_packet_pending:1;
	unsigned		start_config_issued:1;
	unsigned		three_stage_setup:1;
	unsigned		is_drd:1;

	/* Indicate if the gadget was powered by the otg driver */
	unsigned		vbus_active:1;
@@ -1105,9 +1104,6 @@ struct dwc3_gadget_ep_cmd_params {
void dwc3_set_mode(struct dwc3 *dwc, u32 mode);
int dwc3_gadget_resize_tx_fifos(struct dwc3 *dwc);

int dwc3_otg_init(struct dwc3 *dwc);
void dwc3_otg_exit(struct dwc3 *dwc);

#if IS_ENABLED(CONFIG_USB_DWC3_HOST) || IS_ENABLED(CONFIG_USB_DWC3_DUAL_ROLE)
int dwc3_host_init(struct dwc3 *dwc);
void dwc3_host_exit(struct dwc3 *dwc);
+126 −217

File changed.

Preview size limit exceeded, changes collapsed.

drivers/usb/dwc3/dwc3_otg.h

deleted100644 → 0
+0 −31
Original line number Diff line number Diff line
/**
 * dwc3_otg.h - DesignWare USB3 DRD Controller OTG
 *
 * Copyright (c) 2012-2015, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
 * only version 2 as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 */

#ifndef __LINUX_USB_DWC3_OTG_H
#define __LINUX_USB_DWC3_OTG_H

#include <linux/usb/otg.h>

/**
 * struct dwc3_otg: OTG driver data. Shared by HCD and DCD.
 * @otg: USB OTG Transceiver structure.
 */
struct dwc3_otg {
	struct usb_otg		otg;
	struct dwc3		*dwc;
};


#endif /* __LINUX_USB_DWC3_OTG_H */
+5 −17

File changed.

Preview size limit exceeded, changes collapsed.

Loading