Skip to content

Commit 7943f1d

Browse files
andy-shevwsakernel
authored andcommitted
i2c: designware: Allow slave mode for PCI enumerated devices
Allow slave mode for PCI enumerated devices by calling a common i2c_dw_probe() instead of i2c_dw_probe_master(). While dropping dependency to platform driver in slave module, move its configuration section above, closer to core. Signed-off-by: Andy Shevchenko <[email protected]> Acked-by: Jarkko Nikula <[email protected]> Signed-off-by: Wolfram Sang <[email protected]>
1 parent bed20c8 commit 7943f1d

File tree

2 files changed

+12
-13
lines changed

2 files changed

+12
-13
lines changed

drivers/i2c/busses/Kconfig

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -527,6 +527,16 @@ config I2C_DAVINCI
527527
config I2C_DESIGNWARE_CORE
528528
tristate
529529

530+
config I2C_DESIGNWARE_SLAVE
531+
bool "Synopsys DesignWare Slave"
532+
select I2C_SLAVE
533+
help
534+
If you say yes to this option, support will be included for the
535+
Synopsys DesignWare I2C slave adapter.
536+
537+
This is not a standalone module, this module compiles together with
538+
i2c-designware-core.
539+
530540
config I2C_DESIGNWARE_PLATFORM
531541
tristate "Synopsys DesignWare Platform"
532542
select I2C_DESIGNWARE_CORE
@@ -538,17 +548,6 @@ config I2C_DESIGNWARE_PLATFORM
538548
This driver can also be built as a module. If so, the module
539549
will be called i2c-designware-platform.
540550

541-
config I2C_DESIGNWARE_SLAVE
542-
bool "Synopsys DesignWare Slave"
543-
select I2C_SLAVE
544-
depends on I2C_DESIGNWARE_PLATFORM
545-
help
546-
If you say yes to this option, support will be included for the
547-
Synopsys DesignWare I2C slave adapter.
548-
549-
This is not a standalone module, this module compiles together with
550-
i2c-designware-core.
551-
552551
config I2C_DESIGNWARE_PCI
553552
tristate "Synopsys DesignWare PCI"
554553
depends on PCI

drivers/i2c/busses/i2c-designware-pcidrv.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ static int i2c_dw_pci_probe(struct pci_dev *pdev,
251251
}
252252
}
253253

254-
i2c_dw_configure_master(dev);
254+
i2c_dw_configure(dev);
255255

256256
if (controller->scl_sda_cfg) {
257257
cfg = controller->scl_sda_cfg;
@@ -271,7 +271,7 @@ static int i2c_dw_pci_probe(struct pci_dev *pdev,
271271
ACPI_COMPANION_SET(&adap->dev, ACPI_COMPANION(&pdev->dev));
272272
adap->nr = controller->bus_num;
273273

274-
r = i2c_dw_probe_master(dev);
274+
r = i2c_dw_probe(dev);
275275
if (r) {
276276
pci_free_irq_vectors(pdev);
277277
return r;

0 commit comments

Comments
 (0)