hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/drivers/soundwire/intel.h
....@@ -1,27 +1,56 @@
1
-// SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause)
2
-// Copyright(c) 2015-17 Intel Corporation.
1
+/* SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause) */
2
+/* Copyright(c) 2015-17 Intel Corporation. */
33
44 #ifndef __SDW_INTEL_LOCAL_H
55 #define __SDW_INTEL_LOCAL_H
66
77 /**
8
- * struct sdw_intel_res - Soundwire link resources
8
+ * struct sdw_intel_link_res - Soundwire Intel link resource structure,
9
+ * typically populated by the controller driver.
10
+ * @pdev: platform_device
11
+ * @mmio_base: mmio base of SoundWire registers
912 * @registers: Link IO registers base
1013 * @shim: Audio shim pointer
1114 * @alh: ALH (Audio Link Hub) pointer
1215 * @irq: Interrupt line
1316 * @ops: Shim callback ops
14
- * @arg: Shim callback ops argument
15
- *
16
- * This is set as pdata for each link instance.
17
+ * @dev: device implementing hw_params and free callbacks
18
+ * @shim_lock: mutex to handle access to shared SHIM registers
19
+ * @shim_mask: global pointer to check SHIM register initialization
20
+ * @clock_stop_quirks: mask defining requested behavior on pm_suspend
21
+ * @link_mask: global mask needed for power-up/down sequences
22
+ * @cdns: Cadence master descriptor
23
+ * @list: used to walk-through all masters exposed by the same controller
1724 */
1825 struct sdw_intel_link_res {
26
+ struct platform_device *pdev;
27
+ void __iomem *mmio_base; /* not strictly needed, useful for debug */
1928 void __iomem *registers;
2029 void __iomem *shim;
2130 void __iomem *alh;
2231 int irq;
2332 const struct sdw_intel_ops *ops;
24
- void *arg;
33
+ struct device *dev;
34
+ struct mutex *shim_lock; /* protect shared registers */
35
+ u32 *shim_mask;
36
+ u32 clock_stop_quirks;
37
+ u32 link_mask;
38
+ struct sdw_cdns *cdns;
39
+ struct list_head list;
2540 };
2641
42
+struct sdw_intel {
43
+ struct sdw_cdns cdns;
44
+ int instance;
45
+ struct sdw_intel_link_res *link_res;
46
+#ifdef CONFIG_DEBUG_FS
47
+ struct dentry *debugfs;
48
+#endif
49
+};
50
+
51
+#define SDW_INTEL_QUIRK_MASK_BUS_DISABLE BIT(1)
52
+
53
+int intel_master_startup(struct platform_device *pdev);
54
+int intel_master_process_wakeen_event(struct platform_device *pdev);
55
+
2756 #endif /* __SDW_INTEL_LOCAL_H */