Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

soundwire: intel: Add awareness of ACE3+ microphone privacy

ACE3 introduced microphone privacy and along this feature it adds a new
register in vendor specific SHIM to control and status reporting.
The control of mic privacy via the SHIM register is only to enable the
interrupt generation via soundwire, but not handled by the soundwire code
as the mic privacy is not a feature of the soundwire IP.

On the other hand, printing the register value brings value for debugging,
so add a new flag to allow this conditionally.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20250430074714.94000-2-yung-chuan.liao@linux.intel.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>

authored by

Peter Ujfalusi and committed by
Vinod Koul
e1f3f5be aab12022

+14
+2
drivers/soundwire/intel.h
··· 22 22 * @shim_lock: mutex to handle access to shared SHIM registers 23 23 * @shim_mask: global pointer to check SHIM register initialization 24 24 * @clock_stop_quirks: mask defining requested behavior on pm_suspend 25 + * @mic_privacy: ACE version supports microphone privacy 25 26 * @link_mask: global mask needed for power-up/down sequences 26 27 * @cdns: Cadence master descriptor 27 28 * @list: used to walk-through all masters exposed by the same controller ··· 43 42 struct mutex *shim_lock; /* protect shared registers */ 44 43 u32 *shim_mask; 45 44 u32 clock_stop_quirks; 45 + bool mic_privacy; 46 46 u32 link_mask; 47 47 struct sdw_cdns *cdns; 48 48 struct list_head list;
+6
drivers/soundwire/intel_ace2x_debugfs.c
··· 76 76 ret += intel_sprintf(vs_s, false, buf, ret, SDW_SHIM2_INTEL_VS_IOCTL); 77 77 ret += intel_sprintf(vs_s, false, buf, ret, SDW_SHIM2_INTEL_VS_ACTMCTL); 78 78 79 + if (sdw->link_res->mic_privacy) { 80 + ret += scnprintf(buf + ret, RD_BUF - ret, "\nVS PVCCS\n"); 81 + ret += intel_sprintf(vs_s, false, buf, ret, 82 + SDW_SHIM2_INTEL_VS_PVCCS); 83 + } 84 + 79 85 seq_printf(s_file, "%s", buf); 80 86 kfree(buf); 81 87
+1
drivers/soundwire/intel_init.c
··· 77 77 link->shim = res->mmio_base + SDW_SHIM2_GENERIC_BASE(link_id); 78 78 link->shim_vs = res->mmio_base + SDW_SHIM2_VS_BASE(link_id); 79 79 link->shim_lock = res->eml_lock; 80 + link->mic_privacy = res->mic_privacy; 80 81 } 81 82 82 83 link->ops = res->ops;
+5
include/linux/soundwire/sdw_intel.h
··· 189 189 #define SDW_SHIM3_INTEL_VS_ACTMCTL_DOAISE2 BIT(14) 190 190 #define SDW_SHIM3_INTEL_VS_ACTMCTL_CLDE BIT(15) 191 191 192 + /* ACE3+ Mic privacy control and status register */ 193 + #define SDW_SHIM2_INTEL_VS_PVCCS 0x10 194 + 192 195 /** 193 196 * struct sdw_intel_stream_params_data: configuration passed during 194 197 * the @params_stream callback, e.g. for interaction with DSP ··· 334 331 * @shim_base: sdw shim base. 335 332 * @alh_base: sdw alh base. 336 333 * @ext: extended HDaudio link support 334 + * @mic_privacy: ACE version supports microphone privacy 337 335 * @hbus: hdac_bus pointer, needed for power management 338 336 * @eml_lock: mutex protecting shared registers in the HDaudio multi-link 339 337 * space ··· 353 349 u32 shim_base; 354 350 u32 alh_base; 355 351 bool ext; 352 + bool mic_privacy; 356 353 struct hdac_bus *hbus; 357 354 struct mutex *eml_lock; 358 355 };