Commit 7943f1d1 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Wolfram Sang

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: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: default avatarJarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: default avatarWolfram Sang <wsa@kernel.org>
parent bed20c84
...@@ -527,6 +527,16 @@ config I2C_DAVINCI ...@@ -527,6 +527,16 @@ config I2C_DAVINCI
config I2C_DESIGNWARE_CORE config I2C_DESIGNWARE_CORE
tristate tristate
config I2C_DESIGNWARE_SLAVE
bool "Synopsys DesignWare Slave"
select I2C_SLAVE
help
If you say yes to this option, support will be included for the
Synopsys DesignWare I2C slave adapter.
This is not a standalone module, this module compiles together with
i2c-designware-core.
config I2C_DESIGNWARE_PLATFORM config I2C_DESIGNWARE_PLATFORM
tristate "Synopsys DesignWare Platform" tristate "Synopsys DesignWare Platform"
select I2C_DESIGNWARE_CORE select I2C_DESIGNWARE_CORE
...@@ -538,17 +548,6 @@ config I2C_DESIGNWARE_PLATFORM ...@@ -538,17 +548,6 @@ config I2C_DESIGNWARE_PLATFORM
This driver can also be built as a module. If so, the module This driver can also be built as a module. If so, the module
will be called i2c-designware-platform. will be called i2c-designware-platform.
config I2C_DESIGNWARE_SLAVE
bool "Synopsys DesignWare Slave"
select I2C_SLAVE
depends on I2C_DESIGNWARE_PLATFORM
help
If you say yes to this option, support will be included for the
Synopsys DesignWare I2C slave adapter.
This is not a standalone module, this module compiles together with
i2c-designware-core.
config I2C_DESIGNWARE_PCI config I2C_DESIGNWARE_PCI
tristate "Synopsys DesignWare PCI" tristate "Synopsys DesignWare PCI"
depends on PCI depends on PCI
......
...@@ -251,7 +251,7 @@ static int i2c_dw_pci_probe(struct pci_dev *pdev, ...@@ -251,7 +251,7 @@ static int i2c_dw_pci_probe(struct pci_dev *pdev,
} }
} }
i2c_dw_configure_master(dev); i2c_dw_configure(dev);
if (controller->scl_sda_cfg) { if (controller->scl_sda_cfg) {
cfg = controller->scl_sda_cfg; cfg = controller->scl_sda_cfg;
...@@ -271,7 +271,7 @@ static int i2c_dw_pci_probe(struct pci_dev *pdev, ...@@ -271,7 +271,7 @@ static int i2c_dw_pci_probe(struct pci_dev *pdev,
ACPI_COMPANION_SET(&adap->dev, ACPI_COMPANION(&pdev->dev)); ACPI_COMPANION_SET(&adap->dev, ACPI_COMPANION(&pdev->dev));
adap->nr = controller->bus_num; adap->nr = controller->bus_num;
r = i2c_dw_probe_master(dev); r = i2c_dw_probe(dev);
if (r) { if (r) {
pci_free_irq_vectors(pdev); pci_free_irq_vectors(pdev);
return r; return r;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment