ALSA: ASoC for Au1000/1500/1100
cover ALSA: ASoC for Au1000/1500/1100
Hello,
These 2 patches implement ASoC drivers for the AC97 controller found on early Alchemy chips. They are largely based on the old mips/au1x00.c driver which they replace.
Tested on a Db1500 development board.
Manuel Lauss (2):
ALSA: Alchemy AC97C audio support
ALSA: delete MIPS au1x00 driver
arch/mips/alchemy/devboards/db1x00/platform.c | 37 ++ sound/mips/Kconfig | 8 - sound/mips/Makefile | 2 - sound/mips/au1x00.c | 695 ------------------------- sound/soc/au1x/Kconfig | 25 + sound/soc/au1x/Makefile | 9 + sound/soc/au1x/ac97c.c | 398 ++++++++++++++ sound/soc/au1x/db1000.c | 75 +++ sound/soc/au1x/dma.c | 470 +++++++++++++++++ sound/soc/au1x/psc.h | 31 +- 10 files changed, 1036 insertions(+), 714 deletions(-) delete mode 100644 sound/mips/au1x00.c create mode 100644 sound/soc/au1x/ac97c.c create mode 100644 sound/soc/au1x/db1000.c create mode 100644 sound/soc/au1x/dma.c
Signature · 1 line
1.7.6
PATCH 1/2 ALSA: Alchemy AC97C audio support
This patch adds ASoC support for the AC97 controller on the old Au1000/Au1500/Au1100 chips and a universal machine driver for the Db1000/Db1500/Db1100 boards.
Tested on a Db1500 with a STAC9752 codec.
--- arch/mips/alchemy/devboards/db1x00/platform.c | 37 ++ sound/soc/au1x/Kconfig | 25 ++ sound/soc/au1x/Makefile | 9 + sound/soc/au1x/ac97c.c | 398 +++++++++++++++++++++ sound/soc/au1x/db1000.c | 75 ++++ sound/soc/au1x/dma.c | 470 +++++++++++++++++++++++++ sound/soc/au1x/psc.h | 31 ++- 7 files changed, 1036 insertions(+), 9 deletions(-) create mode 100644 sound/soc/au1x/ac97c.c create mode 100644 sound/soc/au1x/db1000.c create mode 100644 sound/soc/au1x/dma.c
arch/mips/alchemy/devboards/db1x00/platform.c +37 -0
@@ -19,8 +19,11 @@*/ #include <linux/init.h> +#include <linux/interrupt.h> #include <linux/platform_device.h> +#include <asm/mach-au1x00/au1000.h> +#include <asm/mach-au1x00/au1000_dma.h> #include <asm/mach-au1x00/au1xxx.h> #include <asm/mach-db1x00/bcsr.h> #include "../platform.h"
@@ -85,6 +88,36 @@#endif #endif +static struct resource alchemy_ac97c_res[] = { + [0 ] = { + .start =AU1000_AC97_PHYS_ADDR , + .end =AU1000_AC97_PHYS_ADDR +0xfff , + .flags =IORESOURCE_MEM , + }, + [1 ] = { + .start =DMA_ID_AC97C_TX , + .end =DMA_ID_AC97C_TX , + .flags =IORESOURCE_DMA , + }, + [2 ] = { + .start =DMA_ID_AC97C_RX , + .end =DMA_ID_AC97C_RX , + .flags =IORESOURCE_DMA , + }, +}; + +static struct platform_device alchemy_ac97c_dev = { + .name ="alchemy-ac97c" , + .id =-1 , + .resource = alchemy_ac97c_res, + .num_resources =ARRAY_SIZE (alchemy_ac97c_res), +}; + +static struct platform_device db1x00_codec_dev = { + .name ="ac97-codec" , + .id =-1 , +}; +static int __init db1xxx_dev_init (void ) {#ifdef DB1XXX_HAS_PCMCIA
@@ -113,6 +146,10 @@ static int __init db1xxx_dev_init(void) 1);#endif db1x_register_norflash (BOARD_FLASH_SIZE ,BOARD_FLASH_WIDTH ,F_SWAPPED ); + +platform_device_register (&db1x00_codec_dev); +platform_device_register (&alchemy_ac97c_dev); +return 0 ; }device_initcall (db1xxx_dev_init);
sound/soc/au1x/Kconfig +25 -0
@@ -18,10 +18,35 @@ config SND_SOC_AU1XPSC_AC97 select SND_AC97_CODEC select SND_SOC_AC97_BUS +## +## Au1000/1500/1100 DMA + AC97C/I2SC +## +config SND_SOC_AU1XAUDIO + tristate "SoC Audio for Au1000/Au1500/Au1100" + depends on MIPS_ALCHEMY + help + This is a driver set for the AC97 unit and the + old DMA controller as found on the Au1000/Au1500/Au1100 chips. + +config SND_SOC_AU1XAC97C + tristate + select AC97_BUS + select SND_AC97_CODEC + select SND_SOC_AC97_BUS + ## ## Boards ## +config SND_SOC_DB1000 + tristate "DB1000 Audio support" + depends on SND_SOC_AU1XAUDIO + select SND_SOC_AU1XAC97C + select SND_SOC_AC97_CODEC + help + Select this option to enable AC97 audio on the early DB1x00 series + of boards (DB1000/DB1500/DB1100). + config SND_SOC_DB1200 tristate "DB1200 AC97+I2S audio support" depends on SND_SOC_AU1XPSC
sound/soc/au1x/Makefile +9 -0
@@ -1,3 +1,10 @@ +# Au1000/1500/1100 Audio units +snd-soc-au1x-dma-objs := dma.o +snd-soc-au1x-ac97c-objs := ac97c.o + +obj-$(CONFIG_SND_SOC_AU1XAUDIO) += snd-soc-au1x-dma.o +obj-$(CONFIG_SND_SOC_AU1XAC97C) += snd-soc-au1x-ac97c.o + # Au1200/Au1550 PSC audio snd-soc-au1xpsc-dbdma-objs := dbdma2.o snd-soc-au1xpsc-i2s-objs := psc-i2s.o
@@ -8,6 +15,8 @@ obj-$(CONFIG_SND_SOC_AU1XPSC_I2S) += snd-soc-au1xpsc-i2s.o obj-$(CONFIG_SND_SOC_AU1XPSC_AC97) += snd-soc-au1xpsc-ac97.o # Boards +snd-soc-db1000-objs := db1000.o snd-soc-db1200-objs := db1200.o +obj-$(CONFIG_SND_SOC_DB1000) += snd-soc-db1000.o obj-$(CONFIG_SND_SOC_DB1200) += snd-soc-db1200.o
sound/soc/au1x/ac97c.c new file +398 -0
398 lines not on this page · raw message
sound/soc/au1x/db1000.c new file +75 -0
75 lines not on this page · raw message
sound/soc/au1x/dma.c new file +470 -0
470 lines not on this page · raw message
sound/soc/au1x/psc.h +22 -9
@@ -1,7 +1,7 @@/* -* Au12x0/Au1550 PSC ALSA ASoC audio support. +* Alchemy ALSA ASoC audio support. * -* (c) 2007-2008 MSC Vertriebsges.m.b.H., +* (c) 2007-2011 MSC Vertriebsges.m.b.H., * Manuel Lauss <[email protected]> * * This program is free software; you can redistribute it and/or modify
@@ -13,7 +13,26 @@#ifndef _AU1X_PCM_H#define _AU1X_PCM_H -/* DBDMA helpers */ +#define PCM_TX 0 +#define PCM_RX 1 + +#define SUBSTREAM_TYPE (substream) \ + ((substream)->stream == SNDRV_PCM_STREAM_PLAYBACK ? PCM_TX : PCM_RX) + + +/* AC97C/I2SC DMA helpers */ +extern struct platform_device *alchemy_pcm_add (struct platform_device *pdev, +int type); +extern void alchemy_pcm_destroy (struct platform_device *dmapd); + +/* Au1000 AC97C/I2SC DAI names. Required to get at correct DMA instance */ +#define AC97C_DAINAME "alchemy-ac97c" +#define I2SC_DAINAME "alchemy-i2sc" +#define AC97C_DMANAME "alchemy-pcm-ac97" +#define I2SC_DMANAME "alchemy-pcm-i2s" + + +/* PSC/DBDMA helpers */ extern struct platform_device *au1xpsc_pcm_add (struct platform_device *pdev);extern void au1xpsc_pcm_destroy (struct platform_device *dmapd);
@@ -30,12 +49,6 @@ struct au1xpsc_audio_data {struct platform_device *dmapd; }; -#define PCM_TX 0 -#define PCM_RX 1 - -#define SUBSTREAM_TYPE (substream) \ - ((substream)->stream == SNDRV_PCM_STREAM_PLAYBACK ? PCM_TX : PCM_RX) -/* easy access macros */ #define PSC_CTRL (x) ((unsigned long)((x)->mmio) + PSC_CTRL_OFFSET)#define PSC_SEL (x) ((unsigned long)((x)->mmio) + PSC_SEL_OFFSET)
Signature · 1 line
1.7.6
PATCH 2/2 ALSA: delete MIPS au1x00 driver
In reply to Manuel LaussSince there's now an ASOC replacement.
--- sound/mips/Kconfig | 8 - sound/mips/Makefile | 2 - sound/mips/au1x00.c | 695 --------------------------------------------------- 3 files changed, 0 insertions(+), 705 deletions(-) delete mode 100644 sound/mips/au1x00.c
sound/mips/Kconfig +0 -8
@@ -22,13 +22,5 @@ config SND_SGI_HAL2 Sound support for the SGI Indy and Indigo2 Workstation. -config SND_AU1X00 - tristate "Au1x00 AC97 Port Driver" - depends on SOC_AU1000 || SOC_AU1100 || SOC_AU1500 - select SND_PCM - select SND_AC97_CODEC - help - ALSA Sound driver for the Au1x00's AC97 port. - endif # SND_MIPS
sound/mips/Makefile +0 -2
@@ -2,11 +2,9 @@ # Makefile for ALSA # -snd-au1x00-objs := au1x00.o snd-sgi-o2-objs := sgio2audio.o ad1843.o snd-sgi-hal2-objs := hal2.o # Toplevel Module Dependency -obj-$(CONFIG_SND_AU1X00) += snd-au1x00.o obj-$(CONFIG_SND_SGI_O2) += snd-sgi-o2.o obj-$(CONFIG_SND_SGI_HAL2) += snd-sgi-hal2.o
sound/mips/au1x00.c deleted +0 -695
695 lines not on this page · raw message
Signature · 1 line
1.7.6
Dear Manuel,
Am Donnerstag, den 21.07.2011, 08:52 +0200 schrieb Manuel Lauss:
Quoted 9 lines
These 2 patches implement ASoC drivers for the AC97 controller found on early Alchemy chips. They are largely based on the old
mips/au1x00.cdriver which they replace.Tested on a Db1500 development board.
Manuel Lauss (2):
ALSA: Alchemy AC97C audio support
ALSA: delete MIPS au1x00 driver
thank you for your patches. ALSA ASoC want to be CCed on patches. Please resend your queue with Mark Brown and Liam Girdwood included in CC.
Additionally ASoC patches need to have »ASoC« prepended in the patch summary, i. e. the subject line.
Thanks,
Paul