diff options
author | Mirko Vogt <mirko@openwrt.org> | 2008-12-12 11:58:53 +0000 |
---|---|---|
committer | Mirko Vogt <mirko@openwrt.org> | 2008-12-12 11:58:53 +0000 |
commit | fac7f7f84f3771c5247c7fdee825c092077984f5 (patch) | |
tree | 54644c1229434d7ee13c5872bda4129e34337fc0 /target/linux/s3c24xx/patches-2.6.24/1178-debug-codec-register-setting-sysfs.patch.patch | |
parent | a34279723a9cf0796f9261f2fb90bea18cd95711 (diff) | |
download | master-187ad058-fac7f7f84f3771c5247c7fdee825c092077984f5.tar.gz master-187ad058-fac7f7f84f3771c5247c7fdee825c092077984f5.tar.bz2 master-187ad058-fac7f7f84f3771c5247c7fdee825c092077984f5.zip |
changed Makefile and profiles, added patches for kernel 2.6.24
(stable-branch of Openmoko)
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@13613 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/s3c24xx/patches-2.6.24/1178-debug-codec-register-setting-sysfs.patch.patch')
-rw-r--r-- | target/linux/s3c24xx/patches-2.6.24/1178-debug-codec-register-setting-sysfs.patch.patch | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/target/linux/s3c24xx/patches-2.6.24/1178-debug-codec-register-setting-sysfs.patch.patch b/target/linux/s3c24xx/patches-2.6.24/1178-debug-codec-register-setting-sysfs.patch.patch new file mode 100644 index 0000000000..0fd0008193 --- /dev/null +++ b/target/linux/s3c24xx/patches-2.6.24/1178-debug-codec-register-setting-sysfs.patch.patch @@ -0,0 +1,67 @@ +From 79b99f7d65cce0730998a84d2fb615ae5ad0cff5 Mon Sep 17 00:00:00 2001 +From: Andy Green <andy@openmoko.com> +Date: Wed, 2 Jul 2008 22:39:01 +0100 +Subject: [PATCH] debug-codec-register-setting-sysfs.patch + Allow direct setting of codec registers for super mega meddling power + Signed-off-by: Andy Green <andy@openmoko.com> + +--- + sound/soc/soc-core.c | 35 +++++++++++++++++++++++++++++++++++ + 1 files changed, 35 insertions(+), 0 deletions(-) + +diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c +index 25f7818..9e20333 100644 +--- a/sound/soc/soc-core.c ++++ b/sound/soc/soc-core.c +@@ -928,6 +928,38 @@ static ssize_t codec_reg_show(struct device *dev, + } + static DEVICE_ATTR(codec_reg, 0444, codec_reg_show, NULL); + ++ ++static ssize_t codec_reg_write(struct device *dev, ++ struct device_attribute *attr, ++ const char *buf, size_t count) ++{ ++ u32 address; ++ u32 data; ++ char * end; ++ size_t left = count; ++ struct snd_soc_device *devdata = dev_get_drvdata(dev); ++ struct snd_soc_codec *codec = devdata->codec; ++ ++ address = simple_strtoul(buf, &end, 16); ++ left -= (int)(end - buf); ++ while ((*end == ' ') && (left)) { ++ end++; ++ left--; ++ } ++ if (!left) ++ return count; ++ data = simple_strtoul(end, &end, 16); ++ ++ printk(KERN_INFO"user writes Codec reg 0x%02X with Data 0x%04X\n", ++ address, data); ++ ++ codec->write(codec, address, data); ++ ++ return count; ++} ++ ++static DEVICE_ATTR(codec_reg_write, 0644, NULL, codec_reg_write); ++ + /** + * snd_soc_new_ac97_codec - initailise AC97 device + * @codec: audio codec +@@ -1139,6 +1171,9 @@ int snd_soc_register_card(struct snd_soc_device *socdev) + err = device_create_file(socdev->dev, &dev_attr_codec_reg); + if (err < 0) + printk(KERN_WARNING "asoc: failed to add codec sysfs entries\n"); ++ err = device_create_file(socdev->dev, &dev_attr_codec_reg_write); ++ if (err < 0) ++ printk(KERN_WARNING "asoc: failed to add codec sysfs entries\n"); + out: + mutex_unlock(&codec->mutex); + return ret; +-- +1.5.6.5 + |