Commit 7a33ea70 authored by Pierre-Louis Bossart's avatar Pierre-Louis Bossart Committed by Takashi Iwai

ALSA: hda: intel-nhlt: handle NHLT VENDOR_DEFINED DMIC geometry

The NHLT spec defines a VENDOR_DEFINED geometry, which requires
reading additional information to figure out the number of
microphones.
Signed-off-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 303681f4
...@@ -96,16 +96,22 @@ struct nhlt_resource_desc { ...@@ -96,16 +96,22 @@ struct nhlt_resource_desc {
#define MIC_ARRAY_2CH 2 #define MIC_ARRAY_2CH 2
#define MIC_ARRAY_4CH 4 #define MIC_ARRAY_4CH 4
struct nhlt_tdm_config { struct nhlt_device_specific_config {
u8 virtual_slot; u8 virtual_slot;
u8 config_type; u8 config_type;
} __packed; } __packed;
struct nhlt_dmic_array_config { struct nhlt_dmic_array_config {
struct nhlt_tdm_config tdm_config; struct nhlt_device_specific_config device_config;
u8 array_type; u8 array_type;
} __packed; } __packed;
struct nhlt_vendor_dmic_array_config {
struct nhlt_dmic_array_config dmic_config;
u8 nb_mics;
/* TODO add vendor mic config */
} __packed;
enum { enum {
NHLT_MIC_ARRAY_2CH_SMALL = 0xa, NHLT_MIC_ARRAY_2CH_SMALL = 0xa,
NHLT_MIC_ARRAY_2CH_BIG = 0xb, NHLT_MIC_ARRAY_2CH_BIG = 0xb,
......
...@@ -63,6 +63,7 @@ int intel_nhlt_get_dmic_geo(struct device *dev, struct nhlt_acpi_table *nhlt) ...@@ -63,6 +63,7 @@ int intel_nhlt_get_dmic_geo(struct device *dev, struct nhlt_acpi_table *nhlt)
{ {
struct nhlt_endpoint *epnt; struct nhlt_endpoint *epnt;
struct nhlt_dmic_array_config *cfg; struct nhlt_dmic_array_config *cfg;
struct nhlt_vendor_dmic_array_config *cfg_vendor;
unsigned int dmic_geo = 0; unsigned int dmic_geo = 0;
u8 j; u8 j;
...@@ -86,7 +87,10 @@ int intel_nhlt_get_dmic_geo(struct device *dev, struct nhlt_acpi_table *nhlt) ...@@ -86,7 +87,10 @@ int intel_nhlt_get_dmic_geo(struct device *dev, struct nhlt_acpi_table *nhlt)
case NHLT_MIC_ARRAY_4CH_2ND_GEOM: case NHLT_MIC_ARRAY_4CH_2ND_GEOM:
dmic_geo = MIC_ARRAY_4CH; dmic_geo = MIC_ARRAY_4CH;
break; break;
case NHLT_MIC_ARRAY_VENDOR_DEFINED:
cfg_vendor = (struct nhlt_vendor_dmic_array_config *)cfg;
dmic_geo = cfg_vendor->nb_mics;
break;
default: default:
dev_warn(dev, "undefined DMIC array_type 0x%0x\n", dev_warn(dev, "undefined DMIC array_type 0x%0x\n",
cfg->array_type); cfg->array_type);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment