aboutsummaryrefslogtreecommitdiffstats
path: root/include/sound/soc.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/sound/soc.h')
-rw-r--r--include/sound/soc.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/include/sound/soc.h b/include/sound/soc.h
index 0e7735264169..a40bc6f316fc 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -16,6 +16,8 @@
16#include <linux/platform_device.h> 16#include <linux/platform_device.h>
17#include <linux/types.h> 17#include <linux/types.h>
18#include <linux/workqueue.h> 18#include <linux/workqueue.h>
19#include <linux/interrupt.h>
20#include <linux/kernel.h>
19#include <sound/core.h> 21#include <sound/core.h>
20#include <sound/pcm.h> 22#include <sound/pcm.h>
21#include <sound/control.h> 23#include <sound/control.h>
@@ -168,6 +170,9 @@ struct soc_enum;
168struct snd_soc_ac97_ops; 170struct snd_soc_ac97_ops;
169struct snd_soc_jack; 171struct snd_soc_jack;
170struct snd_soc_jack_pin; 172struct snd_soc_jack_pin;
173#ifdef CONFIG_GPIOLIB
174struct snd_soc_jack_gpio;
175#endif
171 176
172typedef int (*hw_write_t)(void *,const char* ,int); 177typedef int (*hw_write_t)(void *,const char* ,int);
173typedef int (*hw_read_t)(void *,char* ,int); 178typedef int (*hw_read_t)(void *,char* ,int);
@@ -194,6 +199,12 @@ int snd_soc_jack_new(struct snd_soc_card *card, const char *id, int type,
194void snd_soc_jack_report(struct snd_soc_jack *jack, int status, int mask); 199void snd_soc_jack_report(struct snd_soc_jack *jack, int status, int mask);
195int snd_soc_jack_add_pins(struct snd_soc_jack *jack, int count, 200int snd_soc_jack_add_pins(struct snd_soc_jack *jack, int count,
196 struct snd_soc_jack_pin *pins); 201 struct snd_soc_jack_pin *pins);
202#ifdef CONFIG_GPIOLIB
203int snd_soc_jack_add_gpios(struct snd_soc_jack *jack, int count,
204 struct snd_soc_jack_gpio *gpios);
205void snd_soc_jack_free_gpios(struct snd_soc_jack *jack, int count,
206 struct snd_soc_jack_gpio *gpios);
207#endif
197 208
198/* codec IO */ 209/* codec IO */
199#define snd_soc_read(codec, reg) codec->read(codec, reg) 210#define snd_soc_read(codec, reg) codec->read(codec, reg)
@@ -264,6 +275,27 @@ struct snd_soc_jack_pin {
264 bool invert; 275 bool invert;
265}; 276};
266 277
278/**
279 * struct snd_soc_jack_gpio - Describes a gpio pin for jack detection
280 *
281 * @gpio: gpio number
282 * @name: gpio name
283 * @report: value to report when jack detected
284 * @invert: report presence in low state
285 * @debouce_time: debouce time in ms
286 */
287#ifdef CONFIG_GPIOLIB
288struct snd_soc_jack_gpio {
289 unsigned int gpio;
290 const char *name;
291 int report;
292 int invert;
293 int debounce_time;
294 struct snd_soc_jack *jack;
295 struct work_struct work;
296};
297#endif
298
267struct snd_soc_jack { 299struct snd_soc_jack {
268 struct snd_jack *jack; 300 struct snd_jack *jack;
269 struct snd_soc_card *card; 301 struct snd_soc_card *card;