1 From bc6998405cdff2c189ad6e3e18be695087c30909 Mon Sep 17 00:00:00 2001
2 From: Lars-Peter Clausen <lars@metafoo.de>
3 Date: Mon, 11 Jan 2010 04:29:46 +0100
4 Subject: [PATCH] /opt/Projects/openwrt/target/linux/xburst/patches-2.6.31/105-sound.patch
7 include/sound/pcm.h | 26 +++++++++++++-------------
8 sound/core/pcm_native.c | 7 ++++---
9 sound/soc/Kconfig | 1 +
10 sound/soc/Makefile | 1 +
11 sound/soc/codecs/Kconfig | 7 +++++++
12 sound/soc/codecs/Makefile | 2 ++
13 6 files changed, 28 insertions(+), 16 deletions(-)
15 diff --git a/include/sound/pcm.h b/include/sound/pcm.h
16 index de6d981..6ecc22b 100644
17 --- a/include/sound/pcm.h
18 +++ b/include/sound/pcm.h
19 @@ -113,23 +113,23 @@ struct snd_pcm_ops {
20 #define SNDRV_PCM_RATE_5512 (1<<0) /* 5512Hz */
21 #define SNDRV_PCM_RATE_8000 (1<<1) /* 8000Hz */
22 #define SNDRV_PCM_RATE_11025 (1<<2) /* 11025Hz */
23 -#define SNDRV_PCM_RATE_16000 (1<<3) /* 16000Hz */
24 -#define SNDRV_PCM_RATE_22050 (1<<4) /* 22050Hz */
25 -#define SNDRV_PCM_RATE_32000 (1<<5) /* 32000Hz */
26 -#define SNDRV_PCM_RATE_44100 (1<<6) /* 44100Hz */
27 -#define SNDRV_PCM_RATE_48000 (1<<7) /* 48000Hz */
28 -#define SNDRV_PCM_RATE_64000 (1<<8) /* 64000Hz */
29 -#define SNDRV_PCM_RATE_88200 (1<<9) /* 88200Hz */
30 -#define SNDRV_PCM_RATE_96000 (1<<10) /* 96000Hz */
31 -#define SNDRV_PCM_RATE_176400 (1<<11) /* 176400Hz */
32 -#define SNDRV_PCM_RATE_192000 (1<<12) /* 192000Hz */
33 +#define SNDRV_PCM_RATE_12000 (1<<3) /* 12000Hz */
34 +#define SNDRV_PCM_RATE_16000 (1<<4) /* 16000Hz */
35 +#define SNDRV_PCM_RATE_22050 (1<<5) /* 22050Hz */
36 +#define SNDRV_PCM_RATE_24000 (1<<6) /* 24000Hz */
37 +#define SNDRV_PCM_RATE_32000 (1<<7) /* 32000Hz */
38 +#define SNDRV_PCM_RATE_44100 (1<<8) /* 44100Hz */
39 +#define SNDRV_PCM_RATE_48000 (1<<9) /* 48000Hz */
40 +#define SNDRV_PCM_RATE_64000 (1<<10) /* 64000Hz */
41 +#define SNDRV_PCM_RATE_88200 (1<<11) /* 88200Hz */
42 +#define SNDRV_PCM_RATE_96000 (1<<12) /* 96000Hz */
43 +#define SNDRV_PCM_RATE_176400 (1<<13) /* 176400Hz */
44 +#define SNDRV_PCM_RATE_192000 (1<<14) /* 192000Hz */
46 #define SNDRV_PCM_RATE_CONTINUOUS (1<<30) /* continuous range */
47 #define SNDRV_PCM_RATE_KNOT (1<<31) /* supports more non-continuos rates */
49 -#define SNDRV_PCM_RATE_8000_44100 (SNDRV_PCM_RATE_8000|SNDRV_PCM_RATE_11025|\
50 - SNDRV_PCM_RATE_16000|SNDRV_PCM_RATE_22050|\
51 - SNDRV_PCM_RATE_32000|SNDRV_PCM_RATE_44100)
52 +#define SNDRV_PCM_RATE_8000_44100 (SNDRV_PCM_RATE_8000|SNDRV_PCM_RATE_11025|SNDRV_PCM_RATE_12000|SNDRV_PCM_RATE_16000|SNDRV_PCM_RATE_22050|SNDRV_PCM_RATE_24000|SNDRV_PCM_RATE_32000|SNDRV_PCM_RATE_44100)
53 #define SNDRV_PCM_RATE_8000_48000 (SNDRV_PCM_RATE_8000_44100|SNDRV_PCM_RATE_48000)
54 #define SNDRV_PCM_RATE_8000_96000 (SNDRV_PCM_RATE_8000_48000|SNDRV_PCM_RATE_64000|\
55 SNDRV_PCM_RATE_88200|SNDRV_PCM_RATE_96000)
56 diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c
57 index ab73edf..35c22d7 100644
58 --- a/sound/core/pcm_native.c
59 +++ b/sound/core/pcm_native.c
60 @@ -1721,12 +1721,13 @@ static int snd_pcm_hw_rule_sample_bits(struct snd_pcm_hw_params *params,
61 return snd_interval_refine(hw_param_interval(params, rule->var), &t);
64 -#if SNDRV_PCM_RATE_5512 != 1 << 0 || SNDRV_PCM_RATE_192000 != 1 << 12
65 +#if SNDRV_PCM_RATE_5512 != 1 << 0 || SNDRV_PCM_RATE_192000 != 1 << 14
66 #error "Change this table"
69 -static unsigned int rates[] = { 5512, 8000, 11025, 16000, 22050, 32000, 44100,
70 - 48000, 64000, 88200, 96000, 176400, 192000 };
71 +static unsigned int rates[] = { 5512, 8000, 11025, 12000, 16000, 22050, 24000,
72 + 32000, 44100, 48000, 64000, 88200, 96000,
75 const struct snd_pcm_hw_constraint_list snd_pcm_known_rates = {
76 .count = ARRAY_SIZE(rates),
77 diff --git a/sound/soc/Kconfig b/sound/soc/Kconfig
78 index b1749bc..5a7a724 100644
79 --- a/sound/soc/Kconfig
80 +++ b/sound/soc/Kconfig
81 @@ -36,6 +36,7 @@ source "sound/soc/s3c24xx/Kconfig"
82 source "sound/soc/s6000/Kconfig"
83 source "sound/soc/sh/Kconfig"
84 source "sound/soc/txx9/Kconfig"
85 +source "sound/soc/jz4740/Kconfig"
88 source "sound/soc/codecs/Kconfig"
89 diff --git a/sound/soc/Makefile b/sound/soc/Makefile
90 index 0c5eac0..8e7b5cb 100644
91 --- a/sound/soc/Makefile
92 +++ b/sound/soc/Makefile
93 @@ -14,3 +14,4 @@ obj-$(CONFIG_SND_SOC) += s3c24xx/
94 obj-$(CONFIG_SND_SOC) += s6000/
95 obj-$(CONFIG_SND_SOC) += sh/
96 obj-$(CONFIG_SND_SOC) += txx9/
97 +obj-$(CONFIG_SND_SOC) += jz4740/
98 diff --git a/sound/soc/codecs/Kconfig b/sound/soc/codecs/Kconfig
99 index 0edca93..cd5e44a 100644
100 --- a/sound/soc/codecs/Kconfig
101 +++ b/sound/soc/codecs/Kconfig
102 @@ -217,6 +217,13 @@ config SND_SOC_WM9712
103 config SND_SOC_WM9713
106 +config SND_SOC_JZCODEC
107 + tristate "JZ4720/JZ4740 SoC internal codec"
108 + depends on SND_SOC && SOC_JZ4740
110 + Say Y if you want to use internal codec on Ingenic JZ4720/JZ4740 based
114 config SND_SOC_MAX9877
116 diff --git a/sound/soc/codecs/Makefile b/sound/soc/codecs/Makefile
117 index fb4af28..d58b0fa 100644
118 --- a/sound/soc/codecs/Makefile
119 +++ b/sound/soc/codecs/Makefile
120 @@ -44,6 +44,7 @@ snd-soc-wm9705-objs := wm9705.o
121 snd-soc-wm9712-objs := wm9712.o
122 snd-soc-wm9713-objs := wm9713.o
123 snd-soc-wm-hubs-objs := wm_hubs.o
124 +snd-soc-jzcodec-objs := jzcodec.o
127 snd-soc-max9877-objs := max9877.o
128 @@ -94,6 +95,7 @@ obj-$(CONFIG_SND_SOC_WM9705) += snd-soc-wm9705.o
129 obj-$(CONFIG_SND_SOC_WM9712) += snd-soc-wm9712.o
130 obj-$(CONFIG_SND_SOC_WM9713) += snd-soc-wm9713.o
131 obj-$(CONFIG_SND_SOC_WM_HUBS) += snd-soc-wm-hubs.o
132 +obj-$(CONFIG_SND_SOC_JZCODEC) += snd-soc-jzcodec.o
135 obj-$(CONFIG_SND_SOC_MAX9877) += snd-soc-max9877.o