mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 19:30:30 +09:00
ASoC: codecs: Adds support for es8323
Replace digital_mute with mute_stream Replace component_read32 with component_read Change-Id: I8e0647310eb11325c39ebb408f75cc9ed28df71d Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
This commit is contained in:
@@ -91,6 +91,7 @@ config SND_SOC_ALL_CODECS
|
||||
imply SND_SOC_DMIC
|
||||
imply SND_SOC_DUMMY_CODEC
|
||||
imply SND_SOC_ES8316
|
||||
imply SND_SOC_ES8323
|
||||
imply SND_SOC_ES8328_SPI
|
||||
imply SND_SOC_ES8328_I2C
|
||||
imply SND_SOC_ES7134
|
||||
@@ -786,6 +787,10 @@ config SND_SOC_ES8316
|
||||
tristate "Everest Semi ES8316 CODEC"
|
||||
depends on I2C
|
||||
|
||||
config SND_SOC_ES8323
|
||||
tristate "Everest Semi ES8323 CODEC"
|
||||
depends on I2C
|
||||
|
||||
config SND_SOC_ES8328
|
||||
tristate
|
||||
|
||||
|
||||
@@ -88,6 +88,7 @@ snd-soc-dummy-codec-objs := dummy-codec.o
|
||||
snd-soc-es7134-objs := es7134.o
|
||||
snd-soc-es7241-objs := es7241.o
|
||||
snd-soc-es8316-objs := es8316.o
|
||||
snd-soc-es8323-objs := es8323.o
|
||||
snd-soc-es8328-objs := es8328.o
|
||||
snd-soc-es8328-i2c-objs := es8328-i2c.o
|
||||
snd-soc-es8328-spi-objs := es8328-spi.o
|
||||
@@ -403,6 +404,7 @@ obj-$(CONFIG_SND_SOC_DUMMY_CODEC) += snd-soc-dummy-codec.o
|
||||
obj-$(CONFIG_SND_SOC_ES7134) += snd-soc-es7134.o
|
||||
obj-$(CONFIG_SND_SOC_ES7241) += snd-soc-es7241.o
|
||||
obj-$(CONFIG_SND_SOC_ES8316) += snd-soc-es8316.o
|
||||
obj-$(CONFIG_SND_SOC_ES8323) += snd-soc-es8323.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
|
||||
|
||||
@@ -506,9 +506,9 @@ static int es8323_set_dai_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt)
|
||||
u8 adciface = 0;
|
||||
u8 daciface = 0;
|
||||
|
||||
iface = snd_soc_component_read32(component, ES8323_IFACE);
|
||||
adciface = snd_soc_component_read32(component, ES8323_ADC_IFACE);
|
||||
daciface = snd_soc_component_read32(component, ES8323_DAC_IFACE);
|
||||
iface = snd_soc_component_read(component, ES8323_IFACE);
|
||||
adciface = snd_soc_component_read(component, ES8323_ADC_IFACE);
|
||||
daciface = snd_soc_component_read(component, ES8323_DAC_IFACE);
|
||||
|
||||
/* set master/slave audio interface */
|
||||
switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) {
|
||||
@@ -601,9 +601,9 @@ static int es8323_pcm_hw_params(struct snd_pcm_substream *substream,
|
||||
{
|
||||
struct snd_soc_component *component = dai->component;
|
||||
struct es8323_priv *es8323 = snd_soc_component_get_drvdata(component);
|
||||
u16 srate = snd_soc_component_read32(component, ES8323_IFACE) & 0x80;
|
||||
u16 adciface = snd_soc_component_read32(component, ES8323_ADC_IFACE) & 0xE3;
|
||||
u16 daciface = snd_soc_component_read32(component, ES8323_DAC_IFACE) & 0xC7;
|
||||
u16 srate = snd_soc_component_read(component, ES8323_IFACE) & 0x80;
|
||||
u16 adciface = snd_soc_component_read(component, ES8323_ADC_IFACE) & 0xE3;
|
||||
u16 daciface = snd_soc_component_read(component, ES8323_DAC_IFACE) & 0xC7;
|
||||
int coeff;
|
||||
|
||||
coeff = get_coeff(es8323->sysclk, params_rate(params));
|
||||
@@ -653,7 +653,7 @@ static int es8323_pcm_hw_params(struct snd_pcm_substream *substream,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int es8323_mute(struct snd_soc_dai *dai, int mute)
|
||||
static int es8323_mute(struct snd_soc_dai *dai, int mute, int stream)
|
||||
{
|
||||
struct snd_soc_component *component = dai->component;
|
||||
struct es8323_priv *es8323 = snd_soc_component_get_drvdata(component);
|
||||
@@ -735,7 +735,8 @@ static struct snd_soc_dai_ops es8323_ops = {
|
||||
.hw_params = es8323_pcm_hw_params,
|
||||
.set_fmt = es8323_set_dai_fmt,
|
||||
.set_sysclk = es8323_set_dai_sysclk,
|
||||
.digital_mute = es8323_mute,
|
||||
.mute_stream = es8323_mute,
|
||||
.no_capture_mute = 1,
|
||||
};
|
||||
|
||||
static struct snd_soc_dai_driver es8323_dai = {
|
||||
@@ -883,7 +884,8 @@ static const struct regmap_config es8323_regmap_config = {
|
||||
.cache_type = REGCACHE_RBTREE,
|
||||
.reg_defaults = es8323_reg_defaults,
|
||||
.num_reg_defaults = ARRAY_SIZE(es8323_reg_defaults),
|
||||
.use_single_rw = true,
|
||||
.use_single_read = true,
|
||||
.use_single_write = true,
|
||||
};
|
||||
|
||||
static int es8323_i2c_probe(struct i2c_client *i2c,
|
||||
|
||||
Reference in New Issue
Block a user