]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit
i2c: smbus: add core function handling SMBus host-notify
authorAlain Volmat <alain.volmat@st.com>
Mon, 3 Aug 2020 05:17:55 +0000 (07:17 +0200)
committerWolfram Sang <wsa@kernel.org>
Wed, 9 Sep 2020 08:38:28 +0000 (10:38 +0200)
commit2a71593da34d473461f2f5c3dbb53b883596188a
tree11499f7b30521f57203094e4694ccc33f27c26c2
parente6277308ac214af04516564c516a0ff5f753d009
i2c: smbus: add core function handling SMBus host-notify

SMBus Host-Notify protocol, from the adapter point of view
consist of receiving a message from a client, including the
client address and some other data.

It can be simply handled by creating a new slave device
and registering a callback performing the parsing of the
message received from the client.

This commit introduces two new core functions
  * i2c_new_slave_host_notify_device
  * i2c_free_slave_host_notify_device
that take care of registration of the new slave device and
callback and will call i2c_handle_smbus_host_notify once a
Host-Notify event is received.

Signed-off-by: Alain Volmat <alain.volmat@st.com>
Reviewed-by: Pierre-Yves MORDRET <pierre-yves.mordret@st.com>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
drivers/i2c/i2c-smbus.c
include/linux/i2c-smbus.h