From 5fb609d435f0679ed322ddeb1fdafe6142463fdf Mon Sep 17 00:00:00 2001 From: Dimitris Papastamos Date: Tue, 22 Mar 2011 10:37:03 +0000 Subject: ASoC: soc-cache: Introduce raw bulk write support As it has become more common to have to write firmware or similar large chunks of data to the hardware, add a function to perform raw bulk writes that bypass the cache. This only handles volatile registers as we should avoid getting out of sync with the actual cache. Signed-off-by: Dimitris Papastamos Acked-by: Liam Girdwood Signed-off-by: Mark Brown --- include/sound/soc.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include/sound') diff --git a/include/sound/soc.h b/include/sound/soc.h index bfa4836ea107..2f2a51fe78e9 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h @@ -543,6 +543,7 @@ struct snd_soc_codec { unsigned int (*hw_read)(struct snd_soc_codec *, unsigned int); unsigned int (*read)(struct snd_soc_codec *, unsigned int); int (*write)(struct snd_soc_codec *, unsigned int, unsigned int); + int (*bulk_write_raw)(struct snd_soc_codec *, unsigned int, const void *, size_t); void *reg_cache; const void *reg_def_copy; const struct snd_soc_cache_ops *cache_ops; @@ -814,6 +815,8 @@ struct soc_enum { unsigned int snd_soc_read(struct snd_soc_codec *codec, unsigned int reg); unsigned int snd_soc_write(struct snd_soc_codec *codec, unsigned int reg, unsigned int val); +unsigned int snd_soc_bulk_write_raw(struct snd_soc_codec *codec, + unsigned int reg, const void *data, size_t len); /* device driver data */ -- cgit v1.2.3 From 67850a892bf627e1c627bc8d0bcd84b90ecc9d7f Mon Sep 17 00:00:00 2001 From: Dimitris Papastamos Date: Tue, 22 Mar 2011 10:36:57 +0000 Subject: ASoC: Add control_type in snd_soc_codec This is mainly used by the soc-cache code to easily determine the currently used underlying serial bus. Set SND_SOC_CUSTOM to 1 so we can distinguish it if it is not initialized or set. Signed-off-by: Dimitris Papastamos Acked-by: Liam Girdwood Signed-off-by: Mark Brown --- include/sound/soc.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include/sound') diff --git a/include/sound/soc.h b/include/sound/soc.h index 2f2a51fe78e9..4a11795aaee3 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h @@ -248,7 +248,7 @@ typedef int (*hw_write_t)(void *,const char* ,int); extern struct snd_ac97_bus_ops soc_ac97_ops; enum snd_soc_control_type { - SND_SOC_CUSTOM, + SND_SOC_CUSTOM = 1, SND_SOC_I2C, SND_SOC_SPI, }; @@ -539,6 +539,7 @@ struct snd_soc_codec { /* codec IO */ void *control_data; /* codec control (i2c/3wire) data */ + enum snd_soc_control_type control_type; hw_write_t hw_write; unsigned int (*hw_read)(struct snd_soc_codec *, unsigned int); unsigned int (*read)(struct snd_soc_codec *, unsigned int); -- cgit v1.2.3 From 8020454c9a1ec5ac5801805896b5f69d0c573e17 Mon Sep 17 00:00:00 2001 From: Dimitris Papastamos Date: Thu, 24 Mar 2011 13:45:17 +0000 Subject: ASoC: Add default snd_soc_default_writable_register() callback By using struct snd_soc_reg_access for the read/write/vol attributes of the registers, we provide callbacks that automatically determine whether a given register is readable/writable or volatile. Signed-off-by: Dimitris Papastamos Acked-by: Liam Girdwood Signed-off-by: Mark Brown --- include/sound/soc.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include/sound') diff --git a/include/sound/soc.h b/include/sound/soc.h index 4a11795aaee3..e20835753c6b 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h @@ -292,6 +292,8 @@ int snd_soc_default_volatile_register(struct snd_soc_codec *codec, unsigned int reg); int snd_soc_default_readable_register(struct snd_soc_codec *codec, unsigned int reg); +int snd_soc_default_writable_register(struct snd_soc_codec *codec, + unsigned int reg); /* Utility functions to get clock rates from various things */ int snd_soc_calc_frame_size(int sample_size, int channels, int tdm_slots); @@ -523,6 +525,7 @@ struct snd_soc_codec { size_t reg_size; /* reg_cache_size * reg_word_size */ int (*volatile_register)(struct snd_soc_codec *, unsigned int); int (*readable_register)(struct snd_soc_codec *, unsigned int); + int (*writable_register)(struct snd_soc_codec *, unsigned int); /* runtime */ struct snd_ac97 *ac97; /* for ad-hoc ac97 devices */ @@ -589,6 +592,7 @@ struct snd_soc_codec_driver { size_t, unsigned int); int (*volatile_register)(struct snd_soc_codec *, unsigned int); int (*readable_register)(struct snd_soc_codec *, unsigned int); + int (*writable_register)(struct snd_soc_codec *, unsigned int); short reg_cache_size; short reg_cache_step; short reg_word_size; -- cgit v1.2.3 From 239c970626b9d9c7449de751d91f9a9da1018b85 Mon Sep 17 00:00:00 2001 From: Dimitris Papastamos Date: Thu, 24 Mar 2011 13:45:18 +0000 Subject: ASoC: Add snd_soc_codec_{readable,writable}_register() Provide the top level ASoC core functions for indicating whether a given register is readable or writable. Signed-off-by: Dimitris Papastamos Acked-by: Liam Girdwood Signed-off-by: Mark Brown --- include/sound/soc.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include/sound') diff --git a/include/sound/soc.h b/include/sound/soc.h index e20835753c6b..2720a9f3780b 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h @@ -278,6 +278,10 @@ int snd_soc_register_codec(struct device *dev, void snd_soc_unregister_codec(struct device *dev); int snd_soc_codec_volatile_register(struct snd_soc_codec *codec, unsigned int reg); +int snd_soc_codec_readable_register(struct snd_soc_codec *codec, + unsigned int reg); +int snd_soc_codec_writable_register(struct snd_soc_codec *codec, + unsigned int reg); int snd_soc_codec_set_cache_io(struct snd_soc_codec *codec, int addr_bits, int data_bits, enum snd_soc_control_type control); -- cgit v1.2.3 From 82a5a936f6dea13849d93a2899a9b7294a8db336 Mon Sep 17 00:00:00 2001 From: Peter Hsiang Date: Mon, 4 Apr 2011 19:35:30 -0700 Subject: ASoC: Add max98095 CODEC driver This patch adds the MAX98095 CODEC driver. Signed-off-by: Peter Hsiang Signed-off-by: Mark Brown --- include/sound/max98095.h | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 include/sound/max98095.h (limited to 'include/sound') diff --git a/include/sound/max98095.h b/include/sound/max98095.h new file mode 100644 index 000000000000..3381765b503e --- /dev/null +++ b/include/sound/max98095.h @@ -0,0 +1,26 @@ +/* + * Platform data for MAX98095 + * + * Copyright 2011 Maxim Integrated Products + * + * 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 __SOUND_MAX98095_PDATA_H__ +#define __SOUND_MAX98095_PDATA_H__ + +/* codec platform data */ +struct max98095_pdata { + /* Analog/digital microphone configuration: + * 0 = analog microphone input (normal setting) + * 1 = digital microphone input + */ + unsigned int digmic_left_mode:1; + unsigned int digmic_right_mode:1; +}; + +#endif -- cgit v1.2.3 From b7af1dafdfaf8419065399d07fb7cbae14b286ef Mon Sep 17 00:00:00 2001 From: Mark Brown Date: Thu, 7 Apr 2011 19:18:44 +0900 Subject: ASoC: Add data based control initialisation for CODECs and cards Allow CODEC and card drivers to point to an array of controls from their driver structure rather than explicitly calling snd_soc_add_controls(). Signed-off-by: Mark Brown --- include/sound/soc.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'include/sound') diff --git a/include/sound/soc.h b/include/sound/soc.h index 2720a9f3780b..435cb83c7f48 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h @@ -577,7 +577,9 @@ struct snd_soc_codec_driver { pm_message_t state); int (*resume)(struct snd_soc_codec *); - /* Default DAPM setup, added after probe() is run */ + /* Default control and setup, added after probe() is run */ + const struct snd_kcontrol_new *controls; + int num_controls; const struct snd_soc_dapm_widget *dapm_widgets; int num_dapm_widgets; const struct snd_soc_dapm_route *dapm_routes; @@ -747,6 +749,9 @@ struct snd_soc_card { struct snd_soc_pcm_runtime *rtd_aux; int num_aux_rtd; + const struct snd_kcontrol_new *controls; + int num_controls; + /* * Card-specific routes and widgets. */ -- cgit v1.2.3 From c93993aca45a223452d2a95383b655c85878c6e8 Mon Sep 17 00:00:00 2001 From: Mark Brown Date: Tue, 8 Feb 2011 14:09:41 +0000 Subject: ASoC: Add WM8915 CODEC driver The WM8915 is an ultra low power mobile CODEC designed for smartphones, featuring a mixture of digital and analogue I/O with flexible mixing options and advanced low power accessory detection functionality in a compact package. Signed-off-by: Mark Brown Acked-by: Liam Girdwood --- include/sound/wm8915.h | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 include/sound/wm8915.h (limited to 'include/sound') diff --git a/include/sound/wm8915.h b/include/sound/wm8915.h new file mode 100644 index 000000000000..5817d762f6f3 --- /dev/null +++ b/include/sound/wm8915.h @@ -0,0 +1,55 @@ +/* + * linux/sound/wm8915.h -- Platform data for WM8915 + * + * Copyright 2011 Wolfson Microelectronics. PLC. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +#ifndef __LINUX_SND_WM8903_H +#define __LINUX_SND_WM8903_H + +enum wm8915_inmode { + WM8915_DIFFERRENTIAL_1 = 0, /* IN1xP - IN1xN */ + WM8915_INVERTING = 1, /* IN1xN */ + WM8915_NON_INVERTING = 2, /* IN1xP */ + WM8915_DIFFERENTIAL_2 = 3, /* IN2xP - IN2xP */ +}; + +/** + * ReTune Mobile configurations are specified with a label, sample + * rate and set of values to write (the enable bits will be ignored). + * + * Configurations are expected to be generated using the ReTune Mobile + * control panel in WISCE - see http://www.wolfsonmicro.com/wisce/ + */ +struct wm8915_retune_mobile_config { + const char *name; + int rate; + u16 regs[20]; +}; + +#define WM8915_SET_DEFAULT 0x10000 + +struct wm8915_pdata { + int irq_flags; /** Set IRQ trigger flags; default active low */ + + int ldo_ena; /** GPIO for LDO1; -1 for none */ + + int micdet_def; /** Default MICDET_SRC/HP1FB_SRC/MICD_BIAS */ + + enum wm8915_inmode inl_mode; + enum wm8915_inmode inr_mode; + + u32 spkmute_seq; /** Value for register 0x802 */ + + int gpio_base; + u32 gpio_default[5]; + + int num_retune_mobile_cfgs; + struct wm8915_retune_mobile_config *retune_mobile_cfgs; +}; + +#endif -- cgit v1.2.3 From d06e48db1670b29b3f62f1dfe4a36af237d5aa0d Mon Sep 17 00:00:00 2001 From: Lars-Peter Clausen Date: Tue, 12 Apr 2011 19:31:01 +0200 Subject: ASoC: Make struct snd_soc_card's dapm_widgets and dapm_routes const Those should not be modified (and are not) by the core code, so make them const. This also makes them consistent with the same members of snd_soc_codec. Signed-off-by: Lars-Peter Clausen Acked-by: Liam Girdwood Signed-off-by: Mark Brown --- include/sound/soc.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include/sound') diff --git a/include/sound/soc.h b/include/sound/soc.h index 435cb83c7f48..cb6b18b6eece 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h @@ -755,9 +755,9 @@ struct snd_soc_card { /* * Card-specific routes and widgets. */ - struct snd_soc_dapm_widget *dapm_widgets; + const struct snd_soc_dapm_widget *dapm_widgets; int num_dapm_widgets; - struct snd_soc_dapm_route *dapm_routes; + const struct snd_soc_dapm_route *dapm_routes; int num_dapm_routes; struct work_struct deferred_resume_work; -- cgit v1.2.3 From 28683e0f9cda7450cc81a844f0cb9dfa4a1b940a Mon Sep 17 00:00:00 2001 From: Lu Guanqun Date: Wed, 20 Apr 2011 16:00:46 +0800 Subject: ASoC: simple style fix replace the tab with spaces, make it align with other paragraphs Signed-off-by: Lu Guanqun Acked-by: Liam Girdwood Signed-off-by: Mark Brown --- include/sound/soc-dapm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/sound') diff --git a/include/sound/soc-dapm.h b/include/sound/soc-dapm.h index f72c1039a6fb..d5f1b9a9b8ff 100644 --- a/include/sound/soc-dapm.h +++ b/include/sound/soc-dapm.h @@ -24,7 +24,7 @@ * SoC dynamic audio power management * * We can have up to 4 power domains - * 1. Codec domain - VREF, VMID + * 1. Codec domain - VREF, VMID * Usually controlled at codec probe/remove, although can be set * at stream time if power is not needed for sidetone, etc. * 2. Platform/Machine domain - physically connected inputs and outputs -- cgit v1.2.3 From dad31ec133adb20c8fd10bfd9379da3f08b8721e Mon Sep 17 00:00:00 2001 From: Peter Hsiang Date: Tue, 19 Apr 2011 18:20:40 -0700 Subject: ASoC: Add EQ and filter to max98095 CODEC driver This patch adds the equalizer and biquad filter controls. Signed-off-by: Peter Hsiang Acked-by: Liam Girdwood Signed-off-by: Mark Brown --- include/sound/max98095.h | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'include/sound') diff --git a/include/sound/max98095.h b/include/sound/max98095.h index 3381765b503e..7513a42dd4aa 100644 --- a/include/sound/max98095.h +++ b/include/sound/max98095.h @@ -13,8 +13,36 @@ #ifndef __SOUND_MAX98095_PDATA_H__ #define __SOUND_MAX98095_PDATA_H__ +/* Equalizer filter response configuration */ +struct max98095_eq_cfg { + const char *name; + unsigned int rate; + u16 band1[5]; + u16 band2[5]; + u16 band3[5]; + u16 band4[5]; + u16 band5[5]; +}; + +/* Biquad filter response configuration */ +struct max98095_biquad_cfg { + const char *name; + unsigned int rate; + u16 band1[5]; + u16 band2[5]; +}; + /* codec platform data */ struct max98095_pdata { + + /* Equalizers for DAI1 and DAI2 */ + struct max98095_eq_cfg *eq_cfg; + unsigned int eq_cfgcnt; + + /* Biquad filter for DAI1 and DAI2 */ + struct max98095_biquad_cfg *bq_cfg; + unsigned int bq_cfgcnt; + /* Analog/digital microphone configuration: * 0 = analog microphone input (normal setting) * 1 = digital microphone input -- cgit v1.2.3 From 7cd873c2c9699bdf060b0bac5979a5c2ae68b553 Mon Sep 17 00:00:00 2001 From: Mark Brown Date: Mon, 25 Apr 2011 20:01:42 +0100 Subject: ASoC: Define constants for WM8962 GPIO functions Signed-off-by: Mark Brown Acked-by: Liam Girdwood --- include/sound/wm8962.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'include/sound') diff --git a/include/sound/wm8962.h b/include/sound/wm8962.h index 2b5306c503fb..1750bed7c2f6 100644 --- a/include/sound/wm8962.h +++ b/include/sound/wm8962.h @@ -14,6 +14,28 @@ /* Use to set GPIO default values to zero */ #define WM8962_GPIO_SET 0x10000 +#define WM8962_GPIO_FN_CLKOUT 0 +#define WM8962_GPIO_FN_LOGIC 1 +#define WM8962_GPIO_FN_SDOUT 2 +#define WM8962_GPIO_FN_IRQ 3 +#define WM8962_GPIO_FN_THERMAL 4 +#define WM8962_GPIO_FN_PLL2_LOCK 6 +#define WM8962_GPIO_FN_PLL3_LOCK 7 +#define WM8962_GPIO_FN_FLL_LOCK 9 +#define WM8962_GPIO_FN_DRC_ACT 10 +#define WM8962_GPIO_FN_WSEQ_DONE 11 +#define WM8962_GPIO_FN_ALC_NG_ACT 12 +#define WM8962_GPIO_FN_ALC_PEAK_LIMIT 13 +#define WM8962_GPIO_FN_ALC_SATURATION 14 +#define WM8962_GPIO_FN_ALC_LEVEL_THR 15 +#define WM8962_GPIO_FN_ALC_LEVEL_LOCK 16 +#define WM8962_GPIO_FN_FIFO_ERR 17 +#define WM8962_GPIO_FN_OPCLK 18 +#define WM8962_GPIO_FN_DMICCLK 19 +#define WM8962_GPIO_FN_DMICDAT 20 +#define WM8962_GPIO_FN_MICD 21 +#define WM8962_GPIO_FN_MICSCD 22 + struct wm8962_pdata { int gpio_base; u32 gpio_init[WM8962_MAX_GPIO]; -- cgit v1.2.3 From fb257897bf20c5f0e1df584bb5b874e811651263 Mon Sep 17 00:00:00 2001 From: Mark Brown Date: Thu, 28 Apr 2011 10:57:54 +0100 Subject: ASoC: Work around allmodconfig failure Signed-off-by: Mark Brown Acked-by: Liam Girdwood --- include/sound/soc.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include/sound') diff --git a/include/sound/soc.h b/include/sound/soc.h index cb6b18b6eece..6ce3e573fb40 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h @@ -888,6 +888,9 @@ static inline void snd_soc_initialize_card_lists(struct snd_soc_card *card) INIT_LIST_HEAD(&card->dapm_list); } +int snd_soc_util_init(void); +void snd_soc_util_exit(void); + #include #ifdef CONFIG_DEBUG_FS -- cgit v1.2.3 From 87023ff74b2358b5e51d3c790704f786e89ff769 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Tue, 3 May 2011 12:50:29 +0200 Subject: ASoC: Declare const properly for enum texts The enum texts are supposed to be const char * const []. Without the second const, it gets compile warnings like sound/soc/codecs/max98095.c:607:2: warning: initialization discards qualifiers from pointer target type Signed-off-by: Takashi Iwai --- include/sound/soc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/sound') diff --git a/include/sound/soc.h b/include/sound/soc.h index 6ce3e573fb40..b27c7a2d3bb0 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h @@ -820,7 +820,7 @@ struct soc_enum { unsigned char shift_r; unsigned int max; unsigned int mask; - const char **texts; + const char * const *texts; const unsigned int *values; void *dapm; }; -- cgit v1.2.3 From 8eecaf62445e175572ffabaab090b471001c5a2c Mon Sep 17 00:00:00 2001 From: Lars-Peter Clausen Date: Sat, 30 Apr 2011 19:45:48 +0200 Subject: ASoC: Move DAPM debugfs directory creation to snd_soc_dapm_debugfs_init Move the creation of the DAPM debugfs directory to snd_soc_dapm_debugfs_init instead of having the same duplicated code in both codec and card DAPM setup. Signed-off-by: Lars-Peter Clausen Acked-by: Liam Girdwood Signed-off-by: Mark Brown --- include/sound/soc-dapm.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include/sound') diff --git a/include/sound/soc-dapm.h b/include/sound/soc-dapm.h index d5f1b9a9b8ff..f8a7c9a6f12a 100644 --- a/include/sound/soc-dapm.h +++ b/include/sound/soc-dapm.h @@ -356,7 +356,8 @@ void snd_soc_dapm_shutdown(struct snd_soc_card *card); /* dapm sys fs - used by the core */ int snd_soc_dapm_sys_add(struct device *dev); -void snd_soc_dapm_debugfs_init(struct snd_soc_dapm_context *dapm); +void snd_soc_dapm_debugfs_init(struct snd_soc_dapm_context *dapm, + struct dentry *parent); /* dapm audio pin control and status */ int snd_soc_dapm_enable_pin(struct snd_soc_dapm_context *dapm, -- cgit v1.2.3 From 82cfecdc03499be63262d60daf859b4cc1ea3fba Mon Sep 17 00:00:00 2001 From: Stephen Warren Date: Thu, 28 Apr 2011 17:37:58 -0600 Subject: ASoC: s/w->kcontrols/w->kcontrol_news/g A future change will modify struct snd_soc_dapm_widget to store the actual kcontrol pointers for each kcontrol_new in a field named kcontrols. Rename the existing kcontrols field to enable this. Signed-off-by: Stephen Warren Acked-by: Liam Girdwood Signed-off-by: Mark Brown --- include/sound/soc-dapm.h | 68 ++++++++++++++++++++++++------------------------ 1 file changed, 34 insertions(+), 34 deletions(-) (limited to 'include/sound') diff --git a/include/sound/soc-dapm.h b/include/sound/soc-dapm.h index f8a7c9a6f12a..76714be19e9d 100644 --- a/include/sound/soc-dapm.h +++ b/include/sound/soc-dapm.h @@ -39,30 +39,30 @@ /* codec domain */ #define SND_SOC_DAPM_VMID(wname) \ -{ .id = snd_soc_dapm_vmid, .name = wname, .kcontrols = NULL, \ +{ .id = snd_soc_dapm_vmid, .name = wname, .kcontrol_news = NULL, \ .num_kcontrols = 0} /* platform domain */ #define SND_SOC_DAPM_INPUT(wname) \ -{ .id = snd_soc_dapm_input, .name = wname, .kcontrols = NULL, \ +{ .id = snd_soc_dapm_input, .name = wname, .kcontrol_news = NULL, \ .num_kcontrols = 0, .reg = SND_SOC_NOPM } #define SND_SOC_DAPM_OUTPUT(wname) \ -{ .id = snd_soc_dapm_output, .name = wname, .kcontrols = NULL, \ +{ .id = snd_soc_dapm_output, .name = wname, .kcontrol_news = NULL, \ .num_kcontrols = 0, .reg = SND_SOC_NOPM } #define SND_SOC_DAPM_MIC(wname, wevent) \ -{ .id = snd_soc_dapm_mic, .name = wname, .kcontrols = NULL, \ +{ .id = snd_soc_dapm_mic, .name = wname, .kcontrol_news = NULL, \ .num_kcontrols = 0, .reg = SND_SOC_NOPM, .event = wevent, \ .event_flags = SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD} #define SND_SOC_DAPM_HP(wname, wevent) \ -{ .id = snd_soc_dapm_hp, .name = wname, .kcontrols = NULL, \ +{ .id = snd_soc_dapm_hp, .name = wname, .kcontrol_news = NULL, \ .num_kcontrols = 0, .reg = SND_SOC_NOPM, .event = wevent, \ .event_flags = SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD} #define SND_SOC_DAPM_SPK(wname, wevent) \ -{ .id = snd_soc_dapm_spk, .name = wname, .kcontrols = NULL, \ +{ .id = snd_soc_dapm_spk, .name = wname, .kcontrol_news = NULL, \ .num_kcontrols = 0, .reg = SND_SOC_NOPM, .event = wevent, \ .event_flags = SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD} #define SND_SOC_DAPM_LINE(wname, wevent) \ -{ .id = snd_soc_dapm_line, .name = wname, .kcontrols = NULL, \ +{ .id = snd_soc_dapm_line, .name = wname, .kcontrol_news = NULL, \ .num_kcontrols = 0, .reg = SND_SOC_NOPM, .event = wevent, \ .event_flags = SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD} @@ -70,91 +70,91 @@ #define SND_SOC_DAPM_PGA(wname, wreg, wshift, winvert,\ wcontrols, wncontrols) \ { .id = snd_soc_dapm_pga, .name = wname, .reg = wreg, .shift = wshift, \ - .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = wncontrols} + .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = wncontrols} #define SND_SOC_DAPM_OUT_DRV(wname, wreg, wshift, winvert,\ wcontrols, wncontrols) \ { .id = snd_soc_dapm_out_drv, .name = wname, .reg = wreg, .shift = wshift, \ - .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = wncontrols} + .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = wncontrols} #define SND_SOC_DAPM_MIXER(wname, wreg, wshift, winvert, \ wcontrols, wncontrols)\ { .id = snd_soc_dapm_mixer, .name = wname, .reg = wreg, .shift = wshift, \ - .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = wncontrols} + .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = wncontrols} #define SND_SOC_DAPM_MIXER_NAMED_CTL(wname, wreg, wshift, winvert, \ wcontrols, wncontrols)\ { .id = snd_soc_dapm_mixer_named_ctl, .name = wname, .reg = wreg, \ - .shift = wshift, .invert = winvert, .kcontrols = wcontrols, \ + .shift = wshift, .invert = winvert, .kcontrol_news = wcontrols, \ .num_kcontrols = wncontrols} #define SND_SOC_DAPM_MICBIAS(wname, wreg, wshift, winvert) \ { .id = snd_soc_dapm_micbias, .name = wname, .reg = wreg, .shift = wshift, \ - .invert = winvert, .kcontrols = NULL, .num_kcontrols = 0} + .invert = winvert, .kcontrol_news = NULL, .num_kcontrols = 0} #define SND_SOC_DAPM_SWITCH(wname, wreg, wshift, winvert, wcontrols) \ { .id = snd_soc_dapm_switch, .name = wname, .reg = wreg, .shift = wshift, \ - .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = 1} + .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = 1} #define SND_SOC_DAPM_MUX(wname, wreg, wshift, winvert, wcontrols) \ { .id = snd_soc_dapm_mux, .name = wname, .reg = wreg, .shift = wshift, \ - .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = 1} + .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = 1} #define SND_SOC_DAPM_VIRT_MUX(wname, wreg, wshift, winvert, wcontrols) \ { .id = snd_soc_dapm_virt_mux, .name = wname, .reg = wreg, .shift = wshift, \ - .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = 1} + .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = 1} #define SND_SOC_DAPM_VALUE_MUX(wname, wreg, wshift, winvert, wcontrols) \ { .id = snd_soc_dapm_value_mux, .name = wname, .reg = wreg, \ - .shift = wshift, .invert = winvert, .kcontrols = wcontrols, \ + .shift = wshift, .invert = winvert, .kcontrol_news = wcontrols, \ .num_kcontrols = 1} /* Simplified versions of above macros, assuming wncontrols = ARRAY_SIZE(wcontrols) */ #define SOC_PGA_ARRAY(wname, wreg, wshift, winvert,\ wcontrols) \ { .id = snd_soc_dapm_pga, .name = wname, .reg = wreg, .shift = wshift, \ - .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = ARRAY_SIZE(wcontrols)} + .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = ARRAY_SIZE(wcontrols)} #define SOC_MIXER_ARRAY(wname, wreg, wshift, winvert, \ wcontrols)\ { .id = snd_soc_dapm_mixer, .name = wname, .reg = wreg, .shift = wshift, \ - .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = ARRAY_SIZE(wcontrols)} + .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = ARRAY_SIZE(wcontrols)} #define SOC_MIXER_NAMED_CTL_ARRAY(wname, wreg, wshift, winvert, \ wcontrols)\ { .id = snd_soc_dapm_mixer_named_ctl, .name = wname, .reg = wreg, \ - .shift = wshift, .invert = winvert, .kcontrols = wcontrols, \ + .shift = wshift, .invert = winvert, .kcontrol_news = wcontrols, \ .num_kcontrols = ARRAY_SIZE(wcontrols)} /* path domain with event - event handler must return 0 for success */ #define SND_SOC_DAPM_PGA_E(wname, wreg, wshift, winvert, wcontrols, \ wncontrols, wevent, wflags) \ { .id = snd_soc_dapm_pga, .name = wname, .reg = wreg, .shift = wshift, \ - .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = wncontrols, \ + .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = wncontrols, \ .event = wevent, .event_flags = wflags} #define SND_SOC_DAPM_OUT_DRV_E(wname, wreg, wshift, winvert, wcontrols, \ wncontrols, wevent, wflags) \ { .id = snd_soc_dapm_out_drv, .name = wname, .reg = wreg, .shift = wshift, \ - .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = wncontrols, \ + .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = wncontrols, \ .event = wevent, .event_flags = wflags} #define SND_SOC_DAPM_MIXER_E(wname, wreg, wshift, winvert, wcontrols, \ wncontrols, wevent, wflags) \ { .id = snd_soc_dapm_mixer, .name = wname, .reg = wreg, .shift = wshift, \ - .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = wncontrols, \ + .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = wncontrols, \ .event = wevent, .event_flags = wflags} #define SND_SOC_DAPM_MIXER_NAMED_CTL_E(wname, wreg, wshift, winvert, \ wcontrols, wncontrols, wevent, wflags) \ { .id = snd_soc_dapm_mixer, .name = wname, .reg = wreg, .shift = wshift, \ - .invert = winvert, .kcontrols = wcontrols, \ + .invert = winvert, .kcontrol_news = wcontrols, \ .num_kcontrols = wncontrols, .event = wevent, .event_flags = wflags} #define SND_SOC_DAPM_MICBIAS_E(wname, wreg, wshift, winvert, wevent, wflags) \ { .id = snd_soc_dapm_micbias, .name = wname, .reg = wreg, .shift = wshift, \ - .invert = winvert, .kcontrols = NULL, .num_kcontrols = 0, \ + .invert = winvert, .kcontrol_news = NULL, .num_kcontrols = 0, \ .event = wevent, .event_flags = wflags} #define SND_SOC_DAPM_SWITCH_E(wname, wreg, wshift, winvert, wcontrols, \ wevent, wflags) \ { .id = snd_soc_dapm_switch, .name = wname, .reg = wreg, .shift = wshift, \ - .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = 1, \ + .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = 1, \ .event = wevent, .event_flags = wflags} #define SND_SOC_DAPM_MUX_E(wname, wreg, wshift, winvert, wcontrols, \ wevent, wflags) \ { .id = snd_soc_dapm_mux, .name = wname, .reg = wreg, .shift = wshift, \ - .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = 1, \ + .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = 1, \ .event = wevent, .event_flags = wflags} #define SND_SOC_DAPM_VIRT_MUX_E(wname, wreg, wshift, winvert, wcontrols, \ wevent, wflags) \ { .id = snd_soc_dapm_virt_mux, .name = wname, .reg = wreg, .shift = wshift, \ - .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = 1, \ + .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = 1, \ .event = wevent, .event_flags = wflags} /* additional sequencing control within an event type */ @@ -173,26 +173,26 @@ #define SOC_PGA_E_ARRAY(wname, wreg, wshift, winvert, wcontrols, \ wevent, wflags) \ { .id = snd_soc_dapm_pga, .name = wname, .reg = wreg, .shift = wshift, \ - .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = ARRAY_SIZE(wcontrols), \ + .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = ARRAY_SIZE(wcontrols), \ .event = wevent, .event_flags = wflags} #define SOC_MIXER_E_ARRAY(wname, wreg, wshift, winvert, wcontrols, \ wevent, wflags) \ { .id = snd_soc_dapm_mixer, .name = wname, .reg = wreg, .shift = wshift, \ - .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = ARRAY_SIZE(wcontrols), \ + .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = ARRAY_SIZE(wcontrols), \ .event = wevent, .event_flags = wflags} #define SOC_MIXER_NAMED_CTL_E_ARRAY(wname, wreg, wshift, winvert, \ wcontrols, wevent, wflags) \ { .id = snd_soc_dapm_mixer, .name = wname, .reg = wreg, .shift = wshift, \ - .invert = winvert, .kcontrols = wcontrols, \ + .invert = winvert, .kcontrol_news = wcontrols, \ .num_kcontrols = ARRAY_SIZE(wcontrols), .event = wevent, .event_flags = wflags} /* events that are pre and post DAPM */ #define SND_SOC_DAPM_PRE(wname, wevent) \ -{ .id = snd_soc_dapm_pre, .name = wname, .kcontrols = NULL, \ +{ .id = snd_soc_dapm_pre, .name = wname, .kcontrol_news = NULL, \ .num_kcontrols = 0, .reg = SND_SOC_NOPM, .event = wevent, \ .event_flags = SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_PRE_PMD} #define SND_SOC_DAPM_POST(wname, wevent) \ -{ .id = snd_soc_dapm_post, .name = wname, .kcontrols = NULL, \ +{ .id = snd_soc_dapm_post, .name = wname, .kcontrol_news = NULL, \ .num_kcontrols = 0, .reg = SND_SOC_NOPM, .event = wevent, \ .event_flags = SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_POST_PMD} @@ -232,7 +232,7 @@ /* generic widgets */ #define SND_SOC_DAPM_REG(wid, wname, wreg, wshift, wmask, won_val, woff_val) \ -{ .id = wid, .name = wname, .kcontrols = NULL, .num_kcontrols = 0, \ +{ .id = wid, .name = wname, .kcontrol_news = NULL, .num_kcontrols = 0, \ .reg = -((wreg) + 1), .shift = wshift, .mask = wmask, \ .on_val = won_val, .off_val = woff_val, .event = dapm_reg_event, \ .event_flags = SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD} @@ -473,7 +473,7 @@ struct snd_soc_dapm_widget { /* kcontrols that relate to this widget */ int num_kcontrols; - const struct snd_kcontrol_new *kcontrols; + const struct snd_kcontrol_new *kcontrol_news; /* widget input and outputs */ struct list_head sources; -- cgit v1.2.3 From fad598887dc0d89ffee3e51281a8143beb2ae58c Mon Sep 17 00:00:00 2001 From: Stephen Warren Date: Thu, 28 Apr 2011 17:37:59 -0600 Subject: ASoC: Add w->kcontrols, and populate it Future changes will need reference to the kcontrol created for a given kcontrol_new. Store the created kcontrol values now. Signed-off-by: Stephen Warren Acked-by: Liam Girdwood Signed-off-by: Mark Brown --- 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 76714be19e9d..b25bf0ffc947 100644 --- a/include/sound/soc-dapm.h +++ b/include/sound/soc-dapm.h @@ -474,6 +474,7 @@ struct snd_soc_dapm_widget { /* kcontrols that relate to this widget */ int num_kcontrols; const struct snd_kcontrol_new *kcontrol_news; + struct snd_kcontrol **kcontrols; /* widget input and outputs */ struct list_head sources; -- cgit v1.2.3 From fafd2176f72148e83c64a1f818ff33fceed83d08 Mon Sep 17 00:00:00 2001 From: Stephen Warren Date: Thu, 28 Apr 2011 17:38:00 -0600 Subject: ASoC: Store a list of widgets in a DAPM mux/mixer kcontrol A future change will allow multiple widgets to be affected by the same control. For example, a single register bit that controls separate muxes in both the L and R audio paths. This change updates the code that handles relevant controls to be able to iterate over a list of affected widgets. Note that only the put functions need significant modification to implement the iteration; the get functions do not need to iterate, nor unify the results, since all affected widgets reference the same kcontrol. When creating the list of widgets, always create a 1-sized list, since the control sharing is not implemented in this change. Signed-off-by: Stephen Warren Acked-by: Liam Girdwood Signed-off-by: Mark Brown --- include/sound/soc-dapm.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include/sound') diff --git a/include/sound/soc-dapm.h b/include/sound/soc-dapm.h index b25bf0ffc947..c46e7d89561d 100644 --- a/include/sound/soc-dapm.h +++ b/include/sound/soc-dapm.h @@ -518,4 +518,10 @@ struct snd_soc_dapm_context { #endif }; +/* A list of widgets associated with an object, typically a snd_kcontrol */ +struct snd_soc_dapm_widget_list { + int num_widgets; + struct snd_soc_dapm_widget *widgets[0]; +}; + #endif -- cgit v1.2.3 From 93864cf04283eb2899ef13ded472a9f24538303f Mon Sep 17 00:00:00 2001 From: Peter Ujfalusi Date: Tue, 3 May 2011 18:11:36 +0300 Subject: ASoC: tlv320dac33: Update e-mail address Signed-off-by: Peter Ujfalusi Acked-by: Mark Brown Signed-off-by: Liam Girdwood --- include/sound/tlv320dac33-plat.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/sound') diff --git a/include/sound/tlv320dac33-plat.h b/include/sound/tlv320dac33-plat.h index 6c6649656798..0b94192a8cdf 100644 --- a/include/sound/tlv320dac33-plat.h +++ b/include/sound/tlv320dac33-plat.h @@ -1,7 +1,7 @@ /* * Platform header for Texas Instruments TLV320DAC33 codec driver * - * Author: Peter Ujfalusi + * Author: Peter Ujfalusi * * Copyright: (C) 2009 Nokia Corporation * -- cgit v1.2.3 From b4079ef40a5ae87dc0d29bded7a682b1cbe626ad Mon Sep 17 00:00:00 2001 From: Peter Ujfalusi Date: Tue, 3 May 2011 18:12:41 +0300 Subject: ASoC: tpa6130a2: Update e-mail address Signed-off-by: Peter Ujfalusi Acked-by: Mark Brown Signed-off-by: Liam Girdwood --- include/sound/tpa6130a2-plat.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/sound') diff --git a/include/sound/tpa6130a2-plat.h b/include/sound/tpa6130a2-plat.h index e29fde6b5cbe..89beccb57edd 100644 --- a/include/sound/tpa6130a2-plat.h +++ b/include/sound/tpa6130a2-plat.h @@ -3,7 +3,7 @@ * * Copyright (C) Nokia Corporation * - * Written by Peter Ujfalusi + * Author: Peter Ujfalusi * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License -- cgit v1.2.3 From 22de71ba03311cdc1063757c50a1488cb90a1fca Mon Sep 17 00:00:00 2001 From: Liam Girdwood Date: Thu, 12 May 2011 16:14:04 +0100 Subject: ASoC: core - allow ASoC more flexible machine name Allow ASoC machine drivers to register a driver name and a longname. This allows user space to determine the flavour of machine driver. Signed-off-by: Liam Girdwood Signed-off-by: Mark Brown --- include/sound/soc.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/sound') diff --git a/include/sound/soc.h b/include/sound/soc.h index b27c7a2d3bb0..f1de3e0c75bc 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h @@ -702,6 +702,8 @@ struct snd_soc_aux_dev { /* SoC card */ struct snd_soc_card { const char *name; + const char *long_name; + const char *driver_name; struct device *dev; struct snd_card *snd_card; struct module *owner; -- cgit v1.2.3 From 00d2701070c91728988bbfa414a346a23acd8275 Mon Sep 17 00:00:00 2001 From: Dmitry Artamonow Date: Wed, 18 May 2011 19:25:09 +0400 Subject: ASoC: Asahi Kasei AK4641 codec driver A driver for the AK4641 codec used in iPAQ hx4700 and Glofiish M800 among others. Signed-off-by: Harald Welte Signed-off-by: Philipp Zabel Signed-off-by: Dmitry Artamonow Acked-by: Liam Girdwood Signed-off-by: Mark Brown --- include/sound/ak4641.h | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 include/sound/ak4641.h (limited to 'include/sound') diff --git a/include/sound/ak4641.h b/include/sound/ak4641.h new file mode 100644 index 000000000000..96d1991c811d --- /dev/null +++ b/include/sound/ak4641.h @@ -0,0 +1,26 @@ +/* + * AK4641 ALSA SoC Codec driver + * + * Copyright 2009 Philipp Zabel + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +#ifndef __AK4641_H +#define __AK4641_H + +/** + * struct ak4641_platform_data - platform specific AK4641 configuration + * @gpio_power: GPIO to control external power to AK4641 + * @gpio_npdn: GPIO connected to AK4641 nPDN pin + * + * Both GPIO parameters are optional. + */ +struct ak4641_platform_data { + int gpio_power; + int gpio_npdn; +}; + +#endif /* __AK4641_H */ -- cgit v1.2.3