| Index: include/sound/soc-dapm.h
|
| diff --git a/include/sound/soc-dapm.h b/include/sound/soc-dapm.h
|
| index 8fd3b41b763f6a90ca60446cfd6cca97a36664aa..979ed84e07d65a78fb24798a72e2bd3976d5ec10 100644
|
| --- a/include/sound/soc-dapm.h
|
| +++ b/include/sound/soc-dapm.h
|
| @@ -16,7 +16,6 @@
|
| #include <linux/device.h>
|
| #include <linux/types.h>
|
| #include <sound/control.h>
|
| -#include <sound/soc.h>
|
|
|
| /* widget has no PM register bit */
|
| #define SND_SOC_NOPM -1
|
| @@ -72,6 +71,10 @@
|
| wcontrols, wncontrols) \
|
| { .id = snd_soc_dapm_pga, .name = wname, .reg = wreg, .shift = wshift, \
|
| .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = wncontrols}
|
| +#define SND_SOC_DAPM_OUT_DRV(wname, wreg, wshift, winvert,\
|
| + wcontrols, wncontrols) \
|
| +{ .id = snd_soc_dapm_out_drv, .name = wname, .reg = wreg, .shift = wshift, \
|
| + .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = wncontrols}
|
| #define SND_SOC_DAPM_MIXER(wname, wreg, wshift, winvert, \
|
| wcontrols, wncontrols)\
|
| { .id = snd_soc_dapm_mixer, .name = wname, .reg = wreg, .shift = wshift, \
|
| @@ -90,6 +93,9 @@
|
| #define SND_SOC_DAPM_MUX(wname, wreg, wshift, winvert, wcontrols) \
|
| { .id = snd_soc_dapm_mux, .name = wname, .reg = wreg, .shift = wshift, \
|
| .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = 1}
|
| +#define SND_SOC_DAPM_VIRT_MUX(wname, wreg, wshift, winvert, wcontrols) \
|
| +{ .id = snd_soc_dapm_virt_mux, .name = wname, .reg = wreg, .shift = wshift, \
|
| + .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = 1}
|
| #define SND_SOC_DAPM_VALUE_MUX(wname, wreg, wshift, winvert, wcontrols) \
|
| { .id = snd_soc_dapm_value_mux, .name = wname, .reg = wreg, \
|
| .shift = wshift, .invert = winvert, .kcontrols = wcontrols, \
|
| @@ -116,6 +122,11 @@
|
| { .id = snd_soc_dapm_pga, .name = wname, .reg = wreg, .shift = wshift, \
|
| .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = wncontrols, \
|
| .event = wevent, .event_flags = wflags}
|
| +#define SND_SOC_DAPM_OUT_DRV_E(wname, wreg, wshift, winvert, wcontrols, \
|
| + wncontrols, wevent, wflags) \
|
| +{ .id = snd_soc_dapm_out_drv, .name = wname, .reg = wreg, .shift = wshift, \
|
| + .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = wncontrols, \
|
| + .event = wevent, .event_flags = wflags}
|
| #define SND_SOC_DAPM_MIXER_E(wname, wreg, wshift, winvert, wcontrols, \
|
| wncontrols, wevent, wflags) \
|
| { .id = snd_soc_dapm_mixer, .name = wname, .reg = wreg, .shift = wshift, \
|
| @@ -140,6 +151,23 @@
|
| { .id = snd_soc_dapm_mux, .name = wname, .reg = wreg, .shift = wshift, \
|
| .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = 1, \
|
| .event = wevent, .event_flags = wflags}
|
| +#define SND_SOC_DAPM_VIRT_MUX_E(wname, wreg, wshift, winvert, wcontrols, \
|
| + wevent, wflags) \
|
| +{ .id = snd_soc_dapm_virt_mux, .name = wname, .reg = wreg, .shift = wshift, \
|
| + .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = 1, \
|
| + .event = wevent, .event_flags = wflags}
|
| +
|
| +/* additional sequencing control within an event type */
|
| +#define SND_SOC_DAPM_PGA_S(wname, wsubseq, wreg, wshift, winvert, \
|
| + wevent, wflags) \
|
| +{ .id = snd_soc_dapm_pga, .name = wname, .reg = wreg, .shift = wshift, \
|
| + .invert = winvert, .event = wevent, .event_flags = wflags, \
|
| + .subseq = wsubseq}
|
| +#define SND_SOC_DAPM_SUPPLY_S(wname, wsubseq, wreg, wshift, winvert, wevent, \
|
| + wflags) \
|
| +{ .id = snd_soc_dapm_supply, .name = wname, .reg = wreg, \
|
| + .shift = wshift, .invert = winvert, .event = wevent, \
|
| + .event_flags = wflags, .subseq = wsubseq}
|
|
|
| /* Simplified versions of above macros, assuming wncontrols = ARRAY_SIZE(wcontrols) */
|
| #define SOC_PGA_E_ARRAY(wname, wreg, wshift, winvert, wcontrols, \
|
| @@ -219,13 +247,6 @@
|
| .info = snd_soc_info_volsw, \
|
| .get = snd_soc_dapm_get_volsw, .put = snd_soc_dapm_put_volsw, \
|
| .private_value = SOC_SINGLE_VALUE(reg, shift, max, invert) }
|
| -#define SOC_DAPM_DOUBLE(xname, reg, shift_left, shift_right, max, invert, \
|
| - power) \
|
| -{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \
|
| - .info = snd_soc_info_volsw, \
|
| - .get = snd_soc_dapm_get_volsw, .put = snd_soc_dapm_put_volsw, \
|
| - .private_value = (reg) | ((shift_left) << 8) | ((shift_right) << 12) |\
|
| - ((max) << 16) | ((invert) << 24) }
|
| #define SOC_DAPM_SINGLE_TLV(xname, reg, shift, max, invert, tlv_array) \
|
| { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
|
| .info = snd_soc_info_volsw, \
|
| @@ -233,15 +254,6 @@
|
| .tlv.p = (tlv_array), \
|
| .get = snd_soc_dapm_get_volsw, .put = snd_soc_dapm_put_volsw, \
|
| .private_value = SOC_SINGLE_VALUE(reg, shift, max, invert) }
|
| -#define SOC_DAPM_DOUBLE_TLV(xname, reg, shift_left, shift_right, max, invert, \
|
| - power, tlv_array) \
|
| -{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \
|
| - .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ | SNDRV_CTL_ELEM_ACCESS_READWRITE,\
|
| - .tlv.p = (tlv_array), \
|
| - .info = snd_soc_info_volsw, \
|
| - .get = snd_soc_dapm_get_volsw, .put = snd_soc_dapm_put_volsw, \
|
| - .private_value = (reg) | ((shift_left) << 8) | ((shift_right) << 12) |\
|
| - ((max) << 16) | ((invert) << 24) }
|
| #define SOC_DAPM_ENUM(xname, xenum) \
|
| { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
|
| .info = snd_soc_info_enum_double, \
|
| @@ -297,6 +309,7 @@ enum snd_soc_dapm_type;
|
| struct snd_soc_dapm_path;
|
| struct snd_soc_dapm_pin;
|
| struct snd_soc_dapm_route;
|
| +struct snd_soc_dapm_context;
|
|
|
| int dapm_reg_event(struct snd_soc_dapm_widget *w,
|
| struct snd_kcontrol *kcontrol, int event);
|
| @@ -324,16 +337,16 @@ int snd_soc_dapm_get_pin_switch(struct snd_kcontrol *kcontrol,
|
| struct snd_ctl_elem_value *uncontrol);
|
| int snd_soc_dapm_put_pin_switch(struct snd_kcontrol *kcontrol,
|
| struct snd_ctl_elem_value *uncontrol);
|
| -int snd_soc_dapm_new_control(struct snd_soc_codec *codec,
|
| +int snd_soc_dapm_new_control(struct snd_soc_dapm_context *dapm,
|
| const struct snd_soc_dapm_widget *widget);
|
| -int snd_soc_dapm_new_controls(struct snd_soc_codec *codec,
|
| +int snd_soc_dapm_new_controls(struct snd_soc_dapm_context *dapm,
|
| const struct snd_soc_dapm_widget *widget,
|
| int num);
|
|
|
| /* dapm path setup */
|
| -int snd_soc_dapm_new_widgets(struct snd_soc_codec *codec);
|
| -void snd_soc_dapm_free(struct snd_soc_codec *codec);
|
| -int snd_soc_dapm_add_routes(struct snd_soc_codec *codec,
|
| +int snd_soc_dapm_new_widgets(struct snd_soc_dapm_context *dapm);
|
| +void snd_soc_dapm_free(struct snd_soc_dapm_context *dapm);
|
| +int snd_soc_dapm_add_routes(struct snd_soc_dapm_context *dapm,
|
| const struct snd_soc_dapm_route *route, int num);
|
|
|
| /* dapm events */
|
| @@ -343,27 +356,33 @@ void snd_soc_dapm_shutdown(struct snd_soc_card *card);
|
|
|
| /* dapm sys fs - used by the core */
|
| int snd_soc_dapm_sys_add(struct device *dev);
|
| -void snd_soc_dapm_debugfs_init(struct snd_soc_codec *codec);
|
| +void snd_soc_dapm_debugfs_init(struct snd_soc_dapm_context *dapm);
|
|
|
| /* dapm audio pin control and status */
|
| -int snd_soc_dapm_enable_pin(struct snd_soc_codec *codec, const char *pin);
|
| -int snd_soc_dapm_disable_pin(struct snd_soc_codec *codec, const char *pin);
|
| -int snd_soc_dapm_nc_pin(struct snd_soc_codec *codec, const char *pin);
|
| -int snd_soc_dapm_get_pin_status(struct snd_soc_codec *codec, const char *pin);
|
| -int snd_soc_dapm_sync(struct snd_soc_codec *codec);
|
| -int snd_soc_dapm_force_enable_pin(struct snd_soc_codec *codec,
|
| +int snd_soc_dapm_enable_pin(struct snd_soc_dapm_context *dapm,
|
| + const char *pin);
|
| +int snd_soc_dapm_disable_pin(struct snd_soc_dapm_context *dapm,
|
| + const char *pin);
|
| +int snd_soc_dapm_nc_pin(struct snd_soc_dapm_context *dapm, const char *pin);
|
| +int snd_soc_dapm_get_pin_status(struct snd_soc_dapm_context *dapm,
|
| + const char *pin);
|
| +int snd_soc_dapm_sync(struct snd_soc_dapm_context *dapm);
|
| +int snd_soc_dapm_force_enable_pin(struct snd_soc_dapm_context *dapm,
|
| const char *pin);
|
| -int snd_soc_dapm_ignore_suspend(struct snd_soc_codec *codec, const char *pin);
|
| +int snd_soc_dapm_ignore_suspend(struct snd_soc_dapm_context *dapm,
|
| + const char *pin);
|
|
|
| /* dapm widget types */
|
| enum snd_soc_dapm_type {
|
| snd_soc_dapm_input = 0, /* input pin */
|
| snd_soc_dapm_output, /* output pin */
|
| snd_soc_dapm_mux, /* selects 1 analog signal from many inputs */
|
| + snd_soc_dapm_virt_mux, /* virtual version of snd_soc_dapm_mux */
|
| snd_soc_dapm_value_mux, /* selects 1 analog signal from many inputs */
|
| snd_soc_dapm_mixer, /* mixes several analog signals together */
|
| snd_soc_dapm_mixer_named_ctl, /* mixer with named controls */
|
| snd_soc_dapm_pga, /* programmable gain/attenuation (volume) */
|
| + snd_soc_dapm_out_drv, /* output driver */
|
| snd_soc_dapm_adc, /* analog to digital converter */
|
| snd_soc_dapm_dac, /* digital to analog converter */
|
| snd_soc_dapm_micbias, /* microphone bias (power) */
|
| @@ -425,6 +444,7 @@ struct snd_soc_dapm_widget {
|
| char *sname; /* stream name */
|
| struct snd_soc_codec *codec;
|
| struct list_head list;
|
| + struct snd_soc_dapm_context *dapm;
|
|
|
| /* dapm control */
|
| short reg; /* negative reg = no direct dapm */
|
| @@ -442,6 +462,7 @@ struct snd_soc_dapm_widget {
|
| unsigned char ext:1; /* has external widgets */
|
| unsigned char force:1; /* force state */
|
| unsigned char ignore_suspend:1; /* kept enabled over suspend */
|
| + int subseq; /* sort within widget type */
|
|
|
| int (*power_check)(struct snd_soc_dapm_widget *w);
|
|
|
| @@ -461,4 +482,38 @@ struct snd_soc_dapm_widget {
|
| struct list_head power_list;
|
| };
|
|
|
| +struct snd_soc_dapm_update {
|
| + struct snd_soc_dapm_widget *widget;
|
| + struct snd_kcontrol *kcontrol;
|
| + int reg;
|
| + int mask;
|
| + int val;
|
| +};
|
| +
|
| +/* DAPM context */
|
| +struct snd_soc_dapm_context {
|
| + int n_widgets; /* number of widgets in this context */
|
| + enum snd_soc_bias_level bias_level;
|
| + enum snd_soc_bias_level suspend_bias_level;
|
| + struct delayed_work delayed_work;
|
| + unsigned int idle_bias_off:1; /* Use BIAS_OFF instead of STANDBY */
|
| +
|
| + struct snd_soc_dapm_update *update;
|
| +
|
| + void (*seq_notifier)(struct snd_soc_dapm_context *,
|
| + enum snd_soc_dapm_type, int);
|
| +
|
| + struct device *dev; /* from parent - for debug */
|
| + struct snd_soc_codec *codec; /* parent codec */
|
| + struct snd_soc_card *card; /* parent card */
|
| +
|
| + /* used during DAPM updates */
|
| + int dev_power;
|
| + struct list_head list;
|
| +
|
| +#ifdef CONFIG_DEBUG_FS
|
| + struct dentry *debugfs_dapm;
|
| +#endif
|
| +};
|
| +
|
| #endif
|
|
|