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.
|
|
|
|
* @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-08-17 23:29:18 +08:00
|
|
|
* @clock_stop_quirks: mask defining requested behavior on pm_suspend
|
2020-09-01 23:05:55 +08:00
|
|
|
* @link_mask: global mask needed for power-up/down sequences
|
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
|
|
|
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-08-17 23:29:18 +08:00
|
|
|
u32 clock_stop_quirks;
|
2020-09-01 23:05:55 +08:00
|
|
|
u32 link_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;
|
2021-08-18 10:49:53 +08:00
|
|
|
bool startup_done;
|
2020-06-01 02:20:57 +08:00
|
|
|
#ifdef CONFIG_DEBUG_FS
|
|
|
|
struct dentry *debugfs;
|
|
|
|
#endif
|
|
|
|
};
|
|
|
|
|
2021-05-11 13:21:32 +08:00
|
|
|
int intel_link_startup(struct auxiliary_device *auxdev);
|
|
|
|
int intel_link_process_wakeen_event(struct auxiliary_device *auxdev);
|
|
|
|
|
|
|
|
struct sdw_intel_link_dev {
|
|
|
|
struct auxiliary_device auxdev;
|
|
|
|
struct sdw_intel_link_res link_res;
|
|
|
|
};
|
|
|
|
|
|
|
|
#define auxiliary_dev_to_sdw_intel_link_dev(auxiliary_dev) \
|
|
|
|
container_of(auxiliary_dev, struct sdw_intel_link_dev, auxdev)
|
2020-06-01 02:21:02 +08:00
|
|
|
|
2017-12-14 13:49:43 +08:00
|
|
|
#endif /* __SDW_INTEL_LOCAL_H */
|