Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

eeprom_93cx6: Add data direction control.

Some devices need to know if the data is to be output or read, so add a
data direction into the eeprom structure to tell the driver whether the
data line should be driven.

The user in this case is the Micrel KS8851 which has a direction
control for the EEPROM data line and thus needs to know whether
to drive it (writing) or to tristate it for receiving.

Signed-off-by: Ben Dooks <ben@simtec.co.uk>
Cc: Wolfram Sang <w.sang@pengutronix.de>
Cc: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Ben Dooks and committed by
David S. Miller
b30f8bdc e9008ee9

+5
+3
drivers/misc/eeprom/eeprom_93cx6.c
··· 63 63 eeprom->reg_data_out = 0; 64 64 eeprom->reg_data_clock = 0; 65 65 eeprom->reg_chip_select = 1; 66 + eeprom->drive_data = 1; 66 67 eeprom->register_write(eeprom); 67 68 68 69 /* ··· 102 101 */ 103 102 eeprom->reg_data_in = 0; 104 103 eeprom->reg_data_out = 0; 104 + eeprom->drive_data = 1; 105 105 106 106 /* 107 107 * Start writing all bits. ··· 142 140 */ 143 141 eeprom->reg_data_in = 0; 144 142 eeprom->reg_data_out = 0; 143 + eeprom->drive_data = 0; 145 144 146 145 /* 147 146 * Start reading all bits.
+2
include/linux/eeprom_93cx6.h
··· 46 46 * @register_write(struct eeprom_93cx6 *eeprom): handler to 47 47 * write to the eeprom register by using all reg_* fields. 48 48 * @width: eeprom width, should be one of the PCI_EEPROM_WIDTH_* defines 49 + * @drive_data: Set if we're driving the data line. 49 50 * @reg_data_in: register field to indicate data input 50 51 * @reg_data_out: register field to indicate data output 51 52 * @reg_data_clock: register field to set the data clock ··· 63 62 64 63 int width; 65 64 65 + char drive_data; 66 66 char reg_data_in; 67 67 char reg_data_out; 68 68 char reg_data_clock;