Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 293464
b: refs/heads/master
c: 3030763
h: refs/heads/master
v: v3
  • Loading branch information
Takashi Iwai committed Mar 6, 2012
1 parent 1cec985 commit 7be17ca
Show file tree
Hide file tree
Showing 9 changed files with 505 additions and 296 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9d5ef2663fe220a88412a7190942b7d933da0333
refs/heads/master: 303076342b8a30aa98f8a53b539155d0b81ff0c3
29 changes: 29 additions & 0 deletions trunk/arch/arm/mach-omap2/board-4430sdp.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
#include <video/omap-panel-nokia-dsi.h>
#include <video/omap-panel-picodlp.h>
#include <linux/wl12xx.h>
#include <linux/platform_data/omap-abe-twl6040.h>

#include "mux.h"
#include "hsmmc.h"
Expand Down Expand Up @@ -378,12 +379,40 @@ static struct platform_device sdp4430_dmic_codec = {
.id = -1,
};

static struct omap_abe_twl6040_data sdp4430_abe_audio_data = {
.card_name = "SDP4430",
.has_hs = ABE_TWL6040_LEFT | ABE_TWL6040_RIGHT,
.has_hf = ABE_TWL6040_LEFT | ABE_TWL6040_RIGHT,
.has_ep = 1,
.has_aux = ABE_TWL6040_LEFT | ABE_TWL6040_RIGHT,
.has_vibra = ABE_TWL6040_LEFT | ABE_TWL6040_RIGHT,

.has_dmic = 1,
.has_hsmic = 1,
.has_mainmic = 1,
.has_submic = 1,
.has_afm = ABE_TWL6040_LEFT | ABE_TWL6040_RIGHT,

.jack_detection = 1,
/* MCLK input is 38.4MHz */
.mclk_freq = 38400000,
};

static struct platform_device sdp4430_abe_audio = {
.name = "omap-abe-twl6040",
.id = -1,
.dev = {
.platform_data = &sdp4430_abe_audio_data,
},
};

static struct platform_device *sdp4430_devices[] __initdata = {
&sdp4430_gpio_keys_device,
&sdp4430_leds_gpio,
&sdp4430_leds_pwm,
&sdp4430_vbat,
&sdp4430_dmic_codec,
&sdp4430_abe_audio,
};

static struct omap_musb_board_data musb_board_data = {
Expand Down
60 changes: 59 additions & 1 deletion trunk/arch/arm/mach-omap2/board-omap4panda.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include <linux/regulator/machine.h>
#include <linux/regulator/fixed.h>
#include <linux/wl12xx.h>
#include <linux/platform_data/omap-abe-twl6040.h>

#include <mach/hardware.h>
#include <asm/hardware/gic.h>
Expand Down Expand Up @@ -91,9 +92,34 @@ static struct platform_device leds_gpio = {
},
};

static struct omap_abe_twl6040_data panda_abe_audio_data = {
/* Audio out */
.has_hs = ABE_TWL6040_LEFT | ABE_TWL6040_RIGHT,
/* HandsFree through expasion connector */
.has_hf = ABE_TWL6040_LEFT | ABE_TWL6040_RIGHT,
/* PandaBoard: FM TX, PandaBoardES: can be connected to audio out */
.has_aux = ABE_TWL6040_LEFT | ABE_TWL6040_RIGHT,
/* PandaBoard: FM RX, PandaBoardES: audio in */
.has_afm = ABE_TWL6040_LEFT | ABE_TWL6040_RIGHT,
/* No jack detection. */
.jack_detection = 0,
/* MCLK input is 38.4MHz */
.mclk_freq = 38400000,

};

static struct platform_device panda_abe_audio = {
.name = "omap-abe-twl6040",
.id = -1,
.dev = {
.platform_data = &panda_abe_audio_data,
},
};

static struct platform_device *panda_devices[] __initdata = {
&leds_gpio,
&wl1271_device,
&panda_abe_audio,
};

static const struct usbhs_omap_board_data usbhs_bdata __initconst = {
Expand Down Expand Up @@ -252,8 +278,25 @@ static int __init omap4_twl6030_hsmmc_init(struct omap2_hsmmc_info *controllers)
return 0;
}

static struct twl4030_codec_data twl6040_codec = {
/* single-step ramp for headset and handsfree */
.hs_left_step = 0x0f,
.hs_right_step = 0x0f,
.hf_left_step = 0x1d,
.hf_right_step = 0x1d,
};

static struct twl4030_audio_data twl6040_audio = {
.codec = &twl6040_codec,
.audpwron_gpio = 127,
.naudint_irq = OMAP44XX_IRQ_SYS_2N,
.irq_base = TWL6040_CODEC_IRQ_BASE,
};

/* Panda board uses the common PMIC configuration */
static struct twl4030_platform_data omap4_panda_twldata;
static struct twl4030_platform_data omap4_panda_twldata = {
.audio = &twl6040_audio,
};

/*
* Display monitor features are burnt in their EEPROM as EDID data. The EEPROM
Expand Down Expand Up @@ -485,6 +528,20 @@ void omap4_panda_display_init(void)
omap_mux_init_gpio(HDMI_GPIO_HPD, OMAP_PIN_INPUT_PULLDOWN);
}

static void omap4_panda_init_rev(void)
{
if (cpu_is_omap4430()) {
/* PandaBoard 4430 */
/* ASoC audio configuration */
panda_abe_audio_data.card_name = "PandaBoard";
panda_abe_audio_data.has_hsmic = 1;
} else {
/* PandaBoard ES */
/* ASoC audio configuration */
panda_abe_audio_data.card_name = "PandaBoardES";
}
}

static void __init omap4_panda_init(void)
{
int package = OMAP_PACKAGE_CBS;
Expand All @@ -498,6 +555,7 @@ static void __init omap4_panda_init(void)
if (ret)
pr_err("error setting wl12xx data: %d\n", ret);

omap4_panda_init_rev();
omap4_panda_i2c_init();
platform_add_devices(panda_devices, ARRAY_SIZE(panda_devices));
platform_device_register(&omap_vwlan_device);
Expand Down
49 changes: 49 additions & 0 deletions trunk/include/linux/platform_data/omap-abe-twl6040.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/**
* omap-abe-twl6040.h - ASoC machine driver OMAP4+ devices, header.
*
* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com
* All rights reserved.
*
* Author: Peter Ujfalusi <peter.ujfalusi@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.
*
* 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 _OMAP_ABE_TWL6040_H_
#define _OMAP_ABE_TWL6040_H_

/* To select if only one channel is connected in a stereo port */
#define ABE_TWL6040_LEFT (1 << 0)
#define ABE_TWL6040_RIGHT (1 << 1)

struct omap_abe_twl6040_data {
char *card_name;
/* Feature flags for connected audio pins */
u8 has_hs;
u8 has_hf;
bool has_ep;
u8 has_aux;
u8 has_vibra;
bool has_dmic;
bool has_hsmic;
bool has_mainmic;
bool has_submic;
u8 has_afm;
/* Other features */
bool jack_detection; /* board can detect jack events */
int mclk_freq; /* MCLK frequency speed for twl6040 */
};

#endif /* _OMAP_ABE_TWL6040_H_ */
16 changes: 8 additions & 8 deletions trunk/sound/soc/codecs/twl6040.c
Original file line number Diff line number Diff line change
Expand Up @@ -1138,14 +1138,14 @@ static const struct snd_soc_dapm_widget twl6040_dapm_widgets[] = {
TWL6040_REG_MICRCTL, 2, 0),

/* Microphone bias */
SND_SOC_DAPM_MICBIAS("Headset Mic Bias",
TWL6040_REG_AMICBCTL, 0, 0),
SND_SOC_DAPM_MICBIAS("Main Mic Bias",
TWL6040_REG_AMICBCTL, 4, 0),
SND_SOC_DAPM_MICBIAS("Digital Mic1 Bias",
TWL6040_REG_DMICBCTL, 0, 0),
SND_SOC_DAPM_MICBIAS("Digital Mic2 Bias",
TWL6040_REG_DMICBCTL, 4, 0),
SND_SOC_DAPM_SUPPLY("Headset Mic Bias",
TWL6040_REG_AMICBCTL, 0, 0, NULL, 0),
SND_SOC_DAPM_SUPPLY("Main Mic Bias",
TWL6040_REG_AMICBCTL, 4, 0, NULL, 0),
SND_SOC_DAPM_SUPPLY("Digital Mic1 Bias",
TWL6040_REG_DMICBCTL, 0, 0, NULL, 0),
SND_SOC_DAPM_SUPPLY("Digital Mic2 Bias",
TWL6040_REG_DMICBCTL, 4, 0, NULL, 0),

/* DACs */
SND_SOC_DAPM_DAC("HSDAC Left", "Headset Playback", SND_SOC_NOPM, 0, 0),
Expand Down
13 changes: 8 additions & 5 deletions trunk/sound/soc/omap/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -97,16 +97,19 @@ config SND_OMAP_SOC_SDP3430
Say Y if you want to add support for SoC audio on Texas Instruments
SDP3430.

config SND_OMAP_SOC_SDP4430
tristate "SoC Audio support for Texas Instruments SDP4430"
depends on TWL4030_CORE && SND_OMAP_SOC && MACH_OMAP_4430SDP
config SND_OMAP_SOC_OMAP_ABE_TWL6040
tristate "SoC Audio support for OMAP boards using ABE and twl6040 codec"
depends on TWL4030_CORE && SND_OMAP_SOC && ARCH_OMAP4
select SND_OMAP_SOC_DMIC
select SND_OMAP_SOC_MCPDM
select SND_SOC_TWL6040
select SND_SOC_DMIC
help
Say Y if you want to add support for SoC audio on Texas Instruments
SDP4430.
Say Y if you want to add support for SoC audio on OMAP boards using
ABE and twl6040 codec. This driver currently supports:
- SDP4430/Blaze boards
- PandaBoard (4430)
- PandaBoardES (4460)

config SND_OMAP_SOC_OMAP4_HDMI
tristate "SoC Audio support for Texas Instruments OMAP4 HDMI"
Expand Down
4 changes: 2 additions & 2 deletions trunk/sound/soc/omap/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ snd-soc-overo-objs := overo.o
snd-soc-omap3evm-objs := omap3evm.o
snd-soc-am3517evm-objs := am3517evm.o
snd-soc-sdp3430-objs := sdp3430.o
snd-soc-sdp4430-objs := sdp4430.o
snd-soc-omap-abe-twl6040-objs := omap-abe-twl6040.o
snd-soc-omap3pandora-objs := omap3pandora.o
snd-soc-omap3beagle-objs := omap3beagle.o
snd-soc-zoom2-objs := zoom2.o
Expand All @@ -36,7 +36,7 @@ obj-$(CONFIG_SND_OMAP_SOC_OMAP2EVM) += snd-soc-omap2evm.o
obj-$(CONFIG_SND_OMAP_SOC_OMAP3EVM) += snd-soc-omap3evm.o
obj-$(CONFIG_SND_OMAP_SOC_AM3517EVM) += snd-soc-am3517evm.o
obj-$(CONFIG_SND_OMAP_SOC_SDP3430) += snd-soc-sdp3430.o
obj-$(CONFIG_SND_OMAP_SOC_SDP4430) += snd-soc-sdp4430.o
obj-$(CONFIG_SND_OMAP_SOC_OMAP_ABE_TWL6040) += snd-soc-omap-abe-twl6040.o
obj-$(CONFIG_SND_OMAP_SOC_OMAP3_PANDORA) += snd-soc-omap3pandora.o
obj-$(CONFIG_SND_OMAP_SOC_OMAP3_BEAGLE) += snd-soc-omap3beagle.o
obj-$(CONFIG_SND_OMAP_SOC_ZOOM2) += snd-soc-zoom2.o
Expand Down
Loading

0 comments on commit 7be17ca

Please sign in to comment.