From 7550320002ef461f488e04b28f2796206e3f3f8f Mon Sep 17 00:00:00 2001 From: wangzijiao Date: Mon, 13 Aug 2018 18:35:22 +0800 Subject: [PATCH] add adauinit to sysfs --- .../drivers/misc/xunfei/cpld/netease_config.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lichee/linux-4.9/drivers/misc/xunfei/cpld/netease_config.c b/lichee/linux-4.9/drivers/misc/xunfei/cpld/netease_config.c index 1b5d7ad35..bbcbe160d 100644 --- a/lichee/linux-4.9/drivers/misc/xunfei/cpld/netease_config.c +++ b/lichee/linux-4.9/drivers/misc/xunfei/cpld/netease_config.c @@ -8,6 +8,7 @@ static struct kset *netease_keyset = NULL; static struct kobject cpld_ko; extern int cx20810_set_mode(int mode, int index); extern void netease_cpld_reset(void); +extern void netease_adau1761_init(void); enum { CX20810_NORMAL_MODE = 0, @@ -25,6 +26,7 @@ static ssize_t gen_attr_show(struct kobject *kobj, struct attribute *attr, count += sprintf(buf + count, "adc rst and config:echo 1 > cpld_init\n"); count += sprintf(buf + count, "adc rst:echo 2 > cpld_init\n"); count += sprintf(buf + count, "adc config:echo 3 > cpld_init\n"); + count += sprintf(buf + count, "adau1761 init:echo 4 > cpld_init\n"); return count; } @@ -41,15 +43,23 @@ static ssize_t gen_attr_store(struct kobject *kobj, struct attribute *attr, cx20810_set_mode(CX20810_NORMAL_MODE, 0); cx20810_set_mode(CX20810_NORMAL_MODE, 1); break; + case 2: printk("Adc rst\n"); netease_cpld_reset(); break; + case 3: printk("Adc config\n"); cx20810_set_mode(CX20810_NORMAL_MODE, 0); cx20810_set_mode(CX20810_NORMAL_MODE, 1); break; + + case 4: + printk("Init adau1761!\n"); + netease_adau1761_init(); + break; + default: printk("Can not read your input cmd, need help? type cat cpld_init."); }