aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2013-11-21 09:55:06 -0500
committerMark Brown <broonie@linaro.org>2013-11-25 12:12:15 -0500
commit8778ac6be25abf0496fc614a3e77ad2ff8300353 (patch)
tree57e9515e4a74e3105be919993a5ba573b47b8ea3
parent6ce4eac1f600b34f2f7f58f9cd8f0503d79e42ae (diff)
ASoC: Fix build without CONFIG_GPIOLIB
snd_soc_jack_gpio stuff is currently enabled for CONFIG_GPIOLIB explicitly with ifdef, and this causes build errors on some drivers such as: sound/soc/omap/rx51.c:220:33: error: array type has incomplete element type Remove ifdef and provide dummy functions for CONFIG_GPIOLIB=n case instead. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Mark Brown <broonie@linaro.org>
-rw-r--r--include/sound/soc.h15
1 files changed, 11 insertions, 4 deletions
diff --git a/include/sound/soc.h b/include/sound/soc.h
index 1f741cb24f33..f7e1fac51bba 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -334,9 +334,7 @@ struct snd_soc_jack_pin;
334#include <sound/soc-dapm.h> 334#include <sound/soc-dapm.h>
335#include <sound/soc-dpcm.h> 335#include <sound/soc-dpcm.h>
336 336
337#ifdef CONFIG_GPIOLIB
338struct snd_soc_jack_gpio; 337struct snd_soc_jack_gpio;
339#endif
340 338
341typedef int (*hw_write_t)(void *,const char* ,int); 339typedef int (*hw_write_t)(void *,const char* ,int);
342 340
@@ -446,6 +444,17 @@ int snd_soc_jack_add_gpios(struct snd_soc_jack *jack, int count,
446 struct snd_soc_jack_gpio *gpios); 444 struct snd_soc_jack_gpio *gpios);
447void snd_soc_jack_free_gpios(struct snd_soc_jack *jack, int count, 445void snd_soc_jack_free_gpios(struct snd_soc_jack *jack, int count,
448 struct snd_soc_jack_gpio *gpios); 446 struct snd_soc_jack_gpio *gpios);
447#else
448static inline int snd_soc_jack_add_gpios(struct snd_soc_jack *jack, int count,
449 struct snd_soc_jack_gpio *gpios)
450{
451 return 0;
452}
453
454static inline void snd_soc_jack_free_gpios(struct snd_soc_jack *jack, int count,
455 struct snd_soc_jack_gpio *gpios)
456{
457}
449#endif 458#endif
450 459
451/* codec register bit access */ 460/* codec register bit access */
@@ -580,7 +589,6 @@ struct snd_soc_jack_zone {
580 * to provide more complex checks (eg, reading an 589 * to provide more complex checks (eg, reading an
581 * ADC). 590 * ADC).
582 */ 591 */
583#ifdef CONFIG_GPIOLIB
584struct snd_soc_jack_gpio { 592struct snd_soc_jack_gpio {
585 unsigned int gpio; 593 unsigned int gpio;
586 const char *name; 594 const char *name;
@@ -594,7 +602,6 @@ struct snd_soc_jack_gpio {
594 602
595 int (*jack_status_check)(void); 603 int (*jack_status_check)(void);
596}; 604};
597#endif
598 605
599struct snd_soc_jack { 606struct snd_soc_jack {
600 struct mutex mutex; 607 struct mutex mutex;