Commit f289e55c authored by Jeff Chang's avatar Jeff Chang Committed by Mark Brown

ASoC: Add MediaTek MT6660 Speaker Amp Driver

The MT6660 is a boosted BTL class-D amplifier with V/I sensing.
A built-in DC-DC step-up converter is used to provide efficient
power for class-D amplifier with multi-level class-G operation.
The digital audio interface supports I2S, left-justified,
right-justified, TDM and DSP A/B format for audio in with a data
out used for chip information like voltage sense and current
sense, which are able to be monitored via DATAO through proper
Signed-off-by: default avatarJeff Chang <jeff_chang@richtek.com>
Link: https://lore.kernel.org/r/1579153597-23286-1-git-send-email-richtek.jeff.chang@gmail.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 26aa1917
......@@ -125,6 +125,7 @@ config SND_SOC_ALL_CODECS
select SND_SOC_ML26124 if I2C
select SND_SOC_MT6351 if MTK_PMIC_WRAP
select SND_SOC_MT6358 if MTK_PMIC_WRAP
select SND_SOC_MT6660 if I2C
select SND_SOC_NAU8540 if I2C
select SND_SOC_NAU8810 if I2C
select SND_SOC_NAU8822 if I2C
......@@ -1573,6 +1574,15 @@ config SND_SOC_MT6358
Enable support for the platform which uses MT6358 as
external codec device.
config SND_SOC_MT6660
tristate "Mediatek MT6660 Speaker Amplifier"
depends on I2C
help
MediaTek MT6660 is a smart power amplifier which contain
speaker protection, multi-band DRC, equalizer functions.
Select N if you don't have MT6660 on board.
Select M to build this as module.
config SND_SOC_NAU8540
tristate "Nuvoton Technology Corporation NAU85L40 CODEC"
depends on I2C
......
......@@ -123,6 +123,7 @@ snd-soc-msm8916-analog-objs := msm8916-wcd-analog.o
snd-soc-msm8916-digital-objs := msm8916-wcd-digital.o
snd-soc-mt6351-objs := mt6351.o
snd-soc-mt6358-objs := mt6358.o
snd-soc-mt6660-objs := mt6660.o
snd-soc-nau8540-objs := nau8540.o
snd-soc-nau8810-objs := nau8810.o
snd-soc-nau8822-objs := nau8822.o
......@@ -419,6 +420,7 @@ obj-$(CONFIG_SND_SOC_MSM8916_WCD_ANALOG) +=snd-soc-msm8916-analog.o
obj-$(CONFIG_SND_SOC_MSM8916_WCD_DIGITAL) +=snd-soc-msm8916-digital.o
obj-$(CONFIG_SND_SOC_MT6351) += snd-soc-mt6351.o
obj-$(CONFIG_SND_SOC_MT6358) += snd-soc-mt6358.o
obj-$(CONFIG_SND_SOC_MT6660) += snd-soc-mt6660.o
obj-$(CONFIG_SND_SOC_NAU8540) += snd-soc-nau8540.o
obj-$(CONFIG_SND_SOC_NAU8810) += snd-soc-nau8810.o
obj-$(CONFIG_SND_SOC_NAU8822) += snd-soc-nau8822.o
......
This diff is collapsed.
/* SPDX-License-Identifier: GPL-2.0 */
/*
* Copyright (c) 2019 MediaTek Inc.
*/
#ifndef __SND_SOC_MT6660_H
#define __SND_SOC_MT6660_H
#include <linux/mutex.h>
#include <linux/regmap.h>
#pragma pack(push, 1)
struct mt6660_platform_data {
u8 init_setting_num;
u32 *init_setting_addr;
u32 *init_setting_mask;
u32 *init_setting_val;
};
struct mt6660_chip {
struct i2c_client *i2c;
struct device *dev;
struct platform_device *param_dev;
struct mt6660_platform_data plat_data;
struct mutex io_lock;
struct regmap *regmap;
u16 chip_rev;
};
#pragma pack(pop)
#define MT6660_REG_DEVID (0x00)
#define MT6660_REG_SYSTEM_CTRL (0x03)
#define MT6660_REG_IRQ_STATUS1 (0x05)
#define MT6660_REG_ADDA_CLOCK (0x07)
#define MT6660_REG_SERIAL_CFG1 (0x10)
#define MT6660_REG_DATAO_SEL (0x12)
#define MT6660_REG_TDM_CFG3 (0x15)
#define MT6660_REG_HPF_CTRL (0x18)
#define MT6660_REG_HPF1_COEF (0x1A)
#define MT6660_REG_HPF2_COEF (0x1B)
#define MT6660_REG_PATH_BYPASS (0x1E)
#define MT6660_REG_WDT_CTRL (0x20)
#define MT6660_REG_HCLIP_CTRL (0x24)
#define MT6660_REG_VOL_CTRL (0x29)
#define MT6660_REG_SPS_CTRL (0x30)
#define MT6660_REG_SIGMAX (0x33)
#define MT6660_REG_CALI_T0 (0x3F)
#define MT6660_REG_BST_CTRL (0x40)
#define MT6660_REG_PROTECTION_CFG (0x46)
#define MT6660_REG_DA_GAIN (0x4c)
#define MT6660_REG_AUDIO_IN2_SEL (0x50)
#define MT6660_REG_SIG_GAIN (0x51)
#define MT6660_REG_PLL_CFG1 (0x60)
#define MT6660_REG_DRE_CTRL (0x68)
#define MT6660_REG_DRE_THDMODE (0x69)
#define MT6660_REG_DRE_CORASE (0x6B)
#define MT6660_REG_PWM_CTRL (0x70)
#define MT6660_REG_DC_PROTECT_CTRL (0x74)
#define MT6660_REG_ADC_USB_MODE (0x7c)
#define MT6660_REG_INTERNAL_CFG (0x88)
#define MT6660_REG_RESV0 (0x98)
#define MT6660_REG_RESV1 (0x99)
#define MT6660_REG_RESV2 (0x9A)
#define MT6660_REG_RESV3 (0x9B)
#define MT6660_REG_RESV6 (0xA2)
#define MT6660_REG_RESV7 (0xA3)
#define MT6660_REG_RESV10 (0xB0)
#define MT6660_REG_RESV11 (0xB1)
#define MT6660_REG_RESV16 (0xB6)
#define MT6660_REG_RESV17 (0xB7)
#define MT6660_REG_RESV19 (0xB9)
#define MT6660_REG_RESV21 (0xBB)
#define MT6660_REG_RESV23 (0xBD)
#define MT6660_REG_RESV31 (0xD3)
#define MT6660_REG_RESV40 (0xE0)
#endif /* __SND_SOC_MT6660_H */
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