Allow setting codec register with debugfs filesystem
PATCH 1/1 Allow setting codec register with debugfs filesystem
i.e. echo 6 59 >/sys/kernel/debug/soc-audio.0/codec_reg will set register 0x06 to a value of 0x59
Mark, I didn't base it on dapm's pop_time directory because that hasn't made it to my testing kernel yet. I cannot test directly from the alsa git tree.
Thanks for the feedback.
include/sound/soc.h +3 -0
@@ -516,6 +516,9 @@ struct snd_soc_device {struct delayed_work delayed_work;struct work_struct deferred_resume_work;void *codec_data; +#ifdef CONFIG_DEBUG_FS +struct dentry *debugfs_root; +#endif };/* runtime channel data */
sound/soc/soc-core.c +107 -3
137 lines not on this page · raw message
Signature · 1 line
1.5.4.3
Quoted 3 lines · Troy Kisky
Mark, I didn't base it on dapm's
pop_timedirectory because that hasn't made it to my testing kernel yet. I cannot test directly from the alsa git tree.
You should be able to cherry pick the relevant commits over without too much hassle? Should be commits:
f8f1179d34d5adb3b0fe45327050470aae9b3d7e28dcfbeb157c58ae24d5ba173984bfc316ca95eeed5457f91695784d692190b1b8ff024ae462801c
in that order. ASoC generally backports fairly easily since it doesn't have too many ties into fast-changing parts of the system - you can often get a long way by simply copying soc-core.c, soc-dapm.c, soc.h and soc-dapm.h into your current version.
Could you give that a spin and let me know if you can get something sorted out?
I did also notice:
sound/soc/soc-core.c static ssize_t codec_reg_show(struct device *dev, · line 1013
Quoted 2 lines
sound/soc/soc-core.c +2
-0+#ifdef CONFIG_DEBUG_FS +static int code_reg_open_file (struct inode *inode,struct file *file)
Not sure why I didn't notice this before but codec_reg rather than code_reg?
BTW, please CC me on ASoC patch submissions - it makes it harder for me to miss things on the list.