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

Commit 9ad96e69 authored by Daniel Mack's avatar Daniel Mack Committed by Felipe Balbi
Browse files

usb: musb: re-introduce musb->port_mode



Define MUSB_PORT_MODE_{HOST,GADGET,DUAL_ROLE} and store the
platform-specified value in struct musb.

Note that MUSB_PORT_MODE_HOST has to be set to 1 in order to match
existing device tree bindings which are already documented but in fact
unusued. For information on the bindings, please refer to

  Documentation/devicetree/bindings/usb/omap-usb.txt
  Documentation/devicetree/bindings/usb/am33xx-usb.txt

Signed-off-by: default avatarDaniel Mack <zonque@gmail.com>
Acked-by: default avatarPeter Korsgaard <jacmet@sunsite.dk>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent 2cc65fea
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -1813,6 +1813,7 @@ musb_init_controller(struct device *dev, int nIrq, void __iomem *ctrl)
	musb->board_set_power = plat->set_power;
	musb->board_set_power = plat->set_power;
	musb->min_power = plat->min_power;
	musb->min_power = plat->min_power;
	musb->ops = plat->platform_ops;
	musb->ops = plat->platform_ops;
	musb->port_mode = plat->mode;


	/* The musb_platform_init() call:
	/* The musb_platform_init() call:
	 *   - adjusts musb->mregs
	 *   - adjusts musb->mregs
+7 −0
Original line number Original line Diff line number Diff line
@@ -77,6 +77,12 @@ struct musb_ep;
#define is_peripheral_active(m)		(!(m)->is_host)
#define is_peripheral_active(m)		(!(m)->is_host)
#define is_host_active(m)		((m)->is_host)
#define is_host_active(m)		((m)->is_host)


enum {
	MUSB_PORT_MODE_HOST	= 1,
	MUSB_PORT_MODE_GADGET,
	MUSB_PORT_MODE_DUAL_ROLE,
};

#ifdef CONFIG_PROC_FS
#ifdef CONFIG_PROC_FS
#include <linux/fs.h>
#include <linux/fs.h>
#define MUSB_CONFIG_PROC_FS
#define MUSB_CONFIG_PROC_FS
@@ -356,6 +362,7 @@ struct musb {


	u8			min_power;	/* vbus for periph, in mA/2 */
	u8			min_power;	/* vbus for periph, in mA/2 */


	int			port_mode;	/* MUSB_PORT_MODE_* */
	bool			is_host;
	bool			is_host;


	int			a_wait_bcon;	/* VBUS timeout in msecs */
	int			a_wait_bcon;	/* VBUS timeout in msecs */