Commit e389b1d7 authored by Jeremy Kerr's avatar Jeremy Kerr Committed by Alexandre Belloni

i3c: dw: Add support for in-band interrupts

This change adds support for receiving and dequeueing i3c IBIs.

By setting struct dw_i3c_master->ibi_capable before probe, a platform
implementation can select the IBI-enabled version of the i3c_master_ops,
enabling the global IBI infrastrcture for that controller.
Signed-off-by: default avatarJeremy Kerr <jk@codeconstruct.com.au>
Reviewed-by: default avatarJoel Stanley <joel@jms.id.au>
Link: https://lore.kernel.org/r/79daeefd7ccb7c935d0c159149df21a6c9a73ffa.1680161823.git.jk@codeconstruct.com.auSigned-off-by: default avatarAlexandre Belloni <alexandre.belloni@bootlin.com>
parent e2d43101
This diff is collapsed.
......@@ -19,6 +19,7 @@ struct dw_i3c_master_caps {
struct dw_i3c_dat_entry {
u8 addr;
struct i3c_dev_desc *ibi_dev;
};
struct dw_i3c_master {
......@@ -37,12 +38,22 @@ struct dw_i3c_master {
struct clk *core_clk;
char version[5];
char type[5];
bool ibi_capable;
/*
* Per-device hardware data, used to manage the device address table
* (DAT)
*
* Locking: the devs array may be referenced in IRQ context while
* processing an IBI. However, IBIs (for a specific device, which
* implies a specific DAT entry) can only happen while interrupts are
* requested for that device, which is serialised against other
* insertions/removals from the array by the global i3c infrastructure.
* So, devs_lock protects against concurrent updates to devs->ibi_dev
* between request_ibi/free_ibi and the IBI irq event.
*/
struct dw_i3c_dat_entry devs[DW_I3C_MAX_DEVS];
spinlock_t devs_lock;
/* platform-specific data */
const struct dw_i3c_platform_ops *platform_ops;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment