You've already forked linux-rockchip
mirror of
https://github.com/armbian/linux-rockchip.git
synced 2026-01-06 11:08:10 -08:00
ASoC: tas2764: Add the driver for the TAS2764
Introduce the Texas Instruments TAS2764 amplifier driver with I/V sense for loud speaker applications. Signed-off-by: Dan Murphy <dmurphy@ti.com> Link: https://lore.kernel.org/r/20201007155341.10139-2-dmurphy@ti.com Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
@@ -195,6 +195,7 @@ config SND_SOC_ALL_CODECS
|
||||
imply SND_SOC_STI_SAS
|
||||
imply SND_SOC_TAS2552
|
||||
imply SND_SOC_TAS2562
|
||||
imply SND_SOC_TAS2764
|
||||
imply SND_SOC_TAS2770
|
||||
imply SND_SOC_TAS5086
|
||||
imply SND_SOC_TAS571X
|
||||
@@ -1303,6 +1304,10 @@ config SND_SOC_TAS2562
|
||||
tristate "Texas Instruments TAS2562 Mono Audio amplifier"
|
||||
depends on I2C
|
||||
|
||||
config SND_SOC_TAS2764
|
||||
tristate "Texas Instruments TAS2764 Mono Audio amplifier"
|
||||
depends on I2C
|
||||
|
||||
config SND_SOC_TAS2770
|
||||
tristate "Texas Instruments TAS2770 speaker amplifier"
|
||||
depends on I2C
|
||||
|
||||
@@ -304,6 +304,7 @@ snd-soc-simple-amplifier-objs := simple-amplifier.o
|
||||
snd-soc-tpa6130a2-objs := tpa6130a2.o
|
||||
snd-soc-tas2552-objs := tas2552.o
|
||||
snd-soc-tas2562-objs := tas2562.o
|
||||
snd-soc-tas2764-objs := tas2764.o
|
||||
|
||||
obj-$(CONFIG_SND_SOC_88PM860X) += snd-soc-88pm860x.o
|
||||
obj-$(CONFIG_SND_SOC_AB8500_CODEC) += snd-soc-ab8500-codec.o
|
||||
@@ -517,6 +518,7 @@ obj-$(CONFIG_SND_SOC_STAC9766) += snd-soc-stac9766.o
|
||||
obj-$(CONFIG_SND_SOC_STI_SAS) += snd-soc-sti-sas.o
|
||||
obj-$(CONFIG_SND_SOC_TAS2552) += snd-soc-tas2552.o
|
||||
obj-$(CONFIG_SND_SOC_TAS2562) += snd-soc-tas2562.o
|
||||
obj-$(CONFIG_SND_SOC_TAS2764) += snd-soc-tas2764.o
|
||||
obj-$(CONFIG_SND_SOC_TAS5086) += snd-soc-tas5086.o
|
||||
obj-$(CONFIG_SND_SOC_TAS571X) += snd-soc-tas571x.o
|
||||
obj-$(CONFIG_SND_SOC_TAS5720) += snd-soc-tas5720.o
|
||||
|
||||
688
sound/soc/codecs/tas2764.c
Normal file
688
sound/soc/codecs/tas2764.c
Normal file
File diff suppressed because it is too large
Load Diff
92
sound/soc/codecs/tas2764.h
Normal file
92
sound/soc/codecs/tas2764.h
Normal file
@@ -0,0 +1,92 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
/*
|
||||
* tas2764.h - ALSA SoC Texas Instruments TAS2764 Mono Audio Amplifier
|
||||
*
|
||||
* Copyright (C) 2020 Texas Instruments Incorporated - https://www.ti.com
|
||||
*
|
||||
* Author: Dan Murphy <dmurphy@ti.com>
|
||||
*/
|
||||
|
||||
#ifndef __TAS2764__
|
||||
#define __TAS2764__
|
||||
|
||||
/* Book Control Register */
|
||||
#define TAS2764_BOOKCTL_PAGE 0
|
||||
#define TAS2764_BOOKCTL_REG 127
|
||||
#define TAS2764_REG(page, reg) ((page * 128) + reg)
|
||||
|
||||
/* Page */
|
||||
#define TAS2764_PAGE TAS2764_REG(0X0, 0x00)
|
||||
#define TAS2764_PAGE_PAGE_MASK 255
|
||||
|
||||
/* Software Reset */
|
||||
#define TAS2764_SW_RST TAS2764_REG(0X0, 0x01)
|
||||
#define TAS2764_RST BIT(0)
|
||||
|
||||
/* Power Control */
|
||||
#define TAS2764_PWR_CTRL TAS2764_REG(0X0, 0x02)
|
||||
#define TAS2764_PWR_CTRL_MASK GENMASK(1, 0)
|
||||
#define TAS2764_PWR_CTRL_ACTIVE 0x0
|
||||
#define TAS2764_PWR_CTRL_MUTE BIT(0)
|
||||
#define TAS2764_PWR_CTRL_SHUTDOWN BIT(1)
|
||||
|
||||
#define TAS2764_VSENSE_POWER_EN 3
|
||||
#define TAS2764_ISENSE_POWER_EN 4
|
||||
|
||||
/* Digital Volume Control */
|
||||
#define TAS2764_DVC TAS2764_REG(0X0, 0x1a)
|
||||
#define TAS2764_DVC_MAX 0xc9
|
||||
|
||||
#define TAS2764_CHNL_0 TAS2764_REG(0X0, 0x03)
|
||||
|
||||
/* TDM Configuration Reg0 */
|
||||
#define TAS2764_TDM_CFG0 TAS2764_REG(0X0, 0x08)
|
||||
#define TAS2764_TDM_CFG0_SMP_MASK BIT(5)
|
||||
#define TAS2764_TDM_CFG0_SMP_48KHZ 0x0
|
||||
#define TAS2764_TDM_CFG0_SMP_44_1KHZ BIT(5)
|
||||
#define TAS2764_TDM_CFG0_MASK GENMASK(3, 1)
|
||||
#define TAS2764_TDM_CFG0_44_1_48KHZ BIT(3)
|
||||
#define TAS2764_TDM_CFG0_88_2_96KHZ (BIT(3) | BIT(1))
|
||||
|
||||
/* TDM Configuration Reg1 */
|
||||
#define TAS2764_TDM_CFG1 TAS2764_REG(0X0, 0x09)
|
||||
#define TAS2764_TDM_CFG1_MASK GENMASK(5, 1)
|
||||
#define TAS2764_TDM_CFG1_51_SHIFT 1
|
||||
#define TAS2764_TDM_CFG1_RX_MASK BIT(0)
|
||||
#define TAS2764_TDM_CFG1_RX_RISING 0x0
|
||||
#define TAS2764_TDM_CFG1_RX_FALLING BIT(0)
|
||||
|
||||
/* TDM Configuration Reg2 */
|
||||
#define TAS2764_TDM_CFG2 TAS2764_REG(0X0, 0x0a)
|
||||
#define TAS2764_TDM_CFG2_RXW_MASK GENMASK(3, 2)
|
||||
#define TAS2764_TDM_CFG2_RXW_16BITS 0x0
|
||||
#define TAS2764_TDM_CFG2_RXW_24BITS BIT(3)
|
||||
#define TAS2764_TDM_CFG2_RXW_32BITS (BIT(3) | BIT(2))
|
||||
#define TAS2764_TDM_CFG2_RXS_MASK GENMASK(1, 0)
|
||||
#define TAS2764_TDM_CFG2_RXS_16BITS 0x0
|
||||
#define TAS2764_TDM_CFG2_RXS_24BITS BIT(0)
|
||||
#define TAS2764_TDM_CFG2_RXS_32BITS BIT(1)
|
||||
#define TAS2764_TDM_CFG2_SCFG_MASK GENMASK(5, 4)
|
||||
#define TAS2764_TDM_CFG2_SCFG_I2S 0x0
|
||||
#define TAS2764_TDM_CFG2_SCFG_LEFT_J BIT(4)
|
||||
#define TAS2764_TDM_CFG2_SCFG_RIGHT_J BIT(5)
|
||||
|
||||
/* TDM Configuration Reg3 */
|
||||
#define TAS2764_TDM_CFG3 TAS2764_REG(0X0, 0x0c)
|
||||
#define TAS2764_TDM_CFG3_RXS_MASK GENMASK(7, 4)
|
||||
#define TAS2764_TDM_CFG3_RXS_SHIFT 0x4
|
||||
#define TAS2764_TDM_CFG3_MASK GENMASK(3, 0)
|
||||
|
||||
/* TDM Configuration Reg5 */
|
||||
#define TAS2764_TDM_CFG5 TAS2764_REG(0X0, 0x0e)
|
||||
#define TAS2764_TDM_CFG5_VSNS_MASK BIT(6)
|
||||
#define TAS2764_TDM_CFG5_VSNS_ENABLE BIT(6)
|
||||
#define TAS2764_TDM_CFG5_50_MASK GENMASK(5, 0)
|
||||
|
||||
/* TDM Configuration Reg6 */
|
||||
#define TAS2764_TDM_CFG6 TAS2764_REG(0X0, 0x0f)
|
||||
#define TAS2764_TDM_CFG6_ISNS_MASK BIT(6)
|
||||
#define TAS2764_TDM_CFG6_ISNS_ENABLE BIT(6)
|
||||
#define TAS2764_TDM_CFG6_50_MASK GENMASK(5, 0)
|
||||
|
||||
#endif /* __TAS2764__ */
|
||||
Reference in New Issue
Block a user