Skip to content

Commit

Permalink
Merge remote-tracking branches 'asoc/topic/tas2552', 'asoc/topic/tas5…
Browse files Browse the repository at this point in the history
…086', 'asoc/topic/tegra', 'asoc/topic/tlv' and 'asoc/topic/topology' into asoc-next
  • Loading branch information
Mark Brown committed Aug 30, 2015
6 parents 0a5ff07 + 82cf77a + 9425e9d + f57ddcd + 2e45a25 + 1a3232d commit 428157c
Show file tree
Hide file tree
Showing 52 changed files with 357 additions and 542 deletions.
13 changes: 12 additions & 1 deletion include/sound/soc-topology.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,13 @@ struct snd_soc_tplg_kcontrol_ops {
struct snd_ctl_elem_info *uinfo);
};

/* Bytes ext operations, for TLV byte controls */
struct snd_soc_tplg_bytes_ext_ops {
u32 id;
int (*get)(unsigned int __user *bytes, unsigned int size);
int (*put)(const unsigned int __user *bytes, unsigned int size);
};

/*
* DAPM widget event handlers - used to map handlers onto widgets.
*/
Expand Down Expand Up @@ -136,9 +143,13 @@ struct snd_soc_tplg_ops {
int (*manifest)(struct snd_soc_component *,
struct snd_soc_tplg_manifest *);

/* bespoke kcontrol handlers available for binding */
/* vendor specific kcontrol handlers available for binding */
const struct snd_soc_tplg_kcontrol_ops *io_ops;
int io_ops_count;

/* vendor specific bytes ext handlers available for binding */
const struct snd_soc_tplg_bytes_ext_ops *bytes_ext_ops;
int bytes_ext_ops_count;
};

#ifdef CONFIG_SND_SOC_TOPOLOGY
Expand Down
28 changes: 12 additions & 16 deletions sound/soc/codecs/88pm860x-codec.c
Original file line number Diff line number Diff line change
Expand Up @@ -156,42 +156,38 @@ static const DECLARE_TLV_DB_SCALE(dpga_tlv, -9450, 150, 1);
static const DECLARE_TLV_DB_SCALE(adc_tlv, -900, 300, 0);

/* {-23, -17, -13.5, -11, -9, -6, -3, 0}dB */
static const unsigned int mic_tlv[] = {
TLV_DB_RANGE_HEAD(5),
static const DECLARE_TLV_DB_RANGE(mic_tlv,
0, 0, TLV_DB_SCALE_ITEM(-2300, 0, 0),
1, 1, TLV_DB_SCALE_ITEM(-1700, 0, 0),
2, 2, TLV_DB_SCALE_ITEM(-1350, 0, 0),
3, 3, TLV_DB_SCALE_ITEM(-1100, 0, 0),
4, 7, TLV_DB_SCALE_ITEM(-900, 300, 0),
};
4, 7, TLV_DB_SCALE_ITEM(-900, 300, 0)
);

/* {0, 0, 0, -6, 0, 6, 12, 18}dB */
static const unsigned int aux_tlv[] = {
TLV_DB_RANGE_HEAD(2),
static const DECLARE_TLV_DB_RANGE(aux_tlv,
0, 2, TLV_DB_SCALE_ITEM(0, 0, 0),
3, 7, TLV_DB_SCALE_ITEM(-600, 600, 0),
};
3, 7, TLV_DB_SCALE_ITEM(-600, 600, 0)
);

/* {-16, -13, -10, -7, -5.2, -3,3, -2.2, 0}dB, mute instead of -16dB */
static const unsigned int out_tlv[] = {
TLV_DB_RANGE_HEAD(4),
static const DECLARE_TLV_DB_RANGE(out_tlv,
0, 3, TLV_DB_SCALE_ITEM(-1600, 300, 1),
4, 4, TLV_DB_SCALE_ITEM(-520, 0, 0),
5, 5, TLV_DB_SCALE_ITEM(-330, 0, 0),
6, 7, TLV_DB_SCALE_ITEM(-220, 220, 0),
};
6, 7, TLV_DB_SCALE_ITEM(-220, 220, 0)
);

static const unsigned int st_tlv[] = {
TLV_DB_RANGE_HEAD(8),
static const DECLARE_TLV_DB_RANGE(st_tlv,
0, 1, TLV_DB_SCALE_ITEM(-12041, 602, 0),
2, 3, TLV_DB_SCALE_ITEM(-11087, 250, 0),
4, 5, TLV_DB_SCALE_ITEM(-10643, 158, 0),
6, 7, TLV_DB_SCALE_ITEM(-10351, 116, 0),
8, 9, TLV_DB_SCALE_ITEM(-10133, 92, 0),
10, 13, TLV_DB_SCALE_ITEM(-9958, 70, 0),
14, 17, TLV_DB_SCALE_ITEM(-9689, 53, 0),
18, 271, TLV_DB_SCALE_ITEM(-9484, 37, 0),
};
18, 271, TLV_DB_SCALE_ITEM(-9484, 37, 0)
);

/* Sidetone Gain = M * 2^(-5-N) */
struct st_gain {
Expand Down
7 changes: 3 additions & 4 deletions sound/soc/codecs/ab8500-codec.c
Original file line number Diff line number Diff line change
Expand Up @@ -1335,11 +1335,10 @@ static DECLARE_TLV_DB_SCALE(dax_dig_gain_tlv, -6300, 100, 1);
static DECLARE_TLV_DB_SCALE(hs_ear_dig_gain_tlv, -100, 100, 1);
/* -1dB = Mute */

static const unsigned int hs_gain_tlv[] = {
TLV_DB_RANGE_HEAD(2),
static const DECLARE_TLV_DB_RANGE(hs_gain_tlv,
0, 3, TLV_DB_SCALE_ITEM(-3200, 400, 0),
4, 15, TLV_DB_SCALE_ITEM(-1800, 200, 0),
};
4, 15, TLV_DB_SCALE_ITEM(-1800, 200, 0)
);

static DECLARE_TLV_DB_SCALE(mic_gain_tlv, 0, 100, 0);

Expand Down
21 changes: 9 additions & 12 deletions sound/soc/codecs/adau1373.c
Original file line number Diff line number Diff line change
Expand Up @@ -320,13 +320,12 @@ static const struct reg_default adau1373_reg_defaults[] = {
{ ADAU1373_DIGEN, 0x00 },
};

static const unsigned int adau1373_out_tlv[] = {
TLV_DB_RANGE_HEAD(4),
static const DECLARE_TLV_DB_RANGE(adau1373_out_tlv,
0, 7, TLV_DB_SCALE_ITEM(-7900, 400, 1),
8, 15, TLV_DB_SCALE_ITEM(-4700, 300, 0),
16, 23, TLV_DB_SCALE_ITEM(-2300, 200, 0),
24, 31, TLV_DB_SCALE_ITEM(-700, 100, 0),
};
24, 31, TLV_DB_SCALE_ITEM(-700, 100, 0)
);

static const DECLARE_TLV_DB_MINMAX(adau1373_digital_tlv, -9563, 0);
static const DECLARE_TLV_DB_SCALE(adau1373_in_pga_tlv, -1300, 100, 1);
Expand Down Expand Up @@ -381,12 +380,11 @@ static const char *adau1373_bass_hpf_cutoff_text[] = {
"158Hz", "232Hz", "347Hz", "520Hz",
};

static const unsigned int adau1373_bass_tlv[] = {
TLV_DB_RANGE_HEAD(3),
static const DECLARE_TLV_DB_RANGE(adau1373_bass_tlv,
0, 2, TLV_DB_SCALE_ITEM(-600, 600, 1),
3, 4, TLV_DB_SCALE_ITEM(950, 250, 0),
5, 7, TLV_DB_SCALE_ITEM(1400, 150, 0),
};
5, 7, TLV_DB_SCALE_ITEM(1400, 150, 0)
);

static SOC_ENUM_SINGLE_DECL(adau1373_bass_lpf_cutoff_enum,
ADAU1373_BASS1, 5, adau1373_bass_lpf_cutoff_text);
Expand Down Expand Up @@ -414,11 +412,10 @@ static SOC_ENUM_SINGLE_DECL(adau1373_3d_level_enum,
static SOC_ENUM_SINGLE_DECL(adau1373_3d_cutoff_enum,
ADAU1373_3D_CTRL1, 0, adau1373_3d_cutoff_text);

static const unsigned int adau1373_3d_tlv[] = {
TLV_DB_RANGE_HEAD(2),
static const DECLARE_TLV_DB_RANGE(adau1373_3d_tlv,
0, 0, TLV_DB_SCALE_ITEM(0, 0, 0),
1, 7, TLV_DB_LINEAR_ITEM(-1800, -120),
};
1, 7, TLV_DB_LINEAR_ITEM(-1800, -120)
);

static const char *adau1373_lr_mux_text[] = {
"Mute",
Expand Down
7 changes: 3 additions & 4 deletions sound/soc/codecs/alc5623.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,11 @@ static int amp_mixer_event(struct snd_soc_dapm_widget *w,
static const DECLARE_TLV_DB_SCALE(vol_tlv, -3450, 150, 0);
static const DECLARE_TLV_DB_SCALE(hp_tlv, -4650, 150, 0);
static const DECLARE_TLV_DB_SCALE(adc_rec_tlv, -1650, 150, 0);
static const unsigned int boost_tlv[] = {
TLV_DB_RANGE_HEAD(3),
static const DECLARE_TLV_DB_RANGE(boost_tlv,
0, 0, TLV_DB_SCALE_ITEM(0, 0, 0),
1, 1, TLV_DB_SCALE_ITEM(2000, 0, 0),
2, 2, TLV_DB_SCALE_ITEM(3000, 0, 0),
};
2, 2, TLV_DB_SCALE_ITEM(3000, 0, 0)
);
static const DECLARE_TLV_DB_SCALE(dig_tlv, 0, 600, 0);

static const struct snd_kcontrol_new alc5621_vol_snd_controls[] = {
Expand Down
7 changes: 3 additions & 4 deletions sound/soc/codecs/alc5632.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,11 +146,10 @@ static const DECLARE_TLV_DB_SCALE(vol_tlv, -3450, 150, 0);
static const DECLARE_TLV_DB_SCALE(hp_tlv, -4650, 150, 0);
/* -16.5db min scale, 1.5db steps, no mute */
static const DECLARE_TLV_DB_SCALE(adc_rec_tlv, -1650, 150, 0);
static const unsigned int boost_tlv[] = {
TLV_DB_RANGE_HEAD(2),
static const DECLARE_TLV_DB_RANGE(boost_tlv,
0, 1, TLV_DB_SCALE_ITEM(0, 2000, 0),
1, 3, TLV_DB_SCALE_ITEM(2000, 1000, 0),
};
1, 3, TLV_DB_SCALE_ITEM(2000, 1000, 0)
);
/* 0db min scale, 6 db steps, no mute */
static const DECLARE_TLV_DB_SCALE(dig_tlv, 0, 600, 0);
/* 0db min scalem 0.75db steps, no mute */
Expand Down
7 changes: 3 additions & 4 deletions sound/soc/codecs/cs42l52.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,10 @@ static DECLARE_TLV_DB_SCALE(mix_tlv, -50, 50, 0);

static DECLARE_TLV_DB_SCALE(beep_tlv, -56, 200, 0);

static const unsigned int limiter_tlv[] = {
TLV_DB_RANGE_HEAD(2),
static const DECLARE_TLV_DB_RANGE(limiter_tlv,
0, 2, TLV_DB_SCALE_ITEM(-3000, 600, 0),
3, 7, TLV_DB_SCALE_ITEM(-1200, 300, 0),
};
3, 7, TLV_DB_SCALE_ITEM(-1200, 300, 0)
);

static const char * const cs42l52_adca_text[] = {
"Input1A", "Input2A", "Input3A", "Input4A", "PGA Input Left"};
Expand Down
21 changes: 9 additions & 12 deletions sound/soc/codecs/cs42l56.c
Original file line number Diff line number Diff line change
Expand Up @@ -140,21 +140,18 @@ static DECLARE_TLV_DB_SCALE(tone_tlv, -1050, 150, 0);
static DECLARE_TLV_DB_SCALE(preamp_tlv, 0, 1000, 0);
static DECLARE_TLV_DB_SCALE(pga_tlv, -600, 50, 0);

static const unsigned int ngnb_tlv[] = {
TLV_DB_RANGE_HEAD(2),
static const DECLARE_TLV_DB_RANGE(ngnb_tlv,
0, 1, TLV_DB_SCALE_ITEM(-8200, 600, 0),
2, 5, TLV_DB_SCALE_ITEM(-7600, 300, 0),
};
static const unsigned int ngb_tlv[] = {
TLV_DB_RANGE_HEAD(2),
2, 5, TLV_DB_SCALE_ITEM(-7600, 300, 0)
);
static const DECLARE_TLV_DB_RANGE(ngb_tlv,
0, 2, TLV_DB_SCALE_ITEM(-6400, 600, 0),
3, 7, TLV_DB_SCALE_ITEM(-4600, 300, 0),
};
static const unsigned int alc_tlv[] = {
TLV_DB_RANGE_HEAD(2),
3, 7, TLV_DB_SCALE_ITEM(-4600, 300, 0)
);
static const DECLARE_TLV_DB_RANGE(alc_tlv,
0, 2, TLV_DB_SCALE_ITEM(-3000, 600, 0),
3, 7, TLV_DB_SCALE_ITEM(-1200, 300, 0),
};
3, 7, TLV_DB_SCALE_ITEM(-1200, 300, 0)
);

static const char * const beep_config_text[] = {
"Off", "Single", "Multiple", "Continuous"
Expand Down
14 changes: 6 additions & 8 deletions sound/soc/codecs/cs42l73.c
Original file line number Diff line number Diff line change
Expand Up @@ -161,11 +161,10 @@ static bool cs42l73_readable_register(struct device *dev, unsigned int reg)
}
}

static const unsigned int hpaloa_tlv[] = {
TLV_DB_RANGE_HEAD(2),
static const DECLARE_TLV_DB_RANGE(hpaloa_tlv,
0, 13, TLV_DB_SCALE_ITEM(-7600, 200, 0),
14, 75, TLV_DB_SCALE_ITEM(-4900, 100, 0),
};
14, 75, TLV_DB_SCALE_ITEM(-4900, 100, 0)
);

static DECLARE_TLV_DB_SCALE(adc_boost_tlv, 0, 2500, 0);

Expand All @@ -175,11 +174,10 @@ static DECLARE_TLV_DB_SCALE(ipd_tlv, -9600, 100, 0);

static DECLARE_TLV_DB_SCALE(micpga_tlv, -600, 50, 0);

static const unsigned int limiter_tlv[] = {
TLV_DB_RANGE_HEAD(2),
static const DECLARE_TLV_DB_RANGE(limiter_tlv,
0, 2, TLV_DB_SCALE_ITEM(-3000, 600, 0),
3, 7, TLV_DB_SCALE_ITEM(-1200, 300, 0),
};
3, 7, TLV_DB_SCALE_ITEM(-1200, 300, 0)
);

static const DECLARE_TLV_DB_SCALE(attn_tlv, -6300, 100, 1);

Expand Down
22 changes: 9 additions & 13 deletions sound/soc/codecs/da7210.c
Original file line number Diff line number Diff line change
Expand Up @@ -267,33 +267,29 @@ enum clk_src {
*
* Reserved area are considered as "mute".
*/
static const unsigned int hp_out_tlv[] = {
TLV_DB_RANGE_HEAD(2),
static const DECLARE_TLV_DB_RANGE(hp_out_tlv,
0x0, 0x10, TLV_DB_SCALE_ITEM(TLV_DB_GAIN_MUTE, 0, 1),
/* -54 dB to +15 dB */
0x11, 0x3f, TLV_DB_SCALE_ITEM(-5400, 150, 0),
};
0x11, 0x3f, TLV_DB_SCALE_ITEM(-5400, 150, 0)
);

static const unsigned int lineout_vol_tlv[] = {
TLV_DB_RANGE_HEAD(2),
static const DECLARE_TLV_DB_RANGE(lineout_vol_tlv,
0x0, 0x10, TLV_DB_SCALE_ITEM(TLV_DB_GAIN_MUTE, 0, 1),
/* -54dB to 15dB */
0x11, 0x3f, TLV_DB_SCALE_ITEM(-5400, 150, 0)
};
);

static const unsigned int mono_vol_tlv[] = {
TLV_DB_RANGE_HEAD(2),
static const DECLARE_TLV_DB_RANGE(mono_vol_tlv,
0x0, 0x2, TLV_DB_SCALE_ITEM(-1800, 0, 1),
/* -18dB to 6dB */
0x3, 0x7, TLV_DB_SCALE_ITEM(-1800, 600, 0)
};
);

static const unsigned int aux1_vol_tlv[] = {
TLV_DB_RANGE_HEAD(2),
static const DECLARE_TLV_DB_RANGE(aux1_vol_tlv,
0x0, 0x10, TLV_DB_SCALE_ITEM(TLV_DB_GAIN_MUTE, 0, 1),
/* -48dB to 21dB */
0x11, 0x3f, TLV_DB_SCALE_ITEM(-4800, 150, 0)
};
);

static const DECLARE_TLV_DB_SCALE(eq_gain_tlv, -1050, 150, 0);
static const DECLARE_TLV_DB_SCALE(adc_eq_master_gain_tlv, -1800, 600, 1);
Expand Down
15 changes: 6 additions & 9 deletions sound/soc/codecs/da7213.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,27 +28,24 @@


/* Gain and Volume */
static const unsigned int aux_vol_tlv[] = {
TLV_DB_RANGE_HEAD(2),
static const DECLARE_TLV_DB_RANGE(aux_vol_tlv,
/* -54dB */
0x0, 0x11, TLV_DB_SCALE_ITEM(-5400, 0, 0),
/* -52.5dB to 15dB */
0x12, 0x3f, TLV_DB_SCALE_ITEM(-5250, 150, 0)
};
);

static const unsigned int digital_gain_tlv[] = {
TLV_DB_RANGE_HEAD(2),
static const DECLARE_TLV_DB_RANGE(digital_gain_tlv,
0x0, 0x07, TLV_DB_SCALE_ITEM(TLV_DB_GAIN_MUTE, 0, 1),
/* -78dB to 12dB */
0x08, 0x7f, TLV_DB_SCALE_ITEM(-7800, 75, 0)
};
);

static const unsigned int alc_analog_gain_tlv[] = {
TLV_DB_RANGE_HEAD(2),
static const DECLARE_TLV_DB_RANGE(alc_analog_gain_tlv,
0x0, 0x0, TLV_DB_SCALE_ITEM(TLV_DB_GAIN_MUTE, 0, 1),
/* 0dB to 36dB */
0x01, 0x07, TLV_DB_SCALE_ITEM(0, 600, 0)
};
);

static const DECLARE_TLV_DB_SCALE(mic_vol_tlv, -600, 600, 0);
static const DECLARE_TLV_DB_SCALE(mixin_gain_tlv, -450, 150, 0);
Expand Down
15 changes: 6 additions & 9 deletions sound/soc/codecs/da9055.c
Original file line number Diff line number Diff line change
Expand Up @@ -289,26 +289,23 @@ enum clk_src {

/* Gain and Volume */

static const unsigned int aux_vol_tlv[] = {
TLV_DB_RANGE_HEAD(2),
static const DECLARE_TLV_DB_RANGE(aux_vol_tlv,
0x0, 0x10, TLV_DB_SCALE_ITEM(-5400, 0, 0),
/* -54dB to 15dB */
0x11, 0x3f, TLV_DB_SCALE_ITEM(-5400, 150, 0)
};
);

static const unsigned int digital_gain_tlv[] = {
TLV_DB_RANGE_HEAD(2),
static const DECLARE_TLV_DB_RANGE(digital_gain_tlv,
0x0, 0x07, TLV_DB_SCALE_ITEM(TLV_DB_GAIN_MUTE, 0, 1),
/* -78dB to 12dB */
0x08, 0x7f, TLV_DB_SCALE_ITEM(-7800, 75, 0)
};
);

static const unsigned int alc_analog_gain_tlv[] = {
TLV_DB_RANGE_HEAD(2),
static const DECLARE_TLV_DB_RANGE(alc_analog_gain_tlv,
0x0, 0x0, TLV_DB_SCALE_ITEM(TLV_DB_GAIN_MUTE, 0, 1),
/* 0dB to 36dB */
0x01, 0x07, TLV_DB_SCALE_ITEM(0, 600, 0)
};
);

static const DECLARE_TLV_DB_SCALE(mic_vol_tlv, -600, 600, 0);
static const DECLARE_TLV_DB_SCALE(mixin_gain_tlv, -450, 150, 0);
Expand Down
7 changes: 3 additions & 4 deletions sound/soc/codecs/jz4740.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,10 @@ struct jz4740_codec {
struct regmap *regmap;
};

static const unsigned int jz4740_mic_tlv[] = {
TLV_DB_RANGE_HEAD(2),
static const DECLARE_TLV_DB_RANGE(jz4740_mic_tlv,
0, 2, TLV_DB_SCALE_ITEM(0, 600, 0),
3, 3, TLV_DB_SCALE_ITEM(2000, 0, 0),
};
3, 3, TLV_DB_SCALE_ITEM(2000, 0, 0)
);

static const DECLARE_TLV_DB_SCALE(jz4740_out_tlv, 0, 200, 0);
static const DECLARE_TLV_DB_SCALE(jz4740_in_tlv, -3450, 150, 0);
Expand Down
7 changes: 3 additions & 4 deletions sound/soc/codecs/max9768.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,7 @@ static int max9768_set_gpio(struct snd_kcontrol *kcontrol,
return 0;
}

static const unsigned int volume_tlv[] = {
TLV_DB_RANGE_HEAD(43),
static const DECLARE_TLV_DB_RANGE(volume_tlv,
0, 0, TLV_DB_SCALE_ITEM(-16150, 0, 0),
1, 1, TLV_DB_SCALE_ITEM(-9280, 0, 0),
2, 2, TLV_DB_SCALE_ITEM(-9030, 0, 0),
Expand Down Expand Up @@ -107,8 +106,8 @@ static const unsigned int volume_tlv[] = {
51, 57, TLV_DB_SCALE_ITEM(290, 50, 0),
58, 58, TLV_DB_SCALE_ITEM(650, 0, 0),
59, 62, TLV_DB_SCALE_ITEM(700, 60, 0),
63, 63, TLV_DB_SCALE_ITEM(950, 0, 0),
};
63, 63, TLV_DB_SCALE_ITEM(950, 0, 0)
);

static const struct snd_kcontrol_new max9768_volume[] = {
SOC_SINGLE_TLV("Playback Volume", MAX9768_VOL, 0, 63, 0, volume_tlv),
Expand Down
Loading

0 comments on commit 428157c

Please sign in to comment.