This commit is contained in:
lijie02 2019-01-11 16:17:28 +08:00
commit fd52e99587
11 changed files with 2467 additions and 28 deletions

View File

@ -464,7 +464,7 @@
};
daudio1_pins_a: daudio1@0 {
allwinner,pins = "PG9", "PG10", "PG11",
allwinner,pins = "PG10", "PG11",
"PG12", "PG13";
allwinner,function = "i2s1";
allwinner,muxsel = <3>;
@ -473,7 +473,7 @@
};
daudio1_pins_b: daudio1_sleep@0 {
allwinner,pins = "PG9", "PG10", "PG11",
allwinner,pins = "PG10", "PG11",
"PG12", "PG13";
allwinner,function = "io_disabled";
allwinner,muxsel = <7>;

View File

@ -28,6 +28,16 @@ static int __init r311_probe(struct platform_device *pdev) {
const char *io_name = '\0';
struct regulator *reg = NULL;
gpionum = of_get_named_gpio_flags(np, "mute", 0,
(enum of_gpio_flags *)&cfg);
if (gpio_is_valid(gpionum)) {
gpio_request(gpionum, "mute");
gpio_direction_output(gpionum, 1);
printk("Set mute(%d) to 1 success\n", gpionum);
} else {
printk("Set mute fail\n");
}
if (of_property_read_string(np, "aldo4", &io_name)) {
printk("Wzj: can not get aldo4 name!!\n");
} else {

View File

@ -1090,7 +1090,11 @@ config SND_SOC_TPA6130A2
depends on I2C
config SND_SOC_ES7243
tristate "SND_SOC_ES7243"
tristate "ES7243 ADC Driver"
depends on I2C
config SND_SOC_ES7210
tristate "ES7210 ADC Driver"
depends on I2C
endmenu

View File

@ -227,8 +227,8 @@ snd-soc-ac100-objs := ac100_dapm.o
snd-soc-ac102-objs := ac102.o
snd-soc-ad82584f-objs := ad82584f.o
snd-soc-es7243-objs := es7243.o
obj-$(CONFIG_SND_SOC_ES7243) += es7243.o
obj-$(CONFIG_SND_SOC_ES7210) += es7210.o
obj-$(CONFIG_SND_SOC_88PM860X) += snd-soc-88pm860x.o
obj-$(CONFIG_SND_SOC_AB8500_CODEC) += snd-soc-ab8500-codec.o
obj-$(CONFIG_SND_SOC_AC97_CODEC) += snd-soc-ac97.o
@ -454,6 +454,3 @@ obj-$(CONFIG_SND_SOC_ACX00) += snd-soc-acx00.o
obj-$(CONFIG_SND_SOC_AD82584F) += snd-soc-ad82584f.o
obj-$(CONFIG_SND_SOC_AC100) += snd-soc-ac100.o
obj-$(CONFIG_SND_SOC_AC102) += snd-soc-ac102.o
obj-$(CONFIG_SND_SOC_ES7243) += snd-soc-es7243.o
obj-$(CONFIG_SND_SOC_ES7243) += es7243.o

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,76 @@
/*
* ALSA SoC ES7210 codec driver
*
* Author: David Yang, <yangxiaohua@everest-semi.com>
* or
* <info@everest-semi.com>
* Copyright: (C) 2018 Everest Semiconductor Co., 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 _ES7210_H
#define _ES7210_H
#define ES7210_RESET_CTL_REG00 0x00
#define ES7210_CLK_ON_OFF_REG01 0x01
#define ES7210_MCLK_CTL_REG02 0x02
#define ES7210_MST_CLK_CTL_REG03 0x03
#define ES7210_MST_LRCDIVH_REG04 0x04
#define ES7210_MST_LRCDIVL_REG05 0x05
#define ES7210_DIGITAL_PDN_REG06 0x06
#define ES7210_ADC_OSR_REG07 0x07
#define ES7210_MODE_CFG_REG08 0x08
#define ES7210_TCT0_CHPINI_REG09 0x09
#define ES7210_TCT1_CHPINI_REG0A 0x0A
#define ES7210_CHIP_STA_REG0B 0x0B
#define ES7210_IRQ_CTL_REG0C 0x0C
#define ES7210_MISC_CTL_REG0D 0x0D
#define ES7210_DMIC_CTL_REG10 0x10
#define ES7210_SDP_CFG1_REG11 0x11
#define ES7210_SDP_CFG2_REG12 0x12
#define ES7210_ADC_AUTOMUTE_REG13 0x13
#define ES7210_ADC34_MUTE_REG14 0x14
#define ES7210_ADC12_MUTE_REG15 0x15
#define ES7210_ALC_SEL_REG16 0x16
#define ES7210_ALC_COM_CFG1_REG17 0x17
#define ES7210_ALC34_LVL_REG18 0x18
#define ES7210_ALC12_LVL_REG19 0x19
#define ES7210_ALC_COM_CFG2_REG1A 0x1A
#define ES7210_ALC4_MAX_GAIN_REG1B 0x1B
#define ES7210_ALC3_MAX_GAIN_REG1C 0x1C
#define ES7210_ALC2_MAX_GAIN_REG1D 0x1D
#define ES7210_ALC1_MAX_GAIN_REG1E 0x1E
#define ES7210_ADC34_HPF2_REG20 0x20
#define ES7210_ADC34_HPF1_REG21 0x21
#define ES7210_ADC12_HPF2_REG22 0x22
#define ES7210_ADC12_HPF1_REG23 0x23
#define ES7210_CHP_ID1_REG3D 0x3D
#define ES7210_CHP_ID0_REG3E 0x3E
#define ES7210_CHP_VER_REG3F 0x3F
#define ES7210_ANALOG_SYS_REG40 0x40
#define ES7210_MICBIAS12_REG41 0x41
#define ES7210_MICBIAS34_REG42 0x42
#define ES7210_MIC1_GAIN_REG43 0x43
#define ES7210_MIC2_GAIN_REG44 0x44
#define ES7210_MIC3_GAIN_REG45 0x45
#define ES7210_MIC4_GAIN_REG46 0x46
#define ES7210_MIC1_LP_REG47 0x47
#define ES7210_MIC2_LP_REG48 0x48
#define ES7210_MIC3_LP_REG49 0x49
#define ES7210_MIC4_LP_REG4A 0x4A
#define ES7210_MIC12_PDN_REG4B 0x4B
#define ES7210_MIC34_PDN_REG4C 0x4C
#endif /* _ES7210_H_ */

View File

@ -1,3 +1,4 @@
#define DEBUG
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/init.h>
@ -276,6 +277,7 @@ static int es7243_pd(struct es7243_priv *es7243, struct device_node *np)
int ret = 0;
return ret;
}
static int es7243_i2c_probe(struct i2c_client *client,
const struct i2c_device_id *id)
{
@ -286,6 +288,7 @@ static int es7243_i2c_probe(struct i2c_client *client,
GFP_KERNEL);
if (!es7243)
return -ENOMEM;
es7243->regmap = devm_regmap_init_i2c(client, &es7243_regmap);
if (IS_ERR(es7243->regmap)) {
ret = PTR_ERR(es7243->regmap);
@ -302,8 +305,8 @@ static int es7243_i2c_probe(struct i2c_client *client,
if (ret != 0)
printk(KERN_DEBUG"es7243 i2c probe failed\n");
return ret;
}
static int es7243_i2c_remove(struct i2c_client *client)
{
snd_soc_unregister_codec(&client->dev);
@ -330,9 +333,9 @@ static struct i2c_driver es7243_i2c_driver = {
.remove = es7243_i2c_remove,
.id_table = es7243_i2c_id,
};
module_i2c_driver(es7243_i2c_driver);
//module_i2c_driver(es7243_i2c_driver);
#if 0
#if 1
static int __init es7243_init_module(void)
{
struct i2c_adapter *adapter = NULL;

View File

@ -12,7 +12,7 @@
* the License, or (at your option) any later version.
*
*/
#define DEBUG
#include <linux/module.h>
#include <linux/device.h>
#include <linux/io.h>

View File

@ -848,7 +848,8 @@ CONFIG_SND_SOC=y
# CONFIG_SND_SOC_BT_SCO is not set
# CONFIG_SND_SOC_CS35L33 is not set
# CONFIG_SND_SOC_CS53L30 is not set
# CONFIG_SND_SOC_ES7243 is not set
CONFIG_SND_SOC_ES7210=y
CONFIG_SND_SOC_ES7243=y
CONFIG_SND_SOC_GENERIC_DMAENGINE_PCM=y
CONFIG_SND_SOC_I2C_AND_SPI=y
# CONFIG_SND_SOC_IMG is not set

View File

@ -1250,8 +1250,8 @@ snddmic_used = 0
;--------------------------------------------------------------------------------
[snddaudio0]
snddaudio0_used = 1
;sunxi,snddaudio-codec = "es7243.0-0013"
;sunxi,snddaudio-codec-dai = "es7243"
sunxi,snddaudio-codec = "es7210.0-0040"
sunxi,snddaudio-codec-dai = "es7210"
;-----------------------------------------------------------------------------
[daudio0]
@ -1260,11 +1260,11 @@ daudio_master = 4
tdm_config = 1
mclk_div = 2
clk_active = 0
audio_format = 3
audio_format = 1
signal_inversion = 1
pcm_lrck_period = 32
msb_lsb_first = 0
slot_width_select = 24
slot_width_select = 32
frametype = 0
;tx_data_mode = 1
;rx_data_mode = 1
@ -1275,23 +1275,26 @@ daudio_regulator =
; if register the sound card DAUDIO1.
;--------------------------------------------------------------------------------
[snddaudio1]
snddaudio1_used = 0
snddaudio1_used = 1
sunxi,snddaudio-codec = "es7243"
sunxi,snddaudio-codec-dai = "es7243-codec-dai"
;-----------------------------------------------------------------------------
[daudio1]
daudio1_used = 0
daudio1_used = 1
daudio_master = 4
tdm_config = 1
mclk_div = 1
mclk_div = 2
clk_active = 0
audio_format = 1
signal_inversion = 1
pcm_lrck_period = 256
;msb_lsb_first = 0
slot_width_select = 16
frametype = 1
pcm_lrck_period = 32
msb_lsb_first = 0
slot_width_select = 32
frametype = 0
;tx_data_mode = 1
;rx_data_mode = 1
daudio_regulator = "vcc-pg"
daudio_regulator =
;--------------------------------------------------------------------------------
;allwinner,headphonevol :headphone volume:0x0--0x3f 0db--(-62db) 1db/step
@ -1746,3 +1749,4 @@ bldo3 = "pmu1736_bldo3"
bldo4 = "pmu1736_bldo4"
cldo1 = "pmu1736_cldo1"
swout = "pmu1736_dc1sw"
mute = port:PL11<1><default><default><0>

View File

@ -1554,7 +1554,7 @@ CONFIG_PACKAGE_softap-demo=y
# CONFIG_PACKAGE_tina-app-upgrade is not set
# CONFIG_PACKAGE_tina-upgrade is not set
# CONFIG_PACKAGE_tinacvr is not set
# CONFIG_PACKAGE_tinymp3 is not set
CONFIG_PACKAGE_tinymp3=y
# CONFIG_PACKAGE_tsc_demo is not set
# CONFIG_PACKAGE_uevent-monitor is not set
# CONFIG_PACKAGE_usb-gadget is not set
@ -2540,7 +2540,7 @@ CONFIG_PACKAGE_libjson-c=y
# CONFIG_PACKAGE_liblua is not set
# CONFIG_PACKAGE_liblz4 is not set
# CONFIG_PACKAGE_liblzo is not set
# CONFIG_PACKAGE_libmad is not set
CONFIG_PACKAGE_libmad=y
# CONFIG_PACKAGE_libmcrypt is not set
# CONFIG_PACKAGE_libmicrohttpd is not set
# CONFIG_PACKAGE_libmijia is not set
@ -2888,6 +2888,13 @@ CONFIG_TTF2_SUPPORT=y
#
# CONFIG_PACKAGE_libcae is not set
CONFIG_PACKAGE_libduilite=y
#
# DUILITE SDK Select
#
# CONFIG_DUILITE_6MIC is not set
# CONFIG_DUILITE_4MIC is not set
CONFIG_DUILITE_2MIC=y
CONFIG_PACKAGE_libmsc=y
CONFIG_PACKAGE_libneteasedc=y
CONFIG_PACKAGE_libneteasevoicews=y
@ -2895,7 +2902,7 @@ CONFIG_PACKAGE_libyunxin=y
CONFIG_PACKAGE_KPlatinum=y
CONFIG_PACKAGE_KPlayer=y
CONFIG_PACKAGE_KPlayerTest=y
# CONFIG_PACKAGE_NeteaseInitScript is not set
CONFIG_PACKAGE_NeteaseInitScript=y
CONFIG_PACKAGE_SPlayer=y
CONFIG_PACKAGE_SPlayer-demo=y
CONFIG_PACKAGE_alarmer=y
@ -2935,6 +2942,8 @@ CONFIG_NETEASE_MSC_SDK=y
# CONFIG_NETEASE_CAE_SDK is not set
# CONFIG_XUNFEI_CAE_SDK is not set
CONFIG_NETEASE_DUILITE_SDK=y
# CONFIG_NETEASE_DUILITE_FESPA_SDK is not set
CONFIG_NETEASE_DUILITE_FESPL_SDK=y
CONFIG_NETEASE_TTS_SDK=y
# CONFIG_XUNFEI_TTS_SDK is not set
CONFIG_USED_NONE=y