diff options
author | Ben Dooks <ben@simtec.co.uk> | 2011-11-21 03:57:56 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-11-26 14:59:38 -0500 |
commit | b30f8bdcfa7dd05f4268348f3388ff903132f28e (patch) | |
tree | 6781a42fe2cfe8eacc2ba981cab8cec594f7bfef | |
parent | e9008ee99c77207b2f6aee67e5f849b1e1400a11 (diff) |
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>
-rw-r--r-- | drivers/misc/eeprom/eeprom_93cx6.c | 3 | ||||
-rw-r--r-- | include/linux/eeprom_93cx6.h | 2 |
2 files changed, 5 insertions, 0 deletions
diff --git a/drivers/misc/eeprom/eeprom_93cx6.c b/drivers/misc/eeprom/eeprom_93cx6.c index 7b33de95c4bf..a6037af6f076 100644 --- a/drivers/misc/eeprom/eeprom_93cx6.c +++ b/drivers/misc/eeprom/eeprom_93cx6.c | |||
@@ -63,6 +63,7 @@ static void eeprom_93cx6_startup(struct eeprom_93cx6 *eeprom) | |||
63 | eeprom->reg_data_out = 0; | 63 | eeprom->reg_data_out = 0; |
64 | eeprom->reg_data_clock = 0; | 64 | eeprom->reg_data_clock = 0; |
65 | eeprom->reg_chip_select = 1; | 65 | eeprom->reg_chip_select = 1; |
66 | eeprom->drive_data = 1; | ||
66 | eeprom->register_write(eeprom); | 67 | eeprom->register_write(eeprom); |
67 | 68 | ||
68 | /* | 69 | /* |
@@ -101,6 +102,7 @@ static void eeprom_93cx6_write_bits(struct eeprom_93cx6 *eeprom, | |||
101 | */ | 102 | */ |
102 | eeprom->reg_data_in = 0; | 103 | eeprom->reg_data_in = 0; |
103 | eeprom->reg_data_out = 0; | 104 | eeprom->reg_data_out = 0; |
105 | eeprom->drive_data = 1; | ||
104 | 106 | ||
105 | /* | 107 | /* |
106 | * Start writing all bits. | 108 | * Start writing all bits. |
@@ -140,6 +142,7 @@ static void eeprom_93cx6_read_bits(struct eeprom_93cx6 *eeprom, | |||
140 | */ | 142 | */ |
141 | eeprom->reg_data_in = 0; | 143 | eeprom->reg_data_in = 0; |
142 | eeprom->reg_data_out = 0; | 144 | eeprom->reg_data_out = 0; |
145 | eeprom->drive_data = 0; | ||
143 | 146 | ||
144 | /* | 147 | /* |
145 | * Start reading all bits. | 148 | * Start reading all bits. |
diff --git a/include/linux/eeprom_93cx6.h b/include/linux/eeprom_93cx6.h index c4627cbdb8e0..e04546e9c592 100644 --- a/include/linux/eeprom_93cx6.h +++ b/include/linux/eeprom_93cx6.h | |||
@@ -46,6 +46,7 @@ | |||
46 | * @register_write(struct eeprom_93cx6 *eeprom): handler to | 46 | * @register_write(struct eeprom_93cx6 *eeprom): handler to |
47 | * write to the eeprom register by using all reg_* fields. | 47 | * write to the eeprom register by using all reg_* fields. |
48 | * @width: eeprom width, should be one of the PCI_EEPROM_WIDTH_* defines | 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 | * @reg_data_in: register field to indicate data input | 50 | * @reg_data_in: register field to indicate data input |
50 | * @reg_data_out: register field to indicate data output | 51 | * @reg_data_out: register field to indicate data output |
51 | * @reg_data_clock: register field to set the data clock | 52 | * @reg_data_clock: register field to set the data clock |
@@ -62,6 +63,7 @@ struct eeprom_93cx6 { | |||
62 | 63 | ||
63 | int width; | 64 | int width; |
64 | 65 | ||
66 | char drive_data; | ||
65 | char reg_data_in; | 67 | char reg_data_in; |
66 | char reg_data_out; | 68 | char reg_data_out; |
67 | char reg_data_clock; | 69 | char reg_data_clock; |