aboutsummaryrefslogtreecommitdiffstats
path: root/include/sound
diff options
context:
space:
mode:
Diffstat (limited to 'include/sound')
-rw-r--r--include/sound/control.h2
-rw-r--r--include/sound/cs4271.h24
-rw-r--r--include/sound/sh_fsi.h76
-rw-r--r--include/sound/soc-dapm.h16
-rw-r--r--include/sound/soc.h147
-rw-r--r--include/sound/tlv320aic32x4.h31
-rw-r--r--include/sound/wm8903.h30
-rw-r--r--include/sound/wm9081.h9
8 files changed, 255 insertions, 80 deletions
diff --git a/include/sound/control.h b/include/sound/control.h
index 7715e6f00d38..e67db2869360 100644
--- a/include/sound/control.h
+++ b/include/sound/control.h
@@ -115,6 +115,8 @@ int snd_ctl_add(struct snd_card * card, struct snd_kcontrol * kcontrol);
115int snd_ctl_remove(struct snd_card * card, struct snd_kcontrol * kcontrol); 115int snd_ctl_remove(struct snd_card * card, struct snd_kcontrol * kcontrol);
116int snd_ctl_remove_id(struct snd_card * card, struct snd_ctl_elem_id *id); 116int snd_ctl_remove_id(struct snd_card * card, struct snd_ctl_elem_id *id);
117int snd_ctl_rename_id(struct snd_card * card, struct snd_ctl_elem_id *src_id, struct snd_ctl_elem_id *dst_id); 117int snd_ctl_rename_id(struct snd_card * card, struct snd_ctl_elem_id *src_id, struct snd_ctl_elem_id *dst_id);
118int snd_ctl_activate_id(struct snd_card *card, struct snd_ctl_elem_id *id,
119 int active);
118struct snd_kcontrol *snd_ctl_find_numid(struct snd_card * card, unsigned int numid); 120struct snd_kcontrol *snd_ctl_find_numid(struct snd_card * card, unsigned int numid);
119struct snd_kcontrol *snd_ctl_find_id(struct snd_card * card, struct snd_ctl_elem_id *id); 121struct snd_kcontrol *snd_ctl_find_id(struct snd_card * card, struct snd_ctl_elem_id *id);
120 122
diff --git a/include/sound/cs4271.h b/include/sound/cs4271.h
new file mode 100644
index 000000000000..50a059e7d116
--- /dev/null
+++ b/include/sound/cs4271.h
@@ -0,0 +1,24 @@
1/*
2 * Definitions for CS4271 ASoC codec driver
3 *
4 * Copyright (c) 2010 Alexander Sverdlin <subaparts@yandex.ru>
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 */
16
17#ifndef __CS4271_H
18#define __CS4271_H
19
20struct cs4271_platform_data {
21 int gpio_nreset; /* GPIO driving Reset pin, if any */
22};
23
24#endif /* __CS4271_H */
diff --git a/include/sound/sh_fsi.h b/include/sound/sh_fsi.h
index d79894192ae3..9a155f9d0a12 100644
--- a/include/sound/sh_fsi.h
+++ b/include/sound/sh_fsi.h
@@ -15,67 +15,29 @@
15#define FSI_PORT_A 0 15#define FSI_PORT_A 0
16#define FSI_PORT_B 1 16#define FSI_PORT_B 1
17 17
18/* flags format
19
20 * 0xABCDEEFF
21 *
22 * A: channel size for TDM (input)
23 * B: channel size for TDM (ooutput)
24 * C: inversion
25 * D: mode
26 * E: input format
27 * F: output format
28 */
29
30#include <linux/clk.h> 18#include <linux/clk.h>
31#include <sound/soc.h> 19#include <sound/soc.h>
32 20
33/* TDM channel */ 21/*
34#define SH_FSI_SET_CH_I(x) ((x & 0xF) << 28) 22 * flags format
35#define SH_FSI_SET_CH_O(x) ((x & 0xF) << 24) 23 *
36 24 * 0x000000BA
37#define SH_FSI_CH_IMASK 0xF0000000 25 *
38#define SH_FSI_CH_OMASK 0x0F000000 26 * A: inversion
39#define SH_FSI_GET_CH_I(x) ((x & SH_FSI_CH_IMASK) >> 28) 27 * B: format mode
40#define SH_FSI_GET_CH_O(x) ((x & SH_FSI_CH_OMASK) >> 24) 28 */
41
42/* clock inversion */
43#define SH_FSI_INVERSION_MASK 0x00F00000
44#define SH_FSI_LRM_INV (1 << 20)
45#define SH_FSI_BRM_INV (1 << 21)
46#define SH_FSI_LRS_INV (1 << 22)
47#define SH_FSI_BRS_INV (1 << 23)
48
49/* mode */
50#define SH_FSI_MODE_MASK 0x000F0000
51#define SH_FSI_IN_SLAVE_MODE (1 << 16) /* default master mode */
52#define SH_FSI_OUT_SLAVE_MODE (1 << 17) /* default master mode */
53
54/* DI format */
55#define SH_FSI_FMT_MASK 0x000000FF
56#define SH_FSI_IFMT(x) (((SH_FSI_FMT_ ## x) & SH_FSI_FMT_MASK) << 8)
57#define SH_FSI_OFMT(x) (((SH_FSI_FMT_ ## x) & SH_FSI_FMT_MASK) << 0)
58#define SH_FSI_GET_IFMT(x) ((x >> 8) & SH_FSI_FMT_MASK)
59#define SH_FSI_GET_OFMT(x) ((x >> 0) & SH_FSI_FMT_MASK)
60
61#define SH_FSI_FMT_MONO 0
62#define SH_FSI_FMT_MONO_DELAY 1
63#define SH_FSI_FMT_PCM 2
64#define SH_FSI_FMT_I2S 3
65#define SH_FSI_FMT_TDM 4
66#define SH_FSI_FMT_TDM_DELAY 5
67#define SH_FSI_FMT_SPDIF 6
68
69
70#define SH_FSI_IFMT_TDM_CH(x) \
71 (SH_FSI_IFMT(TDM) | SH_FSI_SET_CH_I(x))
72#define SH_FSI_IFMT_TDM_DELAY_CH(x) \
73 (SH_FSI_IFMT(TDM_DELAY) | SH_FSI_SET_CH_I(x))
74 29
75#define SH_FSI_OFMT_TDM_CH(x) \ 30/* A: clock inversion */
76 (SH_FSI_OFMT(TDM) | SH_FSI_SET_CH_O(x)) 31#define SH_FSI_INVERSION_MASK 0x0000000F
77#define SH_FSI_OFMT_TDM_DELAY_CH(x) \ 32#define SH_FSI_LRM_INV (1 << 0)
78 (SH_FSI_OFMT(TDM_DELAY) | SH_FSI_SET_CH_O(x)) 33#define SH_FSI_BRM_INV (1 << 1)
34#define SH_FSI_LRS_INV (1 << 2)
35#define SH_FSI_BRS_INV (1 << 3)
36
37/* B: format mode */
38#define SH_FSI_FMT_MASK 0x000000F0
39#define SH_FSI_FMT_DAI (0 << 4)
40#define SH_FSI_FMT_SPDIF (1 << 4)
79 41
80 42
81/* 43/*
diff --git a/include/sound/soc-dapm.h b/include/sound/soc-dapm.h
index 8031769ac485..979ed84e07d6 100644
--- a/include/sound/soc-dapm.h
+++ b/include/sound/soc-dapm.h
@@ -157,6 +157,18 @@
157 .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = 1, \ 157 .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = 1, \
158 .event = wevent, .event_flags = wflags} 158 .event = wevent, .event_flags = wflags}
159 159
160/* additional sequencing control within an event type */
161#define SND_SOC_DAPM_PGA_S(wname, wsubseq, wreg, wshift, winvert, \
162 wevent, wflags) \
163{ .id = snd_soc_dapm_pga, .name = wname, .reg = wreg, .shift = wshift, \
164 .invert = winvert, .event = wevent, .event_flags = wflags, \
165 .subseq = wsubseq}
166#define SND_SOC_DAPM_SUPPLY_S(wname, wsubseq, wreg, wshift, winvert, wevent, \
167 wflags) \
168{ .id = snd_soc_dapm_supply, .name = wname, .reg = wreg, \
169 .shift = wshift, .invert = winvert, .event = wevent, \
170 .event_flags = wflags, .subseq = wsubseq}
171
160/* Simplified versions of above macros, assuming wncontrols = ARRAY_SIZE(wcontrols) */ 172/* Simplified versions of above macros, assuming wncontrols = ARRAY_SIZE(wcontrols) */
161#define SOC_PGA_E_ARRAY(wname, wreg, wshift, winvert, wcontrols, \ 173#define SOC_PGA_E_ARRAY(wname, wreg, wshift, winvert, wcontrols, \
162 wevent, wflags) \ 174 wevent, wflags) \
@@ -450,6 +462,7 @@ struct snd_soc_dapm_widget {
450 unsigned char ext:1; /* has external widgets */ 462 unsigned char ext:1; /* has external widgets */
451 unsigned char force:1; /* force state */ 463 unsigned char force:1; /* force state */
452 unsigned char ignore_suspend:1; /* kept enabled over suspend */ 464 unsigned char ignore_suspend:1; /* kept enabled over suspend */
465 int subseq; /* sort within widget type */
453 466
454 int (*power_check)(struct snd_soc_dapm_widget *w); 467 int (*power_check)(struct snd_soc_dapm_widget *w);
455 468
@@ -487,6 +500,9 @@ struct snd_soc_dapm_context {
487 500
488 struct snd_soc_dapm_update *update; 501 struct snd_soc_dapm_update *update;
489 502
503 void (*seq_notifier)(struct snd_soc_dapm_context *,
504 enum snd_soc_dapm_type, int);
505
490 struct device *dev; /* from parent - for debug */ 506 struct device *dev; /* from parent - for debug */
491 struct snd_soc_codec *codec; /* parent codec */ 507 struct snd_soc_codec *codec; /* parent codec */
492 struct snd_soc_card *card; /* parent card */ 508 struct snd_soc_card *card; /* parent card */
diff --git a/include/sound/soc.h b/include/sound/soc.h
index 74921f20a1d8..bfa4836ea107 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -234,6 +234,7 @@ struct snd_soc_codec;
234struct snd_soc_codec_driver; 234struct snd_soc_codec_driver;
235struct soc_enum; 235struct soc_enum;
236struct snd_soc_jack; 236struct snd_soc_jack;
237struct snd_soc_jack_zone;
237struct snd_soc_jack_pin; 238struct snd_soc_jack_pin;
238struct snd_soc_cache_ops; 239struct snd_soc_cache_ops;
239#include <sound/soc-dapm.h> 240#include <sound/soc-dapm.h>
@@ -258,6 +259,16 @@ enum snd_soc_compress_type {
258 SND_SOC_RBTREE_COMPRESSION 259 SND_SOC_RBTREE_COMPRESSION
259}; 260};
260 261
262int snd_soc_codec_set_sysclk(struct snd_soc_codec *codec, int clk_id,
263 unsigned int freq, int dir);
264int snd_soc_codec_set_pll(struct snd_soc_codec *codec, int pll_id, int source,
265 unsigned int freq_in, unsigned int freq_out);
266
267int snd_soc_register_card(struct snd_soc_card *card);
268int snd_soc_unregister_card(struct snd_soc_card *card);
269int snd_soc_suspend(struct device *dev);
270int snd_soc_resume(struct device *dev);
271int snd_soc_poweroff(struct device *dev);
261int snd_soc_register_platform(struct device *dev, 272int snd_soc_register_platform(struct device *dev,
262 struct snd_soc_platform_driver *platform_drv); 273 struct snd_soc_platform_driver *platform_drv);
263void snd_soc_unregister_platform(struct device *dev); 274void snd_soc_unregister_platform(struct device *dev);
@@ -265,7 +276,8 @@ int snd_soc_register_codec(struct device *dev,
265 const struct snd_soc_codec_driver *codec_drv, 276 const struct snd_soc_codec_driver *codec_drv,
266 struct snd_soc_dai_driver *dai_drv, int num_dai); 277 struct snd_soc_dai_driver *dai_drv, int num_dai);
267void snd_soc_unregister_codec(struct device *dev); 278void snd_soc_unregister_codec(struct device *dev);
268int snd_soc_codec_volatile_register(struct snd_soc_codec *codec, int reg); 279int snd_soc_codec_volatile_register(struct snd_soc_codec *codec,
280 unsigned int reg);
269int snd_soc_codec_set_cache_io(struct snd_soc_codec *codec, 281int snd_soc_codec_set_cache_io(struct snd_soc_codec *codec,
270 int addr_bits, int data_bits, 282 int addr_bits, int data_bits,
271 enum snd_soc_control_type control); 283 enum snd_soc_control_type control);
@@ -276,6 +288,10 @@ int snd_soc_cache_write(struct snd_soc_codec *codec,
276 unsigned int reg, unsigned int value); 288 unsigned int reg, unsigned int value);
277int snd_soc_cache_read(struct snd_soc_codec *codec, 289int snd_soc_cache_read(struct snd_soc_codec *codec,
278 unsigned int reg, unsigned int *value); 290 unsigned int reg, unsigned int *value);
291int snd_soc_default_volatile_register(struct snd_soc_codec *codec,
292 unsigned int reg);
293int snd_soc_default_readable_register(struct snd_soc_codec *codec,
294 unsigned int reg);
279 295
280/* Utility functions to get clock rates from various things */ 296/* Utility functions to get clock rates from various things */
281int snd_soc_calc_frame_size(int sample_size, int channels, int tdm_slots); 297int snd_soc_calc_frame_size(int sample_size, int channels, int tdm_slots);
@@ -297,6 +313,9 @@ void snd_soc_jack_notifier_register(struct snd_soc_jack *jack,
297 struct notifier_block *nb); 313 struct notifier_block *nb);
298void snd_soc_jack_notifier_unregister(struct snd_soc_jack *jack, 314void snd_soc_jack_notifier_unregister(struct snd_soc_jack *jack,
299 struct notifier_block *nb); 315 struct notifier_block *nb);
316int snd_soc_jack_add_zones(struct snd_soc_jack *jack, int count,
317 struct snd_soc_jack_zone *zones);
318int snd_soc_jack_get_type(struct snd_soc_jack *jack, int micbias_voltage);
300#ifdef CONFIG_GPIOLIB 319#ifdef CONFIG_GPIOLIB
301int snd_soc_jack_add_gpios(struct snd_soc_jack *jack, int count, 320int snd_soc_jack_add_gpios(struct snd_soc_jack *jack, int count,
302 struct snd_soc_jack_gpio *gpios); 321 struct snd_soc_jack_gpio *gpios);
@@ -321,7 +340,8 @@ void snd_soc_free_ac97_codec(struct snd_soc_codec *codec);
321 *Controls 340 *Controls
322 */ 341 */
323struct snd_kcontrol *snd_soc_cnew(const struct snd_kcontrol_new *_template, 342struct snd_kcontrol *snd_soc_cnew(const struct snd_kcontrol_new *_template,
324 void *data, char *long_name); 343 void *data, char *long_name,
344 const char *prefix);
325int snd_soc_add_controls(struct snd_soc_codec *codec, 345int snd_soc_add_controls(struct snd_soc_codec *codec,
326 const struct snd_kcontrol_new *controls, int num_controls); 346 const struct snd_kcontrol_new *controls, int num_controls);
327int snd_soc_info_enum_double(struct snd_kcontrol *kcontrol, 347int snd_soc_info_enum_double(struct snd_kcontrol *kcontrol,
@@ -367,6 +387,22 @@ int snd_soc_put_volsw_2r_sx(struct snd_kcontrol *kcontrol,
367 struct snd_ctl_elem_value *ucontrol); 387 struct snd_ctl_elem_value *ucontrol);
368 388
369/** 389/**
390 * struct snd_soc_reg_access - Describes whether a given register is
391 * readable, writable or volatile.
392 *
393 * @reg: the register number
394 * @read: whether this register is readable
395 * @write: whether this register is writable
396 * @vol: whether this register is volatile
397 */
398struct snd_soc_reg_access {
399 u16 reg;
400 u16 read;
401 u16 write;
402 u16 vol;
403};
404
405/**
370 * struct snd_soc_jack_pin - Describes a pin to update based on jack detection 406 * struct snd_soc_jack_pin - Describes a pin to update based on jack detection
371 * 407 *
372 * @pin: name of the pin to update 408 * @pin: name of the pin to update
@@ -381,6 +417,24 @@ struct snd_soc_jack_pin {
381}; 417};
382 418
383/** 419/**
420 * struct snd_soc_jack_zone - Describes voltage zones of jack detection
421 *
422 * @min_mv: start voltage in mv
423 * @max_mv: end voltage in mv
424 * @jack_type: type of jack that is expected for this voltage
425 * @debounce_time: debounce_time for jack, codec driver should wait for this
426 * duration before reading the adc for voltages
427 * @:list: list container
428 */
429struct snd_soc_jack_zone {
430 unsigned int min_mv;
431 unsigned int max_mv;
432 unsigned int jack_type;
433 unsigned int debounce_time;
434 struct list_head list;
435};
436
437/**
384 * struct snd_soc_jack_gpio - Describes a gpio pin for jack detection 438 * struct snd_soc_jack_gpio - Describes a gpio pin for jack detection
385 * 439 *
386 * @gpio: gpio number 440 * @gpio: gpio number
@@ -388,6 +442,10 @@ struct snd_soc_jack_pin {
388 * @report: value to report when jack detected 442 * @report: value to report when jack detected
389 * @invert: report presence in low state 443 * @invert: report presence in low state
390 * @debouce_time: debouce time in ms 444 * @debouce_time: debouce time in ms
445 * @wake: enable as wake source
446 * @jack_status_check: callback function which overrides the detection
447 * to provide more complex checks (eg, reading an
448 * ADC).
391 */ 449 */
392#ifdef CONFIG_GPIOLIB 450#ifdef CONFIG_GPIOLIB
393struct snd_soc_jack_gpio { 451struct snd_soc_jack_gpio {
@@ -396,6 +454,8 @@ struct snd_soc_jack_gpio {
396 int report; 454 int report;
397 int invert; 455 int invert;
398 int debounce_time; 456 int debounce_time;
457 bool wake;
458
399 struct snd_soc_jack *jack; 459 struct snd_soc_jack *jack;
400 struct delayed_work work; 460 struct delayed_work work;
401 461
@@ -409,6 +469,7 @@ struct snd_soc_jack {
409 struct list_head pins; 469 struct list_head pins;
410 int status; 470 int status;
411 struct blocking_notifier_head notifier; 471 struct blocking_notifier_head notifier;
472 struct list_head jack_zones;
412}; 473};
413 474
414/* SoC PCM stream information */ 475/* SoC PCM stream information */
@@ -459,18 +520,22 @@ struct snd_soc_codec {
459 struct list_head card_list; 520 struct list_head card_list;
460 int num_dai; 521 int num_dai;
461 enum snd_soc_compress_type compress_type; 522 enum snd_soc_compress_type compress_type;
523 size_t reg_size; /* reg_cache_size * reg_word_size */
524 int (*volatile_register)(struct snd_soc_codec *, unsigned int);
525 int (*readable_register)(struct snd_soc_codec *, unsigned int);
462 526
463 /* runtime */ 527 /* runtime */
464 struct snd_ac97 *ac97; /* for ad-hoc ac97 devices */ 528 struct snd_ac97 *ac97; /* for ad-hoc ac97 devices */
465 unsigned int active; 529 unsigned int active;
466 unsigned int cache_only:1; /* Suppress writes to hardware */ 530 unsigned int cache_bypass:1; /* Suppress access to the cache */
467 unsigned int cache_sync:1; /* Cache needs to be synced to hardware */
468 unsigned int suspended:1; /* Codec is in suspend PM state */ 531 unsigned int suspended:1; /* Codec is in suspend PM state */
469 unsigned int probed:1; /* Codec has been probed */ 532 unsigned int probed:1; /* Codec has been probed */
470 unsigned int ac97_registered:1; /* Codec has been AC97 registered */ 533 unsigned int ac97_registered:1; /* Codec has been AC97 registered */
471 unsigned int ac97_created:1; /* Codec has been created by SoC */ 534 unsigned int ac97_created:1; /* Codec has been created by SoC */
472 unsigned int sysfs_registered:1; /* codec has been sysfs registered */ 535 unsigned int sysfs_registered:1; /* codec has been sysfs registered */
473 unsigned int cache_init:1; /* codec cache has been initialized */ 536 unsigned int cache_init:1; /* codec cache has been initialized */
537 u32 cache_only; /* Suppress writes to hardware */
538 u32 cache_sync; /* Cache needs to be synced to hardware */
474 539
475 /* codec IO */ 540 /* codec IO */
476 void *control_data; /* codec control (i2c/3wire) data */ 541 void *control_data; /* codec control (i2c/3wire) data */
@@ -503,22 +568,39 @@ struct snd_soc_codec_driver {
503 pm_message_t state); 568 pm_message_t state);
504 int (*resume)(struct snd_soc_codec *); 569 int (*resume)(struct snd_soc_codec *);
505 570
571 /* Default DAPM setup, added after probe() is run */
572 const struct snd_soc_dapm_widget *dapm_widgets;
573 int num_dapm_widgets;
574 const struct snd_soc_dapm_route *dapm_routes;
575 int num_dapm_routes;
576
577 /* codec wide operations */
578 int (*set_sysclk)(struct snd_soc_codec *codec,
579 int clk_id, unsigned int freq, int dir);
580 int (*set_pll)(struct snd_soc_codec *codec, int pll_id, int source,
581 unsigned int freq_in, unsigned int freq_out);
582
506 /* codec IO */ 583 /* codec IO */
507 unsigned int (*read)(struct snd_soc_codec *, unsigned int); 584 unsigned int (*read)(struct snd_soc_codec *, unsigned int);
508 int (*write)(struct snd_soc_codec *, unsigned int, unsigned int); 585 int (*write)(struct snd_soc_codec *, unsigned int, unsigned int);
509 int (*display_register)(struct snd_soc_codec *, char *, 586 int (*display_register)(struct snd_soc_codec *, char *,
510 size_t, unsigned int); 587 size_t, unsigned int);
511 int (*volatile_register)(unsigned int); 588 int (*volatile_register)(struct snd_soc_codec *, unsigned int);
512 int (*readable_register)(unsigned int); 589 int (*readable_register)(struct snd_soc_codec *, unsigned int);
513 short reg_cache_size; 590 short reg_cache_size;
514 short reg_cache_step; 591 short reg_cache_step;
515 short reg_word_size; 592 short reg_word_size;
516 const void *reg_cache_default; 593 const void *reg_cache_default;
594 short reg_access_size;
595 const struct snd_soc_reg_access *reg_access_default;
517 enum snd_soc_compress_type compress_type; 596 enum snd_soc_compress_type compress_type;
518 597
519 /* codec bias level */ 598 /* codec bias level */
520 int (*set_bias_level)(struct snd_soc_codec *, 599 int (*set_bias_level)(struct snd_soc_codec *,
521 enum snd_soc_bias_level level); 600 enum snd_soc_bias_level level);
601
602 void (*seq_notifier)(struct snd_soc_dapm_context *,
603 enum snd_soc_dapm_type, int);
522}; 604};
523 605
524/* SoC platform interface */ 606/* SoC platform interface */
@@ -617,15 +699,16 @@ struct snd_soc_card {
617 699
618 bool instantiated; 700 bool instantiated;
619 701
620 int (*probe)(struct platform_device *pdev); 702 int (*probe)(struct snd_soc_card *card);
621 int (*remove)(struct platform_device *pdev); 703 int (*late_probe)(struct snd_soc_card *card);
704 int (*remove)(struct snd_soc_card *card);
622 705
623 /* the pre and post PM functions are used to do any PM work before and 706 /* the pre and post PM functions are used to do any PM work before and
624 * after the codec and DAI's do any PM work. */ 707 * after the codec and DAI's do any PM work. */
625 int (*suspend_pre)(struct platform_device *pdev, pm_message_t state); 708 int (*suspend_pre)(struct snd_soc_card *card);
626 int (*suspend_post)(struct platform_device *pdev, pm_message_t state); 709 int (*suspend_post)(struct snd_soc_card *card);
627 int (*resume_pre)(struct platform_device *pdev); 710 int (*resume_pre)(struct snd_soc_card *card);
628 int (*resume_post)(struct platform_device *pdev); 711 int (*resume_post)(struct snd_soc_card *card);
629 712
630 /* callbacks */ 713 /* callbacks */
631 int (*set_bias_level)(struct snd_soc_card *, 714 int (*set_bias_level)(struct snd_soc_card *,
@@ -654,6 +737,14 @@ struct snd_soc_card {
654 struct snd_soc_pcm_runtime *rtd_aux; 737 struct snd_soc_pcm_runtime *rtd_aux;
655 int num_aux_rtd; 738 int num_aux_rtd;
656 739
740 /*
741 * Card-specific routes and widgets.
742 */
743 struct snd_soc_dapm_widget *dapm_widgets;
744 int num_dapm_widgets;
745 struct snd_soc_dapm_route *dapm_routes;
746 int num_dapm_routes;
747
657 struct work_struct deferred_resume_work; 748 struct work_struct deferred_resume_work;
658 749
659 /* lists of probed devices belonging to this card */ 750 /* lists of probed devices belonging to this card */
@@ -665,11 +756,16 @@ struct snd_soc_card {
665 struct list_head paths; 756 struct list_head paths;
666 struct list_head dapm_list; 757 struct list_head dapm_list;
667 758
759 /* Generic DAPM context for the card */
760 struct snd_soc_dapm_context dapm;
761
668#ifdef CONFIG_DEBUG_FS 762#ifdef CONFIG_DEBUG_FS
669 struct dentry *debugfs_card_root; 763 struct dentry *debugfs_card_root;
670 struct dentry *debugfs_pop_time; 764 struct dentry *debugfs_pop_time;
671#endif 765#endif
672 u32 pop_time; 766 u32 pop_time;
767
768 void *drvdata;
673}; 769};
674 770
675/* SoC machine DAI configuration, glues a codec and cpu DAI together */ 771/* SoC machine DAI configuration, glues a codec and cpu DAI together */
@@ -721,6 +817,17 @@ unsigned int snd_soc_write(struct snd_soc_codec *codec,
721 817
722/* device driver data */ 818/* device driver data */
723 819
820static inline void snd_soc_card_set_drvdata(struct snd_soc_card *card,
821 void *data)
822{
823 card->drvdata = data;
824}
825
826static inline void *snd_soc_card_get_drvdata(struct snd_soc_card *card)
827{
828 return card->drvdata;
829}
830
724static inline void snd_soc_codec_set_drvdata(struct snd_soc_codec *codec, 831static inline void snd_soc_codec_set_drvdata(struct snd_soc_codec *codec,
725 void *data) 832 void *data)
726{ 833{
@@ -754,6 +861,22 @@ static inline void *snd_soc_pcm_get_drvdata(struct snd_soc_pcm_runtime *rtd)
754 return dev_get_drvdata(&rtd->dev); 861 return dev_get_drvdata(&rtd->dev);
755} 862}
756 863
864static inline void snd_soc_initialize_card_lists(struct snd_soc_card *card)
865{
866 INIT_LIST_HEAD(&card->dai_dev_list);
867 INIT_LIST_HEAD(&card->codec_dev_list);
868 INIT_LIST_HEAD(&card->platform_dev_list);
869 INIT_LIST_HEAD(&card->widgets);
870 INIT_LIST_HEAD(&card->paths);
871 INIT_LIST_HEAD(&card->dapm_list);
872}
873
757#include <sound/soc-dai.h> 874#include <sound/soc-dai.h>
758 875
876#ifdef CONFIG_DEBUG_FS
877extern struct dentry *snd_soc_debugfs_root;
878#endif
879
880extern const struct dev_pm_ops snd_soc_pm_ops;
881
759#endif 882#endif
diff --git a/include/sound/tlv320aic32x4.h b/include/sound/tlv320aic32x4.h
new file mode 100644
index 000000000000..c009f70b4029
--- /dev/null
+++ b/include/sound/tlv320aic32x4.h
@@ -0,0 +1,31 @@
1/*
2 * tlv320aic32x4.h -- TLV320AIC32X4 Soc Audio driver platform data
3 *
4 * Copyright 2011 Vista Silicon S.L.
5 *
6 * Author: Javier Martin <javier.martin@vista-silicon.com>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12
13#ifndef _AIC32X4_PDATA_H
14#define _AIC32X4_PDATA_H
15
16#define AIC32X4_PWR_MICBIAS_2075_LDOIN 0x00000001
17#define AIC32X4_PWR_AVDD_DVDD_WEAK_DISABLE 0x00000002
18#define AIC32X4_PWR_AIC32X4_LDO_ENABLE 0x00000004
19#define AIC32X4_PWR_CMMODE_LDOIN_RANGE_18_36 0x00000008
20#define AIC32X4_PWR_CMMODE_HP_LDOIN_POWERED 0x00000010
21
22#define AIC32X4_MICPGA_ROUTE_LMIC_IN2R_10K 0x00000001
23#define AIC32X4_MICPGA_ROUTE_RMIC_IN1L_10K 0x00000002
24
25struct aic32x4_pdata {
26 u32 power_cfg;
27 u32 micpga_routing;
28 bool swapdacs;
29};
30
31#endif
diff --git a/include/sound/wm8903.h b/include/sound/wm8903.h
index b4a0db2307ef..cf7ccb76a8de 100644
--- a/include/sound/wm8903.h
+++ b/include/sound/wm8903.h
@@ -17,13 +17,9 @@
17/* 17/*
18 * R6 (0x06) - Mic Bias Control 0 18 * R6 (0x06) - Mic Bias Control 0
19 */ 19 */
20#define WM8903_MICDET_HYST_ENA 0x0080 /* MICDET_HYST_ENA */ 20#define WM8903_MICDET_THR_MASK 0x0030 /* MICDET_THR - [5:4] */
21#define WM8903_MICDET_HYST_ENA_MASK 0x0080 /* MICDET_HYST_ENA */ 21#define WM8903_MICDET_THR_SHIFT 4 /* MICDET_THR - [5:4] */
22#define WM8903_MICDET_HYST_ENA_SHIFT 7 /* MICDET_HYST_ENA */ 22#define WM8903_MICDET_THR_WIDTH 2 /* MICDET_THR - [5:4] */
23#define WM8903_MICDET_HYST_ENA_WIDTH 1 /* MICDET_HYST_ENA */
24#define WM8903_MICDET_THR_MASK 0x0070 /* MICDET_THR - [6:4] */
25#define WM8903_MICDET_THR_SHIFT 4 /* MICDET_THR - [6:4] */
26#define WM8903_MICDET_THR_WIDTH 3 /* MICDET_THR - [6:4] */
27#define WM8903_MICSHORT_THR_MASK 0x000C /* MICSHORT_THR - [3:2] */ 23#define WM8903_MICSHORT_THR_MASK 0x000C /* MICSHORT_THR - [3:2] */
28#define WM8903_MICSHORT_THR_SHIFT 2 /* MICSHORT_THR - [3:2] */ 24#define WM8903_MICSHORT_THR_SHIFT 2 /* MICSHORT_THR - [3:2] */
29#define WM8903_MICSHORT_THR_WIDTH 2 /* MICSHORT_THR - [3:2] */ 25#define WM8903_MICSHORT_THR_WIDTH 2 /* MICSHORT_THR - [3:2] */
@@ -37,6 +33,21 @@
37#define WM8903_MICBIAS_ENA_WIDTH 1 /* MICBIAS_ENA */ 33#define WM8903_MICBIAS_ENA_WIDTH 1 /* MICBIAS_ENA */
38 34
39/* 35/*
36 * WM8903_GPn_FN values
37 *
38 * See datasheets for list of valid values per pin
39 */
40#define WM8903_GPn_FN_GPIO_OUTPUT 0
41#define WM8903_GPn_FN_BCLK 1
42#define WM8903_GPn_FN_IRQ_OUTPT 2
43#define WM8903_GPn_FN_GPIO_INPUT 3
44#define WM8903_GPn_FN_MICBIAS_CURRENT_DETECT 4
45#define WM8903_GPn_FN_MICBIAS_SHORT_DETECT 5
46#define WM8903_GPn_FN_DMIC_LR_CLK_OUTPUT 6
47#define WM8903_GPn_FN_FLL_LOCK_OUTPUT 8
48#define WM8903_GPn_FN_FLL_CLOCK_OUTPUT 9
49
50/*
40 * R116 (0x74) - GPIO Control 1 51 * R116 (0x74) - GPIO Control 1
41 */ 52 */
42#define WM8903_GP1_FN_MASK 0x1F00 /* GP1_FN - [12:8] */ 53#define WM8903_GP1_FN_MASK 0x1F00 /* GP1_FN - [12:8] */
@@ -231,6 +242,8 @@
231#define WM8903_GP5_DB_SHIFT 0 /* GP5_DB */ 242#define WM8903_GP5_DB_SHIFT 0 /* GP5_DB */
232#define WM8903_GP5_DB_WIDTH 1 /* GP5_DB */ 243#define WM8903_GP5_DB_WIDTH 1 /* GP5_DB */
233 244
245#define WM8903_NUM_GPIO 5
246
234struct wm8903_platform_data { 247struct wm8903_platform_data {
235 bool irq_active_low; /* Set if IRQ active low, default high */ 248 bool irq_active_low; /* Set if IRQ active low, default high */
236 249
@@ -243,7 +256,8 @@ struct wm8903_platform_data {
243 256
244 int micdet_delay; /* Delay after microphone detection (ms) */ 257 int micdet_delay; /* Delay after microphone detection (ms) */
245 258
246 u32 gpio_cfg[5]; /* Default register values for GPIO pin mux */ 259 int gpio_base;
260 u32 gpio_cfg[WM8903_NUM_GPIO]; /* Default register values for GPIO pin mux */
247}; 261};
248 262
249#endif 263#endif
diff --git a/include/sound/wm9081.h b/include/sound/wm9081.h
index e173ddbf6bd4..f34b0b1716d8 100644
--- a/include/sound/wm9081.h
+++ b/include/sound/wm9081.h
@@ -17,9 +17,12 @@ struct wm9081_retune_mobile_setting {
17 u16 config[20]; 17 u16 config[20];
18}; 18};
19 19
20struct wm9081_retune_mobile_config { 20struct wm9081_pdata {
21 struct wm9081_retune_mobile_setting *configs; 21 bool irq_high; /* IRQ is active high */
22 int num_configs; 22 bool irq_cmos; /* IRQ is in CMOS mode */
23
24 struct wm9081_retune_mobile_setting *retune_configs;
25 int num_retune_configs;
23}; 26};
24 27
25#endif 28#endif