Commit 4717636f authored by Weidong Wang's avatar Weidong Wang Committed by Mark Brown

ASoC: codecs: Add aw87390 amplifier driver

Add i2c and amplifier registration for aw87390 and
their associated operation functions.
Signed-off-by: default avatarWeidong Wang <wangweidong.a@awinic.com>
Link: https://lore.kernel.org/r/20230928105727.47273-11-wangweidong.a@awinic.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent f83287a7
......@@ -54,6 +54,7 @@ config SND_SOC_ALL_CODECS
imply SND_SOC_ALC5632
imply SND_SOC_AUDIO_IIO_AUX
imply SND_SOC_AW8738
imply SND_SOC_AW87390
imply SND_SOC_AW88395
imply SND_SOC_AW88261
imply SND_SOC_BT_SCO
......@@ -639,12 +640,12 @@ config SND_SOC_AW8738
operation mode using the Awinic-specific one-wire pulse control.
config SND_SOC_AW88395_LIB
select CRC8
tristate
config SND_SOC_AW88395
tristate "Soc Audio for awinic aw88395"
depends on I2C
select CRC8
select CRC32
select REGMAP_I2C
select GPIOLIB
......@@ -658,7 +659,6 @@ config SND_SOC_AW88395
config SND_SOC_AW88261
tristate "Soc Audio for awinic aw88261"
depends on I2C
select CRC8
select REGMAP_I2C
select GPIOLIB
select SND_SOC_AW88395_LIB
......@@ -669,6 +669,17 @@ config SND_SOC_AW88261
boost converter can be adjusted smartly according to
the input amplitude.
config SND_SOC_AW87390
tristate "Soc Audio for awinic aw87390"
depends on I2C
select REGMAP_I2C
select SND_SOC_AW88395_LIB
help
The awinic aw87390 is specifically designed to improve
the musical output dynamic range, enhance the overall
sound quality, which is a new high efficiency, low
noise, constant large volume, 6th Smart K audio amplifier.
config SND_SOC_BD28623
tristate "ROHM BD28623 CODEC"
help
......
......@@ -47,6 +47,7 @@ snd-soc-ak5558-objs := ak5558.o
snd-soc-arizona-objs := arizona.o arizona-jack.o
snd-soc-audio-iio-aux-objs := audio-iio-aux.o
snd-soc-aw8738-objs := aw8738.o
snd-soc-aw87390-objs := aw87390.o
snd-soc-aw88395-lib-objs := aw88395/aw88395_lib.o
snd-soc-aw88395-objs := aw88395/aw88395.o \
aw88395/aw88395_device.o
......@@ -435,6 +436,7 @@ obj-$(CONFIG_SND_SOC_ALC5632) += snd-soc-alc5632.o
obj-$(CONFIG_SND_SOC_ARIZONA) += snd-soc-arizona.o
obj-$(CONFIG_SND_SOC_AUDIO_IIO_AUX) += snd-soc-audio-iio-aux.o
obj-$(CONFIG_SND_SOC_AW8738) += snd-soc-aw8738.o
obj-$(CONFIG_SND_SOC_AW87390) += snd-soc-aw87390.o
obj-$(CONFIG_SND_SOC_AW88395_LIB) += snd-soc-aw88395-lib.o
obj-$(CONFIG_SND_SOC_AW88395) +=snd-soc-aw88395.o
obj-$(CONFIG_SND_SOC_AW88261) +=snd-soc-aw88261.o
......
This diff is collapsed.
// SPDX-License-Identifier: GPL-2.0-only
//
// aw87390.h -- aw87390 ALSA SoC Audio driver
//
// Copyright (c) 2023 awinic Technology CO., LTD
//
// Author: Weidong Wang <wangweidong.a@awinic.com>
//
#ifndef __AW87390_H__
#define __AW87390_H__
#define AW87390_ID_REG (0x00)
#define AW87390_SYSCTRL_REG (0x01)
#define AW87390_MDCTRL_REG (0x02)
#define AW87390_CPOVP_REG (0x03)
#define AW87390_CPP_REG (0x04)
#define AW87390_PAG_REG (0x05)
#define AW87390_AGC3P_REG (0x06)
#define AW87390_AGC3PA_REG (0x07)
#define AW87390_AGC2P_REG (0x08)
#define AW87390_AGC2PA_REG (0x09)
#define AW87390_AGC1PA_REG (0x0A)
#define AW87390_SYSST_REG (0x59)
#define AW87390_SYSINT_REG (0x60)
#define AW87390_DFT_SYSCTRL_REG (0x61)
#define AW87390_DFT_MDCTRL_REG (0x62)
#define AW87390_DFT_CPADP_REG (0x63)
#define AW87390_DFT_AGCPA_REG (0x64)
#define AW87390_DFT_POFR_REG (0x65)
#define AW87390_DFT_OC_REG (0x66)
#define AW87390_DFT_ADP1_REG (0x67)
#define AW87390_DFT_REF_REG (0x68)
#define AW87390_DFT_LDO_REG (0x69)
#define AW87390_ADP1_REG (0x70)
#define AW87390_ADP2_REG (0x71)
#define AW87390_NG1_REG (0x72)
#define AW87390_NG2_REG (0x73)
#define AW87390_NG3_REG (0x74)
#define AW87390_CP_REG (0x75)
#define AW87390_AB_REG (0x76)
#define AW87390_TEST_REG (0x77)
#define AW87390_ENCR_REG (0x78)
#define AW87390_DELAY_REG_ADDR (0xFE)
#define AW87390_SOFT_RESET_VALUE (0xAA)
#define AW87390_POWER_DOWN_VALUE (0x00)
#define AW87390_REG_MAX (0xFF)
#define AW87390_DEV_DEFAULT_CH (0)
#define AW87390_INIT_PROFILE (0)
#define AW87390_REG_DELAY_TIME (1000)
#define AW87390_I2C_NAME "aw87390"
#define AW87390_ACF_FILE "aw87390_acf.bin"
#define AW87390_PROFILE_EXT(xname, profile_info, profile_get, profile_set) \
{ \
.iface = SNDRV_CTL_ELEM_IFACE_MIXER, \
.name = xname, \
.info = profile_info, \
.get = profile_get, \
.put = profile_set, \
}
enum aw87390_id {
AW87390_CHIP_ID = 0x76,
};
enum {
AW87390_DEV_FW_FAILED = 0,
AW87390_DEV_FW_OK,
};
enum {
AW87390_DEV_PW_OFF = 0,
AW87390_DEV_PW_ON,
};
struct aw87390 {
struct aw_device *aw_pa;
struct mutex lock;
struct regmap *regmap;
struct aw_container *aw_cfg;
};
#endif
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