Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
1837ce35
Commit
1837ce35
authored
Aug 15, 2012
by
Mark Brown
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'asoc/topic/omap' into for-3.7
parents
3876566a
152c6e56
Changes
16
Show whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
287 additions
and
403 deletions
+287
-403
Documentation/devicetree/bindings/sound/omap-twl4030.txt
Documentation/devicetree/bindings/sound/omap-twl4030.txt
+17
-0
arch/arm/mach-omap2/board-cm-t35.c
arch/arm/mach-omap2/board-cm-t35.c
+1
-0
arch/arm/mach-omap2/board-devkit8000.c
arch/arm/mach-omap2/board-devkit8000.c
+1
-0
arch/arm/mach-omap2/board-igep0020.c
arch/arm/mach-omap2/board-igep0020.c
+1
-0
arch/arm/mach-omap2/board-omap3beagle.c
arch/arm/mach-omap2/board-omap3beagle.c
+1
-0
arch/arm/mach-omap2/board-omap3evm.c
arch/arm/mach-omap2/board-omap3evm.c
+1
-0
arch/arm/mach-omap2/board-overo.c
arch/arm/mach-omap2/board-overo.c
+1
-0
arch/arm/mach-omap2/twl-common.c
arch/arm/mach-omap2/twl-common.c
+27
-0
arch/arm/mach-omap2/twl-common.h
arch/arm/mach-omap2/twl-common.h
+2
-0
include/linux/platform_data/omap-twl4030.h
include/linux/platform_data/omap-twl4030.h
+32
-0
sound/soc/omap/Kconfig
sound/soc/omap/Kconfig
+13
-35
sound/soc/omap/Makefile
sound/soc/omap/Makefile
+2
-8
sound/soc/omap/igep0020.c
sound/soc/omap/igep0020.c
+0
-120
sound/soc/omap/omap-twl4030.c
sound/soc/omap/omap-twl4030.c
+188
-0
sound/soc/omap/omap3evm.c
sound/soc/omap/omap3evm.c
+0
-118
sound/soc/omap/overo.c
sound/soc/omap/overo.c
+0
-122
No files found.
Documentation/devicetree/bindings/sound/omap-twl4030.txt
0 → 100644
View file @
1837ce35
* Texas Instruments SoC with twl4030 based audio setups
Required properties:
- compatible: "ti,omap-twl4030"
- ti,model: Name of the sound card (for example "omap3beagle")
- ti,mcbsp: phandle for the McBSP node
- ti,codec: phandle for the twl4030 audio node
Example:
sound {
compatible = "ti,omap-twl4030";
ti,model = "omap3beagle";
ti,mcbsp = <&mcbsp2>;
ti,codec = <&twl_audio>;
};
arch/arm/mach-omap2/board-cm-t35.c
View file @
1837ce35
...
@@ -731,6 +731,7 @@ static void __init cm_t3x_common_init(void)
...
@@ -731,6 +731,7 @@ static void __init cm_t3x_common_init(void)
cm_t35_init_ethernet
();
cm_t35_init_ethernet
();
cm_t35_init_led
();
cm_t35_init_led
();
cm_t35_init_display
();
cm_t35_init_display
();
omap_twl4030_audio_init
(
"cm-t3x"
);
usb_musb_init
(
NULL
);
usb_musb_init
(
NULL
);
cm_t35_init_usbh
();
cm_t35_init_usbh
();
...
...
arch/arm/mach-omap2/board-devkit8000.c
View file @
1837ce35
...
@@ -630,6 +630,7 @@ static void __init devkit8000_init(void)
...
@@ -630,6 +630,7 @@ static void __init devkit8000_init(void)
usbhs_init
(
&
usbhs_bdata
);
usbhs_init
(
&
usbhs_bdata
);
omap_nand_flash_init
(
NAND_BUSWIDTH_16
,
devkit8000_nand_partitions
,
omap_nand_flash_init
(
NAND_BUSWIDTH_16
,
devkit8000_nand_partitions
,
ARRAY_SIZE
(
devkit8000_nand_partitions
));
ARRAY_SIZE
(
devkit8000_nand_partitions
));
omap_twl4030_audio_init
(
"omap3beagle"
);
/* Ensure SDRC pins are mux'd for self-refresh */
/* Ensure SDRC pins are mux'd for self-refresh */
omap_mux_init_signal
(
"sdrc_cke0"
,
OMAP_PIN_OUTPUT
);
omap_mux_init_signal
(
"sdrc_cke0"
,
OMAP_PIN_OUTPUT
);
...
...
arch/arm/mach-omap2/board-igep0020.c
View file @
1837ce35
...
@@ -626,6 +626,7 @@ static void __init igep_init(void)
...
@@ -626,6 +626,7 @@ static void __init igep_init(void)
igep_flash_init
();
igep_flash_init
();
igep_leds_init
();
igep_leds_init
();
omap_twl4030_audio_init
(
"igep2"
);
/*
/*
* WLAN-BT combo module from MuRata which has a Marvell WLAN
* WLAN-BT combo module from MuRata which has a Marvell WLAN
...
...
arch/arm/mach-omap2/board-omap3beagle.c
View file @
1837ce35
...
@@ -519,6 +519,7 @@ static void __init omap3_beagle_init(void)
...
@@ -519,6 +519,7 @@ static void __init omap3_beagle_init(void)
usbhs_init
(
&
usbhs_bdata
);
usbhs_init
(
&
usbhs_bdata
);
omap_nand_flash_init
(
NAND_BUSWIDTH_16
,
omap3beagle_nand_partitions
,
omap_nand_flash_init
(
NAND_BUSWIDTH_16
,
omap3beagle_nand_partitions
,
ARRAY_SIZE
(
omap3beagle_nand_partitions
));
ARRAY_SIZE
(
omap3beagle_nand_partitions
));
omap_twl4030_audio_init
(
"omap3beagle"
);
/* Ensure msecure is mux'd to be able to set the RTC. */
/* Ensure msecure is mux'd to be able to set the RTC. */
omap_mux_init_signal
(
"sys_drm_msecure"
,
OMAP_PIN_OFF_OUTPUT_HIGH
);
omap_mux_init_signal
(
"sys_drm_msecure"
,
OMAP_PIN_OFF_OUTPUT_HIGH
);
...
...
arch/arm/mach-omap2/board-omap3evm.c
View file @
1837ce35
...
@@ -736,6 +736,7 @@ static void __init omap3_evm_init(void)
...
@@ -736,6 +736,7 @@ static void __init omap3_evm_init(void)
omap3evm_init_smsc911x
();
omap3evm_init_smsc911x
();
omap3_evm_display_init
();
omap3_evm_display_init
();
omap3_evm_wl12xx_init
();
omap3_evm_wl12xx_init
();
omap_twl4030_audio_init
(
"omap3evm"
);
}
}
MACHINE_START
(
OMAP3EVM
,
"OMAP3 EVM"
)
MACHINE_START
(
OMAP3EVM
,
"OMAP3 EVM"
)
...
...
arch/arm/mach-omap2/board-overo.c
View file @
1837ce35
...
@@ -509,6 +509,7 @@ static void __init overo_init(void)
...
@@ -509,6 +509,7 @@ static void __init overo_init(void)
overo_display_init
();
overo_display_init
();
overo_init_led
();
overo_init_led
();
overo_init_keys
();
overo_init_keys
();
omap_twl4030_audio_init
(
"overo"
);
/* Ensure SDRC pins are mux'd for self-refresh */
/* Ensure SDRC pins are mux'd for self-refresh */
omap_mux_init_signal
(
"sdrc_cke0"
,
OMAP_PIN_OUTPUT
);
omap_mux_init_signal
(
"sdrc_cke0"
,
OMAP_PIN_OUTPUT
);
...
...
arch/arm/mach-omap2/twl-common.c
View file @
1837ce35
...
@@ -537,3 +537,30 @@ void __init omap4_pmic_get_config(struct twl4030_platform_data *pmic_data,
...
@@ -537,3 +537,30 @@ void __init omap4_pmic_get_config(struct twl4030_platform_data *pmic_data,
pmic_data
->
v2v1
=
&
omap4_v2v1_idata
;
pmic_data
->
v2v1
=
&
omap4_v2v1_idata
;
}
}
#endif
/* CONFIG_ARCH_OMAP4 */
#endif
/* CONFIG_ARCH_OMAP4 */
#if defined(CONFIG_SND_OMAP_SOC_OMAP_TWL4030) || \
defined(CONFIG_SND_OMAP_SOC_OMAP_TWL4030_MODULE)
#include <linux/platform_data/omap-twl4030.h>
static
struct
omap_tw4030_pdata
omap_twl4030_audio_data
;
static
struct
platform_device
audio_device
=
{
.
name
=
"omap-twl4030"
,
.
id
=
-
1
,
.
dev
=
{
.
platform_data
=
&
omap_twl4030_audio_data
,
},
};
void
__init
omap_twl4030_audio_init
(
char
*
card_name
)
{
omap_twl4030_audio_data
.
card_name
=
card_name
;
platform_device_register
(
&
audio_device
);
}
#else
/* SOC_OMAP_TWL4030 */
void
__init
omap_twl4030_audio_init
(
char
*
card_name
,
int
codec_sysclk
)
{
return
;
}
#endif
/* SOC_OMAP_TWL4030 */
arch/arm/mach-omap2/twl-common.h
View file @
1837ce35
...
@@ -59,4 +59,6 @@ void omap3_pmic_get_config(struct twl4030_platform_data *pmic_data,
...
@@ -59,4 +59,6 @@ void omap3_pmic_get_config(struct twl4030_platform_data *pmic_data,
void
omap4_pmic_get_config
(
struct
twl4030_platform_data
*
pmic_data
,
void
omap4_pmic_get_config
(
struct
twl4030_platform_data
*
pmic_data
,
u32
pdata_flags
,
u32
regulators_flags
);
u32
pdata_flags
,
u32
regulators_flags
);
void
omap_twl4030_audio_init
(
char
*
card_name
);
#endif
/* __OMAP_PMIC_COMMON__ */
#endif
/* __OMAP_PMIC_COMMON__ */
include/linux/platform_data/omap-twl4030.h
0 → 100644
View file @
1837ce35
/**
* omap-twl4030.h - ASoC machine driver for TI SoC based boards with twl4030
* codec, header.
*
* Copyright (C) 2012 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_TWL4030_H_
#define _OMAP_TWL4030_H_
struct
omap_tw4030_pdata
{
const
char
*
card_name
;
};
#endif
/* _OMAP_TWL4030_H_ */
sound/soc/omap/Kconfig
View file @
1837ce35
...
@@ -60,23 +60,6 @@ config SND_OMAP_SOC_OSK5912
...
@@ -60,23 +60,6 @@ config SND_OMAP_SOC_OSK5912
help
help
Say Y if you want to add support for SoC audio on osk5912.
Say Y if you want to add support for SoC audio on osk5912.
config SND_OMAP_SOC_OVERO
tristate "SoC Audio support for Gumstix Overo and CompuLab CM-T35"
depends on TWL4030_CORE && SND_OMAP_SOC && (MACH_OVERO || MACH_CM_T35)
select SND_OMAP_SOC_MCBSP
select SND_SOC_TWL4030
help
Say Y if you want to add support for SoC audio on the
Gumstix Overo or CompuLab CM-T35
config SND_OMAP_SOC_OMAP3EVM
tristate "SoC Audio support for OMAP3EVM board"
depends on TWL4030_CORE && SND_OMAP_SOC && MACH_OMAP3EVM
select SND_OMAP_SOC_MCBSP
select SND_SOC_TWL4030
help
Say Y if you want to add support for SoC audio on the omap3evm board.
config SND_OMAP_SOC_AM3517EVM
config SND_OMAP_SOC_AM3517EVM
tristate "SoC Audio support for OMAP3517 / AM3517 EVM"
tristate "SoC Audio support for OMAP3517 / AM3517 EVM"
depends on SND_OMAP_SOC && MACH_OMAP3517EVM && I2C
depends on SND_OMAP_SOC && MACH_OMAP3517EVM && I2C
...
@@ -95,6 +78,19 @@ config SND_OMAP_SOC_SDP3430
...
@@ -95,6 +78,19 @@ config SND_OMAP_SOC_SDP3430
Say Y if you want to add support for SoC audio on Texas Instruments
Say Y if you want to add support for SoC audio on Texas Instruments
SDP3430.
SDP3430.
config SND_OMAP_SOC_OMAP_TWL4030
tristate "SoC Audio support for TI SoC based boards with twl4030 codec"
depends on TWL4030_CORE && SND_OMAP_SOC
select SND_OMAP_SOC_MCBSP
select SND_SOC_TWL4030
help
Say Y if you want to add support for SoC audio on TI SoC based boards
using twl4030 as c codec. This driver currently supports:
- Beagleboard or Devkit8000
- Gumstix Overo or CompuLab CM-T35/CM-T3730
- IGEP v2
- OMAP3EVM
config SND_OMAP_SOC_OMAP_ABE_TWL6040
config SND_OMAP_SOC_OMAP_ABE_TWL6040
tristate "SoC Audio support for OMAP boards using ABE and twl6040 codec"
tristate "SoC Audio support for OMAP boards using ABE and twl6040 codec"
depends on TWL6040_CORE && SND_OMAP_SOC && ARCH_OMAP4
depends on TWL6040_CORE && SND_OMAP_SOC && ARCH_OMAP4
...
@@ -127,16 +123,6 @@ config SND_OMAP_SOC_OMAP3_PANDORA
...
@@ -127,16 +123,6 @@ config SND_OMAP_SOC_OMAP3_PANDORA
help
help
Say Y if you want to add support for SoC audio on the OMAP3 Pandora.
Say Y if you want to add support for SoC audio on the OMAP3 Pandora.
config SND_OMAP_SOC_OMAP3_BEAGLE
tristate "SoC Audio support for OMAP3 Beagle and Devkit8000"
depends on TWL4030_CORE && SND_OMAP_SOC
depends on (MACH_OMAP3_BEAGLE || MACH_DEVKIT8000)
select SND_OMAP_SOC_MCBSP
select SND_SOC_TWL4030
help
Say Y if you want to add support for SoC audio on the Beagleboard or
the clone Devkit8000.
config SND_OMAP_SOC_ZOOM2
config SND_OMAP_SOC_ZOOM2
tristate "SoC Audio support for Zoom2"
tristate "SoC Audio support for Zoom2"
depends on TWL4030_CORE && SND_OMAP_SOC && MACH_OMAP_ZOOM2
depends on TWL4030_CORE && SND_OMAP_SOC && MACH_OMAP_ZOOM2
...
@@ -144,11 +130,3 @@ config SND_OMAP_SOC_ZOOM2
...
@@ -144,11 +130,3 @@ config SND_OMAP_SOC_ZOOM2
select SND_SOC_TWL4030
select SND_SOC_TWL4030
help
help
Say Y if you want to add support for Soc audio on Zoom2 board.
Say Y if you want to add support for Soc audio on Zoom2 board.
config SND_OMAP_SOC_IGEP0020
tristate "SoC Audio support for IGEP v2"
depends on TWL4030_CORE && SND_OMAP_SOC && MACH_IGEP0020
select SND_OMAP_SOC_MCBSP
select SND_SOC_TWL4030
help
Say Y if you want to add support for Soc audio on IGEP v2 board.
sound/soc/omap/Makefile
View file @
1837ce35
...
@@ -16,29 +16,23 @@ snd-soc-n810-objs := n810.o
...
@@ -16,29 +16,23 @@ snd-soc-n810-objs := n810.o
snd-soc-rx51-objs
:=
rx51.o
snd-soc-rx51-objs
:=
rx51.o
snd-soc-ams-delta-objs
:=
ams-delta.o
snd-soc-ams-delta-objs
:=
ams-delta.o
snd-soc-osk5912-objs
:=
osk5912.o
snd-soc-osk5912-objs
:=
osk5912.o
snd-soc-overo-objs
:=
overo.o
snd-soc-omap3evm-objs
:=
omap3evm.o
snd-soc-am3517evm-objs
:=
am3517evm.o
snd-soc-am3517evm-objs
:=
am3517evm.o
snd-soc-sdp3430-objs
:=
sdp3430.o
snd-soc-sdp3430-objs
:=
sdp3430.o
snd-soc-omap-abe-twl6040-objs
:=
omap-abe-twl6040.o
snd-soc-omap-abe-twl6040-objs
:=
omap-abe-twl6040.o
snd-soc-omap-twl4030-objs
:=
omap-twl4030.o
snd-soc-omap3pandora-objs
:=
omap3pandora.o
snd-soc-omap3pandora-objs
:=
omap3pandora.o
snd-soc-omap3beagle-objs
:=
omap3beagle.o
snd-soc-zoom2-objs
:=
zoom2.o
snd-soc-zoom2-objs
:=
zoom2.o
snd-soc-igep0020-objs
:=
igep0020.o
snd-soc-omap-hdmi-card-objs
:=
omap-hdmi-card.o
snd-soc-omap-hdmi-card-objs
:=
omap-hdmi-card.o
obj-$(CONFIG_SND_OMAP_SOC_N810)
+=
snd-soc-n810.o
obj-$(CONFIG_SND_OMAP_SOC_N810)
+=
snd-soc-n810.o
obj-$(CONFIG_SND_OMAP_SOC_RX51)
+=
snd-soc-rx51.o
obj-$(CONFIG_SND_OMAP_SOC_RX51)
+=
snd-soc-rx51.o
obj-$(CONFIG_SND_OMAP_SOC_AMS_DELTA)
+=
snd-soc-ams-delta.o
obj-$(CONFIG_SND_OMAP_SOC_AMS_DELTA)
+=
snd-soc-ams-delta.o
obj-$(CONFIG_SND_OMAP_SOC_OSK5912)
+=
snd-soc-osk5912.o
obj-$(CONFIG_SND_OMAP_SOC_OSK5912)
+=
snd-soc-osk5912.o
obj-$(CONFIG_SND_OMAP_SOC_OVERO)
+=
snd-soc-overo.o
obj-$(CONFIG_SND_OMAP_SOC_OMAP2EVM)
+=
snd-soc-omap2evm.o
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_AM3517EVM)
+=
snd-soc-am3517evm.o
obj-$(CONFIG_SND_OMAP_SOC_SDP3430)
+=
snd-soc-sdp3430.o
obj-$(CONFIG_SND_OMAP_SOC_SDP3430)
+=
snd-soc-sdp3430.o
obj-$(CONFIG_SND_OMAP_SOC_OMAP_ABE_TWL6040)
+=
snd-soc-omap-abe-twl6040.o
obj-$(CONFIG_SND_OMAP_SOC_OMAP_ABE_TWL6040)
+=
snd-soc-omap-abe-twl6040.o
obj-$(CONFIG_SND_OMAP_SOC_OMAP_TWL4030)
+=
snd-soc-omap-twl4030.o
obj-$(CONFIG_SND_OMAP_SOC_OMAP3_PANDORA)
+=
snd-soc-omap3pandora.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
obj-$(CONFIG_SND_OMAP_SOC_ZOOM2)
+=
snd-soc-zoom2.o
obj-$(CONFIG_SND_OMAP_SOC_IGEP0020)
+=
snd-soc-igep0020.o
obj-$(CONFIG_SND_OMAP_SOC_OMAP_HDMI)
+=
snd-soc-omap-hdmi-card.o
obj-$(CONFIG_SND_OMAP_SOC_OMAP_HDMI)
+=
snd-soc-omap-hdmi-card.o
sound/soc/omap/igep0020.c
deleted
100644 → 0
View file @
3876566a
/*
* igep0020.c -- SoC audio for IGEP v2
*
* Based on sound/soc/omap/overo.c by Steve Sakoman
*
* 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
*
*/
#include <linux/clk.h>
#include <linux/platform_device.h>
#include <linux/module.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/soc.h>
#include <asm/mach-types.h>
#include <mach/hardware.h>
#include <mach/gpio.h>
#include <plat/mcbsp.h>
#include "omap-mcbsp.h"
#include "omap-pcm.h"
static
int
igep2_hw_params
(
struct
snd_pcm_substream
*
substream
,
struct
snd_pcm_hw_params
*
params
)
{
struct
snd_soc_pcm_runtime
*
rtd
=
substream
->
private_data
;
struct
snd_soc_dai
*
codec_dai
=
rtd
->
codec_dai
;
int
ret
;
/* Set the codec system clock for DAC and ADC */
ret
=
snd_soc_dai_set_sysclk
(
codec_dai
,
0
,
26000000
,
SND_SOC_CLOCK_IN
);
if
(
ret
<
0
)
{
printk
(
KERN_ERR
"can't set codec system clock
\n
"
);
return
ret
;
}
return
0
;
}
static
struct
snd_soc_ops
igep2_ops
=
{
.
hw_params
=
igep2_hw_params
,
};
/* Digital audio interface glue - connects codec <--> CPU */
static
struct
snd_soc_dai_link
igep2_dai
=
{
.
name
=
"TWL4030"
,
.
stream_name
=
"TWL4030"
,
.
cpu_dai_name
=
"omap-mcbsp.2"
,
.
codec_dai_name
=
"twl4030-hifi"
,
.
platform_name
=
"omap-pcm-audio"
,
.
codec_name
=
"twl4030-codec"
,
.
dai_fmt
=
SND_SOC_DAIFMT_I2S
|
SND_SOC_DAIFMT_NB_NF
|
SND_SOC_DAIFMT_CBM_CFM
,
.
ops
=
&
igep2_ops
,
};
/* Audio machine driver */
static
struct
snd_soc_card
snd_soc_card_igep2
=
{
.
name
=
"igep2"
,
.
owner
=
THIS_MODULE
,
.
dai_link
=
&
igep2_dai
,
.
num_links
=
1
,
};
static
struct
platform_device
*
igep2_snd_device
;
static
int
__init
igep2_soc_init
(
void
)
{
int
ret
;
if
(
!
machine_is_igep0020
())
return
-
ENODEV
;
printk
(
KERN_INFO
"IGEP v2 SoC init
\n
"
);
igep2_snd_device
=
platform_device_alloc
(
"soc-audio"
,
-
1
);
if
(
!
igep2_snd_device
)
{
printk
(
KERN_ERR
"Platform device allocation failed
\n
"
);
return
-
ENOMEM
;
}
platform_set_drvdata
(
igep2_snd_device
,
&
snd_soc_card_igep2
);
ret
=
platform_device_add
(
igep2_snd_device
);
if
(
ret
)
goto
err1
;
return
0
;
err1:
printk
(
KERN_ERR
"Unable to add platform device
\n
"
);
platform_device_put
(
igep2_snd_device
);
return
ret
;
}
module_init
(
igep2_soc_init
);
static
void
__exit
igep2_soc_exit
(
void
)
{
platform_device_unregister
(
igep2_snd_device
);
}
module_exit
(
igep2_soc_exit
);
MODULE_AUTHOR
(
"Enric Balletbo i Serra <eballetbo@iseebcn.com>"
);
MODULE_DESCRIPTION
(
"ALSA SoC IGEP v2"
);
MODULE_LICENSE
(
"GPL"
);
sound/soc/omap/omap
3beagle
.c
→
sound/soc/omap/omap
-twl4030
.c
View file @
1837ce35
/*
/*
* omap
3beagle.c -- SoC audio for OMAP3 Beagle
* omap
-twl4030.c -- SoC audio for TI SoC based boards with twl4030 codec
*
*
* Author: Steve Sakoman <steve@sakoman.com>
* Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com
* All rights reserved.
*
* Author: Peter Ujfalusi <peter.ujfalusi@ti.com>
*
* This driver replaces the following machine drivers:
* omap3beagle (Author: Steve Sakoman <steve@sakoman.com>)
* omap3evm (Author: Anuj Aggarwal <anuj.aggarwal@ti.com>)
* overo (Author: Steve Sakoman <steve@sakoman.com>)
* igep0020 (Author: Enric Balletbo i Serra <eballetbo@iseebcn.com>)
*
*
* This program is free software; you can redistribute it and/or
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* modify it under the terms of the GNU General Public License
...
@@ -19,27 +28,26 @@
...
@@ -19,27 +28,26 @@
*
*
*/
*/
#include <linux/clk.h>
#include <linux/platform_device.h>
#include <linux/platform_device.h>
#include <linux/platform_data/omap-twl4030.h>
#include <linux/module.h>
#include <linux/module.h>
#include <linux/of.h>
#include <sound/core.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/pcm.h>
#include <sound/soc.h>
#include <sound/soc.h>
#include <asm/mach-types.h>
#include <mach/hardware.h>
#include <mach/gpio.h>
#include <plat/mcbsp.h>
#include "omap-mcbsp.h"
#include "omap-mcbsp.h"
#include "omap-pcm.h"
#include "omap-pcm.h"
static
int
omap
3beagle
_hw_params
(
struct
snd_pcm_substream
*
substream
,
static
int
omap
_twl4030
_hw_params
(
struct
snd_pcm_substream
*
substream
,
struct
snd_pcm_hw_params
*
params
)
struct
snd_pcm_hw_params
*
params
)
{
{
struct
snd_soc_pcm_runtime
*
rtd
=
substream
->
private_data
;
struct
snd_soc_pcm_runtime
*
rtd
=
substream
->
private_data
;
struct
snd_soc_dai
*
codec_dai
=
rtd
->
codec_dai
;
struct
snd_soc_dai
*
codec_dai
=
rtd
->
codec_dai
;
struct
snd_soc_dai
*
cpu_dai
=
rtd
->
cpu_dai
;
struct
snd_soc_dai
*
cpu_dai
=
rtd
->
cpu_dai
;
struct
snd_soc_codec
*
codec
=
rtd
->
codec
;
struct
snd_soc_card
*
card
=
codec
->
card
;
unsigned
int
fmt
;
unsigned
int
fmt
;
int
ret
;
int
ret
;
...
@@ -61,90 +69,120 @@ static int omap3beagle_hw_params(struct snd_pcm_substream *substream,
...
@@ -61,90 +69,120 @@ static int omap3beagle_hw_params(struct snd_pcm_substream *substream,
/* Set codec DAI configuration */
/* Set codec DAI configuration */
ret
=
snd_soc_dai_set_fmt
(
codec_dai
,
fmt
);
ret
=
snd_soc_dai_set_fmt
(
codec_dai
,
fmt
);
if
(
ret
<
0
)
{
if
(
ret
<
0
)
{
printk
(
KERN_ERR
"can't set codec DAI configuration
\n
"
);
dev_err
(
card
->
dev
,
"can't set codec DAI configuration
\n
"
);
return
ret
;
return
ret
;
}
}
/* Set cpu DAI configuration */
/* Set cpu DAI configuration */
ret
=
snd_soc_dai_set_fmt
(
cpu_dai
,
fmt
);
ret
=
snd_soc_dai_set_fmt
(
cpu_dai
,
fmt
);
if
(
ret
<
0
)
{
if
(
ret
<
0
)
{
printk
(
KERN_ERR
"can't set cpu DAI configuration
\n
"
);
dev_err
(
card
->
dev
,
"can't set cpu DAI configuration
\n
"
);
return
ret
;
}
/* Set the codec system clock for DAC and ADC */
ret
=
snd_soc_dai_set_sysclk
(
codec_dai
,
0
,
26000000
,
SND_SOC_CLOCK_IN
);
if
(
ret
<
0
)
{
printk
(
KERN_ERR
"can't set codec system clock
\n
"
);
return
ret
;
return
ret
;
}
}
return
0
;
return
0
;
}
}
static
struct
snd_soc_ops
omap
3beagle
_ops
=
{
static
struct
snd_soc_ops
omap
_twl4030
_ops
=
{
.
hw_params
=
omap
3beagle
_hw_params
,
.
hw_params
=
omap
_twl4030
_hw_params
,
};
};
/* Digital audio interface glue - connects codec <--> CPU */
/* Digital audio interface glue - connects codec <--> CPU */
static
struct
snd_soc_dai_link
omap3beagle_dai
=
{
static
struct
snd_soc_dai_link
omap_twl4030_dai_links
[]
=
{
{
.
name
=
"TWL4030"
,
.
name
=
"TWL4030"
,
.
stream_name
=
"TWL4030"
,
.
stream_name
=
"TWL4030"
,
.
cpu_dai_name
=
"omap-mcbsp.2"
,
.
cpu_dai_name
=
"omap-mcbsp.2"
,
.
platform_name
=
"omap-pcm-audio"
,
.
codec_dai_name
=
"twl4030-hifi"
,
.
codec_dai_name
=
"twl4030-hifi"
,
.
platform_name
=
"omap-pcm-audio"
,
.
codec_name
=
"twl4030-codec"
,
.
codec_name
=
"twl4030-codec"
,
.
ops
=
&
omap3beagle_ops
,
.
ops
=
&
omap_twl4030_ops
,
},
};
};
/* Audio machine driver */
/* Audio machine driver */
static
struct
snd_soc_card
snd_soc_omap3beagle
=
{
static
struct
snd_soc_card
omap_twl4030_card
=
{
.
name
=
"omap3beagle"
,
.
owner
=
THIS_MODULE
,
.
owner
=
THIS_MODULE
,
.
dai_link
=
&
omap3beagle_dai
,
.
dai_link
=
omap_twl4030_dai_links
,
.
num_links
=
1
,
.
num_links
=
ARRAY_SIZE
(
omap_twl4030_dai_links
)
,
};
};
static
struct
platform_device
*
omap3beagle_snd_device
;
static
__devinit
int
omap_twl4030_probe
(
struct
platform_device
*
pdev
)
static
int
__init
omap3beagle_soc_init
(
void
)
{
{
int
ret
;
struct
omap_tw4030_pdata
*
pdata
=
dev_get_platdata
(
&
pdev
->
dev
);
struct
device_node
*
node
=
pdev
->
dev
.
of_node
;
struct
snd_soc_card
*
card
=
&
omap_twl4030_card
;
int
ret
=
0
;
if
(
!
(
machine_is_omap3_beagle
()
||
machine_is_devkit8000
()))
card
->
dev
=
&
pdev
->
dev
;
return
-
ENODEV
;
pr_info
(
"OMAP3 Beagle/Devkit8000 SoC init
\n
"
);
omap3beagle_snd_device
=
platform_device_alloc
(
"soc-audio"
,
-
1
);
if
(
node
)
{
if
(
!
omap3beagle_snd_device
)
{
struct
device_node
*
dai_node
;
printk
(
KERN_ERR
"Platform device allocation failed
\n
"
);
return
-
ENOMEM
;
if
(
snd_soc_of_parse_card_name
(
card
,
"ti,model"
))
{
dev_err
(
&
pdev
->
dev
,
"Card name is not provided
\n
"
);
return
-
ENODEV
;
}
}
platform_set_drvdata
(
omap3beagle_snd_device
,
&
snd_soc_omap3beagle
);
dai_node
=
of_parse_phandle
(
node
,
"ti,mcbsp"
,
0
);
if
(
!
dai_node
)
{
dev_err
(
&
pdev
->
dev
,
"McBSP node is not provided
\n
"
);
return
-
EINVAL
;
}
omap_twl4030_dai_links
[
0
].
cpu_dai_name
=
NULL
;
omap_twl4030_dai_links
[
0
].
cpu_of_node
=
dai_node
;
}
else
if
(
pdata
)
{
if
(
pdata
->
card_name
)
{
card
->
name
=
pdata
->
card_name
;
}
else
{
dev_err
(
&
pdev
->
dev
,
"Card name is not provided
\n
"
);
return
-
ENODEV
;
}
}
else
{
dev_err
(
&
pdev
->
dev
,
"Missing pdata
\n
"
);
return
-
ENODEV
;
}
ret
=
platform_device_add
(
omap3beagle_snd_device
);
ret
=
snd_soc_register_card
(
card
);
if
(
ret
)
if
(
ret
)
{
goto
err1
;
dev_err
(
&
pdev
->
dev
,
"snd_soc_register_card() failed: %d
\n
"
,
ret
);
return
ret
;
}
return
0
;
return
0
;
err1:
printk
(
KERN_ERR
"Unable to add platform device
\n
"
);
platform_device_put
(
omap3beagle_snd_device
);
return
ret
;
}
}
static
void
__exit
omap3beagle_soc_exit
(
void
)
static
int
__devexit
omap_twl4030_remove
(
struct
platform_device
*
pdev
)
{
{
platform_device_unregister
(
omap3beagle_snd_device
);
struct
snd_soc_card
*
card
=
platform_get_drvdata
(
pdev
);
snd_soc_unregister_card
(
card
);
return
0
;
}
}
module_init
(
omap3beagle_soc_init
);
static
const
struct
of_device_id
omap_twl4030_of_match
[]
=
{
module_exit
(
omap3beagle_soc_exit
);
{.
compatible
=
"ti,omap-twl4030"
,
},
{
},
};
MODULE_DEVICE_TABLE
(
of
,
omap_twl4030_of_match
);
static
struct
platform_driver
omap_twl4030_driver
=
{
.
driver
=
{
.
name
=
"omap-twl4030"
,
.
owner
=
THIS_MODULE
,
.
pm
=
&
snd_soc_pm_ops
,
.
of_match_table
=
omap_twl4030_of_match
,
},
.
probe
=
omap_twl4030_probe
,
.
remove
=
__devexit_p
(
omap_twl4030_remove
),
};
module_platform_driver
(
omap_twl4030_driver
);
MODULE_AUTHOR
(
"
Steve Sakoman <steve@sakoman
.com>"
);
MODULE_AUTHOR
(
"
Peter Ujfalusi <peter.ujfalusi@ti
.com>"
);
MODULE_DESCRIPTION
(
"ALSA SoC
OMAP3 Beagle
"
);
MODULE_DESCRIPTION
(
"ALSA SoC
for TI SoC based boards with twl4030 codec
"
);
MODULE_LICENSE
(
"GPL"
);
MODULE_LICENSE
(
"GPL"
);
MODULE_ALIAS
(
"platform:omap-twl4030"
);
sound/soc/omap/omap3evm.c
deleted
100644 → 0
View file @
3876566a
/*
* omap3evm.c -- ALSA SoC support for OMAP3 EVM
*
* Author: Anuj Aggarwal <anuj.aggarwal@ti.com>
*
* Based on sound/soc/omap/beagle.c by Steve Sakoman
*
* Copyright (C) 2008 Texas Instruments, Incorporated
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation version 2.
*
* This program is distributed "as is" WITHOUT ANY WARRANTY of any kind,
* whether express or implied; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*/
#include <linux/clk.h>
#include <linux/platform_device.h>
#include <linux/module.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/soc.h>
#include <asm/mach-types.h>
#include <mach/hardware.h>
#include <mach/gpio.h>
#include <plat/mcbsp.h>
#include "omap-mcbsp.h"
#include "omap-pcm.h"
static
int
omap3evm_hw_params
(
struct
snd_pcm_substream
*
substream
,
struct
snd_pcm_hw_params
*
params
)
{
struct
snd_soc_pcm_runtime
*
rtd
=
substream
->
private_data
;
struct
snd_soc_dai
*
codec_dai
=
rtd
->
codec_dai
;
int
ret
;
/* Set the codec system clock for DAC and ADC */
ret
=
snd_soc_dai_set_sysclk
(
codec_dai
,
0
,
26000000
,
SND_SOC_CLOCK_IN
);
if
(
ret
<
0
)
{
printk
(
KERN_ERR
"Can't set codec system clock
\n
"
);
return
ret
;
}
return
0
;
}
static
struct
snd_soc_ops
omap3evm_ops
=
{
.
hw_params
=
omap3evm_hw_params
,
};
/* Digital audio interface glue - connects codec <--> CPU */
static
struct
snd_soc_dai_link
omap3evm_dai
=
{
.
name
=
"TWL4030"
,
.
stream_name
=
"TWL4030"
,
.
cpu_dai_name
=
"omap-mcbsp.2"
,
.
codec_dai_name
=
"twl4030-hifi"
,
.
platform_name
=
"omap-pcm-audio"
,
.
codec_name
=
"twl4030-codec"
,
.
dai_fmt
=
SND_SOC_DAIFMT_I2S
|
SND_SOC_DAIFMT_NB_NF
|
SND_SOC_DAIFMT_CBM_CFM
,
.
ops
=
&
omap3evm_ops
,
};
/* Audio machine driver */
static
struct
snd_soc_card
snd_soc_omap3evm
=
{
.
name
=
"omap3evm"
,
.
owner
=
THIS_MODULE
,
.
dai_link
=
&
omap3evm_dai
,
.
num_links
=
1
,
};
static
struct
platform_device
*
omap3evm_snd_device
;
static
int
__init
omap3evm_soc_init
(
void
)
{
int
ret
;
if
(
!
machine_is_omap3evm
())
return
-
ENODEV
;
pr_info
(
"OMAP3 EVM SoC init
\n
"
);
omap3evm_snd_device
=
platform_device_alloc
(
"soc-audio"
,
-
1
);
if
(
!
omap3evm_snd_device
)
{
printk
(
KERN_ERR
"Platform device allocation failed
\n
"
);
return
-
ENOMEM
;
}
platform_set_drvdata
(
omap3evm_snd_device
,
&
snd_soc_omap3evm
);
ret
=
platform_device_add
(
omap3evm_snd_device
);
if
(
ret
)
goto
err1
;
return
0
;
err1:
printk
(
KERN_ERR
"Unable to add platform device
\n
"
);
platform_device_put
(
omap3evm_snd_device
);
return
ret
;
}
static
void
__exit
omap3evm_soc_exit
(
void
)
{
platform_device_unregister
(
omap3evm_snd_device
);
}
module_init
(
omap3evm_soc_init
);
module_exit
(
omap3evm_soc_exit
);
MODULE_AUTHOR
(
"Anuj Aggarwal <anuj.aggarwal@ti.com>"
);
MODULE_DESCRIPTION
(
"ALSA SoC OMAP3 EVM"
);
MODULE_LICENSE
(
"GPL v2"
);
sound/soc/omap/overo.c
deleted
100644 → 0
View file @
3876566a
/*
* overo.c -- SoC audio for Gumstix Overo
*
* Author: Steve Sakoman <steve@sakoman.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
*
*/
#include <linux/clk.h>
#include <linux/platform_device.h>
#include <linux/module.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/soc.h>
#include <asm/mach-types.h>
#include <mach/hardware.h>
#include <mach/gpio.h>
#include <plat/mcbsp.h>
#include "omap-mcbsp.h"
#include "omap-pcm.h"
static
int
overo_hw_params
(
struct
snd_pcm_substream
*
substream
,
struct
snd_pcm_hw_params
*
params
)
{
struct
snd_soc_pcm_runtime
*
rtd
=
substream
->
private_data
;
struct
snd_soc_dai
*
codec_dai
=
rtd
->
codec_dai
;
int
ret
;
/* Set the codec system clock for DAC and ADC */
ret
=
snd_soc_dai_set_sysclk
(
codec_dai
,
0
,
26000000
,
SND_SOC_CLOCK_IN
);
if
(
ret
<
0
)
{
printk
(
KERN_ERR
"can't set codec system clock
\n
"
);
return
ret
;
}
return
0
;
}
static
struct
snd_soc_ops
overo_ops
=
{
.
hw_params
=
overo_hw_params
,
};
/* Digital audio interface glue - connects codec <--> CPU */
static
struct
snd_soc_dai_link
overo_dai
=
{
.
name
=
"TWL4030"
,
.
stream_name
=
"TWL4030"
,
.
cpu_dai_name
=
"omap-mcbsp.2"
,
.
codec_dai_name
=
"twl4030-hifi"
,
.
platform_name
=
"omap-pcm-audio"
,
.
codec_name
=
"twl4030-codec"
,
.
dai_fmt
=
SND_SOC_DAIFMT_I2S
|
SND_SOC_DAIFMT_NB_NF
|
SND_SOC_DAIFMT_CBM_CFM
,
.
ops
=
&
overo_ops
,
};
/* Audio machine driver */
static
struct
snd_soc_card
snd_soc_card_overo
=
{
.
name
=
"overo"
,
.
owner
=
THIS_MODULE
,
.
dai_link
=
&
overo_dai
,
.
num_links
=
1
,
};
static
struct
platform_device
*
overo_snd_device
;
static
int
__init
overo_soc_init
(
void
)
{
int
ret
;
if
(
!
(
machine_is_overo
()
||
machine_is_cm_t35
()))
{
pr_debug
(
"Incomatible machine!
\n
"
);
return
-
ENODEV
;
}
printk
(
KERN_INFO
"overo SoC init
\n
"
);
overo_snd_device
=
platform_device_alloc
(
"soc-audio"
,
-
1
);
if
(
!
overo_snd_device
)
{
printk
(
KERN_ERR
"Platform device allocation failed
\n
"
);
return
-
ENOMEM
;
}
platform_set_drvdata
(
overo_snd_device
,
&
snd_soc_card_overo
);
ret
=
platform_device_add
(
overo_snd_device
);
if
(
ret
)
goto
err1
;
return
0
;
err1:
printk
(
KERN_ERR
"Unable to add platform device
\n
"
);
platform_device_put
(
overo_snd_device
);
return
ret
;
}
module_init
(
overo_soc_init
);
static
void
__exit
overo_soc_exit
(
void
)
{
platform_device_unregister
(
overo_snd_device
);
}
module_exit
(
overo_soc_exit
);
MODULE_AUTHOR
(
"Steve Sakoman <steve@sakoman.com>"
);
MODULE_DESCRIPTION
(
"ALSA SoC overo"
);
MODULE_LICENSE
(
"GPL"
);
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment