diff options
author | Takashi Iwai <tiwai@suse.de> | 2016-05-16 08:59:00 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2016-05-16 08:59:00 -0400 |
commit | a158f2b79ff1948c864a38296ea4249f7296362b (patch) | |
tree | e62d50376d29a63814cf9d26cbd4c522f6f9271a /include/sound | |
parent | 581abbaa03367f0b1327521f30bd2b69b8075b2f (diff) | |
parent | 515511a7920c69aebf7f5fef0cb8e1df6767f34c (diff) |
Merge tag 'asoc-v4.7' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus
ASoC: Updates for v4.7
The updates this time around are almost all driver code:
- Further slow progress on the topology code.
- Substantial updates and improvements for the da7219, es8328, fsl-ssi
Intel and rcar drivers.
Diffstat (limited to 'include/sound')
-rw-r--r-- | include/sound/dmaengine_pcm.h | 12 | ||||
-rw-r--r-- | include/sound/hdaudio_ext.h | 13 | ||||
-rw-r--r-- | include/sound/hdmi-codec.h | 100 | ||||
-rw-r--r-- | include/sound/pcm_iec958.h | 2 | ||||
-rw-r--r-- | include/sound/soc-dapm.h | 3 | ||||
-rw-r--r-- | include/sound/soc.h | 5 |
6 files changed, 133 insertions, 2 deletions
diff --git a/include/sound/dmaengine_pcm.h b/include/sound/dmaengine_pcm.h index f86ef5ea9b01..67be2445941a 100644 --- a/include/sound/dmaengine_pcm.h +++ b/include/sound/dmaengine_pcm.h | |||
@@ -51,6 +51,16 @@ struct dma_chan *snd_dmaengine_pcm_request_channel(dma_filter_fn filter_fn, | |||
51 | void *filter_data); | 51 | void *filter_data); |
52 | struct dma_chan *snd_dmaengine_pcm_get_chan(struct snd_pcm_substream *substream); | 52 | struct dma_chan *snd_dmaengine_pcm_get_chan(struct snd_pcm_substream *substream); |
53 | 53 | ||
54 | /* | ||
55 | * The DAI supports packed transfers, eg 2 16-bit samples in a 32-bit word. | ||
56 | * If this flag is set the dmaengine driver won't put any restriction on | ||
57 | * the supported sample formats and set the DMA transfer size to undefined. | ||
58 | * The DAI driver is responsible to disable any unsupported formats in it's | ||
59 | * configuration and catch corner cases that are not already handled in | ||
60 | * the ALSA core. | ||
61 | */ | ||
62 | #define SND_DMAENGINE_PCM_DAI_FLAG_PACK BIT(0) | ||
63 | |||
54 | /** | 64 | /** |
55 | * struct snd_dmaengine_dai_dma_data - DAI DMA configuration data | 65 | * struct snd_dmaengine_dai_dma_data - DAI DMA configuration data |
56 | * @addr: Address of the DAI data source or destination register. | 66 | * @addr: Address of the DAI data source or destination register. |
@@ -63,6 +73,7 @@ struct dma_chan *snd_dmaengine_pcm_get_chan(struct snd_pcm_substream *substream) | |||
63 | * requesting the DMA channel. | 73 | * requesting the DMA channel. |
64 | * @chan_name: Custom channel name to use when requesting DMA channel. | 74 | * @chan_name: Custom channel name to use when requesting DMA channel. |
65 | * @fifo_size: FIFO size of the DAI controller in bytes | 75 | * @fifo_size: FIFO size of the DAI controller in bytes |
76 | * @flags: PCM_DAI flags, only SND_DMAENGINE_PCM_DAI_FLAG_PACK for now | ||
66 | */ | 77 | */ |
67 | struct snd_dmaengine_dai_dma_data { | 78 | struct snd_dmaengine_dai_dma_data { |
68 | dma_addr_t addr; | 79 | dma_addr_t addr; |
@@ -72,6 +83,7 @@ struct snd_dmaengine_dai_dma_data { | |||
72 | void *filter_data; | 83 | void *filter_data; |
73 | const char *chan_name; | 84 | const char *chan_name; |
74 | unsigned int fifo_size; | 85 | unsigned int fifo_size; |
86 | unsigned int flags; | ||
75 | }; | 87 | }; |
76 | 88 | ||
77 | void snd_dmaengine_pcm_set_config_from_dai_data( | 89 | void snd_dmaengine_pcm_set_config_from_dai_data( |
diff --git a/include/sound/hdaudio_ext.h b/include/sound/hdaudio_ext.h index 07fa59237feb..b9593b201599 100644 --- a/include/sound/hdaudio_ext.h +++ b/include/sound/hdaudio_ext.h | |||
@@ -14,6 +14,8 @@ | |||
14 | * @gtscap: gts capabilities pointer | 14 | * @gtscap: gts capabilities pointer |
15 | * @drsmcap: dma resume capabilities pointer | 15 | * @drsmcap: dma resume capabilities pointer |
16 | * @hlink_list: link list of HDA links | 16 | * @hlink_list: link list of HDA links |
17 | * @lock: lock for link mgmt | ||
18 | * @cmd_dma_state: state of cmd DMAs: CORB and RIRB | ||
17 | */ | 19 | */ |
18 | struct hdac_ext_bus { | 20 | struct hdac_ext_bus { |
19 | struct hdac_bus bus; | 21 | struct hdac_bus bus; |
@@ -27,6 +29,9 @@ struct hdac_ext_bus { | |||
27 | void __iomem *drsmcap; | 29 | void __iomem *drsmcap; |
28 | 30 | ||
29 | struct list_head hlink_list; | 31 | struct list_head hlink_list; |
32 | |||
33 | struct mutex lock; | ||
34 | bool cmd_dma_state; | ||
30 | }; | 35 | }; |
31 | 36 | ||
32 | int snd_hdac_ext_bus_init(struct hdac_ext_bus *sbus, struct device *dev, | 37 | int snd_hdac_ext_bus_init(struct hdac_ext_bus *sbus, struct device *dev, |
@@ -142,6 +147,9 @@ struct hdac_ext_link { | |||
142 | void __iomem *ml_addr; /* link output stream reg pointer */ | 147 | void __iomem *ml_addr; /* link output stream reg pointer */ |
143 | u32 lcaps; /* link capablities */ | 148 | u32 lcaps; /* link capablities */ |
144 | u16 lsdiid; /* link sdi identifier */ | 149 | u16 lsdiid; /* link sdi identifier */ |
150 | |||
151 | int ref_count; | ||
152 | |||
145 | struct list_head list; | 153 | struct list_head list; |
146 | }; | 154 | }; |
147 | 155 | ||
@@ -154,6 +162,11 @@ void snd_hdac_ext_link_set_stream_id(struct hdac_ext_link *link, | |||
154 | void snd_hdac_ext_link_clear_stream_id(struct hdac_ext_link *link, | 162 | void snd_hdac_ext_link_clear_stream_id(struct hdac_ext_link *link, |
155 | int stream); | 163 | int stream); |
156 | 164 | ||
165 | int snd_hdac_ext_bus_link_get(struct hdac_ext_bus *ebus, | ||
166 | struct hdac_ext_link *link); | ||
167 | int snd_hdac_ext_bus_link_put(struct hdac_ext_bus *ebus, | ||
168 | struct hdac_ext_link *link); | ||
169 | |||
157 | /* update register macro */ | 170 | /* update register macro */ |
158 | #define snd_hdac_updatel(addr, reg, mask, val) \ | 171 | #define snd_hdac_updatel(addr, reg, mask, val) \ |
159 | writel(((readl(addr + reg) & ~(mask)) | (val)), \ | 172 | writel(((readl(addr + reg) & ~(mask)) | (val)), \ |
diff --git a/include/sound/hdmi-codec.h b/include/sound/hdmi-codec.h new file mode 100644 index 000000000000..fc3a481ad91e --- /dev/null +++ b/include/sound/hdmi-codec.h | |||
@@ -0,0 +1,100 @@ | |||
1 | /* | ||
2 | * hdmi-codec.h - HDMI Codec driver API | ||
3 | * | ||
4 | * Copyright (C) 2014 Texas Instruments Incorporated - http://www.ti.com | ||
5 | * | ||
6 | * Author: Jyri Sarha <jsarha@ti.com> | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or | ||
9 | * modify it under the terms of the GNU General Public License | ||
10 | * version 2 as published by the Free Software Foundation. | ||
11 | * | ||
12 | * This program is distributed in the hope that it will be useful, but | ||
13 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
15 | * General Public License for more details. | ||
16 | */ | ||
17 | |||
18 | #ifndef __HDMI_CODEC_H__ | ||
19 | #define __HDMI_CODEC_H__ | ||
20 | |||
21 | #include <linux/hdmi.h> | ||
22 | #include <drm/drm_edid.h> | ||
23 | #include <sound/asoundef.h> | ||
24 | #include <uapi/sound/asound.h> | ||
25 | |||
26 | /* | ||
27 | * Protocol between ASoC cpu-dai and HDMI-encoder | ||
28 | */ | ||
29 | struct hdmi_codec_daifmt { | ||
30 | enum { | ||
31 | HDMI_I2S, | ||
32 | HDMI_RIGHT_J, | ||
33 | HDMI_LEFT_J, | ||
34 | HDMI_DSP_A, | ||
35 | HDMI_DSP_B, | ||
36 | HDMI_AC97, | ||
37 | HDMI_SPDIF, | ||
38 | } fmt; | ||
39 | int bit_clk_inv:1; | ||
40 | int frame_clk_inv:1; | ||
41 | int bit_clk_master:1; | ||
42 | int frame_clk_master:1; | ||
43 | }; | ||
44 | |||
45 | /* | ||
46 | * HDMI audio parameters | ||
47 | */ | ||
48 | struct hdmi_codec_params { | ||
49 | struct hdmi_audio_infoframe cea; | ||
50 | struct snd_aes_iec958 iec; | ||
51 | int sample_rate; | ||
52 | int sample_width; | ||
53 | int channels; | ||
54 | }; | ||
55 | |||
56 | struct hdmi_codec_ops { | ||
57 | /* | ||
58 | * Called when ASoC starts an audio stream setup. | ||
59 | * Optional | ||
60 | */ | ||
61 | int (*audio_startup)(struct device *dev); | ||
62 | |||
63 | /* | ||
64 | * Configures HDMI-encoder for audio stream. | ||
65 | * Mandatory | ||
66 | */ | ||
67 | int (*hw_params)(struct device *dev, | ||
68 | struct hdmi_codec_daifmt *fmt, | ||
69 | struct hdmi_codec_params *hparms); | ||
70 | |||
71 | /* | ||
72 | * Shuts down the audio stream. | ||
73 | * Mandatory | ||
74 | */ | ||
75 | void (*audio_shutdown)(struct device *dev); | ||
76 | |||
77 | /* | ||
78 | * Mute/unmute HDMI audio stream. | ||
79 | * Optional | ||
80 | */ | ||
81 | int (*digital_mute)(struct device *dev, bool enable); | ||
82 | |||
83 | /* | ||
84 | * Provides EDID-Like-Data from connected HDMI device. | ||
85 | * Optional | ||
86 | */ | ||
87 | int (*get_eld)(struct device *dev, uint8_t *buf, size_t len); | ||
88 | }; | ||
89 | |||
90 | /* HDMI codec initalization data */ | ||
91 | struct hdmi_codec_pdata { | ||
92 | const struct hdmi_codec_ops *ops; | ||
93 | uint i2s:1; | ||
94 | uint spdif:1; | ||
95 | int max_i2s_channels; | ||
96 | }; | ||
97 | |||
98 | #define HDMI_CODEC_DRV_NAME "hdmi-audio-codec" | ||
99 | |||
100 | #endif /* __HDMI_CODEC_H__ */ | ||
diff --git a/include/sound/pcm_iec958.h b/include/sound/pcm_iec958.h index 0eed397aca8e..36f023acb201 100644 --- a/include/sound/pcm_iec958.h +++ b/include/sound/pcm_iec958.h | |||
@@ -6,4 +6,6 @@ | |||
6 | int snd_pcm_create_iec958_consumer(struct snd_pcm_runtime *runtime, u8 *cs, | 6 | int snd_pcm_create_iec958_consumer(struct snd_pcm_runtime *runtime, u8 *cs, |
7 | size_t len); | 7 | size_t len); |
8 | 8 | ||
9 | int snd_pcm_create_iec958_consumer_hw_params(struct snd_pcm_hw_params *params, | ||
10 | u8 *cs, size_t len); | ||
9 | #endif | 11 | #endif |
diff --git a/include/sound/soc-dapm.h b/include/sound/soc-dapm.h index 97069466c38d..3101d53468aa 100644 --- a/include/sound/soc-dapm.h +++ b/include/sound/soc-dapm.h | |||
@@ -100,6 +100,7 @@ struct device; | |||
100 | { .id = snd_soc_dapm_mixer_named_ctl, .name = wname, \ | 100 | { .id = snd_soc_dapm_mixer_named_ctl, .name = wname, \ |
101 | SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ | 101 | SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ |
102 | .kcontrol_news = wcontrols, .num_kcontrols = wncontrols} | 102 | .kcontrol_news = wcontrols, .num_kcontrols = wncontrols} |
103 | /* DEPRECATED: use SND_SOC_DAPM_SUPPLY */ | ||
103 | #define SND_SOC_DAPM_MICBIAS(wname, wreg, wshift, winvert) \ | 104 | #define SND_SOC_DAPM_MICBIAS(wname, wreg, wshift, winvert) \ |
104 | { .id = snd_soc_dapm_micbias, .name = wname, \ | 105 | { .id = snd_soc_dapm_micbias, .name = wname, \ |
105 | SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ | 106 | SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ |
@@ -473,7 +474,7 @@ enum snd_soc_dapm_type { | |||
473 | snd_soc_dapm_out_drv, /* output driver */ | 474 | snd_soc_dapm_out_drv, /* output driver */ |
474 | snd_soc_dapm_adc, /* analog to digital converter */ | 475 | snd_soc_dapm_adc, /* analog to digital converter */ |
475 | snd_soc_dapm_dac, /* digital to analog converter */ | 476 | snd_soc_dapm_dac, /* digital to analog converter */ |
476 | snd_soc_dapm_micbias, /* microphone bias (power) */ | 477 | snd_soc_dapm_micbias, /* microphone bias (power) - DEPRECATED: use snd_soc_dapm_supply */ |
477 | snd_soc_dapm_mic, /* microphone */ | 478 | snd_soc_dapm_mic, /* microphone */ |
478 | snd_soc_dapm_hp, /* headphones */ | 479 | snd_soc_dapm_hp, /* headphones */ |
479 | snd_soc_dapm_spk, /* speaker */ | 480 | snd_soc_dapm_spk, /* speaker */ |
diff --git a/include/sound/soc.h b/include/sound/soc.h index 02b4a215fd75..fd7b58a58d6f 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h | |||
@@ -1002,7 +1002,7 @@ struct snd_soc_dai_link { | |||
1002 | */ | 1002 | */ |
1003 | const char *platform_name; | 1003 | const char *platform_name; |
1004 | struct device_node *platform_of_node; | 1004 | struct device_node *platform_of_node; |
1005 | int be_id; /* optional ID for machine driver BE identification */ | 1005 | int id; /* optional ID for machine driver link identification */ |
1006 | 1006 | ||
1007 | const struct snd_soc_pcm_stream *params; | 1007 | const struct snd_soc_pcm_stream *params; |
1008 | unsigned int num_params; | 1008 | unsigned int num_params; |
@@ -1683,6 +1683,9 @@ void snd_soc_remove_dai_link(struct snd_soc_card *card, | |||
1683 | int snd_soc_register_dai(struct snd_soc_component *component, | 1683 | int snd_soc_register_dai(struct snd_soc_component *component, |
1684 | struct snd_soc_dai_driver *dai_drv); | 1684 | struct snd_soc_dai_driver *dai_drv); |
1685 | 1685 | ||
1686 | struct snd_soc_dai *snd_soc_find_dai( | ||
1687 | const struct snd_soc_dai_link_component *dlc); | ||
1688 | |||
1686 | #include <sound/soc-dai.h> | 1689 | #include <sound/soc-dai.h> |
1687 | 1690 | ||
1688 | #ifdef CONFIG_DEBUG_FS | 1691 | #ifdef CONFIG_DEBUG_FS |