ASoC: es8316: add codec driver
Change-Id: I6896036a7af922747180535939074f399f8c38d1 Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
This commit is contained in:
parent
cadc68816f
commit
cdac375404
5 changed files with 297 additions and 504 deletions
23
Documentation/devicetree/bindings/sound/es8316.txt
Normal file
23
Documentation/devicetree/bindings/sound/es8316.txt
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
Everest ES8316 audio CODEC
|
||||
|
||||
Required properties:
|
||||
|
||||
- compatible: "everest,es8316"
|
||||
- reg: the I2C address of the device for I2C
|
||||
- spk-con-gpio: spk mute enable/disable
|
||||
- hp-det-gpio: headphone detect gpio
|
||||
Optional properties:
|
||||
|
||||
- clocks: The phandle of the master clock to the CODEC
|
||||
- clock-names: Should be "mclk"
|
||||
|
||||
Example:
|
||||
|
||||
codec: es8316@10 {
|
||||
compatible = "everest,es8316";
|
||||
reg = <0x10>;
|
||||
clocks = <&cru SCLK_I2S_8CH_OUT>;
|
||||
clock-names = "mclk";
|
||||
spk-con-gpio = <&gpio0 11 GPIO_ACTIVE_HIGH>;
|
||||
hp-det-gpio = <&gpio4 28 GPIO_ACTIVE_HIGH>;
|
||||
};
|
||||
|
|
@ -63,6 +63,7 @@ config SND_SOC_ALL_CODECS
|
|||
select SND_SOC_DA9055 if I2C
|
||||
select SND_SOC_DMIC
|
||||
select SND_SOC_BT_SCO
|
||||
select SND_SOC_ES8316 if I2C
|
||||
select SND_SOC_ES8328_SPI if SPI_MASTER
|
||||
select SND_SOC_ES8328_I2C if I2C
|
||||
select SND_SOC_GTM601
|
||||
|
|
@ -454,6 +455,10 @@ config SND_SOC_BT_SCO
|
|||
config SND_SOC_DMIC
|
||||
tristate
|
||||
|
||||
config SND_SOC_ES8316
|
||||
tristate "Everest Semi ES8316 CODEC"
|
||||
depends on I2C
|
||||
|
||||
config SND_SOC_ES8328
|
||||
tristate "Everest Semi ES8328 CODEC"
|
||||
|
||||
|
|
|
|||
|
|
@ -55,6 +55,7 @@ snd-soc-da732x-objs := da732x.o
|
|||
snd-soc-da9055-objs := da9055.o
|
||||
snd-soc-bt-sco-objs := bt-sco.o
|
||||
snd-soc-dmic-objs := dmic.o
|
||||
snd-soc-es8316-objs := es8316.o
|
||||
snd-soc-es8328-objs := es8328.o
|
||||
snd-soc-es8328-i2c-objs := es8328-i2c.o
|
||||
snd-soc-es8328-spi-objs := es8328-spi.o
|
||||
|
|
@ -250,6 +251,7 @@ obj-$(CONFIG_SND_SOC_DA732X) += snd-soc-da732x.o
|
|||
obj-$(CONFIG_SND_SOC_DA9055) += snd-soc-da9055.o
|
||||
obj-$(CONFIG_SND_SOC_BT_SCO) += snd-soc-bt-sco.o
|
||||
obj-$(CONFIG_SND_SOC_DMIC) += snd-soc-dmic.o
|
||||
obj-$(CONFIG_SND_SOC_ES8316) += snd-soc-es8316.o
|
||||
obj-$(CONFIG_SND_SOC_ES8328) += snd-soc-es8328.o
|
||||
obj-$(CONFIG_SND_SOC_ES8328_I2C)+= snd-soc-es8328-i2c.o
|
||||
obj-$(CONFIG_SND_SOC_ES8328_SPI)+= snd-soc-es8328-spi.o
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -131,4 +131,30 @@
|
|||
#define ES8316_CLKMGR_DAC_ANALOG_EN (0X1<<0)
|
||||
#define ES8316_CLKMGR_DAC_ANALOG_DIS (0X0<<0)
|
||||
|
||||
/* REGISTER 0X0A */
|
||||
#define ES8316_ADCWL_MASK (0x7 << 2)
|
||||
#define ES8316_ADCWL_32 (0x4 << 2)
|
||||
#define ES8316_ADCWL_24 (0x0 << 2)
|
||||
#define ES8316_ADCWL_20 (0x1 << 2)
|
||||
#define ES8316_ADCWL_18 (0x2 << 2)
|
||||
#define ES8316_ADCWL_16 (0x3 << 2)
|
||||
#define ES8316_ADCFMT_MASK (0x3 << 0)
|
||||
#define ES8316_ADCFMT_I2S (0x0 << 0)
|
||||
#define ES8316_ADCWL_LEFT (0x1 << 0)
|
||||
#define ES8316_ADCWL_RIGHT (0x2 << 0)
|
||||
#define ES8316_ADCWL_PCM (0x3 << 0)
|
||||
|
||||
/* REGISTER 0X0B */
|
||||
#define ES8316_DACWL_MASK (0x7 << 2)
|
||||
#define ES8316_DACWL_32 (0x4 << 2)
|
||||
#define ES8316_DACWL_24 (0x0 << 2)
|
||||
#define ES8316_DACWL_20 (0x1 << 2)
|
||||
#define ES8316_DACWL_18 (0x2 << 2)
|
||||
#define ES8316_DACWL_16 (0x3 << 2)
|
||||
#define ES8316_DACFMT_MASK (0x3 << 0)
|
||||
#define ES8316_DACFMT_I2S (0x0 << 0)
|
||||
#define ES8316_DACWL_LEFT (0x1 << 0)
|
||||
#define ES8316_DACWL_RIGHT (0x2 << 0)
|
||||
#define ES8316_DACWL_PCM (0x3 << 0)
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue