diff options
author | Vinod Koul <vinod.koul@intel.com> | 2011-02-09 04:14:17 -0500 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-02-09 18:02:43 -0500 |
commit | fa9879edebdaad4cfcd2dbe3eaa2ba0dc4f0a262 (patch) | |
tree | 47032fd4e879f7390999b180f0557261647742f8 /include/sound | |
parent | 866fd9366a5b2c7d17eb10f7e7b1c17393ed0beb (diff) |
ASoC: add support for multiple jack types
This patch adds soc-jack support for adding voltage zones and for
detecting jack type
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Harsha Priya <priya.harsha@intel.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'include/sound')
-rw-r--r-- | include/sound/soc.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/include/sound/soc.h b/include/sound/soc.h index 4b6c0a8c332f..4ccf1e4e0dd0 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h | |||
@@ -234,6 +234,7 @@ struct snd_soc_codec; | |||
234 | struct snd_soc_codec_driver; | 234 | struct snd_soc_codec_driver; |
235 | struct soc_enum; | 235 | struct soc_enum; |
236 | struct snd_soc_jack; | 236 | struct snd_soc_jack; |
237 | struct snd_soc_jack_zone; | ||
237 | struct snd_soc_jack_pin; | 238 | struct snd_soc_jack_pin; |
238 | struct snd_soc_cache_ops; | 239 | struct snd_soc_cache_ops; |
239 | #include <sound/soc-dapm.h> | 240 | #include <sound/soc-dapm.h> |
@@ -307,6 +308,9 @@ void snd_soc_jack_notifier_register(struct snd_soc_jack *jack, | |||
307 | struct notifier_block *nb); | 308 | struct notifier_block *nb); |
308 | void snd_soc_jack_notifier_unregister(struct snd_soc_jack *jack, | 309 | void snd_soc_jack_notifier_unregister(struct snd_soc_jack *jack, |
309 | struct notifier_block *nb); | 310 | struct notifier_block *nb); |
311 | int snd_soc_jack_add_zones(struct snd_soc_jack *jack, int count, | ||
312 | struct snd_soc_jack_zone *zones); | ||
313 | int snd_soc_jack_get_type(struct snd_soc_jack *jack, int micbias_voltage); | ||
310 | #ifdef CONFIG_GPIOLIB | 314 | #ifdef CONFIG_GPIOLIB |
311 | int snd_soc_jack_add_gpios(struct snd_soc_jack *jack, int count, | 315 | int snd_soc_jack_add_gpios(struct snd_soc_jack *jack, int count, |
312 | struct snd_soc_jack_gpio *gpios); | 316 | struct snd_soc_jack_gpio *gpios); |
@@ -407,6 +411,24 @@ struct snd_soc_jack_pin { | |||
407 | }; | 411 | }; |
408 | 412 | ||
409 | /** | 413 | /** |
414 | * struct snd_soc_jack_zone - Describes voltage zones of jack detection | ||
415 | * | ||
416 | * @min_mv: start voltage in mv | ||
417 | * @max_mv: end voltage in mv | ||
418 | * @jack_type: type of jack that is expected for this voltage | ||
419 | * @debounce_time: debounce_time for jack, codec driver should wait for this | ||
420 | * duration before reading the adc for voltages | ||
421 | * @:list: list container | ||
422 | */ | ||
423 | struct snd_soc_jack_zone { | ||
424 | unsigned int min_mv; | ||
425 | unsigned int max_mv; | ||
426 | unsigned int jack_type; | ||
427 | unsigned int debounce_time; | ||
428 | struct list_head list; | ||
429 | }; | ||
430 | |||
431 | /** | ||
410 | * struct snd_soc_jack_gpio - Describes a gpio pin for jack detection | 432 | * struct snd_soc_jack_gpio - Describes a gpio pin for jack detection |
411 | * | 433 | * |
412 | * @gpio: gpio number | 434 | * @gpio: gpio number |
@@ -435,6 +457,7 @@ struct snd_soc_jack { | |||
435 | struct list_head pins; | 457 | struct list_head pins; |
436 | int status; | 458 | int status; |
437 | struct blocking_notifier_head notifier; | 459 | struct blocking_notifier_head notifier; |
460 | struct list_head jack_zones; | ||
438 | }; | 461 | }; |
439 | 462 | ||
440 | /* SoC PCM stream information */ | 463 | /* SoC PCM stream information */ |