USB: EHCI: Add registers support for SMSC hsic hub
Add SMSC hub registers that can be changed over I2C bus
for changing the default configuration.
Change-Id: Ib1cd158fdd3c3f58d7211428984ca424563c4f14
Signed-off-by: Vijayavardhan Vennapusa <vvreddy@codeaurora.org>
diff --git a/drivers/misc/smsc_hub.c b/drivers/misc/smsc_hub.c
index d3304eb..9232f67 100644
--- a/drivers/misc/smsc_hub.c
+++ b/drivers/misc/smsc_hub.c
@@ -110,6 +110,22 @@
I2C_FUNC_SMBUS_WORD_DATA))
return -EIO;
+ /* CONFIG_N bit in SP_ILOCK register has to be set before changing
+ * other registers to change default configuration of hsic hub.
+ */
+ hsic_hub_set_bits(client, SMSC3503_SP_ILOCK, CONFIG_N);
+
+ /* Can change default configuartion like VID,PID, strings etc
+ * by writing new values to hsic hub registers.
+ */
+ hsic_hub_write_word_data(client, SMSC3503_VENDORID, 0x05C6);
+
+ /* CONFIG_N bit in SP_ILOCK register has to be cleared for new
+ * values in registers to be effective after writing to
+ * other registers.
+ */
+ hsic_hub_clear_bits(client, SMSC3503_SP_ILOCK, CONFIG_N);
+
return 0;
}
diff --git a/include/linux/smsc3503.h b/include/linux/smsc3503.h
index 8153da1..66ba003 100644
--- a/include/linux/smsc3503.h
+++ b/include/linux/smsc3503.h
@@ -14,6 +14,33 @@
#ifndef __LINUX_SMSC3503_H__
#define __LINUX_SMSC3503_H__
+/*Serial interface Registers*/
+#define SMSC3503_VENDORID 0x00 /*u16 read*/
+#define SMSC3503_PRODUCTID 0x02 /*u16 read*/
+#define SMSC3503_DEVICEID 0x04 /*u16 read*/
+
+#define SMSC3503_CONFIG_BYTE_1 0x06 /*u8 read*/
+#define PORT_PWR (1<<0)
+#define EOP_DISABLE (1<<3)
+#define MTT_ENABLE (1<<4)
+#define HS_DISABLE (1<<5)
+#define SELF_BUS_PWR (1<<7)
+
+#define SMSC3503_CONFIG_BYTE_2 0x07 /*u8 read*/
+#define SMSC3503_LANGID 0x11 /*u16 read*/
+#define SMSC3503_MFRSL 0x13 /*u8 read*/
+#define SMSC3503_PRDSL 0x14 /*u8 read*/
+#define SMSC3503_SERSL 0x15 /*u8 read*/
+#define SMSC3503_MANSTR 0x16 /*0x16h-0x53h*/
+#define SMSC3503_PRDSTR 0x54 /*0x54h-0x91h*/
+#define SMSC3503_SERSTR 0x92 /*0x92h-0xCFh*/
+
+#define SMSC3503_SP_ILOCK 0xE7 /*u8 read, set,clear*/
+#define CONFIG_N (1<<0)
+#define CONNECT_N (1<<1)
+#define PRTPWRPINSEL (1<<4)
+#define OCSPINSEL (1<<5)
+
struct smsc_hub_platform_data {
unsigned hub_reset;
};