From a6d41fb9357525cdb32a2e096d323abbe9189794 Mon Sep 17 00:00:00 2001 From: Peter Ujfalusi Date: Wed, 29 Jan 2025 14:16:22 +0200 Subject: [PATCH] HACK: ptl/sdw: mic privacy force enable + register dump title says all... Signed-off-by: Peter Ujfalusi --- drivers/soundwire/intel.h | 1 + drivers/soundwire/intel_ace2x_debugfs.c | 5 +++++ drivers/soundwire/intel_init.c | 1 + include/linux/soundwire/sdw_intel.h | 7 +++++++ sound/soc/sof/intel/hda.c | 7 +++++++ 5 files changed, 21 insertions(+) diff --git a/drivers/soundwire/intel.h b/drivers/soundwire/intel.h index d44e70d3c4e3c0..deabdc0d0279f2 100644 --- a/drivers/soundwire/intel.h +++ b/drivers/soundwire/intel.h @@ -46,6 +46,7 @@ struct sdw_intel_link_res { struct sdw_cdns *cdns; struct list_head list; struct hdac_bus *hbus; + bool privacy; }; /** diff --git a/drivers/soundwire/intel_ace2x_debugfs.c b/drivers/soundwire/intel_ace2x_debugfs.c index 206a8d511ebdc7..774a71c274b9d0 100644 --- a/drivers/soundwire/intel_ace2x_debugfs.c +++ b/drivers/soundwire/intel_ace2x_debugfs.c @@ -76,6 +76,11 @@ static int intel_reg_show(struct seq_file *s_file, void *data) ret += intel_sprintf(vs_s, false, buf, ret, SDW_SHIM2_INTEL_VS_IOCTL); ret += intel_sprintf(vs_s, false, buf, ret, SDW_SHIM2_INTEL_VS_ACTMCTL); + if (sdw->link_res->privacy) { + ret += scnprintf(buf + ret, RD_BUF - ret, "\nVS PVCCS\n"); + ret += intel_sprintf(vs_s, false, buf, ret, SDW_SHIM2_INTEL_VS_PVCCS); + } + seq_printf(s_file, "%s", buf); kfree(buf); diff --git a/drivers/soundwire/intel_init.c b/drivers/soundwire/intel_init.c index 5f53666514a45a..99466d11a5275c 100644 --- a/drivers/soundwire/intel_init.c +++ b/drivers/soundwire/intel_init.c @@ -64,6 +64,7 @@ static struct sdw_intel_link_dev *intel_link_dev_register(struct sdw_intel_res * link = &ldev->link_res; link->hw_ops = res->hw_ops; link->mmio_base = res->mmio_base; + link->privacy = res->privacy; if (!res->ext) { link->registers = res->mmio_base + SDW_LINK_BASE + (SDW_LINK_SIZE * link_id); diff --git a/include/linux/soundwire/sdw_intel.h b/include/linux/soundwire/sdw_intel.h index 50f994da4c48eb..7ca6f91818b8a4 100644 --- a/include/linux/soundwire/sdw_intel.h +++ b/include/linux/soundwire/sdw_intel.h @@ -189,6 +189,12 @@ #define SDW_SHIM3_INTEL_VS_ACTMCTL_DOAISE2 BIT(14) #define SDW_SHIM3_INTEL_VS_ACTMCTL_CLDE BIT(15) +#define SDW_SHIM2_INTEL_VS_PVCCS 0x10 +#define SDW_SHIM2_INTEL_VS_PVCCS_MDSTSCHGIE BIT(0) +#define SDW_SHIM2_INTEL_VS_PVCCS_MDSTSCHG BIT(8) +#define SDW_SHIM2_INTEL_VS_PVCCS_MDSTS BIT(9) +#define SDW_SHIM2_INTEL_VS_PVCCS_FMDIS BIT(10) + /** * struct sdw_intel_stream_params_data: configuration passed during * the @params_stream callback, e.g. for interaction with DSP @@ -351,6 +357,7 @@ struct sdw_intel_res { u32 shim_base; u32 alh_base; bool ext; + bool privacy; struct hdac_bus *hbus; struct mutex *eml_lock; }; diff --git a/sound/soc/sof/intel/hda.c b/sound/soc/sof/intel/hda.c index b5b9d5dcdee8da..1d925e2e7c3956 100644 --- a/sound/soc/sof/intel/hda.c +++ b/sound/soc/sof/intel/hda.c @@ -207,6 +207,9 @@ static int hda_sdw_probe(struct snd_sof_dev *sdev) res.ext = true; res.ops = &sdw_ace2x_callback; + if (chip->hw_ip_version >= SOF_INTEL_ACE_3_0) + res.privacy = true; + } res.irq = sdev->ipc_irq; res.handle = hdev->info.handle; @@ -235,6 +238,10 @@ static int hda_sdw_probe(struct snd_sof_dev *sdev) /* save context */ hdev->sdw = sdw; + if (chip->hw_ip_version >= SOF_INTEL_ACE_3_0) + hdac_bus_eml_set_mic_privacy_mask(sof_to_bus(sdev), true, + AZX_REG_ML_LEPTR_ID_SDW, 0xe); + return 0; }