2009-12-07 12:18:36

by Ben Dooks

[permalink] [raw]
Subject: [patch 1/9] 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 <[email protected]>
Cc: Wolfram Sang <[email protected]>
Cc: Jean Delvare <[email protected]>
Cc: Linux Kernel <[email protected]>

--
drivers/misc/eeprom/eeprom_93cx6.c | 3 +++
include/linux/eeprom_93cx6.h | 2 ++
2 files changed, 5 insertions(+)

Index: b/drivers/misc/eeprom/eeprom_93cx6.c
===================================================================
--- a/drivers/misc/eeprom/eeprom_93cx6.c 2009-10-06 15:35:38.000000000 +0100
+++ b/drivers/misc/eeprom/eeprom_93cx6.c 2009-10-06 15:51:18.000000000 +0100
@@ -70,6 +70,7 @@ static void eeprom_93cx6_startup(struct
eeprom->reg_data_out = 0;
eeprom->reg_data_clock = 0;
eeprom->reg_chip_select = 1;
+ eeprom->drive_data = 1;
eeprom->register_write(eeprom);

/*
@@ -108,6 +109,7 @@ static void eeprom_93cx6_write_bits(stru
*/
eeprom->reg_data_in = 0;
eeprom->reg_data_out = 0;
+ eeprom->drive_data = 1;

/*
* Start writing all bits.
@@ -147,6 +149,7 @@ static void eeprom_93cx6_read_bits(struc
*/
eeprom->reg_data_in = 0;
eeprom->reg_data_out = 0;
+ eeprom->drive_data = 0;

/*
* Start reading all bits.
Index: b/include/linux/eeprom_93cx6.h
===================================================================
--- a/include/linux/eeprom_93cx6.h 2009-10-06 15:35:38.000000000 +0100
+++ b/include/linux/eeprom_93cx6.h 2009-10-06 15:51:18.000000000 +0100
@@ -45,6 +45,7 @@
* @register_write(struct eeprom_93cx6 *eeprom): handler to
* write to the eeprom register by using all reg_* fields.
* @width: eeprom width, should be one of the PCI_EEPROM_WIDTH_* defines
+ * @drive_data: Set if we're driving the data line.
* @reg_data_in: register field to indicate data input
* @reg_data_out: register field to indicate data output
* @reg_data_clock: register field to set the data clock
@@ -61,6 +62,7 @@ struct eeprom_93cx6 {

int width;

+ char drive_data;
char reg_data_in;
char reg_data_out;
char reg_data_clock;


2009-12-07 12:21:42

by Jean Delvare

[permalink] [raw]
Subject: Re: [patch 1/9] eeprom_93cx6: Add data direction control.

On Mon, 07 Dec 2009 12:17:28 +0000, Ben Dooks wrote:
> 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 <[email protected]>
> Cc: Wolfram Sang <[email protected]>
> Cc: Jean Delvare <[email protected]>
> Cc: Linux Kernel <[email protected]>

FYI, I will not be reviewing this patch nor any other patch to the
eeprom_93cx6 driver. I have no clue what these devices are, no access
to any and no interest in them either.

--
Jean Delvare

2009-12-07 12:24:09

by Ben Dooks

[permalink] [raw]
Subject: Re: [patch 1/9] eeprom_93cx6: Add data direction control.

Jean Delvare wrote:
> On Mon, 07 Dec 2009 12:17:28 +0000, Ben Dooks wrote:
>> 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 <[email protected]>
>> Cc: Wolfram Sang <[email protected]>
>> Cc: Jean Delvare <[email protected]>
>> Cc: Linux Kernel <[email protected]>
>
> FYI, I will not be reviewing this patch nor any other patch to the
> eeprom_93cx6 driver. I have no clue what these devices are, no access
> to any and no interest in them either.

Ok, scripts/get_maintainer.pl came up with yourself, Wolfram and linux-kernel
as the people to send this to.

--
Ben Dooks, Design & Software Engineer, Simtec Electronics

http://www.simtec.co.uk/