Skip to content

Commit 9d9929e

Browse files
Shyam Sundar S KAndi Shyti
authored andcommitted
i2c: piix4: Change the parameter list of piix4_transaction function
Currently, `piix4_transaction()` accepts only one parameter, which is the `i2c_adapter` information. This approach works well as long as SB800 SMBus port accesses are confined to the piix4 driver. However, with the implementation of a separate ASF driver and the varying address spaces across drivers, it is necessary to change the function parameter list of `piix4_transaction()` to include the port address. This modification allows other drivers that use piix4 to pass the specific port details they need to operate on. Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Co-developed-by: Sanket Goswami <Sanket.Goswami@amd.com> Signed-off-by: Sanket Goswami <Sanket.Goswami@amd.com> Signed-off-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com> Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
1 parent bd492b5 commit 9d9929e

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

drivers/i2c/busses/i2c-piix4.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -536,10 +536,8 @@ static int piix4_setup_aux(struct pci_dev *PIIX4_dev,
536536
return piix4_smba;
537537
}
538538

539-
static int piix4_transaction(struct i2c_adapter *piix4_adapter)
539+
static int piix4_transaction(struct i2c_adapter *piix4_adapter, unsigned short piix4_smba)
540540
{
541-
struct i2c_piix4_adapdata *adapdata = i2c_get_adapdata(piix4_adapter);
542-
unsigned short piix4_smba = adapdata->smba;
543541
int temp;
544542
int result = 0;
545543
int timeout = 0;
@@ -675,7 +673,7 @@ static s32 piix4_access(struct i2c_adapter * adap, u16 addr,
675673

676674
outb_p((size & 0x1C) + (ENABLE_INT9 & 1), SMBHSTCNT);
677675

678-
status = piix4_transaction(adap);
676+
status = piix4_transaction(adap, piix4_smba);
679677
if (status)
680678
return status;
681679

0 commit comments

Comments
 (0)