From f00c63c8c108d8d7e13c72dd81e1ce442e6586ed Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E5=AE=8B=E7=A7=80=E6=9D=B0?= Date: Sat, 17 Nov 2012 17:47:43 +0800 Subject: [PATCH] phonepad: rt3261 add debug function. --- sound/soc/codecs/rt3261.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/sound/soc/codecs/rt3261.c b/sound/soc/codecs/rt3261.c index 6ba48caafc43..7c26a92ebe16 100755 --- a/sound/soc/codecs/rt3261.c +++ b/sound/soc/codecs/rt3261.c @@ -3597,6 +3597,34 @@ static ssize_t rt3261_proc_write(struct file *file, const char __user *buffer, } break; #endif + case 'd': + if(cookie_pot[1] ==':') + { + strsep(&cookie_pot,":"); + while((p=strsep(&cookie_pot,"="))) + { + reg = simple_strtol(p,NULL,16); + p=strsep(&cookie_pot,","); + value = simple_strtol(p,NULL,16); + rt3261_index_write(rt3261_codec,reg,value); + printk("rt3261_index_write:0x%04x = 0x%04x\n",reg,value); + } + printk("\n"); + } + break; + case 'e': + if(cookie_pot[1] ==':') + { + strsep(&cookie_pot,":"); + while((p=strsep(&cookie_pot,","))) + { + reg = simple_strtol(p,NULL,16); + value = rt3261_index_read(rt3261_codec,reg); + printk("rt3261_index_read:0x%04x = 0x%04x\n",reg,value); + } + printk("\n"); + } + break; default: printk("Help for rt3261_ts .\n-->The Cmd list: \n"); printk("-->'d&&D' Open or Off the debug\n"); -- 2.34.1