]> Git Repo - linux.git/blob - drivers/i3c/master/dw-i3c-master.h
i3c: dw: Add infrastructure for platform-specific implementations
[linux.git] / drivers / i3c / master / dw-i3c-master.h
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3  * Copyright (c) 2023 Code Construct
4  *
5  * Author: Jeremy Kerr <[email protected]>
6  */
7
8 #include <linux/clk.h>
9 #include <linux/i3c/master.h>
10 #include <linux/reset.h>
11 #include <linux/types.h>
12
13 #define DW_I3C_MAX_DEVS 32
14
15 struct dw_i3c_master_caps {
16         u8 cmdfifodepth;
17         u8 datafifodepth;
18 };
19
20 struct dw_i3c_master {
21         struct i3c_master_controller base;
22         u16 maxdevs;
23         u16 datstartaddr;
24         u32 free_pos;
25         struct {
26                 struct list_head list;
27                 struct dw_i3c_xfer *cur;
28                 spinlock_t lock;
29         } xferqueue;
30         struct dw_i3c_master_caps caps;
31         void __iomem *regs;
32         struct reset_control *core_rst;
33         struct clk *core_clk;
34         char version[5];
35         char type[5];
36         u8 addrs[DW_I3C_MAX_DEVS];
37
38         /* platform-specific data */
39         const struct dw_i3c_platform_ops *platform_ops;
40 };
41
42 struct dw_i3c_platform_ops {
43         /*
44          * Called on early bus init: the i3c has been set up, but before any
45          * transactions have taken place. Platform implementations may use to
46          * perform actual device enabling with the i3c core ready.
47          */
48         int (*init)(struct dw_i3c_master *i3c);
49 };
50
51 extern int dw_i3c_common_probe(struct dw_i3c_master *master,
52                                struct platform_device *pdev);
53 extern void dw_i3c_common_remove(struct dw_i3c_master *master);
54
This page took 0.034826 seconds and 4 git commands to generate.