3、c.h>#include#include#include#include"wm8960.h"/*R25-Power1*/#defineWM8960_VMID_MASK0x180#defineWM8960_VREF0x40/*R26-Power2*/#defineWM8960_PWR2_LOUT10x40#defineWM8960_PWR2_ROUT10x20#defineWM8960_PWR2_OUT30x02
4、/*R28-Anti-pop1*/#defineWM8960_POBCTRL0x80#defineWM8960_BUFDCOPEN0x10#defineWM8960_BUFIOEN0x08#defineWM8960_SOFT_ST0x04#defineWM8960_HPSTBY0x01/*R29-Anti-pop2*/#defineWM8960_DISOP0x40#defineWM8960_DRES_MASK0x30/**wm8960registercache*Wecan'treadtheWM8960
5、registerspacewhenweare*using2wirefordevicecontrol,sowecachetheminstead.*/staticconstu16wm8960_reg[WM8960_CACHEREGNUM]={0x0097,0x0097,0x0000,0x0000,0x0000,0x0008,0x0000,0x000a,0x01c0,0x0000,0x00ff,0x00ff,0x0000,0x0000,0x0000,0x0000,0x0000,0x007b,0x0100,0
6、x0032,0x0000,0x00c3,0x00c3,0x01c0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0100,0x0100,0x0050,0x0050,0x0050,0x0050,0x0000,0x0000,0x0000,0x0000,0x0040,0x0000,0x0000,0x0050,0x0050,0x0000,0x0002,0x0037,0x004d,0x0080,0x0008,0x0031,0x0026,0x
7、00e9,};structwm8960_priv{enumsnd_soc_control_typecontrol_type;int(*set_bias_level)(structsnd_soc_codec*,enumsnd_soc_bias_levellevel);structsnd_soc_dapm_widget*lout1;structsnd_soc_dapm_widget*rout1;structsnd_soc_dapm_widget*out3;booldeemph;intplayback_fs
8、;};#definewm8960_reset(c)snd_soc_write(c,WM8960_RESET,0)/*enumeratedcontrols*/staticconstchar*wm8960_polarity[]={"NoInversion","LeftInverted","RightInverted","StereoInversion"};staticconstchar*wm8960_3d_upper_cutoff[]={"High","Lo