diff options
| author | Takashi Iwai <tiwai@suse.de> | 2014-06-03 05:51:14 -0400 |
|---|---|---|
| committer | Takashi Iwai <tiwai@suse.de> | 2014-06-03 05:51:14 -0400 |
| commit | 8743dcd6639c28204ac03fb3e9db7932e3d85418 (patch) | |
| tree | 53b80846cf6731ddb196d522ed2bbf0f76da8344 /include/sound | |
| parent | efd4b76ef789541e7046e873b3546209352cdb59 (diff) | |
| parent | e1d4d3c854f25cff6c6c139588570e124d5e8fa4 (diff) | |
Merge tag 'asoc-v3.16-2' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-next
ASoC: Final updates for v3.16
A few more updates from the last week of development, nothing too
exciting. Highlights include:
- GPIO descriptor support for jacks
- More updates and fixes to the Freescale SSI, Intel and rsnd drivers.
- New drivers for Analog Devices ADAU1361, ADAU1381, ADAU1761 and
ADAU1781, and Realtek RT5677.
Diffstat (limited to 'include/sound')
| -rw-r--r-- | include/sound/omap-pcm.h | 30 | ||||
| -rw-r--r-- | include/sound/rt5677.h | 21 | ||||
| -rw-r--r-- | include/sound/soc.h | 49 |
3 files changed, 98 insertions, 2 deletions
diff --git a/include/sound/omap-pcm.h b/include/sound/omap-pcm.h new file mode 100644 index 000000000000..c1d2f31d71e9 --- /dev/null +++ b/include/sound/omap-pcm.h | |||
| @@ -0,0 +1,30 @@ | |||
| 1 | /* | ||
| 2 | * omap-pcm.h - OMAP PCM driver | ||
| 3 | * | ||
| 4 | * Copyright (C) 2014 Texas Instruments, Inc. | ||
| 5 | * | ||
| 6 | * Author: Peter Ujfalusi <peter.ujfalusi@ti.com> | ||
| 7 | * | ||
| 8 | * This program is free software; you can redistribute it and/or | ||
| 9 | * modify it under the terms of the GNU General Public License | ||
| 10 | * version 2 as published by the Free Software Foundation. | ||
| 11 | * | ||
| 12 | * This program is distributed in the hope that it will be useful, but | ||
| 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 15 | * General Public License for more details. | ||
| 16 | */ | ||
| 17 | |||
| 18 | #ifndef __OMAP_PCM_H__ | ||
| 19 | #define __OMAP_PCM_H__ | ||
| 20 | |||
| 21 | #if IS_ENABLED(CONFIG_SND_OMAP_SOC) | ||
| 22 | int omap_pcm_platform_register(struct device *dev); | ||
| 23 | #else | ||
| 24 | static inline int omap_pcm_platform_register(struct device *dev) | ||
| 25 | { | ||
| 26 | return 0; | ||
| 27 | } | ||
| 28 | #endif /* CONFIG_SND_OMAP_SOC */ | ||
| 29 | |||
| 30 | #endif /* __OMAP_PCM_H__ */ | ||
diff --git a/include/sound/rt5677.h b/include/sound/rt5677.h new file mode 100644 index 000000000000..3da14313bcfc --- /dev/null +++ b/include/sound/rt5677.h | |||
| @@ -0,0 +1,21 @@ | |||
| 1 | /* | ||
| 2 | * linux/sound/rt5677.h -- Platform data for RT5677 | ||
| 3 | * | ||
| 4 | * Copyright 2013 Realtek Semiconductor Corp. | ||
| 5 | * Author: Oder Chiou <oder_chiou@realtek.com> | ||
| 6 | * | ||
| 7 | * This program is free software; you can redistribute it and/or modify | ||
| 8 | * it under the terms of the GNU General Public License version 2 as | ||
| 9 | * published by the Free Software Foundation. | ||
| 10 | */ | ||
| 11 | |||
| 12 | #ifndef __LINUX_SND_RT5677_H | ||
| 13 | #define __LINUX_SND_RT5677_H | ||
| 14 | |||
| 15 | struct rt5677_platform_data { | ||
| 16 | /* IN1 IN2 can optionally be differential */ | ||
| 17 | bool in1_diff; | ||
| 18 | bool in2_diff; | ||
| 19 | }; | ||
| 20 | |||
| 21 | #endif | ||
diff --git a/include/sound/soc.h b/include/sound/soc.h index dcdcc95efd1d..ed9e2d7e5fdc 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h | |||
| @@ -452,6 +452,9 @@ int snd_soc_jack_get_type(struct snd_soc_jack *jack, int micbias_voltage); | |||
| 452 | #ifdef CONFIG_GPIOLIB | 452 | #ifdef CONFIG_GPIOLIB |
| 453 | int snd_soc_jack_add_gpios(struct snd_soc_jack *jack, int count, | 453 | int snd_soc_jack_add_gpios(struct snd_soc_jack *jack, int count, |
| 454 | struct snd_soc_jack_gpio *gpios); | 454 | struct snd_soc_jack_gpio *gpios); |
| 455 | int snd_soc_jack_add_gpiods(struct device *gpiod_dev, | ||
| 456 | struct snd_soc_jack *jack, | ||
| 457 | int count, struct snd_soc_jack_gpio *gpios); | ||
| 455 | void snd_soc_jack_free_gpios(struct snd_soc_jack *jack, int count, | 458 | void snd_soc_jack_free_gpios(struct snd_soc_jack *jack, int count, |
| 456 | struct snd_soc_jack_gpio *gpios); | 459 | struct snd_soc_jack_gpio *gpios); |
| 457 | #else | 460 | #else |
| @@ -461,6 +464,14 @@ static inline int snd_soc_jack_add_gpios(struct snd_soc_jack *jack, int count, | |||
| 461 | return 0; | 464 | return 0; |
| 462 | } | 465 | } |
| 463 | 466 | ||
| 467 | static inline int snd_soc_jack_add_gpiods(struct device *gpiod_dev, | ||
| 468 | struct snd_soc_jack *jack, | ||
| 469 | int count, | ||
| 470 | struct snd_soc_jack_gpio *gpios) | ||
| 471 | { | ||
| 472 | return 0; | ||
| 473 | } | ||
| 474 | |||
| 464 | static inline void snd_soc_jack_free_gpios(struct snd_soc_jack *jack, int count, | 475 | static inline void snd_soc_jack_free_gpios(struct snd_soc_jack *jack, int count, |
| 465 | struct snd_soc_jack_gpio *gpios) | 476 | struct snd_soc_jack_gpio *gpios) |
| 466 | { | 477 | { |
| @@ -587,8 +598,12 @@ struct snd_soc_jack_zone { | |||
| 587 | /** | 598 | /** |
| 588 | * struct snd_soc_jack_gpio - Describes a gpio pin for jack detection | 599 | * struct snd_soc_jack_gpio - Describes a gpio pin for jack detection |
| 589 | * | 600 | * |
| 590 | * @gpio: gpio number | 601 | * @gpio: legacy gpio number |
| 591 | * @name: gpio name | 602 | * @idx: gpio descriptor index within the function of the GPIO |
| 603 | * consumer device | ||
| 604 | * @gpiod_dev GPIO consumer device | ||
| 605 | * @name: gpio name. Also as connection ID for the GPIO consumer | ||
| 606 | * device function name lookup | ||
| 592 | * @report: value to report when jack detected | 607 | * @report: value to report when jack detected |
| 593 | * @invert: report presence in low state | 608 | * @invert: report presence in low state |
| 594 | * @debouce_time: debouce time in ms | 609 | * @debouce_time: debouce time in ms |
| @@ -599,6 +614,8 @@ struct snd_soc_jack_zone { | |||
| 599 | */ | 614 | */ |
| 600 | struct snd_soc_jack_gpio { | 615 | struct snd_soc_jack_gpio { |
| 601 | unsigned int gpio; | 616 | unsigned int gpio; |
| 617 | unsigned int idx; | ||
| 618 | struct device *gpiod_dev; | ||
| 602 | const char *name; | 619 | const char *name; |
| 603 | int report; | 620 | int report; |
| 604 | int invert; | 621 | int invert; |
| @@ -607,6 +624,7 @@ struct snd_soc_jack_gpio { | |||
| 607 | 624 | ||
| 608 | struct snd_soc_jack *jack; | 625 | struct snd_soc_jack *jack; |
| 609 | struct delayed_work work; | 626 | struct delayed_work work; |
| 627 | struct gpio_desc *desc; | ||
| 610 | 628 | ||
| 611 | void *data; | 629 | void *data; |
| 612 | int (*jack_status_check)(void *data); | 630 | int (*jack_status_check)(void *data); |
| @@ -1146,6 +1164,33 @@ static inline struct snd_soc_platform *snd_soc_component_to_platform( | |||
| 1146 | return container_of(component, struct snd_soc_platform, component); | 1164 | return container_of(component, struct snd_soc_platform, component); |
| 1147 | } | 1165 | } |
| 1148 | 1166 | ||
| 1167 | /** | ||
| 1168 | * snd_soc_dapm_to_codec() - Casts a DAPM context to the CODEC it is embedded in | ||
| 1169 | * @dapm: The DAPM context to cast to the CODEC | ||
| 1170 | * | ||
| 1171 | * This function must only be used on DAPM contexts that are known to be part of | ||
| 1172 | * a CODEC (e.g. in a CODEC driver). Otherwise the behavior is undefined. | ||
| 1173 | */ | ||
| 1174 | static inline struct snd_soc_codec *snd_soc_dapm_to_codec( | ||
| 1175 | struct snd_soc_dapm_context *dapm) | ||
| 1176 | { | ||
| 1177 | return container_of(dapm, struct snd_soc_codec, dapm); | ||
| 1178 | } | ||
| 1179 | |||
| 1180 | /** | ||
| 1181 | * snd_soc_dapm_to_platform() - Casts a DAPM context to the platform it is | ||
| 1182 | * embedded in | ||
| 1183 | * @dapm: The DAPM context to cast to the platform. | ||
| 1184 | * | ||
| 1185 | * This function must only be used on DAPM contexts that are known to be part of | ||
| 1186 | * a platform (e.g. in a platform driver). Otherwise the behavior is undefined. | ||
| 1187 | */ | ||
| 1188 | static inline struct snd_soc_platform *snd_soc_dapm_to_platform( | ||
| 1189 | struct snd_soc_dapm_context *dapm) | ||
| 1190 | { | ||
| 1191 | return container_of(dapm, struct snd_soc_platform, dapm); | ||
| 1192 | } | ||
| 1193 | |||
| 1149 | /* codec IO */ | 1194 | /* codec IO */ |
| 1150 | unsigned int snd_soc_read(struct snd_soc_codec *codec, unsigned int reg); | 1195 | unsigned int snd_soc_read(struct snd_soc_codec *codec, unsigned int reg); |
| 1151 | int snd_soc_write(struct snd_soc_codec *codec, unsigned int reg, | 1196 | int snd_soc_write(struct snd_soc_codec *codec, unsigned int reg, |
