Lines Matching +full:write +full:- +full:enable
1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * Copyright (C) 2004 - 2006 rt2x00 SourceForge Project
24 eeprom->reg_data_clock = 1; in eeprom_93cx6_pulse_high()
25 eeprom->register_write(eeprom); in eeprom_93cx6_pulse_high()
37 eeprom->reg_data_clock = 0; in eeprom_93cx6_pulse_low()
38 eeprom->register_write(eeprom); in eeprom_93cx6_pulse_low()
51 * Clear all flags, and enable chip select. in eeprom_93cx6_startup()
53 eeprom->register_read(eeprom); in eeprom_93cx6_startup()
54 eeprom->reg_data_in = 0; in eeprom_93cx6_startup()
55 eeprom->reg_data_out = 0; in eeprom_93cx6_startup()
56 eeprom->reg_data_clock = 0; in eeprom_93cx6_startup()
57 eeprom->reg_chip_select = 1; in eeprom_93cx6_startup()
58 eeprom->drive_data = 1; in eeprom_93cx6_startup()
59 eeprom->register_write(eeprom); in eeprom_93cx6_startup()
73 eeprom->register_read(eeprom); in eeprom_93cx6_cleanup()
74 eeprom->reg_data_in = 0; in eeprom_93cx6_cleanup()
75 eeprom->reg_chip_select = 0; in eeprom_93cx6_cleanup()
76 eeprom->register_write(eeprom); in eeprom_93cx6_cleanup()
90 eeprom->register_read(eeprom); in eeprom_93cx6_write_bits()
95 eeprom->reg_data_in = 0; in eeprom_93cx6_write_bits()
96 eeprom->reg_data_out = 0; in eeprom_93cx6_write_bits()
97 eeprom->drive_data = 1; in eeprom_93cx6_write_bits()
102 for (i = count; i > 0; i--) { in eeprom_93cx6_write_bits()
106 eeprom->reg_data_in = !!(data & BIT(i - 1)); in eeprom_93cx6_write_bits()
109 * Write the bit to the eeprom register. in eeprom_93cx6_write_bits()
111 eeprom->register_write(eeprom); in eeprom_93cx6_write_bits()
120 eeprom->reg_data_in = 0; in eeprom_93cx6_write_bits()
121 eeprom->register_write(eeprom); in eeprom_93cx6_write_bits()
130 eeprom->register_read(eeprom); in eeprom_93cx6_read_bits()
135 eeprom->reg_data_in = 0; in eeprom_93cx6_read_bits()
136 eeprom->reg_data_out = 0; in eeprom_93cx6_read_bits()
137 eeprom->drive_data = 0; in eeprom_93cx6_read_bits()
142 for (i = count; i > 0; i--) { in eeprom_93cx6_read_bits()
145 eeprom->register_read(eeprom); in eeprom_93cx6_read_bits()
150 eeprom->reg_data_in = 0; in eeprom_93cx6_read_bits()
155 if (eeprom->reg_data_out) in eeprom_93cx6_read_bits()
156 buf |= BIT(i - 1); in eeprom_93cx6_read_bits()
165 * eeprom_93cx6_read - Read a word from eeprom
170 * This function will read the eeprom data as host-endian word
186 command = (PCI_EEPROM_READ_OPCODE << eeprom->width) | word; in eeprom_93cx6_read()
188 PCI_EEPROM_WIDTH_OPCODE + eeprom->width); in eeprom_93cx6_read()
208 * eeprom_93cx6_multiread - Read multiple words from eeprom
235 * eeprom_93cx6_readb - Read a byte from eeprom
257 command = (PCI_EEPROM_READ_OPCODE << (eeprom->width + 1)) | byte; in eeprom_93cx6_readb()
259 PCI_EEPROM_WIDTH_OPCODE + eeprom->width + 1); in eeprom_93cx6_readb()
280 * eeprom_93cx6_multireadb - Read multiple bytes from eeprom
300 * eeprom_93cx6_wren - set the write enable state
302 * @enable: true to enable writes, otherwise disable writes
304 * Set the EEPROM write enable state to either allow or deny
305 * writes depending on the @enable value.
307 void eeprom_93cx6_wren(struct eeprom_93cx6 *eeprom, bool enable) in eeprom_93cx6_wren() argument
314 /* create command to enable/disable */ in eeprom_93cx6_wren()
316 command = enable ? PCI_EEPROM_EWEN_OPCODE : PCI_EEPROM_EWDS_OPCODE; in eeprom_93cx6_wren()
317 command <<= (eeprom->width - 2); in eeprom_93cx6_wren()
320 PCI_EEPROM_WIDTH_OPCODE + eeprom->width); in eeprom_93cx6_wren()
327 * eeprom_93cx6_write - write data to the EEPROM
329 * @addr: Address to write data to.
330 * @data: The data to write to address @addr.
332 * Write the @data to the specified @addr in the EEPROM and
335 * Note, since we do not expect large number of write operations
347 command = PCI_EEPROM_WRITE_OPCODE << eeprom->width; in eeprom_93cx6_write()
350 /* send write command */ in eeprom_93cx6_write()
352 PCI_EEPROM_WIDTH_OPCODE + eeprom->width); in eeprom_93cx6_write()
358 eeprom->drive_data = 0; in eeprom_93cx6_write()
359 eeprom->reg_chip_select = 1; in eeprom_93cx6_write()
360 eeprom->register_write(eeprom); in eeprom_93cx6_write()
362 /* wait at-least 250ns to get DO to be the busy signal */ in eeprom_93cx6_write()
368 eeprom->register_read(eeprom); in eeprom_93cx6_write()
370 if (eeprom->reg_data_out) in eeprom_93cx6_write()
375 if (--timeout <= 0) { in eeprom_93cx6_write()