Lines Matching refs:eeprom
30 static inline void eeprom_93cx6_pulse_high(struct eeprom_93cx6 *eeprom) in eeprom_93cx6_pulse_high() argument
32 eeprom->reg_data_clock = 1; in eeprom_93cx6_pulse_high()
33 eeprom->register_write(eeprom); in eeprom_93cx6_pulse_high()
43 static inline void eeprom_93cx6_pulse_low(struct eeprom_93cx6 *eeprom) in eeprom_93cx6_pulse_low() argument
45 eeprom->reg_data_clock = 0; in eeprom_93cx6_pulse_low()
46 eeprom->register_write(eeprom); in eeprom_93cx6_pulse_low()
56 static void eeprom_93cx6_startup(struct eeprom_93cx6 *eeprom) in eeprom_93cx6_startup() argument
61 eeprom->register_read(eeprom); in eeprom_93cx6_startup()
62 eeprom->reg_data_in = 0; in eeprom_93cx6_startup()
63 eeprom->reg_data_out = 0; in eeprom_93cx6_startup()
64 eeprom->reg_data_clock = 0; in eeprom_93cx6_startup()
65 eeprom->reg_chip_select = 1; in eeprom_93cx6_startup()
66 eeprom->drive_data = 1; in eeprom_93cx6_startup()
67 eeprom->register_write(eeprom); in eeprom_93cx6_startup()
72 eeprom_93cx6_pulse_high(eeprom); in eeprom_93cx6_startup()
73 eeprom_93cx6_pulse_low(eeprom); in eeprom_93cx6_startup()
76 static void eeprom_93cx6_cleanup(struct eeprom_93cx6 *eeprom) in eeprom_93cx6_cleanup() argument
81 eeprom->register_read(eeprom); in eeprom_93cx6_cleanup()
82 eeprom->reg_data_in = 0; in eeprom_93cx6_cleanup()
83 eeprom->reg_chip_select = 0; in eeprom_93cx6_cleanup()
84 eeprom->register_write(eeprom); in eeprom_93cx6_cleanup()
89 eeprom_93cx6_pulse_high(eeprom); in eeprom_93cx6_cleanup()
90 eeprom_93cx6_pulse_low(eeprom); in eeprom_93cx6_cleanup()
93 static void eeprom_93cx6_write_bits(struct eeprom_93cx6 *eeprom, in eeprom_93cx6_write_bits() argument
98 eeprom->register_read(eeprom); in eeprom_93cx6_write_bits()
103 eeprom->reg_data_in = 0; in eeprom_93cx6_write_bits()
104 eeprom->reg_data_out = 0; in eeprom_93cx6_write_bits()
105 eeprom->drive_data = 1; in eeprom_93cx6_write_bits()
114 eeprom->reg_data_in = !!(data & (1 << (i - 1))); in eeprom_93cx6_write_bits()
119 eeprom->register_write(eeprom); in eeprom_93cx6_write_bits()
124 eeprom_93cx6_pulse_high(eeprom); in eeprom_93cx6_write_bits()
125 eeprom_93cx6_pulse_low(eeprom); in eeprom_93cx6_write_bits()
128 eeprom->reg_data_in = 0; in eeprom_93cx6_write_bits()
129 eeprom->register_write(eeprom); in eeprom_93cx6_write_bits()
132 static void eeprom_93cx6_read_bits(struct eeprom_93cx6 *eeprom, in eeprom_93cx6_read_bits() argument
138 eeprom->register_read(eeprom); in eeprom_93cx6_read_bits()
143 eeprom->reg_data_in = 0; in eeprom_93cx6_read_bits()
144 eeprom->reg_data_out = 0; in eeprom_93cx6_read_bits()
145 eeprom->drive_data = 0; in eeprom_93cx6_read_bits()
151 eeprom_93cx6_pulse_high(eeprom); in eeprom_93cx6_read_bits()
153 eeprom->register_read(eeprom); in eeprom_93cx6_read_bits()
158 eeprom->reg_data_in = 0; in eeprom_93cx6_read_bits()
163 if (eeprom->reg_data_out) in eeprom_93cx6_read_bits()
166 eeprom_93cx6_pulse_low(eeprom); in eeprom_93cx6_read_bits()
181 void eeprom_93cx6_read(struct eeprom_93cx6 *eeprom, const u8 word, in eeprom_93cx6_read() argument
189 eeprom_93cx6_startup(eeprom); in eeprom_93cx6_read()
194 command = (PCI_EEPROM_READ_OPCODE << eeprom->width) | word; in eeprom_93cx6_read()
195 eeprom_93cx6_write_bits(eeprom, command, in eeprom_93cx6_read()
196 PCI_EEPROM_WIDTH_OPCODE + eeprom->width); in eeprom_93cx6_read()
201 eeprom_93cx6_read_bits(eeprom, data, 16); in eeprom_93cx6_read()
206 eeprom_93cx6_cleanup(eeprom); in eeprom_93cx6_read()
223 void eeprom_93cx6_multiread(struct eeprom_93cx6 *eeprom, const u8 word, in eeprom_93cx6_multiread() argument
231 eeprom_93cx6_read(eeprom, word + i, &tmp); in eeprom_93cx6_multiread()
246 void eeprom_93cx6_readb(struct eeprom_93cx6 *eeprom, const u8 byte, in eeprom_93cx6_readb() argument
255 eeprom_93cx6_startup(eeprom); in eeprom_93cx6_readb()
260 command = (PCI_EEPROM_READ_OPCODE << (eeprom->width + 1)) | byte; in eeprom_93cx6_readb()
261 eeprom_93cx6_write_bits(eeprom, command, in eeprom_93cx6_readb()
262 PCI_EEPROM_WIDTH_OPCODE + eeprom->width + 1); in eeprom_93cx6_readb()
267 eeprom_93cx6_read_bits(eeprom, &tmp, 8); in eeprom_93cx6_readb()
273 eeprom_93cx6_cleanup(eeprom); in eeprom_93cx6_readb()
287 void eeprom_93cx6_multireadb(struct eeprom_93cx6 *eeprom, const u8 byte, in eeprom_93cx6_multireadb() argument
293 eeprom_93cx6_readb(eeprom, byte + i, &data[i]); in eeprom_93cx6_multireadb()
305 void eeprom_93cx6_wren(struct eeprom_93cx6 *eeprom, bool enable) in eeprom_93cx6_wren() argument
310 eeprom_93cx6_startup(eeprom); in eeprom_93cx6_wren()
315 command <<= (eeprom->width - 2); in eeprom_93cx6_wren()
317 eeprom_93cx6_write_bits(eeprom, command, in eeprom_93cx6_wren()
318 PCI_EEPROM_WIDTH_OPCODE + eeprom->width); in eeprom_93cx6_wren()
320 eeprom_93cx6_cleanup(eeprom); in eeprom_93cx6_wren()
337 void eeprom_93cx6_write(struct eeprom_93cx6 *eeprom, u8 addr, u16 data) in eeprom_93cx6_write() argument
343 eeprom_93cx6_startup(eeprom); in eeprom_93cx6_write()
345 command = PCI_EEPROM_WRITE_OPCODE << eeprom->width; in eeprom_93cx6_write()
349 eeprom_93cx6_write_bits(eeprom, command, in eeprom_93cx6_write()
350 PCI_EEPROM_WIDTH_OPCODE + eeprom->width); in eeprom_93cx6_write()
353 eeprom_93cx6_write_bits(eeprom, data, 16); in eeprom_93cx6_write()
356 eeprom->drive_data = 0; in eeprom_93cx6_write()
357 eeprom->reg_chip_select = 1; in eeprom_93cx6_write()
358 eeprom->register_write(eeprom); in eeprom_93cx6_write()
366 eeprom->register_read(eeprom); in eeprom_93cx6_write()
368 if (eeprom->reg_data_out) in eeprom_93cx6_write()
379 eeprom_93cx6_cleanup(eeprom); in eeprom_93cx6_write()