Commit | Line | Data |
---|---|---|
23859465 PLB |
1 | /* SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause) */ |
2 | /* Copyright(c) 2015-17 Intel Corporation. */ | |
71bb8a1b VK |
3 | |
4 | #ifndef __SDW_INTEL_LOCAL_H | |
5 | #define __SDW_INTEL_LOCAL_H | |
6 | ||
7 | /** | |
f98f690f PLB |
8 | * struct sdw_intel_link_res - Soundwire Intel link resource structure, |
9 | * typically populated by the controller driver. | |
b3ad31f3 | 10 | * @hw_ops: platform-specific ops |
f98f690f | 11 | * @mmio_base: mmio base of SoundWire registers |
71bb8a1b VK |
12 | * @registers: Link IO registers base |
13 | * @shim: Audio shim pointer | |
14 | * @alh: ALH (Audio Link Hub) pointer | |
15 | * @irq: Interrupt line | |
c46302ec | 16 | * @ops: Shim callback ops |
4b206d34 | 17 | * @dev: device implementing hw_params and free callbacks |
4a17c441 PLB |
18 | * @shim_lock: mutex to handle access to shared SHIM registers |
19 | * @shim_mask: global pointer to check SHIM register initialization | |
a320f41e | 20 | * @clock_stop_quirks: mask defining requested behavior on pm_suspend |
de763fa8 | 21 | * @link_mask: global mask needed for power-up/down sequences |
4a98a6b2 BL |
22 | * @cdns: Cadence master descriptor |
23 | * @list: used to walk-through all masters exposed by the same controller | |
71bb8a1b VK |
24 | */ |
25 | struct sdw_intel_link_res { | |
b3ad31f3 PLB |
26 | const struct sdw_intel_hw_ops *hw_ops; |
27 | ||
f98f690f | 28 | void __iomem *mmio_base; /* not strictly needed, useful for debug */ |
71bb8a1b VK |
29 | void __iomem *registers; |
30 | void __iomem *shim; | |
31 | void __iomem *alh; | |
32 | int irq; | |
c46302ec | 33 | const struct sdw_intel_ops *ops; |
4b206d34 | 34 | struct device *dev; |
4a17c441 PLB |
35 | struct mutex *shim_lock; /* protect shared registers */ |
36 | u32 *shim_mask; | |
a320f41e | 37 | u32 clock_stop_quirks; |
de763fa8 | 38 | u32 link_mask; |
4a98a6b2 BL |
39 | struct sdw_cdns *cdns; |
40 | struct list_head list; | |
71bb8a1b VK |
41 | }; |
42 | ||
b6109dd6 PLB |
43 | struct sdw_intel { |
44 | struct sdw_cdns cdns; | |
45 | int instance; | |
46 | struct sdw_intel_link_res *link_res; | |
e4401abb | 47 | bool startup_done; |
b6109dd6 PLB |
48 | #ifdef CONFIG_DEBUG_FS |
49 | struct dentry *debugfs; | |
50 | #endif | |
51 | }; | |
52 | ||
29a269c6 PLB |
53 | int intel_link_startup(struct auxiliary_device *auxdev); |
54 | int intel_link_process_wakeen_event(struct auxiliary_device *auxdev); | |
55 | ||
56 | struct sdw_intel_link_dev { | |
57 | struct auxiliary_device auxdev; | |
58 | struct sdw_intel_link_res link_res; | |
59 | }; | |
60 | ||
61 | #define auxiliary_dev_to_sdw_intel_link_dev(auxiliary_dev) \ | |
62 | container_of(auxiliary_dev, struct sdw_intel_link_dev, auxdev) | |
6d2c6669 | 63 | |
71bb8a1b | 64 | #endif /* __SDW_INTEL_LOCAL_H */ |