1 /* SPDX-License-Identifier: GPL-2.0+ */
3 * Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved.
9 #include <linux/soundwire/sdw.h>
14 struct acp_sdw_pdata {
16 /* mutex to protect acp common register access */
17 struct mutex *acp_sdw_lock;
20 struct sdw_manager_reg_mask {
21 u32 sw_pad_enable_mask;
22 u32 sw_pad_pulldown_mask;
23 u32 acp_sdw_intr_mask;
27 * struct sdw_amd_dai_runtime: AMD sdw dai runtime data
29 * @name: SoundWire stream name
30 * @stream: stream runtime
32 * @stream_type: Stream type
34 struct sdw_amd_dai_runtime {
36 struct sdw_stream_runtime *stream;
38 enum sdw_stream_type stream_type;
42 * struct amd_sdw_manager - amd manager driver context
45 * @mmio: SoundWire registers mmio base
46 * @acp_mmio: acp registers mmio base
47 * @reg_mask: register mask structure per manager instance
48 * @amd_sdw_irq_thread: SoundWire manager irq workqueue
49 * @amd_sdw_work: peripheral status work queue
50 * @probe_work: SoundWire manager probe workqueue
51 * @acp_sdw_lock: mutex to protect acp share register access
52 * @status: peripheral devices status array
53 * @num_din_ports: number of input ports
54 * @num_dout_ports: number of output ports
55 * @cols_index: Column index in frame shape
56 * @rows_index: Rows index in frame shape
57 * @instance: SoundWire manager instance
58 * @quirks: SoundWire manager quirks
59 * @wake_en_mask: wake enable mask per SoundWire manager
60 * @power_mode_mask: flag interprets amd SoundWire manager power mode
61 * @dai_runtime_array: dai runtime array
63 struct amd_sdw_manager {
68 void __iomem *acp_mmio;
70 struct sdw_manager_reg_mask *reg_mask;
71 struct work_struct amd_sdw_irq_thread;
72 struct work_struct amd_sdw_work;
73 struct work_struct probe_work;
74 /* mutex to protect acp common register access */
75 struct mutex *acp_sdw_lock;
77 enum sdw_slave_status status[SDW_MAX_DEVICES + 1];
90 struct sdw_amd_dai_runtime **dai_runtime_array;