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: tas2552: Support TI TAS2552 Amplifier
Support the TI TAS2552 Class D amplifier. The TAS2552 is a high efficiency Class-D audio power amplifier with advanced battery current management and an integrated Class-G boost The device constantly measures the current and voltage across the load and provides a digital stream of this information. Signed-off-by: Dan Murphy <dmurphy@ti.com> Signed-off-by: Mark Brown <broonie@linaro.org>
This commit is contained in:
26
Documentation/devicetree/bindings/sound/tas2552.txt
Normal file
26
Documentation/devicetree/bindings/sound/tas2552.txt
Normal file
@@ -0,0 +1,26 @@
|
||||
Texas Instruments - tas2552 Codec module
|
||||
|
||||
The tas2552 serial control bus communicates through I2C protocols
|
||||
|
||||
Required properties:
|
||||
- compatible - One of:
|
||||
"ti,tas2552" - TAS2552
|
||||
- reg - I2C slave address
|
||||
- supply-*: Required supply regulators are:
|
||||
"vbat" battery voltage
|
||||
"iovdd" I/O Voltage
|
||||
"avdd" Analog DAC Voltage
|
||||
|
||||
Optional properties:
|
||||
- enable-gpio - gpio pin to enable/disable the device
|
||||
|
||||
Example:
|
||||
|
||||
tas2552: tas2552@41 {
|
||||
compatible = "ti,tas2552";
|
||||
reg = <0x41>;
|
||||
enable-gpio = <&gpio4 2 GPIO_ACTIVE_HIGH>;
|
||||
};
|
||||
|
||||
For more product information please see the link below:
|
||||
http://www.ti.com/product/TAS2552
|
||||
25
include/sound/tas2552-plat.h
Normal file
25
include/sound/tas2552-plat.h
Normal file
@@ -0,0 +1,25 @@
|
||||
/*
|
||||
* TAS2552 driver platform header
|
||||
*
|
||||
* Copyright (C) 2014 Texas Instruments Inc.
|
||||
*
|
||||
* Author: Dan Murphy <dmurphy@ti.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* version 2 as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*/
|
||||
|
||||
#ifndef TAS2552_PLAT_H
|
||||
#define TAS2552_PLAT_H
|
||||
|
||||
struct tas2552_platform_data {
|
||||
int enable_gpio;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -91,6 +91,7 @@ config SND_SOC_ALL_CODECS
|
||||
select SND_SOC_STA350 if I2C
|
||||
select SND_SOC_STA529 if I2C
|
||||
select SND_SOC_STAC9766 if SND_SOC_AC97_BUS
|
||||
select SND_SOC_TAS2552 if I2C
|
||||
select SND_SOC_TAS5086 if I2C
|
||||
select SND_SOC_TLV320AIC23_I2C if I2C
|
||||
select SND_SOC_TLV320AIC23_SPI if SPI_MASTER
|
||||
@@ -513,6 +514,10 @@ config SND_SOC_STA529
|
||||
config SND_SOC_STAC9766
|
||||
tristate
|
||||
|
||||
config SND_SOC_TAS2552
|
||||
tristate "Texas Instruments TAS2552 Mono Audio amplifier"
|
||||
depends on I2C
|
||||
|
||||
config SND_SOC_TAS5086
|
||||
tristate "Texas Instruments TAS5086 speaker amplifier"
|
||||
depends on I2C
|
||||
|
||||
@@ -160,6 +160,7 @@ snd-soc-wm-hubs-objs := wm_hubs.o
|
||||
# Amp
|
||||
snd-soc-max9877-objs := max9877.o
|
||||
snd-soc-tpa6130a2-objs := tpa6130a2.o
|
||||
snd-soc-tas2552-objs := tas2552.o
|
||||
|
||||
obj-$(CONFIG_SND_SOC_88PM860X) += snd-soc-88pm860x.o
|
||||
obj-$(CONFIG_SND_SOC_AB8500_CODEC) += snd-soc-ab8500-codec.o
|
||||
@@ -251,6 +252,7 @@ obj-$(CONFIG_SND_SOC_STA32X) += snd-soc-sta32x.o
|
||||
obj-$(CONFIG_SND_SOC_STA350) += snd-soc-sta350.o
|
||||
obj-$(CONFIG_SND_SOC_STA529) += snd-soc-sta529.o
|
||||
obj-$(CONFIG_SND_SOC_STAC9766) += snd-soc-stac9766.o
|
||||
obj-$(CONFIG_SND_SOC_TAS2552) += snd-soc-tas2552.o
|
||||
obj-$(CONFIG_SND_SOC_TAS5086) += snd-soc-tas5086.o
|
||||
obj-$(CONFIG_SND_SOC_TLV320AIC23) += snd-soc-tlv320aic23.o
|
||||
obj-$(CONFIG_SND_SOC_TLV320AIC23_I2C) += snd-soc-tlv320aic23-i2c.o
|
||||
|
||||
540
sound/soc/codecs/tas2552.c
Normal file
540
sound/soc/codecs/tas2552.c
Normal file
File diff suppressed because it is too large
Load Diff
129
sound/soc/codecs/tas2552.h
Normal file
129
sound/soc/codecs/tas2552.h
Normal file
@@ -0,0 +1,129 @@
|
||||
/*
|
||||
* tas2552.h - ALSA SoC Texas Instruments TAS2552 Mono Audio Amplifier
|
||||
*
|
||||
* Copyright (C) 2014 Texas Instruments Incorporated - http://www.ti.com
|
||||
*
|
||||
* Author: Dan Murphy <dmurphy@ti.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* version 2 as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*/
|
||||
|
||||
#ifndef __TAS2552_H__
|
||||
#define __TAS2552_H__
|
||||
|
||||
/* Register Address Map */
|
||||
#define TAS2552_DEVICE_STATUS 0x00
|
||||
#define TAS2552_CFG_1 0x01
|
||||
#define TAS2552_CFG_2 0x02
|
||||
#define TAS2552_CFG_3 0x03
|
||||
#define TAS2552_DOUT 0x04
|
||||
#define TAS2552_SER_CTRL_1 0x05
|
||||
#define TAS2552_SER_CTRL_2 0x06
|
||||
#define TAS2552_OUTPUT_DATA 0x07
|
||||
#define TAS2552_PLL_CTRL_1 0x08
|
||||
#define TAS2552_PLL_CTRL_2 0x09
|
||||
#define TAS2552_PLL_CTRL_3 0x0a
|
||||
#define TAS2552_BTIP 0x0b
|
||||
#define TAS2552_BTS_CTRL 0x0c
|
||||
#define TAS2552_RESERVED_0D 0x0d
|
||||
#define TAS2552_LIMIT_RATE_HYS 0x0e
|
||||
#define TAS2552_LIMIT_RELEASE 0x0f
|
||||
#define TAS2552_LIMIT_INT_COUNT 0x10
|
||||
#define TAS2552_PDM_CFG 0x11
|
||||
#define TAS2552_PGA_GAIN 0x12
|
||||
#define TAS2552_EDGE_RATE_CTRL 0x13
|
||||
#define TAS2552_BOOST_PT_CTRL 0x14
|
||||
#define TAS2552_VER_NUM 0x16
|
||||
#define TAS2552_VBAT_DATA 0x19
|
||||
#define TAS2552_MAX_REG 0x20
|
||||
|
||||
/* CFG1 Register Masks */
|
||||
#define TAS2552_MUTE_MASK (1 << 2)
|
||||
#define TAS2552_SWS_MASK (1 << 1)
|
||||
#define TAS2552_WCLK_MASK 0x07
|
||||
#define TAS2552_CLASSD_EN_MASK (1 << 7)
|
||||
|
||||
/* CFG2 Register Masks */
|
||||
#define TAS2552_CLASSD_EN (1 << 7)
|
||||
#define TAS2552_BOOST_EN (1 << 6)
|
||||
#define TAS2552_APT_EN (1 << 5)
|
||||
#define TAS2552_PLL_ENABLE (1 << 3)
|
||||
#define TAS2552_LIM_EN (1 << 2)
|
||||
#define TAS2552_IVSENSE_EN (1 << 1)
|
||||
|
||||
/* CFG3 Register Masks */
|
||||
#define TAS2552_WORD_CLK_MASK (1 << 7)
|
||||
#define TAS2552_BIT_CLK_MASK (1 << 6)
|
||||
#define TAS2552_DATA_FORMAT_MASK (0x11 << 2)
|
||||
|
||||
#define TAS2552_DAIFMT_I2S_MASK 0xf3
|
||||
#define TAS2552_DAIFMT_DSP (1 << 3)
|
||||
#define TAS2552_DAIFMT_RIGHT_J (1 << 4)
|
||||
#define TAS2552_DAIFMT_LEFT_J (0x11 << 3)
|
||||
|
||||
#define TAS2552_PLL_SRC_MCLK 0x00
|
||||
#define TAS2552_PLL_SRC_BCLK (1 << 3)
|
||||
#define TAS2552_PLL_SRC_IVCLKIN (1 << 4)
|
||||
#define TAS2552_PLL_SRC_1_8_FIXED (0x11 << 3)
|
||||
|
||||
#define TAS2552_DIN_SRC_SEL_MUTED 0x00
|
||||
#define TAS2552_DIN_SRC_SEL_LEFT (1 << 4)
|
||||
#define TAS2552_DIN_SRC_SEL_RIGHT (1 << 5)
|
||||
#define TAS2552_DIN_SRC_SEL_AVG_L_R (0x11 << 4)
|
||||
|
||||
#define TAS2552_PDM_IN_SEL (1 << 5)
|
||||
#define TAS2552_I2S_OUT_SEL (1 << 6)
|
||||
#define TAS2552_ANALOG_IN_SEL (1 << 7)
|
||||
|
||||
/* CFG3 WCLK Dividers */
|
||||
#define TAS2552_8KHZ 0x00
|
||||
#define TAS2552_11_12KHZ (1 << 1)
|
||||
#define TAS2552_16KHZ (1 << 2)
|
||||
#define TAS2552_22_24KHZ (1 << 3)
|
||||
#define TAS2552_32KHZ (1 << 4)
|
||||
#define TAS2552_44_48KHZ (1 << 5)
|
||||
#define TAS2552_88_96KHZ (1 << 6)
|
||||
#define TAS2552_176_192KHZ (1 << 7)
|
||||
|
||||
/* OUTPUT_DATA register */
|
||||
#define TAS2552_PDM_DATA_I 0x00
|
||||
#define TAS2552_PDM_DATA_V (1 << 6)
|
||||
#define TAS2552_PDM_DATA_I_V (1 << 7)
|
||||
#define TAS2552_PDM_DATA_V_I (0x11 << 6)
|
||||
|
||||
/* PDM CFG Register */
|
||||
#define TAS2552_PDM_DATA_ES_RISE 0x4
|
||||
|
||||
#define TAS2552_PDM_PLL_CLK_SEL 0x00
|
||||
#define TAS2552_PDM_IV_CLK_SEL (1 << 1)
|
||||
#define TAS2552_PDM_BCLK_SEL (1 << 2)
|
||||
#define TAS2552_PDM_MCLK_SEL (1 << 3)
|
||||
|
||||
/* Boost pass-through register */
|
||||
#define TAS2552_APT_DELAY_50 0x00
|
||||
#define TAS2552_APT_DELAY_75 (1 << 1)
|
||||
#define TAS2552_APT_DELAY_125 (1 << 2)
|
||||
#define TAS2552_APT_DELAY_200 (1 << 3)
|
||||
|
||||
#define TAS2552_APT_THRESH_2_5 0x00
|
||||
#define TAS2552_APT_THRESH_1_7 (1 << 3)
|
||||
#define TAS2552_APT_THRESH_1_4_1_1 (1 << 4)
|
||||
#define TAS2552_APT_THRESH_2_1_7 (0x11 << 2)
|
||||
|
||||
/* PLL Control Register */
|
||||
#define TAS2552_245MHZ_CLK 24576000
|
||||
#define TAS2552_225MHZ_CLK 22579200
|
||||
#define TAS2552_PLL_J_MASK 0x7f
|
||||
#define TAS2552_PLL_D_UPPER_MASK 0x3f
|
||||
#define TAS2552_PLL_D_LOWER_MASK 0xff
|
||||
#define TAS2552_PLL_BYPASS_MASK 0x80
|
||||
#define TAS2552_PLL_BYPASS 0x80
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user