Hi Here we go (again), hopefully with all withespace preserved. checkpatch gave no errors on my side. Regards Tim Signed-off-by: Tim Sander <tim.sander@xxxxxxx> add ocpol and polarity flags to mx31 mx35 diff --git a/arch/arm/plat-mxc/ehci.c b/arch/arm/plat-mxc/ehci.c index 82808c6..0862933 100644 --- a/arch/arm/plat-mxc/ehci.c +++ b/arch/arm/plat-mxc/ehci.c @@ -38,6 +38,8 @@ #define MX35_OTG_SIC_SHIFT 29 #define MX35_OTG_SIC_MASK (0x3 << MX35_OTG_SIC_SHIFT) #define MX35_OTG_PM_BIT (1 << 24) +#define MX35_OTG_PP_HIGH (1 << 11) +#define MX35_OTG_OCPOL (1 << 3) #define MX35_H1_SIC_SHIFT 21 #define MX35_H1_SIC_MASK (0x3 << MX35_H1_SIC_SHIFT) @@ -47,6 +49,7 @@ #define MX35_H1_IPPUE_DOWN_BIT (1 << 6) #define MX35_H1_TLL_BIT (1 << 5) #define MX35_H1_USBTE_BIT (1 << 4) +#define MX35_H1_OCPOL (1 << 3) #define MXC_OTG_OFFSET 0 #define MXC_H1_OFFSET 0x200 @@ -168,9 +171,16 @@ int mxc_initialize_usb_hw(int port, unsigned int flags) v &= ~(MX35_OTG_SIC_MASK | MX35_OTG_PM_BIT); v |= (flags & MXC_EHCI_INTERFACE_MASK) << MX35_OTG_SIC_SHIFT; + v |= MX35_OTG_OCPOL; + if (!(flags & MXC_EHCI_POWER_PINS_ENABLED)) v |= MX35_OTG_PM_BIT; + if (flags & MXC_EHCI_POWER_OCPOL_LOW) + v &= ~MX35_OTG_OCPOL; + + if (flags & MXC_EHCI_PP_HIGH) + v |= MX35_OTG_PP_HIGH; break; case 1: /* H1 port */ v &= ~(MX35_H1_SIC_MASK | MX35_H1_PM_BIT | MX35_H1_TLL_BIT | @@ -178,6 +188,7 @@ int mxc_initialize_usb_hw(int port, unsigned int flags) MX35_H1_IPPUE_UP_BIT | MX35_H1_PP_BIT); v |= (flags & MXC_EHCI_INTERFACE_MASK) << MX35_H1_SIC_SHIFT; + v |= MX35_H1_OCPOL; if (!(flags & MXC_EHCI_POWER_PINS_ENABLED)) v |= MX35_H1_PM_BIT; @@ -197,6 +208,8 @@ int mxc_initialize_usb_hw(int port, unsigned int flags) if (flags & MXC_EHCI_POLARITY_HIGH) v |= MX35_H1_PP_BIT; + if (flags & MXC_EHCI_POWER_OCPOL_LOW) + v |= MX35_H1_OCPOL; break; default: return -EINVAL; diff --git a/arch/arm/plat-mxc/include/mach/mxc_ehci.h b/arch/arm/plat-mxc/include/mach/mxc_ehci.h index e829031..2de1fe7 100644 --- a/arch/arm/plat-mxc/include/mach/mxc_ehci.h +++ b/arch/arm/plat-mxc/include/mach/mxc_ehci.h @@ -19,6 +19,7 @@ #define MXC_EHCI_INTERFACE_SINGLE_BI (3 << 0) #define MXC_EHCI_INTERFACE_MASK (0xf) +#define MXC_EHCI_POWER_OCPOL_LOW (1 << 3) #define MXC_EHCI_POWER_PINS_ENABLED (1 << 5) #define MXC_EHCI_TTL_ENABLED (1 << 6) @@ -27,6 +28,7 @@ #define MXC_EHCI_IPPUE_UP (1 << 9) #define MXC_EHCI_WAKEUP_ENABLED (1 << 10) #define MXC_EHCI_ITC_NO_THRESHOLD (1 << 11) +#define MXC_EHCI_PP_HIGH (1 << 12) #define MXC_EHCI_POLARITY_HIGH (1 << 18) #define MXC_USBCTRL_OFFSET 0 -- 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