Commit c1f27190 authored by Arun KS's avatar Arun KS Committed by Takashi Iwai

ALSA: ASoC: Add TLV320AIC23 codec driver

ASoC codec driver for TLV320AIC23 device
Signed-off-by: default avatarArun KS <arunks@mistralsolutions.com>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 869fbb36
...@@ -7,6 +7,7 @@ config SND_SOC_ALL_CODECS ...@@ -7,6 +7,7 @@ config SND_SOC_ALL_CODECS
select SND_SOC_AK4535 select SND_SOC_AK4535
select SND_SOC_CS4270 select SND_SOC_CS4270
select SND_SOC_SSM2602 select SND_SOC_SSM2602
select SND_SOC_TLV320AIC23
select SND_SOC_TLV320AIC26 select SND_SOC_TLV320AIC26
select SND_SOC_TLV320AIC3X select SND_SOC_TLV320AIC3X
select SND_SOC_UDA1380 select SND_SOC_UDA1380
...@@ -62,6 +63,10 @@ config SND_SOC_CS4270_VD33_ERRATA ...@@ -62,6 +63,10 @@ config SND_SOC_CS4270_VD33_ERRATA
config SND_SOC_SSM2602 config SND_SOC_SSM2602
tristate tristate
config SND_SOC_TLV320AIC23
tristate
depends on I2C
config SND_SOC_TLV320AIC26 config SND_SOC_TLV320AIC26
tristate "TI TLV320AIC26 Codec support" tristate "TI TLV320AIC26 Codec support"
depends on SND_SOC && SPI depends on SND_SOC && SPI
......
...@@ -4,6 +4,7 @@ snd-soc-ad73311-objs := ad73311.o ...@@ -4,6 +4,7 @@ snd-soc-ad73311-objs := ad73311.o
snd-soc-ak4535-objs := ak4535.o snd-soc-ak4535-objs := ak4535.o
snd-soc-cs4270-objs := cs4270.o snd-soc-cs4270-objs := cs4270.o
snd-soc-ssm2602-objs := ssm2602.o snd-soc-ssm2602-objs := ssm2602.o
snd-soc-tlv320aic23-objs := tlv320aic23.o
snd-soc-tlv320aic26-objs := tlv320aic26.o snd-soc-tlv320aic26-objs := tlv320aic26.o
snd-soc-tlv320aic3x-objs := tlv320aic3x.o snd-soc-tlv320aic3x-objs := tlv320aic3x.o
snd-soc-uda1380-objs := uda1380.o snd-soc-uda1380-objs := uda1380.o
...@@ -25,6 +26,7 @@ obj-$(CONFIG_SND_SOC_AD73311) += snd-soc-ad73311.o ...@@ -25,6 +26,7 @@ obj-$(CONFIG_SND_SOC_AD73311) += snd-soc-ad73311.o
obj-$(CONFIG_SND_SOC_AK4535) += snd-soc-ak4535.o obj-$(CONFIG_SND_SOC_AK4535) += snd-soc-ak4535.o
obj-$(CONFIG_SND_SOC_CS4270) += snd-soc-cs4270.o obj-$(CONFIG_SND_SOC_CS4270) += snd-soc-cs4270.o
obj-$(CONFIG_SND_SOC_SSM2602) += snd-soc-ssm2602.o obj-$(CONFIG_SND_SOC_SSM2602) += snd-soc-ssm2602.o
obj-$(CONFIG_SND_SOC_TLV320AIC23) += snd-soc-tlv320aic23.o
obj-$(CONFIG_SND_SOC_TLV320AIC26) += snd-soc-tlv320aic26.o obj-$(CONFIG_SND_SOC_TLV320AIC26) += snd-soc-tlv320aic26.o
obj-$(CONFIG_SND_SOC_TLV320AIC3X) += snd-soc-tlv320aic3x.o obj-$(CONFIG_SND_SOC_TLV320AIC3X) += snd-soc-tlv320aic3x.o
obj-$(CONFIG_SND_SOC_UDA1380) += snd-soc-uda1380.o obj-$(CONFIG_SND_SOC_UDA1380) += snd-soc-uda1380.o
......
This diff is collapsed.
/*
* ALSA SoC TLV320AIC23 codec driver
*
* Author: Arun KS, <arunks@mistralsolutions.com>
* Copyright: (C) 2008 Mistral Solutions Pvt Ltd
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
#ifndef _TLV320AIC23_H
#define _TLV320AIC23_H
/* Codec TLV320AIC23 */
#define TLV320AIC23_LINVOL 0x00
#define TLV320AIC23_RINVOL 0x01
#define TLV320AIC23_LCHNVOL 0x02
#define TLV320AIC23_RCHNVOL 0x03
#define TLV320AIC23_ANLG 0x04
#define TLV320AIC23_DIGT 0x05
#define TLV320AIC23_PWR 0x06
#define TLV320AIC23_DIGT_FMT 0x07
#define TLV320AIC23_SRATE 0x08
#define TLV320AIC23_ACTIVE 0x09
#define TLV320AIC23_RESET 0x0F
/* Left (right) line input volume control register */
#define TLV320AIC23_LRS_ENABLED 0x0100
#define TLV320AIC23_LIM_MUTED 0x0080
#define TLV320AIC23_LIV_DEFAULT 0x0017
#define TLV320AIC23_LIV_MAX 0x001f
#define TLV320AIC23_LIV_MIN 0x0000
/* Left (right) channel headphone volume control register */
#define TLV320AIC23_LZC_ON 0x0080
#define TLV320AIC23_LHV_DEFAULT 0x0079
#define TLV320AIC23_LHV_MAX 0x007f
#define TLV320AIC23_LHV_MIN 0x0000
/* Analog audio path control register */
#define TLV320AIC23_STA_REG(x) ((x)<<6)
#define TLV320AIC23_STE_ENABLED 0x0020
#define TLV320AIC23_DAC_SELECTED 0x0010
#define TLV320AIC23_BYPASS_ON 0x0008
#define TLV320AIC23_INSEL_MIC 0x0004
#define TLV320AIC23_MICM_MUTED 0x0002
#define TLV320AIC23_MICB_20DB 0x0001
/* Digital audio path control register */
#define TLV320AIC23_DACM_MUTE 0x0008
#define TLV320AIC23_DEEMP_32K 0x0002
#define TLV320AIC23_DEEMP_44K 0x0004
#define TLV320AIC23_DEEMP_48K 0x0006
#define TLV320AIC23_ADCHP_ON 0x0001
/* Power control down register */
#define TLV320AIC23_DEVICE_PWR_OFF 0x0080
#define TLV320AIC23_CLK_OFF 0x0040
#define TLV320AIC23_OSC_OFF 0x0020
#define TLV320AIC23_OUT_OFF 0x0010
#define TLV320AIC23_DAC_OFF 0x0008
#define TLV320AIC23_ADC_OFF 0x0004
#define TLV320AIC23_MIC_OFF 0x0002
#define TLV320AIC23_LINE_OFF 0x0001
/* Digital audio interface register */
#define TLV320AIC23_MS_MASTER 0x0040
#define TLV320AIC23_LRSWAP_ON 0x0020
#define TLV320AIC23_LRP_ON 0x0010
#define TLV320AIC23_IWL_16 0x0000
#define TLV320AIC23_IWL_20 0x0004
#define TLV320AIC23_IWL_24 0x0008
#define TLV320AIC23_IWL_32 0x000C
#define TLV320AIC23_FOR_I2S 0x0002
#define TLV320AIC23_FOR_DSP 0x0003
#define TLV320AIC23_FOR_LJUST 0x0001
/* Sample rate control register */
#define TLV320AIC23_CLKOUT_HALF 0x0080
#define TLV320AIC23_CLKIN_HALF 0x0040
#define TLV320AIC23_BOSR_384fs 0x0002 /* BOSR_272fs in USB mode */
#define TLV320AIC23_USB_CLK_ON 0x0001
#define TLV320AIC23_SR_MASK 0xf
#define TLV320AIC23_CLKOUT_SHIFT 7
#define TLV320AIC23_CLKIN_SHIFT 6
#define TLV320AIC23_SR_SHIFT 2
#define TLV320AIC23_BOSR_SHIFT 1
/* Digital interface register */
#define TLV320AIC23_ACT_ON 0x0001
/*
* AUDIO related MACROS
*/
#define TLV320AIC23_DEFAULT_OUT_VOL 0x70
#define TLV320AIC23_DEFAULT_IN_VOLUME 0x10
#define TLV320AIC23_OUT_VOL_MIN TLV320AIC23_LHV_MIN
#define TLV320AIC23_OUT_VOL_MAX TLV320AIC23_LHV_MAX
#define TLV320AIC23_OUT_VO_RANGE (TLV320AIC23_OUT_VOL_MAX - \
TLV320AIC23_OUT_VOL_MIN)
#define TLV320AIC23_OUT_VOL_MASK TLV320AIC23_OUT_VOL_MAX
#define TLV320AIC23_IN_VOL_MIN TLV320AIC23_LIV_MIN
#define TLV320AIC23_IN_VOL_MAX TLV320AIC23_LIV_MAX
#define TLV320AIC23_IN_VOL_RANGE (TLV320AIC23_IN_VOL_MAX - \
TLV320AIC23_IN_VOL_MIN)
#define TLV320AIC23_IN_VOL_MASK TLV320AIC23_IN_VOL_MAX
#define TLV320AIC23_SIDETONE_MASK 0x1c0
#define TLV320AIC23_SIDETONE_0 0x100
#define TLV320AIC23_SIDETONE_6 0x000
#define TLV320AIC23_SIDETONE_9 0x040
#define TLV320AIC23_SIDETONE_12 0x080
#define TLV320AIC23_SIDETONE_18 0x0c0
extern struct snd_soc_dai tlv320aic23_dai;
extern struct snd_soc_codec_device soc_codec_dev_tlv320aic23;
#endif /* _TLV320AIC23_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment