diff options
author | Graeme Gregory <dp@xora.org.uk> | 2007-04-03 07:53:31 +0000 |
---|---|---|
committer | Graeme Gregory <dp@xora.org.uk> | 2007-04-03 07:53:31 +0000 |
commit | 346cdc522a94bb3a3998604bf1d0637d17ccf5f8 (patch) | |
tree | 43c656874f9c8111fc62bd97b09c8fabe67cfc79 /packages | |
parent | debf7fe692a5edc9930e6c844949304da8422058 (diff) |
linux-smdk2443_2.6.20+git.bb : add a kernel for the smdk2443 board from
samsung.
Diffstat (limited to 'packages')
14 files changed, 5297 insertions, 0 deletions
diff --git a/packages/linux/linux-smdk2443/.mtn2git_empty b/packages/linux/linux-smdk2443/.mtn2git_empty new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/packages/linux/linux-smdk2443/.mtn2git_empty diff --git a/packages/linux/linux-smdk2443/0020-Add-ASoC-S3C24xx-platform-support.patch b/packages/linux/linux-smdk2443/0020-Add-ASoC-S3C24xx-platform-support.patch new file mode 100644 index 0000000000..3c79c17422 --- /dev/null +++ b/packages/linux/linux-smdk2443/0020-Add-ASoC-S3C24xx-platform-support.patch @@ -0,0 +1,1077 @@ +From a958d8bfdf4fd043471012560a7e9a089d81390e Mon Sep 17 00:00:00 2001 +From: Liam Girdwood <liam@localhost.localdomain> +Date: Sun, 4 Mar 2007 16:56:28 +0000 +Subject: [PATCH] Add ASoC S3C24xx platform support. + +Signed-off-by: Ben Dooks <ben@simtec.co.uk> +Signed-off-by: Graeme Gregory <gg@opensource.wolfsonmicro.com> +Signed-off-by: Liam Girdwood <lg@opensource.wolfsonmicro.com> +--- + sound/soc/Kconfig | 1 + + sound/soc/Makefile | 2 +- + sound/soc/s3c24xx/Kconfig | 16 ++ + sound/soc/s3c24xx/Makefile | 7 + + sound/soc/s3c24xx/s3c24xx-i2s.c | 439 +++++++++++++++++++++++++++++++++++++ + sound/soc/s3c24xx/s3c24xx-i2s.h | 35 +++ + sound/soc/s3c24xx/s3c24xx-pcm.c | 462 +++++++++++++++++++++++++++++++++++++++ + sound/soc/s3c24xx/s3c24xx-pcm.h | 32 +++ + 8 files changed, 993 insertions(+), 1 deletions(-) + create mode 100644 sound/soc/s3c24xx/Kconfig + create mode 100644 sound/soc/s3c24xx/Makefile + create mode 100644 sound/soc/s3c24xx/s3c24xx-i2s.c + create mode 100644 sound/soc/s3c24xx/s3c24xx-i2s.h + create mode 100644 sound/soc/s3c24xx/s3c24xx-pcm.c + create mode 100644 sound/soc/s3c24xx/s3c24xx-pcm.h + +diff --git a/sound/soc/Kconfig b/sound/soc/Kconfig +index ec821a5..74a5f5f 100644 +--- a/sound/soc/Kconfig ++++ b/sound/soc/Kconfig +@@ -24,6 +24,7 @@ menu "SoC Platforms" + depends on SND_SOC + source "sound/soc/at91/Kconfig" + source "sound/soc/pxa/Kconfig" ++source "sound/soc/s3c24xx/Kconfig" + endmenu + + # Supported codecs +diff --git a/sound/soc/Makefile b/sound/soc/Makefile +index 98e6f49..0ae2e49 100644 +--- a/sound/soc/Makefile ++++ b/sound/soc/Makefile +@@ -1,4 +1,4 @@ + snd-soc-core-objs := soc-core.o soc-dapm.o + + obj-$(CONFIG_SND_SOC) += snd-soc-core.o +-obj-$(CONFIG_SND_SOC) += codecs/ at91/ pxa/ ++obj-$(CONFIG_SND_SOC) += codecs/ at91/ pxa/ s3c24xx/ +diff --git a/sound/soc/s3c24xx/Kconfig b/sound/soc/s3c24xx/Kconfig +new file mode 100644 +index 0000000..433da9f +--- /dev/null ++++ b/sound/soc/s3c24xx/Kconfig +@@ -0,0 +1,16 @@ ++menu "SoC Audio for the Samsung S3C24XX" ++ ++config SND_S3C24XX_SOC ++ tristate "SoC Audio for the Samsung S3C24XX chips" ++ depends on ARCH_S3C2410 && SND ++ select SND_PCM ++ help ++ Say Y or M if you want to add support for codecs attached to ++ the S3C24XX AC97, I2S or SSP interface. You will also need ++ to select the audio interfaces to support below. ++ ++config SND_S3C24XX_SOC_I2S ++ tristate ++ ++endmenu ++ +diff --git a/sound/soc/s3c24xx/Makefile b/sound/soc/s3c24xx/Makefile +new file mode 100644 +index 0000000..56200d7 +--- /dev/null ++++ b/sound/soc/s3c24xx/Makefile +@@ -0,0 +1,7 @@ ++# S3c24XX Platform Support ++snd-soc-s3c24xx-objs := s3c24xx-pcm.o ++snd-soc-s3c24xx-i2s-objs := s3c24xx-i2s.o ++ ++obj-$(CONFIG_SND_S3C24XX_SOC) += snd-soc-s3c24xx.o ++obj-$(CONFIG_SND_S3C24XX_SOC_I2S) += snd-soc-s3c24xx-i2s.o ++ +diff --git a/sound/soc/s3c24xx/s3c24xx-i2s.c b/sound/soc/s3c24xx/s3c24xx-i2s.c +new file mode 100644 +index 0000000..df655a5 +--- /dev/null ++++ b/sound/soc/s3c24xx/s3c24xx-i2s.c +@@ -0,0 +1,439 @@ ++/* ++ * s3c24xx-i2s.c -- ALSA Soc Audio Layer ++ * ++ * (c) 2006 Wolfson Microelectronics PLC. ++ * Graeme Gregory graeme.gregory@wolfsonmicro.com or linux@wolfsonmicro.com ++ * ++ * (c) 2004-2005 Simtec Electronics ++ * http://armlinux.simtec.co.uk/ ++ * Ben Dooks <ben@simtec.co.uk> ++ * ++ * 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; either version 2 of the License, or (at your ++ * option) any later version. ++ * ++ * ++ * Revision history ++ * 11th Dec 2006 Merged with Simtec driver ++ * 10th Nov 2006 Initial version. ++ */ ++ ++#include <linux/init.h> ++#include <linux/module.h> ++#include <linux/device.h> ++#include <linux/delay.h> ++#include <linux/clk.h> ++#include <sound/driver.h> ++#include <sound/core.h> ++#include <sound/pcm.h> ++#include <sound/pcm_params.h> ++#include <sound/initval.h> ++#include <sound/soc.h> ++ ++#include <asm/hardware.h> ++#include <asm/io.h> ++#include <asm/arch/regs-iis.h> ++#include <asm/arch/regs-gpio.h> ++#include <asm/arch/regs-clock.h> ++#include <asm/arch/audio.h> ++#include <asm/dma.h> ++#include <asm/arch/dma.h> ++ ++#include "s3c24xx-pcm.h" ++#include "s3c24xx-i2s.h" ++ ++#define S3C24XX_I2S_DEBUG 0 ++#if S3C24XX_I2S_DEBUG ++#define DBG(x...) printk(KERN_DEBUG x) ++#else ++#define DBG(x...) ++#endif ++ ++static struct s3c2410_dma_client s3c24xx_dma_client_out = { ++ .name = "I2S PCM Stereo out" ++}; ++ ++static struct s3c2410_dma_client s3c24xx_dma_client_in = { ++ .name = "I2S PCM Stereo in" ++}; ++ ++static struct s3c24xx_pcm_dma_params s3c24xx_i2s_pcm_stereo_out = { ++ .client = &s3c24xx_dma_client_out, ++ .channel = DMACH_I2S_OUT, ++ .dma_addr = S3C2410_PA_IIS + S3C2410_IISFIFO ++}; ++ ++static struct s3c24xx_pcm_dma_params s3c24xx_i2s_pcm_stereo_in = { ++ .client = &s3c24xx_dma_client_in, ++ .channel = DMACH_I2S_IN, ++ .dma_addr = S3C2410_PA_IIS + S3C2410_IISFIFO ++}; ++ ++struct s3c24xx_i2s_info { ++ void __iomem *regs; ++ struct clk *iis_clk; ++}; ++static struct s3c24xx_i2s_info s3c24xx_i2s; ++ ++static void s3c24xx_snd_txctrl(int on) ++{ ++ u32 iisfcon; ++ u32 iiscon; ++ u32 iismod; ++ ++ DBG("Entered %s\n", __FUNCTION__); ++ ++ iisfcon = readl(s3c24xx_i2s.regs + S3C2410_IISFCON); ++ iiscon = readl(s3c24xx_i2s.regs + S3C2410_IISCON); ++ iismod = readl(s3c24xx_i2s.regs + S3C2410_IISMOD); ++ ++ DBG("r: IISCON: %lx IISMOD: %lx IISFCON: %lx\n", iiscon, iismod, iisfcon); ++ ++ if (on) { ++ iisfcon |= S3C2410_IISFCON_TXDMA | S3C2410_IISFCON_TXENABLE; ++ iiscon |= S3C2410_IISCON_TXDMAEN | S3C2410_IISCON_IISEN; ++ iiscon &= ~S3C2410_IISCON_TXIDLE; ++ iismod |= S3C2410_IISMOD_TXMODE; ++ ++ writel(iismod, s3c24xx_i2s.regs + S3C2410_IISMOD); ++ writel(iisfcon, s3c24xx_i2s.regs + S3C2410_IISFCON); ++ writel(iiscon, s3c24xx_i2s.regs + S3C2410_IISCON); ++ } else { ++ /* note, we have to disable the FIFOs otherwise bad things ++ * seem to happen when the DMA stops. According to the ++ * Samsung supplied kernel, this should allow the DMA ++ * engine and FIFOs to reset. If this isn't allowed, the ++ * DMA engine will simply freeze randomly. ++ */ ++ ++ iisfcon &= ~S3C2410_IISFCON_TXENABLE; ++ iisfcon &= ~S3C2410_IISFCON_TXDMA; ++ iiscon |= S3C2410_IISCON_TXIDLE; ++ iiscon &= ~S3C2410_IISCON_TXDMAEN; ++ iismod &= ~S3C2410_IISMOD_TXMODE; ++ ++ writel(iiscon, s3c24xx_i2s.regs + S3C2410_IISCON); ++ writel(iisfcon, s3c24xx_i2s.regs + S3C2410_IISFCON); ++ writel(iismod, s3c24xx_i2s.regs + S3C2410_IISMOD); ++ } ++ ++ DBG("w: IISCON: %lx IISMOD: %lx IISFCON: %lx\n", iiscon, iismod, iisfcon); ++} ++ ++static void s3c24xx_snd_rxctrl(int on) ++{ ++ u32 iisfcon; ++ u32 iiscon; ++ u32 iismod; ++ ++ DBG("Entered %s\n", __FUNCTION__); ++ ++ iisfcon = readl(s3c24xx_i2s.regs + S3C2410_IISFCON); ++ iiscon = readl(s3c24xx_i2s.regs + S3C2410_IISCON); ++ iismod = readl(s3c24xx_i2s.regs + S3C2410_IISMOD); ++ ++ DBG("r: IISCON: %lx IISMOD: %lx IISFCON: %lx\n", iiscon, iismod, iisfcon); ++ ++ if (on) { ++ iisfcon |= S3C2410_IISFCON_RXDMA | S3C2410_IISFCON_RXENABLE; ++ iiscon |= S3C2410_IISCON_RXDMAEN | S3C2410_IISCON_IISEN; ++ iiscon &= ~S3C2410_IISCON_RXIDLE; ++ iismod |= S3C2410_IISMOD_RXMODE; ++ ++ writel(iismod, s3c24xx_i2s.regs + S3C2410_IISMOD); ++ writel(iisfcon, s3c24xx_i2s.regs + S3C2410_IISFCON); ++ writel(iiscon, s3c24xx_i2s.regs + S3C2410_IISCON); ++ } else { ++ /* note, we have to disable the FIFOs otherwise bad things ++ * seem to happen when the DMA stops. According to the ++ * Samsung supplied kernel, this should allow the DMA ++ * engine and FIFOs to reset. If this isn't allowed, the ++ * DMA engine will simply freeze randomly. ++ */ ++ ++ iisfcon &= ~S3C2410_IISFCON_RXENABLE; ++ iisfcon &= ~S3C2410_IISFCON_RXDMA; ++ iiscon |= S3C2410_IISCON_RXIDLE; ++ iiscon &= ~S3C2410_IISCON_RXDMAEN; ++ iismod &= ~S3C2410_IISMOD_RXMODE; ++ ++ writel(iisfcon, s3c24xx_i2s.regs + S3C2410_IISFCON); ++ writel(iiscon, s3c24xx_i2s.regs + S3C2410_IISCON); ++ writel(iismod, s3c24xx_i2s.regs + S3C2410_IISMOD); ++ } ++ ++ DBG("w: IISCON: %lx IISMOD: %lx IISFCON: %lx\n", iiscon, iismod, iisfcon); ++} ++ ++/* ++ * Wait for the LR signal to allow synchronisation to the L/R clock ++ * from the codec. May only be needed for slave mode. ++ */ ++static int s3c24xx_snd_lrsync(void) ++{ ++ u32 iiscon; ++ unsigned long timeout = jiffies + msecs_to_jiffies(5); ++ ++ DBG("Entered %s\n", __FUNCTION__); ++ ++ while (1) { ++ iiscon = readl(s3c24xx_i2s.regs + S3C2410_IISCON); ++ if (iiscon & S3C2410_IISCON_LRINDEX) ++ break; ++ ++ if (timeout < jiffies) ++ return -ETIMEDOUT; ++ } ++ ++ return 0; ++} ++ ++/* ++ * Check whether CPU is the master or slave ++ */ ++static inline int s3c24xx_snd_is_clkmaster(void) ++{ ++ DBG("Entered %s\n", __FUNCTION__); ++ ++ return (readl(s3c24xx_i2s.regs + S3C2410_IISMOD) & S3C2410_IISMOD_SLAVE) ? 0:1; ++} ++ ++/* ++ * Set S3C24xx I2S DAI format ++ */ ++static int s3c24xx_i2s_set_fmt(struct snd_soc_cpu_dai *cpu_dai, ++ unsigned int fmt) ++{ ++ u32 iismod; ++ ++ DBG("Entered %s\n", __FUNCTION__); ++ ++ iismod = readl(s3c24xx_i2s.regs + S3C2410_IISMOD); ++ DBG("hw_params r: IISMOD: %lx \n", iismod); ++ ++ switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) { ++ case SND_SOC_DAIFMT_CBM_CFM: ++ iismod |= S3C2410_IISMOD_SLAVE; ++ break; ++ case SND_SOC_DAIFMT_CBS_CFS: ++ break; ++ default: ++ return -EINVAL; ++ } ++ ++ switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) { ++ case SND_SOC_DAIFMT_LEFT_J: ++ iismod |= S3C2410_IISMOD_MSB; ++ break; ++ case SND_SOC_DAIFMT_I2S: ++ break; ++ default: ++ return -EINVAL; ++ } ++ ++ writel(iismod, s3c24xx_i2s.regs + S3C2410_IISMOD); ++ DBG("hw_params w: IISMOD: %lx \n", iismod); ++ return 0; ++} ++ ++static int s3c24xx_i2s_hw_params(struct snd_pcm_substream *substream, ++ struct snd_pcm_hw_params *params) ++{ ++ struct snd_soc_pcm_runtime *rtd = substream->private_data; ++ u32 iismod; ++ ++ DBG("Entered %s\n", __FUNCTION__); ++ ++ if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) ++ rtd->dai->cpu_dai->dma_data = &s3c24xx_i2s_pcm_stereo_out; ++ else ++ rtd->dai->cpu_dai->dma_data = &s3c24xx_i2s_pcm_stereo_in; ++ ++ /* Working copies of register */ ++ iismod = readl(s3c24xx_i2s.regs + S3C2410_IISMOD); ++ DBG("hw_params r: IISMOD: %lx\n", iismod); ++ ++ switch (params_format(params)) { ++ case SNDRV_PCM_FORMAT_S8: ++ break; ++ case SNDRV_PCM_FORMAT_S16_LE: ++ iismod |= S3C2410_IISMOD_16BIT; ++ break; ++ } ++ ++ writel(iismod, s3c24xx_i2s.regs + S3C2410_IISMOD); ++ DBG("hw_params w: IISMOD: %lx\n", iismod); ++ return 0; ++} ++ ++static int s3c24xx_i2s_trigger(struct snd_pcm_substream *substream, int cmd) ++{ ++ int ret = 0; ++ ++ DBG("Entered %s\n", __FUNCTION__); ++ ++ switch (cmd) { ++ case SNDRV_PCM_TRIGGER_START: ++ case SNDRV_PCM_TRIGGER_RESUME: ++ case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: ++ if (!s3c24xx_snd_is_clkmaster()) { ++ ret = s3c24xx_snd_lrsync(); ++ if (ret) ++ goto exit_err; ++ } ++ ++ if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) ++ s3c24xx_snd_rxctrl(1); ++ else ++ s3c24xx_snd_txctrl(1); ++ break; ++ case SNDRV_PCM_TRIGGER_STOP: ++ case SNDRV_PCM_TRIGGER_SUSPEND: ++ case SNDRV_PCM_TRIGGER_PAUSE_PUSH: ++ if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) ++ s3c24xx_snd_rxctrl(0); ++ else ++ s3c24xx_snd_txctrl(0); ++ break; ++ default: ++ ret = -EINVAL; ++ break; ++ } ++ ++exit_err: ++ return ret; ++} ++ ++/* ++ * Set S3C24xx Clock source ++ */ ++static int s3c24xx_i2s_set_sysclk(struct snd_soc_cpu_dai *cpu_dai, ++ int clk_id, unsigned int freq, int dir) ++{ ++ u32 iismod = readl(s3c24xx_i2s.regs + S3C2410_IISMOD); ++ ++ DBG("Entered %s\n", __FUNCTION__); ++ ++ iismod &= ~S3C2440_IISMOD_MPLL; ++ ++ switch (clk_id) { ++ case S3C24XX_CLKSRC_PCLK: ++ break; ++ case S3C24XX_CLKSRC_MPLL: ++ iismod |= S3C2440_IISMOD_MPLL; ++ break; ++ default: ++ return -EINVAL; ++ } ++ ++ writel(iismod, s3c24xx_i2s.regs + S3C2410_IISMOD); ++ return 0; ++} ++ ++/* ++ * Set S3C24xx Clock dividers ++ */ ++static int s3c24xx_i2s_set_clkdiv(struct snd_soc_cpu_dai *cpu_dai, ++ int div_id, int div) ++{ ++ u32 reg; ++ ++ DBG("Entered %s\n", __FUNCTION__); ++ ++ switch (div_id) { ++ case S3C24XX_DIV_MCLK: ++ reg = readl(s3c24xx_i2s.regs + S3C2410_IISMOD) & ~S3C2410_IISMOD_FS_MASK; ++ writel(reg | div, s3c24xx_i2s.regs + S3C2410_IISMOD); ++ break; ++ case S3C24XX_DIV_BCLK: ++ reg = readl(s3c24xx_i2s.regs + S3C2410_IISMOD) & ~(S3C2410_IISMOD_384FS); ++ writel(reg | div, s3c24xx_i2s.regs + S3C2410_IISMOD); ++ break; ++ case S3C24XX_DIV_PRESCALER: ++ writel(div, s3c24xx_i2s.regs + S3C2410_IISPSR); ++ reg = readl(s3c24xx_i2s.regs + S3C2410_IISCON); ++ writel(reg | S3C2410_IISCON_PSCEN, s3c24xx_i2s.regs + S3C2410_IISCON); ++ break; ++ default: ++ return -EINVAL; ++ } ++ ++ return 0; ++} ++ ++/* ++ * To avoid duplicating clock code, allow machine driver to ++ * get the clockrate from here. ++ */ ++u32 s3c24xx_i2s_get_clockrate(void) ++{ ++ return clk_get_rate(s3c24xx_i2s.iis_clk); ++} ++EXPORT_SYMBOL_GPL(s3c24xx_i2s_get_clockrate); ++ ++static int s3c24xx_i2s_probe(struct platform_device *pdev) ++{ ++ DBG("Entered %s\n", __FUNCTION__); ++ ++ s3c24xx_i2s.regs = ioremap(S3C2410_PA_IIS, 0x100); ++ if (s3c24xx_i2s.regs == NULL) ++ return -ENXIO; ++ ++ s3c24xx_i2s.iis_clk=clk_get(&pdev->dev, "iis"); ++ if (s3c24xx_i2s.iis_clk == NULL) { ++ DBG("failed to get iis_clock\n"); ++ return -ENODEV; ++ } ++ clk_enable(s3c24xx_i2s.iis_clk); ++ ++ /* Configure the I2S pins in correct mode */ ++ s3c2410_gpio_cfgpin(S3C2410_GPE0, S3C2410_GPE0_I2SLRCK); ++ s3c2410_gpio_cfgpin(S3C2410_GPE1, S3C2410_GPE1_I2SSCLK); ++ s3c2410_gpio_cfgpin(S3C2410_GPE2, S3C2410_GPE2_CDCLK); ++ s3c2410_gpio_cfgpin(S3C2410_GPE3, S3C2410_GPE3_I2SSDI); ++ s3c2410_gpio_cfgpin(S3C2410_GPE4, S3C2410_GPE4_I2SSDO); ++ ++ writel(S3C2410_IISCON_IISEN, s3c24xx_i2s.regs + S3C2410_IISCON); ++ ++ s3c24xx_snd_txctrl(0); ++ s3c24xx_snd_rxctrl(0); ++ ++ return 0; ++} ++ ++#define S3C24XX_I2S_RATES \ ++ (SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_11025 | SNDRV_PCM_RATE_16000 | \ ++ SNDRV_PCM_RATE_22050 | SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 | \ ++ SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000) ++ ++struct snd_soc_cpu_dai s3c24xx_i2s_dai = { ++ .name = "s3c24xx-i2s", ++ .id = 0, ++ .type = SND_SOC_DAI_I2S, ++ .probe = s3c24xx_i2s_probe, ++ .playback = { ++ .channels_min = 2, ++ .channels_max = 2, ++ .rates = S3C24XX_I2S_RATES, ++ .formats = SNDRV_PCM_FMTBIT_S8 | SNDRV_PCM_FMTBIT_S16_LE,}, ++ .capture = { ++ .channels_min = 2, ++ .channels_max = 2, ++ .rates = S3C24XX_I2S_RATES, ++ .formats = SNDRV_PCM_FMTBIT_S8 | SNDRV_PCM_FMTBIT_S16_LE,}, ++ .ops = { ++ .trigger = s3c24xx_i2s_trigger, ++ .hw_params = s3c24xx_i2s_hw_params,}, ++ .dai_ops = { ++ .set_fmt = s3c24xx_i2s_set_fmt, ++ .set_clkdiv = s3c24xx_i2s_set_clkdiv, ++ .set_sysclk = s3c24xx_i2s_set_sysclk, ++ }, ++}; ++EXPORT_SYMBOL_GPL(s3c24xx_i2s_dai); ++ ++/* Module information */ ++MODULE_AUTHOR("Ben Dooks, <ben@simtec.co.uk>"); ++MODULE_DESCRIPTION("s3c24xx I2S SoC Interface"); ++MODULE_LICENSE("GPL"); +diff --git a/sound/soc/s3c24xx/s3c24xx-i2s.h b/sound/soc/s3c24xx/s3c24xx-i2s.h +new file mode 100644 +index 0000000..f9ca04e +--- /dev/null ++++ b/sound/soc/s3c24xx/s3c24xx-i2s.h +@@ -0,0 +1,35 @@ ++/* ++ * s3c24xx-i2s.c -- ALSA Soc Audio Layer ++ * ++ * Copyright 2005 Wolfson Microelectronics PLC. ++ * Author: Graeme Gregory ++ * graeme.gregory@wolfsonmicro.com or linux@wolfsonmicro.com ++ * ++ * 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; either version 2 of the License, or (at your ++ * option) any later version. ++ * ++ * Revision history ++ * 10th Nov 2006 Initial version. ++ */ ++ ++#ifndef S3C24XXI2S_H_ ++#define S3C24XXI2S_H_ ++ ++/* clock sources */ ++#define S3C24XX_CLKSRC_PCLK 0 ++#define S3C24XX_CLKSRC_MPLL 1 ++ ++/* Clock dividers */ ++#define S3C24XX_DIV_MCLK 0 ++#define S3C24XX_DIV_BCLK 1 ++#define S3C24XX_DIV_PRESCALER 2 ++ ++/* prescaler */ ++#define S3C24XX_PRESCALE(a,b) \ ++ (((a - 1) << S3C2410_IISPSR_INTSHIFT) | ((b - 1) << S3C2410_IISPSR_EXTSHFIT)) ++ ++u32 s3c24xx_i2s_get_clockrate(void); ++ ++#endif /*S3C24XXI2S_H_*/ +diff --git a/sound/soc/s3c24xx/s3c24xx-pcm.c b/sound/soc/s3c24xx/s3c24xx-pcm.c +new file mode 100644 +index 0000000..867f1b3 +--- /dev/null ++++ b/sound/soc/s3c24xx/s3c24xx-pcm.c +@@ -0,0 +1,462 @@ ++/* ++ * s3c24xx-pcm.c -- ALSA Soc Audio Layer ++ * ++ * (c) 2006 Wolfson Microelectronics PLC. ++ * Graeme Gregory graeme.gregory@wolfsonmicro.com or linux@wolfsonmicro.com ++ * ++ * (c) 2004-2005 Simtec Electronics ++ * http://armlinux.simtec.co.uk/ ++ * Ben Dooks <ben@simtec.co.uk> ++ * ++ * 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; either version 2 of the License, or (at your ++ * option) any later version. ++ * ++ * Revision history ++ * 11th Dec 2006 Merged with Simtec driver ++ * 10th Nov 2006 Initial version. ++ */ ++ ++#include <linux/module.h> ++#include <linux/init.h> ++#include <linux/platform_device.h> ++#include <linux/slab.h> ++#include <linux/dma-mapping.h> ++ ++#include <sound/driver.h> ++#include <sound/core.h> ++#include <sound/pcm.h> ++#include <sound/pcm_params.h> ++#include <sound/soc.h> ++ ++#include <asm/dma.h> ++#include <asm/io.h> ++#include <asm/hardware.h> ++#include <asm/arch/dma.h> ++#include <asm/arch/audio.h> ++ ++#include "s3c24xx-pcm.h" ++ ++#define S3C24XX_PCM_DEBUG 0 ++#if S3C24XX_PCM_DEBUG ++#define DBG(x...) printk(KERN_DEBUG x) ++#else ++#define DBG(x...) ++#endif ++ ++static const struct snd_pcm_hardware s3c24xx_pcm_hardware = { ++ .info = SNDRV_PCM_INFO_INTERLEAVED | ++ SNDRV_PCM_INFO_BLOCK_TRANSFER | ++ SNDRV_PCM_INFO_MMAP | ++ SNDRV_PCM_INFO_MMAP_VALID, ++ .formats = SNDRV_PCM_FMTBIT_S16_LE | ++ SNDRV_PCM_FMTBIT_U16_LE | ++ SNDRV_PCM_FMTBIT_U8 | ++ SNDRV_PCM_FMTBIT_S8, ++ .channels_min = 2, ++ .channels_max = 2, ++ .buffer_bytes_max = 128*1024, ++ .period_bytes_min = PAGE_SIZE, ++ .period_bytes_max = PAGE_SIZE*2, ++ .periods_min = 2, ++ .periods_max = 128, ++ .fifo_size = 32, ++}; ++ ++struct s3c24xx_runtime_data { ++ spinlock_t lock; ++ int state; ++ unsigned int dma_loaded; ++ unsigned int dma_limit; ++ unsigned int dma_period; ++ dma_addr_t dma_start; ++ dma_addr_t dma_pos; ++ dma_addr_t dma_end; ++ struct s3c24xx_pcm_dma_params *params; ++}; ++ ++/* s3c24xx_pcm_enqueue ++ * ++ * place a dma buffer onto the queue for the dma system ++ * to handle. ++*/ ++static void s3c24xx_pcm_enqueue(struct snd_pcm_substream *substream) ++{ ++ struct s3c24xx_runtime_data *prtd = substream->runtime->private_data; ++ dma_addr_t pos = prtd->dma_pos; ++ int ret; ++ ++ DBG("Entered %s\n", __FUNCTION__); ++ ++ while (prtd->dma_loaded < prtd->dma_limit) { ++ unsigned long len = prtd->dma_period; ++ ++ DBG("dma_loaded: %d\n",prtd->dma_loaded); ++ ++ if ((pos + len) > prtd->dma_end) { ++ len = prtd->dma_end - pos; ++ DBG(KERN_DEBUG "%s: corrected dma len %ld\n", ++ __FUNCTION__, len); ++ } ++ ++ ret = s3c2410_dma_enqueue(prtd->params->channel, substream, pos, len); ++ ++ if (ret == 0) { ++ prtd->dma_loaded++; ++ pos += prtd->dma_period; ++ if (pos >= prtd->dma_end) ++ pos = prtd->dma_start; ++ } else ++ break; ++ } ++ ++ prtd->dma_pos = pos; ++} ++ ++static void s3c24xx_audio_buffdone(struct s3c2410_dma_chan *channel, ++ void *dev_id, int size, ++ enum s3c2410_dma_buffresult result) ++{ ++ struct snd_pcm_substream *substream = dev_id; ++ struct s3c24xx_runtime_data *prtd = substream->runtime->private_data; ++ ++ DBG("Entered %s\n", __FUNCTION__); ++ ++ if (result == S3C2410_RES_ABORT || result == S3C2410_RES_ERR) ++ return; ++ ++ if (substream) ++ snd_pcm_period_elapsed(substream); ++ ++ spin_lock(&prtd->lock); ++ if (prtd->state & ST_RUNNING) { ++ prtd->dma_loaded--; ++ s3c24xx_pcm_enqueue(substream); ++ } ++ ++ spin_unlock(&prtd->lock); ++} ++ ++static int s3c24xx_pcm_hw_params(struct snd_pcm_substream *substream, ++ struct snd_pcm_hw_params *params) ++{ ++ struct snd_pcm_runtime *runtime = substream->runtime; ++ struct s3c24xx_runtime_data *prtd = runtime->private_data; ++ struct snd_soc_pcm_runtime *rtd = substream->private_data; ++ struct s3c24xx_pcm_dma_params *dma = rtd->dai->cpu_dai->dma_data; ++ unsigned long totbytes = params_buffer_bytes(params); ++ int ret=0; ++ ++ DBG("Entered %s\n", __FUNCTION__); ++ ++ /* return if this is a bufferless transfer e.g. ++ * codec <--> BT codec or GSM modem -- lg FIXME */ ++ if (!dma) ++ return 0; ++ ++ /* prepare DMA */ ++ prtd->params = dma; ++ ++ DBG("params %p, client %p, channel %d\n", prtd->params, ++ prtd->params->client, prtd->params->channel); ++ ++ ret = s3c2410_dma_request(prtd->params->channel, ++ prtd->params->client, NULL); ++ ++ if (ret) { ++ DBG(KERN_ERR "failed to get dma channel\n"); ++ return ret; ++ } ++ ++ /* channel needs configuring for mem=>device, increment memory addr, ++ * sync to pclk, half-word transfers to the IIS-FIFO. */ ++ if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { ++ s3c2410_dma_devconfig(prtd->params->channel, ++ S3C2410_DMASRC_MEM, S3C2410_DISRCC_INC | ++ S3C2410_DISRCC_APB, prtd->params->dma_addr); ++ ++ s3c2410_dma_config(prtd->params->channel, ++ 2, S3C2410_DCON_SYNC_PCLK | S3C2410_DCON_HANDSHAKE); ++ } else { ++ s3c2410_dma_config(prtd->params->channel, ++ 2, S3C2410_DCON_HANDSHAKE | S3C2410_DCON_SYNC_PCLK); ++ ++ s3c2410_dma_devconfig(prtd->params->channel, ++ S3C2410_DMASRC_HW, 0x3, ++ prtd->params->dma_addr); ++ } ++ ++ s3c2410_dma_set_buffdone_fn(prtd->params->channel, ++ s3c24xx_audio_buffdone); ++ ++ snd_pcm_set_runtime_buffer(substream, &substream->dma_buffer); ++ ++ runtime->dma_bytes = totbytes; ++ ++ spin_lock_irq(&prtd->lock); ++ prtd->dma_loaded = 0; ++ prtd->dma_limit = runtime->hw.periods_min; ++ prtd->dma_period = params_period_bytes(params); ++ prtd->dma_start = runtime->dma_addr; ++ prtd->dma_pos = prtd->dma_start; ++ prtd->dma_end = prtd->dma_start + totbytes; ++ spin_unlock_irq(&prtd->lock); ++ ++ return 0; ++} ++ ++static int s3c24xx_pcm_hw_free(struct snd_pcm_substream *substream) ++{ ++ struct s3c24xx_runtime_data *prtd = substream->runtime->private_data; ++ ++ DBG("Entered %s\n", __FUNCTION__); ++ ++ /* TODO - do we need to ensure DMA flushed */ ++ snd_pcm_set_runtime_buffer(substream, NULL); ++ ++ if (prtd->params) { ++ s3c2410_dma_free(prtd->params->channel, prtd->params->client); ++ prtd->params = NULL; ++ } ++ ++ return 0; ++} ++ ++static int s3c24xx_pcm_prepare(struct snd_pcm_substream *substream) ++{ ++ struct s3c24xx_runtime_data *prtd = substream->runtime->private_data; ++ int ret = 0; ++ ++ DBG("Entered %s\n", __FUNCTION__); ++ ++ /* return if this is a bufferless transfer e.g. ++ * codec <--> BT codec or GSM modem -- lg FIXME */ ++ if (!prtd->params) ++ return 0; ++ ++ /* flush the DMA channel */ ++ s3c2410_dma_ctrl(prtd->params->channel, S3C2410_DMAOP_FLUSH); ++ prtd->dma_loaded = 0; ++ prtd->dma_pos = prtd->dma_start; ++ ++ /* enqueue dma buffers */ ++ s3c24xx_pcm_enqueue(substream); ++ ++ return ret; ++} ++ ++static int s3c24xx_pcm_trigger(struct snd_pcm_substream *substream, int cmd) ++{ ++ struct s3c24xx_runtime_data *prtd = substream->runtime->private_data; ++ int ret = 0; ++ ++ DBG("Entered %s\n", __FUNCTION__); ++ ++ spin_lock(&prtd->lock); ++ ++ switch (cmd) { ++ case SNDRV_PCM_TRIGGER_START: ++ case SNDRV_PCM_TRIGGER_RESUME: ++ case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: ++ prtd->state |= ST_RUNNING; ++ s3c2410_dma_ctrl(prtd->params->channel, S3C2410_DMAOP_START); ++ s3c2410_dma_ctrl(prtd->params->channel, S3C2410_DMAOP_STARTED); ++ break; ++ ++ case SNDRV_PCM_TRIGGER_STOP: ++ case SNDRV_PCM_TRIGGER_SUSPEND: ++ case SNDRV_PCM_TRIGGER_PAUSE_PUSH: ++ prtd->state &= ~ST_RUNNING; ++ s3c2410_dma_ctrl(prtd->params->channel, S3C2410_DMAOP_STOP); ++ break; ++ ++ default: ++ ret = -EINVAL; ++ break; ++ } ++ ++ spin_unlock(&prtd->lock); ++ ++ return ret; ++} ++ ++static snd_pcm_uframes_t s3c24xx_pcm_pointer(struct snd_pcm_substream *substream) ++{ ++ struct snd_pcm_runtime *runtime = substream->runtime; ++ struct s3c24xx_runtime_data *prtd = runtime->private_data; ++ unsigned long res; ++ dma_addr_t src, dst; ++ ++ DBG("Entered %s\n", __FUNCTION__); ++ ++ spin_lock(&prtd->lock); ++ s3c2410_dma_getposition(prtd->params->channel, &src, &dst); ++ ++ if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) ++ res = dst - prtd->dma_start; ++ else ++ res = src - prtd->dma_start; ++ ++ spin_unlock(&prtd->lock); ++ ++ DBG("Pointer %x %x\n",src,dst); ++ ++ /* we seem to be getting the odd error from the pcm library due ++ * to out-of-bounds pointers. this is maybe due to the dma engine ++ * not having loaded the new values for the channel before being ++ * callled... (todo - fix ) ++ */ ++ ++ if (res >= snd_pcm_lib_buffer_bytes(substream)) { ++ if (res == snd_pcm_lib_buffer_bytes(substream)) ++ res = 0; ++ } ++ ++ return bytes_to_frames(substream->runtime, res); ++} ++ ++static int s3c24xx_pcm_open(struct snd_pcm_substream *substream) ++{ ++ struct snd_pcm_runtime *runtime = substream->runtime; ++ struct s3c24xx_runtime_data *prtd; ++ ++ int ret; ++ ++ DBG("Entered %s\n", __FUNCTION__); ++ ++ snd_soc_set_runtime_hwparams(substream, &s3c24xx_pcm_hardware); ++ ++ prtd = kzalloc(sizeof(struct s3c24xx_runtime_data), GFP_KERNEL); ++ if (prtd == NULL) ++ return -ENOMEM; ++ ++ runtime->private_data = prtd; ++ return 0; ++} ++ ++static int s3c24xx_pcm_close(struct snd_pcm_substream *substream) ++{ ++ struct snd_pcm_runtime *runtime = substream->runtime; ++ struct s3c24xx_runtime_data *prtd = runtime->private_data; ++ ++ DBG("Entered %s\n", __FUNCTION__); ++ ++ if (prtd) ++ kfree(prtd); ++ else ++ DBG("s3c24xx_pcm_close called with prtd == NULL\n"); ++ ++ return 0; ++} ++ ++static int s3c24xx_pcm_mmap(struct snd_pcm_substream *substream, ++ struct vm_area_struct *vma) ++{ ++ struct snd_pcm_runtime *runtime = substream->runtime; ++ ++ DBG("Entered %s\n", __FUNCTION__); ++ ++ return dma_mmap_writecombine(substream->pcm->card->dev, vma, ++ runtime->dma_area, ++ runtime->dma_addr, ++ runtime->dma_bytes); ++} ++ ++static struct snd_pcm_ops s3c24xx_pcm_ops = { ++ .open = s3c24xx_pcm_open, ++ .close = s3c24xx_pcm_close, ++ .ioctl = snd_pcm_lib_ioctl, ++ .hw_params = s3c24xx_pcm_hw_params, ++ .hw_free = s3c24xx_pcm_hw_free, ++ .prepare = s3c24xx_pcm_prepare, ++ .trigger = s3c24xx_pcm_trigger, ++ .pointer = s3c24xx_pcm_pointer, ++ .mmap = s3c24xx_pcm_mmap, ++}; ++ ++static int s3c24xx_pcm_preallocate_dma_buffer(struct snd_pcm *pcm, int stream) ++{ ++ struct snd_pcm_substream *substream = pcm->streams[stream].substream; ++ struct snd_dma_buffer *buf = &substream->dma_buffer; ++ size_t size = s3c24xx_pcm_hardware.buffer_bytes_max; ++ ++ DBG("Entered %s\n", __FUNCTION__); ++ ++ buf->dev.type = SNDRV_DMA_TYPE_DEV; ++ buf->dev.dev = pcm->card->dev; ++ buf->private_data = NULL; ++ buf->area = dma_alloc_writecombine(pcm->card->dev, size, ++ &buf->addr, GFP_KERNEL); ++ if (!buf->area) ++ return -ENOMEM; ++ buf->bytes = size; ++ return 0; ++} ++ ++static void s3c24xx_pcm_free_dma_buffers(struct snd_pcm *pcm) ++{ ++ struct snd_pcm_substream *substream; ++ struct snd_dma_buffer *buf; ++ int stream; ++ ++ DBG("Entered %s\n", __FUNCTION__); ++ ++ for (stream = 0; stream < 2; stream++) { ++ substream = pcm->streams[stream].substream; ++ if (!substream) ++ continue; ++ ++ buf = &substream->dma_buffer; ++ if (!buf->area) ++ continue; ++ ++ dma_free_writecombine(pcm->card->dev, buf->bytes, ++ buf->area, buf->addr); ++ buf->area = NULL; ++ } ++} ++ ++static u64 s3c24xx_pcm_dmamask = DMA_32BIT_MASK; ++ ++static int s3c24xx_pcm_new(struct snd_card *card, struct snd_soc_codec_dai *dai, ++ struct snd_pcm *pcm) ++{ ++ int ret = 0; ++ ++ DBG("Entered %s\n", __FUNCTION__); ++ ++ if (!card->dev->dma_mask) ++ card->dev->dma_mask = &s3c24xx_pcm_dmamask; ++ if (!card->dev->coherent_dma_mask) ++ card->dev->coherent_dma_mask = 0xffffffff; ++ ++ if (dai->playback.channels_min) { ++ ret = s3c24xx_pcm_preallocate_dma_buffer(pcm, ++ SNDRV_PCM_STREAM_PLAYBACK); ++ if (ret) ++ goto out; ++ } ++ ++ if (dai->capture.channels_min) { ++ ret = s3c24xx_pcm_preallocate_dma_buffer(pcm, ++ SNDRV_PCM_STREAM_CAPTURE); ++ if (ret) ++ goto out; ++ } ++ out: ++ return ret; ++} ++ ++struct snd_soc_platform s3c24xx_soc_platform = { ++ .name = "s3c24xx-audio", ++ .pcm_ops = &s3c24xx_pcm_ops, ++ .pcm_new = s3c24xx_pcm_new, ++ .pcm_free = s3c24xx_pcm_free_dma_buffers, ++}; ++ ++EXPORT_SYMBOL_GPL(s3c24xx_soc_platform); ++ ++MODULE_AUTHOR("Ben Dooks, <ben@simtec.co.uk>"); ++MODULE_DESCRIPTION("Samsung S3C24XX PCM DMA module"); ++MODULE_LICENSE("GPL"); +diff --git a/sound/soc/s3c24xx/s3c24xx-pcm.h b/sound/soc/s3c24xx/s3c24xx-pcm.h +new file mode 100644 +index 0000000..5dced4a +--- /dev/null ++++ b/sound/soc/s3c24xx/s3c24xx-pcm.h +@@ -0,0 +1,32 @@ ++/* ++ * s3c24xx-pcm.h -- ++ * ++ * 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; either version 2 of the License, or (at your ++ * option) any later version. ++ * ++ * ALSA PCM interface for the Samsung S3C24xx CPU ++ */ ++ ++#ifndef _S3C24XX_PCM_H ++#define _S3C24XX_PCM_H ++ ++#define ST_RUNNING (1<<0) ++#define ST_OPENED (1<<1) ++ ++struct s3c24xx_pcm_dma_params { ++ struct s3c2410_dma_client *client; /* stream identifier */ ++ int channel; /* Channel ID */ ++ dma_addr_t dma_addr; ++}; ++ ++#define S3C24XX_DAI_I2S 0 ++ ++extern struct snd_soc_cpu_dai s3c24xx_i2s_dai; ++ ++/* platform data */ ++extern struct snd_soc_platform s3c24xx_soc_platform; ++extern struct snd_ac97_bus_ops s3c24xx_ac97_ops; ++ ++#endif +-- +1.5.0.3 + diff --git a/packages/linux/linux-smdk2443/0021-Add-Neo1973-ASoC-support.patch b/packages/linux/linux-smdk2443/0021-Add-Neo1973-ASoC-support.patch new file mode 100644 index 0000000000..4b518241b8 --- /dev/null +++ b/packages/linux/linux-smdk2443/0021-Add-Neo1973-ASoC-support.patch @@ -0,0 +1,763 @@ +From eb7cbe67158924a0de114664ce5251fcad418b12 Mon Sep 17 00:00:00 2001 +From: Liam Girdwood <liam@localhost.localdomain> +Date: Sun, 4 Mar 2007 16:58:40 +0000 +Subject: [PATCH] Add Neo1973 ASoC support. + +Signed-off-by: Graeme Gregory <gg@opensource.wolfsonmicro.com> +Signed-off-by: Liam Girdwood <lg@opensource.wolfsonmicro.com> +--- + sound/soc/s3c24xx/Kconfig | 9 + + sound/soc/s3c24xx/Makefile | 4 + + sound/soc/s3c24xx/lm4857.h | 15 + + sound/soc/s3c24xx/neo1973_wm8753.c | 686 ++++++++++++++++++++++++++++++++++++ + 4 files changed, 714 insertions(+), 0 deletions(-) + create mode 100644 sound/soc/s3c24xx/lm4857.h + create mode 100644 sound/soc/s3c24xx/neo1973_wm8753.c + +diff --git a/sound/soc/s3c24xx/Kconfig b/sound/soc/s3c24xx/Kconfig +index 433da9f..c414886 100644 +--- a/sound/soc/s3c24xx/Kconfig ++++ b/sound/soc/s3c24xx/Kconfig +@@ -12,5 +12,14 @@ config SND_S3C24XX_SOC + config SND_S3C24XX_SOC_I2S + tristate + ++config SND_S3C24XX_SOC_NEO1973_WM8753 ++ tristate "SoC I2S Audio support for NEO1973 - WM8753" ++ depends on SND_S3C24XX_SOC && MACH_GTA01 ++ select SND_S3C24XX_SOC_I2S ++ select SND_SOC_WM8753 ++ help ++ Say Y if you want to add support for SoC audio on smdk2440 ++ with the WM8753. ++ + endmenu + +diff --git a/sound/soc/s3c24xx/Makefile b/sound/soc/s3c24xx/Makefile +index 56200d7..7b5c6fe 100644 +--- a/sound/soc/s3c24xx/Makefile ++++ b/sound/soc/s3c24xx/Makefile +@@ -5,3 +5,7 @@ snd-soc-s3c24xx-i2s-objs := s3c24xx-i2s.o + obj-$(CONFIG_SND_S3C24XX_SOC) += snd-soc-s3c24xx.o + obj-$(CONFIG_SND_S3C24XX_SOC_I2S) += snd-soc-s3c24xx-i2s.o + ++# S3C24XX Machine Support ++snd-soc-neo1973-wm8753-objs := neo1973_wm8753.o ++ ++obj-$(CONFIG_SND_S3C24XX_SOC_NEO1973_WM8753) += snd-soc-neo1973-wm8753.o +diff --git a/sound/soc/s3c24xx/lm4857.h b/sound/soc/s3c24xx/lm4857.h +new file mode 100644 +index 0000000..382d6c4 +--- /dev/null ++++ b/sound/soc/s3c24xx/lm4857.h +@@ -0,0 +1,15 @@ ++#ifndef LM4857_H_ ++#define LM4857_H_ ++ ++/* The register offsets in the cache array */ ++#define LM4857_MVOL 0 ++#define LM4857_LVOL 1 ++#define LM4857_RVOL 2 ++#define LM4857_CTRL 3 ++ ++/* the shifts required to set these bits */ ++#define LM4857_3D 5 ++#define LM4857_WAKEUP 5 ++#define LM4857_EPGAIN 4 ++ ++#endif /*LM4857_H_*/ +diff --git a/sound/soc/s3c24xx/neo1973_wm8753.c b/sound/soc/s3c24xx/neo1973_wm8753.c +new file mode 100644 +index 0000000..46a70e3 +--- /dev/null ++++ b/sound/soc/s3c24xx/neo1973_wm8753.c +@@ -0,0 +1,686 @@ ++/* ++ * neo1973_wm8753.c -- SoC audio for Neo1973 ++ * ++ * Copyright 2007 Wolfson Microelectronics PLC. ++ * Author: Graeme Gregory ++ * graeme.gregory@wolfsonmicro.com or linux@wolfsonmicro.com ++ * ++ * 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; either version 2 of the License, or (at your ++ * option) any later version. ++ * ++ * Revision history ++ * 20th Jan 2007 Initial version. ++ * 05th Feb 2007 Rename all to Neo1973 ++ * ++ */ ++ ++#include <linux/module.h> ++#include <linux/moduleparam.h> ++#include <linux/timer.h> ++#include <linux/interrupt.h> ++#include <linux/platform_device.h> ++#include <linux/i2c.h> ++#include <sound/driver.h> ++#include <sound/core.h> ++#include <sound/pcm.h> ++#include <sound/soc.h> ++#include <sound/soc-dapm.h> ++ ++#include <asm/mach-types.h> ++#include <asm/hardware/scoop.h> ++#include <asm/arch/regs-iis.h> ++#include <asm/arch/regs-clock.h> ++#include <asm/arch/regs-gpio.h> ++#include <asm/arch/hardware.h> ++#include <asm/arch/audio.h> ++#include <asm/io.h> ++#include <asm/arch/spi-gpio.h> ++#include "../codecs/wm8753.h" ++#include "lm4857.h" ++#include "s3c24xx-pcm.h" ++#include "s3c24xx-i2s.h" ++ ++#define NEO1973_DEBUG 0 ++#if NEO1973_DEBUG ++#define DBG(x...) printk(KERN_DEBUG x) ++#else ++#define DBG(x...) ++#endif ++ ++/* define the scenarios */ ++#define NEO_AUDIO_OFF 0 ++#define NEO_GSM_CALL_AUDIO_HANDSET 1 ++#define NEO_GSM_CALL_AUDIO_HEADSET 2 ++#define NEO_GSM_CALL_AUDIO_BLUETOOTH 3 ++#define NEO_STEREO_TO_SPEAKERS 4 ++#define NEO_STEREO_TO_HEADPHONES 5 ++#define NEO_CAPTURE_HANDSET 6 ++#define NEO_CAPTURE_HEADSET 7 ++#define NEO_CAPTURE_BLUETOOTH 8 ++ ++static struct snd_soc_machine neo1973; ++static struct i2c_client *i2c; ++ ++static int neo1973_hifi_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_codec_dai *codec_dai = rtd->dai->codec_dai; ++ struct snd_soc_cpu_dai *cpu_dai = rtd->dai->cpu_dai; ++ unsigned int pll_out = 0, bclk = 0; ++ int ret = 0; ++ unsigned long iis_clkrate; ++ ++ iis_clkrate = s3c24xx_i2s_get_clockrate(); ++ ++ switch (params_rate(params)) { ++ case 8000: ++ case 16000: ++ pll_out = 12288000; ++ break; ++ case 48000: ++ bclk = WM8753_BCLK_DIV_4; ++ pll_out = 12288000; ++ break; ++ case 96000: ++ bclk = WM8753_BCLK_DIV_2; ++ pll_out = 12288000; ++ break; ++ case 11025: ++ bclk = WM8753_BCLK_DIV_16; ++ pll_out = 11289600; ++ break; ++ case 22050: ++ bclk = WM8753_BCLK_DIV_8; ++ pll_out = 11289600; ++ break; ++ case 44100: ++ bclk = WM8753_BCLK_DIV_4; ++ pll_out = 11289600; ++ break; ++ case 88200: ++ bclk = WM8753_BCLK_DIV_2; ++ pll_out = 11289600; ++ break; ++ } ++ ++ /* set codec DAI configuration */ ++ ret = codec_dai->dai_ops.set_fmt(codec_dai, ++ SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBM_CFM); ++ if (ret < 0) ++ return ret; ++ ++ /* set cpu DAI configuration */ ++ ret = cpu_dai->dai_ops.set_fmt(cpu_dai, ++ SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBM_CFM); ++ if (ret < 0) ++ return ret; ++ ++ /* set the codec system clock for DAC and ADC */ ++ ret = codec_dai->dai_ops.set_sysclk(codec_dai, WM8753_MCLK, pll_out, ++ SND_SOC_CLOCK_IN); ++ if (ret < 0) ++ return ret; ++ ++ /* set MCLK division for sample rate */ ++ ret = cpu_dai->dai_ops.set_clkdiv(cpu_dai, S3C24XX_DIV_MCLK, ++ S3C2410_IISMOD_32FS ); ++ if (ret < 0) ++ return ret; ++ ++ /* set codec BCLK division for sample rate */ ++ ret = codec_dai->dai_ops.set_clkdiv(codec_dai, WM8753_BCLKDIV, bclk); ++ if (ret < 0) ++ return ret; ++ ++ /* set prescaler division for sample rate */ ++ ret = cpu_dai->dai_ops.set_clkdiv(cpu_dai, S3C24XX_DIV_PRESCALER, ++ S3C24XX_PRESCALE(4,4)); ++ if (ret < 0) ++ return ret; ++ ++ /* codec PLL input is PCLK/4 */ ++ ret = codec_dai->dai_ops.set_pll(codec_dai, WM8753_PLL1, iis_clkrate/4, ++ pll_out); ++ if (ret < 0) ++ return ret; ++ ++ return 0; ++} ++ ++static int neo1973_hifi_hw_free(struct snd_pcm_substream *substream) ++{ ++ struct snd_soc_pcm_runtime *rtd = substream->private_data; ++ struct snd_soc_codec_dai *codec_dai = rtd->dai->codec_dai; ++ ++ /* disable the PLL */ ++ return codec_dai->dai_ops.set_pll(codec_dai, WM8753_PLL1, 0, 0); ++} ++ ++/* ++ * Neo1973 WM8753 HiFi DAI opserations. ++ */ ++static struct snd_soc_ops neo1973_hifi_ops = { ++ .hw_params = neo1973_hifi_hw_params, ++ .hw_free = neo1973_hifi_hw_free, ++}; ++ ++static int neo1973_voice_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_codec_dai *codec_dai = rtd->dai->codec_dai; ++ unsigned int pcmdiv = 0; ++ int ret = 0; ++ unsigned long iis_clkrate; ++ ++ /* todo: gg where is sysclk coming from for voice ?? */ ++ iis_clkrate = s3c24xx_i2s_get_clockrate(); ++ ++ if (params_rate(params) != 8000) ++ return -EINVAL; ++ if(params_channels(params) != 1) ++ return -EINVAL; ++ ++ pcmdiv = WM8753_PCM_DIV_6; /* 2.048 MHz */ ++ ++ /* todo: gg check mode (DSP_B) against CSR datasheet */ ++ /* set codec DAI configuration */ ++ ret = codec_dai->dai_ops.set_fmt(codec_dai, SND_SOC_DAIFMT_DSP_B | ++ SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBS_CFS); ++ if (ret < 0) ++ return ret; ++ ++ /* set the codec system clock for DAC and ADC */ ++ ret = codec_dai->dai_ops.set_sysclk(codec_dai, WM8753_PCMCLK, 12288000, ++ SND_SOC_CLOCK_IN); ++ if (ret < 0) ++ return ret; ++ ++ /* set codec PCM division for sample rate */ ++ ret = codec_dai->dai_ops.set_clkdiv(codec_dai, WM8753_PCMDIV, pcmdiv); ++ if (ret < 0) ++ return ret; ++ ++ /* configue and enable PLL for 12.288MHz output */ ++ ret = codec_dai->dai_ops.set_pll(codec_dai, WM8753_PLL2, iis_clkrate/4, ++ 12288000); ++ if (ret < 0) ++ return ret; ++ ++ return 0; ++} ++ ++static int neo1973_voice_hw_free(struct snd_pcm_substream *substream) ++{ ++ struct snd_soc_pcm_runtime *rtd = substream->private_data; ++ struct snd_soc_codec_dai *codec_dai = rtd->dai->codec_dai; ++ ++ /* disable the PLL */ ++ return codec_dai->dai_ops.set_pll(codec_dai, WM8753_PLL2, 0, 0); ++} ++ ++static struct snd_soc_ops neo1973_voice_ops = { ++ .hw_params = neo1973_voice_hw_params, ++ .hw_free = neo1973_voice_hw_free, ++}; ++ ++static int neo1973_scenario = 0; ++ ++static int neo1973_get_scenario(struct snd_kcontrol *kcontrol, ++ struct snd_ctl_elem_value *ucontrol) ++{ ++ ucontrol->value.integer.value[0] = neo1973_scenario; ++ return 0; ++} ++ ++static int set_scenario_endpoints(struct snd_soc_codec *codec, int scenario) ++{ ++ switch(neo1973_scenario) { ++ case NEO_AUDIO_OFF: ++ snd_soc_dapm_set_endpoint(codec, "Audio Out", 0); ++ snd_soc_dapm_set_endpoint(codec, "GSM Line Out", 0); ++ snd_soc_dapm_set_endpoint(codec, "GSM Line In", 0); ++ snd_soc_dapm_set_endpoint(codec, "Headset Mic", 0); ++ snd_soc_dapm_set_endpoint(codec, "Call Mic", 0); ++ break; ++ case NEO_GSM_CALL_AUDIO_HANDSET: ++ snd_soc_dapm_set_endpoint(codec, "Audio Out", 1); ++ snd_soc_dapm_set_endpoint(codec, "GSM Line Out", 1); ++ snd_soc_dapm_set_endpoint(codec, "GSM Line In", 1); ++ snd_soc_dapm_set_endpoint(codec, "Headset Mic", 0); ++ snd_soc_dapm_set_endpoint(codec, "Call Mic", 1); ++ break; ++ case NEO_GSM_CALL_AUDIO_HEADSET: ++ snd_soc_dapm_set_endpoint(codec, "Audio Out", 1); ++ snd_soc_dapm_set_endpoint(codec, "GSM Line Out", 1); ++ snd_soc_dapm_set_endpoint(codec, "GSM Line In", 1); ++ snd_soc_dapm_set_endpoint(codec, "Headset Mic", 1); ++ snd_soc_dapm_set_endpoint(codec, "Call Mic", 0); ++ break; ++ case NEO_GSM_CALL_AUDIO_BLUETOOTH: ++ snd_soc_dapm_set_endpoint(codec, "Audio Out", 0); ++ snd_soc_dapm_set_endpoint(codec, "GSM Line Out", 1); ++ snd_soc_dapm_set_endpoint(codec, "GSM Line In", 1); ++ snd_soc_dapm_set_endpoint(codec, "Headset Mic", 0); ++ snd_soc_dapm_set_endpoint(codec, "Call Mic", 0); ++ break; ++ case NEO_STEREO_TO_SPEAKERS: ++ snd_soc_dapm_set_endpoint(codec, "Audio Out", 1); ++ snd_soc_dapm_set_endpoint(codec, "GSM Line Out", 0); ++ snd_soc_dapm_set_endpoint(codec, "GSM Line In", 0); ++ snd_soc_dapm_set_endpoint(codec, "Headset Mic", 0); ++ snd_soc_dapm_set_endpoint(codec, "Call Mic", 0); ++ break; ++ case NEO_STEREO_TO_HEADPHONES: ++ snd_soc_dapm_set_endpoint(codec, "Audio Out", 1); ++ snd_soc_dapm_set_endpoint(codec, "GSM Line Out", 0); ++ snd_soc_dapm_set_endpoint(codec, "GSM Line In", 0); ++ snd_soc_dapm_set_endpoint(codec, "Headset Mic", 0); ++ snd_soc_dapm_set_endpoint(codec, "Call Mic", 0); ++ break; ++ case NEO_CAPTURE_HANDSET: ++ snd_soc_dapm_set_endpoint(codec, "Audio Out", 0); ++ snd_soc_dapm_set_endpoint(codec, "GSM Line Out", 0); ++ snd_soc_dapm_set_endpoint(codec, "GSM Line In", 0); ++ snd_soc_dapm_set_endpoint(codec, "Headset Mic", 0); ++ snd_soc_dapm_set_endpoint(codec, "Call Mic", 1); ++ break; ++ case NEO_CAPTURE_HEADSET: ++ snd_soc_dapm_set_endpoint(codec, "Audio Out", 0); ++ snd_soc_dapm_set_endpoint(codec, "GSM Line Out", 0); ++ snd_soc_dapm_set_endpoint(codec, "GSM Line In", 0); ++ snd_soc_dapm_set_endpoint(codec, "Headset Mic", 1); ++ snd_soc_dapm_set_endpoint(codec, "Call Mic", 0); ++ break; ++ case NEO_CAPTURE_BLUETOOTH: ++ snd_soc_dapm_set_endpoint(codec, "Audio Out", 0); ++ snd_soc_dapm_set_endpoint(codec, "GSM Line Out", 0); ++ snd_soc_dapm_set_endpoint(codec, "GSM Line In", 0); ++ snd_soc_dapm_set_endpoint(codec, "Headset Mic", 0); ++ snd_soc_dapm_set_endpoint(codec, "Call Mic", 0); ++ break; ++ default: ++ snd_soc_dapm_set_endpoint(codec, "Audio Out", 0); ++ snd_soc_dapm_set_endpoint(codec, "GSM Line Out", 0); ++ snd_soc_dapm_set_endpoint(codec, "GSM Line In", 0); ++ snd_soc_dapm_set_endpoint(codec, "Headset Mic", 0); ++ snd_soc_dapm_set_endpoint(codec, "Call Mic", 0); ++ } ++ ++ snd_soc_dapm_sync_endpoints(codec); ++ ++ return 0; ++} ++ ++static int neo1973_set_scenario(struct snd_kcontrol *kcontrol, ++ struct snd_ctl_elem_value *ucontrol) ++{ ++ struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); ++ ++ if (neo1973_scenario == ucontrol->value.integer.value[0]) ++ return 0; ++ ++ neo1973_scenario = ucontrol->value.integer.value[0]; ++ ++ set_scenario_endpoints(codec, neo1973_scenario); ++ ++ return 1; ++} ++ ++static u8 lm4857_regs[4] = {0x00, 0x40, 0x80, 0xC0}; ++ ++static void lm4857_write_regs( void ) ++{ ++ if( i2c_master_send(i2c, lm4857_regs, 4) != 4) ++ printk(KERN_WARNING "lm4857: i2c write failed\n"); ++} ++ ++static int lm4857_get_reg(struct snd_kcontrol *kcontrol, ++ struct snd_ctl_elem_value *ucontrol) ++{ ++ int reg=kcontrol->private_value & 0xFF; ++ int shift = (kcontrol->private_value >> 8) & 0x0F; ++ int mask = (kcontrol->private_value >> 16) & 0xFF; ++ ++ ucontrol->value.integer.value[0] = (lm4857_regs[reg] >> shift) & mask; ++ ++ return 0; ++} ++ ++static int lm4857_set_reg(struct snd_kcontrol *kcontrol, ++ struct snd_ctl_elem_value *ucontrol) ++{ ++ int reg = kcontrol->private_value & 0xFF; ++ int shift = (kcontrol->private_value >> 8) & 0x0F; ++ int mask = (kcontrol->private_value >> 16) & 0xFF; ++ ++ if (((lm4857_regs[reg] >> shift ) & mask) == ++ ucontrol->value.integer.value[0]) ++ return 0; ++ ++ lm4857_regs[reg] &= ~ (mask << shift); ++ lm4857_regs[reg] |= ucontrol->value.integer.value[0] << shift; ++ ++ lm4857_write_regs(); ++ return 1; ++} ++ ++static int lm4857_get_mode(struct snd_kcontrol *kcontrol, ++ struct snd_ctl_elem_value *ucontrol) ++{ ++ u8 value = lm4857_regs[LM4857_CTRL] & 0x0F; ++ ++ if (value) ++ value -= 5; ++ ++ ucontrol->value.integer.value[0] = value; ++ return 0; ++} ++ ++static int lm4857_set_mode(struct snd_kcontrol *kcontrol, ++ struct snd_ctl_elem_value *ucontrol) ++{ ++ u8 value = ucontrol->value.integer.value[0]; ++ ++ if (value) ++ value += 5; ++ ++ if ((lm4857_regs[LM4857_CTRL] & 0x0F) == value) ++ return 0; ++ ++ lm4857_regs[LM4857_CTRL] &= 0xF0; ++ lm4857_regs[LM4857_CTRL] |= value; ++ ++ lm4857_write_regs(); ++ return 1; ++} ++ ++static const struct snd_soc_dapm_widget wm8753_dapm_widgets[] = { ++ SND_SOC_DAPM_LINE("Audio Out", NULL), ++ SND_SOC_DAPM_LINE("GSM Line Out", NULL), ++ SND_SOC_DAPM_LINE("GSM Line In", NULL), ++ SND_SOC_DAPM_MIC("Headset Mic", NULL), ++ SND_SOC_DAPM_MIC("Call Mic", NULL), ++}; ++ ++ ++/* example machine audio_mapnections */ ++static const char* audio_map[][3] = { ++ ++ /* Connections to the lm4857 amp */ ++ {"Audio Out", NULL, "LOUT1"}, ++ {"Audio Out", NULL, "ROUT1"}, ++ ++ /* Connections to the GSM Module */ ++ {"GSM Line Out", NULL, "MONO1"}, ++ {"GSM Line Out", NULL, "MONO2"}, ++ {"RXP", NULL, "GSM Line In"}, ++ {"RXN", NULL, "GSM Line In"}, ++ ++ /* Connections to Headset */ ++ {"MIC1", NULL, "Mic Bias"}, ++ {"Mic Bias", NULL, "Headset Mic"}, ++ ++ /* Call Mic */ ++ {"MIC2", NULL, "Mic Bias"}, ++ {"MIC2N", NULL, "Mic Bias"}, ++ {"Mic Bias", NULL, "Call Mic"}, ++ ++ /* Connect the ALC pins */ ++ {"ACIN", NULL, "ACOP"}, ++ ++ {NULL, NULL, NULL}, ++}; ++ ++static const char *lm4857_mode[] = { ++ "Off", ++ "Call Speaker", ++ "Stereo Speakers", ++ "Stereo Speakers + Headphones", ++ "Headphones" ++}; ++ ++static const struct soc_enum lm4857_mode_enum[] = { ++ SOC_ENUM_SINGLE_EXT(5, lm4857_mode), ++}; ++ ++static const char *neo_scenarios[] = { ++ "Off", ++ "GSM Handset", ++ "GSM Headset", ++ "GSM Bluetooth", ++ "Speakers", ++ "Headphones", ++ "Capture Handset", ++ "Capture Headset", ++ "Capture Bluetooth" ++}; ++ ++static const struct soc_enum neo_scenario_enum[] = { ++ SOC_ENUM_SINGLE_EXT(9,neo_scenarios), ++}; ++ ++static const struct snd_kcontrol_new wm8753_neo1973_controls[] = { ++ SOC_SINGLE_EXT("Amp Left Playback Volume", LM4857_LVOL, 0, 31, 0, ++ lm4857_get_reg, lm4857_set_reg), ++ SOC_SINGLE_EXT("Amp Right Playback Volume", LM4857_RVOL, 0, 31, 0, ++ lm4857_get_reg, lm4857_set_reg), ++ SOC_SINGLE_EXT("Amp Mono Playback Volume", LM4857_MVOL, 0, 31, 0, ++ lm4857_get_reg, lm4857_set_reg), ++ SOC_ENUM_EXT("Amp Mode", lm4857_mode_enum[0], ++ lm4857_get_mode, lm4857_set_mode), ++ SOC_ENUM_EXT("Neo Mode", neo_scenario_enum[0], ++ neo1973_get_scenario, neo1973_set_scenario), ++ SOC_SINGLE_EXT("Amp Spk 3D Playback Switch", LM4857_LVOL, 5, 1, 0, ++ lm4857_get_reg, lm4857_set_reg), ++ SOC_SINGLE_EXT("Amp HP 3d Playback Switch", LM4857_RVOL, 5, 1, 0, ++ lm4857_get_reg, lm4857_set_reg), ++ SOC_SINGLE_EXT("Amp Fast Wakeup Playback Switch", LM4857_CTRL, 5, 1, 0, ++ lm4857_get_reg, lm4857_set_reg), ++ SOC_SINGLE_EXT("Amp Earpiece 6dB Playback Switch", LM4857_CTRL, 4, 1, 0, ++ lm4857_get_reg, lm4857_set_reg), ++}; ++ ++/* ++ * This is an example machine initialisation for a wm8753 connected to a ++ * neo1973 II. It is missing logic to detect hp/mic insertions and logic ++ * to re-route the audio in such an event. ++ */ ++static int neo1973_wm8753_init(struct snd_soc_codec *codec) ++{ ++ int i, err; ++ ++ /* set up NC codec pins */ ++ snd_soc_dapm_set_endpoint(codec, "LOUT2", 0); ++ snd_soc_dapm_set_endpoint(codec, "ROUT2", 0); ++ snd_soc_dapm_set_endpoint(codec, "OUT3", 0); ++ snd_soc_dapm_set_endpoint(codec, "OUT4", 0); ++ snd_soc_dapm_set_endpoint(codec, "LINE1", 0); ++ snd_soc_dapm_set_endpoint(codec, "LINE2", 0); ++ ++ ++ /* set endpoints to default mode */ ++ set_scenario_endpoints(codec, NEO_AUDIO_OFF); ++ ++ /* Add neo1973 specific widgets */ ++ for(i = 0; i < ARRAY_SIZE(wm8753_dapm_widgets); i++) ++ snd_soc_dapm_new_control(codec, &wm8753_dapm_widgets[i]); ++ ++ /* add neo1973 specific controls */ ++ for (i = 0; i < ARRAY_SIZE(wm8753_neo1973_controls); i++) { ++ if ((err = snd_ctl_add(codec->card, ++ snd_soc_cnew(&wm8753_neo1973_controls[i],codec, NULL))) < 0) ++ return err; ++ } ++ ++ /* set up neo1973 specific audio path audio_mapnects */ ++ for(i = 0; audio_map[i][0] != NULL; i++) { ++ snd_soc_dapm_connect_input(codec, audio_map[i][0], audio_map[i][1], ++ audio_map[i][2]); ++ } ++ ++ snd_soc_dapm_sync_endpoints(codec); ++ return 0; ++} ++ ++/* ++ * BT Codec DAI ++ */ ++static struct snd_soc_cpu_dai bt_dai = ++{ .name = "Bluetooth", ++ .id = 0, ++ .type = SND_SOC_DAI_PCM, ++ .playback = { ++ .channels_min = 1, ++ .channels_max = 1, ++ .rates = SNDRV_PCM_RATE_8000, ++ .formats = SNDRV_PCM_FMTBIT_S16_LE,}, ++ .capture = { ++ .channels_min = 1, ++ .channels_max = 1, ++ .rates = SNDRV_PCM_RATE_8000, ++ .formats = SNDRV_PCM_FMTBIT_S16_LE,}, ++}; ++ ++static struct snd_soc_dai_link neo1973_dai[] = { ++{ /* Hifi Playback - for similatious use with voice below */ ++ .name = "WM8753", ++ .stream_name = "WM8753 HiFi", ++ .cpu_dai = &s3c24xx_i2s_dai, ++ .codec_dai = &wm8753_dai[WM8753_DAI_HIFI], ++ .init = neo1973_wm8753_init, ++ .ops = &neo1973_hifi_ops, ++}, ++{ /* Voice via BT */ ++ .name = "Bluetooth", ++ .stream_name = "Voice", ++ .cpu_dai = &bt_dai, ++ .codec_dai = &wm8753_dai[WM8753_DAI_VOICE], ++ .ops = &neo1973_voice_ops, ++}, ++}; ++ ++static struct snd_soc_machine neo1973 = { ++ .name = "neo1973", ++ .dai_link = neo1973_dai, ++ .num_links = ARRAY_SIZE(neo1973_dai), ++}; ++ ++static struct wm8753_setup_data neo1973_wm8753_setup = { ++ .i2c_address = 0x1a, ++}; ++ ++static struct snd_soc_device neo1973_snd_devdata = { ++ .machine = &neo1973, ++ .platform = &s3c24xx_soc_platform, ++ .codec_dev = &soc_codec_dev_wm8753, ++ .codec_data = &neo1973_wm8753_setup, ++}; ++ ++static struct i2c_client client_template; ++ ++static unsigned short normal_i2c[] = { 0x7C, I2C_CLIENT_END }; ++ ++/* Magic definition of all other variables and things */ ++I2C_CLIENT_INSMOD; ++ ++static int lm4857_amp_probe(struct i2c_adapter *adap, int addr, int kind) ++{ ++ int ret; ++ ++ client_template.adapter = adap; ++ client_template.addr = addr; ++ ++ DBG("Entering %s\n", __FUNCTION__); ++ ++ i2c = kzalloc(sizeof(struct i2c_client), GFP_KERNEL); ++ if (i2c == NULL){ ++ return -ENOMEM; ++ } ++ memcpy(i2c, &client_template, sizeof(struct i2c_client)); ++ ++ ret = i2c_attach_client(i2c); ++ if (ret < 0) { ++ DBG("failed to attach codec at addr %x\n", addr); ++ goto exit_err; ++ } ++ ++ lm4857_write_regs(); ++ ++ return ret; ++ ++exit_err: ++ kfree(i2c); ++ return ret; ++} ++ ++static int lm4857_i2c_detach(struct i2c_client *client) ++{ ++ i2c_detach_client(client); ++ kfree(client); ++ return 0; ++} ++ ++static int lm4857_i2c_attach(struct i2c_adapter *adap) ++{ ++ return i2c_probe(adap, &addr_data, lm4857_amp_probe); ++} ++ ++#define I2C_DRIVERID_LM4857 0xA5A5 /* liam - need a proper id */ ++ ++/* corgi i2c codec control layer */ ++static struct i2c_driver lm4857_i2c_driver = { ++ .driver = { ++ .name = "LM4857 I2C Amp", ++ .owner = THIS_MODULE, ++ }, ++ .id = I2C_DRIVERID_LM4857, ++ .attach_adapter = lm4857_i2c_attach, ++ .detach_client = lm4857_i2c_detach, ++ .command = NULL, ++}; ++ ++static struct i2c_client client_template = { ++ .name = "LM4857", ++ .driver = &lm4857_i2c_driver, ++}; ++ ++static struct platform_device *neo1973_snd_device; ++ ++static int __init neo1973_init(void) ++{ ++ int ret; ++ ++ neo1973_snd_device = platform_device_alloc("soc-audio", -1); ++ if (!neo1973_snd_device) ++ return -ENOMEM; ++ ++ platform_set_drvdata(neo1973_snd_device, &neo1973_snd_devdata); ++ neo1973_snd_devdata.dev = &neo1973_snd_device->dev; ++ ret = platform_device_add(neo1973_snd_device); ++ ++ if (ret) ++ platform_device_put(neo1973_snd_device); ++ ++ ret = i2c_add_driver(&lm4857_i2c_driver); ++ if (ret != 0) ++ printk(KERN_ERR "can't add i2c driver"); ++ ++ return ret; ++} ++ ++static void __exit neo1973_exit(void) ++{ ++ platform_device_unregister(neo1973_snd_device); ++} ++ ++module_init(neo1973_init); ++module_exit(neo1973_exit); ++ ++/* Module information */ ++MODULE_AUTHOR("Graeme Gregory, graeme.gregory@wolfsonmicro.com, www.wolfsonmicro.com"); ++MODULE_DESCRIPTION("ALSA SoC WM8753 Neo1973"); ++MODULE_LICENSE("GPL"); +-- +1.5.0.3 + diff --git a/packages/linux/linux-smdk2443/0022-Add-initial-ASoC-SMDK2440-support.patch b/packages/linux/linux-smdk2443/0022-Add-initial-ASoC-SMDK2440-support.patch new file mode 100644 index 0000000000..01b51d925e --- /dev/null +++ b/packages/linux/linux-smdk2443/0022-Add-initial-ASoC-SMDK2440-support.patch @@ -0,0 +1,373 @@ +From a6171bfad4671fe525ae2c8cddd4f6a7f739e346 Mon Sep 17 00:00:00 2001 +From: Liam Girdwood <liam@localhost.localdomain> +Date: Sun, 4 Mar 2007 17:00:59 +0000 +Subject: [PATCH] Add initial ASoC SMDK2440 support. + +Signed-off-by: Ben Dooks <ben@simtec.co.uk> +Signed-off-by: Graeme Gregory <gg@opensource.wolfsonmicro.com> +Signed-off-by: Liam Girdwood <lg@opensource.wolfsonmicro.com> +--- + sound/soc/s3c24xx/Kconfig | 7 + + sound/soc/s3c24xx/Makefile | 2 + + sound/soc/s3c24xx/smdk2440.c | 320 ++++++++++++++++++++++++++++++++++++++++++ + 3 files changed, 329 insertions(+), 0 deletions(-) + create mode 100644 sound/soc/s3c24xx/smdk2440.c + +diff --git a/sound/soc/s3c24xx/Kconfig b/sound/soc/s3c24xx/Kconfig +index c414886..99fe902 100644 +--- a/sound/soc/s3c24xx/Kconfig ++++ b/sound/soc/s3c24xx/Kconfig +@@ -21,5 +21,12 @@ config SND_S3C24XX_SOC_NEO1973_WM8753 + Say Y if you want to add support for SoC audio on smdk2440 + with the WM8753. + ++config SND_S3C24XX_SOC_SMDK2440 ++ tristate "SoC I2S Audio support for SMDK2440" ++ depends on SND_S3C24XX_SOC && MACH_SMDK ++ select SND_S3C24XX_SOC_I2S ++ help ++ Say Y if you want to add support for SoC audio on SMDK2440 ++ + endmenu + +diff --git a/sound/soc/s3c24xx/Makefile b/sound/soc/s3c24xx/Makefile +index 7b5c6fe..b991052 100644 +--- a/sound/soc/s3c24xx/Makefile ++++ b/sound/soc/s3c24xx/Makefile +@@ -7,5 +7,7 @@ obj-$(CONFIG_SND_S3C24XX_SOC_I2S) += snd-soc-s3c24xx-i2s.o + + # S3C24XX Machine Support + snd-soc-neo1973-wm8753-objs := neo1973_wm8753.o ++snd-soc-smdk2440-objs := smdk2440.o + + obj-$(CONFIG_SND_S3C24XX_SOC_NEO1973_WM8753) += snd-soc-neo1973-wm8753.o ++obj-$(CONFIG_SND_S3C24XX_SOC_SMDK2440) += snd-soc-smdk2440.o +diff --git a/sound/soc/s3c24xx/smdk2440.c b/sound/soc/s3c24xx/smdk2440.c +new file mode 100644 +index 0000000..9885a5e +--- /dev/null ++++ b/sound/soc/s3c24xx/smdk2440.c +@@ -0,0 +1,320 @@ ++/* ++ * smdk2440.c -- ALSA Soc Audio Layer ++ * ++ * (c) 2006 Wolfson Microelectronics PLC. ++ * Graeme Gregory graeme.gregory@wolfsonmicro.com or linux@wolfsonmicro.com ++ * ++ * (c) 2004-2005 Simtec Electronics ++ * http://armlinux.simtec.co.uk/ ++ * Ben Dooks <ben@simtec.co.uk> ++ * ++ * 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; either version 2 of the License, or (at your ++ * option) any later version. ++ * ++ * This module is a modified version of the s3c24xx I2S driver supplied by ++ * Ben Dooks of Simtec and rejigged to the ASoC style at Wolfson Microelectronics ++ * ++ * Revision history ++ * 11th Dec 2006 Merged with Simtec driver ++ * 10th Nov 2006 Initial version. ++ */ ++ ++#include <linux/module.h> ++#include <linux/moduleparam.h> ++#include <linux/timer.h> ++#include <linux/interrupt.h> ++#include <linux/platform_device.h> ++#include <sound/driver.h> ++#include <sound/core.h> ++#include <sound/pcm.h> ++#include <sound/soc.h> ++#include <sound/soc-dapm.h> ++ ++#include <asm/mach-types.h> ++#include <asm/hardware/scoop.h> ++#include <asm/arch/regs-iis.h> ++#include <asm/arch/regs-clock.h> ++#include <asm/arch/regs-gpio.h> ++#include <asm/arch/hardware.h> ++#include <asm/arch/audio.h> ++#include <asm/io.h> ++#include <asm/arch/spi-gpio.h> ++#include "../codecs/uda1380.h" ++#include "s3c24xx-pcm.h" ++#include "s3c24xx-i2s.h" ++ ++#define SMDK2440_DEBUG 0 ++#if SMDK2440_DEBUG ++#define DBG(x...) printk(KERN_DEBUG x) ++#else ++#define DBG(x...) ++#endif ++ ++/* audio clock in Hz */ ++#define SMDK_CLOCK_SOURCE S3C24XX_CLKSRC_MPLL ++#define SMDK_CRYSTAL_CLOCK 16934400 ++ ++static int smdk2440_startup(struct snd_pcm_substream *substream) ++{ ++ struct snd_soc_pcm_runtime *rtd = substream->private_data; ++ struct snd_soc_codec *codec = rtd->socdev->codec; ++ ++ DBG("Entered smdk2440_startup\n"); ++ ++ return 0; ++} ++ ++static int smdk2440_shutdown(struct snd_pcm_substream *substream) ++{ ++ struct snd_soc_pcm_runtime *rtd = substream->private_data; ++ struct snd_soc_codec *codec = rtd->socdev->codec; ++ ++ DBG("Entered smdk2440_shutdown\n"); ++ ++ return 0; ++} ++ ++static int smdk2440_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_cpu_dai *cpu_dai = rtd->dai->cpu_dai; ++ struct snd_soc_codec_dai *codec_dai = rtd->dai->codec_dai; ++ unsigned long iis_clkrate; ++ int div, div256, div384, diff256, diff384, bclk, mclk; ++ int ret; ++ unsigned int rate=params_rate(params); ++ ++ DBG("Entered %s\n",__FUNCTION__); ++ ++ iis_clkrate = s3c24xx_i2s_get_clockrate(); ++ ++ /* Using PCLK doesnt seem to suit audio particularly well on these cpu's ++ */ ++ ++ div256 = iis_clkrate / (rate * 256); ++ div384 = iis_clkrate / (rate * 384); ++ ++ if (((iis_clkrate / div256) - (rate * 256)) < ++ ((rate * 256) - (iis_clkrate / (div256 + 1)))) { ++ diff256 = (iis_clkrate / div256) - (rate * 256); ++ } else { ++ div256++; ++ diff256 = (iis_clkrate / div256) - (rate * 256); ++ } ++ ++ if (((iis_clkrate / div384) - (rate * 384)) < ++ ((rate * 384) - (iis_clkrate / (div384 + 1)))) { ++ diff384 = (iis_clkrate / div384) - (rate * 384); ++ } else { ++ div384++; ++ diff384 = (iis_clkrate / div384) - (rate * 384); ++ } ++ ++ DBG("diff256 %d, diff384 %d\n", diff256, diff384); ++ ++ if (diff256<=diff384) { ++ DBG("Selected 256FS\n"); ++ div = div256 - 1; ++ bclk = S3C2410_IISMOD_256FS; ++ } else { ++ DBG("Selected 384FS\n"); ++ div = div384 - 1; ++ bclk = S3C2410_IISMOD_384FS; ++ } ++ ++ /* set codec DAI configuration */ ++ ret = codec_dai->dai_ops.set_fmt(codec_dai, SND_SOC_DAIFMT_I2S | ++ SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBS_CFS); ++ if (ret < 0) ++ return ret; ++ ++ /* set cpu DAI configuration */ ++ ret = cpu_dai->dai_ops.set_fmt(cpu_dai, SND_SOC_DAIFMT_I2S | ++ SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBS_CFS); ++ if (ret < 0) ++ return ret; ++ ++ /* set the audio system clock for DAC and ADC */ ++ ret = cpu_dai->dai_ops.set_sysclk(cpu_dai, S3C24XX_CLKSRC_PCLK, ++ rate, SND_SOC_CLOCK_OUT); ++ if (ret < 0) ++ return ret; ++ ++ /* set MCLK division for sample rate */ ++ ret = cpu_dai->dai_ops.set_clkdiv(cpu_dai, S3C24XX_DIV_MCLK, S3C2410_IISMOD_32FS ); ++ if (ret < 0) ++ return ret; ++ ++ /* set BCLK division for sample rate */ ++ ret = cpu_dai->dai_ops.set_clkdiv(cpu_dai, S3C24XX_DIV_BCLK, bclk); ++ if (ret < 0) ++ return ret; ++ ++ /* set prescaler division for sample rate */ ++ ret = cpu_dai->dai_ops.set_clkdiv(cpu_dai, S3C24XX_DIV_PRESCALER, ++ S3C24XX_PRESCALE(div,div)); ++ if (ret < 0) ++ return ret; ++ ++ return 0; ++} ++ ++static struct snd_soc_ops smdk2440_ops = { ++ .startup = smdk2440_startup, ++ .shutdown = smdk2440_shutdown, ++ .hw_params = smdk2440_hw_params, ++}; ++ ++/* smdk2440 machine dapm widgets */ ++static const struct snd_soc_dapm_widget smdk2440_dapm_widgets[] = { ++SND_SOC_DAPM_HP("Headphone Jack", NULL), ++SND_SOC_DAPM_MIC("Mic Jack", NULL), ++SND_SOC_DAPM_LINE("Line Jack", NULL), ++}; ++ ++/* smdk2440 machine audio map (connections to the codec pins) */ ++static const char* audio_map[][3] = { ++ /* headphone connected to HPOUT */ ++ {"Headphone Jack", NULL, "HPOUT"}, ++ ++ /* mic is connected to MICIN (via right channel of headphone jack) */ ++ {"MICIN", NULL, "Mic Jack"}, ++ {"MICIN", NULL, "Line Jack"}, ++ ++ {NULL, NULL, NULL}, ++}; ++ ++/* ++ * Logic for a UDA1341 as attached to SMDK2440 ++ */ ++static int smdk2440_uda1341_init(struct snd_soc_codec *codec) ++{ ++ int i, err; ++ ++ DBG("Staring smdk2440 init\n"); ++ ++ /* Add smdk2440 specific widgets */ ++ for(i = 0; i < ARRAY_SIZE(smdk2440_dapm_widgets); i++) { ++ snd_soc_dapm_new_control(codec, &smdk2440_dapm_widgets[i]); ++ } ++ ++ /* Set up smdk2440 specific audio path audio_mapnects */ ++ for(i = 0; audio_map[i][0] != NULL; i++) { ++ snd_soc_dapm_connect_input(codec, audio_map[i][0], ++ audio_map[i][1], audio_map[i][2]); ++ } ++ ++ snd_soc_dapm_sync_endpoints(codec); ++ ++ DBG("Ending smdk2440 init\n"); ++ ++ return 0; ++} ++ ++/* s3c24xx digital audio interface glue - connects codec <--> CPU */ ++static struct snd_soc_dai_link s3c24xx_dai = { ++ .name = "WM8731", ++ .stream_name = "WM8731", ++ .cpu_dai = &s3c24xx_i2s_dai, ++ .codec_dai = &uda1380_dai, ++ .init = smdk2440_uda1341_init, ++ .ops = &smdk2440_ops, ++}; ++ ++/* smdk2440 audio machine driver */ ++static struct snd_soc_machine snd_soc_machine_smdk2440 = { ++ .name = "SMDK2440", ++ .dai_link = &s3c24xx_dai, ++ .num_links = 1, ++}; ++ ++static struct uda1380_setup_data smdk2440_uda1380_setup = { ++ .i2c_address = 0x00, ++}; ++ ++/* s3c24xx audio subsystem */ ++static struct snd_soc_device s3c24xx_snd_devdata = { ++ .machine = &snd_soc_machine_smdk2440, ++ .platform = &s3c24xx_soc_platform, ++ .codec_dev = &soc_codec_dev_uda1380, ++ .codec_data = &smdk2440_uda1380_setup, ++}; ++ ++static struct platform_device *s3c24xx_snd_device; ++ ++struct smdk2440_spi_device { ++ struct device *dev; ++}; ++ ++static struct smdk2440_spi_device smdk2440_spi_devdata = { ++}; ++ ++struct s3c2410_spigpio_info smdk2440_spi_devinfo = { ++ .pin_clk = S3C2410_GPF4, ++ .pin_mosi = S3C2410_GPF5, ++ .pin_miso = S3C2410_GPF6, ++ //.board_size, ++ //.board_info, ++ .chip_select=NULL, ++}; ++ ++static struct platform_device *smdk2440_spi_device; ++ ++static int __init smdk2440_init(void) ++{ ++ int ret; ++ ++ if (!machine_is_smdk2440() && !machine_is_s3c2440()) { ++ DBG("%d\n",machine_arch_type); ++ DBG("Not a SMDK2440\n"); ++ return -ENODEV; ++ } ++ ++ s3c24xx_snd_device = platform_device_alloc("soc-audio", -1); ++ if (!s3c24xx_snd_device) { ++ DBG("platform_dev_alloc failed\n"); ++ return -ENOMEM; ++ } ++ ++ platform_set_drvdata(s3c24xx_snd_device, &s3c24xx_snd_devdata); ++ s3c24xx_snd_devdata.dev = &s3c24xx_snd_device->dev; ++ ret = platform_device_add(s3c24xx_snd_device); ++ ++ if (ret) ++ platform_device_put(s3c24xx_snd_device); ++ ++ // Create a bitbanged SPI device ++ ++ smdk2440_spi_device = platform_device_alloc("s3c24xx-spi-gpio",-1); ++ if (!smdk2440_spi_device) { ++ DBG("smdk2440_spi_device : platform_dev_alloc failed\n"); ++ return -ENOMEM; ++ } ++ DBG("Return Code %d\n",ret); ++ ++ platform_set_drvdata(smdk2440_spi_device, &smdk2440_spi_devdata); ++ smdk2440_spi_devdata.dev = &smdk2440_spi_device->dev; ++ smdk2440_spi_devdata.dev->platform_data = &smdk2440_spi_devinfo; ++ ret = platform_device_add(smdk2440_spi_device); ++ ++ if (ret) ++ platform_device_put(smdk2440_spi_device); ++ ++ return ret; ++} ++ ++static void __exit smdk2440_exit(void) ++{ ++ platform_device_unregister(s3c24xx_snd_device); ++} ++ ++module_init(smdk2440_init); ++module_exit(smdk2440_exit); ++ ++/* Module information */ ++MODULE_AUTHOR("Ben Dooks, <ben@simtec.co.uk>"); ++MODULE_DESCRIPTION("ALSA SoC SMDK2440"); ++MODULE_LICENSE("GPL"); +-- +1.5.0.3 + diff --git a/packages/linux/linux-smdk2443/0023-Add-ASoC-SMDK2440-support-for-WM8956-codec.patch b/packages/linux/linux-smdk2443/0023-Add-ASoC-SMDK2440-support-for-WM8956-codec.patch new file mode 100644 index 0000000000..a1609ff6e6 --- /dev/null +++ b/packages/linux/linux-smdk2443/0023-Add-ASoC-SMDK2440-support-for-WM8956-codec.patch @@ -0,0 +1,391 @@ +From 2799ad808892eff7367ebc3e329ab3e7d00ccdac Mon Sep 17 00:00:00 2001 +From: Liam Girdwood <liam@localhost.localdomain> +Date: Sun, 4 Mar 2007 17:05:34 +0000 +Subject: [PATCH] Add ASoC SMDK2440 support for WM8956 codec. + +Signed-off-by: Graeme Gregory <gg@opensource.wolfsonmicro.com> +Signed-off-by: Liam Girdwood <lg@opensource.wolfsonmicro.com> +--- + sound/soc/s3c24xx/Kconfig | 9 + + sound/soc/s3c24xx/Makefile | 3 + + sound/soc/s3c24xx/smdk2440_wm8956.c | 335 +++++++++++++++++++++++++++++++++++ + 3 files changed, 347 insertions(+), 0 deletions(-) + create mode 100644 sound/soc/s3c24xx/smdk2440_wm8956.c + +diff --git a/sound/soc/s3c24xx/Kconfig b/sound/soc/s3c24xx/Kconfig +index 99fe902..2b4bd21 100644 +--- a/sound/soc/s3c24xx/Kconfig ++++ b/sound/soc/s3c24xx/Kconfig +@@ -28,5 +28,14 @@ config SND_S3C24XX_SOC_SMDK2440 + help + Say Y if you want to add support for SoC audio on SMDK2440 + ++config SND_S3C24XX_SOC_SMDK2440_WM8956 ++ tristate "SoC I2S WM8956 Audio support for SMDK2440" ++ depends on SND_S3C24XX_SOC && MACH_SMDK ++ select SND_S3C24XX_SOC_I2S ++ select SND_SOC_WM8956 ++ help ++ Say Y if you want to add support for SoC audio on SMDK2440 ++ with WM8956. ++ + endmenu + +diff --git a/sound/soc/s3c24xx/Makefile b/sound/soc/s3c24xx/Makefile +index b991052..2759e88 100644 +--- a/sound/soc/s3c24xx/Makefile ++++ b/sound/soc/s3c24xx/Makefile +@@ -8,6 +8,9 @@ obj-$(CONFIG_SND_S3C24XX_SOC_I2S) += snd-soc-s3c24xx-i2s.o + # S3C24XX Machine Support + snd-soc-neo1973-wm8753-objs := neo1973_wm8753.o + snd-soc-smdk2440-objs := smdk2440.o ++snd-soc-smdk2440-wm8956-objs := smdk2440-wm8956.o + + obj-$(CONFIG_SND_S3C24XX_SOC_NEO1973_WM8753) += snd-soc-neo1973-wm8753.o + obj-$(CONFIG_SND_S3C24XX_SOC_SMDK2440) += snd-soc-smdk2440.o ++obj-$(CONFIG_SND_S3C24XX_SOC_SMDK2440_WM8956) += snd-soc-smdk2440-wm8956.o ++ +diff --git a/sound/soc/s3c24xx/smdk2440_wm8956.c b/sound/soc/s3c24xx/smdk2440_wm8956.c +new file mode 100644 +index 0000000..89960eb +--- /dev/null ++++ b/sound/soc/s3c24xx/smdk2440_wm8956.c +@@ -0,0 +1,335 @@ ++/* ++ * smdk2440.c -- ALSA Soc Audio Layer ++ * ++ * (c) 2006 Wolfson Microelectronics PLC. ++ * Graeme Gregory graeme.gregory@wolfsonmicro.com or linux@wolfsonmicro.com ++ * ++ * (c) 2004-2005 Simtec Electronics ++ * http://armlinux.simtec.co.uk/ ++ * Ben Dooks <ben@simtec.co.uk> ++ * ++ * 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; either version 2 of the License, or (at your ++ * option) any later version. ++ * ++ * This module is a modified version of the s3c24xx I2S driver supplied by ++ * Ben Dooks of Simtec and rejigged to the ASoC style at Wolfson Microelectronics ++ * ++ * Revision history ++ * 11th Dec 2006 Merged with Simtec driver ++ * 10th Nov 2006 Initial version. ++ */ ++ ++#include <linux/module.h> ++#include <linux/moduleparam.h> ++#include <linux/timer.h> ++#include <linux/interrupt.h> ++#include <linux/platform_device.h> ++#include <sound/driver.h> ++#include <sound/core.h> ++#include <sound/pcm.h> ++#include <sound/soc.h> ++#include <sound/soc-dapm.h> ++ ++#include <asm/mach-types.h> ++#include <asm/hardware/scoop.h> ++#include <asm/arch/regs-iis.h> ++#include <asm/arch/regs-clock.h> ++#include <asm/arch/regs-gpio.h> ++#include <asm/arch/hardware.h> ++#include <asm/arch/audio.h> ++#include <asm/io.h> ++#include <asm/arch/spi-gpio.h> ++#include "../codecs/wm8956.h" ++#include "s3c24xx-pcm.h" ++#include "s3c24xx-i2s.h" ++ ++#define SMDK2440_DEBUG 0 ++#if SMDK2440_DEBUG ++#define DBG(x...) printk(KERN_DEBUG x) ++#else ++#define DBG(x...) ++#endif ++ ++/* audio clock in Hz */ ++#define SMDK_CLOCK_SOURCE S3C24XX_CLKSRC_MPLL ++#define SMDK_CRYSTAL_CLOCK 12000000 ++ ++static int smdk2440_startup(struct snd_pcm_substream *substream) ++{ ++ struct snd_soc_pcm_runtime *rtd = substream->private_data; ++ struct snd_soc_codec *codec = rtd->socdev->codec; ++ ++ DBG("Entered %s\n",__FUNCTION__); ++ ++ return 0; ++} ++ ++static int smdk2440_shutdown(struct snd_pcm_substream *substream) ++{ ++ struct snd_soc_pcm_runtime *rtd = substream->private_data; ++ struct snd_soc_codec *codec = rtd->socdev->codec; ++ ++ DBG("Entered %s\n",__FUNCTION__); ++ ++ return 0; ++} ++ ++static int smdk2440_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_cpu_dai *cpu_dai = rtd->dai->cpu_dai; ++ struct snd_soc_codec_dai *codec_dai = rtd->dai->codec_dai; ++ int bclk, mclk; ++ int ret; ++ int pll; ++ int div=0,sysclkdiv=0; ++ unsigned int rate = params_rate(params); ++ ++ DBG("Entered %s\n",__FUNCTION__); ++ ++ /* Work out the pll dividers */ ++ switch(rate) ++ { ++ case 8000: ++ case 16000: ++ case 32000: ++ case 48000: ++ pll=12288000; ++ break; ++ case 96000: ++ pll=24576000; ++ break; ++ case 11025: ++ case 22050: ++ case 44100: ++ pll=11289600; ++ break; ++ case 88200: ++ pll=22579200; ++ break; ++ default: ++ pll=12288000; ++ } ++ ++ /* Work out the DAV Div */ ++ switch(rate) ++ { ++ case 96000: ++ case 88200: ++ case 48000: ++ case 44100: ++ div=0; ++ break; ++ case 32000: ++ div=1; ++ break; ++ case 22050; ++ div=2; ++ break; ++ case 16000: ++ div=1; ++ sysclkdiv=2; ++ break; ++ case 11025: ++ div=4; ++ break; ++ case 8000: ++ div=6; ++ break; ++ } ++ ++ /* set codec DAI configuration */ ++ ret = codec_dai->dai_ops.set_fmt(codec_dai, SND_SOC_DAIFMT_I2S | ++ SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBM_CFM); ++ if (ret < 0) ++ return ret; ++ ++ ret = codec_dai->dai_ops.set_pll(codec_dai, 0, SMDK_CRYSTAL_CLOCK, pll); ++ if (ret < 0) ++ return ret; ++ ++ ret = codec_dai->dai_ops.set_clkdiv(codec_dai, WM8956_SYSCLKDIV, sysclkdiv); ++ if (ret < 0) ++ return ret; ++ ++ ret = codec_dai->dai_ops.set_clkdiv(codec_dai, WM8956_DACDIV, div); ++ if (ret < 0) ++ return ret; ++ ++ /* set cpu DAI configuration */ ++ ret = cpu_dai->dai_ops.set_fmt(cpu_dai, SND_SOC_DAIFMT_I2S | ++ SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBM_CFM); ++ if (ret < 0) ++ return ret; ++ ++ /* set the audio system clock for DAC and ADC */ ++ /* 12Mhz crystal for this example */ ++ ret = cpu_dai->dai_ops.set_sysclk(cpu_dai, S3C24XX_CLKSRC_MPLL, ++ SMDK_CRYSTAL_CLOCK, SND_SOC_CLOCK_OUT); ++ if (ret < 0) ++ return ret; ++ ++ /* set MCLK division for sample rate */ ++ ret = cpu_dai->dai_ops.set_clkdiv(cpu_dai, S3C24XX_DIV_MCLK, S3C2410_IISMOD_32FS ); ++ if (ret < 0) ++ return ret; ++ ++ return 0; ++} ++ ++static struct snd_soc_ops smdk2440_ops = { ++ .startup = smdk2440_startup, ++ .shutdown = smdk2440_shutdown, ++ .hw_params = smdk2440_hw_params, ++}; ++ ++/* smdk2440 machine dapm widgets */ ++static const struct snd_soc_dapm_widget smdk2440_dapm_widgets[] = { ++SND_SOC_DAPM_HP("Headphone Jack", NULL), ++SND_SOC_DAPM_MIC("Mic Jack", NULL), ++SND_SOC_DAPM_LINE("Line Jack", NULL), ++}; ++ ++/* smdk2440 machine audio map (connections to the codec pins) */ ++static const char* audio_map[][3] = { ++ /* headphone connected to HPOUT */ ++ {"Headphone Jack", NULL, "HPOUT"}, ++ {"MICIN", NULL, "Mic Jack"}, ++ {"MICIN", NULL, "Line Jack"}, ++ ++ {NULL, NULL, NULL}, ++}; ++ ++/* ++ * Logic for a wm8956 as attached to SMDK2440 ++ */ ++static int smdk2440_wm8956_init(struct snd_soc_codec *codec) ++{ ++ int i, err; ++ ++ DBG("Entered %s\n",__FUNCTION__); ++ ++ ++ /* Add smdk2440 specific widgets */ ++ for(i = 0; i < ARRAY_SIZE(smdk2440_dapm_widgets); i++) { ++ snd_soc_dapm_new_control(codec, &smdk2440_dapm_widgets[i]); ++ } ++ ++ /* Set up smdk2440 specific audio path audio_mapnects */ ++ for(i = 0; audio_map[i][0] != NULL; i++) { ++ snd_soc_dapm_connect_input(codec, audio_map[i][0], ++ audio_map[i][1], audio_map[i][2]); ++ } ++ ++ snd_soc_dapm_sync_endpoints(codec); ++ ++ return 0; ++} ++ ++/* s3c24xx digital audio interface glue - connects codec <--> CPU */ ++static struct snd_soc_dai_link s3c24xx_dai = { ++ .name = "WM8731", ++ .stream_name = "WM8731", ++ .cpu_dai = &s3c24xx_i2s_dai, ++ .codec_dai = &wm8956_dai, ++ .init = smdk2440_wm8956_init, ++ .ops = &smdk2440_ops, ++}; ++ ++/* smdk2440 audio machine driver */ ++static struct snd_soc_machine snd_soc_machine_smdk2440 = { ++ .name = "SMDK2440", ++ .dai_link = &s3c24xx_dai, ++ .num_links = 1, ++}; ++ ++static struct wm8956_setup_data smdk2440_wm8956_setup = { ++ .i2c_address = 0x00, ++}; ++ ++/* s3c24xx audio subsystem */ ++static struct snd_soc_device s3c24xx_snd_devdata = { ++ .machine = &snd_soc_machine_smdk2440, ++ .platform = &s3c24xx_soc_platform, ++ .codec_dev = &soc_codec_dev_wm8956, ++ .codec_data = &smdk2440_wm8956_setup, ++}; ++ ++static struct platform_device *s3c24xx_snd_device; ++ ++struct smdk2440_spi_device { ++ struct device *dev; ++}; ++ ++static struct smdk2440_spi_device smdk2440_spi_devdata = { ++}; ++ ++struct s3c2410_spigpio_info smdk2440_spi_devinfo = { ++ .pin_clk = S3C2410_GPF4, ++ .pin_mosi = S3C2410_GPF5, ++ .pin_miso = S3C2410_GPF6, ++ //.board_size, ++ //.board_info, ++ .chip_select=NULL, ++}; ++ ++static struct platform_device *smdk2440_spi_device; ++ ++static int __init smdk2440_init(void) ++{ ++ int ret; ++ ++ if (!machine_is_smdk2440() && !machine_is_s3c2440()) { ++ DBG("%d\n",machine_arch_type); ++ DBG("Not a SMDK2440\n"); ++ return -ENODEV; ++ } ++ ++ s3c24xx_snd_device = platform_device_alloc("soc-audio", -1); ++ if (!s3c24xx_snd_device) { ++ DBG("platform_dev_alloc failed\n"); ++ return -ENOMEM; ++ } ++ ++ platform_set_drvdata(s3c24xx_snd_device, &s3c24xx_snd_devdata); ++ s3c24xx_snd_devdata.dev = &s3c24xx_snd_device->dev; ++ ret = platform_device_add(s3c24xx_snd_device); ++ ++ if (ret) ++ platform_device_put(s3c24xx_snd_device); ++ ++ // Create a bitbanged SPI device ++ ++ smdk2440_spi_device = platform_device_alloc("s3c24xx-spi-gpio",-1); ++ if (!smdk2440_spi_device) { ++ DBG("smdk2440_spi_device : platform_dev_alloc failed\n"); ++ return -ENOMEM; ++ } ++ DBG("Return Code %d\n",ret); ++ ++ platform_set_drvdata(smdk2440_spi_device, &smdk2440_spi_devdata); ++ smdk2440_spi_devdata.dev = &smdk2440_spi_device->dev; ++ smdk2440_spi_devdata.dev->platform_data = &smdk2440_spi_devinfo; ++ ret = platform_device_add(smdk2440_spi_device); ++ ++ if (ret) ++ platform_device_put(smdk2440_spi_device); ++ ++ return ret; ++} ++ ++static void __exit smdk2440_exit(void) ++{ ++ platform_device_unregister(s3c24xx_snd_device); ++} ++ ++module_init(smdk2440_init); ++module_exit(smdk2440_exit); ++ ++/* Module information */ ++MODULE_AUTHOR("Ben Dooks, <ben@simtec.co.uk>"); ++MODULE_DESCRIPTION("ALSA SoC SMDK2440"); ++MODULE_LICENSE("GPL"); +-- +1.5.0.3 + diff --git a/packages/linux/linux-smdk2443/0033-arch-hardware.h-is-no-longer-allowed-to-be-directly.patch b/packages/linux/linux-smdk2443/0033-arch-hardware.h-is-no-longer-allowed-to-be-directly.patch new file mode 100644 index 0000000000..2dc2a6ac41 --- /dev/null +++ b/packages/linux/linux-smdk2443/0033-arch-hardware.h-is-no-longer-allowed-to-be-directly.patch @@ -0,0 +1,41 @@ +From 3108e2dc553b3014294a6915471198c94c643657 Mon Sep 17 00:00:00 2001 +From: Graeme Gregory <gg@a10082.wolfsonmicro.main> +Date: Mon, 26 Mar 2007 14:19:43 +0100 +Subject: [PATCH] arch/hardware.h is no longer allowed to be directly included. So changed +to include hardware.h + +Signed-off-by: Graeme Gregory <gg@opensource.wolfsonmicro.com> +--- + sound/soc/s3c24xx/neo1973_wm8753.c | 2 +- + sound/soc/s3c24xx/smdk2440.c | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/sound/soc/s3c24xx/neo1973_wm8753.c b/sound/soc/s3c24xx/neo1973_wm8753.c +index 46a70e3..34e03cd 100644 +--- a/sound/soc/s3c24xx/neo1973_wm8753.c ++++ b/sound/soc/s3c24xx/neo1973_wm8753.c +@@ -33,7 +33,7 @@ + #include <asm/arch/regs-iis.h> + #include <asm/arch/regs-clock.h> + #include <asm/arch/regs-gpio.h> +-#include <asm/arch/hardware.h> ++#include <asm/hardware.h> + #include <asm/arch/audio.h> + #include <asm/io.h> + #include <asm/arch/spi-gpio.h> +diff --git a/sound/soc/s3c24xx/smdk2440.c b/sound/soc/s3c24xx/smdk2440.c +index 9885a5e..5363fe1 100644 +--- a/sound/soc/s3c24xx/smdk2440.c ++++ b/sound/soc/s3c24xx/smdk2440.c +@@ -37,7 +37,7 @@ + #include <asm/arch/regs-iis.h> + #include <asm/arch/regs-clock.h> + #include <asm/arch/regs-gpio.h> +-#include <asm/arch/hardware.h> ++#include <asm/hardware.h> + #include <asm/arch/audio.h> + #include <asm/io.h> + #include <asm/arch/spi-gpio.h> +-- +1.5.0.3 + diff --git a/packages/linux/linux-smdk2443/0034-Export-ac97_dai.patch b/packages/linux/linux-smdk2443/0034-Export-ac97_dai.patch new file mode 100644 index 0000000000..d159d92ea3 --- /dev/null +++ b/packages/linux/linux-smdk2443/0034-Export-ac97_dai.patch @@ -0,0 +1,39 @@ +From 5927769216ec15b725f224e3e60ed9884c192704 Mon Sep 17 00:00:00 2001 +From: Graeme Gregory <gg@a10082.wolfsonmicro.main> +Date: Mon, 26 Mar 2007 15:18:27 +0100 +Subject: [PATCH] Export ac97_dai + +This is required so that machine drivers can use this codec. + +Signed-off-by: Graeme Gregory <gg@opensource.wolfsonmicro.com> +--- + sound/soc/codecs/ac97.c | 1 + + sound/soc/codecs/ac97.h | 1 + + 2 files changed, 2 insertions(+), 0 deletions(-) + +diff --git a/sound/soc/codecs/ac97.c b/sound/soc/codecs/ac97.c +index 55bc55e..0cdef97 100644 +--- a/sound/soc/codecs/ac97.c ++++ b/sound/soc/codecs/ac97.c +@@ -60,6 +60,7 @@ static struct snd_soc_codec_dai ac97_dai = { + .ops = { + .prepare = ac97_prepare,}, + }; ++EXPORT_SYMBOL_GPL(ac97_dai); + + static unsigned int ac97_read(struct snd_soc_codec *codec, + unsigned int reg) +diff --git a/sound/soc/codecs/ac97.h b/sound/soc/codecs/ac97.h +index 930ddfc..2bf6d69 100644 +--- a/sound/soc/codecs/ac97.h ++++ b/sound/soc/codecs/ac97.h +@@ -14,5 +14,6 @@ + #define __LINUX_SND_SOC_AC97_H + + extern struct snd_soc_codec_device soc_codec_dev_ac97; ++extern struct snd_soc_codec_dai ac97_dai; + + #endif +-- +1.5.0.3 + diff --git a/packages/linux/linux-smdk2443/0035-Fix-power-and-PLL.patch b/packages/linux/linux-smdk2443/0035-Fix-power-and-PLL.patch new file mode 100644 index 0000000000..c498da69fe --- /dev/null +++ b/packages/linux/linux-smdk2443/0035-Fix-power-and-PLL.patch @@ -0,0 +1,63 @@ +From fc2b709436ef9069dac1e2b46a8acb94a7169e8d Mon Sep 17 00:00:00 2001 +From: Graeme Gregory <gg@a10082.wolfsonmicro.main> +Date: Mon, 26 Mar 2007 15:25:43 +0100 +Subject: [PATCH] Fix power and PLL + +bit 0 of POWER1 has oposite meaning to the rest of the bits so write this +to zero to enable chip. + +enable the fractional PLL by enabling the correct bit in register. + +Signed-off-by: Graeme Gregory <gg@opensource.wolfsonmicro.com> +--- + sound/soc/codecs/wm8956.c | 4 ++-- + sound/soc/codecs/wm8960.c | 4 ++-- + 2 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/sound/soc/codecs/wm8956.c b/sound/soc/codecs/wm8956.c +index 6e1bbc9..d88f572 100644 +--- a/sound/soc/codecs/wm8956.c ++++ b/sound/soc/codecs/wm8956.c +@@ -314,7 +314,7 @@ static int wm8956_dapm_event(struct snd_soc_codec *codec, int event) + } + #endif + // tmp +- wm8956_write(codec, WM8956_POWER1, 0xffff); ++ wm8956_write(codec, WM8956_POWER1, 0xfffe); + wm8956_write(codec, WM8956_POWER2, 0xffff); + wm8956_write(codec, WM8956_POWER3, 0xffff); + codec->dapm_state = event; +@@ -388,7 +388,7 @@ static int wm8956_set_dai_pll(struct snd_soc_codec_dai *codec_dai, + return -EINVAL; + + reg = wm8956_read_reg_cache(codec, WM8956_PLLN) & 0x1e0; +- wm8956_write(codec, WM8956_PLLN, reg | (pll_div.pre_div << 4) ++ wm8956_write(codec, WM8956_PLLN, reg | (1<<5) | (pll_div.pre_div << 4) + | pll_div.n); + wm8956_write(codec, WM8956_PLLK1, pll_div.k >> 16 ); + wm8956_write(codec, WM8956_PLLK2, (pll_div.k >> 8) & 0xff); +diff --git a/sound/soc/codecs/wm8960.c b/sound/soc/codecs/wm8960.c +index a754742..24cbb36 100644 +--- a/sound/soc/codecs/wm8960.c ++++ b/sound/soc/codecs/wm8960.c +@@ -356,7 +356,7 @@ static int wm8960_dapm_event(struct snd_soc_codec *codec, int event) + } + #endif + // tmp +- wm8960_write(codec, WM8960_POWER1, 0xffff); ++ wm8960_write(codec, WM8960_POWER1, 0xfffe); + wm8960_write(codec, WM8960_POWER2, 0xffff); + wm8960_write(codec, WM8960_POWER3, 0xffff); + codec->dapm_state = event; +@@ -430,7 +430,7 @@ static int wm8960_set_dai_pll(struct snd_soc_codec_dai *codec_dai, + return -EINVAL; + + reg = wm8960_read_reg_cache(codec, WM8960_PLLN) & 0x1e0; +- wm8960_write(codec, WM8960_PLLN, reg | (pll_div.pre_div << 4) ++ wm8960_write(codec, WM8960_PLLN, reg | (1<<5) | (pll_div.pre_div << 4) + | pll_div.n); + wm8960_write(codec, WM8960_PLLK1, pll_div.k >> 16 ); + wm8960_write(codec, WM8960_PLLK2, (pll_div.k >> 8) & 0xff); +-- +1.5.0.3 + diff --git a/packages/linux/linux-smdk2443/0036-Move-s3c24xx_i2s_dai-and-add-dma_size.patch b/packages/linux/linux-smdk2443/0036-Move-s3c24xx_i2s_dai-and-add-dma_size.patch new file mode 100644 index 0000000000..3b013db336 --- /dev/null +++ b/packages/linux/linux-smdk2443/0036-Move-s3c24xx_i2s_dai-and-add-dma_size.patch @@ -0,0 +1,48 @@ +From 129287fa3ed3c4caf14e9d9f70bec2f3a42ea00d Mon Sep 17 00:00:00 2001 +From: Graeme Gregory <gg@a10082.wolfsonmicro.main> +Date: Mon, 26 Mar 2007 15:31:30 +0100 +Subject: [PATCH] Move s3c24xx_i2s_dai and add dma_size + +move s3c24xx_i2s_dai from pcm.h to i2s.h where it should be + +add a dma_size parameter to the dma params as I2S and AC97 use different +writing widths to the FIFO. + +Signed-off-by: Graeme Gregory <gg@opensource.wolfsonmicro.com> +--- + sound/soc/s3c24xx/s3c24xx-i2s.h | 2 ++ + sound/soc/s3c24xx/s3c24xx-pcm.h | 3 +-- + 2 files changed, 3 insertions(+), 2 deletions(-) + +diff --git a/sound/soc/s3c24xx/s3c24xx-i2s.h b/sound/soc/s3c24xx/s3c24xx-i2s.h +index f9ca04e..537b4ec 100644 +--- a/sound/soc/s3c24xx/s3c24xx-i2s.h ++++ b/sound/soc/s3c24xx/s3c24xx-i2s.h +@@ -32,4 +32,6 @@ + + u32 s3c24xx_i2s_get_clockrate(void); + ++extern struct snd_soc_cpu_dai s3c24xx_i2s_dai; ++ + #endif /*S3C24XXI2S_H_*/ +diff --git a/sound/soc/s3c24xx/s3c24xx-pcm.h b/sound/soc/s3c24xx/s3c24xx-pcm.h +index 5dced4a..5619fdc 100644 +--- a/sound/soc/s3c24xx/s3c24xx-pcm.h ++++ b/sound/soc/s3c24xx/s3c24xx-pcm.h +@@ -19,12 +19,11 @@ struct s3c24xx_pcm_dma_params { + struct s3c2410_dma_client *client; /* stream identifier */ + int channel; /* Channel ID */ + dma_addr_t dma_addr; ++ int dma_size; /* Size of the DMA transfer */ + }; + + #define S3C24XX_DAI_I2S 0 + +-extern struct snd_soc_cpu_dai s3c24xx_i2s_dai; +- + /* platform data */ + extern struct snd_soc_platform s3c24xx_soc_platform; + extern struct snd_ac97_bus_ops s3c24xx_ac97_ops; +-- +1.5.0.3 + diff --git a/packages/linux/linux-smdk2443/0037-Use-dma_size-parameter-and-fix-buffdone-oops.patch b/packages/linux/linux-smdk2443/0037-Use-dma_size-parameter-and-fix-buffdone-oops.patch new file mode 100644 index 0000000000..720f3b4868 --- /dev/null +++ b/packages/linux/linux-smdk2443/0037-Use-dma_size-parameter-and-fix-buffdone-oops.patch @@ -0,0 +1,104 @@ +From b0679d107622f7480a6629d3e92af714d9ea78b4 Mon Sep 17 00:00:00 2001 +From: Graeme Gregory <gg@a10082.wolfsonmicro.main> +Date: Mon, 26 Mar 2007 15:34:29 +0100 +Subject: [PATCH] Use dma_size parameter and fix buffdone oops + +Make use of the dma_size parameter in i2s.c and pcm.c + +Move the access of prtd in buffdone until after we have checked for an +abort as flush may be called when prtd is no longer valid. + +Signed-off-by: Graeme Gregory <gg@opensource.wolfsonmicro.com> +--- + sound/soc/s3c24xx/s3c24xx-i2s.c | 6 ++++-- + sound/soc/s3c24xx/s3c24xx-pcm.c | 16 +++++++++------- + 2 files changed, 13 insertions(+), 9 deletions(-) + +diff --git a/sound/soc/s3c24xx/s3c24xx-i2s.c b/sound/soc/s3c24xx/s3c24xx-i2s.c +index df655a5..8ca314d 100644 +--- a/sound/soc/s3c24xx/s3c24xx-i2s.c ++++ b/sound/soc/s3c24xx/s3c24xx-i2s.c +@@ -61,13 +61,15 @@ static struct s3c2410_dma_client s3c24xx_dma_client_in = { + static struct s3c24xx_pcm_dma_params s3c24xx_i2s_pcm_stereo_out = { + .client = &s3c24xx_dma_client_out, + .channel = DMACH_I2S_OUT, +- .dma_addr = S3C2410_PA_IIS + S3C2410_IISFIFO ++ .dma_addr = S3C2410_PA_IIS + S3C2410_IISFIFO, ++ .dma_size = 2, + }; + + static struct s3c24xx_pcm_dma_params s3c24xx_i2s_pcm_stereo_in = { + .client = &s3c24xx_dma_client_in, + .channel = DMACH_I2S_IN, +- .dma_addr = S3C2410_PA_IIS + S3C2410_IISFIFO ++ .dma_addr = S3C2410_PA_IIS + S3C2410_IISFIFO, ++ .dma_size = 2, + }; + + struct s3c24xx_i2s_info { +diff --git a/sound/soc/s3c24xx/s3c24xx-pcm.c b/sound/soc/s3c24xx/s3c24xx-pcm.c +index 867f1b3..dc28bc6 100644 +--- a/sound/soc/s3c24xx/s3c24xx-pcm.c ++++ b/sound/soc/s3c24xx/s3c24xx-pcm.c +@@ -38,7 +38,7 @@ + + #include "s3c24xx-pcm.h" + +-#define S3C24XX_PCM_DEBUG 0 ++#define S3C24XX_PCM_DEBUG 1 + #if S3C24XX_PCM_DEBUG + #define DBG(x...) printk(KERN_DEBUG x) + #else +@@ -119,13 +119,15 @@ static void s3c24xx_audio_buffdone(struct s3c2410_dma_chan *channel, + enum s3c2410_dma_buffresult result) + { + struct snd_pcm_substream *substream = dev_id; +- struct s3c24xx_runtime_data *prtd = substream->runtime->private_data; ++ struct s3c24xx_runtime_data *prtd; + + DBG("Entered %s\n", __FUNCTION__); + + if (result == S3C2410_RES_ABORT || result == S3C2410_RES_ERR) + return; + ++ prtd = substream->runtime->private_data; ++ + if (substream) + snd_pcm_period_elapsed(substream); + +@@ -177,10 +179,12 @@ static int s3c24xx_pcm_hw_params(struct snd_pcm_substream *substream, + S3C2410_DISRCC_APB, prtd->params->dma_addr); + + s3c2410_dma_config(prtd->params->channel, +- 2, S3C2410_DCON_SYNC_PCLK | S3C2410_DCON_HANDSHAKE); ++ prtd->params->dma_size, ++ S3C2410_DCON_SYNC_PCLK | S3C2410_DCON_HANDSHAKE); + } else { + s3c2410_dma_config(prtd->params->channel, +- 2, S3C2410_DCON_HANDSHAKE | S3C2410_DCON_SYNC_PCLK); ++ prtd->params->dma_size, ++ S3C2410_DCON_HANDSHAKE | S3C2410_DCON_SYNC_PCLK); + + s3c2410_dma_devconfig(prtd->params->channel, + S3C2410_DMASRC_HW, 0x3, +@@ -214,7 +218,7 @@ static int s3c24xx_pcm_hw_free(struct snd_pcm_substream *substream) + + /* TODO - do we need to ensure DMA flushed */ + snd_pcm_set_runtime_buffer(substream, NULL); +- ++ + if (prtd->params) { + s3c2410_dma_free(prtd->params->channel, prtd->params->client); + prtd->params = NULL; +@@ -321,8 +325,6 @@ static int s3c24xx_pcm_open(struct snd_pcm_substream *substream) + struct snd_pcm_runtime *runtime = substream->runtime; + struct s3c24xx_runtime_data *prtd; + +- int ret; +- + DBG("Entered %s\n", __FUNCTION__); + + snd_soc_set_runtime_hwparams(substream, &s3c24xx_pcm_hardware); +-- +1.5.0.3 + diff --git a/packages/linux/linux-smdk2443/0038-Add-smdk2443-s3c2443-ac97-and-wm9710-support.patch b/packages/linux/linux-smdk2443/0038-Add-smdk2443-s3c2443-ac97-and-wm9710-support.patch new file mode 100644 index 0000000000..9fa7e557f0 --- /dev/null +++ b/packages/linux/linux-smdk2443/0038-Add-smdk2443-s3c2443-ac97-and-wm9710-support.patch @@ -0,0 +1,724 @@ +From e3a91813a659447bd20de014902fc5b1d95272aa Mon Sep 17 00:00:00 2001 +From: Graeme Gregory <gg@a10082.wolfsonmicro.main> +Date: Mon, 26 Mar 2007 15:47:09 +0100 +Subject: [PATCH] Add smdk2443 s3c2443-ac97 and wm9710 support + +This is the machine driver for smdk2443 with wm9710 + +Also the s3c2443-ac97 driver for use with the above machine driver. + +Signed-off-by: Graeme Gregory <gg@opensource.wolfsonmicro.com> +--- + sound/soc/s3c24xx/Kconfig | 15 ++ + sound/soc/s3c24xx/Makefile | 5 +- + sound/soc/s3c24xx/s3c2443-ac97.c | 438 +++++++++++++++++++++++++++++++++++ + sound/soc/s3c24xx/s3c24xx-ac97.h | 25 ++ + sound/soc/s3c24xx/smdk2443_wm9710.c | 162 +++++++++++++ + 5 files changed, 644 insertions(+), 1 deletions(-) + create mode 100644 sound/soc/s3c24xx/s3c2443-ac97.c + create mode 100644 sound/soc/s3c24xx/s3c24xx-ac97.h + create mode 100644 sound/soc/s3c24xx/smdk2443_wm9710.c + +diff --git a/sound/soc/s3c24xx/Kconfig b/sound/soc/s3c24xx/Kconfig +index 2b4bd21..c41ac49 100644 +--- a/sound/soc/s3c24xx/Kconfig ++++ b/sound/soc/s3c24xx/Kconfig +@@ -12,6 +12,12 @@ config SND_S3C24XX_SOC + config SND_S3C24XX_SOC_I2S + tristate + ++config SND_S3C2443_SOC_AC97 ++ tristate ++ select AC97_BUS ++ select SND_AC97_CODEC ++ select SND_SOC_AC97_BUS ++ + config SND_S3C24XX_SOC_NEO1973_WM8753 + tristate "SoC I2S Audio support for NEO1973 - WM8753" + depends on SND_S3C24XX_SOC && MACH_GTA01 +@@ -37,5 +43,14 @@ config SND_S3C24XX_SOC_SMDK2440_WM8956 + Say Y if you want to add support for SoC audio on SMDK2440 + with WM8956. + ++config SND_S3C24XX_SOC_SMDK2443_WM9710 ++ tristate "SoC I2S Audio support for SMDK2443 - WM9710" ++ depends on SND_S3C24XX_SOC && MACH_SMDK2443 ++ select SND_S3C2443_SOC_AC97 ++ select SND_SOC_AC97_CODEC ++ help ++ Say Y if you want to add support for SoC audio on smdk2443 ++ with the WM9710. ++ + endmenu + +diff --git a/sound/soc/s3c24xx/Makefile b/sound/soc/s3c24xx/Makefile +index 2759e88..3594155 100644 +--- a/sound/soc/s3c24xx/Makefile ++++ b/sound/soc/s3c24xx/Makefile +@@ -1,16 +1,19 @@ + # S3c24XX Platform Support + snd-soc-s3c24xx-objs := s3c24xx-pcm.o + snd-soc-s3c24xx-i2s-objs := s3c24xx-i2s.o ++snd-soc-s3c2443-ac97-objs := s3c2443-ac97.o + + obj-$(CONFIG_SND_S3C24XX_SOC) += snd-soc-s3c24xx.o + obj-$(CONFIG_SND_S3C24XX_SOC_I2S) += snd-soc-s3c24xx-i2s.o ++obj-$(CONFIG_SND_S3C2443_SOC_AC97) += snd-soc-s3c2443-ac97.o + + # S3C24XX Machine Support + snd-soc-neo1973-wm8753-objs := neo1973_wm8753.o + snd-soc-smdk2440-objs := smdk2440.o + snd-soc-smdk2440-wm8956-objs := smdk2440-wm8956.o ++snd-soc-smdk2443-wm9710-objs := smdk2443_wm9710.o + + obj-$(CONFIG_SND_S3C24XX_SOC_NEO1973_WM8753) += snd-soc-neo1973-wm8753.o + obj-$(CONFIG_SND_S3C24XX_SOC_SMDK2440) += snd-soc-smdk2440.o + obj-$(CONFIG_SND_S3C24XX_SOC_SMDK2440_WM8956) += snd-soc-smdk2440-wm8956.o +- ++obj-$(CONFIG_SND_S3C24XX_SOC_SMDK2443_WM9710) += snd-soc-smdk2443-wm9710.o +diff --git a/sound/soc/s3c24xx/s3c2443-ac97.c b/sound/soc/s3c24xx/s3c2443-ac97.c +new file mode 100644 +index 0000000..db5996b +--- /dev/null ++++ b/sound/soc/s3c24xx/s3c2443-ac97.c +@@ -0,0 +1,438 @@ ++/* ++ * s3c24xx-i2s.c -- ALSA Soc Audio Layer ++ * ++ * (c) 2006 Wolfson Microelectronics PLC. ++ * Graeme Gregory graeme.gregory@wolfsonmicro.com or linux@wolfsonmicro.com ++ * ++ * Copyright (C) 2005, Sean Choi <sh428.choi@samsung.com> ++ * All rights reserved. ++ * ++ * 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. ++ * ++ * Revision history ++ * 21st Mar 2007 Initial Version ++ */ ++ ++#include <linux/init.h> ++#include <linux/module.h> ++#include <linux/platform_device.h> ++#include <linux/interrupt.h> ++#include <linux/wait.h> ++#include <linux/delay.h> ++#include <linux/clk.h> ++ ++#include <sound/driver.h> ++#include <sound/core.h> ++#include <sound/pcm.h> ++#include <sound/ac97_codec.h> ++#include <sound/initval.h> ++#include <sound/soc.h> ++ ++#include <asm/hardware.h> ++#include <asm/io.h> ++#include <asm/arch/regs-ac97.h> ++#include <asm/arch/regs-gpio.h> ++#include <asm/arch/regs-clock.h> ++#include <asm/arch/audio.h> ++#include <asm/dma.h> ++#include <asm/arch/dma.h> ++ ++#include "s3c24xx-pcm.h" ++#include "s3c24xx-ac97.h" ++ ++#define S3C2443_I2S_DEBUG 1 ++#if S3C2443_I2S_DEBUG ++#define DBG(x...) printk(KERN_DEBUG x) ++#else ++#define DBG(x...) ++#endif ++ ++struct s3c24xx_ac97_info { ++ void __iomem *regs; ++ struct clk *ac97_clk; ++}; ++static struct s3c24xx_ac97_info s3c24xx_ac97; ++ ++static struct completion CAR_completion; ++static u32 waitingForMask; ++static DECLARE_MUTEX(CAR_mutex); ++ ++static unsigned short s3c2443_ac97_read(struct snd_ac97 *ac97, ++ unsigned short reg) ++{ ++ u32 ac_glbctrl; ++ u32 ac_codec_cmd; ++ u32 stat, addr, data; ++ ++ DBG("Entered %s\n",__FUNCTION__); ++ ++ down(&CAR_mutex); ++ ++ // Initialise the completion used in ISR ++ init_completion(&CAR_completion); ++ ++ waitingForMask = S3C_AC97_GLBSTAT_CODECREADY; ++ ac_codec_cmd = readl(s3c24xx_ac97.regs + S3C_AC97_CODEC_CMD); ++ ac_codec_cmd = S3C_AC97_CODEC_CMD_READ | AC_CMD_ADDR(reg); ++ writel(ac_codec_cmd, s3c24xx_ac97.regs + S3C_AC97_CODEC_CMD); ++ ++ udelay(50); ++ ++ ac_glbctrl = readl(s3c24xx_ac97.regs + S3C_AC97_GLBCTRL); ++ ac_glbctrl |= S3C_AC97_GLBCTRL_CODECREADYIE; ++ writel(ac_glbctrl, s3c24xx_ac97.regs + S3C_AC97_GLBCTRL); ++ ++ wait_for_completion(&CAR_completion); ++ ++ stat = readl(s3c24xx_ac97.regs + S3C_AC97_STAT); ++ addr = (stat >> 16) & 0x7f; ++ data = (stat & 0xffff); ++ ++ DBG("AC97 Read %x %x\n", addr, data); ++ ++ if (addr != reg) { ++ printk("req addr = %02x, rep addr = %02x\n", reg, addr); ++ } ++ ++ up(&CAR_mutex); ++ ++ return (unsigned short)data; ++} ++ ++static void s3c2443_ac97_write(struct snd_ac97 *ac97, unsigned short reg, ++ unsigned short val) ++{ ++ u32 ac_glbctrl; ++ u32 ac_codec_cmd; ++ ++ DBG("Entered %s\n",__FUNCTION__); ++ ++ down(&CAR_mutex); ++ ++ DBG("AC97 Write %x:%x\n", reg,val); ++ ++ init_completion(&CAR_completion); ++ ++ waitingForMask = S3C_AC97_GLBSTAT_CODECREADY; ++ ac_codec_cmd = readl(s3c24xx_ac97.regs + S3C_AC97_CODEC_CMD); ++ ac_codec_cmd = AC_CMD_ADDR(reg) | AC_CMD_DATA(val); ++ writel(ac_codec_cmd, s3c24xx_ac97.regs + S3C_AC97_CODEC_CMD); ++ ++ udelay(50); ++ ++ ac_glbctrl = readl(s3c24xx_ac97.regs + S3C_AC97_GLBCTRL); ++ ac_glbctrl |= S3C_AC97_GLBCTRL_CODECREADYIE; ++ writel(ac_glbctrl, s3c24xx_ac97.regs + S3C_AC97_GLBCTRL); ++ ++ wait_for_completion(&CAR_completion); ++ ++ ac_codec_cmd = readl(s3c24xx_ac97.regs + S3C_AC97_CODEC_CMD); ++ ac_codec_cmd |= S3C_AC97_CODEC_CMD_READ; ++ writel(ac_codec_cmd, s3c24xx_ac97.regs + S3C_AC97_CODEC_CMD); ++ ++ up(&CAR_mutex); ++ ++} ++ ++static void s3c2443_ac97_warm_reset(struct snd_ac97 *ac97) ++{ ++ u32 ac_glbctrl; ++ ++ DBG("Entered %s\n", __FUNCTION__); ++ ++ ac_glbctrl = readl(s3c24xx_ac97.regs + S3C_AC97_GLBCTRL); ++ ac_glbctrl = S3C_AC97_GLBCTRL_WARMRESET; ++ writel(ac_glbctrl, s3c24xx_ac97.regs + S3C_AC97_GLBCTRL); ++ udelay(1000); ++ ++ ac_glbctrl = 0; ++ writel(ac_glbctrl, s3c24xx_ac97.regs + S3C_AC97_GLBCTRL); ++ udelay(1000); ++} ++ ++static void s3c2443_ac97_cold_reset(struct snd_ac97 *ac97) ++{ ++ u32 ac_glbctrl; ++ ++ DBG("Entered %s\n", __FUNCTION__); ++ ++ ac_glbctrl = readl(s3c24xx_ac97.regs + S3C_AC97_GLBCTRL); ++ ac_glbctrl = S3C_AC97_GLBCTRL_COLDRESET; ++ writel(ac_glbctrl, s3c24xx_ac97.regs + S3C_AC97_GLBCTRL); ++ udelay(1000); ++ ++ ac_glbctrl = 0; ++ writel(ac_glbctrl, s3c24xx_ac97.regs + S3C_AC97_GLBCTRL); ++ udelay(1000); ++ ++ ac_glbctrl = readl(s3c24xx_ac97.regs + S3C_AC97_GLBCTRL); ++ ac_glbctrl = S3C_AC97_GLBCTRL_ACLINKON; ++ writel(ac_glbctrl, s3c24xx_ac97.regs + S3C_AC97_GLBCTRL); ++ udelay(1000); ++ ++ ac_glbctrl |= S3C_AC97_GLBCTRL_TRANSFERDATAENABLE; ++ writel(ac_glbctrl, s3c24xx_ac97.regs + S3C_AC97_GLBCTRL); ++ udelay(1000); ++ ++ ac_glbctrl |= S3C_AC97_GLBCTRL_PCMOUTTM_DMA | S3C_AC97_GLBCTRL_PCMINTM_DMA | ++ S3C_AC97_GLBCTRL_MICINTM_DMA; ++ writel(ac_glbctrl, s3c24xx_ac97.regs + S3C_AC97_GLBCTRL); ++ ++} ++ ++static irqreturn_t s3c2443_ac97_irq(int irq, void *dev_id) ++{ ++ int gsr; ++ u32 ac_glbctrl; ++ ++ gsr = readl(s3c24xx_ac97.regs + S3C_AC97_GLBSTAT) & waitingForMask; ++ ++ if (gsr) { ++ ac_glbctrl = readl(s3c24xx_ac97.regs + S3C_AC97_GLBCTRL); ++ ac_glbctrl &= ~S3C_AC97_GLBCTRL_CODECREADYIE; ++ writel(ac_glbctrl, s3c24xx_ac97.regs + S3C_AC97_GLBCTRL); ++ complete(&CAR_completion); ++ } ++ return IRQ_HANDLED; ++} ++ ++struct snd_ac97_bus_ops soc_ac97_ops = { ++ .read = s3c2443_ac97_read, ++ .write = s3c2443_ac97_write, ++ .warm_reset = s3c2443_ac97_warm_reset, ++ .reset = s3c2443_ac97_cold_reset, ++}; ++ ++static struct s3c2410_dma_client s3c2443_dma_client_out = { ++ .name = "AC97 PCM Stereo out" ++}; ++ ++static struct s3c2410_dma_client s3c2443_dma_client_in = { ++ .name = "AC97 PCM Stereo in" ++}; ++ ++static struct s3c2410_dma_client s3c2443_dma_client_micin = { ++ .name = "AC97 Mic Mono in" ++}; ++ ++static struct s3c24xx_pcm_dma_params s3c2443_ac97_pcm_stereo_out = { ++ .client = &s3c2443_dma_client_out, ++ .channel = DMACH_PCM_OUT, ++ .dma_addr = S3C2440_PA_AC97 + S3C_AC97_PCM_DATA, ++ .dma_size = 4, ++}; ++ ++static struct s3c24xx_pcm_dma_params s3c2443_ac97_pcm_stereo_in = { ++ .client = &s3c2443_dma_client_in, ++ .channel = DMACH_PCM_IN, ++ .dma_addr = S3C2440_PA_AC97 + S3C_AC97_PCM_DATA, ++ .dma_size = 4, ++}; ++ ++static struct s3c24xx_pcm_dma_params s3c2443_ac97_mic_mono_in = { ++ .client = &s3c2443_dma_client_micin, ++ .channel = DMACH_MIC_IN, ++ .dma_addr = S3C2440_PA_AC97 + S3C_AC97_MIC_DATA, ++ .dma_size = 4, ++}; ++ ++#ifdef CONFIG_PM ++static int s3c2443_ac97_suspend(struct platform_device *pdev, ++ struct snd_soc_cpu_dai *dai) ++{ ++ ++ return 0; ++} ++ ++static int s3c2443_ac97_resume(struct platform_device *pdev, ++ struct snd_soc_cpu_dai *dai) ++{ ++ return 0; ++} ++ ++#else ++#define s3c2443_ac97_suspend NULL ++#define s3c2443_ac97_resume NULL ++#endif ++ ++static int s3c2443_ac97_probe(struct platform_device *pdev) ++{ ++ int ret; ++ u32 ac_glbctrl; ++ ++ s3c24xx_ac97.regs = ioremap(S3C2440_PA_AC97, 0x100); ++ if (s3c24xx_ac97.regs == NULL) ++ return -ENXIO; ++ ++ s3c24xx_ac97.ac97_clk=clk_get(&pdev->dev, "ac97"); ++ if (s3c24xx_ac97.ac97_clk == NULL) { ++ DBG("failed to get ac97_clock\n"); ++ return -ENODEV; ++ } ++ clk_enable(s3c24xx_ac97.ac97_clk); ++ ++ s3c2410_gpio_cfgpin(S3C2410_GPE0, S3C2443_GPE0_AC_nRESET); ++ s3c2410_gpio_cfgpin(S3C2410_GPE1, S3C2443_GPE1_AC_SYNC); ++ s3c2410_gpio_cfgpin(S3C2410_GPE2, S3C2443_GPE2_AC_BITCLK); ++ s3c2410_gpio_cfgpin(S3C2410_GPE3, S3C2443_GPE3_AC_SDI); ++ s3c2410_gpio_cfgpin(S3C2410_GPE4, S3C2443_GPE4_AC_SDO); ++ ++ ac_glbctrl = readl(s3c24xx_ac97.regs + S3C_AC97_GLBCTRL); ++ ac_glbctrl = S3C_AC97_GLBCTRL_COLDRESET; ++ writel(ac_glbctrl, s3c24xx_ac97.regs + S3C_AC97_GLBCTRL); ++ udelay(1000); ++ ++ ac_glbctrl = 0; ++ writel(ac_glbctrl, s3c24xx_ac97.regs + S3C_AC97_GLBCTRL); ++ udelay(1000); ++ ++ ac_glbctrl = readl(s3c24xx_ac97.regs + S3C_AC97_GLBCTRL); ++ ac_glbctrl = S3C_AC97_GLBCTRL_ACLINKON; ++ writel(ac_glbctrl, s3c24xx_ac97.regs + S3C_AC97_GLBCTRL); ++ udelay(1000); ++ ++ ac_glbctrl |= S3C_AC97_GLBCTRL_TRANSFERDATAENABLE; ++ writel(ac_glbctrl, s3c24xx_ac97.regs + S3C_AC97_GLBCTRL); ++ ++ ret = request_irq(IRQ_S3C2443_AC97, s3c2443_ac97_irq, SA_INTERRUPT, "AC97", NULL); ++ if (ret) ++ printk("Interrupt request failed.\n"); ++ ++ return ret; ++} ++ ++static void s3c2443_ac97_remove(struct platform_device *pdev) ++{ ++ ++} ++ ++static int s3c2443_ac97_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_cpu_dai *cpu_dai = rtd->dai->cpu_dai; ++ ++ if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) ++ cpu_dai->dma_data = &s3c2443_ac97_pcm_stereo_out; ++ else ++ cpu_dai->dma_data = &s3c2443_ac97_pcm_stereo_in; ++ ++ return 0; ++} ++ ++static int s3c2443_ac97_trigger(struct snd_pcm_substream *substream, int cmd) ++{ ++ u32 ac_glbctrl; ++ ++ ac_glbctrl = readl(s3c24xx_ac97.regs + S3C_AC97_GLBCTRL); ++ switch(cmd) { ++ case SNDRV_PCM_TRIGGER_START: ++ case SNDRV_PCM_TRIGGER_RESUME: ++ case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: ++ if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) ++ ac_glbctrl |= S3C_AC97_GLBCTRL_PCMINTM_DMA; ++ else ++ ac_glbctrl |= S3C_AC97_GLBCTRL_PCMOUTTM_DMA; ++ break; ++ case SNDRV_PCM_TRIGGER_STOP: ++ case SNDRV_PCM_TRIGGER_SUSPEND: ++ case SNDRV_PCM_TRIGGER_PAUSE_PUSH: ++ if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) ++ ac_glbctrl &= ~S3C_AC97_GLBCTRL_PCMINTM_MASK; ++ else ++ ac_glbctrl &= ~S3C_AC97_GLBCTRL_PCMOUTTM_MASK; ++ break; ++ } ++ writel(ac_glbctrl, s3c24xx_ac97.regs + S3C_AC97_GLBCTRL); ++ ++ return 0; ++} ++ ++static int s3c2443_ac97_hw_mic_params(struct snd_pcm_substream *substream, ++ struct snd_pcm_hw_params *params) ++{ ++ struct snd_soc_pcm_runtime *rtd = substream->private_data; ++ struct snd_soc_cpu_dai *cpu_dai = rtd->dai->cpu_dai; ++ ++ if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) ++ return -ENODEV; ++ else ++ cpu_dai->dma_data = &s3c2443_ac97_mic_mono_in; ++ ++ return 0; ++} ++ ++static int s3c2443_ac97_mic_trigger(struct snd_pcm_substream *substream, int cmd) ++{ ++ u32 ac_glbctrl; ++ ++ ac_glbctrl = readl(s3c24xx_ac97.regs + S3C_AC97_GLBCTRL); ++ switch(cmd) { ++ case SNDRV_PCM_TRIGGER_START: ++ case SNDRV_PCM_TRIGGER_RESUME: ++ case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: ++ ac_glbctrl |= S3C_AC97_GLBCTRL_PCMINTM_DMA; ++ break; ++ case SNDRV_PCM_TRIGGER_STOP: ++ case SNDRV_PCM_TRIGGER_SUSPEND: ++ case SNDRV_PCM_TRIGGER_PAUSE_PUSH: ++ ac_glbctrl &= ~S3C_AC97_GLBCTRL_PCMINTM_MASK; ++ } ++ writel(ac_glbctrl, s3c24xx_ac97.regs + S3C_AC97_GLBCTRL); ++ ++ return 0; ++} ++ ++#define s3c2443_AC97_RATES (SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_11025 |\ ++ SNDRV_PCM_RATE_16000 | SNDRV_PCM_RATE_22050 | SNDRV_PCM_RATE_44100 | \ ++ SNDRV_PCM_RATE_48000) ++ ++struct snd_soc_cpu_dai s3c2443_ac97_dai[] = { ++{ ++ .name = "s3c2443-ac97", ++ .id = 0, ++ .type = SND_SOC_DAI_AC97, ++ .probe = s3c2443_ac97_probe, ++ .remove = s3c2443_ac97_remove, ++ .suspend = s3c2443_ac97_suspend, ++ .resume = s3c2443_ac97_resume, ++ .playback = { ++ .stream_name = "AC97 Playback", ++ .channels_min = 2, ++ .channels_max = 2, ++ .rates = s3c2443_AC97_RATES, ++ .formats = SNDRV_PCM_FMTBIT_S16_LE,}, ++ .capture = { ++ .stream_name = "AC97 Capture", ++ .channels_min = 2, ++ .channels_max = 2, ++ .rates = s3c2443_AC97_RATES, ++ .formats = SNDRV_PCM_FMTBIT_S16_LE,}, ++ .ops = { ++ .hw_params = s3c2443_ac97_hw_params, ++ .trigger = s3c2443_ac97_trigger}, ++}, ++{ ++ .name = "pxa2xx-ac97-mic", ++ .id = 1, ++ .type = SND_SOC_DAI_AC97, ++ .capture = { ++ .stream_name = "AC97 Mic Capture", ++ .channels_min = 1, ++ .channels_max = 1, ++ .rates = s3c2443_AC97_RATES, ++ .formats = SNDRV_PCM_FMTBIT_S16_LE,}, ++ .ops = { ++ .hw_params = s3c2443_ac97_hw_mic_params, ++ .trigger = s3c2443_ac97_mic_trigger,}, ++}, ++}; ++ ++EXPORT_SYMBOL_GPL(s3c2443_ac97_dai); ++EXPORT_SYMBOL_GPL(soc_ac97_ops); ++ ++MODULE_AUTHOR("Graeme Gregory"); ++MODULE_DESCRIPTION("AC97 driver for the Samsung s3c2443 chip"); ++MODULE_LICENSE("GPL"); +diff --git a/sound/soc/s3c24xx/s3c24xx-ac97.h b/sound/soc/s3c24xx/s3c24xx-ac97.h +new file mode 100644 +index 0000000..afddff0 +--- /dev/null ++++ b/sound/soc/s3c24xx/s3c24xx-ac97.h +@@ -0,0 +1,25 @@ ++/* ++ * s3c24xx-i2s.c -- ALSA Soc Audio Layer ++ * ++ * Copyright 2005 Wolfson Microelectronics PLC. ++ * Author: Graeme Gregory ++ * graeme.gregory@wolfsonmicro.com or linux@wolfsonmicro.com ++ * ++ * 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; either version 2 of the License, or (at your ++ * option) any later version. ++ * ++ * Revision history ++ * 10th Nov 2006 Initial version. ++ */ ++ ++#ifndef S3C24XXAC97_H_ ++#define S3C24XXAC97_H_ ++ ++#define AC_CMD_ADDR(x) (x<<16) ++#define AC_CMD_DATA(x) (x&0xffff) ++ ++extern struct snd_soc_cpu_dai s3c2443_ac97_dai[]; ++ ++#endif /*S3C24XXI2S_H_*/ +diff --git a/sound/soc/s3c24xx/smdk2443_wm9710.c b/sound/soc/s3c24xx/smdk2443_wm9710.c +new file mode 100644 +index 0000000..66c13cf +--- /dev/null ++++ b/sound/soc/s3c24xx/smdk2443_wm9710.c +@@ -0,0 +1,162 @@ ++/* ++ * smdk2443_wm9710.c -- SoC audio for smdk2443 ++ * ++ * Copyright 2007 Wolfson Microelectronics PLC. ++ * Author: Graeme Gregory ++ * graeme.gregory@wolfsonmicro.com or linux@wolfsonmicro.com ++ * ++ * 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; either version 2 of the License, or (at your ++ * option) any later version. ++ * ++ * Revision history ++ * 8th Mar 2007 Initial version. ++ * ++ */ ++ ++#include <linux/module.h> ++#include <linux/moduleparam.h> ++#include <linux/device.h> ++#include <linux/i2c.h> ++#include <sound/driver.h> ++#include <sound/core.h> ++#include <sound/pcm.h> ++#include <sound/soc.h> ++#include <sound/soc-dapm.h> ++ ++#include <asm/mach-types.h> ++#include <asm/hardware/scoop.h> ++#include <asm/arch/regs-iis.h> ++#include <asm/arch/regs-clock.h> ++#include <asm/arch/regs-gpio.h> ++#include <asm/hardware.h> ++#include <asm/arch/audio.h> ++#include <asm/io.h> ++#include <asm/arch/spi-gpio.h> ++#include "../codecs/ac97.h" ++#include "s3c24xx-pcm.h" ++#include "s3c24xx-ac97.h" ++ ++#define SMDK2443_DEBUG 1 ++#if SMDK2443_DEBUG ++#define DBG(x...) printk(KERN_DEBUG x) ++#else ++#define DBG(x...) ++#endif ++ ++static struct snd_soc_machine smdk2443; ++ ++static int smdk2443_suspend(struct platform_device *pdev, pm_message_t state) ++{ ++ return 0; ++} ++ ++static int smdk2443_resume(struct platform_device *pdev) ++{ ++ return 0; ++} ++ ++static int smdk2443_probe(struct platform_device *pdev) ++{ ++ return 0; ++} ++ ++static int smdk2443_remove(struct platform_device *pdev) ++{ ++ return 0; ++} ++ ++static const struct snd_soc_dapm_widget smdk2443_dapm_widgets[] = { ++ SND_SOC_DAPM_MIC("Mic (Internal)", NULL), ++}; ++ ++/* example machine interconnections */ ++static const char* intercon[][3] = { ++ ++ /* mic is connected to mic1 - with bias */ ++ {"MIC1", NULL, "Mic Bias"}, ++ {"Mic Bias", NULL, "Mic (Internal)"}, ++ ++ {NULL, NULL, NULL}, ++}; ++ ++static int smdk2443_wm9710_init(struct snd_soc_codec *codec) ++{ ++ int i; ++ ++ /* set up smdk2443 NC codec pins */ ++ snd_soc_dapm_set_endpoint(codec, "RXP", 0); ++ snd_soc_dapm_set_endpoint(codec, "RXN", 0); ++ ++ /* Add smdk2443 specific widgets */ ++ for(i = 0; i < ARRAY_SIZE(smdk2443_dapm_widgets); i++) { ++ snd_soc_dapm_new_control(codec, &smdk2443_dapm_widgets[i]); ++ } ++ ++ /* set up smdk2443 specific audio path interconnects */ ++ for(i = 0; intercon[i][0] != NULL; i++) { ++ snd_soc_dapm_connect_input(codec, intercon[i][0], intercon[i][1], intercon[i][2]); ++ } ++ ++ snd_soc_dapm_sync_endpoints(codec); ++ return 0; ++} ++ ++static struct snd_soc_dai_link smdk2443_dai[] = { ++{ ++ .name = "AC97", ++ .stream_name = "AC97 HiFi", ++ .cpu_dai = &s3c2443_ac97_dai[0], ++ .codec_dai = &ac97_dai, ++ .init = smdk2443_wm9710_init, ++}, ++}; ++ ++static struct snd_soc_machine smdk2443 = { ++ .name = "SMDK2443", ++ .probe = smdk2443_probe, ++ .remove = smdk2443_remove, ++ .suspend_pre = smdk2443_suspend, ++ .resume_post = smdk2443_resume, ++ .dai_link = smdk2443_dai, ++ .num_links = ARRAY_SIZE(smdk2443_dai), ++}; ++ ++static struct snd_soc_device smdk2443_snd_ac97_devdata = { ++ .machine = &smdk2443, ++ .platform = &s3c24xx_soc_platform, ++ .codec_dev = &soc_codec_dev_ac97, ++}; ++ ++static struct platform_device *smdk2443_snd_ac97_device; ++ ++static int __init smdk2443_init(void) ++{ ++ int ret; ++ ++ smdk2443_snd_ac97_device = platform_device_alloc("soc-audio", -1); ++ if (!smdk2443_snd_ac97_device) ++ return -ENOMEM; ++ ++ platform_set_drvdata(smdk2443_snd_ac97_device, &smdk2443_snd_ac97_devdata); ++ smdk2443_snd_ac97_devdata.dev = &smdk2443_snd_ac97_device->dev; ++ ++ if((ret = platform_device_add(smdk2443_snd_ac97_device)) != 0) ++ platform_device_put(smdk2443_snd_ac97_device); ++ ++ return ret; ++} ++ ++static void __exit smdk2443_exit(void) ++{ ++ platform_device_unregister(smdk2443_snd_ac97_device); ++} ++ ++module_init(smdk2443_init); ++module_exit(smdk2443_exit); ++ ++/* Module information */ ++MODULE_AUTHOR("Graeme Gregory, graeme.gregory@wolfsonmicro.com, www.wolfsonmicro.com"); ++MODULE_DESCRIPTION("ALSA SoC WM9710 SMDK2443"); ++MODULE_LICENSE("GPL"); +-- +1.5.0.3 + diff --git a/packages/linux/linux-smdk2443/asoc-mainline.patch b/packages/linux/linux-smdk2443/asoc-mainline.patch new file mode 100644 index 0000000000..82018af24f --- /dev/null +++ b/packages/linux/linux-smdk2443/asoc-mainline.patch @@ -0,0 +1,142 @@ +Index: git/arch/arm/mach-s3c2443/mach-smdk2443.c +=================================================================== +--- git.orig/arch/arm/mach-s3c2443/mach-smdk2443.c 2007-03-27 13:25:05.000000000 +0100 ++++ git/arch/arm/mach-s3c2443/mach-smdk2443.c 2007-03-27 13:44:19.000000000 +0100 +@@ -69,6 +69,11 @@ + .pfn = __phys_to_pfn(S3C2410_CS2 + (1<<24)), + .length = SZ_4M, + .type = MT_DEVICE, ++ }, { ++ .virtual = (u32)S3C2410_ADDR(0x02000000) , ++ .pfn = __phys_to_pfn(0x09000000), ++ .length = SZ_1M, ++ .type = MT_DEVICE, + } + }; + +Index: git/drivers/net/cs89x0.c +=================================================================== +--- git.orig/drivers/net/cs89x0.c 2007-03-27 13:25:08.000000000 +0100 ++++ git/drivers/net/cs89x0.c 2007-03-27 13:44:19.000000000 +0100 +@@ -187,6 +187,10 @@ + #include <asm/irq.h> + static unsigned int netcard_portlist[] __initdata = {IXDP2X01_CS8900_VIRT_BASE, 0}; + static unsigned int cs8900_irq_map[] = {IRQ_IXDP2X01_CS8900, 0, 0, 0}; ++#elif defined(CONFIG_ARCH_S3C2440) ++static unsigned int netcard_portlist[] __initdata = {S3C2410_ADDR(0x02000000) + 0x300 , 0}; ++static unsigned int cs8900_irq_map[] = {IRQ_EINT13, 0, 0, 0}; ++static unsigned char cs8900_mac[] = {0xDE,0xAD,0xBE,0xEF,0x01,0x02}; + #elif defined(CONFIG_ARCH_PNX010X) + #include <asm/irq.h> + #include <asm/arch/gpio.h> +@@ -719,6 +723,14 @@ + + printk( "[Cirrus EEPROM] "); + } ++#if defined(CONFIG_ARCH_S3C2440) ++ else ++ { ++ for (i=0; i < ETH_ALEN; i++) { ++ dev->dev_addr[i] = cs8900_mac[i]; ++ } ++ } ++#endif + + printk("\n"); + +@@ -802,7 +814,7 @@ + } else { + i = lp->isa_config & INT_NO_MASK; + if (lp->chip_type == CS8900) { +-#if defined(CONFIG_MACH_IXDP2351) || defined(CONFIG_ARCH_IXDP2X01) || defined(CONFIG_ARCH_PNX010X) ++#if defined(CONFIG_MACH_IXDP2351) || defined(CONFIG_ARCH_IXDP2X01) || defined(CONFIG_ARCH_PNX010X) || defined(CONFIG_ARCH_S3C2410) + i = cs8900_irq_map[0]; + #else + /* Translate the IRQ using the IRQ mapping table. */ +@@ -1309,7 +1321,7 @@ + else + #endif + { +-#if !defined(CONFIG_MACH_IXDP2351) && !defined(CONFIG_ARCH_IXDP2X01) && !defined(CONFIG_ARCH_PNX010X) ++#if !defined(CONFIG_MACH_IXDP2351) && !defined(CONFIG_ARCH_IXDP2X01) && !defined(CONFIG_ARCH_PNX010X) && !defined(CONFIG_ARCH_S3C2410) + if (((1 << dev->irq) & lp->irq_map) == 0) { + printk(KERN_ERR "%s: IRQ %d is not in our map of allowable IRQs, which is %x\n", + dev->name, dev->irq, lp->irq_map); +@@ -1324,7 +1336,11 @@ + writereg(dev, PP_BusCTL, ENABLE_IRQ | MEMORY_ON); + #endif + write_irq(dev, lp->chip_type, dev->irq); ++#if !defined(CONFIG_ARCH_S3C2440) + ret = request_irq(dev->irq, &net_interrupt, 0, dev->name, dev); ++#else ++ ret = request_irq(dev->irq, &net_interrupt, IRQF_DISABLED | IRQF_TRIGGER_HIGH, dev->name, dev); ++#endif + if (ret) { + if (net_debug) + printk(KERN_DEBUG "cs89x0: request_irq(%d) failed\n", dev->irq); +Index: git/include/asm-arm/arch-s3c2410/regs-ac97.h +=================================================================== +--- git.orig/include/asm-arm/arch-s3c2410/regs-ac97.h 2007-03-27 13:25:14.000000000 +0100 ++++ git/include/asm-arm/arch-s3c2410/regs-ac97.h 2007-03-27 13:44:19.000000000 +0100 +@@ -13,11 +13,55 @@ + #ifndef __ASM_ARCH_REGS_AC97_H + #define __ASM_ARCH_REGS_AC97_H __FILE__ + +-#define S3C_AC97_GLBCTRL (0x00) +-#define S3C_AC97_GLBSTAT (0x04) +-#define S3C_AC97_CODEC_CMD (0x08) +-#define S3C_AC97_PCM_ADDR (0x10) +-#define S3C_AC97_PCM_DATA (0x18) +-#define S3C_AC97_MIC_DATA (0x1C) ++#define S3C_AC97_GLBCTRL (0x00) ++ ++#define S3C_AC97_GLBCTRL_CODECREADYIE (1<<22) ++#define S3C_AC97_GLBCTRL_PCMOUTURIE (1<<21) ++#define S3C_AC97_GLBCTRL_PCMINORIE (1<<20) ++#define S3C_AC97_GLBCTRL_MICINORIE (1<<19) ++#define S3C_AC97_GLBCTRL_PCMOUTTIE (1<<18) ++#define S3C_AC97_GLBCTRL_PCMINTIE (1<<17) ++#define S3C_AC97_GLBCTRL_MICINTIE (1<<16) ++#define S3C_AC97_GLBCTRL_PCMOUTTM_OFF (0<<12) ++#define S3C_AC97_GLBCTRL_PCMOUTTM_PIO (1<<12) ++#define S3C_AC97_GLBCTRL_PCMOUTTM_DMA (2<<12) ++#define S3C_AC97_GLBCTRL_PCMOUTTM_MASK (3<<12) ++#define S3C_AC97_GLBCTRL_PCMINTM_OFF (0<<10) ++#define S3C_AC97_GLBCTRL_PCMINTM_PIO (1<<10) ++#define S3C_AC97_GLBCTRL_PCMINTM_DMA (2<<10) ++#define S3C_AC97_GLBCTRL_PCMINTM_MASK (3<<10) ++#define S3C_AC97_GLBCTRL_MICINTM_OFF (0<<8) ++#define S3C_AC97_GLBCTRL_MICINTM_PIO (1<<8) ++#define S3C_AC97_GLBCTRL_MICINTM_DMA (2<<8) ++#define S3C_AC97_GLBCTRL_MICINTM_MASK (3<<8) ++#define S3C_AC97_GLBCTRL_TRANSFERDATAENABLE (1<<3) ++#define S3C_AC97_GLBCTRL_ACLINKON (1<<2) ++#define S3C_AC97_GLBCTRL_WARMRESET (1<<1) ++#define S3C_AC97_GLBCTRL_COLDRESET (1<<0) ++ ++#define S3C_AC97_GLBSTAT (0x04) ++ ++#define S3C_AC97_GLBSTAT_CODECREADY (1<<22) ++#define S3C_AC97_GLBSTAT_PCMOUTUR (1<<21) ++#define S3C_AC97_GLBSTAT_PCMINORI (1<<20) ++#define S3C_AC97_GLBSTAT_MICINORI (1<<19) ++#define S3C_AC97_GLBSTAT_PCMOUTTI (1<<18) ++#define S3C_AC97_GLBSTAT_PCMINTI (1<<17) ++#define S3C_AC97_GLBSTAT_MICINTI (1<<16) ++#define S3C_AC97_GLBSTAT_MAINSTATE_IDLE (0<<0) ++#define S3C_AC97_GLBSTAT_MAINSTATE_INIT (1<<0) ++#define S3C_AC97_GLBSTAT_MAINSTATE_READY (2<<0) ++#define S3C_AC97_GLBSTAT_MAINSTATE_ACTIVE (3<<0) ++#define S3C_AC97_GLBSTAT_MAINSTATE_LP (4<<0) ++#define S3C_AC97_GLBSTAT_MAINSTATE_WARM (5<<0) ++ ++#define S3C_AC97_CODEC_CMD (0x08) ++ ++#define S3C_AC97_CODEC_CMD_READ (1<<23) ++ ++#define S3C_AC97_STAT (0x0c) ++#define S3C_AC97_PCM_ADDR (0x10) ++#define S3C_AC97_PCM_DATA (0x18) ++#define S3C_AC97_MIC_DATA (0x1C) + + #endif /* __ASM_ARCH_REGS_AC97_H */ diff --git a/packages/linux/linux-smdk2443/defconfig-smdk2443 b/packages/linux/linux-smdk2443/defconfig-smdk2443 new file mode 100644 index 0000000000..e8aea8c586 --- /dev/null +++ b/packages/linux/linux-smdk2443/defconfig-smdk2443 @@ -0,0 +1,1480 @@ +# +# Automatically generated make config: don't edit +# Linux kernel version: 2.6.21-rc2 +# Tue Mar 13 10:50:46 2007 +# +CONFIG_ARM=y +CONFIG_SYS_SUPPORTS_APM_EMULATION=y +# CONFIG_GENERIC_TIME is not set +CONFIG_MMU=y +CONFIG_NO_IOPORT=y +CONFIG_GENERIC_HARDIRQS=y +CONFIG_TRACE_IRQFLAGS_SUPPORT=y +CONFIG_HARDIRQS_SW_RESEND=y +CONFIG_GENERIC_IRQ_PROBE=y +CONFIG_RWSEM_GENERIC_SPINLOCK=y +# CONFIG_ARCH_HAS_ILOG2_U32 is not set +# CONFIG_ARCH_HAS_ILOG2_U64 is not set +CONFIG_GENERIC_HWEIGHT=y +CONFIG_GENERIC_CALIBRATE_DELAY=y +CONFIG_ZONE_DMA=y +CONFIG_VECTORS_BASE=0xffff0000 +CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" + +# +# Code maturity level options +# +CONFIG_EXPERIMENTAL=y +CONFIG_BROKEN_ON_SMP=y +CONFIG_INIT_ENV_ARG_LIMIT=32 + +# +# General setup +# +CONFIG_LOCALVERSION="" +CONFIG_LOCALVERSION_AUTO=y +CONFIG_SWAP=y +CONFIG_SYSVIPC=y +# CONFIG_IPC_NS is not set +CONFIG_SYSVIPC_SYSCTL=y +# CONFIG_POSIX_MQUEUE is not set +# CONFIG_BSD_PROCESS_ACCT is not set +# CONFIG_TASKSTATS is not set +# CONFIG_UTS_NS is not set +# CONFIG_AUDIT is not set +# CONFIG_IKCONFIG is not set +CONFIG_SYSFS_DEPRECATED=y +# CONFIG_RELAY is not set +CONFIG_INITRAMFS_SOURCE="" +CONFIG_CC_OPTIMIZE_FOR_SIZE=y +CONFIG_SYSCTL=y +# CONFIG_EMBEDDED is not set +CONFIG_UID16=y +CONFIG_SYSCTL_SYSCALL=y +CONFIG_KALLSYMS=y +# CONFIG_KALLSYMS_ALL is not set +# CONFIG_KALLSYMS_EXTRA_PASS is not set +CONFIG_HOTPLUG=y +CONFIG_PRINTK=y +CONFIG_BUG=y +CONFIG_ELF_CORE=y +CONFIG_BASE_FULL=y +CONFIG_FUTEX=y +CONFIG_EPOLL=y +CONFIG_SHMEM=y +CONFIG_SLAB=y +CONFIG_VM_EVENT_COUNTERS=y +CONFIG_RT_MUTEXES=y +# CONFIG_TINY_SHMEM is not set +CONFIG_BASE_SMALL=0 +# CONFIG_SLOB is not set + +# +# Loadable module support +# +CONFIG_MODULES=y +CONFIG_MODULE_UNLOAD=y +# CONFIG_MODULE_FORCE_UNLOAD is not set +# CONFIG_MODVERSIONS is not set +# CONFIG_MODULE_SRCVERSION_ALL is not set +CONFIG_KMOD=y + +# +# Block layer +# +CONFIG_BLOCK=y +# CONFIG_LBD is not set +# CONFIG_BLK_DEV_IO_TRACE is not set +# CONFIG_LSF is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y +CONFIG_DEFAULT_AS=y +# CONFIG_DEFAULT_DEADLINE is not set +# CONFIG_DEFAULT_CFQ is not set +# CONFIG_DEFAULT_NOOP is not set +CONFIG_DEFAULT_IOSCHED="anticipatory" + +# +# System Type +# +# CONFIG_ARCH_AAEC2000 is not set +# CONFIG_ARCH_INTEGRATOR is not set +# CONFIG_ARCH_REALVIEW is not set +# CONFIG_ARCH_VERSATILE is not set +# CONFIG_ARCH_AT91 is not set +# CONFIG_ARCH_CLPS7500 is not set +# CONFIG_ARCH_CLPS711X is not set +# CONFIG_ARCH_CO285 is not set +# CONFIG_ARCH_EBSA110 is not set +# CONFIG_ARCH_EP93XX is not set +# CONFIG_ARCH_FOOTBRIDGE is not set +# CONFIG_ARCH_NETX is not set +# CONFIG_ARCH_H720X is not set +# CONFIG_ARCH_IMX is not set +# CONFIG_ARCH_IOP32X is not set +# CONFIG_ARCH_IOP33X is not set +# CONFIG_ARCH_IOP13XX is not set +# CONFIG_ARCH_IXP4XX is not set +# CONFIG_ARCH_IXP2000 is not set +# CONFIG_ARCH_IXP23XX is not set +# CONFIG_ARCH_L7200 is not set +# CONFIG_ARCH_NS9XXX is not set +# CONFIG_ARCH_PNX4008 is not set +# CONFIG_ARCH_PXA is not set +# CONFIG_ARCH_RPC is not set +# CONFIG_ARCH_SA1100 is not set +CONFIG_ARCH_S3C2410=y +# CONFIG_ARCH_SHARK is not set +# CONFIG_ARCH_LH7A40X is not set +# CONFIG_ARCH_OMAP is not set +CONFIG_PLAT_S3C24XX=y +CONFIG_CPU_S3C244X=y +CONFIG_PM_SIMTEC=y +# CONFIG_S3C2410_BOOT_WATCHDOG is not set +# CONFIG_S3C2410_BOOT_ERROR_RESET is not set +# CONFIG_S3C2410_PM_DEBUG is not set +# CONFIG_S3C2410_PM_CHECK is not set +CONFIG_S3C2410_LOWLEVEL_UART_PORT=0 +CONFIG_S3C2410_DMA=y +CONFIG_S3C2410_DMA_DEBUG=n +CONFIG_MACH_SMDK=y + +# +# S3C2400 Machines +# +CONFIG_CPU_S3C2410=y +CONFIG_CPU_S3C2410_DMA=y +CONFIG_S3C2410_PM=y +CONFIG_S3C2410_GPIO=y +CONFIG_S3C2410_CLOCK=y + +# +# S3C2410 Machines +# +CONFIG_ARCH_SMDK2410=y +CONFIG_ARCH_H1940=y +CONFIG_PM_H1940=y +CONFIG_MACH_N30=y +CONFIG_ARCH_BAST=y +CONFIG_MACH_OTOM=y +# CONFIG_MACH_AML_M5900 is not set +CONFIG_BAST_PC104_IRQ=y +CONFIG_MACH_VR1000=y +# CONFIG_MACH_QT2410 is not set +CONFIG_CPU_S3C2412=y +CONFIG_S3C2412_DMA=y +CONFIG_S3C2412_PM=y + +# +# S3C2412 Machines +# +CONFIG_MACH_SMDK2413=y +CONFIG_MACH_S3C2413=y +# CONFIG_MACH_VSTMS is not set +CONFIG_CPU_S3C2440=y +CONFIG_S3C2440_DMA=y + +# +# S3C2440 Machines +# +CONFIG_MACH_ANUBIS=y +CONFIG_MACH_OSIRIS=y +CONFIG_MACH_RX3715=y +CONFIG_ARCH_S3C2440=y +CONFIG_MACH_NEXCODER_2440=y +CONFIG_SMDK2440_CPU2440=y +CONFIG_CPU_S3C2442=y + +# +# S3C2442 Machines +# +CONFIG_SMDK2440_CPU2442=y +CONFIG_CPU_S3C2443=y +CONFIG_S3C2443_DMA=y + +# +# S3C2443 Machines +# +CONFIG_MACH_SMDK2443=y + +# +# Processor Type +# +CONFIG_CPU_32=y +CONFIG_CPU_ARM920T=y +CONFIG_CPU_ARM926T=y +CONFIG_CPU_32v4T=y +CONFIG_CPU_32v5=y +CONFIG_CPU_ABRT_EV4T=y +CONFIG_CPU_ABRT_EV5TJ=y +CONFIG_CPU_CACHE_V4WT=y +CONFIG_CPU_CACHE_VIVT=y +CONFIG_CPU_COPY_V4WB=y +CONFIG_CPU_TLB_V4WBI=y +CONFIG_CPU_CP15=y +CONFIG_CPU_CP15_MMU=y + +# +# Processor Features +# +# CONFIG_ARM_THUMB is not set +# CONFIG_CPU_ICACHE_DISABLE is not set +# CONFIG_CPU_DCACHE_DISABLE is not set +# CONFIG_CPU_DCACHE_WRITETHROUGH is not set +# CONFIG_CPU_CACHE_ROUND_ROBIN is not set +# CONFIG_OUTER_CACHE is not set + +# +# Bus support +# +CONFIG_ISA=y + +# +# PCCARD (PCMCIA/CardBus) support +# +# CONFIG_PCCARD is not set + +# +# Kernel Features +# +# CONFIG_PREEMPT is not set +# CONFIG_NO_IDLE_HZ is not set +CONFIG_HZ=200 +CONFIG_AEABI=y +CONFIG_OABI_COMPAT=y +# CONFIG_ARCH_DISCONTIGMEM_ENABLE is not set +CONFIG_SELECT_MEMORY_MODEL=y +CONFIG_FLATMEM_MANUAL=y +# CONFIG_DISCONTIGMEM_MANUAL is not set +# CONFIG_SPARSEMEM_MANUAL is not set +CONFIG_FLATMEM=y +CONFIG_FLAT_NODE_MEM_MAP=y +# CONFIG_SPARSEMEM_STATIC is not set +CONFIG_SPLIT_PTLOCK_CPUS=4096 +# CONFIG_RESOURCES_64BIT is not set +CONFIG_ZONE_DMA_FLAG=1 +CONFIG_ALIGNMENT_TRAP=y + +# +# Boot options +# +CONFIG_ZBOOT_ROM_TEXT=0x0 +CONFIG_ZBOOT_ROM_BSS=0x0 +CONFIG_CMDLINE="root=/dev/nfs ip=auto cs89x0_media=rj45 rw console=ttySAC0,115200" +# CONFIG_XIP_KERNEL is not set +# CONFIG_KEXEC is not set + +# +# Floating point emulation +# + +# +# At least one emulation must be selected +# +CONFIG_FPE_NWFPE=y +# CONFIG_FPE_NWFPE_XP is not set +# CONFIG_FPE_FASTFPE is not set +# CONFIG_VFP is not set + +# +# Userspace binary formats +# +CONFIG_BINFMT_ELF=y +CONFIG_BINFMT_AOUT=y +# CONFIG_BINFMT_MISC is not set + +# +# Power management options +# +CONFIG_PM=y +CONFIG_PM_LEGACY=y +# CONFIG_PM_DEBUG is not set +# CONFIG_PM_SYSFS_DEPRECATED is not set +# CONFIG_APM_EMULATION is not set + +# +# Networking +# +CONFIG_NET=y + +# +# Networking options +# +# CONFIG_NETDEBUG is not set +# CONFIG_PACKET is not set +CONFIG_UNIX=y +CONFIG_XFRM=y +# CONFIG_XFRM_USER is not set +# CONFIG_XFRM_SUB_POLICY is not set +# CONFIG_XFRM_MIGRATE is not set +# CONFIG_NET_KEY is not set +CONFIG_INET=y +# CONFIG_IP_MULTICAST is not set +# CONFIG_IP_ADVANCED_ROUTER is not set +CONFIG_IP_FIB_HASH=y +CONFIG_IP_PNP=y +CONFIG_IP_PNP_DHCP=y +CONFIG_IP_PNP_BOOTP=y +# CONFIG_IP_PNP_RARP is not set +# CONFIG_NET_IPIP is not set +# CONFIG_NET_IPGRE is not set +# CONFIG_ARPD is not set +# CONFIG_SYN_COOKIES is not set +# CONFIG_INET_AH is not set +# CONFIG_INET_ESP is not set +# CONFIG_INET_IPCOMP is not set +# CONFIG_INET_XFRM_TUNNEL is not set +# CONFIG_INET_TUNNEL is not set +CONFIG_INET_XFRM_MODE_TRANSPORT=y +CONFIG_INET_XFRM_MODE_TUNNEL=y +CONFIG_INET_XFRM_MODE_BEET=y +CONFIG_INET_DIAG=y +CONFIG_INET_TCP_DIAG=y +# CONFIG_TCP_CONG_ADVANCED is not set +CONFIG_TCP_CONG_CUBIC=y +CONFIG_DEFAULT_TCP_CONG="cubic" +# CONFIG_TCP_MD5SIG is not set +# CONFIG_IPV6 is not set +# CONFIG_INET6_XFRM_TUNNEL is not set +# CONFIG_INET6_TUNNEL is not set +# CONFIG_NETWORK_SECMARK is not set +# CONFIG_NETFILTER is not set + +# +# DCCP Configuration (EXPERIMENTAL) +# +# CONFIG_IP_DCCP is not set + +# +# SCTP Configuration (EXPERIMENTAL) +# +# CONFIG_IP_SCTP is not set + +# +# TIPC Configuration (EXPERIMENTAL) +# +# CONFIG_TIPC is not set +# CONFIG_ATM is not set +# CONFIG_BRIDGE is not set +# CONFIG_VLAN_8021Q is not set +# CONFIG_DECNET is not set +# CONFIG_LLC2 is not set +# CONFIG_IPX is not set +# CONFIG_ATALK is not set +# CONFIG_X25 is not set +# CONFIG_LAPB is not set +# CONFIG_ECONET is not set +# CONFIG_WAN_ROUTER is not set + +# +# QoS and/or fair queueing +# +# CONFIG_NET_SCHED is not set + +# +# Network testing +# +# CONFIG_NET_PKTGEN is not set +# CONFIG_HAMRADIO is not set +# CONFIG_IRDA is not set +# CONFIG_BT is not set +# CONFIG_IEEE80211 is not set + +# +# Device Drivers +# + +# +# Generic Driver Options +# +CONFIG_STANDALONE=y +CONFIG_PREVENT_FIRMWARE_BUILD=y +# CONFIG_FW_LOADER is not set +# CONFIG_DEBUG_DRIVER is not set +# CONFIG_DEBUG_DEVRES is not set +# CONFIG_SYS_HYPERVISOR is not set + +# +# Connector - unified userspace <-> kernelspace linker +# +# CONFIG_CONNECTOR is not set + +# +# Memory Technology Devices (MTD) +# +CONFIG_MTD=y +# CONFIG_MTD_DEBUG is not set +# CONFIG_MTD_CONCAT is not set +CONFIG_MTD_PARTITIONS=y +CONFIG_MTD_REDBOOT_PARTS=y +CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK=-1 +CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED=y +# CONFIG_MTD_REDBOOT_PARTS_READONLY is not set +CONFIG_MTD_CMDLINE_PARTS=y +# CONFIG_MTD_AFS_PARTS is not set + +# +# User Modules And Translation Layers +# +CONFIG_MTD_CHAR=y +CONFIG_MTD_BLKDEVS=y +CONFIG_MTD_BLOCK=y +# CONFIG_FTL is not set +# CONFIG_NFTL is not set +# CONFIG_INFTL is not set +# CONFIG_RFD_FTL is not set +# CONFIG_SSFDC is not set + +# +# RAM/ROM/Flash chip drivers +# +CONFIG_MTD_CFI=y +CONFIG_MTD_JEDECPROBE=y +CONFIG_MTD_GEN_PROBE=y +# CONFIG_MTD_CFI_ADV_OPTIONS is not set +CONFIG_MTD_MAP_BANK_WIDTH_1=y +CONFIG_MTD_MAP_BANK_WIDTH_2=y +CONFIG_MTD_MAP_BANK_WIDTH_4=y +# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set +CONFIG_MTD_MAP_BANK_WIDTH_16=y +# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set +CONFIG_MTD_CFI_I1=y +CONFIG_MTD_CFI_I2=y +# CONFIG_MTD_CFI_I4 is not set +# CONFIG_MTD_CFI_I8 is not set +CONFIG_MTD_CFI_INTELEXT=y +CONFIG_MTD_CFI_AMDSTD=y +# CONFIG_MTD_CFI_STAA is not set +CONFIG_MTD_CFI_UTIL=y +# CONFIG_MTD_RAM is not set +CONFIG_MTD_ROM=y +# CONFIG_MTD_ABSENT is not set +# CONFIG_MTD_OBSOLETE_CHIPS is not set + +# +# Mapping drivers for chip access +# +# CONFIG_MTD_COMPLEX_MAPPINGS is not set +# CONFIG_MTD_PHYSMAP is not set +# CONFIG_MTD_ARM_INTEGRATOR is not set +# CONFIG_MTD_IMPA7 is not set +CONFIG_MTD_BAST=y +CONFIG_MTD_BAST_MAXSIZE=4 +# CONFIG_MTD_PLATRAM is not set + +# +# Self-contained MTD device drivers +# +# CONFIG_MTD_DATAFLASH is not set +# CONFIG_MTD_M25P80 is not set +# CONFIG_MTD_SLRAM is not set +# CONFIG_MTD_PHRAM is not set +# CONFIG_MTD_MTDRAM is not set +# CONFIG_MTD_BLOCK2MTD is not set + +# +# Disk-On-Chip Device Drivers +# +# CONFIG_MTD_DOC2000 is not set +# CONFIG_MTD_DOC2001 is not set +# CONFIG_MTD_DOC2001PLUS is not set + +# +# NAND Flash Device Drivers +# +CONFIG_MTD_NAND=y +# CONFIG_MTD_NAND_VERIFY_WRITE is not set +# CONFIG_MTD_NAND_ECC_SMC is not set +CONFIG_MTD_NAND_IDS=y +CONFIG_MTD_NAND_S3C2410=y +# CONFIG_MTD_NAND_S3C2410_DEBUG is not set +# CONFIG_MTD_NAND_S3C2410_HWECC is not set +# CONFIG_MTD_NAND_S3C2410_CLKSTOP is not set +# CONFIG_MTD_NAND_DISKONCHIP is not set +# CONFIG_MTD_NAND_NANDSIM is not set + +# +# OneNAND Flash Device Drivers +# +# CONFIG_MTD_ONENAND is not set + +# +# Parallel port support +# +CONFIG_PARPORT=y +# CONFIG_PARPORT_PC is not set +# CONFIG_PARPORT_GSC is not set +# CONFIG_PARPORT_AX88796 is not set +CONFIG_PARPORT_1284=y + +# +# Plug and Play support +# +# CONFIG_PNP is not set +# CONFIG_PNPACPI is not set + +# +# Block devices +# +# CONFIG_BLK_DEV_COW_COMMON is not set +CONFIG_BLK_DEV_LOOP=y +# CONFIG_BLK_DEV_CRYPTOLOOP is not set +CONFIG_BLK_DEV_NBD=m +# CONFIG_BLK_DEV_UB is not set +CONFIG_BLK_DEV_RAM=y +CONFIG_BLK_DEV_RAM_COUNT=16 +CONFIG_BLK_DEV_RAM_SIZE=4096 +CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024 +CONFIG_BLK_DEV_INITRD=y +# CONFIG_CDROM_PKTCDVD is not set +CONFIG_ATA_OVER_ETH=m + +# +# ATA/ATAPI/MFM/RLL support +# +CONFIG_IDE=y +CONFIG_BLK_DEV_IDE=y + +# +# Please see Documentation/ide.txt for help/info on IDE drives +# +# CONFIG_BLK_DEV_IDE_SATA is not set +CONFIG_BLK_DEV_IDEDISK=y +# CONFIG_IDEDISK_MULTI_MODE is not set +CONFIG_BLK_DEV_IDECD=y +CONFIG_BLK_DEV_IDETAPE=m +CONFIG_BLK_DEV_IDEFLOPPY=m +# CONFIG_IDE_TASK_IOCTL is not set + +# +# IDE chipset support/bugfixes +# +CONFIG_IDE_GENERIC=y +# CONFIG_IDE_ARM is not set +CONFIG_BLK_DEV_IDE_BAST=y +# CONFIG_IDE_CHIPSETS is not set +# CONFIG_BLK_DEV_IDEDMA is not set +# CONFIG_IDEDMA_AUTO is not set +# CONFIG_BLK_DEV_HD is not set + +# +# SCSI device support +# +# CONFIG_RAID_ATTRS is not set +# CONFIG_SCSI is not set +# CONFIG_SCSI_NETLINK is not set + +# +# Serial ATA (prod) and Parallel ATA (experimental) drivers +# +# CONFIG_ATA is not set + +# +# Multi-device support (RAID and LVM) +# +# CONFIG_MD is not set + +# +# Fusion MPT device support +# +# CONFIG_FUSION is not set + +# +# IEEE 1394 (FireWire) support +# + +# +# I2O device support +# + +# +# Network device support +# +CONFIG_NETDEVICES=y +# CONFIG_DUMMY is not set +# CONFIG_BONDING is not set +# CONFIG_EQUALIZER is not set +# CONFIG_TUN is not set + +# +# ARCnet devices +# +# CONFIG_ARCNET is not set + +# +# PHY device support +# +# CONFIG_PHYLIB is not set + +# +# Ethernet (10 or 100Mbit) +# +CONFIG_NET_ETHERNET=y +CONFIG_MII=y +# CONFIG_NET_VENDOR_3COM is not set +# CONFIG_NET_VENDOR_SMC is not set +# CONFIG_SMC91X is not set +# CONFIG_DM9000 is not set +# CONFIG_NET_VENDOR_RACAL is not set +# CONFIG_AT1700 is not set +# CONFIG_DEPCA is not set +# CONFIG_HP100 is not set +# CONFIG_NET_ISA is not set +CONFIG_NET_PCI=y +# CONFIG_AC3200 is not set +# CONFIG_APRICOT is not set +CONFIG_CS89x0=y +# CONFIG_NET_POCKET is not set + +# +# Ethernet (1000 Mbit) +# + +# +# Ethernet (10000 Mbit) +# + +# +# Token Ring devices +# +# CONFIG_TR is not set + +# +# Wireless LAN (non-hamradio) +# +# CONFIG_NET_RADIO is not set + +# +# Wan interfaces +# +# CONFIG_WAN is not set +# CONFIG_PLIP is not set +# CONFIG_PPP is not set +# CONFIG_SLIP is not set +# CONFIG_SHAPER is not set +# CONFIG_NETCONSOLE is not set +# CONFIG_NETPOLL is not set +# CONFIG_NET_POLL_CONTROLLER is not set + +# +# ISDN subsystem +# +# CONFIG_ISDN is not set + +# +# Input device support +# +CONFIG_INPUT=y +# CONFIG_INPUT_FF_MEMLESS is not set + +# +# Userland interfaces +# +CONFIG_INPUT_MOUSEDEV=y +CONFIG_INPUT_MOUSEDEV_PSAUX=y +CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024 +CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 +# CONFIG_INPUT_JOYDEV is not set +CONFIG_INPUT_TSDEV=y +CONFIG_INPUT_TSDEV_SCREEN_X=240 +CONFIG_INPUT_TSDEV_SCREEN_Y=320 +CONFIG_INPUT_EVDEV=y +# CONFIG_INPUT_EVBUG is not set + +# +# Input Device Drivers +# +CONFIG_INPUT_KEYBOARD=y +CONFIG_KEYBOARD_ATKBD=y +# CONFIG_KEYBOARD_SUNKBD is not set +# CONFIG_KEYBOARD_LKKBD is not set +# CONFIG_KEYBOARD_XTKBD is not set +# CONFIG_KEYBOARD_NEWTON is not set +# CONFIG_KEYBOARD_STOWAWAY is not set +# CONFIG_KEYBOARD_GPIO is not set +CONFIG_INPUT_MOUSE=y +CONFIG_MOUSE_PS2=y +# CONFIG_MOUSE_SERIAL is not set +# CONFIG_MOUSE_INPORT is not set +# CONFIG_MOUSE_LOGIBM is not set +# CONFIG_MOUSE_PC110PAD is not set +# CONFIG_MOUSE_VSXXXAA is not set +# CONFIG_INPUT_JOYSTICK is not set +CONFIG_INPUT_TOUCHSCREEN=y +# CONFIG_TOUCHSCREEN_ADS7846 is not set +# CONFIG_TOUCHSCREEN_GUNZE is not set +# CONFIG_TOUCHSCREEN_ELO is not set +# CONFIG_TOUCHSCREEN_MTOUCH is not set +# CONFIG_TOUCHSCREEN_MK712 is not set +# CONFIG_TOUCHSCREEN_PENMOUNT is not set +# CONFIG_TOUCHSCREEN_TOUCHRIGHT is not set +# CONFIG_TOUCHSCREEN_TOUCHWIN is not set +# CONFIG_TOUCHSCREEN_UCB1400 is not set +# CONFIG_INPUT_MISC is not set + +# +# Hardware I/O ports +# +CONFIG_SERIO=y +CONFIG_SERIO_SERPORT=y +# CONFIG_SERIO_PARKBD is not set +CONFIG_SERIO_LIBPS2=y +# CONFIG_SERIO_RAW is not set +# CONFIG_GAMEPORT is not set + +# +# Character devices +# +CONFIG_VT=y +CONFIG_VT_CONSOLE=y +CONFIG_HW_CONSOLE=y +# CONFIG_VT_HW_CONSOLE_BINDING is not set +CONFIG_SERIAL_NONSTANDARD=y +# CONFIG_COMPUTONE is not set +# CONFIG_ROCKETPORT is not set +# CONFIG_CYCLADES is not set +# CONFIG_DIGIEPCA is not set +# CONFIG_MOXA_INTELLIO is not set +# CONFIG_MOXA_SMARTIO is not set +# CONFIG_MOXA_SMARTIO_NEW is not set +# CONFIG_SYNCLINKMP is not set +# CONFIG_N_HDLC is not set +# CONFIG_RISCOM8 is not set +# CONFIG_SPECIALIX is not set +# CONFIG_SX is not set +# CONFIG_RIO is not set +# CONFIG_STALDRV is not set + +# +# Serial drivers +# +CONFIG_SERIAL_8250=y +CONFIG_SERIAL_8250_CONSOLE=y +CONFIG_SERIAL_8250_NR_UARTS=8 +CONFIG_SERIAL_8250_RUNTIME_UARTS=4 +CONFIG_SERIAL_8250_EXTENDED=y +CONFIG_SERIAL_8250_MANY_PORTS=y +# CONFIG_SERIAL_8250_FOURPORT is not set +# CONFIG_SERIAL_8250_ACCENT is not set +# CONFIG_SERIAL_8250_BOCA is not set +# CONFIG_SERIAL_8250_EXAR_ST16C554 is not set +# CONFIG_SERIAL_8250_HUB6 is not set +CONFIG_SERIAL_8250_SHARE_IRQ=y +# CONFIG_SERIAL_8250_DETECT_IRQ is not set +# CONFIG_SERIAL_8250_RSA is not set + +# +# Non-8250 serial port support +# +CONFIG_SERIAL_S3C2410=y +CONFIG_SERIAL_S3C2410_CONSOLE=y +CONFIG_SERIAL_CORE=y +CONFIG_SERIAL_CORE_CONSOLE=y +CONFIG_UNIX98_PTYS=y +CONFIG_LEGACY_PTYS=y +CONFIG_LEGACY_PTY_COUNT=256 +CONFIG_PRINTER=y +# CONFIG_LP_CONSOLE is not set +CONFIG_PPDEV=y +# CONFIG_TIPAR is not set + +# +# IPMI +# +# CONFIG_IPMI_HANDLER is not set + +# +# Watchdog Cards +# +CONFIG_WATCHDOG=y +# CONFIG_WATCHDOG_NOWAYOUT is not set + +# +# Watchdog Device Drivers +# +# CONFIG_SOFT_WATCHDOG is not set +CONFIG_S3C2410_WATCHDOG=y + +# +# ISA-based Watchdog Cards +# +# CONFIG_PCWATCHDOG is not set +# CONFIG_MIXCOMWD is not set +# CONFIG_WDT is not set + +# +# USB-based Watchdog Cards +# +# CONFIG_USBPCWATCHDOG is not set +CONFIG_HW_RANDOM=y +# CONFIG_NVRAM is not set +# CONFIG_DTLK is not set +# CONFIG_R3964 is not set +# CONFIG_RAW_DRIVER is not set + +# +# TPM devices +# +# CONFIG_TCG_TPM is not set + +# +# I2C support +# +CONFIG_I2C=y +CONFIG_I2C_CHARDEV=m + +# +# I2C Algorithms +# +CONFIG_I2C_ALGOBIT=m +# CONFIG_I2C_ALGOPCF is not set +# CONFIG_I2C_ALGOPCA is not set + +# +# I2C Hardware Bus support +# +# CONFIG_I2C_ELEKTOR is not set +CONFIG_I2C_ISA=m +# CONFIG_I2C_OCORES is not set +# CONFIG_I2C_PARPORT is not set +# CONFIG_I2C_PARPORT_LIGHT is not set +CONFIG_I2C_S3C2410=y +# CONFIG_I2C_STUB is not set +# CONFIG_I2C_PCA_ISA is not set + +# +# Miscellaneous I2C Chip support +# +# CONFIG_SENSORS_DS1337 is not set +# CONFIG_SENSORS_DS1374 is not set +CONFIG_SENSORS_EEPROM=m +# CONFIG_SENSORS_PCF8574 is not set +# CONFIG_SENSORS_PCA9539 is not set +# CONFIG_SENSORS_PCF8591 is not set +# CONFIG_SENSORS_MAX6875 is not set +# CONFIG_I2C_DEBUG_CORE is not set +# CONFIG_I2C_DEBUG_ALGO is not set +# CONFIG_I2C_DEBUG_BUS is not set +# CONFIG_I2C_DEBUG_CHIP is not set + +# +# SPI support +# +CONFIG_SPI=y +# CONFIG_SPI_DEBUG is not set +CONFIG_SPI_MASTER=y + +# +# SPI Master Controller Drivers +# +CONFIG_SPI_BITBANG=y +# CONFIG_SPI_BUTTERFLY is not set +# CONFIG_SPI_S3C24XX is not set +CONFIG_SPI_S3C24XX_GPIO=y + +# +# SPI Protocol Masters +# +# CONFIG_SPI_AT25 is not set + +# +# Dallas's 1-wire bus +# +# CONFIG_W1 is not set + +# +# Hardware Monitoring support +# +CONFIG_HWMON=y +CONFIG_HWMON_VID=m +# CONFIG_SENSORS_ABITUGURU is not set +# CONFIG_SENSORS_ADM1021 is not set +# CONFIG_SENSORS_ADM1025 is not set +# CONFIG_SENSORS_ADM1026 is not set +# CONFIG_SENSORS_ADM1029 is not set +# CONFIG_SENSORS_ADM1031 is not set +# CONFIG_SENSORS_ADM9240 is not set +# CONFIG_SENSORS_ASB100 is not set +# CONFIG_SENSORS_ATXP1 is not set +# CONFIG_SENSORS_DS1621 is not set +# CONFIG_SENSORS_F71805F is not set +# CONFIG_SENSORS_FSCHER is not set +# CONFIG_SENSORS_FSCPOS is not set +# CONFIG_SENSORS_GL518SM is not set +# CONFIG_SENSORS_GL520SM is not set +# CONFIG_SENSORS_IT87 is not set +# CONFIG_SENSORS_LM63 is not set +# CONFIG_SENSORS_LM70 is not set +CONFIG_SENSORS_LM75=m +# CONFIG_SENSORS_LM77 is not set +CONFIG_SENSORS_LM78=m +# CONFIG_SENSORS_LM80 is not set +# CONFIG_SENSORS_LM83 is not set +CONFIG_SENSORS_LM85=m +# CONFIG_SENSORS_LM87 is not set +# CONFIG_SENSORS_LM90 is not set +# CONFIG_SENSORS_LM92 is not set +# CONFIG_SENSORS_MAX1619 is not set +# CONFIG_SENSORS_PC87360 is not set +# CONFIG_SENSORS_PC87427 is not set +# CONFIG_SENSORS_SMSC47M1 is not set +# CONFIG_SENSORS_SMSC47M192 is not set +# CONFIG_SENSORS_SMSC47B397 is not set +# CONFIG_SENSORS_VT1211 is not set +# CONFIG_SENSORS_W83781D is not set +# CONFIG_SENSORS_W83791D is not set +# CONFIG_SENSORS_W83792D is not set +# CONFIG_SENSORS_W83793 is not set +# CONFIG_SENSORS_W83L785TS is not set +# CONFIG_SENSORS_W83627HF is not set +# CONFIG_SENSORS_W83627EHF is not set +# CONFIG_HWMON_DEBUG_CHIP is not set + +# +# Misc devices +# + +# +# Multifunction device drivers +# +# CONFIG_MFD_SM501 is not set + +# +# LED devices +# +# CONFIG_NEW_LEDS is not set + +# +# LED drivers +# + +# +# LED Triggers +# + +# +# Multimedia devices +# +# CONFIG_VIDEO_DEV is not set + +# +# Digital Video Broadcasting Devices +# +# CONFIG_DVB is not set +# CONFIG_USB_DABUSB is not set + +# +# Graphics support +# +CONFIG_BACKLIGHT_LCD_SUPPORT=y +CONFIG_BACKLIGHT_CLASS_DEVICE=m +CONFIG_LCD_CLASS_DEVICE=m +CONFIG_FB=y +# CONFIG_FIRMWARE_EDID is not set +# CONFIG_FB_DDC is not set +CONFIG_FB_CFB_FILLRECT=y +CONFIG_FB_CFB_COPYAREA=y +CONFIG_FB_CFB_IMAGEBLIT=y +# CONFIG_FB_SVGALIB is not set +# CONFIG_FB_MACMODES is not set +# CONFIG_FB_BACKLIGHT is not set +# CONFIG_FB_MODE_HELPERS is not set +# CONFIG_FB_TILEBLITTING is not set + +# +# Frambuffer hardware drivers +# +# CONFIG_FB_S1D13XXX is not set +CONFIG_FB_S3C2410=y +# CONFIG_FB_S3C2410_DEBUG is not set +# CONFIG_FB_VIRTUAL is not set + +# +# Console display driver support +# +# CONFIG_VGA_CONSOLE is not set +# CONFIG_MDA_CONSOLE is not set +CONFIG_DUMMY_CONSOLE=y +CONFIG_FRAMEBUFFER_CONSOLE=y +# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set +# CONFIG_FONTS is not set +CONFIG_FONT_8x8=y +CONFIG_FONT_8x16=y + +# +# Logo configuration +# +CONFIG_LOGO=y +CONFIG_LOGO_LINUX_MONO=y +CONFIG_LOGO_LINUX_VGA16=y +CONFIG_LOGO_LINUX_CLUT224=y + +# +# Sound +# +CONFIG_SOUND=y + +# +# Advanced Linux Sound Architecture +# +CONFIG_SND=m +CONFIG_SND_TIMER=m +CONFIG_SND_PCM=m +# CONFIG_SND_SEQUENCER is not set +CONFIG_SND_OSSEMUL=y +CONFIG_SND_MIXER_OSS=m +CONFIG_SND_PCM_OSS=m +CONFIG_SND_PCM_OSS_PLUGINS=y +# CONFIG_SND_DYNAMIC_MINORS is not set +CONFIG_SND_SUPPORT_OLD_API=y +CONFIG_SND_VERBOSE_PROCFS=y +CONFIG_SND_VERBOSE_PRINTK=y +CONFIG_SND_DEBUG=y +CONFIG_SND_DEBUG_DETECT=y +# CONFIG_SND_PCM_XRUN_DEBUG is not set + +# +# Generic devices +# +CONFIG_SND_AC97_CODEC=m +# CONFIG_SND_DUMMY is not set +# CONFIG_SND_MTPAV is not set +# CONFIG_SND_MTS64 is not set +# CONFIG_SND_SERIAL_U16550 is not set +# CONFIG_SND_MPU401 is not set +# CONFIG_SND_PORTMAN2X4 is not set + +# +# ALSA ARM devices +# + +# +# USB devices +# +# CONFIG_SND_USB_AUDIO is not set + +# +# SoC audio support +# +CONFIG_SND_SOC_AC97_BUS=y +CONFIG_SND_SOC=m + +# +# SoC Platforms +# + +# +# SoC Audio for the Atmel AT91 +# + +# +# SoC Audio for the Intel PXA2xx +# + +# +# SoC Audio for the Samsung S3C24XX +# +CONFIG_SND_S3C24XX_SOC=m +CONFIG_SND_S3C2443_SOC_AC97=m +# CONFIG_SND_S3C24XX_SOC_SMDK2440 is not set +# CONFIG_SND_S3C24XX_SOC_SMDK2440_WM8956 is not set +CONFIG_SND_S3C24XX_SOC_SMDK2443_WM9710=m + +# +# SoC Audio for the Freescale i.MX +# +CONFIG_SND_SOC_AC97_CODEC=m + +# +# Open Sound System +# +# CONFIG_SOUND_PRIME is not set +CONFIG_AC97_BUS=m + +# +# HID Devices +# +CONFIG_HID=y +# CONFIG_HID_DEBUG is not set + +# +# USB support +# +CONFIG_USB_ARCH_HAS_HCD=y +CONFIG_USB_ARCH_HAS_OHCI=y +# CONFIG_USB_ARCH_HAS_EHCI is not set +CONFIG_USB=y +# CONFIG_USB_DEBUG is not set + +# +# Miscellaneous USB options +# +CONFIG_USB_DEVICEFS=y +# CONFIG_USB_DYNAMIC_MINORS is not set +# CONFIG_USB_SUSPEND is not set +# CONFIG_USB_OTG is not set + +# +# USB Host Controller Drivers +# +# CONFIG_USB_ISP116X_HCD is not set +CONFIG_USB_OHCI_HCD=y +# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set +# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set +CONFIG_USB_OHCI_LITTLE_ENDIAN=y +# CONFIG_USB_SL811_HCD is not set + +# +# USB Device Class drivers +# +# CONFIG_USB_ACM is not set +# CONFIG_USB_PRINTER is not set + +# +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' +# + +# +# may also be needed; see USB_STORAGE Help for more information +# +# CONFIG_USB_LIBUSUAL is not set + +# +# USB Input Devices +# +CONFIG_USB_HID=y +# CONFIG_USB_HIDINPUT_POWERBOOK is not set +# CONFIG_HID_FF is not set +# CONFIG_USB_HIDDEV is not set +# CONFIG_USB_AIPTEK is not set +# CONFIG_USB_WACOM is not set +# CONFIG_USB_ACECAD is not set +# CONFIG_USB_KBTAB is not set +# CONFIG_USB_POWERMATE is not set +# CONFIG_USB_TOUCHSCREEN is not set +# CONFIG_USB_YEALINK is not set +# CONFIG_USB_XPAD is not set +# CONFIG_USB_ATI_REMOTE is not set +# CONFIG_USB_ATI_REMOTE2 is not set +# CONFIG_USB_KEYSPAN_REMOTE is not set +# CONFIG_USB_APPLETOUCH is not set +# CONFIG_USB_GTCO is not set + +# +# USB Imaging devices +# +# CONFIG_USB_MDC800 is not set + +# +# USB Network Adapters +# +# CONFIG_USB_CATC is not set +# CONFIG_USB_KAWETH is not set +# CONFIG_USB_PEGASUS is not set +# CONFIG_USB_RTL8150 is not set +# CONFIG_USB_USBNET_MII is not set +# CONFIG_USB_USBNET is not set +CONFIG_USB_MON=y + +# +# USB port drivers +# +# CONFIG_USB_USS720 is not set + +# +# USB Serial Converter support +# +# CONFIG_USB_SERIAL is not set + +# +# USB Miscellaneous drivers +# +# CONFIG_USB_EMI62 is not set +# CONFIG_USB_EMI26 is not set +# CONFIG_USB_ADUTUX is not set +# CONFIG_USB_AUERSWALD is not set +# CONFIG_USB_RIO500 is not set +# CONFIG_USB_LEGOTOWER is not set +# CONFIG_USB_LCD is not set +# CONFIG_USB_BERRY_CHARGE is not set +# CONFIG_USB_LED is not set +# CONFIG_USB_CYPRESS_CY7C63 is not set +# CONFIG_USB_CYTHERM is not set +# CONFIG_USB_PHIDGET is not set +# CONFIG_USB_IDMOUSE is not set +# CONFIG_USB_FTDI_ELAN is not set +# CONFIG_USB_APPLEDISPLAY is not set +# CONFIG_USB_LD is not set +# CONFIG_USB_TRANCEVIBRATOR is not set +# CONFIG_USB_IOWARRIOR is not set +# CONFIG_USB_TEST is not set + +# +# USB DSL modem support +# + +# +# USB Gadget Support +# +# CONFIG_USB_GADGET is not set + +# +# MMC/SD Card support +# +# CONFIG_MMC is not set + +# +# Real Time Clock +# +CONFIG_RTC_LIB=y +# CONFIG_RTC_CLASS is not set + +# +# File systems +# +CONFIG_EXT2_FS=y +# CONFIG_EXT2_FS_XATTR is not set +# CONFIG_EXT2_FS_XIP is not set +CONFIG_EXT3_FS=y +CONFIG_EXT3_FS_XATTR=y +# CONFIG_EXT3_FS_POSIX_ACL is not set +# CONFIG_EXT3_FS_SECURITY is not set +# CONFIG_EXT4DEV_FS is not set +CONFIG_JBD=y +# CONFIG_JBD_DEBUG is not set +CONFIG_FS_MBCACHE=y +# CONFIG_REISERFS_FS is not set +# CONFIG_JFS_FS is not set +# CONFIG_FS_POSIX_ACL is not set +# CONFIG_XFS_FS is not set +# CONFIG_GFS2_FS is not set +# CONFIG_OCFS2_FS is not set +# CONFIG_MINIX_FS is not set +CONFIG_ROMFS_FS=y +CONFIG_INOTIFY=y +CONFIG_INOTIFY_USER=y +# CONFIG_QUOTA is not set +CONFIG_DNOTIFY=y +# CONFIG_AUTOFS_FS is not set +# CONFIG_AUTOFS4_FS is not set +# CONFIG_FUSE_FS is not set + +# +# CD-ROM/DVD Filesystems +# +# CONFIG_ISO9660_FS is not set +# CONFIG_UDF_FS is not set + +# +# DOS/FAT/NT Filesystems +# +CONFIG_FAT_FS=y +CONFIG_MSDOS_FS=y +CONFIG_VFAT_FS=y +CONFIG_FAT_DEFAULT_CODEPAGE=437 +CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" +# CONFIG_NTFS_FS is not set + +# +# Pseudo filesystems +# +CONFIG_PROC_FS=y +CONFIG_PROC_SYSCTL=y +CONFIG_SYSFS=y +CONFIG_TMPFS=y +# CONFIG_TMPFS_POSIX_ACL is not set +# CONFIG_HUGETLB_PAGE is not set +CONFIG_RAMFS=y +# CONFIG_CONFIGFS_FS is not set + +# +# Miscellaneous filesystems +# +# CONFIG_ADFS_FS is not set +# CONFIG_AFFS_FS is not set +# CONFIG_HFS_FS is not set +# CONFIG_HFSPLUS_FS is not set +# CONFIG_BEFS_FS is not set +# CONFIG_BFS_FS is not set +# CONFIG_EFS_FS is not set +CONFIG_JFFS2_FS=y +CONFIG_JFFS2_FS_DEBUG=0 +CONFIG_JFFS2_FS_WRITEBUFFER=y +# CONFIG_JFFS2_SUMMARY is not set +# CONFIG_JFFS2_FS_XATTR is not set +# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set +CONFIG_JFFS2_ZLIB=y +CONFIG_JFFS2_RTIME=y +# CONFIG_JFFS2_RUBIN is not set +# CONFIG_CRAMFS is not set +# CONFIG_VXFS_FS is not set +# CONFIG_HPFS_FS is not set +# CONFIG_QNX4FS_FS is not set +# CONFIG_SYSV_FS is not set +# CONFIG_UFS_FS is not set + +# +# Network File Systems +# +CONFIG_NFS_FS=y +CONFIG_NFS_V3=y +# CONFIG_NFS_V3_ACL is not set +# CONFIG_NFS_V4 is not set +# CONFIG_NFS_DIRECTIO is not set +# CONFIG_NFSD is not set +CONFIG_ROOT_NFS=y +CONFIG_LOCKD=y +CONFIG_LOCKD_V4=y +CONFIG_NFS_COMMON=y +CONFIG_SUNRPC=y +# CONFIG_RPCSEC_GSS_KRB5 is not set +# CONFIG_RPCSEC_GSS_SPKM3 is not set +# CONFIG_SMB_FS is not set +# CONFIG_CIFS is not set +# CONFIG_NCP_FS is not set +# CONFIG_CODA_FS is not set +# CONFIG_AFS_FS is not set +# CONFIG_9P_FS is not set + +# +# Partition Types +# +CONFIG_PARTITION_ADVANCED=y +# CONFIG_ACORN_PARTITION is not set +# CONFIG_OSF_PARTITION is not set +# CONFIG_AMIGA_PARTITION is not set +# CONFIG_ATARI_PARTITION is not set +# CONFIG_MAC_PARTITION is not set +CONFIG_MSDOS_PARTITION=y +CONFIG_BSD_DISKLABEL=y +# CONFIG_MINIX_SUBPARTITION is not set +CONFIG_SOLARIS_X86_PARTITION=y +# CONFIG_UNIXWARE_DISKLABEL is not set +# CONFIG_LDM_PARTITION is not set +# CONFIG_SGI_PARTITION is not set +# CONFIG_ULTRIX_PARTITION is not set +# CONFIG_SUN_PARTITION is not set +# CONFIG_KARMA_PARTITION is not set +# CONFIG_EFI_PARTITION is not set + +# +# Native Language Support +# +CONFIG_NLS=y +CONFIG_NLS_DEFAULT="iso8859-1" +# CONFIG_NLS_CODEPAGE_437 is not set +# CONFIG_NLS_CODEPAGE_737 is not set +# CONFIG_NLS_CODEPAGE_775 is not set +# CONFIG_NLS_CODEPAGE_850 is not set +# CONFIG_NLS_CODEPAGE_852 is not set +# CONFIG_NLS_CODEPAGE_855 is not set +# CONFIG_NLS_CODEPAGE_857 is not set +# CONFIG_NLS_CODEPAGE_860 is not set +# CONFIG_NLS_CODEPAGE_861 is not set +# CONFIG_NLS_CODEPAGE_862 is not set +# CONFIG_NLS_CODEPAGE_863 is not set +# CONFIG_NLS_CODEPAGE_864 is not set +# CONFIG_NLS_CODEPAGE_865 is not set +# CONFIG_NLS_CODEPAGE_866 is not set +# CONFIG_NLS_CODEPAGE_869 is not set +# CONFIG_NLS_CODEPAGE_936 is not set +# CONFIG_NLS_CODEPAGE_950 is not set +# CONFIG_NLS_CODEPAGE_932 is not set +# CONFIG_NLS_CODEPAGE_949 is not set +# CONFIG_NLS_CODEPAGE_874 is not set +# CONFIG_NLS_ISO8859_8 is not set +# CONFIG_NLS_CODEPAGE_1250 is not set +# CONFIG_NLS_CODEPAGE_1251 is not set +# CONFIG_NLS_ASCII is not set +# CONFIG_NLS_ISO8859_1 is not set +# CONFIG_NLS_ISO8859_2 is not set +# CONFIG_NLS_ISO8859_3 is not set +# CONFIG_NLS_ISO8859_4 is not set +# CONFIG_NLS_ISO8859_5 is not set +# CONFIG_NLS_ISO8859_6 is not set +# CONFIG_NLS_ISO8859_7 is not set +# CONFIG_NLS_ISO8859_9 is not set +# CONFIG_NLS_ISO8859_13 is not set +# CONFIG_NLS_ISO8859_14 is not set +# CONFIG_NLS_ISO8859_15 is not set +# CONFIG_NLS_KOI8_R is not set +# CONFIG_NLS_KOI8_U is not set +# CONFIG_NLS_UTF8 is not set + +# +# Distributed Lock Manager +# +# CONFIG_DLM is not set + +# +# Profiling support +# +# CONFIG_PROFILING is not set + +# +# Kernel hacking +# +# CONFIG_PRINTK_TIME is not set +CONFIG_ENABLE_MUST_CHECK=y +CONFIG_MAGIC_SYSRQ=y +# CONFIG_UNUSED_SYMBOLS is not set +# CONFIG_DEBUG_FS is not set +# CONFIG_HEADERS_CHECK is not set +CONFIG_DEBUG_KERNEL=y +# CONFIG_DEBUG_SHIRQ is not set +CONFIG_LOG_BUF_SHIFT=16 +CONFIG_DETECT_SOFTLOCKUP=y +# CONFIG_SCHEDSTATS is not set +# CONFIG_TIMER_STATS is not set +# CONFIG_DEBUG_SLAB is not set +# CONFIG_DEBUG_RT_MUTEXES is not set +# CONFIG_RT_MUTEX_TESTER is not set +# CONFIG_DEBUG_SPINLOCK is not set +CONFIG_DEBUG_MUTEXES=y +# CONFIG_DEBUG_SPINLOCK_SLEEP is not set +# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set +# CONFIG_DEBUG_KOBJECT is not set +CONFIG_DEBUG_BUGVERBOSE=y +CONFIG_DEBUG_INFO=y +# CONFIG_DEBUG_VM is not set +# CONFIG_DEBUG_LIST is not set +CONFIG_FRAME_POINTER=y +CONFIG_FORCED_INLINING=y +# CONFIG_RCU_TORTURE_TEST is not set +# CONFIG_FAULT_INJECTION is not set +CONFIG_DEBUG_USER=y +# CONFIG_DEBUG_ERRORS is not set +CONFIG_DEBUG_LL=y +# CONFIG_DEBUG_ICEDCC is not set +CONFIG_DEBUG_S3C2410_PORT=y +CONFIG_DEBUG_S3C2410_UART=0 + +# +# Security options +# +# CONFIG_KEYS is not set +# CONFIG_SECURITY is not set + +# +# Cryptographic options +# +# CONFIG_CRYPTO is not set + +# +# Library routines +# +CONFIG_BITREVERSE=y +# CONFIG_CRC_CCITT is not set +# CONFIG_CRC16 is not set +CONFIG_CRC32=y +# CONFIG_LIBCRC32C is not set +CONFIG_ZLIB_INFLATE=y +CONFIG_ZLIB_DEFLATE=y +CONFIG_PLIST=y +CONFIG_HAS_IOMEM=y diff --git a/packages/linux/linux-smdk2443_2.6.20+git.bb b/packages/linux/linux-smdk2443_2.6.20+git.bb new file mode 100644 index 0000000000..b97ebd7327 --- /dev/null +++ b/packages/linux/linux-smdk2443_2.6.20+git.bb @@ -0,0 +1,52 @@ +DESCRIPTION = "Linux Kernel for smdk2443 compatible machines" +SECTION = "kernel" +LICENSE = "GPL" +DEPENDS += "u-boot-mkimage-gta01-native" + +PR = "r1" + +GGSRC = "http://www.xora.org.uk/oe/patches/" + +SRC_URI = "git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git;protocol=git;tag=v2.6.21-rc5 \ + file://0020-Add-ASoC-S3C24xx-platform-support.patch;patch=1 \ + file://0021-Add-Neo1973-ASoC-support.patch;patch=1 \ + file://0022-Add-initial-ASoC-SMDK2440-support.patch;patch=1 \ + file://0023-Add-ASoC-SMDK2440-support-for-WM8956-codec.patch;patch=1 \ + file://0034-Export-ac97_dai.patch;patch=1 \ + file://0036-Move-s3c24xx_i2s_dai-and-add-dma_size.patch;patch=1 \ + file://0037-Use-dma_size-parameter-and-fix-buffdone-oops.patch;patch=1 \ + file://0038-Add-smdk2443-s3c2443-ac97-and-wm9710-support.patch;patch=1 \ + file://asoc-mainline.patch;patch=1 \ + file://defconfig-smdk2443" + +S = "${WORKDIR}/git" + +inherit kernel + +COMPATIBLE_HOST = "arm.*-linux" +COMPATIBLE_MACHINE = "smdk2443" +KERNEL_IMAGETYPE = "zImage" + +do_configure() { + install ${WORKDIR}/defconfig-smdk2443 ${S}/.config + oe_runmake oldconfig +} + +do_deploy() { + install -d ${DEPLOY_DIR_IMAGE} + install -m 0644 arch/${ARCH}/boot/${KERNEL_IMAGETYPE} ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${PV}-${MACHINE}-${DATETIME}.bin + rm -f ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${MACHINE}.bin + ln -s ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${PV}-${MACHINE}-${DATETIME}.bin ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${MACHINE}.bin + tar -cvzf ${DEPLOY_DIR_IMAGE}/modules-${KERNEL_RELEASE}-${MACHINE}.tgz -C ${D} lib + ${OBJCOPY} -O binary -R .note -R .comment -S vmlinux linux.bin + rm -f linux.bin.gz + gzip -9 linux.bin + uboot-mkimage -A arm -O linux -T kernel -C gzip -a 30008000 -e 30008000 -n "smdk2443 kernel" -d linux.bin.gz ${DEPLOY_DIR_IMAGE}/uImage-${PV}-${MACHINE}-${DATETIME}.bin + rm -f linux.bin.gz +} + +do_deploy[dirs] = "${S}" + +addtask deploy before do_package after do_install + +KERNEL_RELEASE = "2.6.21-rc5" |