mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
i2c: do not enable fall back to Host Notify by default
Falling back unconditionally to HostNotify as primary client's interrupt breaks some drivers which alter their functionality depending on whether interrupt is present or not, so let's introduce a board flag telling I2C core explicitly if we want wired interrupt or HostNotify-based one: I2C_CLIENT_HOST_NOTIFY. For DT-based systems we introduce "host-notify" property that we convert to I2C_CLIENT_HOST_NOTIFY board flag. Tested-by: Benjamin Tissoires <[email protected]> Signed-off-by: Dmitry Torokhov <[email protected]> Acked-by: Pali Rohár <[email protected]> Acked-by: Rob Herring <[email protected]> Signed-off-by: Wolfram Sang <[email protected]>
This commit is contained in:
parent
30f939feae
commit
331c342552
3 changed files with 17 additions and 9 deletions
|
|
@ -931,7 +931,10 @@ static int i2c_device_probe(struct device *dev)
|
|||
if (!client->irq) {
|
||||
int irq = -ENOENT;
|
||||
|
||||
if (dev->of_node) {
|
||||
if (client->flags & I2C_CLIENT_HOST_NOTIFY) {
|
||||
dev_dbg(dev, "Using Host Notify IRQ\n");
|
||||
irq = i2c_smbus_host_notify_to_irq(client);
|
||||
} else if (dev->of_node) {
|
||||
irq = of_irq_get_byname(dev->of_node, "irq");
|
||||
if (irq == -EINVAL || irq == -ENODATA)
|
||||
irq = of_irq_get(dev->of_node, 0);
|
||||
|
|
@ -940,14 +943,7 @@ static int i2c_device_probe(struct device *dev)
|
|||
}
|
||||
if (irq == -EPROBE_DEFER)
|
||||
return irq;
|
||||
/*
|
||||
* ACPI and OF did not find any useful IRQ, try to see
|
||||
* if Host Notify can be used.
|
||||
*/
|
||||
if (irq < 0) {
|
||||
dev_dbg(dev, "Using Host Notify IRQ\n");
|
||||
irq = i2c_smbus_host_notify_to_irq(client);
|
||||
}
|
||||
|
||||
if (irq < 0)
|
||||
irq = 0;
|
||||
|
||||
|
|
@ -1716,6 +1712,9 @@ static struct i2c_client *of_i2c_register_device(struct i2c_adapter *adap,
|
|||
info.of_node = of_node_get(node);
|
||||
info.archdata = &dev_ad;
|
||||
|
||||
if (of_property_read_bool(node, "host-notify"))
|
||||
info.flags |= I2C_CLIENT_HOST_NOTIFY;
|
||||
|
||||
if (of_get_property(node, "wakeup-source", NULL))
|
||||
info.flags |= I2C_CLIENT_WAKE;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue