aboutsummaryrefslogtreecommitdiff
path: root/drivers/net/ks8851.h
diff options
context:
space:
mode:
authorSebastien Jan <s-jan@ti.com>2010-05-05 08:45:53 +0000
committerDavid S. Miller <davem@davemloft.net>2010-05-05 21:27:44 -0700
commita4bdfff74464f86d7e3b8feaf42d18960adc5514 (patch)
tree4dcde38694ca796b1a3d04a0044948397b497f6c /drivers/net/ks8851.h
parent7d9974666e0dc2cbbeac80fa4d550df0bbea6fad (diff)
ks8851: Low level functions for read/write to companion eeprom
Low-level functions provide 16bits words read and write capability to ks8851 companion eeprom. Signed-off-by: Sebastien Jan <s-jan@ti.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ks8851.h')
-rw-r--r--drivers/net/ks8851.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/drivers/net/ks8851.h b/drivers/net/ks8851.h
index f52c312cc35..537fb06e593 100644
--- a/drivers/net/ks8851.h
+++ b/drivers/net/ks8851.h
@@ -25,12 +25,24 @@
#define OBCR_ODS_16mA (1 << 6)
#define KS_EEPCR 0x22
+#define EEPCR_EESRWA (1 << 5)
#define EEPCR_EESA (1 << 4)
-#define EEPCR_EESB (1 << 3)
+#define EEPCR_EESB_OFFSET 3
+#define EEPCR_EESB (1 << EEPCR_EESB_OFFSET)
#define EEPCR_EEDO (1 << 2)
#define EEPCR_EESCK (1 << 1)
#define EEPCR_EECS (1 << 0)
+#define EEPROM_OP_LEN 3 /* bits:*/
+#define EEPROM_OP_READ 0x06
+#define EEPROM_OP_EWEN 0x04
+#define EEPROM_OP_WRITE 0x05
+#define EEPROM_OP_EWDS 0x14
+
+#define EEPROM_DATA_LEN 16 /* 16 bits EEPROM */
+#define EEPROM_WRITE_TIME 4 /* wrt ack time in ms */
+#define EEPROM_SK_PERIOD 400 /* in us */
+
#define KS_MBIR 0x24
#define MBIR_TXMBF (1 << 12)
#define MBIR_TXMBFA (1 << 11)