mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
i2c: use an IRQ to report Host Notify events, not alert
The current SMBus Host Notify implementation relies on .alert() to relay its notifications. However, the use cases where SMBus Host Notify is needed currently is to signal data ready on touchpads. This is closer to an IRQ than a custom API through .alert(). Given that the 2 touchpad manufacturers (Synaptics and Elan) that use SMBus Host Notify don't put any data in the SMBus payload, the concept actually matches one to one. Benefits are multiple: - simpler code and API: the client will just have an IRQ, and nothing needs to be added in the adapter beside internally enabling it. - no more specific workqueue, the threading is handled by IRQ core directly (when required) - no more races when removing the device (the drivers are already required to disable irq on remove) - simpler handling for drivers: use plain regular IRQs - no more dependency on i2c-smbus for i2c-i801 (and any other adapter) - the IRQ domain is created automatically when the adapter exports the Host Notify capability - the IRQ are assign only if ACPI, OF and the caller did not assign one already - the domain is automatically destroyed on remove - fewer lines of code (minus 20, yeah!) Signed-off-by: Benjamin Tissoires <[email protected]> Signed-off-by: Wolfram Sang <[email protected]>
This commit is contained in:
parent
c912a25a5a
commit
4d5538f588
7 changed files with 133 additions and 158 deletions
|
|
@ -200,10 +200,14 @@ alerting device's address.
|
|||
[S] [HostAddr] [Wr] A [DevAddr] A [DataLow] A [DataHigh] A [P]
|
||||
|
||||
This is implemented in the following way in the Linux kernel:
|
||||
* I2C bus drivers which support SMBus Host Notify should call
|
||||
i2c_setup_smbus_host_notify() to setup SMBus Host Notify support.
|
||||
* I2C drivers for devices which can trigger SMBus Host Notify should implement
|
||||
the optional alert() callback.
|
||||
* I2C bus drivers which support SMBus Host Notify should report
|
||||
I2C_FUNC_SMBUS_HOST_NOTIFY.
|
||||
* I2C bus drivers trigger SMBus Host Notify by a call to
|
||||
i2c_handle_smbus_host_notify().
|
||||
* I2C drivers for devices which can trigger SMBus Host Notify will have
|
||||
client->irq assigned to a Host Notify IRQ if noone else specified an other.
|
||||
|
||||
There is currently no way to retrieve the data parameter from the client.
|
||||
|
||||
|
||||
Packet Error Checking (PEC)
|
||||
|
|
|
|||
Loading…
Reference in a new issue