i3c: dw: Add infrastructure for platform-specific implementations
authorJeremy Kerr <jk@codeconstruct.com.au>
Fri, 31 Mar 2023 09:14:59 +0000 (17:14 +0800)
committerAlexandre Belloni <alexandre.belloni@bootlin.com>
Fri, 28 Apr 2023 06:18:53 +0000 (08:18 +0200)
commitd782188cbb05a196e46a4838484f020ceeb889ec
treed491cf6924e40a862ca3bf9138ad2395111dfe5f
parent66b32e3d2c6daeeafb80fa41f3a41e4c0ab85cc6
i3c: dw: Add infrastructure for platform-specific implementations

The dw i3c core can be integrated into various SoC devices. Platforms
that use this core may need a little configuration that is specific to
that platform.

Add some infrastructure to allow platform-specific behaviour: common
probe/remove functions, a set of platform hook operations, and a pointer
for platform-specific data in struct dw_i3c_master. Move the common api
into a new (i3c local) header file.

Platforms will provide their own struct platform_driver, which allocates
struct dw_i3c_master, does any platform-specific probe behaviour, and
calls into the common probe.

A future change will add new platform support that uses this
infrastructure.

Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
Reviewed-by: Joel Stanley <joel@jms.id.au>
Link: https://lore.kernel.org/r/20230331091501.3800299-2-jk@codeconstruct.com.au
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
drivers/i3c/master/dw-i3c-master.c
drivers/i3c/master/dw-i3c-master.h [new file with mode: 0644]