From bb6fc620c2ed972f58a0174f64f8dbd22a5911b1 Mon Sep 17 00:00:00 2001 From: Kuninori Morimoto Date: Mon, 8 Aug 2016 05:59:56 +0000 Subject: ASoC: simple-card-utils: add asoc_simple_card_parse_clk() Current simple-card can get clock via DT clocks or "system-clock-frequency" property. This patch makes it simple style standard Signed-off-by: Kuninori Morimoto Signed-off-by: Mark Brown --- include/sound/simple_card_utils.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'include/sound') diff --git a/include/sound/simple_card_utils.h b/include/sound/simple_card_utils.h index 86088aed9002..1392eb56cf0e 100644 --- a/include/sound/simple_card_utils.h +++ b/include/sound/simple_card_utils.h @@ -33,4 +33,12 @@ int asoc_simple_card_set_dailink_name(struct device *dev, int asoc_simple_card_parse_card_name(struct snd_soc_card *card, char *prefix); +#define asoc_simple_card_parse_clk_cpu(node, dai_link, simple_dai) \ + asoc_simple_card_parse_clk(node, dai_link->cpu_of_node, simple_dai) +#define asoc_simple_card_parse_clk_codec(node, dai_link, simple_dai) \ + asoc_simple_card_parse_clk(node, dai_link->codec_of_node, simple_dai) +int asoc_simple_card_parse_clk(struct device_node *node, + struct device_node *dai_of_node, + struct asoc_simple_dai *simple_dai); + #endif /* __SIMPLE_CARD_CORE_H */ -- cgit v1.2.3 From ae30a694da4c37b4d0c8b750c9a4104d8da749b3 Mon Sep 17 00:00:00 2001 From: Kuninori Morimoto Date: Mon, 8 Aug 2016 06:01:43 +0000 Subject: ASoC: simple-card-utils: add asoc_simple_card_parse_dai() simple-card needs to get its dai name and endpoint node. This patch makes it simple style standard Signed-off-by: Kuninori Morimoto Signed-off-by: Mark Brown --- include/sound/simple_card_utils.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'include/sound') diff --git a/include/sound/simple_card_utils.h b/include/sound/simple_card_utils.h index 1392eb56cf0e..62b392695d2d 100644 --- a/include/sound/simple_card_utils.h +++ b/include/sound/simple_card_utils.h @@ -41,4 +41,21 @@ int asoc_simple_card_parse_clk(struct device_node *node, struct device_node *dai_of_node, struct asoc_simple_dai *simple_dai); +#define asoc_simple_card_parse_cpu(node, dai_link, \ + list_name, cells_name, is_single_link) \ + asoc_simple_card_parse_dai(node, &dai_link->cpu_of_node, \ + &dai_link->cpu_dai_name, list_name, cells_name, is_single_link) +#define asoc_simple_card_parse_codec(node, dai_link, list_name, cells_name) \ + asoc_simple_card_parse_dai(node, &dai_link->codec_of_node, \ + &dai_link->codec_dai_name, list_name, cells_name, NULL) +#define asoc_simple_card_parse_platform(node, dai_link, list_name, cells_name) \ + asoc_simple_card_parse_dai(node, &dai_link->platform_of_node, \ + NULL, list_name, cells_name, NULL) +int asoc_simple_card_parse_dai(struct device_node *node, + struct device_node **endpoint_np, + const char **dai_name, + const char *list_name, + const char *cells_name, + int *is_single_links); + #endif /* __SIMPLE_CARD_CORE_H */ -- cgit v1.2.3 From 0306741004fdfc2bc515b4b129b1f86881c5fcf5 Mon Sep 17 00:00:00 2001 From: Sylwester Nawrocki Date: Thu, 4 Aug 2016 15:38:41 +0200 Subject: ASoC: L3 bus: Add default gpio ops This adds aptional GPIO bit-bang based callback implementations for setting CLK, DATA and MODE L3 bus lines. It is added here to avoid possible duplicate implementations across users of the bus. Signed-off-by: Sylwester Nawrocki Signed-off-by: Mark Brown --- include/sound/l3.h | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'include/sound') diff --git a/include/sound/l3.h b/include/sound/l3.h index 423a08f0f1b0..1471da22adad 100644 --- a/include/sound/l3.h +++ b/include/sound/l3.h @@ -2,9 +2,15 @@ #define _L3_H_ 1 struct l3_pins { - void (*setdat)(int); - void (*setclk)(int); - void (*setmode)(int); + void (*setdat)(struct l3_pins *, int); + void (*setclk)(struct l3_pins *, int); + void (*setmode)(struct l3_pins *, int); + + int gpio_data; + int gpio_clk; + int gpio_mode; + int use_gpios; + int data_hold; int data_setup; int clock_high; @@ -13,6 +19,9 @@ struct l3_pins { int mode_setup; }; +struct device; + int l3_write(struct l3_pins *adap, u8 addr, u8 *data, int len); +int l3_set_gpio_ops(struct device *dev, struct l3_pins *adap); #endif -- cgit v1.2.3 From 84c5c20395a8e4ca2043136e1f0d128cf758244b Mon Sep 17 00:00:00 2001 From: Sylwester Nawrocki Date: Thu, 4 Aug 2016 15:38:44 +0200 Subject: ASoC: s3c24xx_uda134x: Remove unused power() callback The power() callback has always been empty so just remove it. Signed-off-by: Sylwester Nawrocki Signed-off-by: Mark Brown --- include/sound/s3c24xx_uda134x.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include/sound') diff --git a/include/sound/s3c24xx_uda134x.h b/include/sound/s3c24xx_uda134x.h index 33df4cb909d3..ffaf1f098c8e 100644 --- a/include/sound/s3c24xx_uda134x.h +++ b/include/sound/s3c24xx_uda134x.h @@ -7,7 +7,6 @@ struct s3c24xx_uda134x_platform_data { int l3_clk; int l3_mode; int l3_data; - void (*power) (int); int model; }; -- cgit v1.2.3 From 8073aefa60823acf205a1e6a5ea118297179d766 Mon Sep 17 00:00:00 2001 From: Kuninori Morimoto Date: Mon, 8 Aug 2016 09:36:49 +0000 Subject: ASoC: remove codec duplicated callback function codec driver and component driver has duplicated callback functions, and codec side functions are just copied to component side when register timing. This was quick-hack, but no longer needed. This patch removes codec side duplicated callback function. Signed-off-by: Kuninori Morimoto Signed-off-by: Mark Brown --- include/sound/soc.h | 8 -------- 1 file changed, 8 deletions(-) (limited to 'include/sound') diff --git a/include/sound/soc.h b/include/sound/soc.h index 6144882cc96a..5eb2b38c3437 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h @@ -898,14 +898,6 @@ struct snd_soc_codec_driver { int (*resume)(struct snd_soc_codec *); struct snd_soc_component_driver component_driver; - /* 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; - int num_dapm_routes; - /* codec wide operations */ int (*set_sysclk)(struct snd_soc_codec *codec, int clk_id, int source, unsigned int freq, int dir); -- cgit v1.2.3 From 1e814030954015e42621191f3adc52df2241dc08 Mon Sep 17 00:00:00 2001 From: Kuninori Morimoto Date: Mon, 1 Aug 2016 06:11:36 +0000 Subject: ASoC: remove snd_soc_pcm_set/get_drvdata() snd_soc_pcm_set_drvdata() will set driver data to rtd->dev, but driver data of rtd->dev is already used as "rtd" on soc_post_component_init(). static int soc_post_component_init(xxx) { ... dev_set_drvdata(rtd->dev, rtd); ... } To remove confusion, this patch removes snd_soc_pcm_set/get_drvdata(). Signed-off-by: Kuninori Morimoto Signed-off-by: Mark Brown --- include/sound/soc.h | 11 ----------- 1 file changed, 11 deletions(-) (limited to 'include/sound') diff --git a/include/sound/soc.h b/include/sound/soc.h index 6144882cc96a..bc953994acb9 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h @@ -1547,17 +1547,6 @@ static inline void *snd_soc_platform_get_drvdata(struct snd_soc_platform *platfo return snd_soc_component_get_drvdata(&platform->component); } -static inline void snd_soc_pcm_set_drvdata(struct snd_soc_pcm_runtime *rtd, - void *data) -{ - dev_set_drvdata(rtd->dev, data); -} - -static inline void *snd_soc_pcm_get_drvdata(struct snd_soc_pcm_runtime *rtd) -{ - return dev_get_drvdata(rtd->dev); -} - static inline void snd_soc_initialize_card_lists(struct snd_soc_card *card) { INIT_LIST_HEAD(&card->codec_dev_list); -- cgit v1.2.3 From 21ba62f849a20accf7d41e3056ea8913bc23cfb1 Mon Sep 17 00:00:00 2001 From: Kuninori Morimoto Date: Tue, 9 Aug 2016 05:48:30 +0000 Subject: ASoC: simple-card-utils: add asoc_simple_card_init_dai() simple-card is supporting clock/tdm slot initialization. This patch makes this method simple style standard. Signed-off-by: Kuninori Morimoto Signed-off-by: Mark Brown --- include/sound/simple_card_utils.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/sound') diff --git a/include/sound/simple_card_utils.h b/include/sound/simple_card_utils.h index 62b392695d2d..13168e029232 100644 --- a/include/sound/simple_card_utils.h +++ b/include/sound/simple_card_utils.h @@ -58,4 +58,6 @@ int asoc_simple_card_parse_dai(struct device_node *node, const char *cells_name, int *is_single_links); +int asoc_simple_card_init_dai(struct snd_soc_dai *dai, + struct asoc_simple_dai *simple_dai); #endif /* __SIMPLE_CARD_CORE_H */ -- cgit v1.2.3 From c262c9ab7a956b15c4c12b81472502a587d0dfcd Mon Sep 17 00:00:00 2001 From: Kuninori Morimoto Date: Tue, 9 Aug 2016 05:49:41 +0000 Subject: ASoC: simple-card-utils: add asoc_simple_card_canonicalize_dailink() simple-card is assuming that sometimes platform and cpu are same. This patch makes this method simple style standard. Signed-off-by: Kuninori Morimoto Signed-off-by: Mark Brown --- include/sound/simple_card_utils.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include/sound') diff --git a/include/sound/simple_card_utils.h b/include/sound/simple_card_utils.h index 13168e029232..a71d46a95ca8 100644 --- a/include/sound/simple_card_utils.h +++ b/include/sound/simple_card_utils.h @@ -60,4 +60,7 @@ int asoc_simple_card_parse_dai(struct device_node *node, int asoc_simple_card_init_dai(struct snd_soc_dai *dai, struct asoc_simple_dai *simple_dai); + +int asoc_simple_card_canonicalize_dailink(struct snd_soc_dai_link *dai_link); + #endif /* __SIMPLE_CARD_CORE_H */ -- cgit v1.2.3 From 983cebd602af8c2bf9d5830f15fb4e18fb38f994 Mon Sep 17 00:00:00 2001 From: Kuninori Morimoto Date: Wed, 10 Aug 2016 02:20:19 +0000 Subject: ASoC: simple-card-utils: add asoc_simple_card_canonicalize_cpu() simple-card needs remove dai_link->cpu_dai_name if it CPU was single DAI. This patch makes this method simple style standard. Signed-off-by: Kuninori Morimoto Signed-off-by: Mark Brown --- include/sound/simple_card_utils.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/sound') diff --git a/include/sound/simple_card_utils.h b/include/sound/simple_card_utils.h index a71d46a95ca8..f760f559393e 100644 --- a/include/sound/simple_card_utils.h +++ b/include/sound/simple_card_utils.h @@ -62,5 +62,7 @@ int asoc_simple_card_init_dai(struct snd_soc_dai *dai, struct asoc_simple_dai *simple_dai); int asoc_simple_card_canonicalize_dailink(struct snd_soc_dai_link *dai_link); +void asoc_simple_card_canonicalize_cpu(struct snd_soc_dai_link *dai_link, + int is_single_links); #endif /* __SIMPLE_CARD_CORE_H */ -- cgit v1.2.3 From 0f4e0711b735a148cb6da0e6f91253b62fc2c5b2 Mon Sep 17 00:00:00 2001 From: Kuninori Morimoto Date: Wed, 10 Aug 2016 02:21:25 +0000 Subject: ASoC: simple-card-utils: add asoc_simple_card_clean_reference() simple-card needs to decrease the reference count of the device nodes. This patch makes this method simple style standard. Signed-off-by: Kuninori Morimoto Signed-off-by: Mark Brown --- include/sound/simple_card_utils.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/sound') diff --git a/include/sound/simple_card_utils.h b/include/sound/simple_card_utils.h index f760f559393e..403ec92164fc 100644 --- a/include/sound/simple_card_utils.h +++ b/include/sound/simple_card_utils.h @@ -65,4 +65,6 @@ int asoc_simple_card_canonicalize_dailink(struct snd_soc_dai_link *dai_link); void asoc_simple_card_canonicalize_cpu(struct snd_soc_dai_link *dai_link, int is_single_links); +int asoc_simple_card_clean_reference(struct snd_soc_card *card); + #endif /* __SIMPLE_CARD_CORE_H */ -- cgit v1.2.3 From e5668caec5698f14f310fb06bb39595b21d2fe4a Mon Sep 17 00:00:00 2001 From: Nicolas Iooss Date: Tue, 23 Aug 2016 10:51:22 +0200 Subject: ASoC: simple-card-utils: add __printf attribute asoc_simple_card_set_dailink_name() uses devm_kvasprintf() to format some of its arguments. Adding a __printf attribute to this function makes it possible to detect at compile-time errors related to format strings. Signed-off-by: Nicolas Iooss Signed-off-by: Mark Brown --- include/sound/simple_card_utils.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/sound') diff --git a/include/sound/simple_card_utils.h b/include/sound/simple_card_utils.h index 403ec92164fc..fd6412551145 100644 --- a/include/sound/simple_card_utils.h +++ b/include/sound/simple_card_utils.h @@ -27,6 +27,7 @@ int asoc_simple_card_parse_daifmt(struct device *dev, struct device_node *codec, char *prefix, unsigned int *retfmt); +__printf(3, 4) int asoc_simple_card_set_dailink_name(struct device *dev, struct snd_soc_dai_link *dai_link, const char *fmt, ...); -- cgit v1.2.3 From 2b26dd4c1fc5f83bc088f4a053120ca03817045e Mon Sep 17 00:00:00 2001 From: Oder Chiou Date: Mon, 19 Sep 2016 19:26:08 +0800 Subject: ASoC: rt5660: add rt5660 codec driver This is the initial codec driver for rt5660 Signed-off-by: Oder Chiou Signed-off-by: Mark Brown --- include/sound/rt5660.h | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 include/sound/rt5660.h (limited to 'include/sound') diff --git a/include/sound/rt5660.h b/include/sound/rt5660.h new file mode 100644 index 000000000000..065f83a24db6 --- /dev/null +++ b/include/sound/rt5660.h @@ -0,0 +1,31 @@ +/* + * linux/sound/rt5660.h -- Platform data for RT5660 + * + * Copyright 2016 Realtek Semiconductor Corp. + * Author: Oder Chiou + * + * 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_RT5660_H +#define __LINUX_SND_RT5660_H + +enum rt5660_dmic1_data_pin { + RT5660_DMIC1_NULL, + RT5660_DMIC1_DATA_GPIO2, + RT5660_DMIC1_DATA_IN1P, +}; + +struct rt5660_platform_data { + /* IN1 & IN3 can optionally be differential */ + bool in1_diff; + bool in3_diff; + bool use_ldo2; + bool poweroff_codec_in_suspend; + + enum rt5660_dmic1_data_pin dmic1_data_pin; +}; + +#endif -- cgit v1.2.3 From bb0c35fcaf8f2ad3383dd43ca8abf5203cd06cc3 Mon Sep 17 00:00:00 2001 From: Adam Thomson Date: Mon, 26 Sep 2016 14:29:21 +0100 Subject: ASoC: da7219: Disable AAD if codec is not a wake-up source Currently if AAD is enabled in the device, during system suspend the feature remains, regardless of whether the codec is a wake-up source or not. This means some additional power is being used which is unnecessary, and can causes issues with some platforms' IRQ handlers where state changes during system suspend aren't captured. This patch updates the driver to disable AAD during suspend, if we're not a wake-up source, and then re-enables this on resume. 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 02876acdc840..409ef1397fd3 100644 --- a/include/sound/da7219.h +++ b/include/sound/da7219.h @@ -34,6 +34,8 @@ enum da7219_mic_amp_in_sel { struct da7219_aad_pdata; struct da7219_pdata { + bool wakeup_source; + /* Mic */ enum da7219_micbias_voltage micbias_lvl; enum da7219_mic_amp_in_sel mic_amp_in_sel; -- cgit v1.2.3