2019-05-01 23:57:25 +08:00
|
|
|
/* SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause) */
|
|
|
|
/* Copyright(c) 2015-17 Intel Corporation. */
|
2017-12-14 13:49:43 +08:00
|
|
|
|
|
|
|
#ifndef __SDW_INTEL_LOCAL_H
|
|
|
|
#define __SDW_INTEL_LOCAL_H
|
|
|
|
|
|
|
|
/**
|
2019-12-12 09:45:01 +08:00
|
|
|
* struct sdw_intel_link_res - Soundwire Intel link resource structure,
|
|
|
|
* typically populated by the controller driver.
|
|
|
|
* @pdev: platform_device
|
|
|
|
* @mmio_base: mmio base of SoundWire registers
|
2017-12-14 13:49:43 +08:00
|
|
|
* @registers: Link IO registers base
|
|
|
|
* @shim: Audio shim pointer
|
|
|
|
* @alh: ALH (Audio Link Hub) pointer
|
|
|
|
* @irq: Interrupt line
|
2018-04-26 21:09:05 +08:00
|
|
|
* @ops: Shim callback ops
|
2019-12-12 09:45:02 +08:00
|
|
|
* @dev: device implementing hw_params and free callbacks
|
2020-07-16 23:09:40 +08:00
|
|
|
* @shim_lock: mutex to handle access to shared SHIM registers
|
|
|
|
* @shim_mask: global pointer to check SHIM register initialization
|
2020-07-16 23:09:45 +08:00
|
|
|
* @cdns: Cadence master descriptor
|
|
|
|
* @list: used to walk-through all masters exposed by the same controller
|
2017-12-14 13:49:43 +08:00
|
|
|
*/
|
|
|
|
struct sdw_intel_link_res {
|
2019-12-12 09:45:01 +08:00
|
|
|
struct platform_device *pdev;
|
|
|
|
void __iomem *mmio_base; /* not strictly needed, useful for debug */
|
2017-12-14 13:49:43 +08:00
|
|
|
void __iomem *registers;
|
|
|
|
void __iomem *shim;
|
|
|
|
void __iomem *alh;
|
|
|
|
int irq;
|
2018-04-26 21:09:05 +08:00
|
|
|
const struct sdw_intel_ops *ops;
|
2019-12-12 09:45:02 +08:00
|
|
|
struct device *dev;
|
2020-07-16 23:09:40 +08:00
|
|
|
struct mutex *shim_lock; /* protect shared registers */
|
|
|
|
u32 *shim_mask;
|
2020-07-16 23:09:45 +08:00
|
|
|
struct sdw_cdns *cdns;
|
|
|
|
struct list_head list;
|
2017-12-14 13:49:43 +08:00
|
|
|
};
|
|
|
|
|
2020-06-01 02:20:57 +08:00
|
|
|
struct sdw_intel {
|
|
|
|
struct sdw_cdns cdns;
|
|
|
|
int instance;
|
|
|
|
struct sdw_intel_link_res *link_res;
|
|
|
|
#ifdef CONFIG_DEBUG_FS
|
|
|
|
struct dentry *debugfs;
|
|
|
|
#endif
|
|
|
|
};
|
|
|
|
|
|
|
|
#define SDW_INTEL_QUIRK_MASK_BUS_DISABLE BIT(1)
|
|
|
|
|
2020-06-01 02:21:02 +08:00
|
|
|
int intel_master_startup(struct platform_device *pdev);
|
|
|
|
|
2017-12-14 13:49:43 +08:00
|
|
|
#endif /* __SDW_INTEL_LOCAL_H */
|