History log of /linux-master/drivers/i2c/i2c-core-slave.c
Revision Date Author Comments
# d714fb25 18-Mar-2022 Jae Hyun Yoo <quic_jaehyoo@quicinc.com>

i2c: add tracepoints for I2C slave events

I2C slave events tracepoints can be enabled by:

echo 1 > /sys/kernel/tracing/events/i2c_slave/enable

and logs in /sys/kernel/tracing/trace will look like:

... i2c_slave: i2c-0 a=010 ret=0 WR_REQ []
... i2c_slave: i2c-0 a=010 ret=0 WR_RCV [02]
... i2c_slave: i2c-0 a=010 ret=0 WR_RCV [0c]
... i2c_slave: i2c-0 a=010 ret=0 STOP []
... i2c_slave: i2c-0 a=010 ret=0 RD_REQ [04]
... i2c_slave: i2c-0 a=010 ret=0 RD_PRO [b4]
... i2c_slave: i2c-0 a=010 ret=0 STOP []

formatted as:

i2c-<adapter_nr>
a=<addr>
ret=<ret> <- callback return value
<event>
[<data>]

trace printings can be selected by adding a filter like:

echo adapter_nr==1 >/sys/kernel/tracing/events/i2c_slave/filter

Signed-off-by: Jae Hyun Yoo <quic_jaehyoo@quicinc.com>
Signed-off-by: Wolfram Sang <wsa@kernel.org>


# 8808981b 25-Jul-2020 Wolfram Sang <wsa+renesas@sang-engineering.com>

i2c: slave: add sanity check when unregistering

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Alain Volmat <alain.volmat@st.com>
Signed-off-by: Wolfram Sang <wsa@kernel.org>


# 1b1be3bf 25-Jul-2020 Wolfram Sang <wsa+renesas@sang-engineering.com>

i2c: slave: improve sanity check when registering

Add check for ERR_PTR and simplify code while here.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Alain Volmat <alain.volmat@st.com>
Signed-off-by: Wolfram Sang <wsa@kernel.org>


# 2874c5fd 27-May-2019 Thomas Gleixner <tglx@linutronix.de>

treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152

Based on 1 normalized pattern(s):

this program is free software you can redistribute it and or modify
it under the terms of the gnu general public license as published by
the free software foundation either version 2 of the license or at
your option any later version

extracted by the scancode license scanner the SPDX license identifier

GPL-2.0-or-later

has been chosen to replace the boilerplate/reference in 3029 file(s).

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Allison Randal <allison@lohutok.net>
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190527070032.746973796@linutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 3f3a89e1 19-Jun-2018 Peter Rosin <peda@axentia.se>

i2c: remove i2c_lock_adapter and use i2c_lock_bus directly

The i2c_lock_adapter name is ambiguous since it is unclear if it
refers to the root adapter or the adapter you name in the argument.
The natural interpretation is the adapter you name in the argument,
but there are historical reasons for that not being the case; it
in fact locks the root adapter. Just remove the function and force
users to spell out the I2C_LOCK_ROOT_ADAPTER name to indicate what
is really going on. Also remove i2c_unlock_adapter, of course.

This patch was generated with

git grep -l 'i2c_\(un\)\?lock_adapter' \
| xargs sed -i 's/i2c_\(un\)\?lock_adapter(\([^)]*\))/'\
'i2c_\1lock_bus(\2, I2C_LOCK_ROOT_ADAPTER)/g'

followed by white-space touch-up.

Signed-off-by: Peter Rosin <peda@axentia.se>
Acked-by: Jonathan Cameron <jonathan.cameron@huawei.com>
Tested-by: Sekhar Nori <nsekhar@ti.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>


# e4991ecd 23-May-2017 Wolfram Sang <wsa@kernel.org>

i2c: break out slave support into separate file

Also removes some ifdeffery.

Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>