Skip to content

Commit

Permalink
HACK: ptl/sdw: mic privacy force enable + register dump
Browse files Browse the repository at this point in the history
title says all...

Signed-off-by: Peter Ujfalusi <[email protected]>
  • Loading branch information
ujfalusi committed Feb 13, 2025
1 parent bcc42be commit a6d41fb
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions drivers/soundwire/intel.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ struct sdw_intel_link_res {
struct sdw_cdns *cdns;
struct list_head list;
struct hdac_bus *hbus;
bool privacy;
};

/**
Expand Down
5 changes: 5 additions & 0 deletions drivers/soundwire/intel_ace2x_debugfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
1 change: 1 addition & 0 deletions drivers/soundwire/intel_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
7 changes: 7 additions & 0 deletions include/linux/soundwire/sdw_intel.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
};
Expand Down
7 changes: 7 additions & 0 deletions sound/soc/sof/intel/hda.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit a6d41fb

Please sign in to comment.