USB: OHCI-HCD: Support for LPC32xx
Subsystems (4)
v8 cover USB: OHCI-HCD: Support for LPC32xx
These patches add support for the LPC32xx to the ohci-pnx4008 driver and make the driver use smbus functions.
As discussed with Greg-KH on the USB mailing list, the ohci-pnx4008 driver is first renamed to reflect its multi-platform support. The second patch also renames the respective pnx4008_* symbols accordingly.
The third patch adds the actual lpc32xx support.
The fourth patch removes the re-coded i2c_write() by using an existing smbus function. You can leave out this very single patch to still have the desired LPC32xx support. It just fixes existing kernel code to only use smbus calls in this driver.
Applies to v3.3-rc7
Changes since v7:
* Removed pnx4008 filename reference
* Rename via git format-patch -M
Thanks to Arnd Bergmann and Wolfram Sang for reviewing!
---
Roland Stigge (4):
USB: OHCI-HCD: Rename ohci-pnx4008 to ohci-nxp
USB: ohci-nxp: Rename symbols from pnx4008 to nxp
USB: ohci-nxp: Support for LPC32xx
USB: ohci-nxp: Remove i2c_write(), use smbus
Documentation/i2c/instantiating-devices | 6 +-
drivers/usb/host/ohci-hcd.c | 6 +-
drivers/usb/host/{ohci-pnx4008.c => ohci-nxp.c} | 253 +++++++++++++++--------
3 files changed, 170 insertions(+), 95 deletions(-)
rename drivers/usb/host/{ohci-pnx4008.c => ohci-nxp.c} (57%)Signature · 1 line
1.7.9
PATCH v8 1/4 USB: OHCI-HCD: Rename ohci-pnx4008 to ohci-nxp
Since this driver is compatible with several NXP devices, the driver is renamed accordingly. Please combine with the following patch which also changes the respective symbol names.
---
drivers/usb/host/ohci-hcd.c | 2 +-
drivers/usb/host/{ohci-pnx4008.c => ohci-nxp.c} | 0
2 files changed, 1 insertions(+), 1 deletions(-)
rename drivers/usb/host/{ohci-pnx4008.c => ohci-nxp.c} (100%)drivers/usb/host/ohci-hcd.c +1 -1
@@ -1051,7 +1051,7 @@ MODULE_LICENSE ("GPL");#endif #ifdef CONFIG_ARCH_PNX4008 -#include "ohci-pnx4008.c" +#include "ohci-nxp.c" #define PLATFORM_DRIVER usb_hcd_pnx4008_driver#endif
drivers/usb/host/ohci-nxp.c renamed from drivers/usb/host/ohci-pnx4008.c +0 -0
Signature · 1 line
1.7.9
PATCH v8 2/4 USB: ohci-nxp: Rename symbols from pnx4008 to nxp
In reply to Roland StiggeSince this driver is compatible with several NXP devices, the driver was renamed accordingly. This patch also changes the respective symbol names.
--- Documentation/i2c/instantiating-devices | 6 ++-- drivers/usb/host/ohci-hcd.c | 2 +- drivers/usb/host/ohci-nxp.c | 53 ++++++++++++++++--------------- 3 files changed, 31 insertions(+), 30 deletions(-)
Documentation/i2c/instantiating-devices +3 -3
@@ -87,11 +87,11 @@ it may have different addresses from one board to the next (manufacturer changing its design without notice). In this case, you can call i2c_new_probed_device() instead of i2c_new_device(). -Example (from the pnx4008 OHCI driver): +Example (from the nxp OHCI driver): static const unsigned short normal_i2c[] = { 0x2c, 0x2d, I2C_CLIENT_END }; -static int __devinit usb_hcd_pnx4008_probe(struct platform_device *pdev) +static int __devinit usb_hcd_nxp_probe(struct platform_device *pdev) { (...) struct i2c_adapter *i2c_adap;
@@ -100,7 +100,7 @@ static int __devinit usb_hcd_pnx4008_probe(struct platform_device *pdev) (...) i2c_adap = i2c_get_adapter(2); memset(&i2c_info, 0, sizeof(struct i2c_board_info)); - strlcpy(i2c_info.type, "isp1301_pnx", I2C_NAME_SIZE); + strlcpy(i2c_info.type, "isp1301_nxp", I2C_NAME_SIZE); isp1301_i2c_client = i2c_new_probed_device(i2c_adap, &i2c_info, normal_i2c, NULL); i2c_put_adapter(i2c_adap);
drivers/usb/host/ohci-hcd.c +1 -1
@@ -1052,7 +1052,7 @@ MODULE_LICENSE ("GPL");#ifdef CONFIG_ARCH_PNX4008 #include "ohci-nxp.c" -#define PLATFORM_DRIVER usb_hcd_pnx4008_driver +#define PLATFORM_DRIVER usb_hcd_nxp_driver#endif #ifdef CONFIG_ARCH_DAVINCI_DA8XX
drivers/usb/host/ohci-nxp.c +27 -26
172 lines not on this page · raw message
Signature · 1 line
1.7.9
PATCH v8 3/4 USB: ohci-nxp: Support for LPC32xx
In reply to Roland StiggeThis patch adds support for the LPC32xx to ohci-nxp
--- drivers/usb/host/ohci-hcd.c | 2 +- drivers/usb/host/ohci-nxp.c | 142 ++++++++++++++++++++++++++++++++---------- 2 files changed, 109 insertions(+), 35 deletions(-)
drivers/usb/host/ohci-hcd.c +1 -1
@@ -1050,7 +1050,7 @@ MODULE_LICENSE ("GPL");#define PLATFORM_DRIVER ohci_hcd_at91_driver#endif -#ifdef CONFIG_ARCH_PNX4008 +#if defined(CONFIG_ARCH_PNX4008 ) || defined(CONFIG_ARCH_LPC32XX )#include "ohci-nxp.c" #define PLATFORM_DRIVER usb_hcd_nxp_driver#endif
drivers/usb/host/ohci-nxp.c +108 -34
200 lines not on this page · raw message
Signature · 1 line
1.7.9
PATCH v8 4/4 USB: ohci-nxp: Remove i2c_write(), use smbus
In reply to Roland StiggeThis patch removes the re-coded i2c_write function from the ohci-nxp driver in favour of using just smbus functions.
--- drivers/usb/host/ohci-nxp.c | 58 +++++++++++++++++++++--------------------- 1 files changed, 29 insertions(+), 29 deletions(-)
drivers/usb/host/ohci-nxp.c +29 -29
@@ -149,38 +149,36 @@ static struct i2c_driver isp1301_driver = { .id_table = isp1301_id, }; -static void i2c_write (u8 buf,u8 subaddr) -{ -char tmpbuf[2 ]; - - tmpbuf[0 ] = subaddr;/*register number */ - tmpbuf[1 ] = buf;/*register data */ -i2c_master_send (isp1301_i2c_client, &tmpbuf[0 ],2 ); -} -static void isp1301_configure_pnx4008 (void ) {/* PNX4008 only supports DAT_SE0 USB mode */ /* PNX4008 R2A requires setting the MAX603 to output 3.6V */ /* Power up externel charge-pump */ -i2c_write (MC1_DAT_SE0 |MC1_SPEED_REG ,ISP1301_I2C_MODE_CONTROL_1 ); -i2c_write (~(MC1_DAT_SE0 |MC1_SPEED_REG ), -ISP1301_I2C_MODE_CONTROL_1 |ISP1301_I2C_REG_CLEAR_ADDR ); -i2c_write (MC2_BI_DI |MC2_PSW_EN |MC2_SPD_SUSP_CTRL , -ISP1301_I2C_MODE_CONTROL_2 ); -i2c_write (~(MC2_BI_DI |MC2_PSW_EN |MC2_SPD_SUSP_CTRL ), -ISP1301_I2C_MODE_CONTROL_2 |ISP1301_I2C_REG_CLEAR_ADDR ); -i2c_write (OTG1_DM_PULLDOWN |OTG1_DP_PULLDOWN , -ISP1301_I2C_OTG_CONTROL_1 ); -i2c_write (~(OTG1_DM_PULLDOWN |OTG1_DP_PULLDOWN ), -ISP1301_I2C_OTG_CONTROL_1 |ISP1301_I2C_REG_CLEAR_ADDR ); -i2c_write (0xFF , -ISP1301_I2C_INTERRUPT_LATCH |ISP1301_I2C_REG_CLEAR_ADDR ); -i2c_write (0xFF , -ISP1301_I2C_INTERRUPT_FALLING |ISP1301_I2C_REG_CLEAR_ADDR ); -i2c_write (0xFF , -ISP1301_I2C_INTERRUPT_RISING |ISP1301_I2C_REG_CLEAR_ADDR ); +i2c_smbus_write_byte_data (isp1301_i2c_client, +ISP1301_I2C_MODE_CONTROL_1 ,MC1_DAT_SE0 |MC1_SPEED_REG ); +i2c_smbus_write_byte_data (isp1301_i2c_client, +ISP1301_I2C_MODE_CONTROL_1 |ISP1301_I2C_REG_CLEAR_ADDR , + ~(MC1_DAT_SE0 |MC1_SPEED_REG )); +i2c_smbus_write_byte_data (isp1301_i2c_client, +ISP1301_I2C_MODE_CONTROL_2 , +MC2_BI_DI |MC2_PSW_EN |MC2_SPD_SUSP_CTRL ); +i2c_smbus_write_byte_data (isp1301_i2c_client, +ISP1301_I2C_MODE_CONTROL_2 |ISP1301_I2C_REG_CLEAR_ADDR , + ~(MC2_BI_DI |MC2_PSW_EN |MC2_SPD_SUSP_CTRL )); +i2c_smbus_write_byte_data (isp1301_i2c_client, +ISP1301_I2C_OTG_CONTROL_1 ,OTG1_DM_PULLDOWN |OTG1_DP_PULLDOWN ); +i2c_smbus_write_byte_data (isp1301_i2c_client, +ISP1301_I2C_OTG_CONTROL_1 |ISP1301_I2C_REG_CLEAR_ADDR , + ~(OTG1_DM_PULLDOWN |OTG1_DP_PULLDOWN )); +i2c_smbus_write_byte_data (isp1301_i2c_client, +ISP1301_I2C_INTERRUPT_LATCH |ISP1301_I2C_REG_CLEAR_ADDR ,0xFF ); +i2c_smbus_write_byte_data (isp1301_i2c_client, +ISP1301_I2C_INTERRUPT_FALLING |ISP1301_I2C_REG_CLEAR_ADDR , +0xFF ); +i2c_smbus_write_byte_data (isp1301_i2c_client, +ISP1301_I2C_INTERRUPT_RISING |ISP1301_I2C_REG_CLEAR_ADDR , +0xFF ); }static void isp1301_configure_lpc32xx (void )
@@ -242,13 +240,15 @@ static void isp1301_configure(void)static inline void isp1301_vbus_on (void ) { -i2c_write (OTG1_VBUS_DRV ,ISP1301_I2C_OTG_CONTROL_1 ); +i2c_smbus_write_byte_data (isp1301_i2c_client,ISP1301_I2C_OTG_CONTROL_1 , +OTG1_VBUS_DRV ); }static inline void isp1301_vbus_off (void ) { -i2c_write (OTG1_VBUS_DRV , -ISP1301_I2C_OTG_CONTROL_1 |ISP1301_I2C_REG_CLEAR_ADDR ); +i2c_smbus_write_byte_data (isp1301_i2c_client, +ISP1301_I2C_OTG_CONTROL_1 |ISP1301_I2C_REG_CLEAR_ADDR , +OTG1_VBUS_DRV ); }static void nxp_start_hc (void )
Signature · 1 line
1.7.9
Quoted 16 lines · Roland Stigge
These patches add support for the LPC32xx to the ohci-pnx4008 driver and make the driver use smbus functions.
As discussed with Greg-KH on the USB mailing list, the ohci-pnx4008 driver is first renamed to reflect its multi-platform support. The second patch also renames the respective pnx4008_* symbols accordingly.
The third patch adds the actual lpc32xx support.
The fourth patch removes the re-coded
i2c_write()by using an existing smbus function. You can leave out this very single patch to still have the desired LPC32xx support. It just fixes existing kernel code to only use smbus calls in this driver.Applies to v3.3-rc7
Quoted 8 lines
Changes since v7:
* Removed pnx4008 filename reference
* Rename via git format-patch -MThanks to Arnd Bergmann and Wolfram Sang for reviewing!
Signed-off-by Roland Stigge <[email protected]>