From b9bb3fdf4e870fb655064f5c3c81c1fee7fd89ce Mon Sep 17 00:00:00 2001 From: Charles Keepax Date: Fri, 19 Oct 2018 09:59:57 +0100 Subject: i2c: Remove unnecessary call to irq_find_mapping irq_create_mapping calls irq_find_mapping internally and will use the found mapping if one exists, so there is no need to manually call this from i2c_smbus_host_notify_to_irq. Signed-off-by: Charles Keepax Reviewed-by: Benjamin Tissoires Signed-off-by: Wolfram Sang --- drivers/i2c/i2c-core-base.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/i2c/i2c-core-base.c b/drivers/i2c/i2c-core-base.c index dc78aa7369de..656f0a6fe3ad 100644 --- a/drivers/i2c/i2c-core-base.c +++ b/drivers/i2c/i2c-core-base.c @@ -306,10 +306,7 @@ static int i2c_smbus_host_notify_to_irq(const struct i2c_client *client) if (client->flags & I2C_CLIENT_TEN) return -EINVAL; - irq = irq_find_mapping(adap->host_notify_domain, client->addr); - if (!irq) - irq = irq_create_mapping(adap->host_notify_domain, - client->addr); + irq = irq_create_mapping(adap->host_notify_domain, client->addr); return irq > 0 ? irq : -ENXIO; } -- cgit v1.2.3 From 6f108dd70d3010c391c1e9f56f3f20d1f9e75450 Mon Sep 17 00:00:00 2001 From: Charles Keepax Date: Fri, 19 Oct 2018 09:59:58 +0100 Subject: i2c: Clear client->irq in i2c_device_remove The IRQ will be mapped in i2c_device_probe only if client->irq is zero and i2c_device_remove does not clear this. When rebinding an I2C device, whos IRQ provider has also been rebound this means that an IRQ mapping will never be created, causing the I2C device to fail to acquire its IRQ. Fix this issue by clearing client->irq in i2c_device_remove, forcing i2c_device_probe to lookup the mapping again. Signed-off-by: Charles Keepax Reviewed-by: Benjamin Tissoires Signed-off-by: Wolfram Sang --- drivers/i2c/i2c-core-base.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/i2c/i2c-core-base.c b/drivers/i2c/i2c-core-base.c index 656f0a6fe3ad..28460f6a60cc 100644 --- a/drivers/i2c/i2c-core-base.c +++ b/drivers/i2c/i2c-core-base.c @@ -430,6 +430,8 @@ static int i2c_device_remove(struct device *dev) dev_pm_clear_wake_irq(&client->dev); device_init_wakeup(&client->dev, false); + client->irq = 0; + return status; } -- cgit v1.2.3 From 69819c7fc836e17a870a23a54b885a44afc89d85 Mon Sep 17 00:00:00 2001 From: "A.s. Dong" Date: Tue, 30 Oct 2018 15:28:11 +0000 Subject: dt-bindings: i2c: i2c-imx-lpi2c: add imx8qxp compatible string Add imx8qxp compatible string Reviewed-by: Rob Herring Signed-off-by: Dong Aisheng Signed-off-by: Wolfram Sang --- Documentation/devicetree/bindings/i2c/i2c-imx-lpi2c.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/i2c/i2c-imx-lpi2c.txt b/Documentation/devicetree/bindings/i2c/i2c-imx-lpi2c.txt index 091c8dfd3229..b245363d6d60 100644 --- a/Documentation/devicetree/bindings/i2c/i2c-imx-lpi2c.txt +++ b/Documentation/devicetree/bindings/i2c/i2c-imx-lpi2c.txt @@ -3,6 +3,7 @@ Required properties: - compatible : - "fsl,imx7ulp-lpi2c" for LPI2C compatible with the one integrated on i.MX7ULP soc + - "fsl,imx8qxp-lpi2c" for LPI2C compatible with the one integrated on i.MX8QXP soc - reg : address and length of the lpi2c master registers - interrupts : lpi2c interrupt - clocks : lpi2c clock specifier -- cgit v1.2.3 From 012ebc3b7801fcf424d0ebb4689c98f90a8593e0 Mon Sep 17 00:00:00 2001 From: "A.s. Dong" Date: Tue, 30 Oct 2018 15:28:14 +0000 Subject: MAINTAINERS: add maintainer for IMX LPI2C driver The LPI2C is used in IMX7ULP/MX8 SoCs. Signed-off-by: Dong Aisheng Signed-off-by: Wolfram Sang --- MAINTAINERS | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 1c0f771b859e..5d581e0dd017 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -5871,6 +5871,14 @@ L: linux-i2c@vger.kernel.org S: Maintained F: drivers/i2c/busses/i2c-cpm.c +FREESCALE IMX LPI2C DRIVER +M: Dong Aisheng +L: linux-i2c@vger.kernel.org +L: linux-imx@nxp.com +S: Maintained +F: drivers/i2c/busses/i2c-imx-lpi2c.c +F: Documentation/devicetree/bindings/i2c/i2c-imx-lpi2c.txt + FREESCALE IMX / MXC FEC DRIVER M: Fugang Duan L: netdev@vger.kernel.org -- cgit v1.2.3