Generalised the SPI abstraction layer to also be able to handle interfaces

that don't provide the full flexibility of a bit-bashing interface.

Temporarily hacked rtl8139.c to use the new interface.
This commit is contained in:
Michael Brown
2006-12-04 15:36:51 +00:00
parent 2e41bfd268
commit 931f94dca3
10 changed files with 397 additions and 211 deletions

View File

@@ -1058,9 +1058,13 @@ static int ef1002_i2c_read_bit ( struct bit_basher *basher,
return ( EFAB_DWORD_FIELD ( reg, EF1_EEPROM ) & mask );
}
static struct bit_basher_operations ef1002_basher_ops = {
.read = ef1002_i2c_read_bit,
.write = ef1002_i2c_write_bit,
};
static void ef1002_init_eeprom ( struct efab_nic *efab ) {
efab->ef1002_i2c.basher.write = ef1002_i2c_write_bit;
efab->ef1002_i2c.basher.read = ef1002_i2c_read_bit;
efab->ef1002_i2c.basher.op = &ef1002_basher_ops;
init_i2c_bit_basher ( &efab->ef1002_i2c );
efab->ef1002_eeprom.address = EF1_EEPROM_I2C_ID;
}