[oe-commits] org.oe.dev linux-openmoko_2.6.22.5.bb : update for kernel, gta02 sound support,

xora commit openembedded-commits at lists.openembedded.org
Sat Nov 10 16:05:46 UTC 2007


linux-openmoko_2.6.22.5.bb : update for kernel, gta02 sound support,
fixed suspend/resume while playing sound. fixed suspend/resume for
vibrator. Moved SCRREV onwards.

Author: xora at openembedded.org
Branch: org.openembedded.dev
Revision: 6fa479793e733c0dcee579fe5abc88f1379e65ca
ViewMTN: http://monotone.openembedded.org/revision/info/6fa479793e733c0dcee579fe5abc88f1379e65ca
Files:
1
packages/linux/linux-openmoko/gta-vibro-pwm-suspend.patch
packages/linux/linux-openmoko/gta02-sound.patch
packages/linux/linux-openmoko/iis-suspend.patch
packages/linux/linux-openmoko/s3c24xx-pcm-suspend.patch
packages/linux/linux-openmoko/soc-core-suspend.patch
conf/distro/include/sane-srcrevs.inc
packages/linux/linux-openmoko_2.6.22.5.bb
Diffs:

#
# mt diff -ra8bbe3231c4a7d1a9014e5fd3c6c20645af1834b -r6fa479793e733c0dcee579fe5abc88f1379e65ca
#
# 
# 
# add_file "packages/linux/linux-openmoko/gta-vibro-pwm-suspend.patch"
#  content [16124a054cd4fc021edb33ec8252418f8e2684b8]
# 
# add_file "packages/linux/linux-openmoko/gta02-sound.patch"
#  content [dc9eb450c1546c84d1510d4b606a7ae621abedeb]
# 
# add_file "packages/linux/linux-openmoko/iis-suspend.patch"
#  content [32e149c8f956579350ce30b669ab7fcca71adc83]
# 
# add_file "packages/linux/linux-openmoko/s3c24xx-pcm-suspend.patch"
#  content [63da8560c9f0b0299c876f514a7d365a73e106ef]
# 
# add_file "packages/linux/linux-openmoko/soc-core-suspend.patch"
#  content [8c71c67eab5c1561242d0fa9f9646690b4adf530]
# 
# patch "conf/distro/include/sane-srcrevs.inc"
#  from [f77e245ef0b0121bd27da5a99090503b3e4bd658]
#    to [5042fe37776f355d5cf0a9f2c171ae0b34a9f9c0]
# 
# patch "packages/linux/linux-openmoko_2.6.22.5.bb"
#  from [a346ec71a75efeddc7673df7f64fd3f4e8dbfad3]
#    to [dc22701bab72ff440fe319db29a5b316f9f44f90]
# 
============================================================
--- packages/linux/linux-openmoko/gta-vibro-pwm-suspend.patch	16124a054cd4fc021edb33ec8252418f8e2684b8
+++ packages/linux/linux-openmoko/gta-vibro-pwm-suspend.patch	16124a054cd4fc021edb33ec8252418f8e2684b8
@@ -0,0 +1,27 @@
+Index: linux-2.6.22/drivers/leds/leds-gta01.c
+===================================================================
+--- linux-2.6.22.orig/drivers/leds/leds-gta01.c	2007-11-09 16:27:03.000000000 +0000
++++ linux-2.6.22/drivers/leds/leds-gta01.c	2007-11-09 16:27:13.000000000 +0000
+@@ -33,6 +33,8 @@
+ 	struct s3c2410_pwm pwm;
+ };
+ 
++static int gta01vib_init_hw(struct gta01_vib_priv *vp);
++
+ static inline struct gta01_vib_priv *pdev_to_vpriv(struct platform_device *dev)
+ {
+ 	return platform_get_drvdata(dev);
+@@ -80,7 +82,13 @@
+ 
+ static int gta01vib_resume(struct platform_device *dev)
+ {
++	struct gta01_vib_priv *vp = pdev_to_vpriv(dev);
++
+ 	led_classdev_resume(&gta01_vib_led);
++
++	if (vp->has_pwm)
++		gta01vib_init_hw(vp);
++
+ 	return 0;
+ }
+ #endif
============================================================
--- packages/linux/linux-openmoko/gta02-sound.patch	dc9eb450c1546c84d1510d4b606a7ae621abedeb
+++ packages/linux/linux-openmoko/gta02-sound.patch	dc9eb450c1546c84d1510d4b606a7ae621abedeb
@@ -0,0 +1,754 @@
+Index: linux-2.6.22/sound/soc/s3c24xx/neo1973_gta02_wm8753.c
+===================================================================
+--- /dev/null	1970-01-01 00:00:00.000000000 +0000
++++ linux-2.6.22/sound/soc/s3c24xx/neo1973_gta02_wm8753.c	2007-11-09 16:21:35.000000000 +0000
+@@ -0,0 +1,667 @@
++/*
++ * neo1973_gta02_wm8753.c  --  SoC audio for Neo1973
++ *
++ * Copyright 2007 OpenMoko Inc
++ * Author: Graeme Gregory <graeme at openmoko.org>
++ * Copyright 2007 Wolfson Microelectronics PLC.
++ * Author: Graeme Gregory <linux at 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
++ *    06th Nov 2007   Changed from GTA01 to GTA02
++ *    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/hardware.h>
++#include <asm/arch/audio.h>
++#include <asm/io.h>
++#include <asm/arch/spi-gpio.h>
++#include <asm/arch/regs-gpioj.h>
++#include <asm/arch/gta02.h>
++#include "../codecs/wm8753.h"
++#include "s3c24xx-pcm.h"
++#include "s3c24xx-i2s.h"
++
++/* 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
++#define NEO_STEREO_TO_HANDSET_SPK	9
++
++static struct snd_soc_machine neo1973_gta02;
++
++static int neo1973_gta02_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_gta02_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_gta02_hifi_ops = {
++	.hw_params = neo1973_gta02_hifi_hw_params,
++	.hw_free = neo1973_gta02_hifi_hw_free,
++};
++
++static int neo1973_gta02_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;
++
++	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_gta02_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_gta02_voice_ops = {
++	.hw_params = neo1973_gta02_voice_hw_params,
++	.hw_free = neo1973_gta02_voice_hw_free,
++};
++
++#define LM4853_AMP 1
++#define LM4853_SPK 2
++
++static u8 lm4853_state=0;
++
++static int lm4853_set_state(struct snd_kcontrol *kcontrol,
++	struct snd_ctl_elem_value *ucontrol)
++{
++	int val = ucontrol->value.integer.value[0];
++
++	if(val) {
++		lm4853_state |= LM4853_AMP;
++		s3c2410_gpio_setpin(GTA02_GPIO_AMP_SHUT,0);
++	} else {
++		lm4853_state &= ~LM4853_AMP;
++		s3c2410_gpio_setpin(GTA02_GPIO_AMP_SHUT,1);
++	}
++
++	return 0;
++}
++
++static int lm4853_get_state(struct snd_kcontrol *kcontrol,
++	struct snd_ctl_elem_value *ucontrol)
++{
++	ucontrol->value.integer.value[0] = lm4853_state & LM4853_AMP;
++
++	return 0;
++}
++
++static int lm4853_set_spk(struct snd_kcontrol *kcontrol,
++	struct snd_ctl_elem_value *ucontrol)
++{
++	int val = ucontrol->value.integer.value[0];
++
++	if(val) {
++		lm4853_state |= LM4853_SPK;
++		s3c2410_gpio_setpin(GTA02_GPIO_HP_IN,0);
++	} else {
++		lm4853_state &= ~LM4853_SPK;
++		s3c2410_gpio_setpin(GTA02_GPIO_HP_IN,1);
++	}
++
++	return 0;
++}
++
++static int lm4853_get_spk(struct snd_kcontrol *kcontrol,
++	struct snd_ctl_elem_value *ucontrol)
++{
++	ucontrol->value.integer.value[0] = (lm4853_state & LM4853_AMP) >> 1;
++
++	return 0;
++}
++
++static int neo1973_gta02_set_stereo_out(struct snd_kcontrol *kcontrol,
++	struct snd_ctl_elem_value *ucontrol)
++{
++	struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
++	int val = ucontrol->value.integer.value[0];
++
++	snd_soc_dapm_set_endpoint(codec, "Stereo Out", val);
++
++	snd_soc_dapm_sync_endpoints(codec);
++
++	return 0;
++}
++
++static int neo1973_gta02_get_stereo_out(struct snd_kcontrol *kcontrol,
++	struct snd_ctl_elem_value *ucontrol)
++{
++	struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
++
++	ucontrol->value.integer.value[0] =
++		snd_soc_dapm_get_endpoint(codec, "Stereo Out");
++
++	return 0;
++}
++
++
++static int neo1973_gta02_set_gsm_out(struct snd_kcontrol *kcontrol,
++	struct snd_ctl_elem_value *ucontrol)
++{
++	struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
++	int val = ucontrol->value.integer.value[0];
++
++	snd_soc_dapm_set_endpoint(codec, "GSM Line Out", val);
++
++	snd_soc_dapm_sync_endpoints(codec);
++
++	return 0;
++}
++
++static int neo1973_gta02_get_gsm_out(struct snd_kcontrol *kcontrol,
++	struct snd_ctl_elem_value *ucontrol)
++{
++	struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
++
++	ucontrol->value.integer.value[0] =
++		snd_soc_dapm_get_endpoint(codec, "GSM Line Out");
++
++	return 0;
++}
++
++static int neo1973_gta02_set_gsm_in(struct snd_kcontrol *kcontrol,
++	struct snd_ctl_elem_value *ucontrol)
++{
++	struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
++	int val = ucontrol->value.integer.value[0];
++
++	snd_soc_dapm_set_endpoint(codec, "GSM Line In", val);
++
++	snd_soc_dapm_sync_endpoints(codec);
++
++	return 0;
++}
++
++static int neo1973_gta02_get_gsm_in(struct snd_kcontrol *kcontrol,
++	struct snd_ctl_elem_value *ucontrol)
++{
++	struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
++
++	ucontrol->value.integer.value[0] =
++		snd_soc_dapm_get_endpoint(codec, "GSM Line In");
++
++	return 0;
++}
++
++static int neo1973_gta02_set_headset_mic(struct snd_kcontrol *kcontrol,
++	struct snd_ctl_elem_value *ucontrol)
++{
++	struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
++	int val = ucontrol->value.integer.value[0];
++
++	snd_soc_dapm_set_endpoint(codec, "Headset Mic", val);
++
++	snd_soc_dapm_sync_endpoints(codec);
++
++	return 0;
++}
++
++static int neo1973_gta02_get_headset_mic(struct snd_kcontrol *kcontrol,
++	struct snd_ctl_elem_value *ucontrol)
++{
++	struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
++
++	ucontrol->value.integer.value[0] =
++		snd_soc_dapm_get_endpoint(codec, "Headset Mic");
++
++	return 0;
++}
++
++static int neo1973_gta02_set_handset_mic(struct snd_kcontrol *kcontrol,
++	struct snd_ctl_elem_value *ucontrol)
++{
++	struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
++	int val = ucontrol->value.integer.value[0];
++
++	snd_soc_dapm_set_endpoint(codec, "Handset Mic", val);
++
++	snd_soc_dapm_sync_endpoints(codec);
++
++	return 0;
++}
++
++static int neo1973_gta02_get_handset_mic(struct snd_kcontrol *kcontrol,
++	struct snd_ctl_elem_value *ucontrol)
++{
++	struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
++
++	ucontrol->value.integer.value[0] =
++		snd_soc_dapm_get_endpoint(codec, "Handset Mic");
++
++	return 0;
++}
++
++static int neo1973_gta02_set_handset_spk(struct snd_kcontrol *kcontrol,
++	struct snd_ctl_elem_value *ucontrol)
++{
++	struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
++	int val = ucontrol->value.integer.value[0];
++
++	snd_soc_dapm_set_endpoint(codec, "Handset Spk", val);
++
++	snd_soc_dapm_sync_endpoints(codec);
++
++	return 0;
++}
++
++static int neo1973_gta02_get_handset_spk(struct snd_kcontrol *kcontrol,
++	struct snd_ctl_elem_value *ucontrol)
++{
++	struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
++
++	ucontrol->value.integer.value[0] =
++		snd_soc_dapm_get_endpoint(codec, "Handset Spk");
++
++	return 0;
++}
++
++static const struct snd_soc_dapm_widget wm8753_dapm_widgets[] = {
++	SND_SOC_DAPM_LINE("Stereo 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("Handset Mic", NULL),
++	SND_SOC_DAPM_SPK("Handset Spk", NULL),
++};
++
++
++/* example machine audio_mapnections */
++static const char* audio_map[][3] = {
++
++	/* Connections to the lm4853 amp */
++	{"Stereo Out", NULL, "LOUT1"},
++	{"Stereo 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, "Handset Mic"},
++
++	/* Call Speaker */
++	{"Handset Spk", NULL, "LOUT2"},
++	{"Handset Spk", NULL, "ROUT2"},
++
++	/* Connect the ALC pins */
++	{"ACIN", NULL, "ACOP"},
++
++	{NULL, NULL, NULL},
++};
++
++static const struct snd_kcontrol_new wm8753_neo1973_gta02_controls[] = {
++	SOC_SINGLE_EXT("DAPM Stereo Out Switch", 0, 0, 1, 0,
++		neo1973_gta02_get_stereo_out,
++		neo1973_gta02_set_stereo_out),
++	SOC_SINGLE_EXT("DAPM GSM Line Out Switch", 1, 0, 1, 0,
++		neo1973_gta02_get_gsm_out,
++		neo1973_gta02_set_gsm_out),
++	SOC_SINGLE_EXT("DAPM GSM Line In Switch", 2, 0, 1, 0,
++		neo1973_gta02_get_gsm_in,
++		neo1973_gta02_set_gsm_in),
++	SOC_SINGLE_EXT("DAPM Headset Mic Switch", 3, 0, 1, 0,
++		neo1973_gta02_get_headset_mic,
++		neo1973_gta02_set_headset_mic),
++	SOC_SINGLE_EXT("DAPM Handset Mic Switch", 4, 0, 1, 0,
++		neo1973_gta02_get_handset_mic,
++		neo1973_gta02_set_handset_mic),
++	SOC_SINGLE_EXT("DAPM Handset Spk Switch", 5, 0, 1, 0,
++		neo1973_gta02_get_handset_spk,
++		neo1973_gta02_set_handset_spk),
++	SOC_SINGLE_EXT("Amp State Switch", 6, 0, 1, 0,
++		lm4853_get_state,
++		lm4853_set_state),
++	SOC_SINGLE_EXT("Amp Spk Switch", 7, 0, 1, 0,
++		lm4853_get_spk,
++		lm4853_set_spk),
++};
++
++/*
++ * This is an example machine initialisation for a wm8753 connected to a
++ * neo1973 GTA02.
++ */
++static int%s
>>> DIFF TRUNCATED @ 16K






More information about the Openembedded-commits mailing list