Lines Matching +full:write +full:- +full:enable
1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * Copyright (C) 2004 - 2006 rt2x00 SourceForge Project
23 eeprom->reg_data_clock = 1; in eeprom_93cx6_pulse_high()
24 eeprom->register_write(eeprom); in eeprom_93cx6_pulse_high()
36 eeprom->reg_data_clock = 0; in eeprom_93cx6_pulse_low()
37 eeprom->register_write(eeprom); in eeprom_93cx6_pulse_low()
50 * Clear all flags, and enable chip select. in eeprom_93cx6_startup()
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()
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()
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()
101 for (i = count; i > 0; i--) { in eeprom_93cx6_write_bits()
105 eeprom->reg_data_in = !!(data & (1 << (i - 1))); in eeprom_93cx6_write_bits()
108 * Write the bit to the eeprom register. in eeprom_93cx6_write_bits()
110 eeprom->register_write(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()
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()
141 for (i = count; i > 0; i--) { 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()
155 buf |= (1 << (i - 1)); in eeprom_93cx6_read_bits()
164 * eeprom_93cx6_read - Read a word from eeprom
169 * This function will read the eeprom data as host-endian word
185 command = (PCI_EEPROM_READ_OPCODE << eeprom->width) | word; in eeprom_93cx6_read()
187 PCI_EEPROM_WIDTH_OPCODE + eeprom->width); in eeprom_93cx6_read()
202 * eeprom_93cx6_multiread - Read multiple words from eeprom
229 * eeprom_93cx6_readb - Read a byte from eeprom
251 command = (PCI_EEPROM_READ_OPCODE << (eeprom->width + 1)) | byte; in eeprom_93cx6_readb()
253 PCI_EEPROM_WIDTH_OPCODE + eeprom->width + 1); in eeprom_93cx6_readb()
269 * eeprom_93cx6_multireadb - Read multiple bytes from eeprom
289 * eeprom_93cx6_wren - set the write enable state
291 * @enable: true to enable writes, otherwise disable writes
293 * Set the EEPROM write enable state to either allow or deny
294 * writes depending on the @enable value.
296 void eeprom_93cx6_wren(struct eeprom_93cx6 *eeprom, bool enable) in eeprom_93cx6_wren() argument
303 /* create command to enable/disable */ in eeprom_93cx6_wren()
305 command = enable ? PCI_EEPROM_EWEN_OPCODE : PCI_EEPROM_EWDS_OPCODE; in eeprom_93cx6_wren()
306 command <<= (eeprom->width - 2); in eeprom_93cx6_wren()
309 PCI_EEPROM_WIDTH_OPCODE + eeprom->width); in eeprom_93cx6_wren()
316 * eeprom_93cx6_write - write data to the EEPROM
318 * @addr: Address to write data to.
319 * @data: The data to write to address @addr.
321 * Write the @data to the specified @addr in the EEPROM and
324 * Note, since we do not expect large number of write operations
336 command = PCI_EEPROM_WRITE_OPCODE << eeprom->width; in eeprom_93cx6_write()
339 /* send write command */ in eeprom_93cx6_write()
341 PCI_EEPROM_WIDTH_OPCODE + eeprom->width); 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()
351 /* wait at-least 250ns to get DO to be the busy signal */ in eeprom_93cx6_write()
357 eeprom->register_read(eeprom); in eeprom_93cx6_write()
359 if (eeprom->reg_data_out) in eeprom_93cx6_write()
364 if (--timeout <= 0) { in eeprom_93cx6_write()