Lines Matching refs:eeprom
21 static inline void eeprom_93cx6_pulse_high(struct eeprom_93cx6 *eeprom) in eeprom_93cx6_pulse_high() argument
23 eeprom->reg_data_clock = 1; in eeprom_93cx6_pulse_high()
24 eeprom->register_write(eeprom); in eeprom_93cx6_pulse_high()
34 static inline void eeprom_93cx6_pulse_low(struct eeprom_93cx6 *eeprom) in eeprom_93cx6_pulse_low() argument
36 eeprom->reg_data_clock = 0; in eeprom_93cx6_pulse_low()
37 eeprom->register_write(eeprom); in eeprom_93cx6_pulse_low()
47 static void eeprom_93cx6_startup(struct eeprom_93cx6 *eeprom) in eeprom_93cx6_startup() argument
52 eeprom->register_read(eeprom); in eeprom_93cx6_startup()
53 eeprom->reg_data_in = 0; in eeprom_93cx6_startup()
54 eeprom->reg_data_out = 0; in eeprom_93cx6_startup()
55 eeprom->reg_data_clock = 0; in eeprom_93cx6_startup()
56 eeprom->reg_chip_select = 1; in eeprom_93cx6_startup()
57 eeprom->drive_data = 1; in eeprom_93cx6_startup()
58 eeprom->register_write(eeprom); in eeprom_93cx6_startup()
63 eeprom_93cx6_pulse_high(eeprom); in eeprom_93cx6_startup()
64 eeprom_93cx6_pulse_low(eeprom); in eeprom_93cx6_startup()
67 static void eeprom_93cx6_cleanup(struct eeprom_93cx6 *eeprom) in eeprom_93cx6_cleanup() argument
72 eeprom->register_read(eeprom); in eeprom_93cx6_cleanup()
73 eeprom->reg_data_in = 0; in eeprom_93cx6_cleanup()
74 eeprom->reg_chip_select = 0; in eeprom_93cx6_cleanup()
75 eeprom->register_write(eeprom); in eeprom_93cx6_cleanup()
80 eeprom_93cx6_pulse_high(eeprom); in eeprom_93cx6_cleanup()
81 eeprom_93cx6_pulse_low(eeprom); in eeprom_93cx6_cleanup()
84 static void eeprom_93cx6_write_bits(struct eeprom_93cx6 *eeprom, in eeprom_93cx6_write_bits() argument
89 eeprom->register_read(eeprom); in eeprom_93cx6_write_bits()
94 eeprom->reg_data_in = 0; in eeprom_93cx6_write_bits()
95 eeprom->reg_data_out = 0; in eeprom_93cx6_write_bits()
96 eeprom->drive_data = 1; in eeprom_93cx6_write_bits()
105 eeprom->reg_data_in = !!(data & (1 << (i - 1))); in eeprom_93cx6_write_bits()
110 eeprom->register_write(eeprom); in eeprom_93cx6_write_bits()
115 eeprom_93cx6_pulse_high(eeprom); in eeprom_93cx6_write_bits()
116 eeprom_93cx6_pulse_low(eeprom); in eeprom_93cx6_write_bits()
119 eeprom->reg_data_in = 0; in eeprom_93cx6_write_bits()
120 eeprom->register_write(eeprom); in eeprom_93cx6_write_bits()
123 static void eeprom_93cx6_read_bits(struct eeprom_93cx6 *eeprom, in eeprom_93cx6_read_bits() argument
129 eeprom->register_read(eeprom); in eeprom_93cx6_read_bits()
134 eeprom->reg_data_in = 0; in eeprom_93cx6_read_bits()
135 eeprom->reg_data_out = 0; in eeprom_93cx6_read_bits()
136 eeprom->drive_data = 0; in eeprom_93cx6_read_bits()
142 eeprom_93cx6_pulse_high(eeprom); in eeprom_93cx6_read_bits()
144 eeprom->register_read(eeprom); in eeprom_93cx6_read_bits()
149 eeprom->reg_data_in = 0; in eeprom_93cx6_read_bits()
154 if (eeprom->reg_data_out) in eeprom_93cx6_read_bits()
157 eeprom_93cx6_pulse_low(eeprom); in eeprom_93cx6_read_bits()
172 void eeprom_93cx6_read(struct eeprom_93cx6 *eeprom, const u8 word, in eeprom_93cx6_read() argument
180 eeprom_93cx6_startup(eeprom); in eeprom_93cx6_read()
185 command = (PCI_EEPROM_READ_OPCODE << eeprom->width) | word; in eeprom_93cx6_read()
186 eeprom_93cx6_write_bits(eeprom, command, in eeprom_93cx6_read()
187 PCI_EEPROM_WIDTH_OPCODE + eeprom->width); in eeprom_93cx6_read()
192 eeprom_93cx6_read_bits(eeprom, data, 16); in eeprom_93cx6_read()
197 eeprom_93cx6_cleanup(eeprom); in eeprom_93cx6_read()
214 void eeprom_93cx6_multiread(struct eeprom_93cx6 *eeprom, const u8 word, in eeprom_93cx6_multiread() argument
222 eeprom_93cx6_read(eeprom, word + i, &tmp); in eeprom_93cx6_multiread()
237 void eeprom_93cx6_readb(struct eeprom_93cx6 *eeprom, const u8 byte, in eeprom_93cx6_readb() argument
246 eeprom_93cx6_startup(eeprom); in eeprom_93cx6_readb()
251 command = (PCI_EEPROM_READ_OPCODE << (eeprom->width + 1)) | byte; in eeprom_93cx6_readb()
252 eeprom_93cx6_write_bits(eeprom, command, in eeprom_93cx6_readb()
253 PCI_EEPROM_WIDTH_OPCODE + eeprom->width + 1); in eeprom_93cx6_readb()
258 eeprom_93cx6_read_bits(eeprom, &tmp, 8); in eeprom_93cx6_readb()
264 eeprom_93cx6_cleanup(eeprom); in eeprom_93cx6_readb()
278 void eeprom_93cx6_multireadb(struct eeprom_93cx6 *eeprom, const u8 byte, in eeprom_93cx6_multireadb() argument
284 eeprom_93cx6_readb(eeprom, byte + i, &data[i]); in eeprom_93cx6_multireadb()
296 void eeprom_93cx6_wren(struct eeprom_93cx6 *eeprom, bool enable) in eeprom_93cx6_wren() argument
301 eeprom_93cx6_startup(eeprom); in eeprom_93cx6_wren()
306 command <<= (eeprom->width - 2); in eeprom_93cx6_wren()
308 eeprom_93cx6_write_bits(eeprom, command, in eeprom_93cx6_wren()
309 PCI_EEPROM_WIDTH_OPCODE + eeprom->width); in eeprom_93cx6_wren()
311 eeprom_93cx6_cleanup(eeprom); in eeprom_93cx6_wren()
328 void eeprom_93cx6_write(struct eeprom_93cx6 *eeprom, u8 addr, u16 data) in eeprom_93cx6_write() argument
334 eeprom_93cx6_startup(eeprom); in eeprom_93cx6_write()
336 command = PCI_EEPROM_WRITE_OPCODE << eeprom->width; in eeprom_93cx6_write()
340 eeprom_93cx6_write_bits(eeprom, command, in eeprom_93cx6_write()
341 PCI_EEPROM_WIDTH_OPCODE + eeprom->width); in eeprom_93cx6_write()
344 eeprom_93cx6_write_bits(eeprom, data, 16); in eeprom_93cx6_write()
347 eeprom->drive_data = 0; in eeprom_93cx6_write()
348 eeprom->reg_chip_select = 1; in eeprom_93cx6_write()
349 eeprom->register_write(eeprom); in eeprom_93cx6_write()
357 eeprom->register_read(eeprom); in eeprom_93cx6_write()
359 if (eeprom->reg_data_out) in eeprom_93cx6_write()
370 eeprom_93cx6_cleanup(eeprom); in eeprom_93cx6_write()