Commit eae9f9ce authored by Raphael-Xu's avatar Raphael-Xu Committed by Mark Brown

ASoC: add tas2780 driver

1.update Kconfig and Makefile 2.add tas2780.c and tas2780.h
Signed-off-by: default avatarRaphael-Xu <13691752556@139.com>
Link: https://lore.kernel.org/r/20220707123343.2403-1-13691752556@139.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 0de876c1
...@@ -219,6 +219,7 @@ config SND_SOC_ALL_CODECS ...@@ -219,6 +219,7 @@ config SND_SOC_ALL_CODECS
imply SND_SOC_TAS2562 imply SND_SOC_TAS2562
imply SND_SOC_TAS2764 imply SND_SOC_TAS2764
imply SND_SOC_TAS2770 imply SND_SOC_TAS2770
imply SND_SOC_TAS2780
imply SND_SOC_TAS5086 imply SND_SOC_TAS5086
imply SND_SOC_TAS571X imply SND_SOC_TAS571X
imply SND_SOC_TAS5720 imply SND_SOC_TAS5720
...@@ -1535,6 +1536,13 @@ config SND_SOC_TAS2770 ...@@ -1535,6 +1536,13 @@ config SND_SOC_TAS2770
tristate "Texas Instruments TAS2770 speaker amplifier" tristate "Texas Instruments TAS2770 speaker amplifier"
depends on I2C depends on I2C
config SND_SOC_TAS2780
tristate "Texas Instruments TAS2780 Mono Audio amplifier"
depends on I2C
help
Enable support for Texas Instruments TAS2780 high-efficiency
digital input mono Class-D audio power amplifiers.
config SND_SOC_TAS5086 config SND_SOC_TAS5086
tristate "Texas Instruments TAS5086 speaker amplifier" tristate "Texas Instruments TAS5086 speaker amplifier"
depends on I2C depends on I2C
......
...@@ -348,6 +348,7 @@ snd-soc-tpa6130a2-objs := tpa6130a2.o ...@@ -348,6 +348,7 @@ snd-soc-tpa6130a2-objs := tpa6130a2.o
snd-soc-tas2552-objs := tas2552.o snd-soc-tas2552-objs := tas2552.o
snd-soc-tas2562-objs := tas2562.o snd-soc-tas2562-objs := tas2562.o
snd-soc-tas2764-objs := tas2764.o snd-soc-tas2764-objs := tas2764.o
snd-soc-tas2780-objs := tas2780.o
# Mux # Mux
snd-soc-simple-mux-objs := simple-mux.o snd-soc-simple-mux-objs := simple-mux.o
...@@ -592,6 +593,7 @@ obj-$(CONFIG_SND_SOC_STI_SAS) += snd-soc-sti-sas.o ...@@ -592,6 +593,7 @@ obj-$(CONFIG_SND_SOC_STI_SAS) += snd-soc-sti-sas.o
obj-$(CONFIG_SND_SOC_TAS2552) += snd-soc-tas2552.o obj-$(CONFIG_SND_SOC_TAS2552) += snd-soc-tas2552.o
obj-$(CONFIG_SND_SOC_TAS2562) += snd-soc-tas2562.o obj-$(CONFIG_SND_SOC_TAS2562) += snd-soc-tas2562.o
obj-$(CONFIG_SND_SOC_TAS2764) += snd-soc-tas2764.o obj-$(CONFIG_SND_SOC_TAS2764) += snd-soc-tas2764.o
obj-$(CONFIG_SND_SOC_TAS2780) += snd-soc-tas2780.o
obj-$(CONFIG_SND_SOC_TAS5086) += snd-soc-tas5086.o obj-$(CONFIG_SND_SOC_TAS5086) += snd-soc-tas5086.o
obj-$(CONFIG_SND_SOC_TAS571X) += snd-soc-tas571x.o obj-$(CONFIG_SND_SOC_TAS571X) += snd-soc-tas571x.o
obj-$(CONFIG_SND_SOC_TAS5720) += snd-soc-tas5720.o obj-$(CONFIG_SND_SOC_TAS5720) += snd-soc-tas5720.o
......
This diff is collapsed.
/* SPDX-License-Identifier: GPL-2.0-only */
/*
* TAS2780.h - ALSA SoC Texas Instruments TAS2780 Mono Audio Amplifier
*
* Copyright (C) 2020-2022 Texas Instruments Incorporated - https://www.ti.com
*
* Author: Raphael Xu <raphael-xu@ti.com>
*/
#ifndef __TAS2780_H__
#define __TAS2780_H__
/* Book Control Register */
#define TAS2780_BOOKCTL_PAGE 0
#define TAS2780_BOOKCTL_REG 127
#define TAS2780_REG(page, reg) ((page * 128) + reg)
/* Page */
#define TAS2780_PAGE TAS2780_REG(0X0, 0x00)
#define TAS2780_PAGE_PAGE_MASK 255
/* Software Reset */
#define TAS2780_SW_RST TAS2780_REG(0X0, 0x01)
#define TAS2780_RST BIT(0)
/* Power Control */
#define TAS2780_PWR_CTRL TAS2780_REG(0X0, 0x02)
#define TAS2780_PWR_CTRL_MASK GENMASK(1, 0)
#define TAS2780_PWR_CTRL_ACTIVE 0x0
#define TAS2780_PWR_CTRL_MUTE BIT(0)
#define TAS2780_PWR_CTRL_SHUTDOWN BIT(1)
#define TAS2780_VSENSE_POWER_EN 3
#define TAS2780_ISENSE_POWER_EN 4
/* Digital Volume Control */
#define TAS2780_DVC TAS2780_REG(0X0, 0x1a)
#define TAS2780_DVC_MAX 0xc9
#define TAS2780_CHNL_0 TAS2780_REG(0X0, 0x03)
/* TDM Configuration Reg0 */
#define TAS2780_TDM_CFG0 TAS2780_REG(0X0, 0x08)
#define TAS2780_TDM_CFG0_SMP_MASK BIT(5)
#define TAS2780_TDM_CFG0_SMP_48KHZ 0x0
#define TAS2780_TDM_CFG0_SMP_44_1KHZ BIT(5)
#define TAS2780_TDM_CFG0_MASK GENMASK(3, 1)
#define TAS2780_TDM_CFG0_44_1_48KHZ BIT(3)
#define TAS2780_TDM_CFG0_88_2_96KHZ (BIT(3) | BIT(1))
/* TDM Configuration Reg1 */
#define TAS2780_TDM_CFG1 TAS2780_REG(0X0, 0x09)
#define TAS2780_TDM_CFG1_MASK GENMASK(5, 1)
#define TAS2780_TDM_CFG1_51_SHIFT 1
#define TAS2780_TDM_CFG1_RX_MASK BIT(0)
#define TAS2780_TDM_CFG1_RX_RISING 0x0
#define TAS2780_TDM_CFG1_RX_FALLING BIT(0)
/* TDM Configuration Reg2 */
#define TAS2780_TDM_CFG2 TAS2780_REG(0X0, 0x0a)
#define TAS2780_TDM_CFG2_RXW_MASK GENMASK(3, 2)
#define TAS2780_TDM_CFG2_RXW_16BITS 0x0
#define TAS2780_TDM_CFG2_RXW_24BITS BIT(3)
#define TAS2780_TDM_CFG2_RXW_32BITS (BIT(3) | BIT(2))
#define TAS2780_TDM_CFG2_RXS_MASK GENMASK(1, 0)
#define TAS2780_TDM_CFG2_RXS_16BITS 0x0
#define TAS2780_TDM_CFG2_RXS_24BITS BIT(0)
#define TAS2780_TDM_CFG2_RXS_32BITS BIT(1)
#define TAS2780_TDM_CFG2_SCFG_MASK GENMASK(5, 4)
#define TAS2780_TDM_CFG2_SCFG_I2S 0x0
#define TAS2780_TDM_CFG2_SCFG_LEFT_J BIT(4)
#define TAS2780_TDM_CFG2_SCFG_RIGHT_J BIT(5)
/* TDM Configuration Reg3 */
#define TAS2780_TDM_CFG3 TAS2780_REG(0X0, 0x0c)
#define TAS2780_TDM_CFG3_RXS_MASK GENMASK(7, 4)
#define TAS2780_TDM_CFG3_RXS_SHIFT 0x4
#define TAS2780_TDM_CFG3_MASK GENMASK(3, 0)
/* TDM Configuration Reg4 */
#define TAS2780_TDM_CFG4 TAS2780_REG(0X0, 0x0d)
#define TAS2780_TDM_CFG4_TX_OFFSET_MASK GENMASK(3, 1)
/* TDM Configuration Reg5 */
#define TAS2780_TDM_CFG5 TAS2780_REG(0X0, 0x0e)
#define TAS2780_TDM_CFG5_VSNS_MASK BIT(6)
#define TAS2780_TDM_CFG5_VSNS_ENABLE BIT(6)
#define TAS2780_TDM_CFG5_50_MASK GENMASK(5, 0)
/* TDM Configuration Reg6 */
#define TAS2780_TDM_CFG6 TAS2780_REG(0X0, 0x0f)
#define TAS2780_TDM_CFG6_ISNS_MASK BIT(6)
#define TAS2780_TDM_CFG6_ISNS_ENABLE BIT(6)
#define TAS2780_TDM_CFG6_50_MASK GENMASK(5, 0)
/* IC CFG */
#define TAS2780_IC_CFG TAS2780_REG(0X0, 0x5c)
#define TAS2780_IC_CFG_MASK GENMASK(7, 6)
#define TAS2780_IC_CFG_ENABLE (BIT(7) | BIT(6))
#endif /* __TAS2780_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