blob: 76820d0b9deb0bbce3e7a36273eb97288cdc8c2a [file] [log] [blame]
David Brazdil0f672f62019-12-10 10:32:29 +00001/* SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause) */
2/* Copyright(c) 2015-17 Intel Corporation. */
Andrew Scullb4b6d4a2019-01-02 15:54:55 +00003
4#ifndef __SDW_INTEL_LOCAL_H
5#define __SDW_INTEL_LOCAL_H
6
7/**
Olivier Deprez157378f2022-04-04 15:47:50 +02008 * 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
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000012 * @registers: Link IO registers base
13 * @shim: Audio shim pointer
14 * @alh: ALH (Audio Link Hub) pointer
15 * @irq: Interrupt line
16 * @ops: Shim callback ops
Olivier Deprez157378f2022-04-04 15:47:50 +020017 * @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
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000024 */
25struct sdw_intel_link_res {
Olivier Deprez157378f2022-04-04 15:47:50 +020026 struct platform_device *pdev;
27 void __iomem *mmio_base; /* not strictly needed, useful for debug */
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000028 void __iomem *registers;
29 void __iomem *shim;
30 void __iomem *alh;
31 int irq;
32 const struct sdw_intel_ops *ops;
Olivier Deprez157378f2022-04-04 15:47:50 +020033 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;
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000040};
41
Olivier Deprez157378f2022-04-04 15:47:50 +020042struct 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
53int intel_master_startup(struct platform_device *pdev);
54int intel_master_process_wakeen_event(struct platform_device *pdev);
55
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000056#endif /* __SDW_INTEL_LOCAL_H */