]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
ASoC: Intel: Skylake: move NHLT header to common directory
authorPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Mon, 10 Feb 2020 08:44:00 +0000 (09:44 +0100)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Fri, 14 Feb 2020 13:20:15 +0000 (14:20 +0100)
BugLink: https://bugs.launchpad.net/bugs/1837828
Prepare move from NHLT code to common directory, starting with header.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
(cherry picked from commit 63643b5902c4bf096b504b0563f5426ba5baef15)
Signed-off-by: Hui Wang <hui.wang@canonical.com>
Acked-by: Sultan Alsawaf <sultan.alsawaf@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
include/sound/intel-nhlt.h [new file with mode: 0644]
sound/soc/intel/skylake/skl-nhlt.c
sound/soc/intel/skylake/skl-nhlt.h [deleted file]
sound/soc/intel/skylake/skl-ssp-clk.c
sound/soc/intel/skylake/skl-topology.c
sound/soc/intel/skylake/skl.h

diff --git a/include/sound/intel-nhlt.h b/include/sound/intel-nhlt.h
new file mode 100644 (file)
index 0000000..f85fbf9
--- /dev/null
@@ -0,0 +1,119 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/*
+ *  skl-nhlt.h - Intel HDA Platform NHLT header
+ *
+ *  Copyright (C) 2015 Intel Corp
+ *  Author: Sanjiv Kumar <sanjiv.kumar@intel.com>
+ *  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ *
+ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ */
+#ifndef __SKL_NHLT_H__
+#define __SKL_NHLT_H__
+
+#include <linux/acpi.h>
+
+struct wav_fmt {
+       u16 fmt_tag;
+       u16 channels;
+       u32 samples_per_sec;
+       u32 avg_bytes_per_sec;
+       u16 block_align;
+       u16 bits_per_sample;
+       u16 cb_size;
+} __packed;
+
+struct wav_fmt_ext {
+       struct wav_fmt fmt;
+       union samples {
+               u16 valid_bits_per_sample;
+               u16 samples_per_block;
+               u16 reserved;
+       } sample;
+       u32 channel_mask;
+       u8 sub_fmt[16];
+} __packed;
+
+enum nhlt_link_type {
+       NHLT_LINK_HDA = 0,
+       NHLT_LINK_DSP = 1,
+       NHLT_LINK_DMIC = 2,
+       NHLT_LINK_SSP = 3,
+       NHLT_LINK_INVALID
+};
+
+enum nhlt_device_type {
+       NHLT_DEVICE_BT = 0,
+       NHLT_DEVICE_DMIC = 1,
+       NHLT_DEVICE_I2S = 4,
+       NHLT_DEVICE_INVALID
+};
+
+struct nhlt_specific_cfg {
+       u32 size;
+       u8 caps[0];
+} __packed;
+
+struct nhlt_fmt_cfg {
+       struct wav_fmt_ext fmt_ext;
+       struct nhlt_specific_cfg config;
+} __packed;
+
+struct nhlt_fmt {
+       u8 fmt_count;
+       struct nhlt_fmt_cfg fmt_config[0];
+} __packed;
+
+struct nhlt_endpoint {
+       u32  length;
+       u8   linktype;
+       u8   instance_id;
+       u16  vendor_id;
+       u16  device_id;
+       u16  revision_id;
+       u32  subsystem_id;
+       u8   device_type;
+       u8   direction;
+       u8   virtual_bus_id;
+       struct nhlt_specific_cfg config;
+} __packed;
+
+struct nhlt_acpi_table {
+       struct acpi_table_header header;
+       u8 endpoint_count;
+       struct nhlt_endpoint desc[0];
+} __packed;
+
+struct nhlt_resource_desc  {
+       u32 extra;
+       u16 flags;
+       u64 addr_spc_gra;
+       u64 min_addr;
+       u64 max_addr;
+       u64 addr_trans_offset;
+       u64 length;
+} __packed;
+
+#define MIC_ARRAY_2CH 2
+#define MIC_ARRAY_4CH 4
+
+struct nhlt_tdm_config {
+       u8 virtual_slot;
+       u8 config_type;
+} __packed;
+
+struct nhlt_dmic_array_config {
+       struct nhlt_tdm_config tdm_config;
+       u8 array_type;
+} __packed;
+
+enum {
+       NHLT_MIC_ARRAY_2CH_SMALL = 0xa,
+       NHLT_MIC_ARRAY_2CH_BIG = 0xb,
+       NHLT_MIC_ARRAY_4CH_1ST_GEOM = 0xc,
+       NHLT_MIC_ARRAY_4CH_L_SHAPED = 0xd,
+       NHLT_MIC_ARRAY_4CH_2ND_GEOM = 0xe,
+       NHLT_MIC_ARRAY_VENDOR_DEFINED = 0xf,
+};
+
+#endif
index e01815cec6fdb51995055908835777003eefc732..8ae61666adf4170260b3c7c1d9e8d32af0c7b135 100644 (file)
@@ -9,6 +9,7 @@
  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  */
 #include <linux/pci.h>
+#include <sound/intel-nhlt.h>
 #include "skl.h"
 #include "skl-i2s.h"
 
diff --git a/sound/soc/intel/skylake/skl-nhlt.h b/sound/soc/intel/skylake/skl-nhlt.h
deleted file mode 100644 (file)
index f85fbf9..0000000
+++ /dev/null
@@ -1,119 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-/*
- *  skl-nhlt.h - Intel HDA Platform NHLT header
- *
- *  Copyright (C) 2015 Intel Corp
- *  Author: Sanjiv Kumar <sanjiv.kumar@intel.com>
- *  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- *
- * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- */
-#ifndef __SKL_NHLT_H__
-#define __SKL_NHLT_H__
-
-#include <linux/acpi.h>
-
-struct wav_fmt {
-       u16 fmt_tag;
-       u16 channels;
-       u32 samples_per_sec;
-       u32 avg_bytes_per_sec;
-       u16 block_align;
-       u16 bits_per_sample;
-       u16 cb_size;
-} __packed;
-
-struct wav_fmt_ext {
-       struct wav_fmt fmt;
-       union samples {
-               u16 valid_bits_per_sample;
-               u16 samples_per_block;
-               u16 reserved;
-       } sample;
-       u32 channel_mask;
-       u8 sub_fmt[16];
-} __packed;
-
-enum nhlt_link_type {
-       NHLT_LINK_HDA = 0,
-       NHLT_LINK_DSP = 1,
-       NHLT_LINK_DMIC = 2,
-       NHLT_LINK_SSP = 3,
-       NHLT_LINK_INVALID
-};
-
-enum nhlt_device_type {
-       NHLT_DEVICE_BT = 0,
-       NHLT_DEVICE_DMIC = 1,
-       NHLT_DEVICE_I2S = 4,
-       NHLT_DEVICE_INVALID
-};
-
-struct nhlt_specific_cfg {
-       u32 size;
-       u8 caps[0];
-} __packed;
-
-struct nhlt_fmt_cfg {
-       struct wav_fmt_ext fmt_ext;
-       struct nhlt_specific_cfg config;
-} __packed;
-
-struct nhlt_fmt {
-       u8 fmt_count;
-       struct nhlt_fmt_cfg fmt_config[0];
-} __packed;
-
-struct nhlt_endpoint {
-       u32  length;
-       u8   linktype;
-       u8   instance_id;
-       u16  vendor_id;
-       u16  device_id;
-       u16  revision_id;
-       u32  subsystem_id;
-       u8   device_type;
-       u8   direction;
-       u8   virtual_bus_id;
-       struct nhlt_specific_cfg config;
-} __packed;
-
-struct nhlt_acpi_table {
-       struct acpi_table_header header;
-       u8 endpoint_count;
-       struct nhlt_endpoint desc[0];
-} __packed;
-
-struct nhlt_resource_desc  {
-       u32 extra;
-       u16 flags;
-       u64 addr_spc_gra;
-       u64 min_addr;
-       u64 max_addr;
-       u64 addr_trans_offset;
-       u64 length;
-} __packed;
-
-#define MIC_ARRAY_2CH 2
-#define MIC_ARRAY_4CH 4
-
-struct nhlt_tdm_config {
-       u8 virtual_slot;
-       u8 config_type;
-} __packed;
-
-struct nhlt_dmic_array_config {
-       struct nhlt_tdm_config tdm_config;
-       u8 array_type;
-} __packed;
-
-enum {
-       NHLT_MIC_ARRAY_2CH_SMALL = 0xa,
-       NHLT_MIC_ARRAY_2CH_BIG = 0xb,
-       NHLT_MIC_ARRAY_4CH_1ST_GEOM = 0xc,
-       NHLT_MIC_ARRAY_4CH_L_SHAPED = 0xd,
-       NHLT_MIC_ARRAY_4CH_2ND_GEOM = 0xe,
-       NHLT_MIC_ARRAY_VENDOR_DEFINED = 0xf,
-};
-
-#endif
index 5bb6e40d4d3ec2ba2a78fe211d613047ffb76182..5bfcd46452f9ede34b20ca1755c04e615e8e5283 100644 (file)
@@ -11,6 +11,7 @@
 #include <linux/platform_device.h>
 #include <linux/clk-provider.h>
 #include <linux/clkdev.h>
+#include <sound/intel-nhlt.h>
 #include "skl.h"
 #include "skl-ssp-clk.h"
 #include "skl-topology.h"
index 6241e35213af65c0491dfea65b2ed79623700726..f8a501cf5fbd5d1504e0f29ec8d93f3d53d3ec98 100644 (file)
@@ -12,6 +12,7 @@
 #include <linux/types.h>
 #include <linux/firmware.h>
 #include <linux/uuid.h>
+#include <sound/intel-nhlt.h>
 #include <sound/soc.h>
 #include <sound/soc-topology.h>
 #include <uapi/sound/snd_sst_tokens.h>
index 6070666a63928eb007b934770670af45b0647138..928e8115a1a784e66f8efede121d06a9c9721a4d 100644 (file)
@@ -16,7 +16,6 @@
 #include <sound/hdaudio_ext.h>
 #include <sound/hda_codec.h>
 #include <sound/soc.h>
-#include "skl-nhlt.h"
 #include "skl-ssp-clk.h"
 
 #define SKL_SUSPEND_DELAY 2000