[alsa-devel] [PATCH v2 1/3] ASoC: Intel: Skylake: Add api to retrieve dmic array info from nhlt
Vinod Koul
vinod.koul at intel.com
Thu May 26 07:23:00 CEST 2016
On Wed, May 25, 2016 at 06:19:17AM -0700, Yong Zhi wrote:
> skylake can be configured with either both 2 and 4 channel DMIC
Skylake
> array, or 2 channel DMIC array only, this patch provides an API to
> retrieve the DMIC info from nhlt.
>
> *
> */
> #include "skl.h"
> +#include <linux/pci.h>
Typical convention is to have standard includes before local ones
> +int skl_get_dmic_geo(struct skl *skl)
> +{
> + struct nhlt_acpi_table *nhlt = (struct nhlt_acpi_table *)skl->nhlt;
> + struct nhlt_endpoint *epnt;
> + struct nhlt_dmic_array_config *cfg;
> + struct device *dev = &(skl->pci->dev);
i dont think braces are required..
> + unsigned int dmic_geo = 0;
> + u8 j;
> +
> + epnt = (struct nhlt_endpoint *)nhlt->desc;
> +
> + for (j = 0; j < nhlt->endpoint_count; j++) {
> + if (epnt->linktype == NHLT_LINK_DMIC) {
> + cfg = (struct nhlt_dmic_array_config *)
> + (epnt->config.caps);
> + switch (cfg->array_type) {
> + case NHLT_MIC_ARRAY_2CH_SMALL:
> + case NHLT_MIC_ARRAY_2CH_BIG:
> + dmic_geo |= MIC_ARRAY_2CH;
> + break;
empty line here please
> + case NHLT_MIC_ARRAY_4CH_1ST_GEOM:
> + case NHLT_MIC_ARRAY_4CH_L_SHAPED:
> + case NHLT_MIC_ARRAY_4CH_2ND_GEOM:
> + dmic_geo |= MIC_ARRAY_4CH;
> + break;
here too
--
~Vinod
More information about the Alsa-devel
mailing list