From 041e74b71491acadad74b275e8b05add165d92b4 Mon Sep 17 00:00:00 2001 From: "oder_chiou@realtek.com" Date: Mon, 5 Feb 2018 18:29:56 +0800 Subject: ASoC: rt5659: Add the support of Intel HDA Header The patch adds the support of Intel HDA Header. Signed-off-by: Oder Chiou Signed-off-by: Mark Brown --- include/sound/rt5659.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/sound') diff --git a/include/sound/rt5659.h b/include/sound/rt5659.h index 656c4d58948d..9012e2b25360 100644 --- a/include/sound/rt5659.h +++ b/include/sound/rt5659.h @@ -30,6 +30,7 @@ enum rt5659_dmic2_data_pin { enum rt5659_jd_src { RT5659_JD_NULL, RT5659_JD3, + RT5659_JD_HDA_HEADER, }; struct rt5659_platform_data { -- cgit From c95869e5c04fb0000370e7310dc892b417b8128a Mon Sep 17 00:00:00 2001 From: Kuninori Morimoto Date: Mon, 29 Jan 2018 02:58:25 +0000 Subject: ASoC: ac97: replace codec to component Now we can replace Codec to Component. Let's do it. Note: xxx_codec_xxx() -> xxx_component_xxx() .idle_bias_off = 0 -> .idle_bias_on = 1 .ignore_pmdown_time = 0 -> .use_pmdown_time = 1 - -> .endianness = 1 - -> .non_legacy_dai_naming = 1 To keep compatibilty, this patch adds snd_soc_xxx_ac97_codec() macro. These will be removed when all codec code was removed. Signed-off-by: Kuninori Morimoto Signed-off-by: Mark Brown --- include/sound/soc.h | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'include/sound') diff --git a/include/sound/soc.h b/include/sound/soc.h index 747fd583b9dc..6a11b0239f74 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h @@ -586,10 +586,17 @@ int snd_soc_test_bits(struct snd_soc_codec *codec, unsigned int reg, unsigned int mask, unsigned int value); #ifdef CONFIG_SND_SOC_AC97_BUS -struct snd_ac97 *snd_soc_alloc_ac97_codec(struct snd_soc_codec *codec); -struct snd_ac97 *snd_soc_new_ac97_codec(struct snd_soc_codec *codec, +#define snd_soc_alloc_ac97_codec(codec) \ + snd_soc_alloc_ac97_component(&codec->component) +#define snd_soc_new_ac97_codec(codec, id, id_mask) \ + snd_soc_new_ac97_component(&codec->component, id, id_mask) +#define snd_soc_free_ac97_codec(ac97) \ + snd_soc_free_ac97_component(ac97) + +struct snd_ac97 *snd_soc_alloc_ac97_component(struct snd_soc_component *component); +struct snd_ac97 *snd_soc_new_ac97_component(struct snd_soc_component *component, unsigned int id, unsigned int id_mask); -void snd_soc_free_ac97_codec(struct snd_ac97 *ac97); +void snd_soc_free_ac97_component(struct snd_ac97 *ac97); int snd_soc_set_ac97_ops(struct snd_ac97_bus_ops *ops); int snd_soc_set_ac97_ops_of_reset(struct snd_ac97_bus_ops *ops, -- cgit From be7ee5f32a9a4eba881d18e85d58e9a03a9cca99 Mon Sep 17 00:00:00 2001 From: Kuninori Morimoto Date: Mon, 29 Jan 2018 02:41:09 +0000 Subject: ASoC: soc-generic-dmaengine-pcm: replace platform to component Now platform can be replaced to component, let's do it. Signed-off-by: Kuninori Morimoto Signed-off-by: Mark Brown --- include/sound/dmaengine_pcm.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/sound') diff --git a/include/sound/dmaengine_pcm.h b/include/sound/dmaengine_pcm.h index 67be2445941a..8a5a8404966e 100644 --- a/include/sound/dmaengine_pcm.h +++ b/include/sound/dmaengine_pcm.h @@ -161,4 +161,6 @@ int snd_dmaengine_pcm_prepare_slave_config(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params, struct dma_slave_config *slave_config); +#define SND_DMAENGINE_PCM_DRV_NAME "snd_dmaengine_pcm" + #endif -- cgit From 78648092ef46255e6dc6685202164199c86cf930 Mon Sep 17 00:00:00 2001 From: Olivier Moysan Date: Mon, 19 Feb 2018 16:00:36 +0100 Subject: ASoC: dmaengine_pcm: add processing support Allow dmaengine client to optionally register a processing callback. This callback is intended to apply processing on samples in buffer copied from/to user space, before/after DMA transfer. Signed-off-by: Olivier Moysan Signed-off-by: Mark Brown --- include/sound/dmaengine_pcm.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include/sound') diff --git a/include/sound/dmaengine_pcm.h b/include/sound/dmaengine_pcm.h index 8a5a8404966e..47ef486852ed 100644 --- a/include/sound/dmaengine_pcm.h +++ b/include/sound/dmaengine_pcm.h @@ -140,6 +140,9 @@ struct snd_dmaengine_pcm_config { struct dma_chan *(*compat_request_channel)( struct snd_soc_pcm_runtime *rtd, struct snd_pcm_substream *substream); + int (*process)(struct snd_pcm_substream *substream, + int channel, unsigned long hwoff, + void *buf, unsigned long bytes); dma_filter_fn compat_filter_fn; struct device *dma_dev; const char *chan_names[SNDRV_PCM_STREAM_LAST + 1]; -- cgit From 54e3a3a152a6f466f3a94b28be10f08b86905bc0 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Sun, 25 Feb 2018 11:46:42 +0100 Subject: ASoC: rt5651: Remove unused rt5651_platform_data There are no in tree users of platform-data for the rt5651 codec driver, so lets remove support for it. Signed-off-by: Hans de Goede Signed-off-by: Mark Brown --- include/sound/rt5651.h | 8 -------- 1 file changed, 8 deletions(-) (limited to 'include/sound') diff --git a/include/sound/rt5651.h b/include/sound/rt5651.h index 18b79a761f10..1612462bf5ad 100644 --- a/include/sound/rt5651.h +++ b/include/sound/rt5651.h @@ -18,12 +18,4 @@ enum rt5651_jd_src { RT5651_JD2, }; -struct rt5651_platform_data { - /* IN2 can optionally be differential */ - bool in2_diff; - - bool dmic_en; - enum rt5651_jd_src jd_src; -}; - #endif -- cgit From f0c2a330d99ef81519dc809d8b6a7dafe39b0933 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Sun, 4 Mar 2018 15:35:51 +0100 Subject: ASoC: rt5651: Configure jack-detect source through a device-property Configure the jack-detect source through a device-property which can be set by code outside of the codec driver. Rather then putting platform specific DMI quirks inside the generic codec driver. Signed-off-by: Hans de Goede Signed-off-by: Mark Brown --- include/sound/rt5651.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include/sound') diff --git a/include/sound/rt5651.h b/include/sound/rt5651.h index 1612462bf5ad..725b36c329d0 100644 --- a/include/sound/rt5651.h +++ b/include/sound/rt5651.h @@ -11,6 +11,10 @@ #ifndef __LINUX_SND_RT5651_H #define __LINUX_SND_RT5651_H +/* + * Note these MUST match the values from the DT binding: + * Documentation/devicetree/bindings/sound/rt5651.txt + */ enum rt5651_jd_src { RT5651_JD_NULL, RT5651_JD1_1, -- cgit From e6eb0207597afa1cdd4914a17a727b101cc859ff Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Sun, 4 Mar 2018 15:35:53 +0100 Subject: ASoC: rt5651: Allow specifying the OVCD scale-factor through a device-property OVer-Current-Detection (OVCD) for the micbias current is used to detect if an inserted jack is a headset or headphones (mic shorted to ground). The threshold for at which current the OVCD triggers on the rt5651 is not only controlled by setting the absolute current limit, but also by setting a scale factor which applies to the limit. Testing has shown that we need to set both (depending on the board). This commit adds support for the sofar unused OVCD scale-factor register and adds support for specifying non-default values for it through the "realtek,over-current-scale-factor" device-property. Signed-off-by: Hans de Goede Signed-off-by: Mark Brown --- include/sound/rt5651.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'include/sound') diff --git a/include/sound/rt5651.h b/include/sound/rt5651.h index 725b36c329d0..6403b862fb9a 100644 --- a/include/sound/rt5651.h +++ b/include/sound/rt5651.h @@ -22,4 +22,15 @@ enum rt5651_jd_src { RT5651_JD2, }; +/* + * Note these MUST match the values from the DT binding: + * Documentation/devicetree/bindings/sound/rt5651.txt + */ +enum rt5651_ovcd_sf { + RT5651_OVCD_SF_0P5, + RT5651_OVCD_SF_0P75, + RT5651_OVCD_SF_1P0, + RT5651_OVCD_SF_1P5, +}; + #endif -- cgit From fc8f7ea2d6c074baaad202c9187962bfa493ef13 Mon Sep 17 00:00:00 2001 From: Adam Thomson Date: Fri, 9 Mar 2018 16:25:43 +0000 Subject: ASoC: da7219: Add common clock usage for providing DAI clks There is a need to use DA7219 as DAI clock master for other codecs within a system, which means that the DAI clocks are required to remain, regardless of whether the codec is actually running playback/capture. To be able to expose control of the DAI clocking the common clock framework has been employed. The current implementation adds a simple clock gate for enabling and disabling the DAI clocks, with no rate control supported (this is still handled through standard hw_params() functions as before). If DT is enabled then the clock is added to the OF providers list, otherwise a clkdev lookup is used. Signed-off-by: Adam Thomson Signed-off-by: Mark Brown --- include/sound/da7219.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/sound') diff --git a/include/sound/da7219.h b/include/sound/da7219.h index 409ef1397fd3..1bfcb16f2d10 100644 --- a/include/sound/da7219.h +++ b/include/sound/da7219.h @@ -36,6 +36,8 @@ struct da7219_aad_pdata; struct da7219_pdata { bool wakeup_source; + const char *dai_clks_name; + /* Mic */ enum da7219_micbias_voltage micbias_lvl; enum da7219_mic_amp_in_sel mic_amp_in_sel; -- cgit From 946857636d279486eaa47c930930185631f28fce Mon Sep 17 00:00:00 2001 From: Sylwester Nawrocki Date: Fri, 9 Mar 2018 18:48:54 +0100 Subject: ASoC: Add snd_soc_of_put_dai_link_codecs() helper function The code for dereferencing device nodes in the 'codecs' array is moved to a separate function so we can avoid open coding that in drivers. Signed-off-by: Sylwester Nawrocki Signed-off-by: Mark Brown --- include/sound/soc.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/sound') diff --git a/include/sound/soc.h b/include/sound/soc.h index 747fd583b9dc..4a387f0b3d56 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h @@ -1807,6 +1807,7 @@ int snd_soc_of_get_dai_name(struct device_node *of_node, int snd_soc_of_get_dai_link_codecs(struct device *dev, struct device_node *of_node, struct snd_soc_dai_link *dai_link); +void snd_soc_of_put_dai_link_codecs(struct snd_soc_dai_link *dai_link); int snd_soc_add_dai_link(struct snd_soc_card *card, struct snd_soc_dai_link *dai_link); -- cgit From 0f2d4f162f4f54b431420df23122901a6ccd641e Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Mon, 12 Mar 2018 20:34:35 +0100 Subject: ASoC: rt5651: move definitions of dt-binding constants to include/dt-bindings Move the definitions of constants used in the dt-bindings from include/sound/rt5651.h to include/dt-bindings/sound/rt5651.h. As dt-bindings headers may also be parsed by the dt-compiler, they cannot use enums, only defines, so this commit also changes the code declaring the constants to use defines. Signed-off-by: Hans de Goede Signed-off-by: Mark Brown --- include/sound/rt5651.h | 36 ------------------------------------ 1 file changed, 36 deletions(-) delete mode 100644 include/sound/rt5651.h (limited to 'include/sound') diff --git a/include/sound/rt5651.h b/include/sound/rt5651.h deleted file mode 100644 index 6403b862fb9a..000000000000 --- a/include/sound/rt5651.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - * linux/sound/rt286.h -- Platform data for RT286 - * - * Copyright 2013 Realtek Microelectronics - * - * 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_RT5651_H -#define __LINUX_SND_RT5651_H - -/* - * Note these MUST match the values from the DT binding: - * Documentation/devicetree/bindings/sound/rt5651.txt - */ -enum rt5651_jd_src { - RT5651_JD_NULL, - RT5651_JD1_1, - RT5651_JD1_2, - RT5651_JD2, -}; - -/* - * Note these MUST match the values from the DT binding: - * Documentation/devicetree/bindings/sound/rt5651.txt - */ -enum rt5651_ovcd_sf { - RT5651_OVCD_SF_0P5, - RT5651_OVCD_SF_0P75, - RT5651_OVCD_SF_1P0, - RT5651_OVCD_SF_1P5, -}; - -#endif -- cgit From 2e78a5562ebc2e4bbdfd7f7729385b3acc94c36e Mon Sep 17 00:00:00 2001 From: Olivier Moysan Date: Tue, 13 Mar 2018 17:27:08 +0100 Subject: ASoC: dmaengine_pcm: document process callback Add missing description of process callback. Fixes: 78648092ef46 ("ASoC: dmaengine_pcm: add processing support") Signed-off-by: Olivier Moysan Signed-off-by: Mark Brown --- include/sound/dmaengine_pcm.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/sound') diff --git a/include/sound/dmaengine_pcm.h b/include/sound/dmaengine_pcm.h index 47ef486852ed..e3481eebdd98 100644 --- a/include/sound/dmaengine_pcm.h +++ b/include/sound/dmaengine_pcm.h @@ -118,6 +118,8 @@ void snd_dmaengine_pcm_set_config_from_dai_data( * PCM substream. Will be called from the PCM drivers hwparams callback. * @compat_request_channel: Callback to request a DMA channel for platforms * which do not use devicetree. + * @process: Callback used to apply processing on samples transferred from/to + * user space. * @compat_filter_fn: Will be used as the filter function when requesting a * channel for platforms which do not use devicetree. The filter parameter * will be the DAI's DMA data. -- cgit From 5b2d15bbd1eeb3d787c8e6459a8cb2645f336050 Mon Sep 17 00:00:00 2001 From: Srinivas Kandagatla Date: Sat, 10 Mar 2018 02:37:27 +0000 Subject: ASoC: dapm: add support to pinctrl dapm Purpose of having pinctrl dapm is to dynamically put the pins in low power state when they are not actively used by the audio and saving power. Without this each driver has to set the pinctrl states, either during probe or dynamically depending on the callbacks received from ASoC core. Signed-off-by: Srinivas Kandagatla Signed-off-by: Mark Brown --- include/sound/soc-dapm.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'include/sound') diff --git a/include/sound/soc-dapm.h b/include/sound/soc-dapm.h index 344b96c206a3..a6ce2de4e20a 100644 --- a/include/sound/soc-dapm.h +++ b/include/sound/soc-dapm.h @@ -269,6 +269,13 @@ struct device; .reg = SND_SOC_NOPM, .shift = wdelay, .event = dapm_regulator_event, \ .event_flags = SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD, \ .on_val = wflags} +#define SND_SOC_DAPM_PINCTRL(wname, active, sleep) \ +{ .id = snd_soc_dapm_pinctrl, .name = wname, \ + .priv = (&(struct snd_soc_dapm_pinctrl_priv) \ + { .active_state = active, .sleep_state = sleep,}), \ + .reg = SND_SOC_NOPM, .event = dapm_pinctrl_event, \ + .event_flags = SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD } + /* dapm kcontrol types */ @@ -374,6 +381,8 @@ int dapm_regulator_event(struct snd_soc_dapm_widget *w, struct snd_kcontrol *kcontrol, int event); int dapm_clock_event(struct snd_soc_dapm_widget *w, struct snd_kcontrol *kcontrol, int event); +int dapm_pinctrl_event(struct snd_soc_dapm_widget *w, + struct snd_kcontrol *kcontrol, int event); /* dapm controls */ int snd_soc_dapm_put_volsw(struct snd_kcontrol *kcontrol, @@ -500,6 +509,7 @@ enum snd_soc_dapm_type { snd_soc_dapm_pre, /* machine specific pre widget - exec first */ snd_soc_dapm_post, /* machine specific post widget - exec last */ snd_soc_dapm_supply, /* power/clock supply */ + snd_soc_dapm_pinctrl, /* pinctrl */ snd_soc_dapm_regulator_supply, /* external regulator */ snd_soc_dapm_clock_supply, /* external clock */ snd_soc_dapm_aif_in, /* audio interface input */ @@ -581,6 +591,7 @@ struct snd_soc_dapm_widget { void *priv; /* widget specific data */ struct regulator *regulator; /* attached regulator */ + struct pinctrl *pinctrl; /* attached pinctrl */ const struct snd_soc_pcm_stream *params; /* params for dai links */ unsigned int num_params; /* number of params for dai links */ unsigned int params_select; /* currently selected param for dai link */ @@ -683,6 +694,11 @@ struct snd_soc_dapm_stats { int neighbour_checks; }; +struct snd_soc_dapm_pinctrl_priv { + const char *active_state; + const char *sleep_state; +}; + /** * snd_soc_dapm_init_bias_level() - Initialize DAPM bias level * @dapm: The DAPM context to initialize -- cgit