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

@@ -7,8 +7,10 @@
*
*/
/** A bit-bashing interface */
struct bit_basher {
struct bit_basher;
/** Bit-bashing operations */
struct bit_basher_operations {
/**
* Set/clear output bit
*
@@ -35,6 +37,12 @@ struct bit_basher {
int ( * read ) ( struct bit_basher *basher, unsigned int bit_id );
};
/** A bit-bashing interface */
struct bit_basher {
/** Bit-bashing operations */
struct bit_basher_operations *op;
};
extern void write_bit ( struct bit_basher *basher, unsigned int bit_id,
unsigned long data );
extern int read_bit ( struct bit_basher *basher, unsigned int bit_id );