ASoC: add RT5670 CODEC driver
Subsystems (3)
PATCH v2 1/1 ASoC: add RT5670 CODEC driver
From: Bard Liao <[email protected]>
This patch adds a minimum support of Realtek ALC5670 codec.
---
Currently, only playback with headphone or line out and capture with digital mic are tested. We will add other patches for other functions.
This version do the following changes:
* Rename some widgets/controls.
* Merge all ASRC checking function to a single function.
* Change _MICBIAS to _SUPPLY
* Return error in unsupported slots or slot_width cases.
--- include/sound/rt5670.h | 27 + sound/soc/codecs/Kconfig | 6 + sound/soc/codecs/Makefile | 2 + sound/soc/codecs/rt5670-dsp.h | 54 + sound/soc/codecs/rt5670.c | 2692 +++++++++++++++++++++++++++++++++++++++++ sound/soc/codecs/rt5670.h | 2000 ++++++++++++++++++++++++++++++ 6 files changed, 4781 insertions(+) create mode 100644 include/sound/rt5670.h create mode 100644 sound/soc/codecs/rt5670-dsp.h create mode 100644 sound/soc/codecs/rt5670.c create mode 100644 sound/soc/codecs/rt5670.h
include/sound/rt5670.h new file +27 -0
@@ -0,0 +1,27 @@ +/* +* linux/sound/rt5670.h -- Platform data for RT5670 +* +* Copyright 2014 Realtek Microelectronics +* +* 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 __LINUX_SND_RT5670_H +#define __LINUX_SND_RT5670_H + +struct rt5670_platform_data { +int jd_mode; +bool in2_diff; + +bool dmic_en; +unsigned int dmic1_data_pin; +/* 0 = GPIO6; 1 = IN2P; 3 = GPIO7*/ +unsigned int dmic2_data_pin; +/* 0 = GPIO8; 1 = IN3N; */ +unsigned int dmic3_data_pin; +/* 0 = GPIO9; 1 = GPIO10; 2 = GPIO5*/ +}; + +#endif
sound/soc/codecs/Kconfig +6 -0
@@ -79,6 +79,7 @@ config SND_SOC_ALL_CODECS select SND_SOC_RT5640 if I2C select SND_SOC_RT5645 if I2C select SND_SOC_RT5651 if I2C + select SND_SOC_RT5670 if I2C select SND_SOC_RT5677 if I2C select SND_SOC_SGTL5000 if I2C select SND_SOC_SI476X if MFD_SI476X_CORE
@@ -451,10 +452,12 @@ config SND_SOC_RL6231 default y if SND_SOC_RT5640=y default y if SND_SOC_RT5645=y default y if SND_SOC_RT5651=y + default y if SND_SOC_RT5670=y default y if SND_SOC_RT5677=y default m if SND_SOC_RT5640=m default m if SND_SOC_RT5645=m default m if SND_SOC_RT5651=m + default m if SND_SOC_RT5670=m default m if SND_SOC_RT5677=m config SND_SOC_RT5631
@@ -469,6 +472,9 @@ config SND_SOC_RT5645 config SND_SOC_RT5651 tristate +config SND_SOC_RT5670 + tristate + config SND_SOC_RT5677 tristate
sound/soc/codecs/Makefile +2 -0
@@ -73,6 +73,7 @@ snd-soc-rt5631-objs := rt5631.o snd-soc-rt5640-objs := rt5640.o snd-soc-rt5645-objs := rt5645.o snd-soc-rt5651-objs := rt5651.o +snd-soc-rt5670-objs := rt5670.o snd-soc-rt5677-objs := rt5677.o snd-soc-sgtl5000-objs := sgtl5000.o snd-soc-alc5623-objs := alc5623.o
@@ -241,6 +242,7 @@ obj-$(CONFIG_SND_SOC_RT5631) += snd-soc-rt5631.o obj-$(CONFIG_SND_SOC_RT5640) += snd-soc-rt5640.o obj-$(CONFIG_SND_SOC_RT5645) += snd-soc-rt5645.o obj-$(CONFIG_SND_SOC_RT5651) += snd-soc-rt5651.o +obj-$(CONFIG_SND_SOC_RT5670) += snd-soc-rt5670.o obj-$(CONFIG_SND_SOC_RT5677) += snd-soc-rt5677.o obj-$(CONFIG_SND_SOC_SGTL5000) += snd-soc-sgtl5000.o obj-$(CONFIG_SND_SOC_SIGMADSP) += snd-soc-sigmadsp.o
sound/soc/codecs/rt5670-dsp.h new file +54 -0
54 lines not on this page · raw message
sound/soc/codecs/rt5670.c new file +2692 -0
2,692 lines not on this page · raw message
sound/soc/codecs/rt5670.h new file +2000 -0
185 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
1.8.1.1.439.g50a6b54
Part of the diff is not shown here. View the raw message.
Quoted 3 lines · On Mon, Jun 30, 2014 at 08:31:13PM +0800, [email protected] wrote:
From: Bard Liao <[email protected]>
This patch adds a minimum support of Realtek ALC5670 codec.
Applied, thanks.