aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMark Brown <broonie@linaro.org>2014-03-23 10:00:41 -0400
committerMark Brown <broonie@linaro.org>2014-03-23 10:00:41 -0400
commitd66fa86956149a211db3d7ae9e9f2536b65ccde4 (patch)
tree013c71ec06c6d9710a183854ce1a0fe33530a0db /include
parentebec909345bbb1e2d06cd0d94f65664edcc0f208 (diff)
parentdeeed33850c8a376addabbf971df433b2a1ba74c (diff)
Merge tag 'asoc-v3.15' into asoc-next
ASoC: Updates for v3.15 Quite a busy release for ASoC this time, more on janitorial work than exciting new features but welcome nontheless: - Lots of cleanups from Takashi for enumerations; the original API for these was error prone so he's refactored lots of code to use more modern APIs which avoid issues. - Elimination of the ASoC level wrappers for I2C and SPI moving us closer to converting to regmap completely and avoiding some randconfig hassle. - Provide both manually and transparently locked DAPM APIs rather than a mix of the two fixing some concurrency issues. - Start converting CODEC drivers to use separate bus interface drivers rather than having them all in one file helping avoid dependency issues. - DPCM support for Intel Haswell and Bay Trail platforms. - Lots of work on improvements for simple-card, DaVinci and the Renesas rcar drivers. - New drivers for Analog Devices ADAU1977, TI PCM512x and parts of the CSR SiRF SoC. # gpg: Signature made Wed 12 Mar 2014 23:05:45 GMT using RSA key ID 7EA229BD # gpg: Good signature from "Mark Brown <broonie@sirena.org.uk>" # gpg: aka "Mark Brown <broonie@debian.org>" # gpg: aka "Mark Brown <broonie@kernel.org>" # gpg: aka "Mark Brown <broonie@tardis.ed.ac.uk>" # gpg: aka "Mark Brown <broonie@linaro.org>" # gpg: aka "Mark Brown <Mark.Brown@linaro.org>"
Diffstat (limited to 'include')
-rw-r--r--include/linux/atmel-ssc.h1
-rw-r--r--include/linux/mfd/arizona/registers.h6
-rw-r--r--include/linux/platform_data/adau1977.h45
-rw-r--r--include/linux/platform_data/asoc-s3c.h3
-rw-r--r--include/linux/platform_data/asoc-s3c24xx_simtec.h3
-rw-r--r--include/linux/platform_data/davinci_asp.h4
-rw-r--r--include/linux/regmap.h9
-rw-r--r--include/sound/rcar_snd.h36
-rw-r--r--include/sound/simple_card.h6
-rw-r--r--include/sound/soc-dai.h3
-rw-r--r--include/sound/soc-dapm.h40
-rw-r--r--include/sound/soc.h126
-rw-r--r--include/trace/events/hswadsp.h384
-rw-r--r--include/trace/events/intel-sst.h148
14 files changed, 736 insertions, 78 deletions
diff --git a/include/linux/atmel-ssc.h b/include/linux/atmel-ssc.h
index 66a0e5384edd..571a12ebb018 100644
--- a/include/linux/atmel-ssc.h
+++ b/include/linux/atmel-ssc.h
@@ -18,6 +18,7 @@ struct ssc_device {
18 struct clk *clk; 18 struct clk *clk;
19 int user; 19 int user;
20 int irq; 20 int irq;
21 bool clk_from_rk_pin;
21}; 22};
22 23
23struct ssc_device * __must_check ssc_request(unsigned int ssc_num); 24struct ssc_device * __must_check ssc_request(unsigned int ssc_num);
diff --git a/include/linux/mfd/arizona/registers.h b/include/linux/mfd/arizona/registers.h
index fdf3aa376eb2..3ddaa634b19d 100644
--- a/include/linux/mfd/arizona/registers.h
+++ b/include/linux/mfd/arizona/registers.h
@@ -1702,9 +1702,9 @@
1702/* 1702/*
1703 * R373 (0x175) - FLL1 Control 5 1703 * R373 (0x175) - FLL1 Control 5
1704 */ 1704 */
1705#define ARIZONA_FLL1_FRATIO_MASK 0x0700 /* FLL1_FRATIO - [10:8] */ 1705#define ARIZONA_FLL1_FRATIO_MASK 0x0F00 /* FLL1_FRATIO - [11:8] */
1706#define ARIZONA_FLL1_FRATIO_SHIFT 8 /* FLL1_FRATIO - [10:8] */ 1706#define ARIZONA_FLL1_FRATIO_SHIFT 8 /* FLL1_FRATIO - [11:8] */
1707#define ARIZONA_FLL1_FRATIO_WIDTH 3 /* FLL1_FRATIO - [10:8] */ 1707#define ARIZONA_FLL1_FRATIO_WIDTH 4 /* FLL1_FRATIO - [11:8] */
1708#define ARIZONA_FLL1_OUTDIV_MASK 0x000E /* FLL1_OUTDIV - [3:1] */ 1708#define ARIZONA_FLL1_OUTDIV_MASK 0x000E /* FLL1_OUTDIV - [3:1] */
1709#define ARIZONA_FLL1_OUTDIV_SHIFT 1 /* FLL1_OUTDIV - [3:1] */ 1709#define ARIZONA_FLL1_OUTDIV_SHIFT 1 /* FLL1_OUTDIV - [3:1] */
1710#define ARIZONA_FLL1_OUTDIV_WIDTH 3 /* FLL1_OUTDIV - [3:1] */ 1710#define ARIZONA_FLL1_OUTDIV_WIDTH 3 /* FLL1_OUTDIV - [3:1] */
diff --git a/include/linux/platform_data/adau1977.h b/include/linux/platform_data/adau1977.h
new file mode 100644
index 000000000000..bed11d908f92
--- /dev/null
+++ b/include/linux/platform_data/adau1977.h
@@ -0,0 +1,45 @@
1/*
2 * ADAU1977/ADAU1978/ADAU1979 driver
3 *
4 * Copyright 2014 Analog Devices Inc.
5 * Author: Lars-Peter Clausen <lars@metafoo.de>
6 *
7 * Licensed under the GPL-2.
8 */
9
10#ifndef __LINUX_PLATFORM_DATA_ADAU1977_H__
11#define __LINUX_PLATFORM_DATA_ADAU1977_H__
12
13/**
14 * enum adau1977_micbias - ADAU1977 MICBIAS pin voltage setting
15 * @ADAU1977_MICBIAS_5V0: MICBIAS is set to 5.0 V
16 * @ADAU1977_MICBIAS_5V5: MICBIAS is set to 5.5 V
17 * @ADAU1977_MICBIAS_6V0: MICBIAS is set to 6.0 V
18 * @ADAU1977_MICBIAS_6V5: MICBIAS is set to 6.5 V
19 * @ADAU1977_MICBIAS_7V0: MICBIAS is set to 7.0 V
20 * @ADAU1977_MICBIAS_7V5: MICBIAS is set to 7.5 V
21 * @ADAU1977_MICBIAS_8V0: MICBIAS is set to 8.0 V
22 * @ADAU1977_MICBIAS_8V5: MICBIAS is set to 8.5 V
23 * @ADAU1977_MICBIAS_9V0: MICBIAS is set to 9.0 V
24 */
25enum adau1977_micbias {
26 ADAU1977_MICBIAS_5V0 = 0x0,
27 ADAU1977_MICBIAS_5V5 = 0x1,
28 ADAU1977_MICBIAS_6V0 = 0x2,
29 ADAU1977_MICBIAS_6V5 = 0x3,
30 ADAU1977_MICBIAS_7V0 = 0x4,
31 ADAU1977_MICBIAS_7V5 = 0x5,
32 ADAU1977_MICBIAS_8V0 = 0x6,
33 ADAU1977_MICBIAS_8V5 = 0x7,
34 ADAU1977_MICBIAS_9V0 = 0x8,
35};
36
37/**
38 * struct adau1977_platform_data - Platform configuration data for the ADAU1977
39 * @micbias: Specifies the voltage for the MICBIAS pin
40 */
41struct adau1977_platform_data {
42 enum adau1977_micbias micbias;
43};
44
45#endif
diff --git a/include/linux/platform_data/asoc-s3c.h b/include/linux/platform_data/asoc-s3c.h
index 9efc04dd255a..709c6f7e2f8c 100644
--- a/include/linux/platform_data/asoc-s3c.h
+++ b/include/linux/platform_data/asoc-s3c.h
@@ -1,5 +1,4 @@
1/* arch/arm/plat-samsung/include/plat/audio.h 1/*
2 *
3 * Copyright (c) 2009 Samsung Electronics Co. Ltd 2 * Copyright (c) 2009 Samsung Electronics Co. Ltd
4 * Author: Jaswinder Singh <jassi.brar@samsung.com> 3 * Author: Jaswinder Singh <jassi.brar@samsung.com>
5 * 4 *
diff --git a/include/linux/platform_data/asoc-s3c24xx_simtec.h b/include/linux/platform_data/asoc-s3c24xx_simtec.h
index 376af5286a3e..d220e54123aa 100644
--- a/include/linux/platform_data/asoc-s3c24xx_simtec.h
+++ b/include/linux/platform_data/asoc-s3c24xx_simtec.h
@@ -1,5 +1,4 @@
1/* arch/arm/plat-samsung/include/plat/audio-simtec.h 1/*
2 *
3 * Copyright 2008 Simtec Electronics 2 * Copyright 2008 Simtec Electronics
4 * http://armlinux.simtec.co.uk/ 3 * http://armlinux.simtec.co.uk/
5 * Ben Dooks <ben@simtec.co.uk> 4 * Ben Dooks <ben@simtec.co.uk>
diff --git a/include/linux/platform_data/davinci_asp.h b/include/linux/platform_data/davinci_asp.h
index 5245992b0367..85ad68f9206a 100644
--- a/include/linux/platform_data/davinci_asp.h
+++ b/include/linux/platform_data/davinci_asp.h
@@ -18,7 +18,7 @@
18 18
19#include <linux/genalloc.h> 19#include <linux/genalloc.h>
20 20
21struct snd_platform_data { 21struct davinci_mcasp_pdata {
22 u32 tx_dma_offset; 22 u32 tx_dma_offset;
23 u32 rx_dma_offset; 23 u32 rx_dma_offset;
24 int asp_chan_q; /* event queue number for ASP channel */ 24 int asp_chan_q; /* event queue number for ASP channel */
@@ -87,6 +87,8 @@ struct snd_platform_data {
87 int tx_dma_channel; 87 int tx_dma_channel;
88 int rx_dma_channel; 88 int rx_dma_channel;
89}; 89};
90/* TODO: Fix arch/arm/mach-davinci/ users and remove this define */
91#define snd_platform_data davinci_mcasp_pdata
90 92
91enum { 93enum {
92 MCASP_VERSION_1 = 0, /* DM646x */ 94 MCASP_VERSION_1 = 0, /* DM646x */
diff --git a/include/linux/regmap.h b/include/linux/regmap.h
index 4149f1a9b003..3e1a2e4a92ad 100644
--- a/include/linux/regmap.h
+++ b/include/linux/regmap.h
@@ -423,6 +423,8 @@ bool regmap_check_range_table(struct regmap *map, unsigned int reg,
423 423
424int regmap_register_patch(struct regmap *map, const struct reg_default *regs, 424int regmap_register_patch(struct regmap *map, const struct reg_default *regs,
425 int num_regs); 425 int num_regs);
426int regmap_parse_val(struct regmap *map, const void *buf,
427 unsigned int *val);
426 428
427static inline bool regmap_reg_in_range(unsigned int reg, 429static inline bool regmap_reg_in_range(unsigned int reg,
428 const struct regmap_range *range) 430 const struct regmap_range *range)
@@ -695,6 +697,13 @@ static inline int regmap_register_patch(struct regmap *map,
695 return -EINVAL; 697 return -EINVAL;
696} 698}
697 699
700static inline int regmap_parse_val(struct regmap *map, const void *buf,
701 unsigned int *val)
702{
703 WARN_ONCE(1, "regmap API is disabled");
704 return -EINVAL;
705}
706
698static inline struct regmap *dev_get_regmap(struct device *dev, 707static inline struct regmap *dev_get_regmap(struct device *dev,
699 const char *name) 708 const char *name)
700{ 709{
diff --git a/include/sound/rcar_snd.h b/include/sound/rcar_snd.h
index 6add6ccc811e..34a3c02a4576 100644
--- a/include/sound/rcar_snd.h
+++ b/include/sound/rcar_snd.h
@@ -34,17 +34,17 @@
34 * B : SSI direction 34 * B : SSI direction
35 */ 35 */
36#define RSND_SSI_CLK_PIN_SHARE (1 << 31) 36#define RSND_SSI_CLK_PIN_SHARE (1 << 31)
37#define RSND_SSI_SYNC (1 << 29) /* SSI34_sync etc */
38
39#define RSND_SSI_PLAY (1 << 24) 37#define RSND_SSI_PLAY (1 << 24)
40 38
39#define RSND_SSI(_dma_id, _pio_irq, _flags) \
40{ .dma_id = _dma_id, .pio_irq = _pio_irq, .flags = _flags }
41#define RSND_SSI_SET(_dai_id, _dma_id, _pio_irq, _flags) \ 41#define RSND_SSI_SET(_dai_id, _dma_id, _pio_irq, _flags) \
42{ .dai_id = _dai_id, .dma_id = _dma_id, .pio_irq = _pio_irq, .flags = _flags } 42{ .dai_id = _dai_id, .dma_id = _dma_id, .pio_irq = _pio_irq, .flags = _flags }
43#define RSND_SSI_UNUSED \ 43#define RSND_SSI_UNUSED \
44{ .dai_id = -1, .dma_id = -1, .pio_irq = -1, .flags = 0 } 44{ .dai_id = -1, .dma_id = -1, .pio_irq = -1, .flags = 0 }
45 45
46struct rsnd_ssi_platform_info { 46struct rsnd_ssi_platform_info {
47 int dai_id; 47 int dai_id; /* will be removed */
48 int dma_id; 48 int dma_id;
49 int pio_irq; 49 int pio_irq;
50 u32 flags; 50 u32 flags;
@@ -55,9 +55,31 @@ struct rsnd_ssi_platform_info {
55 */ 55 */
56#define RSND_SCU_USE_HPBIF (1 << 31) /* it needs RSND_SSI_DEPENDENT */ 56#define RSND_SCU_USE_HPBIF (1 << 31) /* it needs RSND_SSI_DEPENDENT */
57 57
58struct rsnd_scu_platform_info { 58#define RSND_SRC(rate, _dma_id) \
59{ .flags = RSND_SCU_USE_HPBIF, .convert_rate = rate, .dma_id = _dma_id, }
60#define RSND_SRC_SET(rate, _dma_id) \
61 { .flags = RSND_SCU_USE_HPBIF, .convert_rate = rate, .dma_id = _dma_id, }
62#define RSND_SRC_UNUSED \
63 { .flags = 0, .convert_rate = 0, .dma_id = 0, }
64
65#define rsnd_scu_platform_info rsnd_src_platform_info
66#define src_info scu_info
67#define src_info_nr scu_info_nr
68
69struct rsnd_src_platform_info {
59 u32 flags; 70 u32 flags;
60 u32 convert_rate; /* sampling rate convert */ 71 u32 convert_rate; /* sampling rate convert */
72 int dma_id; /* for Gen2 SCU */
73};
74
75struct rsnd_dai_path_info {
76 struct rsnd_ssi_platform_info *ssi;
77 struct rsnd_src_platform_info *src;
78};
79
80struct rsnd_dai_platform_info {
81 struct rsnd_dai_path_info playback;
82 struct rsnd_dai_path_info capture;
61}; 83};
62 84
63/* 85/*
@@ -75,8 +97,10 @@ struct rcar_snd_info {
75 u32 flags; 97 u32 flags;
76 struct rsnd_ssi_platform_info *ssi_info; 98 struct rsnd_ssi_platform_info *ssi_info;
77 int ssi_info_nr; 99 int ssi_info_nr;
78 struct rsnd_scu_platform_info *scu_info; 100 struct rsnd_src_platform_info *src_info;
79 int scu_info_nr; 101 int src_info_nr;
102 struct rsnd_dai_platform_info *dai_info;
103 int dai_info_nr;
80 int (*start)(int id); 104 int (*start)(int id);
81 int (*stop)(int id); 105 int (*stop)(int id);
82}; 106};
diff --git a/include/sound/simple_card.h b/include/sound/simple_card.h
index 6c74527d4926..9b0ac77177b6 100644
--- a/include/sound/simple_card.h
+++ b/include/sound/simple_card.h
@@ -18,6 +18,8 @@ struct asoc_simple_dai {
18 const char *name; 18 const char *name;
19 unsigned int fmt; 19 unsigned int fmt;
20 unsigned int sysclk; 20 unsigned int sysclk;
21 int slots;
22 int slot_width;
21}; 23};
22 24
23struct asoc_simple_card_info { 25struct asoc_simple_card_info {
@@ -29,10 +31,6 @@ struct asoc_simple_card_info {
29 unsigned int daifmt; 31 unsigned int daifmt;
30 struct asoc_simple_dai cpu_dai; 32 struct asoc_simple_dai cpu_dai;
31 struct asoc_simple_dai codec_dai; 33 struct asoc_simple_dai codec_dai;
32
33 /* used in simple-card.c */
34 struct snd_soc_dai_link snd_link;
35 struct snd_soc_card snd_card;
36}; 34};
37 35
38#endif /* __SIMPLE_CARD_H */ 36#endif /* __SIMPLE_CARD_H */
diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h
index 71f27c403194..2f66d5e8cd15 100644
--- a/include/sound/soc-dai.h
+++ b/include/sound/soc-dai.h
@@ -142,6 +142,8 @@ struct snd_soc_dai_ops {
142 * Called by soc_card drivers, normally in their hw_params. 142 * Called by soc_card drivers, normally in their hw_params.
143 */ 143 */
144 int (*set_fmt)(struct snd_soc_dai *dai, unsigned int fmt); 144 int (*set_fmt)(struct snd_soc_dai *dai, unsigned int fmt);
145 int (*of_xlate_tdm_slot_mask)(unsigned int slots,
146 unsigned int *tx_mask, unsigned int *rx_mask);
145 int (*set_tdm_slot)(struct snd_soc_dai *dai, 147 int (*set_tdm_slot)(struct snd_soc_dai *dai,
146 unsigned int tx_mask, unsigned int rx_mask, 148 unsigned int tx_mask, unsigned int rx_mask,
147 int slots, int slot_width); 149 int slots, int slot_width);
@@ -270,6 +272,7 @@ struct snd_soc_dai {
270 /* parent platform/codec */ 272 /* parent platform/codec */
271 struct snd_soc_platform *platform; 273 struct snd_soc_platform *platform;
272 struct snd_soc_codec *codec; 274 struct snd_soc_codec *codec;
275 struct snd_soc_component *component;
273 276
274 struct snd_soc_card *card; 277 struct snd_soc_card *card;
275 278
diff --git a/include/sound/soc-dapm.h b/include/sound/soc-dapm.h
index 6e89ef6c11c1..ef78f562f4a8 100644
--- a/include/sound/soc-dapm.h
+++ b/include/sound/soc-dapm.h
@@ -108,13 +108,9 @@ struct device;
108 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ 108 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
109 .kcontrol_news = wcontrols, .num_kcontrols = 1} 109 .kcontrol_news = wcontrols, .num_kcontrols = 1}
110#define SND_SOC_DAPM_VIRT_MUX(wname, wreg, wshift, winvert, wcontrols) \ 110#define SND_SOC_DAPM_VIRT_MUX(wname, wreg, wshift, winvert, wcontrols) \
111{ .id = snd_soc_dapm_virt_mux, .name = wname, \ 111 SND_SOC_DAPM_MUX(wname, wreg, wshift, winvert, wcontrols)
112 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
113 .kcontrol_news = wcontrols, .num_kcontrols = 1}
114#define SND_SOC_DAPM_VALUE_MUX(wname, wreg, wshift, winvert, wcontrols) \ 112#define SND_SOC_DAPM_VALUE_MUX(wname, wreg, wshift, winvert, wcontrols) \
115{ .id = snd_soc_dapm_value_mux, .name = wname, \ 113 SND_SOC_DAPM_MUX(wname, wreg, wshift, winvert, wcontrols)
116 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
117 .kcontrol_news = wcontrols, .num_kcontrols = 1}
118 114
119/* Simplified versions of above macros, assuming wncontrols = ARRAY_SIZE(wcontrols) */ 115/* Simplified versions of above macros, assuming wncontrols = ARRAY_SIZE(wcontrols) */
120#define SOC_PGA_ARRAY(wname, wreg, wshift, winvert,\ 116#define SOC_PGA_ARRAY(wname, wreg, wshift, winvert,\
@@ -172,10 +168,8 @@ struct device;
172 .event = wevent, .event_flags = wflags} 168 .event = wevent, .event_flags = wflags}
173#define SND_SOC_DAPM_VIRT_MUX_E(wname, wreg, wshift, winvert, wcontrols, \ 169#define SND_SOC_DAPM_VIRT_MUX_E(wname, wreg, wshift, winvert, wcontrols, \
174 wevent, wflags) \ 170 wevent, wflags) \
175{ .id = snd_soc_dapm_virt_mux, .name = wname, \ 171 SND_SOC_DAPM_MUX_E(wname, wreg, wshift, winvert, wcontrols, wevent, \
176 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ 172 wflags)
177 .kcontrol_news = wcontrols, .num_kcontrols = 1, \
178 .event = wevent, .event_flags = wflags}
179 173
180/* additional sequencing control within an event type */ 174/* additional sequencing control within an event type */
181#define SND_SOC_DAPM_PGA_S(wname, wsubseq, wreg, wshift, winvert, \ 175#define SND_SOC_DAPM_PGA_S(wname, wsubseq, wreg, wshift, winvert, \
@@ -311,12 +305,8 @@ struct device;
311 .get = snd_soc_dapm_get_enum_double, \ 305 .get = snd_soc_dapm_get_enum_double, \
312 .put = snd_soc_dapm_put_enum_double, \ 306 .put = snd_soc_dapm_put_enum_double, \
313 .private_value = (unsigned long)&xenum } 307 .private_value = (unsigned long)&xenum }
314#define SOC_DAPM_ENUM_VIRT(xname, xenum) \ 308#define SOC_DAPM_ENUM_VIRT(xname, xenum) \
315{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ 309 SOC_DAPM_ENUM(xname, xenum)
316 .info = snd_soc_info_enum_double, \
317 .get = snd_soc_dapm_get_enum_virt, \
318 .put = snd_soc_dapm_put_enum_virt, \
319 .private_value = (unsigned long)&xenum }
320#define SOC_DAPM_ENUM_EXT(xname, xenum, xget, xput) \ 310#define SOC_DAPM_ENUM_EXT(xname, xenum, xget, xput) \
321{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ 311{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
322 .info = snd_soc_info_enum_double, \ 312 .info = snd_soc_info_enum_double, \
@@ -324,11 +314,7 @@ struct device;
324 .put = xput, \ 314 .put = xput, \
325 .private_value = (unsigned long)&xenum } 315 .private_value = (unsigned long)&xenum }
326#define SOC_DAPM_VALUE_ENUM(xname, xenum) \ 316#define SOC_DAPM_VALUE_ENUM(xname, xenum) \
327{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ 317 SOC_DAPM_ENUM(xname, xenum)
328 .info = snd_soc_info_enum_double, \
329 .get = snd_soc_dapm_get_value_enum_double, \
330 .put = snd_soc_dapm_put_value_enum_double, \
331 .private_value = (unsigned long)&xenum }
332#define SOC_DAPM_PIN_SWITCH(xname) \ 318#define SOC_DAPM_PIN_SWITCH(xname) \
333{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname " Switch", \ 319{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname " Switch", \
334 .info = snd_soc_dapm_info_pin_switch, \ 320 .info = snd_soc_dapm_info_pin_switch, \
@@ -392,14 +378,6 @@ int snd_soc_dapm_get_enum_double(struct snd_kcontrol *kcontrol,
392 struct snd_ctl_elem_value *ucontrol); 378 struct snd_ctl_elem_value *ucontrol);
393int snd_soc_dapm_put_enum_double(struct snd_kcontrol *kcontrol, 379int snd_soc_dapm_put_enum_double(struct snd_kcontrol *kcontrol,
394 struct snd_ctl_elem_value *ucontrol); 380 struct snd_ctl_elem_value *ucontrol);
395int snd_soc_dapm_get_enum_virt(struct snd_kcontrol *kcontrol,
396 struct snd_ctl_elem_value *ucontrol);
397int snd_soc_dapm_put_enum_virt(struct snd_kcontrol *kcontrol,
398 struct snd_ctl_elem_value *ucontrol);
399int snd_soc_dapm_get_value_enum_double(struct snd_kcontrol *kcontrol,
400 struct snd_ctl_elem_value *ucontrol);
401int snd_soc_dapm_put_value_enum_double(struct snd_kcontrol *kcontrol,
402 struct snd_ctl_elem_value *ucontrol);
403int snd_soc_dapm_info_pin_switch(struct snd_kcontrol *kcontrol, 381int snd_soc_dapm_info_pin_switch(struct snd_kcontrol *kcontrol,
404 struct snd_ctl_elem_info *uinfo); 382 struct snd_ctl_elem_info *uinfo);
405int snd_soc_dapm_get_pin_switch(struct snd_kcontrol *kcontrol, 383int snd_soc_dapm_get_pin_switch(struct snd_kcontrol *kcontrol,
@@ -461,6 +439,7 @@ int snd_soc_dapm_nc_pin_unlocked(struct snd_soc_dapm_context *dapm,
461int snd_soc_dapm_get_pin_status(struct snd_soc_dapm_context *dapm, 439int snd_soc_dapm_get_pin_status(struct snd_soc_dapm_context *dapm,
462 const char *pin); 440 const char *pin);
463int snd_soc_dapm_sync(struct snd_soc_dapm_context *dapm); 441int snd_soc_dapm_sync(struct snd_soc_dapm_context *dapm);
442int snd_soc_dapm_sync_unlocked(struct snd_soc_dapm_context *dapm);
464int snd_soc_dapm_force_enable_pin(struct snd_soc_dapm_context *dapm, 443int snd_soc_dapm_force_enable_pin(struct snd_soc_dapm_context *dapm,
465 const char *pin); 444 const char *pin);
466int snd_soc_dapm_force_enable_pin_unlocked(struct snd_soc_dapm_context *dapm, 445int snd_soc_dapm_force_enable_pin_unlocked(struct snd_soc_dapm_context *dapm,
@@ -470,7 +449,6 @@ int snd_soc_dapm_ignore_suspend(struct snd_soc_dapm_context *dapm,
470void snd_soc_dapm_auto_nc_codec_pins(struct snd_soc_codec *codec); 449void snd_soc_dapm_auto_nc_codec_pins(struct snd_soc_codec *codec);
471 450
472/* Mostly internal - should not normally be used */ 451/* Mostly internal - should not normally be used */
473void dapm_mark_dirty(struct snd_soc_dapm_widget *w, const char *reason);
474void dapm_mark_io_dirty(struct snd_soc_dapm_context *dapm); 452void dapm_mark_io_dirty(struct snd_soc_dapm_context *dapm);
475 453
476/* dapm path query */ 454/* dapm path query */
@@ -484,8 +462,6 @@ enum snd_soc_dapm_type {
484 snd_soc_dapm_input = 0, /* input pin */ 462 snd_soc_dapm_input = 0, /* input pin */
485 snd_soc_dapm_output, /* output pin */ 463 snd_soc_dapm_output, /* output pin */
486 snd_soc_dapm_mux, /* selects 1 analog signal from many inputs */ 464 snd_soc_dapm_mux, /* selects 1 analog signal from many inputs */
487 snd_soc_dapm_virt_mux, /* virtual version of snd_soc_dapm_mux */
488 snd_soc_dapm_value_mux, /* selects 1 analog signal from many inputs */
489 snd_soc_dapm_mixer, /* mixes several analog signals together */ 465 snd_soc_dapm_mixer, /* mixes several analog signals together */
490 snd_soc_dapm_mixer_named_ctl, /* mixer with named controls */ 466 snd_soc_dapm_mixer_named_ctl, /* mixer with named controls */
491 snd_soc_dapm_pga, /* programmable gain/attenuation (volume) */ 467 snd_soc_dapm_pga, /* programmable gain/attenuation (volume) */
diff --git a/include/sound/soc.h b/include/sound/soc.h
index 9a001472b96a..959f38949967 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -45,6 +45,11 @@
45 ((unsigned long)&(struct soc_mixer_control) \ 45 ((unsigned long)&(struct soc_mixer_control) \
46 {.reg = xlreg, .rreg = xrreg, .shift = xshift, .rshift = xshift, \ 46 {.reg = xlreg, .rreg = xrreg, .shift = xshift, .rshift = xshift, \
47 .max = xmax, .platform_max = xmax, .invert = xinvert}) 47 .max = xmax, .platform_max = xmax, .invert = xinvert})
48#define SOC_DOUBLE_R_S_VALUE(xlreg, xrreg, xshift, xmin, xmax, xsign_bit, xinvert) \
49 ((unsigned long)&(struct soc_mixer_control) \
50 {.reg = xlreg, .rreg = xrreg, .shift = xshift, .rshift = xshift, \
51 .max = xmax, .min = xmin, .platform_max = xmax, .sign_bit = xsign_bit, \
52 .invert = xinvert})
48#define SOC_DOUBLE_R_RANGE_VALUE(xlreg, xrreg, xshift, xmin, xmax, xinvert) \ 53#define SOC_DOUBLE_R_RANGE_VALUE(xlreg, xrreg, xshift, xmin, xmax, xinvert) \
49 ((unsigned long)&(struct soc_mixer_control) \ 54 ((unsigned long)&(struct soc_mixer_control) \
50 {.reg = xlreg, .rreg = xrreg, .shift = xshift, .rshift = xshift, \ 55 {.reg = xlreg, .rreg = xrreg, .shift = xshift, .rshift = xshift, \
@@ -152,6 +157,15 @@
152 {.reg = xreg, .rreg = xrreg, \ 157 {.reg = xreg, .rreg = xrreg, \
153 .shift = xshift, .rshift = xshift, \ 158 .shift = xshift, .rshift = xshift, \
154 .max = xmax, .min = xmin} } 159 .max = xmax, .min = xmin} }
160#define SOC_DOUBLE_R_S_TLV(xname, reg_left, reg_right, xshift, xmin, xmax, xsign_bit, xinvert, tlv_array) \
161{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\
162 .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ |\
163 SNDRV_CTL_ELEM_ACCESS_READWRITE,\
164 .tlv.p = (tlv_array), \
165 .info = snd_soc_info_volsw, \
166 .get = snd_soc_get_volsw, .put = snd_soc_put_volsw, \
167 .private_value = SOC_DOUBLE_R_S_VALUE(reg_left, reg_right, xshift, \
168 xmin, xmax, xsign_bit, xinvert) }
155#define SOC_DOUBLE_S8_TLV(xname, xreg, xmin, xmax, tlv_array) \ 169#define SOC_DOUBLE_S8_TLV(xname, xreg, xmin, xmax, tlv_array) \
156{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \ 170{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \
157 .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ | \ 171 .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ | \
@@ -162,30 +176,28 @@
162 .private_value = (unsigned long)&(struct soc_mixer_control) \ 176 .private_value = (unsigned long)&(struct soc_mixer_control) \
163 {.reg = xreg, .min = xmin, .max = xmax, \ 177 {.reg = xreg, .min = xmin, .max = xmax, \
164 .platform_max = xmax} } 178 .platform_max = xmax} }
165#define SOC_ENUM_DOUBLE(xreg, xshift_l, xshift_r, xmax, xtexts) \ 179#define SOC_ENUM_DOUBLE(xreg, xshift_l, xshift_r, xitems, xtexts) \
166{ .reg = xreg, .shift_l = xshift_l, .shift_r = xshift_r, \ 180{ .reg = xreg, .shift_l = xshift_l, .shift_r = xshift_r, \
167 .max = xmax, .texts = xtexts, \ 181 .items = xitems, .texts = xtexts, \
168 .mask = xmax ? roundup_pow_of_two(xmax) - 1 : 0} 182 .mask = xitems ? roundup_pow_of_two(xitems) - 1 : 0}
169#define SOC_ENUM_SINGLE(xreg, xshift, xmax, xtexts) \ 183#define SOC_ENUM_SINGLE(xreg, xshift, xitems, xtexts) \
170 SOC_ENUM_DOUBLE(xreg, xshift, xshift, xmax, xtexts) 184 SOC_ENUM_DOUBLE(xreg, xshift, xshift, xitems, xtexts)
171#define SOC_ENUM_SINGLE_EXT(xmax, xtexts) \ 185#define SOC_ENUM_SINGLE_EXT(xitems, xtexts) \
172{ .max = xmax, .texts = xtexts } 186{ .items = xitems, .texts = xtexts }
173#define SOC_VALUE_ENUM_DOUBLE(xreg, xshift_l, xshift_r, xmask, xmax, xtexts, xvalues) \ 187#define SOC_VALUE_ENUM_DOUBLE(xreg, xshift_l, xshift_r, xmask, xitems, xtexts, xvalues) \
174{ .reg = xreg, .shift_l = xshift_l, .shift_r = xshift_r, \ 188{ .reg = xreg, .shift_l = xshift_l, .shift_r = xshift_r, \
175 .mask = xmask, .max = xmax, .texts = xtexts, .values = xvalues} 189 .mask = xmask, .items = xitems, .texts = xtexts, .values = xvalues}
176#define SOC_VALUE_ENUM_SINGLE(xreg, xshift, xmask, xmax, xtexts, xvalues) \ 190#define SOC_VALUE_ENUM_SINGLE(xreg, xshift, xmask, xnitmes, xtexts, xvalues) \
177 SOC_VALUE_ENUM_DOUBLE(xreg, xshift, xshift, xmask, xmax, xtexts, xvalues) 191 SOC_VALUE_ENUM_DOUBLE(xreg, xshift, xshift, xmask, xnitmes, xtexts, xvalues)
192#define SOC_ENUM_SINGLE_VIRT(xitems, xtexts) \
193 SOC_ENUM_SINGLE(SND_SOC_NOPM, 0, xitems, xtexts)
178#define SOC_ENUM(xname, xenum) \ 194#define SOC_ENUM(xname, xenum) \
179{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname,\ 195{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname,\
180 .info = snd_soc_info_enum_double, \ 196 .info = snd_soc_info_enum_double, \
181 .get = snd_soc_get_enum_double, .put = snd_soc_put_enum_double, \ 197 .get = snd_soc_get_enum_double, .put = snd_soc_put_enum_double, \
182 .private_value = (unsigned long)&xenum } 198 .private_value = (unsigned long)&xenum }
183#define SOC_VALUE_ENUM(xname, xenum) \ 199#define SOC_VALUE_ENUM(xname, xenum) \
184{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname,\ 200 SOC_ENUM(xname, xenum)
185 .info = snd_soc_info_enum_double, \
186 .get = snd_soc_get_value_enum_double, \
187 .put = snd_soc_put_value_enum_double, \
188 .private_value = (unsigned long)&xenum }
189#define SOC_SINGLE_EXT(xname, xreg, xshift, xmax, xinvert,\ 201#define SOC_SINGLE_EXT(xname, xreg, xshift, xmax, xinvert,\
190 xhandler_get, xhandler_put) \ 202 xhandler_get, xhandler_put) \
191{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ 203{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
@@ -272,17 +284,19 @@
272 * ARRAY_SIZE internally 284 * ARRAY_SIZE internally
273 */ 285 */
274#define SOC_ENUM_DOUBLE_DECL(name, xreg, xshift_l, xshift_r, xtexts) \ 286#define SOC_ENUM_DOUBLE_DECL(name, xreg, xshift_l, xshift_r, xtexts) \
275 struct soc_enum name = SOC_ENUM_DOUBLE(xreg, xshift_l, xshift_r, \ 287 const struct soc_enum name = SOC_ENUM_DOUBLE(xreg, xshift_l, xshift_r, \
276 ARRAY_SIZE(xtexts), xtexts) 288 ARRAY_SIZE(xtexts), xtexts)
277#define SOC_ENUM_SINGLE_DECL(name, xreg, xshift, xtexts) \ 289#define SOC_ENUM_SINGLE_DECL(name, xreg, xshift, xtexts) \
278 SOC_ENUM_DOUBLE_DECL(name, xreg, xshift, xshift, xtexts) 290 SOC_ENUM_DOUBLE_DECL(name, xreg, xshift, xshift, xtexts)
279#define SOC_ENUM_SINGLE_EXT_DECL(name, xtexts) \ 291#define SOC_ENUM_SINGLE_EXT_DECL(name, xtexts) \
280 struct soc_enum name = SOC_ENUM_SINGLE_EXT(ARRAY_SIZE(xtexts), xtexts) 292 const struct soc_enum name = SOC_ENUM_SINGLE_EXT(ARRAY_SIZE(xtexts), xtexts)
281#define SOC_VALUE_ENUM_DOUBLE_DECL(name, xreg, xshift_l, xshift_r, xmask, xtexts, xvalues) \ 293#define SOC_VALUE_ENUM_DOUBLE_DECL(name, xreg, xshift_l, xshift_r, xmask, xtexts, xvalues) \
282 struct soc_enum name = SOC_VALUE_ENUM_DOUBLE(xreg, xshift_l, xshift_r, xmask, \ 294 const struct soc_enum name = SOC_VALUE_ENUM_DOUBLE(xreg, xshift_l, xshift_r, xmask, \
283 ARRAY_SIZE(xtexts), xtexts, xvalues) 295 ARRAY_SIZE(xtexts), xtexts, xvalues)
284#define SOC_VALUE_ENUM_SINGLE_DECL(name, xreg, xshift, xmask, xtexts, xvalues) \ 296#define SOC_VALUE_ENUM_SINGLE_DECL(name, xreg, xshift, xmask, xtexts, xvalues) \
285 SOC_VALUE_ENUM_DOUBLE_DECL(name, xreg, xshift, xshift, xmask, xtexts, xvalues) 297 SOC_VALUE_ENUM_DOUBLE_DECL(name, xreg, xshift, xshift, xmask, xtexts, xvalues)
298#define SOC_ENUM_SINGLE_VIRT_DECL(name, xtexts) \
299 const struct soc_enum name = SOC_ENUM_SINGLE_VIRT(ARRAY_SIZE(xtexts), xtexts)
286 300
287/* 301/*
288 * Component probe and remove ordering levels for components with runtime 302 * Component probe and remove ordering levels for components with runtime
@@ -413,6 +427,10 @@ struct snd_pcm_substream *snd_soc_get_dai_substream(struct snd_soc_card *card,
413struct snd_soc_pcm_runtime *snd_soc_get_pcm_runtime(struct snd_soc_card *card, 427struct snd_soc_pcm_runtime *snd_soc_get_pcm_runtime(struct snd_soc_card *card,
414 const char *dai_link); 428 const char *dai_link);
415 429
430bool snd_soc_runtime_ignore_pmdown_time(struct snd_soc_pcm_runtime *rtd);
431void snd_soc_runtime_activate(struct snd_soc_pcm_runtime *rtd, int stream);
432void snd_soc_runtime_deactivate(struct snd_soc_pcm_runtime *rtd, int stream);
433
416/* Utility functions to get clock rates from various things */ 434/* Utility functions to get clock rates from various things */
417int snd_soc_calc_frame_size(int sample_size, int channels, int tdm_slots); 435int snd_soc_calc_frame_size(int sample_size, int channels, int tdm_slots);
418int snd_soc_params_to_frame_size(struct snd_pcm_hw_params *params); 436int snd_soc_params_to_frame_size(struct snd_pcm_hw_params *params);
@@ -496,10 +514,6 @@ int snd_soc_get_enum_double(struct snd_kcontrol *kcontrol,
496 struct snd_ctl_elem_value *ucontrol); 514 struct snd_ctl_elem_value *ucontrol);
497int snd_soc_put_enum_double(struct snd_kcontrol *kcontrol, 515int snd_soc_put_enum_double(struct snd_kcontrol *kcontrol,
498 struct snd_ctl_elem_value *ucontrol); 516 struct snd_ctl_elem_value *ucontrol);
499int snd_soc_get_value_enum_double(struct snd_kcontrol *kcontrol,
500 struct snd_ctl_elem_value *ucontrol);
501int snd_soc_put_value_enum_double(struct snd_kcontrol *kcontrol,
502 struct snd_ctl_elem_value *ucontrol);
503int snd_soc_info_volsw(struct snd_kcontrol *kcontrol, 517int snd_soc_info_volsw(struct snd_kcontrol *kcontrol,
504 struct snd_ctl_elem_info *uinfo); 518 struct snd_ctl_elem_info *uinfo);
505#define snd_soc_info_bool_ext snd_ctl_boolean_mono_info 519#define snd_soc_info_bool_ext snd_ctl_boolean_mono_info
@@ -656,12 +670,19 @@ struct snd_soc_component {
656 const char *name; 670 const char *name;
657 int id; 671 int id;
658 struct device *dev; 672 struct device *dev;
673
674 unsigned int active;
675
676 unsigned int ignore_pmdown_time:1; /* pmdown_time is ignored at stop */
677
659 struct list_head list; 678 struct list_head list;
660 679
661 struct snd_soc_dai_driver *dai_drv; 680 struct snd_soc_dai_driver *dai_drv;
662 int num_dai; 681 int num_dai;
663 682
664 const struct snd_soc_component_driver *driver; 683 const struct snd_soc_component_driver *driver;
684
685 struct list_head dai_list;
665}; 686};
666 687
667/* SoC Audio Codec device */ 688/* SoC Audio Codec device */
@@ -683,7 +704,6 @@ struct snd_soc_codec {
683 704
684 /* runtime */ 705 /* runtime */
685 struct snd_ac97 *ac97; /* for ad-hoc ac97 devices */ 706 struct snd_ac97 *ac97; /* for ad-hoc ac97 devices */
686 unsigned int active;
687 unsigned int cache_bypass:1; /* Suppress access to the cache */ 707 unsigned int cache_bypass:1; /* Suppress access to the cache */
688 unsigned int suspended:1; /* Codec is in suspend PM state */ 708 unsigned int suspended:1; /* Codec is in suspend PM state */
689 unsigned int probed:1; /* Codec has been probed */ 709 unsigned int probed:1; /* Codec has been probed */
@@ -709,7 +729,6 @@ struct snd_soc_codec {
709 729
710 /* dapm */ 730 /* dapm */
711 struct snd_soc_dapm_context dapm; 731 struct snd_soc_dapm_context dapm;
712 unsigned int ignore_pmdown_time:1; /* pmdown_time is ignored at stop */
713 732
714#ifdef CONFIG_DEBUG_FS 733#ifdef CONFIG_DEBUG_FS
715 struct dentry *debugfs_codec_root; 734 struct dentry *debugfs_codec_root;
@@ -1067,6 +1086,7 @@ struct soc_mixer_control {
1067 int min, max, platform_max; 1086 int min, max, platform_max;
1068 int reg, rreg; 1087 int reg, rreg;
1069 unsigned int shift, rshift; 1088 unsigned int shift, rshift;
1089 unsigned int sign_bit;
1070 unsigned int invert:1; 1090 unsigned int invert:1;
1071 unsigned int autodisable:1; 1091 unsigned int autodisable:1;
1072}; 1092};
@@ -1085,11 +1105,10 @@ struct soc_mreg_control {
1085 1105
1086/* enumerated kcontrol */ 1106/* enumerated kcontrol */
1087struct soc_enum { 1107struct soc_enum {
1088 unsigned short reg; 1108 int reg;
1089 unsigned short reg2;
1090 unsigned char shift_l; 1109 unsigned char shift_l;
1091 unsigned char shift_r; 1110 unsigned char shift_r;
1092 unsigned int max; 1111 unsigned int items;
1093 unsigned int mask; 1112 unsigned int mask;
1094 const char * const *texts; 1113 const char * const *texts;
1095 const unsigned int *values; 1114 const unsigned int *values;
@@ -1168,11 +1187,51 @@ static inline bool snd_soc_volsw_is_stereo(struct soc_mixer_control *mc)
1168 return 1; 1187 return 1;
1169} 1188}
1170 1189
1190static inline unsigned int snd_soc_enum_val_to_item(struct soc_enum *e,
1191 unsigned int val)
1192{
1193 unsigned int i;
1194
1195 if (!e->values)
1196 return val;
1197
1198 for (i = 0; i < e->items; i++)
1199 if (val == e->values[i])
1200 return i;
1201
1202 return 0;
1203}
1204
1205static inline unsigned int snd_soc_enum_item_to_val(struct soc_enum *e,
1206 unsigned int item)
1207{
1208 if (!e->values)
1209 return item;
1210
1211 return e->values[item];
1212}
1213
1214static inline bool snd_soc_component_is_active(
1215 struct snd_soc_component *component)
1216{
1217 return component->active != 0;
1218}
1219
1220static inline bool snd_soc_codec_is_active(struct snd_soc_codec *codec)
1221{
1222 return snd_soc_component_is_active(&codec->component);
1223}
1224
1171int snd_soc_util_init(void); 1225int snd_soc_util_init(void);
1172void snd_soc_util_exit(void); 1226void snd_soc_util_exit(void);
1173 1227
1174int snd_soc_of_parse_card_name(struct snd_soc_card *card, 1228int snd_soc_of_parse_card_name(struct snd_soc_card *card,
1175 const char *propname); 1229 const char *propname);
1230int snd_soc_of_parse_audio_simple_widgets(struct snd_soc_card *card,
1231 const char *propname);
1232int snd_soc_of_parse_tdm_slot(struct device_node *np,
1233 unsigned int *slots,
1234 unsigned int *slot_width);
1176int snd_soc_of_parse_audio_routing(struct snd_soc_card *card, 1235int snd_soc_of_parse_audio_routing(struct snd_soc_card *card,
1177 const char *propname); 1236 const char *propname);
1178unsigned int snd_soc_of_parse_daifmt(struct device_node *np, 1237unsigned int snd_soc_of_parse_daifmt(struct device_node *np,
@@ -1188,4 +1247,15 @@ extern struct dentry *snd_soc_debugfs_root;
1188 1247
1189extern const struct dev_pm_ops snd_soc_pm_ops; 1248extern const struct dev_pm_ops snd_soc_pm_ops;
1190 1249
1250/* Helper functions */
1251static inline void snd_soc_dapm_mutex_lock(struct snd_soc_dapm_context *dapm)
1252{
1253 mutex_lock(&dapm->card->dapm_mutex);
1254}
1255
1256static inline void snd_soc_dapm_mutex_unlock(struct snd_soc_dapm_context *dapm)
1257{
1258 mutex_unlock(&dapm->card->dapm_mutex);
1259}
1260
1191#endif 1261#endif
diff --git a/include/trace/events/hswadsp.h b/include/trace/events/hswadsp.h
new file mode 100644
index 000000000000..0f78bbb02002
--- /dev/null
+++ b/include/trace/events/hswadsp.h
@@ -0,0 +1,384 @@
1#undef TRACE_SYSTEM
2#define TRACE_SYSTEM hswadsp
3
4#if !defined(_TRACE_HSWADSP_H) || defined(TRACE_HEADER_MULTI_READ)
5#define _TRACE_HSWADSP_H
6
7#include <linux/types.h>
8#include <linux/ktime.h>
9#include <linux/tracepoint.h>
10
11struct sst_hsw;
12struct sst_hsw_stream;
13struct sst_hsw_ipc_stream_free_req;
14struct sst_hsw_ipc_volume_req;
15struct sst_hsw_ipc_stream_alloc_req;
16struct sst_hsw_audio_data_format_ipc;
17struct sst_hsw_ipc_stream_info_reply;
18struct sst_hsw_ipc_device_config_req;
19
20DECLARE_EVENT_CLASS(sst_irq,
21
22 TP_PROTO(uint32_t status, uint32_t mask),
23
24 TP_ARGS(status, mask),
25
26 TP_STRUCT__entry(
27 __field( unsigned int, status )
28 __field( unsigned int, mask )
29 ),
30
31 TP_fast_assign(
32 __entry->status = status;
33 __entry->mask = mask;
34 ),
35
36 TP_printk("status 0x%8.8x mask 0x%8.8x",
37 (unsigned int)__entry->status, (unsigned int)__entry->mask)
38);
39
40DEFINE_EVENT(sst_irq, sst_irq_busy,
41
42 TP_PROTO(unsigned int status, unsigned int mask),
43
44 TP_ARGS(status, mask)
45
46);
47
48DEFINE_EVENT(sst_irq, sst_irq_done,
49
50 TP_PROTO(unsigned int status, unsigned int mask),
51
52 TP_ARGS(status, mask)
53
54);
55
56DECLARE_EVENT_CLASS(ipc,
57
58 TP_PROTO(const char *name, int val),
59
60 TP_ARGS(name, val),
61
62 TP_STRUCT__entry(
63 __string( name, name )
64 __field( unsigned int, val )
65 ),
66
67 TP_fast_assign(
68 __assign_str(name, name);
69 __entry->val = val;
70 ),
71
72 TP_printk("%s 0x%8.8x", __get_str(name), (unsigned int)__entry->val)
73
74);
75
76DEFINE_EVENT(ipc, ipc_request,
77
78 TP_PROTO(const char *name, int val),
79
80 TP_ARGS(name, val)
81
82);
83
84DEFINE_EVENT(ipc, ipc_reply,
85
86 TP_PROTO(const char *name, int val),
87
88 TP_ARGS(name, val)
89
90);
91
92DEFINE_EVENT(ipc, ipc_pending_reply,
93
94 TP_PROTO(const char *name, int val),
95
96 TP_ARGS(name, val)
97
98);
99
100DEFINE_EVENT(ipc, ipc_notification,
101
102 TP_PROTO(const char *name, int val),
103
104 TP_ARGS(name, val)
105
106);
107
108DEFINE_EVENT(ipc, ipc_error,
109
110 TP_PROTO(const char *name, int val),
111
112 TP_ARGS(name, val)
113
114);
115
116DECLARE_EVENT_CLASS(stream_position,
117
118 TP_PROTO(unsigned int id, unsigned int pos),
119
120 TP_ARGS(id, pos),
121
122 TP_STRUCT__entry(
123 __field( unsigned int, id )
124 __field( unsigned int, pos )
125 ),
126
127 TP_fast_assign(
128 __entry->id = id;
129 __entry->pos = pos;
130 ),
131
132 TP_printk("id %d position 0x%x",
133 (unsigned int)__entry->id, (unsigned int)__entry->pos)
134);
135
136DEFINE_EVENT(stream_position, stream_read_position,
137
138 TP_PROTO(unsigned int id, unsigned int pos),
139
140 TP_ARGS(id, pos)
141
142);
143
144DEFINE_EVENT(stream_position, stream_write_position,
145
146 TP_PROTO(unsigned int id, unsigned int pos),
147
148 TP_ARGS(id, pos)
149
150);
151
152TRACE_EVENT(hsw_stream_buffer,
153
154 TP_PROTO(struct sst_hsw_stream *stream),
155
156 TP_ARGS(stream),
157
158 TP_STRUCT__entry(
159 __field( int, id )
160 __field( int, pt_addr )
161 __field( int, num_pages )
162 __field( int, ring_size )
163 __field( int, ring_offset )
164 __field( int, first_pfn )
165 ),
166
167 TP_fast_assign(
168 __entry->id = stream->host_id;
169 __entry->pt_addr = stream->request.ringinfo.ring_pt_address;
170 __entry->num_pages = stream->request.ringinfo.num_pages;
171 __entry->ring_size = stream->request.ringinfo.ring_size;
172 __entry->ring_offset = stream->request.ringinfo.ring_offset;
173 __entry->first_pfn = stream->request.ringinfo.ring_first_pfn;
174 ),
175
176 TP_printk("stream %d ring addr 0x%x pages %d size 0x%x offset 0x%x PFN 0x%x",
177 (int) __entry->id, (int)__entry->pt_addr,
178 (int)__entry->num_pages, (int)__entry->ring_size,
179 (int)__entry->ring_offset, (int)__entry->first_pfn)
180);
181
182TRACE_EVENT(hsw_stream_alloc_reply,
183
184 TP_PROTO(struct sst_hsw_stream *stream),
185
186 TP_ARGS(stream),
187
188 TP_STRUCT__entry(
189 __field( int, id )
190 __field( int, stream_id )
191 __field( int, mixer_id )
192 __field( int, peak0 )
193 __field( int, peak1 )
194 __field( int, vol0 )
195 __field( int, vol1 )
196 ),
197
198 TP_fast_assign(
199 __entry->id = stream->host_id;
200 __entry->stream_id = stream->reply.stream_hw_id;
201 __entry->mixer_id = stream->reply.mixer_hw_id;
202 __entry->peak0 = stream->reply.peak_meter_register_address[0];
203 __entry->peak1 = stream->reply.peak_meter_register_address[1];
204 __entry->vol0 = stream->reply.volume_register_address[0];
205 __entry->vol1 = stream->reply.volume_register_address[1];
206 ),
207
208 TP_printk("stream %d hw id %d mixer %d peak 0x%x:0x%x vol 0x%x,0x%x",
209 (int) __entry->id, (int) __entry->stream_id, (int)__entry->mixer_id,
210 (int)__entry->peak0, (int)__entry->peak1,
211 (int)__entry->vol0, (int)__entry->vol1)
212);
213
214TRACE_EVENT(hsw_mixer_info_reply,
215
216 TP_PROTO(struct sst_hsw_ipc_stream_info_reply *reply),
217
218 TP_ARGS(reply),
219
220 TP_STRUCT__entry(
221 __field( int, mixer_id )
222 __field( int, peak0 )
223 __field( int, peak1 )
224 __field( int, vol0 )
225 __field( int, vol1 )
226 ),
227
228 TP_fast_assign(
229 __entry->mixer_id = reply->mixer_hw_id;
230 __entry->peak0 = reply->peak_meter_register_address[0];
231 __entry->peak1 = reply->peak_meter_register_address[1];
232 __entry->vol0 = reply->volume_register_address[0];
233 __entry->vol1 = reply->volume_register_address[1];
234 ),
235
236 TP_printk("mixer id %d peak 0x%x:0x%x vol 0x%x,0x%x",
237 (int)__entry->mixer_id,
238 (int)__entry->peak0, (int)__entry->peak1,
239 (int)__entry->vol0, (int)__entry->vol1)
240);
241
242TRACE_EVENT(hsw_stream_data_format,
243
244 TP_PROTO(struct sst_hsw_stream *stream,
245 struct sst_hsw_audio_data_format_ipc *req),
246
247 TP_ARGS(stream, req),
248
249 TP_STRUCT__entry(
250 __field( uint32_t, id )
251 __field( uint32_t, frequency )
252 __field( uint32_t, bitdepth )
253 __field( uint32_t, map )
254 __field( uint32_t, config )
255 __field( uint32_t, style )
256 __field( uint8_t, ch_num )
257 __field( uint8_t, valid_bit )
258 ),
259
260 TP_fast_assign(
261 __entry->id = stream->host_id;
262 __entry->frequency = req->frequency;
263 __entry->bitdepth = req->bitdepth;
264 __entry->map = req->map;
265 __entry->config = req->config;
266 __entry->style = req->style;
267 __entry->ch_num = req->ch_num;
268 __entry->valid_bit = req->valid_bit;
269 ),
270
271 TP_printk("stream %d freq %d depth %d map 0x%x config 0x%x style 0x%x ch %d bits %d",
272 (int) __entry->id, (uint32_t)__entry->frequency,
273 (uint32_t)__entry->bitdepth, (uint32_t)__entry->map,
274 (uint32_t)__entry->config, (uint32_t)__entry->style,
275 (uint8_t)__entry->ch_num, (uint8_t)__entry->valid_bit)
276);
277
278TRACE_EVENT(hsw_stream_alloc_request,
279
280 TP_PROTO(struct sst_hsw_stream *stream,
281 struct sst_hsw_ipc_stream_alloc_req *req),
282
283 TP_ARGS(stream, req),
284
285 TP_STRUCT__entry(
286 __field( uint32_t, id )
287 __field( uint8_t, path_id )
288 __field( uint8_t, stream_type )
289 __field( uint8_t, format_id )
290 ),
291
292 TP_fast_assign(
293 __entry->id = stream->host_id;
294 __entry->path_id = req->path_id;
295 __entry->stream_type = req->stream_type;
296 __entry->format_id = req->format_id;
297 ),
298
299 TP_printk("stream %d path %d type %d format %d",
300 (int) __entry->id, (uint8_t)__entry->path_id,
301 (uint8_t)__entry->stream_type, (uint8_t)__entry->format_id)
302);
303
304TRACE_EVENT(hsw_stream_free_req,
305
306 TP_PROTO(struct sst_hsw_stream *stream,
307 struct sst_hsw_ipc_stream_free_req *req),
308
309 TP_ARGS(stream, req),
310
311 TP_STRUCT__entry(
312 __field( int, id )
313 __field( int, stream_id )
314 ),
315
316 TP_fast_assign(
317 __entry->id = stream->host_id;
318 __entry->stream_id = req->stream_id;
319 ),
320
321 TP_printk("stream %d hw id %d",
322 (int) __entry->id, (int) __entry->stream_id)
323);
324
325TRACE_EVENT(hsw_volume_req,
326
327 TP_PROTO(struct sst_hsw_stream *stream,
328 struct sst_hsw_ipc_volume_req *req),
329
330 TP_ARGS(stream, req),
331
332 TP_STRUCT__entry(
333 __field( int, id )
334 __field( uint32_t, channel )
335 __field( uint32_t, target_volume )
336 __field( uint64_t, curve_duration )
337 __field( uint32_t, curve_type )
338 ),
339
340 TP_fast_assign(
341 __entry->id = stream->host_id;
342 __entry->channel = req->channel;
343 __entry->target_volume = req->target_volume;
344 __entry->curve_duration = req->curve_duration;
345 __entry->curve_type = req->curve_type;
346 ),
347
348 TP_printk("stream %d chan 0x%x vol %d duration %llu type %d",
349 (int) __entry->id, (uint32_t) __entry->channel,
350 (uint32_t)__entry->target_volume,
351 (uint64_t)__entry->curve_duration,
352 (uint32_t)__entry->curve_type)
353);
354
355TRACE_EVENT(hsw_device_config_req,
356
357 TP_PROTO(struct sst_hsw_ipc_device_config_req *req),
358
359 TP_ARGS(req),
360
361 TP_STRUCT__entry(
362 __field( uint32_t, ssp )
363 __field( uint32_t, clock_freq )
364 __field( uint32_t, mode )
365 __field( uint16_t, clock_divider )
366 ),
367
368 TP_fast_assign(
369 __entry->ssp = req->ssp_interface;
370 __entry->clock_freq = req->clock_frequency;
371 __entry->mode = req->mode;
372 __entry->clock_divider = req->clock_divider;
373 ),
374
375 TP_printk("SSP %d Freq %d mode %d div %d",
376 (uint32_t)__entry->ssp,
377 (uint32_t)__entry->clock_freq, (uint32_t)__entry->mode,
378 (uint32_t)__entry->clock_divider)
379);
380
381#endif /* _TRACE_HSWADSP_H */
382
383/* This part must be outside protection */
384#include <trace/define_trace.h>
diff --git a/include/trace/events/intel-sst.h b/include/trace/events/intel-sst.h
new file mode 100644
index 000000000000..76c72d3f1902
--- /dev/null
+++ b/include/trace/events/intel-sst.h
@@ -0,0 +1,148 @@
1#undef TRACE_SYSTEM
2#define TRACE_SYSTEM intel-sst
3
4#if !defined(_TRACE_INTEL_SST_H) || defined(TRACE_HEADER_MULTI_READ)
5#define _TRACE_INTEL_SST_H
6
7#include <linux/types.h>
8#include <linux/ktime.h>
9#include <linux/tracepoint.h>
10
11DECLARE_EVENT_CLASS(sst_ipc_msg,
12
13 TP_PROTO(unsigned int val),
14
15 TP_ARGS(val),
16
17 TP_STRUCT__entry(
18 __field( unsigned int, val )
19 ),
20
21 TP_fast_assign(
22 __entry->val = val;
23 ),
24
25 TP_printk("0x%8.8x", (unsigned int)__entry->val)
26);
27
28DEFINE_EVENT(sst_ipc_msg, sst_ipc_msg_tx,
29
30 TP_PROTO(unsigned int val),
31
32 TP_ARGS(val)
33
34);
35
36DEFINE_EVENT(sst_ipc_msg, sst_ipc_msg_rx,
37
38 TP_PROTO(unsigned int val),
39
40 TP_ARGS(val)
41
42);
43
44DECLARE_EVENT_CLASS(sst_ipc_mailbox,
45
46 TP_PROTO(unsigned int offset, unsigned int val),
47
48 TP_ARGS(offset, val),
49
50 TP_STRUCT__entry(
51 __field( unsigned int, offset )
52 __field( unsigned int, val )
53 ),
54
55 TP_fast_assign(
56 __entry->offset = offset;
57 __entry->val = val;
58 ),
59
60 TP_printk(" 0x%4.4x = 0x%8.8x",
61 (unsigned int)__entry->offset, (unsigned int)__entry->val)
62);
63
64DEFINE_EVENT(sst_ipc_mailbox, sst_ipc_inbox_rdata,
65
66 TP_PROTO(unsigned int offset, unsigned int val),
67
68 TP_ARGS(offset, val)
69
70);
71
72DEFINE_EVENT(sst_ipc_mailbox, sst_ipc_inbox_wdata,
73
74 TP_PROTO(unsigned int offset, unsigned int val),
75
76 TP_ARGS(offset, val)
77
78);
79
80DEFINE_EVENT(sst_ipc_mailbox, sst_ipc_outbox_rdata,
81
82 TP_PROTO(unsigned int offset, unsigned int val),
83
84 TP_ARGS(offset, val)
85
86);
87
88DEFINE_EVENT(sst_ipc_mailbox, sst_ipc_outbox_wdata,
89
90 TP_PROTO(unsigned int offset, unsigned int val),
91
92 TP_ARGS(offset, val)
93
94);
95
96DECLARE_EVENT_CLASS(sst_ipc_mailbox_info,
97
98 TP_PROTO(unsigned int size),
99
100 TP_ARGS(size),
101
102 TP_STRUCT__entry(
103 __field( unsigned int, size )
104 ),
105
106 TP_fast_assign(
107 __entry->size = size;
108 ),
109
110 TP_printk("Mailbox bytes 0x%8.8x", (unsigned int)__entry->size)
111);
112
113DEFINE_EVENT(sst_ipc_mailbox_info, sst_ipc_inbox_read,
114
115 TP_PROTO(unsigned int size),
116
117 TP_ARGS(size)
118
119);
120
121DEFINE_EVENT(sst_ipc_mailbox_info, sst_ipc_inbox_write,
122
123 TP_PROTO(unsigned int size),
124
125 TP_ARGS(size)
126
127);
128
129DEFINE_EVENT(sst_ipc_mailbox_info, sst_ipc_outbox_read,
130
131 TP_PROTO(unsigned int size),
132
133 TP_ARGS(size)
134
135);
136
137DEFINE_EVENT(sst_ipc_mailbox_info, sst_ipc_outbox_write,
138
139 TP_PROTO(unsigned int size),
140
141 TP_ARGS(size)
142
143);
144
145#endif /* _TRACE_SST_H */
146
147/* This part must be outside protection */
148#include <trace/define_trace.h>