summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/linux/acpi.h7
-rw-r--r--include/sound/core.h1
-rw-r--r--include/sound/cs35l36.h43
-rw-r--r--include/sound/dmaengine_pcm.h4
-rw-r--r--include/sound/hda_register.h2
-rw-r--r--include/sound/hda_verbs.h2
-rw-r--r--include/sound/hdaudio.h3
-rw-r--r--include/sound/info.h36
-rw-r--r--include/sound/memalloc.h1
-rw-r--r--include/sound/pcm.h29
-rw-r--r--include/sound/simple_card_utils.h4
-rw-r--r--include/sound/soc-acpi.h33
-rw-r--r--include/sound/soc-dapm.h27
-rw-r--r--include/sound/soc-topology.h8
-rw-r--r--include/sound/soc.h73
15 files changed, 218 insertions, 55 deletions
diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index 87715f20b69a..03b4c4f225d0 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -1014,6 +1014,13 @@ struct acpi_gpio_mapping {
1014 1014
1015/* Ignore IoRestriction field */ 1015/* Ignore IoRestriction field */
1016#define ACPI_GPIO_QUIRK_NO_IO_RESTRICTION BIT(0) 1016#define ACPI_GPIO_QUIRK_NO_IO_RESTRICTION BIT(0)
1017/*
1018 * When ACPI GPIO mapping table is in use the index parameter inside it
1019 * refers to the GPIO resource in _CRS method. That index has no
1020 * distinction of actual type of the resource. When consumer wants to
1021 * get GpioIo type explicitly, this quirk may be used.
1022 */
1023#define ACPI_GPIO_QUIRK_ONLY_GPIOIO BIT(1)
1017 1024
1018 unsigned int quirks; 1025 unsigned int quirks;
1019}; 1026};
diff --git a/include/sound/core.h b/include/sound/core.h
index 36a5934cf4b1..e923c23e05dd 100644
--- a/include/sound/core.h
+++ b/include/sound/core.h
@@ -120,7 +120,6 @@ struct snd_card {
120 struct list_head ctl_files; /* active control files */ 120 struct list_head ctl_files; /* active control files */
121 121
122 struct snd_info_entry *proc_root; /* root for soundcard specific files */ 122 struct snd_info_entry *proc_root; /* root for soundcard specific files */
123 struct snd_info_entry *proc_id; /* the card id */
124 struct proc_dir_entry *proc_root_link; /* number link to real id */ 123 struct proc_dir_entry *proc_root_link; /* number link to real id */
125 124
126 struct list_head files_list; /* all files associated to this card */ 125 struct list_head files_list; /* all files associated to this card */
diff --git a/include/sound/cs35l36.h b/include/sound/cs35l36.h
new file mode 100644
index 000000000000..8f8049d390f0
--- /dev/null
+++ b/include/sound/cs35l36.h
@@ -0,0 +1,43 @@
1/* SPDX-License-Identifier: GPL-2.0 */
2/*
3 * linux/sound/cs35l36.h -- Platform data for CS35L36
4 *
5 * Copyright 2018 Cirrus Logic, Inc.
6 *
7 * Author: James Schulman <james.schulman@cirrus.com>
8 *
9 */
10
11#ifndef __CS35L36_H
12#define __CS35L36_H
13
14struct cs35l36_vpbr_cfg {
15 bool is_present;
16 bool vpbr_en;
17 int vpbr_thld;
18 int vpbr_atk_rate;
19 int vpbr_atk_vol;
20 int vpbr_max_attn;
21 int vpbr_wait;
22 int vpbr_rel_rate;
23 int vpbr_mute_en;
24};
25
26struct cs35l36_platform_data {
27 bool multi_amp_mode;
28 bool dcm_mode;
29 bool amp_pcm_inv;
30 bool imon_pol_inv;
31 bool vmon_pol_inv;
32 int boost_ind;
33 int bst_vctl;
34 int bst_vctl_sel;
35 int bst_ipk;
36 bool extern_boost;
37 int temp_warn_thld;
38 int irq_drv_sel;
39 int irq_gpio_sel;
40 struct cs35l36_vpbr_cfg vpbr_config;
41};
42
43#endif /* __CS35L36_H */
diff --git a/include/sound/dmaengine_pcm.h b/include/sound/dmaengine_pcm.h
index 2c4cfaa135a6..c679f6116580 100644
--- a/include/sound/dmaengine_pcm.h
+++ b/include/sound/dmaengine_pcm.h
@@ -99,10 +99,6 @@ void snd_dmaengine_pcm_set_config_from_dai_data(
99 * playback. 99 * playback.
100 */ 100 */
101#define SND_DMAENGINE_PCM_FLAG_HALF_DUPLEX BIT(3) 101#define SND_DMAENGINE_PCM_FLAG_HALF_DUPLEX BIT(3)
102/*
103 * The PCM streams have custom channel names specified.
104 */
105#define SND_DMAENGINE_PCM_FLAG_CUSTOM_CHANNEL_NAME BIT(4)
106 102
107/** 103/**
108 * struct snd_dmaengine_pcm_config - Configuration data for dmaengine based PCM 104 * struct snd_dmaengine_pcm_config - Configuration data for dmaengine based PCM
diff --git a/include/sound/hda_register.h b/include/sound/hda_register.h
index 2ab39fb52d7a..0fd39295b426 100644
--- a/include/sound/hda_register.h
+++ b/include/sound/hda_register.h
@@ -79,6 +79,7 @@ enum { SDI0, SDI1, SDI2, SDI3, SDO0, SDO1, SDO2, SDO3 };
79 79
80/* stream register offsets from stream base */ 80/* stream register offsets from stream base */
81#define AZX_REG_SD_CTL 0x00 81#define AZX_REG_SD_CTL 0x00
82#define AZX_REG_SD_CTL_3B 0x02 /* 3rd byte of SD_CTL register */
82#define AZX_REG_SD_STS 0x03 83#define AZX_REG_SD_STS 0x03
83#define AZX_REG_SD_LPIB 0x04 84#define AZX_REG_SD_LPIB 0x04
84#define AZX_REG_SD_CBL 0x08 85#define AZX_REG_SD_CBL 0x08
@@ -165,6 +166,7 @@ enum { SDI0, SDI1, SDI2, SDI3, SDO0, SDO1, SDO2, SDO3 };
165#define SD_INT_COMPLETE 0x04 /* completion interrupt */ 166#define SD_INT_COMPLETE 0x04 /* completion interrupt */
166#define SD_INT_MASK (SD_INT_DESC_ERR|SD_INT_FIFO_ERR|\ 167#define SD_INT_MASK (SD_INT_DESC_ERR|SD_INT_FIFO_ERR|\
167 SD_INT_COMPLETE) 168 SD_INT_COMPLETE)
169#define SD_CTL_STRIPE_MASK 0x3 /* stripe control mask */
168 170
169/* SD_STS */ 171/* SD_STS */
170#define SD_STS_FIFO_READY 0x20 /* FIFO ready */ 172#define SD_STS_FIFO_READY 0x20 /* FIFO ready */
diff --git a/include/sound/hda_verbs.h b/include/sound/hda_verbs.h
index 2a8573a00ea6..e36b77531c5c 100644
--- a/include/sound/hda_verbs.h
+++ b/include/sound/hda_verbs.h
@@ -66,6 +66,7 @@ enum {
66#define AC_VERB_GET_CONFIG_DEFAULT 0x0f1c 66#define AC_VERB_GET_CONFIG_DEFAULT 0x0f1c
67/* f20: AFG/MFG */ 67/* f20: AFG/MFG */
68#define AC_VERB_GET_SUBSYSTEM_ID 0x0f20 68#define AC_VERB_GET_SUBSYSTEM_ID 0x0f20
69#define AC_VERB_GET_STRIPE_CONTROL 0x0f24
69#define AC_VERB_GET_CVT_CHAN_COUNT 0x0f2d 70#define AC_VERB_GET_CVT_CHAN_COUNT 0x0f2d
70#define AC_VERB_GET_HDMI_DIP_SIZE 0x0f2e 71#define AC_VERB_GET_HDMI_DIP_SIZE 0x0f2e
71#define AC_VERB_GET_HDMI_ELDD 0x0f2f 72#define AC_VERB_GET_HDMI_ELDD 0x0f2f
@@ -110,6 +111,7 @@ enum {
110#define AC_VERB_SET_CONFIG_DEFAULT_BYTES_3 0x71f 111#define AC_VERB_SET_CONFIG_DEFAULT_BYTES_3 0x71f
111#define AC_VERB_SET_EAPD 0x788 112#define AC_VERB_SET_EAPD 0x788
112#define AC_VERB_SET_CODEC_RESET 0x7ff 113#define AC_VERB_SET_CODEC_RESET 0x7ff
114#define AC_VERB_SET_STRIPE_CONTROL 0x724
113#define AC_VERB_SET_CVT_CHAN_COUNT 0x72d 115#define AC_VERB_SET_CVT_CHAN_COUNT 0x72d
114#define AC_VERB_SET_HDMI_DIP_INDEX 0x730 116#define AC_VERB_SET_HDMI_DIP_INDEX 0x730
115#define AC_VERB_SET_HDMI_DIP_DATA 0x731 117#define AC_VERB_SET_HDMI_DIP_DATA 0x731
diff --git a/include/sound/hdaudio.h b/include/sound/hdaudio.h
index b4fa1c775251..45f944d57982 100644
--- a/include/sound/hdaudio.h
+++ b/include/sound/hdaudio.h
@@ -539,6 +539,9 @@ void snd_hdac_stream_sync(struct hdac_stream *azx_dev, bool start,
539 unsigned int streams); 539 unsigned int streams);
540void snd_hdac_stream_timecounter_init(struct hdac_stream *azx_dev, 540void snd_hdac_stream_timecounter_init(struct hdac_stream *azx_dev,
541 unsigned int streams); 541 unsigned int streams);
542int snd_hdac_get_stream_stripe_ctl(struct hdac_bus *bus,
543 struct snd_pcm_substream *substream);
544
542/* 545/*
543 * macros for easy use 546 * macros for easy use
544 */ 547 */
diff --git a/include/sound/info.h b/include/sound/info.h
index becdf66d2825..97fdda41e076 100644
--- a/include/sound/info.h
+++ b/include/sound/info.h
@@ -82,7 +82,6 @@ struct snd_info_entry {
82 struct snd_info_entry_ops *ops; 82 struct snd_info_entry_ops *ops;
83 } c; 83 } c;
84 struct snd_info_entry *parent; 84 struct snd_info_entry *parent;
85 struct snd_card *card;
86 struct module *module; 85 struct module *module;
87 void *private_data; 86 void *private_data;
88 void (*private_free)(struct snd_info_entry *entry); 87 void (*private_free)(struct snd_info_entry *entry);
@@ -160,6 +159,13 @@ static inline void snd_info_set_text_ops(struct snd_info_entry *entry,
160 entry->c.text.read = read; 159 entry->c.text.read = read;
161} 160}
162 161
162int snd_card_rw_proc_new(struct snd_card *card, const char *name,
163 void *private_data,
164 void (*read)(struct snd_info_entry *,
165 struct snd_info_buffer *),
166 void (*write)(struct snd_info_entry *entry,
167 struct snd_info_buffer *buffer));
168
163int snd_info_check_reserved_words(const char *str); 169int snd_info_check_reserved_words(const char *str);
164 170
165#else 171#else
@@ -189,10 +195,38 @@ static inline int snd_card_proc_new(struct snd_card *card, const char *name,
189static inline void snd_info_set_text_ops(struct snd_info_entry *entry __attribute__((unused)), 195static inline void snd_info_set_text_ops(struct snd_info_entry *entry __attribute__((unused)),
190 void *private_data, 196 void *private_data,
191 void (*read)(struct snd_info_entry *, struct snd_info_buffer *)) {} 197 void (*read)(struct snd_info_entry *, struct snd_info_buffer *)) {}
198static inline int snd_card_rw_proc_new(struct snd_card *card, const char *name,
199 void *private_data,
200 void (*read)(struct snd_info_entry *,
201 struct snd_info_buffer *),
202 void (*write)(struct snd_info_entry *entry,
203 struct snd_info_buffer *buffer))
204{
205 return 0;
206}
192static inline int snd_info_check_reserved_words(const char *str) { return 1; } 207static inline int snd_info_check_reserved_words(const char *str) { return 1; }
193 208
194#endif 209#endif
195 210
211/**
212 * snd_card_ro_proc_new - Create a read-only text proc file entry for the card
213 * @card: the card instance
214 * @name: the file name
215 * @private_data: the arbitrary private data
216 * @read: the read callback
217 *
218 * This proc file entry will be registered via snd_card_register() call, and
219 * it will be removed automatically at the card removal, too.
220 */
221static inline int
222snd_card_ro_proc_new(struct snd_card *card, const char *name,
223 void *private_data,
224 void (*read)(struct snd_info_entry *,
225 struct snd_info_buffer *))
226{
227 return snd_card_rw_proc_new(card, name, private_data, read, NULL);
228}
229
196/* 230/*
197 * OSS info part 231 * OSS info part
198 */ 232 */
diff --git a/include/sound/memalloc.h b/include/sound/memalloc.h
index af3fa577fa06..1ac0dd82a916 100644
--- a/include/sound/memalloc.h
+++ b/include/sound/memalloc.h
@@ -37,7 +37,6 @@ struct snd_dma_device {
37}; 37};
38 38
39#define snd_dma_pci_data(pci) (&(pci)->dev) 39#define snd_dma_pci_data(pci) (&(pci)->dev)
40#define snd_dma_isa_data() NULL
41#define snd_dma_continuous_data(x) ((struct device *)(__force unsigned long)(x)) 40#define snd_dma_continuous_data(x) ((struct device *)(__force unsigned long)(x))
42 41
43 42
diff --git a/include/sound/pcm.h b/include/sound/pcm.h
index d6bd3caf6878..465d7d033c4c 100644
--- a/include/sound/pcm.h
+++ b/include/sound/pcm.h
@@ -30,6 +30,7 @@
30#include <linux/mm.h> 30#include <linux/mm.h>
31#include <linux/bitops.h> 31#include <linux/bitops.h>
32#include <linux/pm_qos.h> 32#include <linux/pm_qos.h>
33#include <linux/refcount.h>
33 34
34#define snd_pcm_substream_chip(substream) ((substream)->private_data) 35#define snd_pcm_substream_chip(substream) ((substream)->private_data)
35#define snd_pcm_chip(pcm) ((pcm)->private_data) 36#define snd_pcm_chip(pcm) ((pcm)->private_data)
@@ -439,7 +440,7 @@ struct snd_pcm_group { /* keep linked substreams */
439 spinlock_t lock; 440 spinlock_t lock;
440 struct mutex mutex; 441 struct mutex mutex;
441 struct list_head substreams; 442 struct list_head substreams;
442 int count; 443 refcount_t refs;
443}; 444};
444 445
445struct pid; 446struct pid;
@@ -470,7 +471,6 @@ struct snd_pcm_substream {
470 struct snd_pcm_group self_group; /* fake group for non linked substream (with substream lock inside) */ 471 struct snd_pcm_group self_group; /* fake group for non linked substream (with substream lock inside) */
471 struct snd_pcm_group *group; /* pointer to current group */ 472 struct snd_pcm_group *group; /* pointer to current group */
472 /* -- assigned files -- */ 473 /* -- assigned files -- */
473 void *file;
474 int ref_count; 474 int ref_count;
475 atomic_t mmap_count; 475 atomic_t mmap_count;
476 unsigned int f_flags; 476 unsigned int f_flags;
@@ -482,15 +482,6 @@ struct snd_pcm_substream {
482#endif 482#endif
483#ifdef CONFIG_SND_VERBOSE_PROCFS 483#ifdef CONFIG_SND_VERBOSE_PROCFS
484 struct snd_info_entry *proc_root; 484 struct snd_info_entry *proc_root;
485 struct snd_info_entry *proc_info_entry;
486 struct snd_info_entry *proc_hw_params_entry;
487 struct snd_info_entry *proc_sw_params_entry;
488 struct snd_info_entry *proc_status_entry;
489 struct snd_info_entry *proc_prealloc_entry;
490 struct snd_info_entry *proc_prealloc_max_entry;
491#ifdef CONFIG_SND_PCM_XRUN_DEBUG
492 struct snd_info_entry *proc_xrun_injection_entry;
493#endif
494#endif /* CONFIG_SND_VERBOSE_PROCFS */ 485#endif /* CONFIG_SND_VERBOSE_PROCFS */
495 /* misc flags */ 486 /* misc flags */
496 unsigned int hw_opened: 1; 487 unsigned int hw_opened: 1;
@@ -512,10 +503,8 @@ struct snd_pcm_str {
512#endif 503#endif
513#ifdef CONFIG_SND_VERBOSE_PROCFS 504#ifdef CONFIG_SND_VERBOSE_PROCFS
514 struct snd_info_entry *proc_root; 505 struct snd_info_entry *proc_root;
515 struct snd_info_entry *proc_info_entry;
516#ifdef CONFIG_SND_PCM_XRUN_DEBUG 506#ifdef CONFIG_SND_PCM_XRUN_DEBUG
517 unsigned int xrun_debug; /* 0 = disabled, 1 = verbose, 2 = stacktrace */ 507 unsigned int xrun_debug; /* 0 = disabled, 1 = verbose, 2 = stacktrace */
518 struct snd_info_entry *proc_xrun_debug_entry;
519#endif 508#endif
520#endif 509#endif
521 struct snd_kcontrol *chmap_kctl; /* channel-mapping controls */ 510 struct snd_kcontrol *chmap_kctl; /* channel-mapping controls */
@@ -538,6 +527,7 @@ struct snd_pcm {
538 void (*private_free) (struct snd_pcm *pcm); 527 void (*private_free) (struct snd_pcm *pcm);
539 bool internal; /* pcm is for internal use only */ 528 bool internal; /* pcm is for internal use only */
540 bool nonatomic; /* whole PCM operations are in non-atomic context */ 529 bool nonatomic; /* whole PCM operations are in non-atomic context */
530 bool no_device_suspend; /* don't invoke device PM suspend */
541#if IS_ENABLED(CONFIG_SND_PCM_OSS) 531#if IS_ENABLED(CONFIG_SND_PCM_OSS)
542 struct snd_pcm_oss oss; 532 struct snd_pcm_oss oss;
543#endif 533#endif
@@ -581,13 +571,8 @@ int snd_pcm_stop(struct snd_pcm_substream *substream, snd_pcm_state_t status);
581int snd_pcm_drain_done(struct snd_pcm_substream *substream); 571int snd_pcm_drain_done(struct snd_pcm_substream *substream);
582int snd_pcm_stop_xrun(struct snd_pcm_substream *substream); 572int snd_pcm_stop_xrun(struct snd_pcm_substream *substream);
583#ifdef CONFIG_PM 573#ifdef CONFIG_PM
584int snd_pcm_suspend(struct snd_pcm_substream *substream);
585int snd_pcm_suspend_all(struct snd_pcm *pcm); 574int snd_pcm_suspend_all(struct snd_pcm *pcm);
586#else 575#else
587static inline int snd_pcm_suspend(struct snd_pcm_substream *substream)
588{
589 return 0;
590}
591static inline int snd_pcm_suspend_all(struct snd_pcm *pcm) 576static inline int snd_pcm_suspend_all(struct snd_pcm *pcm)
592{ 577{
593 return 0; 578 return 0;
@@ -1200,12 +1185,12 @@ static inline void snd_pcm_gettime(struct snd_pcm_runtime *runtime,
1200 * Memory 1185 * Memory
1201 */ 1186 */
1202 1187
1203int snd_pcm_lib_preallocate_free(struct snd_pcm_substream *substream); 1188void snd_pcm_lib_preallocate_free(struct snd_pcm_substream *substream);
1204int snd_pcm_lib_preallocate_free_for_all(struct snd_pcm *pcm); 1189void snd_pcm_lib_preallocate_free_for_all(struct snd_pcm *pcm);
1205int snd_pcm_lib_preallocate_pages(struct snd_pcm_substream *substream, 1190void snd_pcm_lib_preallocate_pages(struct snd_pcm_substream *substream,
1206 int type, struct device *data, 1191 int type, struct device *data,
1207 size_t size, size_t max); 1192 size_t size, size_t max);
1208int snd_pcm_lib_preallocate_pages_for_all(struct snd_pcm *pcm, 1193void snd_pcm_lib_preallocate_pages_for_all(struct snd_pcm *pcm,
1209 int type, void *data, 1194 int type, void *data,
1210 size_t size, size_t max); 1195 size_t size, size_t max);
1211int snd_pcm_lib_malloc_pages(struct snd_pcm_substream *substream, size_t size); 1196int snd_pcm_lib_malloc_pages(struct snd_pcm_substream *substream, size_t size);
diff --git a/include/sound/simple_card_utils.h b/include/sound/simple_card_utils.h
index 6d69ed2bd7b1..7afe45389972 100644
--- a/include/sound/simple_card_utils.h
+++ b/include/sound/simple_card_utils.h
@@ -75,7 +75,7 @@ void asoc_simple_card_clk_disable(struct asoc_simple_dai *dai);
75 &dai_link->codec_dai_name, \ 75 &dai_link->codec_dai_name, \
76 list_name, cells_name, NULL) 76 list_name, cells_name, NULL)
77#define asoc_simple_card_parse_platform(node, dai_link, list_name, cells_name) \ 77#define asoc_simple_card_parse_platform(node, dai_link, list_name, cells_name) \
78 asoc_simple_card_parse_dai(node, dai_link->platform, \ 78 asoc_simple_card_parse_dai(node, dai_link->platforms, \
79 &dai_link->platform_of_node, \ 79 &dai_link->platform_of_node, \
80 NULL, list_name, cells_name, NULL) 80 NULL, list_name, cells_name, NULL)
81int asoc_simple_card_parse_dai(struct device_node *node, 81int asoc_simple_card_parse_dai(struct device_node *node,
@@ -108,7 +108,7 @@ int asoc_simple_card_parse_graph_dai(struct device_node *ep,
108int asoc_simple_card_init_dai(struct snd_soc_dai *dai, 108int asoc_simple_card_init_dai(struct snd_soc_dai *dai,
109 struct asoc_simple_dai *simple_dai); 109 struct asoc_simple_dai *simple_dai);
110 110
111int asoc_simple_card_canonicalize_dailink(struct snd_soc_dai_link *dai_link); 111void asoc_simple_card_canonicalize_platform(struct snd_soc_dai_link *dai_link);
112void asoc_simple_card_canonicalize_cpu(struct snd_soc_dai_link *dai_link, 112void asoc_simple_card_canonicalize_cpu(struct snd_soc_dai_link *dai_link,
113 int is_single_links); 113 int is_single_links);
114 114
diff --git a/include/sound/soc-acpi.h b/include/sound/soc-acpi.h
index 266e64e3c24c..35b38e41e5b2 100644
--- a/include/sound/soc-acpi.h
+++ b/include/sound/soc-acpi.h
@@ -22,20 +22,37 @@ struct snd_soc_acpi_package_context {
22#define SND_ACPI_I2C_ID_LEN (4 + ACPI_ID_LEN + 3 + 1) 22#define SND_ACPI_I2C_ID_LEN (4 + ACPI_ID_LEN + 3 + 1)
23 23
24#if IS_ENABLED(CONFIG_ACPI) 24#if IS_ENABLED(CONFIG_ACPI)
25/* acpi match */
26struct snd_soc_acpi_mach *
27snd_soc_acpi_find_machine(struct snd_soc_acpi_mach *machines);
28
25bool snd_soc_acpi_find_package_from_hid(const u8 hid[ACPI_ID_LEN], 29bool snd_soc_acpi_find_package_from_hid(const u8 hid[ACPI_ID_LEN],
26 struct snd_soc_acpi_package_context *ctx); 30 struct snd_soc_acpi_package_context *ctx);
31
32/* check all codecs */
33struct snd_soc_acpi_mach *snd_soc_acpi_codec_list(void *arg);
34
27#else 35#else
36/* acpi match */
37static inline struct snd_soc_acpi_mach *
38snd_soc_acpi_find_machine(struct snd_soc_acpi_mach *machines)
39{
40 return NULL;
41}
42
28static inline bool 43static inline bool
29snd_soc_acpi_find_package_from_hid(const u8 hid[ACPI_ID_LEN], 44snd_soc_acpi_find_package_from_hid(const u8 hid[ACPI_ID_LEN],
30 struct snd_soc_acpi_package_context *ctx) 45 struct snd_soc_acpi_package_context *ctx)
31{ 46{
32 return false; 47 return false;
33} 48}
34#endif
35 49
36/* acpi match */ 50/* check all codecs */
37struct snd_soc_acpi_mach * 51static inline struct snd_soc_acpi_mach *snd_soc_acpi_codec_list(void *arg)
38snd_soc_acpi_find_machine(struct snd_soc_acpi_mach *machines); 52{
53 return NULL;
54}
55#endif
39 56
40/** 57/**
41 * snd_soc_acpi_mach_params: interface for machine driver configuration 58 * snd_soc_acpi_mach_params: interface for machine driver configuration
@@ -69,9 +86,6 @@ struct snd_soc_acpi_mach_params {
69 * is not constant since this field may be updated at run-time 86 * is not constant since this field may be updated at run-time
70 * @sof_fw_filename: Sound Open Firmware file name, if enabled 87 * @sof_fw_filename: Sound Open Firmware file name, if enabled
71 * @sof_tplg_filename: Sound Open Firmware topology file name, if enabled 88 * @sof_tplg_filename: Sound Open Firmware topology file name, if enabled
72 * @asoc_plat_name: ASoC platform name, used for binding machine drivers
73 * if non NULL
74 * @new_mach_data: machine driver private data fixup
75 */ 89 */
76/* Descriptor for SST ASoC machine driver */ 90/* Descriptor for SST ASoC machine driver */
77struct snd_soc_acpi_mach { 91struct snd_soc_acpi_mach {
@@ -85,8 +99,6 @@ struct snd_soc_acpi_mach {
85 struct snd_soc_acpi_mach_params mach_params; 99 struct snd_soc_acpi_mach_params mach_params;
86 const char *sof_fw_filename; 100 const char *sof_fw_filename;
87 const char *sof_tplg_filename; 101 const char *sof_tplg_filename;
88 const char *asoc_plat_name;
89 struct platform_device * (*new_mach_data)(void *pdata);
90}; 102};
91 103
92#define SND_SOC_ACPI_MAX_CODECS 3 104#define SND_SOC_ACPI_MAX_CODECS 3
@@ -105,7 +117,4 @@ struct snd_soc_acpi_codecs {
105 u8 codecs[SND_SOC_ACPI_MAX_CODECS][ACPI_ID_LEN]; 117 u8 codecs[SND_SOC_ACPI_MAX_CODECS][ACPI_ID_LEN];
106}; 118};
107 119
108/* check all codecs */
109struct snd_soc_acpi_mach *snd_soc_acpi_codec_list(void *arg);
110
111#endif 120#endif
diff --git a/include/sound/soc-dapm.h b/include/sound/soc-dapm.h
index bd8163f151cb..c00a0b8ade08 100644
--- a/include/sound/soc-dapm.h
+++ b/include/sound/soc-dapm.h
@@ -214,21 +214,21 @@ struct device;
214 .event_flags = SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_POST_PMD} 214 .event_flags = SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_POST_PMD}
215 215
216/* stream domain */ 216/* stream domain */
217#define SND_SOC_DAPM_AIF_IN(wname, stname, wslot, wreg, wshift, winvert) \ 217#define SND_SOC_DAPM_AIF_IN(wname, stname, wchan, wreg, wshift, winvert) \
218{ .id = snd_soc_dapm_aif_in, .name = wname, .sname = stname, \ 218{ .id = snd_soc_dapm_aif_in, .name = wname, .sname = stname, \
219 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), } 219 .channel = wchan, SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), }
220#define SND_SOC_DAPM_AIF_IN_E(wname, stname, wslot, wreg, wshift, winvert, \ 220#define SND_SOC_DAPM_AIF_IN_E(wname, stname, wchan, wreg, wshift, winvert, \
221 wevent, wflags) \ 221 wevent, wflags) \
222{ .id = snd_soc_dapm_aif_in, .name = wname, .sname = stname, \ 222{ .id = snd_soc_dapm_aif_in, .name = wname, .sname = stname, \
223 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ 223 .channel = wchan, SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
224 .event = wevent, .event_flags = wflags } 224 .event = wevent, .event_flags = wflags }
225#define SND_SOC_DAPM_AIF_OUT(wname, stname, wslot, wreg, wshift, winvert) \ 225#define SND_SOC_DAPM_AIF_OUT(wname, stname, wchan, wreg, wshift, winvert) \
226{ .id = snd_soc_dapm_aif_out, .name = wname, .sname = stname, \ 226{ .id = snd_soc_dapm_aif_out, .name = wname, .sname = stname, \
227 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), } 227 .channel = wchan, SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), }
228#define SND_SOC_DAPM_AIF_OUT_E(wname, stname, wslot, wreg, wshift, winvert, \ 228#define SND_SOC_DAPM_AIF_OUT_E(wname, stname, wchan, wreg, wshift, winvert, \
229 wevent, wflags) \ 229 wevent, wflags) \
230{ .id = snd_soc_dapm_aif_out, .name = wname, .sname = stname, \ 230{ .id = snd_soc_dapm_aif_out, .name = wname, .sname = stname, \
231 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ 231 .channel = wchan, SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
232 .event = wevent, .event_flags = wflags } 232 .event = wevent, .event_flags = wflags }
233#define SND_SOC_DAPM_DAC(wname, stname, wreg, wshift, winvert) \ 233#define SND_SOC_DAPM_DAC(wname, stname, wreg, wshift, winvert) \
234{ .id = snd_soc_dapm_dac, .name = wname, .sname = stname, \ 234{ .id = snd_soc_dapm_dac, .name = wname, .sname = stname, \
@@ -407,6 +407,10 @@ int snd_soc_dapm_new_dai_widgets(struct snd_soc_dapm_context *dapm,
407int snd_soc_dapm_link_dai_widgets(struct snd_soc_card *card); 407int snd_soc_dapm_link_dai_widgets(struct snd_soc_card *card);
408void snd_soc_dapm_connect_dai_link_widgets(struct snd_soc_card *card); 408void snd_soc_dapm_connect_dai_link_widgets(struct snd_soc_card *card);
409 409
410int snd_soc_dapm_update_dai(struct snd_pcm_substream *substream,
411 struct snd_pcm_hw_params *params,
412 struct snd_soc_dai *dai);
413
410/* dapm path setup */ 414/* dapm path setup */
411int snd_soc_dapm_new_widgets(struct snd_soc_card *card); 415int snd_soc_dapm_new_widgets(struct snd_soc_card *card);
412void snd_soc_dapm_free(struct snd_soc_dapm_context *dapm); 416void snd_soc_dapm_free(struct snd_soc_dapm_context *dapm);
@@ -519,6 +523,9 @@ enum snd_soc_dapm_type {
519 snd_soc_dapm_asrc, /* DSP/CODEC ASRC component */ 523 snd_soc_dapm_asrc, /* DSP/CODEC ASRC component */
520 snd_soc_dapm_encoder, /* FW/SW audio encoder component */ 524 snd_soc_dapm_encoder, /* FW/SW audio encoder component */
521 snd_soc_dapm_decoder, /* FW/SW audio decoder component */ 525 snd_soc_dapm_decoder, /* FW/SW audio decoder component */
526
527 /* Don't edit below this line */
528 SND_SOC_DAPM_TYPE_COUNT
522}; 529};
523 530
524enum snd_soc_dapm_subclass { 531enum snd_soc_dapm_subclass {
@@ -540,6 +547,8 @@ struct snd_soc_dapm_route {
540 /* Note: currently only supported for links where source is a supply */ 547 /* Note: currently only supported for links where source is a supply */
541 int (*connected)(struct snd_soc_dapm_widget *source, 548 int (*connected)(struct snd_soc_dapm_widget *source,
542 struct snd_soc_dapm_widget *sink); 549 struct snd_soc_dapm_widget *sink);
550
551 struct snd_soc_dobj dobj;
543}; 552};
544 553
545/* dapm audio path between two widgets */ 554/* dapm audio path between two widgets */
@@ -625,6 +634,8 @@ struct snd_soc_dapm_widget {
625 int endpoints[2]; 634 int endpoints[2];
626 635
627 struct clk *clk; 636 struct clk *clk;
637
638 int channel;
628}; 639};
629 640
630struct snd_soc_dapm_update { 641struct snd_soc_dapm_update {
diff --git a/include/sound/soc-topology.h b/include/sound/soc-topology.h
index fa4b8413d2e2..5223896de26f 100644
--- a/include/sound/soc-topology.h
+++ b/include/sound/soc-topology.h
@@ -38,12 +38,14 @@ struct snd_soc_dapm_route;
38enum snd_soc_dobj_type { 38enum snd_soc_dobj_type {
39 SND_SOC_DOBJ_NONE = 0, /* object is not dynamic */ 39 SND_SOC_DOBJ_NONE = 0, /* object is not dynamic */
40 SND_SOC_DOBJ_MIXER, 40 SND_SOC_DOBJ_MIXER,
41 SND_SOC_DOBJ_ENUM,
42 SND_SOC_DOBJ_BYTES, 41 SND_SOC_DOBJ_BYTES,
43 SND_SOC_DOBJ_PCM, 42 SND_SOC_DOBJ_ENUM,
43 SND_SOC_DOBJ_GRAPH,
44 SND_SOC_DOBJ_WIDGET,
44 SND_SOC_DOBJ_DAI_LINK, 45 SND_SOC_DOBJ_DAI_LINK,
46 SND_SOC_DOBJ_PCM,
45 SND_SOC_DOBJ_CODEC_LINK, 47 SND_SOC_DOBJ_CODEC_LINK,
46 SND_SOC_DOBJ_WIDGET, 48 SND_SOC_DOBJ_BACKEND_LINK,
47}; 49};
48 50
49/* dynamic control object */ 51/* dynamic control object */
diff --git a/include/sound/soc.h b/include/sound/soc.h
index e665f111b0d2..eb7db605955b 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -802,6 +802,9 @@ struct snd_soc_component_driver {
802 int probe_order; 802 int probe_order;
803 int remove_order; 803 int remove_order;
804 804
805 /* signal if the module handling the component cannot be removed */
806 unsigned int ignore_module_refcount:1;
807
805 /* bits */ 808 /* bits */
806 unsigned int idle_bias_on:1; 809 unsigned int idle_bias_on:1;
807 unsigned int suspend_bias_off:1; 810 unsigned int suspend_bias_off:1;
@@ -891,6 +894,18 @@ struct snd_soc_dai_link {
891 /* config - must be set by machine driver */ 894 /* config - must be set by machine driver */
892 const char *name; /* Codec name */ 895 const char *name; /* Codec name */
893 const char *stream_name; /* Stream name */ 896 const char *stream_name; /* Stream name */
897
898 /*
899 * cpu_name
900 * cpu_of_node
901 * cpu_dai_name
902 *
903 * These are legacy style, and will be replaced to
904 * modern style (= snd_soc_dai_link_component) in the future,
905 * but, not yet supported so far.
906 * If modern style was supported for CPU, all driver will switch
907 * to use it, and, legacy style code will be removed from ALSA SoC.
908 */
894 /* 909 /*
895 * You MAY specify the link's CPU-side device, either by device name, 910 * You MAY specify the link's CPU-side device, either by device name,
896 * or by DT/OF node, but not both. If this information is omitted, 911 * or by DT/OF node, but not both. If this information is omitted,
@@ -906,6 +921,19 @@ struct snd_soc_dai_link {
906 * only, which only works well when that device exposes a single DAI. 921 * only, which only works well when that device exposes a single DAI.
907 */ 922 */
908 const char *cpu_dai_name; 923 const char *cpu_dai_name;
924
925 /*
926 * codec_name
927 * codec_of_node
928 * codec_dai_name
929 *
930 * These are legacy style, it will be converted to modern style
931 * (= snd_soc_dai_link_component) automatically in soc-core
932 * if driver is using legacy style.
933 * Driver shouldn't use both legacy and modern style in the same time.
934 * If modern style was supported for CPU, all driver will switch
935 * to use it, and, legacy style code will be removed from ALSA SoC.
936 */
909 /* 937 /*
910 * You MUST specify the link's codec, either by device name, or by 938 * You MUST specify the link's codec, either by device name, or by
911 * DT/OF node, but not both. 939 * DT/OF node, but not both.
@@ -919,13 +947,25 @@ struct snd_soc_dai_link {
919 unsigned int num_codecs; 947 unsigned int num_codecs;
920 948
921 /* 949 /*
950 * platform_name
951 * platform_of_node
952 *
953 * These are legacy style, it will be converted to modern style
954 * (= snd_soc_dai_link_component) automatically in soc-core
955 * if driver is using legacy style.
956 * Driver shouldn't use both legacy and modern style in the same time.
957 * If modern style was supported for CPU, all driver will switch
958 * to use it, and, legacy style code will be removed from ALSA SoC.
959 */
960 /*
922 * You MAY specify the link's platform/PCM/DMA driver, either by 961 * You MAY specify the link's platform/PCM/DMA driver, either by
923 * device name, or by DT/OF node, but not both. Some forms of link 962 * device name, or by DT/OF node, but not both. Some forms of link
924 * do not need a platform. 963 * do not need a platform.
925 */ 964 */
926 const char *platform_name; 965 const char *platform_name;
927 struct device_node *platform_of_node; 966 struct device_node *platform_of_node;
928 struct snd_soc_dai_link_component *platform; 967 struct snd_soc_dai_link_component *platforms;
968 unsigned int num_platforms;
929 969
930 int id; /* optional ID for machine driver link identification */ 970 int id; /* optional ID for machine driver link identification */
931 971
@@ -1543,6 +1583,37 @@ struct snd_soc_dai *snd_soc_card_get_codec_dai(struct snd_soc_card *card,
1543 return NULL; 1583 return NULL;
1544} 1584}
1545 1585
1586static inline
1587int snd_soc_fixup_dai_links_platform_name(struct snd_soc_card *card,
1588 const char *platform_name)
1589{
1590 struct snd_soc_dai_link *dai_link;
1591 const char *name;
1592 int i;
1593
1594 if (!platform_name) /* nothing to do */
1595 return 0;
1596
1597 /* set platform name for each dailink */
1598 for_each_card_prelinks(card, i, dai_link) {
1599 name = devm_kstrdup(card->dev, platform_name, GFP_KERNEL);
1600 if (!name)
1601 return -ENOMEM;
1602
1603 if (dai_link->platforms)
1604 /* only single platform is supported for now */
1605 dai_link->platforms->name = name;
1606 else
1607 /*
1608 * legacy mode, this case will be removed when all
1609 * derivers are switched to modern style dai_link.
1610 */
1611 dai_link->platform_name = name;
1612 }
1613
1614 return 0;
1615}
1616
1546#ifdef CONFIG_DEBUG_FS 1617#ifdef CONFIG_DEBUG_FS
1547extern struct dentry *snd_soc_debugfs_root; 1618extern struct dentry *snd_soc_debugfs_root;
1548#endif 1619#endif