From 4968107786e75f5aaba3c1c8e959ccbae929457f Mon Sep 17 00:00:00 2001 From: Vinod Koul Date: Thu, 16 Aug 2012 17:10:40 +0530 Subject: ASoC: add definations for compressed operations Here we update the asoc structures to add compress stream definations First the struct snd_soc_dai_driver adds a new member to indicate if the dai is compressed or pcm. Next we add a new structre the struct snd_soc_compr_ops in the struct snd_soc_dai_link. This is to be used for machine driver to perform any opertaions required for setting up compressed audio streams next is the compressed data operations, they are added using struct snd_compr_ops in the struct snd_soc_platform_driver. Signed-off-by: Namarta Kohli Signed-off-by: Ramesh Babu K V Signed-off-by: Vinod Koul Signed-off-by: Mark Brown --- include/sound/compress_driver.h | 1 + include/sound/soc-dai.h | 3 +++ include/sound/soc.h | 16 +++++++++++++++- 3 files changed, 19 insertions(+), 1 deletion(-) (limited to 'include/sound') diff --git a/include/sound/compress_driver.h b/include/sound/compress_driver.h index 48f2a1f..f2912ab 100644 --- a/include/sound/compress_driver.h +++ b/include/sound/compress_driver.h @@ -61,6 +61,7 @@ struct snd_compr_runtime { u64 total_bytes_available; u64 total_bytes_transferred; wait_queue_head_t sleep; + void *private_data; }; /** diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h index 1f69e0a..628db7b 100644 --- a/include/sound/soc-dai.h +++ b/include/sound/soc-dai.h @@ -18,6 +18,7 @@ struct snd_pcm_substream; struct snd_soc_dapm_widget; +struct snd_compr_stream; /* * DAI hardware audio formats. @@ -205,6 +206,8 @@ struct snd_soc_dai_driver { int (*remove)(struct snd_soc_dai *dai); int (*suspend)(struct snd_soc_dai *dai); int (*resume)(struct snd_soc_dai *dai); + /* compress dai */ + bool compress_dai; /* ops */ const struct snd_soc_dai_ops *ops; diff --git a/include/sound/soc.h b/include/sound/soc.h index e063380..313b766 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h @@ -22,6 +22,7 @@ #include #include #include +#include #include #include @@ -399,6 +400,7 @@ int snd_soc_platform_read(struct snd_soc_platform *platform, int snd_soc_platform_write(struct snd_soc_platform *platform, unsigned int reg, unsigned int val); int soc_new_pcm(struct snd_soc_pcm_runtime *rtd, int num); +int soc_new_compress(struct snd_soc_pcm_runtime *rtd, int num); struct snd_pcm_substream *snd_soc_get_dai_substream(struct snd_soc_card *card, const char *dai_link, int stream); @@ -632,6 +634,13 @@ struct snd_soc_ops { int (*trigger)(struct snd_pcm_substream *, int); }; +struct snd_soc_compr_ops { + int (*startup)(struct snd_compr_stream *); + void (*shutdown)(struct snd_compr_stream *); + int (*set_params)(struct snd_compr_stream *); + int (*trigger)(struct snd_compr_stream *); +}; + /* SoC cache ops */ struct snd_soc_cache_ops { const char *name; @@ -787,9 +796,12 @@ struct snd_soc_platform_driver { snd_pcm_sframes_t (*delay)(struct snd_pcm_substream *, struct snd_soc_dai *); - /* platform stream ops */ + /* platform stream pcm ops */ struct snd_pcm_ops *ops; + /* platform stream compress ops */ + struct snd_compr_ops *compr_ops; + /* platform stream completion event */ int (*stream_event)(struct snd_soc_dapm_context *dapm, int event); @@ -891,6 +903,7 @@ struct snd_soc_dai_link { /* machine stream operations */ struct snd_soc_ops *ops; + struct snd_soc_compr_ops *compr_ops; }; struct snd_soc_codec_conf { @@ -1027,6 +1040,7 @@ struct snd_soc_pcm_runtime { /* runtime devices */ struct snd_pcm *pcm; + struct snd_compr *compr; struct snd_soc_codec *codec; struct snd_soc_platform *platform; struct snd_soc_dai *codec_dai; -- cgit v1.1 From 02e79476998ba7e62842d20dca898c403ad55c7e Mon Sep 17 00:00:00 2001 From: Mark Brown Date: Tue, 21 Aug 2012 17:54:52 +0100 Subject: ASoC: wm_hubs: Allow configuration of MICBIAS power up delay via pdata Sometimes the analogue circuitry connected to the microphone needs some time to settle after power up. Allow systems to configure this delay in the platform data, the driver will then insert the required delay during power up of paths that involve the microphone. Signed-off-by: Mark Brown --- include/sound/wm8993.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include/sound') diff --git a/include/sound/wm8993.h b/include/sound/wm8993.h index eee19f6..8016fd8 100644 --- a/include/sound/wm8993.h +++ b/include/sound/wm8993.h @@ -32,6 +32,10 @@ struct wm8993_platform_data { unsigned int lineout1fb:1; unsigned int lineout2fb:1; + /* Delay to add for microphones to stabalise after power up */ + int micbias1_delay; + int micbias2_delay; + /* Microphone biases: 0=0.9*AVDD1 1=0.65*AVVD1 */ unsigned int micbias1_lvl:1; unsigned int micbias2_lvl:1; -- cgit v1.1 From e3523e01869da20fdd12ffd19ae1df7bf492650e Mon Sep 17 00:00:00 2001 From: Dimitris Papastamos Date: Thu, 23 Aug 2012 15:59:56 +0100 Subject: ASoC: wm0010: Add initial wm0010 DSP driver The WM0010 is a compact digital signal processor that has been highly optimised for low-power audio applications. Extensive memory resources and core optimisation allow the device to manage all audio processing algorithms efficiently and autonomously, while the host processor sleeps or performs other tasks. Signed-off-by: Dimitris Papastamos Signed-off-by: Mark Brown --- include/sound/wm0010.h | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 include/sound/wm0010.h (limited to 'include/sound') diff --git a/include/sound/wm0010.h b/include/sound/wm0010.h new file mode 100644 index 0000000..3261e90 --- /dev/null +++ b/include/sound/wm0010.h @@ -0,0 +1,27 @@ +/* + * wm0010.h -- Platform data for WM0010 DSP Driver + * + * Copyright 2012 Wolfson Microelectronics PLC. + * + * Author: Dimitris Papastamos + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + */ + +#ifndef WM0010_PDATA_H +#define WM0010_PDATA_H + +struct wm0010_pdata { + int gpio_reset; + + /* Set if there is an inverter between the GPIO controlling + * the reset signal and the device. + */ + int reset_active_high; + int irq_flags; +}; + +#endif -- cgit v1.1 From 03f67433758a3eeb37b9c1559886c377da874ad2 Mon Sep 17 00:00:00 2001 From: Stephen Warren Date: Wed, 5 Sep 2012 10:27:14 -0600 Subject: ASoC: tegra: move platform data header Move the Tegra+WM8903 ASoC platform data header out of arch/arm/mach-tegra, as a pre-requisite of single zImage. Signed-off-by: Stephen Warren Signed-off-by: Mark Brown --- include/sound/tegra_wm8903.h | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 include/sound/tegra_wm8903.h (limited to 'include/sound') diff --git a/include/sound/tegra_wm8903.h b/include/sound/tegra_wm8903.h new file mode 100644 index 0000000..57b202e --- /dev/null +++ b/include/sound/tegra_wm8903.h @@ -0,0 +1,26 @@ +/* + * Copyright 2011 NVIDIA, Inc. + * + * This software is licensed under the terms of the GNU General Public + * License version 2, as published by the Free Software Foundation, and + * may be copied, distributed, and modified under those terms. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ + +#ifndef __SOUND_TEGRA_WM38903_H +#define __SOUND_TEGRA_WM38903_H + +struct tegra_wm8903_platform_data { + int gpio_spkr_en; + int gpio_hp_det; + int gpio_hp_mute; + int gpio_int_mic_en; + int gpio_ext_mic_en; +}; + +#endif -- cgit v1.1 From 85da89f562579b001831b71d49946bfa0a93529d Mon Sep 17 00:00:00 2001 From: Lars-Peter Clausen Date: Mon, 3 Sep 2012 10:34:26 +0200 Subject: ASoC: Remove unused 'saved_value' field from snd_soc_dapm_widget struct The only user was removed over two years ago in commit a6c65736 ("ASoC: Remove current PGA control handling"). Signed-off-by: Lars-Peter Clausen Signed-off-by: Mark Brown --- include/sound/soc-dapm.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include/sound') diff --git a/include/sound/soc-dapm.h b/include/sound/soc-dapm.h index abe373d..0a15537 100644 --- a/include/sound/soc-dapm.h +++ b/include/sound/soc-dapm.h @@ -510,7 +510,6 @@ struct snd_soc_dapm_widget { /* dapm control */ int reg; /* negative reg = no direct dapm */ unsigned char shift; /* bits to shift */ - unsigned int saved_value; /* widget saved value */ unsigned int value; /* widget current value */ unsigned int mask; /* non-shifted mask */ unsigned int on_val; /* on state value */ -- cgit v1.1 From e2d32ff6ce4ee9958f3973a086f3fa5d009e6306 Mon Sep 17 00:00:00 2001 From: Mark Brown Date: Fri, 31 Aug 2012 17:38:32 -0700 Subject: ASoC: dapm: Ensure bypass paths are suspended and resumed Since bypass paths aren't part of DAPM streams and we may not have any DAPM streams there may not be anything that triggers a DAPM sync for them. Mark all input and output widgets as dirty and then sync to do so at the end of suspend and resume. Signed-off-by: Mark Brown Acked-by: Liam Girdwood --- include/sound/soc-dapm.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/sound') diff --git a/include/sound/soc-dapm.h b/include/sound/soc-dapm.h index 0a15537..07e2510 100644 --- a/include/sound/soc-dapm.h +++ b/include/sound/soc-dapm.h @@ -412,6 +412,7 @@ void snd_soc_dapm_auto_nc_codec_pins(struct snd_soc_codec *codec); /* Mostly internal - should not normally be used */ void dapm_mark_dirty(struct snd_soc_dapm_widget *w, const char *reason); +void dapm_mark_io_dirty(struct snd_soc_dapm_context *dapm); /* dapm path query */ int snd_soc_dapm_dai_get_connected_widgets(struct snd_soc_dai *dai, int stream, -- cgit v1.1 From 822b4b8d63e09076a4487eb881d3b7a13b28121c Mon Sep 17 00:00:00 2001 From: Mark Brown Date: Fri, 7 Sep 2012 10:54:32 +0800 Subject: ASoC: dapm: Add flags to regulator supplies This will be used to enable additional control of the regulators. Signed-off-by: Mark Brown Acked-by: Liam Girdwood --- include/sound/soc-dapm.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'include/sound') diff --git a/include/sound/soc-dapm.h b/include/sound/soc-dapm.h index 07e2510..c96bf5a 100644 --- a/include/sound/soc-dapm.h +++ b/include/sound/soc-dapm.h @@ -244,10 +244,11 @@ struct device; { .id = snd_soc_dapm_supply, .name = wname, .reg = wreg, \ .shift = wshift, .invert = winvert, .event = wevent, \ .event_flags = wflags} -#define SND_SOC_DAPM_REGULATOR_SUPPLY(wname, wdelay) \ +#define SND_SOC_DAPM_REGULATOR_SUPPLY(wname, wdelay, wflags) \ { .id = snd_soc_dapm_regulator_supply, .name = wname, \ .reg = SND_SOC_NOPM, .shift = wdelay, .event = dapm_regulator_event, \ - .event_flags = SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD } + .event_flags = SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD, \ + .invert = wflags} /* dapm kcontrol types */ -- cgit v1.1 From 86767b7d5b3cdbd105e7d7066d671b52aa208188 Mon Sep 17 00:00:00 2001 From: Lars-Peter Clausen Date: Fri, 14 Sep 2012 13:57:27 +0200 Subject: ASoC: Avoid recalculating the bitmask for SOC_ENUM controls For ENUM controls the bitmask is calculated based on the number of items. Currently this is done each time the control is accessed. And while the performance impact of this should be negligible we can easily do better. The roundup_pow_of_two macro performs the same calculation which is currently done manually, but it is also possible to use this macro with compile time constants and so it can be used to initialize static data. So we can use it to initialize the mask field of a ENUM control during its declaration. Signed-off-by: Lars-Peter Clausen Acked-by: Peter Ujfalusi Signed-off-by: Mark Brown --- include/sound/soc.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'include/sound') diff --git a/include/sound/soc.h b/include/sound/soc.h index 313b766..91244a0 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -160,7 +161,8 @@ .platform_max = xmax} } #define SOC_ENUM_DOUBLE(xreg, xshift_l, xshift_r, xmax, xtexts) \ { .reg = xreg, .shift_l = xshift_l, .shift_r = xshift_r, \ - .max = xmax, .texts = xtexts } + .max = xmax, .texts = xtexts, \ + .mask = xmax ? roundup_pow_of_two(xmax) - 1 : 0} #define SOC_ENUM_SINGLE(xreg, xshift, xmax, xtexts) \ SOC_ENUM_DOUBLE(xreg, xshift, xshift, xmax, xtexts) #define SOC_ENUM_SINGLE_EXT(xmax, xtexts) \ -- cgit v1.1 From 3706163140939bccd58fba739a9820f1d5eebeaf Mon Sep 17 00:00:00 2001 From: Mark Brown Date: Thu, 13 Sep 2012 11:46:58 +0800 Subject: ASoC: wm8960: Support shared LRCLK If the LRCLK is shared and the WM8960 is clock master then we should enable the LRCM bit to tell the device that it should drive LRCLK when either ADC or DAC is enabled rather than separately driving the two LRCLKs. Signed-off-by: Mark Brown --- include/sound/wm8960.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/sound') diff --git a/include/sound/wm8960.h b/include/sound/wm8960.h index 74e9a95..b5a1ab9e 100644 --- a/include/sound/wm8960.h +++ b/include/sound/wm8960.h @@ -19,6 +19,8 @@ struct wm8960_data { bool capless; /* Headphone outputs configured in capless mode */ int dres; /* Discharge resistance for headphone outputs */ + + bool shared_lrclk; /* DAC and ADC LRCLKs are wired together */ }; #endif -- cgit v1.1 From 0534951ba493a97eee646f62101cf88fac2308c6 Mon Sep 17 00:00:00 2001 From: Timur Tabi Date: Thu, 20 Sep 2012 13:57:27 -0500 Subject: ASoC: wm8960: remove 'dres' field from platform data structure The 'dres' field (discharge resistance for headphone outputs) is no longer used in the driver, so remove it. It was used in the original version of the driver when entering standby from off, but we stopped using it when we switched from having a single startup sequence to having separate cap and capless sequences. Signed-off-by: Timur Tabi Signed-off-by: Mark Brown --- include/sound/wm8960.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'include/sound') diff --git a/include/sound/wm8960.h b/include/sound/wm8960.h index b5a1ab9e..e8ce8ee 100644 --- a/include/sound/wm8960.h +++ b/include/sound/wm8960.h @@ -18,8 +18,6 @@ struct wm8960_data { bool capless; /* Headphone outputs configured in capless mode */ - int dres; /* Discharge resistance for headphone outputs */ - bool shared_lrclk; /* DAC and ADC LRCLKs are wired together */ }; -- cgit v1.1