>>>>> "Daniel" == Daniel Mack <zonque@xxxxxxxxx> writes: Daniel> Define MUSB_PORT_MODE_{HOST,GADGET,DUAL_ROLE} and store the Daniel> platform-specified value in struct musb. Daniel> Note that MUSB_PORT_MODE_HOST has to be set to 1 in order to Daniel> match existing device tree bindings which are already Daniel> documented but in fact unusued. Daniel> Signed-off-by: Daniel Mack <zonque@xxxxxxxxx> It would have been nice to add an explicit reference to am33xx-usb.txt / omap-usb.txt for the bindings, but that's minor (should those files be combined?) Acked-by: Peter Korsgaard <jacmet@xxxxxxxxxx> Daniel> --- Daniel> drivers/usb/musb/musb_core.c | 1 + Daniel> drivers/usb/musb/musb_core.h | 7 +++++++ Daniel> 2 files changed, 8 insertions(+) Daniel> diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c Daniel> index fbcf5cb..2640d25 100644 Daniel> --- a/drivers/usb/musb/musb_core.c Daniel> +++ b/drivers/usb/musb/musb_core.c Daniel> @@ -1821,6 +1821,7 @@ musb_init_controller(struct device *dev, int nIrq, void __iomem *ctrl) musb-> board_set_power = plat->set_power; musb-> min_power = plat->min_power; musb-> ops = plat->platform_ops; Daniel> + musb->port_mode = plat->mode; Daniel> /* The musb_platform_init() call: Daniel> * - adjusts musb->mregs Daniel> diff --git a/drivers/usb/musb/musb_core.h b/drivers/usb/musb/musb_core.h Daniel> index 6b65847..174c097 100644 Daniel> --- a/drivers/usb/musb/musb_core.h Daniel> +++ b/drivers/usb/musb/musb_core.h Daniel> @@ -77,6 +77,12 @@ struct musb_ep; Daniel> #define is_peripheral_active(m) (!(m)->is_host) Daniel> #define is_host_active(m) ((m)->is_host) Daniel> +enum { Daniel> + MUSB_PORT_MODE_HOST = 1, Daniel> + MUSB_PORT_MODE_GADGET, Daniel> + MUSB_PORT_MODE_DUAL_ROLE, Daniel> +}; Daniel> + Daniel> #ifdef CONFIG_PROC_FS Daniel> #include <linux/fs.h> Daniel> #define MUSB_CONFIG_PROC_FS Daniel> @@ -356,6 +362,7 @@ struct musb { Daniel> u8 min_power; /* vbus for periph, in mA/2 */ Daniel> + int port_mode; /* MUSB_PORT_MODE_* */ Daniel> bool is_host; Daniel> int a_wait_bcon; /* VBUS timeout in msecs */ Daniel> -- Daniel> 1.8.1.4 -- Bye, Peter Korsgaard -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html