1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 #define PCI_EEPROM_WIDTH_93C46 6
18 #define PCI_EEPROM_WIDTH_93C56 8
19 #define PCI_EEPROM_WIDTH_93C66 8
20 #define PCI_EEPROM_WIDTH_93C86 8
21 #define PCI_EEPROM_WIDTH_OPCODE 3
22 #define PCI_EEPROM_WRITE_OPCODE 0x05
23 #define PCI_EEPROM_ERASE_OPCODE 0x07
24 #define PCI_EEPROM_READ_OPCODE 0x06
25 #define PCI_EEPROM_EWDS_OPCODE 0x10
26 #define PCI_EEPROM_EWEN_OPCODE 0x13
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46 struct eeprom_93cx6 {
47 void *data;
48
49 void (*register_read)(struct eeprom_93cx6 *eeprom);
50 void (*register_write)(struct eeprom_93cx6 *eeprom);
51
52 int width;
53
54 char drive_data;
55 char reg_data_in;
56 char reg_data_out;
57 char reg_data_clock;
58 char reg_chip_select;
59 };
60
61 extern void eeprom_93cx6_read(struct eeprom_93cx6 *eeprom,
62 const u8 word, u16 *data);
63 extern void eeprom_93cx6_multiread(struct eeprom_93cx6 *eeprom,
64 const u8 word, __le16 *data, const u16 words);
65 extern void eeprom_93cx6_readb(struct eeprom_93cx6 *eeprom,
66 const u8 byte, u8 *data);
67 extern void eeprom_93cx6_multireadb(struct eeprom_93cx6 *eeprom,
68 const u8 byte, u8 *data, const u16 bytes);
69
70 extern void eeprom_93cx6_wren(struct eeprom_93cx6 *eeprom, bool enable);
71
72 extern void eeprom_93cx6_write(struct eeprom_93cx6 *eeprom,
73 u8 addr, u16 data);