Skip to content

Commit

Permalink
ASoC: Fix build without CONFIG_GPIOLIB
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Takashi Iwai authored and Mark Brown committed Nov 25, 2013
1 parent 6ce4eac commit 8778ac6
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions include/sound/soc.h
Original file line number Diff line number Diff line change
Expand Up @@ -334,9 +334,7 @@ struct snd_soc_jack_pin;
#include <sound/soc-dapm.h>
#include <sound/soc-dpcm.h>

#ifdef CONFIG_GPIOLIB
struct snd_soc_jack_gpio;
#endif

typedef int (*hw_write_t)(void *,const char* ,int);

Expand Down Expand Up @@ -446,6 +444,17 @@ int snd_soc_jack_add_gpios(struct snd_soc_jack *jack, int count,
struct snd_soc_jack_gpio *gpios);
void snd_soc_jack_free_gpios(struct snd_soc_jack *jack, int count,
struct snd_soc_jack_gpio *gpios);
#else
static inline int snd_soc_jack_add_gpios(struct snd_soc_jack *jack, int count,
struct snd_soc_jack_gpio *gpios)
{
return 0;
}

static inline void snd_soc_jack_free_gpios(struct snd_soc_jack *jack, int count,
struct snd_soc_jack_gpio *gpios)
{
}
#endif

/* codec register bit access */
Expand Down Expand Up @@ -580,7 +589,6 @@ struct snd_soc_jack_zone {
* to provide more complex checks (eg, reading an
* ADC).
*/
#ifdef CONFIG_GPIOLIB
struct snd_soc_jack_gpio {
unsigned int gpio;
const char *name;
Expand All @@ -594,7 +602,6 @@ struct snd_soc_jack_gpio {

int (*jack_status_check)(void);
};
#endif

struct snd_soc_jack {
struct mutex mutex;
Expand Down

0 comments on commit 8778ac6

Please sign in to comment.