Skip to content

Commit

Permalink
ASoC: TPA6130A2 amplifier driver
Browse files Browse the repository at this point in the history
Driver for Texas Instruments TPA6130A2 stereo headphone
amplifier.

The driver provides playback gain control and also pre-defined
DAPM_HP widgets and DAPM routings for power management.

The DAPM_HP widget names are:
"TPA6130A2 Headphone Left"
"TPA6130A2 Headphone Right"

From soc machine drivers to use with the tpa6130a2 amplifier,
the tpa6130a2_add_controls has to be called, which adds the alsa
controls and the DAPM routing needed for the tpa6130a2.
After that the machine driver can connect the codec's output
with 'TPA6130A2 Left' and 'TPA6130A2 Right':

        {"TPA6130A2 Left", NULL, "CODEC LEFT OUT"},
        {"TPA6130A2 Right", NULL, "CODEC RIGHT OUT"},

Internally the left and right channels are powered separately.
When none of the channels are needed the amplifier is powered
down:
hard power: valid GPIO number is passed within platform data
soft power: Using the software shutdown of the amplifier

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
  • Loading branch information
Peter Ujfalusi authored and Mark Brown committed Oct 9, 2009
1 parent 69d2c2a commit 493b67e
Show file tree
Hide file tree
Showing 5 changed files with 561 additions and 0 deletions.
30 changes: 30 additions & 0 deletions include/sound/tpa6130a2-plat.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* TPA6130A2 driver platform header
*
* Copyright (C) Nokia Corporation
*
* Written by Peter Ujfalusi <peter.ujfalusi@nokia.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.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA
*/

#ifndef TPA6130A2_PLAT_H
#define TPA6130A2_PLAT_H

struct tpa6130a2_platform_data {
int power_gpio;
};

#endif
4 changes: 4 additions & 0 deletions sound/soc/codecs/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ config SND_SOC_ALL_CODECS
select SND_SOC_TLV320AIC23 if I2C
select SND_SOC_TLV320AIC26 if SPI_MASTER
select SND_SOC_TLV320AIC3X if I2C
select SND_SOC_TPA6130A2 if I2C
select SND_SOC_TWL4030 if TWL4030_CORE
select SND_SOC_UDA134X
select SND_SOC_UDA1380 if I2C
Expand Down Expand Up @@ -228,3 +229,6 @@ config SND_SOC_WM9713
# Amp
config SND_SOC_MAX9877
tristate

config SND_SOC_TPA6130A2
tristate
2 changes: 2 additions & 0 deletions sound/soc/codecs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ snd-soc-wm-hubs-objs := wm_hubs.o

# Amp
snd-soc-max9877-objs := max9877.o
snd-soc-tpa6130a2-objs := tpa6130a2.o

obj-$(CONFIG_SND_SOC_AC97_CODEC) += snd-soc-ac97.o
obj-$(CONFIG_SND_SOC_AD1836) += snd-soc-ad1836.o
Expand Down Expand Up @@ -101,3 +102,4 @@ obj-$(CONFIG_SND_SOC_WM_HUBS) += snd-soc-wm-hubs.o

# Amp
obj-$(CONFIG_SND_SOC_MAX9877) += snd-soc-max9877.o
obj-$(CONFIG_SND_SOC_TPA6130A2) += snd-soc-tpa6130a2.o
Loading

0 comments on commit 493b67e

Please sign in to comment.