linux/sound/soc/intel/skylake/skl-nhlt.h
<<
>>
Prefs
   1/* SPDX-License-Identifier: GPL-2.0-only */
   2/*
   3 *  skl-nhlt.h - Intel HDA Platform NHLT header
   4 *
   5 *  Copyright (C) 2015 Intel Corp
   6 *  Author: Sanjiv Kumar <sanjiv.kumar@intel.com>
   7 *  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   8 *
   9 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  10 */
  11#ifndef __SKL_NHLT_H__
  12#define __SKL_NHLT_H__
  13
  14#include <linux/acpi.h>
  15
  16struct wav_fmt {
  17        u16 fmt_tag;
  18        u16 channels;
  19        u32 samples_per_sec;
  20        u32 avg_bytes_per_sec;
  21        u16 block_align;
  22        u16 bits_per_sample;
  23        u16 cb_size;
  24} __packed;
  25
  26struct wav_fmt_ext {
  27        struct wav_fmt fmt;
  28        union samples {
  29                u16 valid_bits_per_sample;
  30                u16 samples_per_block;
  31                u16 reserved;
  32        } sample;
  33        u32 channel_mask;
  34        u8 sub_fmt[16];
  35} __packed;
  36
  37enum nhlt_link_type {
  38        NHLT_LINK_HDA = 0,
  39        NHLT_LINK_DSP = 1,
  40        NHLT_LINK_DMIC = 2,
  41        NHLT_LINK_SSP = 3,
  42        NHLT_LINK_INVALID
  43};
  44
  45enum nhlt_device_type {
  46        NHLT_DEVICE_BT = 0,
  47        NHLT_DEVICE_DMIC = 1,
  48        NHLT_DEVICE_I2S = 4,
  49        NHLT_DEVICE_INVALID
  50};
  51
  52struct nhlt_specific_cfg {
  53        u32 size;
  54        u8 caps[0];
  55} __packed;
  56
  57struct nhlt_fmt_cfg {
  58        struct wav_fmt_ext fmt_ext;
  59        struct nhlt_specific_cfg config;
  60} __packed;
  61
  62struct nhlt_fmt {
  63        u8 fmt_count;
  64        struct nhlt_fmt_cfg fmt_config[0];
  65} __packed;
  66
  67struct nhlt_endpoint {
  68        u32  length;
  69        u8   linktype;
  70        u8   instance_id;
  71        u16  vendor_id;
  72        u16  device_id;
  73        u16  revision_id;
  74        u32  subsystem_id;
  75        u8   device_type;
  76        u8   direction;
  77        u8   virtual_bus_id;
  78        struct nhlt_specific_cfg config;
  79} __packed;
  80
  81struct nhlt_acpi_table {
  82        struct acpi_table_header header;
  83        u8 endpoint_count;
  84        struct nhlt_endpoint desc[0];
  85} __packed;
  86
  87struct nhlt_resource_desc  {
  88        u32 extra;
  89        u16 flags;
  90        u64 addr_spc_gra;
  91        u64 min_addr;
  92        u64 max_addr;
  93        u64 addr_trans_offset;
  94        u64 length;
  95} __packed;
  96
  97#define MIC_ARRAY_2CH 2
  98#define MIC_ARRAY_4CH 4
  99
 100struct nhlt_tdm_config {
 101        u8 virtual_slot;
 102        u8 config_type;
 103} __packed;
 104
 105struct nhlt_dmic_array_config {
 106        struct nhlt_tdm_config tdm_config;
 107        u8 array_type;
 108} __packed;
 109
 110enum {
 111        NHLT_MIC_ARRAY_2CH_SMALL = 0xa,
 112        NHLT_MIC_ARRAY_2CH_BIG = 0xb,
 113        NHLT_MIC_ARRAY_4CH_1ST_GEOM = 0xc,
 114        NHLT_MIC_ARRAY_4CH_L_SHAPED = 0xd,
 115        NHLT_MIC_ARRAY_4CH_2ND_GEOM = 0xe,
 116        NHLT_MIC_ARRAY_VENDOR_DEFINED = 0xf,
 117};
 118
 119#endif
 120