blob: 4ea3d262d249772871cdfb5f7491ac215615380f [file] [log] [blame]
Pierre-Louis Bossart23859462019-05-01 10:57:25 -05001/* SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause) */
2/* Copyright(c) 2015-17 Intel Corporation. */
Vinod Koul71bb8a12017-12-14 11:19:43 +05303
4#ifndef __SDW_INTEL_LOCAL_H
5#define __SDW_INTEL_LOCAL_H
6
7/**
Pierre-Louis Bossartf98f6902019-12-11 19:45:01 -06008 * 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
Vinod Koul71bb8a12017-12-14 11:19:43 +053012 * @registers: Link IO registers base
13 * @shim: Audio shim pointer
14 * @alh: ALH (Audio Link Hub) pointer
15 * @irq: Interrupt line
Vinod Koulc46302e2018-04-26 18:39:05 +053016 * @ops: Shim callback ops
Rander Wang4b206d32019-12-11 19:45:02 -060017 * @dev: device implementing hw_params and free callbacks
Pierre-Louis Bossart4a17c442020-07-16 23:09:40 +080018 * @shim_lock: mutex to handle access to shared SHIM registers
19 * @shim_mask: global pointer to check SHIM register initialization
Bard Liao4a98a6b2020-07-16 23:09:45 +080020 * @cdns: Cadence master descriptor
21 * @list: used to walk-through all masters exposed by the same controller
Vinod Koul71bb8a12017-12-14 11:19:43 +053022 */
23struct sdw_intel_link_res {
Pierre-Louis Bossartf98f6902019-12-11 19:45:01 -060024 struct platform_device *pdev;
25 void __iomem *mmio_base; /* not strictly needed, useful for debug */
Vinod Koul71bb8a12017-12-14 11:19:43 +053026 void __iomem *registers;
27 void __iomem *shim;
28 void __iomem *alh;
29 int irq;
Vinod Koulc46302e2018-04-26 18:39:05 +053030 const struct sdw_intel_ops *ops;
Rander Wang4b206d32019-12-11 19:45:02 -060031 struct device *dev;
Pierre-Louis Bossart4a17c442020-07-16 23:09:40 +080032 struct mutex *shim_lock; /* protect shared registers */
33 u32 *shim_mask;
Bard Liao4a98a6b2020-07-16 23:09:45 +080034 struct sdw_cdns *cdns;
35 struct list_head list;
Vinod Koul71bb8a12017-12-14 11:19:43 +053036};
37
Pierre-Louis Bossartb6109dd2020-06-01 02:20:57 +080038struct sdw_intel {
39 struct sdw_cdns cdns;
40 int instance;
41 struct sdw_intel_link_res *link_res;
42#ifdef CONFIG_DEBUG_FS
43 struct dentry *debugfs;
44#endif
45};
46
47#define SDW_INTEL_QUIRK_MASK_BUS_DISABLE BIT(1)
48
Pierre-Louis Bossart6d2c6662020-06-01 02:21:02 +080049int intel_master_startup(struct platform_device *pdev);
Rander Wangab2c9132020-07-16 23:09:46 +080050int intel_master_process_wakeen_event(struct platform_device *pdev);
Pierre-Louis Bossart6d2c6662020-06-01 02:21:02 +080051
Vinod Koul71bb8a12017-12-14 11:19:43 +053052#endif /* __SDW_INTEL_LOCAL_H */