Date:2012-04-16 22:21:12 (8 years 1 month ago)
Author:Lars C.
Commit:c6ebd3dd878a7df00c20bd7955718b2dc2f2a996
Message:ASoC: JZ4740: Add TLV information

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Files: sound/soc/codecs/jz4740.c (2 diffs)

Change Details

sound/soc/codecs/jz4740.c
2424#include <sound/pcm_params.h>
2525#include <sound/initval.h>
2626#include <sound/soc.h>
27#include <sound/tlv.h>
2728
2829#define JZ4740_REG_CODEC_1 0x0
2930#define JZ4740_REG_CODEC_2 0x1
...... 
9596    return 0;
9697}
9798
99static const unsigned int jz4740_mic_tlv[] = {
100    TLV_DB_RANGE_HEAD(2),
101    0, 2, TLV_DB_SCALE_ITEM(0, 600, 0),
102    3, 3, TLV_DB_SCALE_ITEM(2000, 0, 0),
103};
104
105static const DECLARE_TLV_DB_SCALE(jz4740_out_tlv, 0, 200, 0);
106static const DECLARE_TLV_DB_SCALE(jz4740_in_tlv, -3450, 150, 0);
107
98108static const struct snd_kcontrol_new jz4740_codec_controls[] = {
99    SOC_SINGLE("Master Playback Volume", JZ4740_REG_CODEC_2,
100            JZ4740_CODEC_2_HEADPHONE_VOLUME_OFFSET, 3, 0),
101    SOC_SINGLE("Master Capture Volume", JZ4740_REG_CODEC_2,
102            JZ4740_CODEC_2_INPUT_VOLUME_OFFSET, 31, 0),
109    SOC_SINGLE_TLV("Master Playback Volume", JZ4740_REG_CODEC_2,
110            JZ4740_CODEC_2_HEADPHONE_VOLUME_OFFSET, 3, 0, jz4740_out_tlv),
111    SOC_SINGLE_TLV("Master Capture Volume", JZ4740_REG_CODEC_2,
112            JZ4740_CODEC_2_INPUT_VOLUME_OFFSET, 31, 0, jz4740_in_tlv),
103113    SOC_SINGLE("Master Playback Switch", JZ4740_REG_CODEC_1,
104114            JZ4740_CODEC_1_HEADPHONE_DISABLE_OFFSET, 1, 1),
105    SOC_SINGLE("Mic Capture Volume", JZ4740_REG_CODEC_2,
106            JZ4740_CODEC_2_MIC_BOOST_GAIN_OFFSET, 3, 0),
115    SOC_SINGLE_TLV("Mic Capture Volume", JZ4740_REG_CODEC_2,
116            JZ4740_CODEC_2_MIC_BOOST_GAIN_OFFSET, 3, 0, jz4740_mic_tlv),
107117};
108118
109119static const struct snd_kcontrol_new jz4740_codec_output_controls[] = {

Archive Download the corresponding diff file



interactive