Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause) */
0002 /* Copyright(c) 2015-17 Intel Corporation. */
0003 
0004 #ifndef __SDW_INTEL_LOCAL_H
0005 #define __SDW_INTEL_LOCAL_H
0006 
0007 /**
0008  * struct sdw_intel_link_res - Soundwire Intel link resource structure,
0009  * typically populated by the controller driver.
0010  * @mmio_base: mmio base of SoundWire registers
0011  * @registers: Link IO registers base
0012  * @shim: Audio shim pointer
0013  * @alh: ALH (Audio Link Hub) pointer
0014  * @irq: Interrupt line
0015  * @ops: Shim callback ops
0016  * @dev: device implementing hw_params and free callbacks
0017  * @shim_lock: mutex to handle access to shared SHIM registers
0018  * @shim_mask: global pointer to check SHIM register initialization
0019  * @clock_stop_quirks: mask defining requested behavior on pm_suspend
0020  * @link_mask: global mask needed for power-up/down sequences
0021  * @cdns: Cadence master descriptor
0022  * @list: used to walk-through all masters exposed by the same controller
0023  */
0024 struct sdw_intel_link_res {
0025     void __iomem *mmio_base; /* not strictly needed, useful for debug */
0026     void __iomem *registers;
0027     void __iomem *shim;
0028     void __iomem *alh;
0029     int irq;
0030     const struct sdw_intel_ops *ops;
0031     struct device *dev;
0032     struct mutex *shim_lock; /* protect shared registers */
0033     u32 *shim_mask;
0034     u32 clock_stop_quirks;
0035     u32 link_mask;
0036     struct sdw_cdns *cdns;
0037     struct list_head list;
0038 };
0039 
0040 struct sdw_intel {
0041     struct sdw_cdns cdns;
0042     int instance;
0043     struct sdw_intel_link_res *link_res;
0044     bool startup_done;
0045 #ifdef CONFIG_DEBUG_FS
0046     struct dentry *debugfs;
0047 #endif
0048 };
0049 
0050 int intel_link_startup(struct auxiliary_device *auxdev);
0051 int intel_link_process_wakeen_event(struct auxiliary_device *auxdev);
0052 
0053 struct sdw_intel_link_dev {
0054     struct auxiliary_device auxdev;
0055     struct sdw_intel_link_res link_res;
0056 };
0057 
0058 #define auxiliary_dev_to_sdw_intel_link_dev(auxiliary_dev) \
0059     container_of(auxiliary_dev, struct sdw_intel_link_dev, auxdev)
0060 
0061 #endif /* __SDW_INTEL_LOCAL_H */