[PATCH] 1/5 powerpc: Rework PowerMac i2c part 1
This is the first part of a rework of the PowerMac i2c code. It completely reworks the "low_i2c" layer. It is now more flexible, supports KeyWest, SMU and PMU i2c busses, and provides functions to match device nodes to i2c busses and adapters. This patch also extends & fix some bugs in the SMU driver related to i2c support and removes the clock spreading hacks from the pmac feature code rather than adapting them to the new API since they'll be replaced by the platform function code completely in patch 3/5 Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
This commit is contained in:
committed by
Paul Mackerras
parent
002ec58eb5
commit
730745a5c4
@@ -358,6 +358,9 @@ extern unsigned long smu_cmdbuf_abs;
|
||||
* Kenrel asynchronous i2c interface
|
||||
*/
|
||||
|
||||
#define SMU_I2C_READ_MAX 0x1d
|
||||
#define SMU_I2C_WRITE_MAX 0x15
|
||||
|
||||
/* SMU i2c header, exactly matches i2c header on wire */
|
||||
struct smu_i2c_param
|
||||
{
|
||||
@@ -368,12 +371,9 @@ struct smu_i2c_param
|
||||
u8 subaddr[3]; /* subaddress */
|
||||
u8 caddr; /* combined address, filled by SMU driver */
|
||||
u8 datalen; /* length of transfer */
|
||||
u8 data[7]; /* data */
|
||||
u8 data[SMU_I2C_READ_MAX]; /* data */
|
||||
};
|
||||
|
||||
#define SMU_I2C_READ_MAX 0x0d
|
||||
#define SMU_I2C_WRITE_MAX 0x05
|
||||
|
||||
struct smu_i2c_cmd
|
||||
{
|
||||
/* public */
|
||||
@@ -387,7 +387,7 @@ struct smu_i2c_cmd
|
||||
int read;
|
||||
int stage;
|
||||
int retries;
|
||||
u8 pdata[0x10];
|
||||
u8 pdata[32];
|
||||
struct list_head link;
|
||||
};
|
||||
|
||||
@@ -519,7 +519,7 @@ struct smu_sdbp_cpupiddata {
|
||||
* if not found. The data format is described below
|
||||
*/
|
||||
extern struct smu_sdbp_header *smu_get_sdb_partition(int id,
|
||||
unsigned int *size);
|
||||
unsigned int *size);
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user