^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /* SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) /* Copyright(c) 2015-17 Intel Corporation. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) #ifndef __SDW_INTEL_LOCAL_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) #define __SDW_INTEL_LOCAL_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) * struct sdw_intel_link_res - Soundwire Intel link resource structure,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) * typically populated by the controller driver.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) * @pdev: platform_device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) * @mmio_base: mmio base of SoundWire registers
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) * @registers: Link IO registers base
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) * @shim: Audio shim pointer
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) * @alh: ALH (Audio Link Hub) pointer
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) * @irq: Interrupt line
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) * @ops: Shim callback ops
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) * @dev: device implementing hw_params and free callbacks
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) * @shim_lock: mutex to handle access to shared SHIM registers
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) * @shim_mask: global pointer to check SHIM register initialization
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) * @clock_stop_quirks: mask defining requested behavior on pm_suspend
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) * @link_mask: global mask needed for power-up/down sequences
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) * @cdns: Cadence master descriptor
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) * @list: used to walk-through all masters exposed by the same controller
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) struct sdw_intel_link_res {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) struct platform_device *pdev;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) void __iomem *mmio_base; /* not strictly needed, useful for debug */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) void __iomem *registers;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) void __iomem *shim;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) void __iomem *alh;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) int irq;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) const struct sdw_intel_ops *ops;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) struct device *dev;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) struct mutex *shim_lock; /* protect shared registers */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) u32 *shim_mask;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) u32 clock_stop_quirks;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) u32 link_mask;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) struct sdw_cdns *cdns;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) struct list_head list;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) struct sdw_intel {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) struct sdw_cdns cdns;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) int instance;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) struct sdw_intel_link_res *link_res;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) #ifdef CONFIG_DEBUG_FS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) struct dentry *debugfs;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) #define SDW_INTEL_QUIRK_MASK_BUS_DISABLE BIT(1)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) int intel_master_startup(struct platform_device *pdev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) int intel_master_process_wakeen_event(struct platform_device *pdev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) #endif /* __SDW_INTEL_LOCAL_H */