本帖最后由 wsk311728 于 2015-1-19 11:02 编辑
参照E9给出的内核的里board-mx6q_sabresd.c和board-mx6q_sabresd.h文件,在飞思卡尔官方给出的BSP里,修改内核里的board-mx6q_sabresd.c文件,把wm8962的驱动改成wm8960的驱动。
思路如下:
1、修改arch/arm/mach-mx6/board-mx6q_sabresd.h里的配置
2、修改arch/arm/mach-mx6/board-mx6q_sabresd.c里关于wm8962的部分修改成wm8960
3.在include/sound/wm8960.h文件里,添加加如下内容(红色部分):
...
#define WM8960_DRES_MAX 3
#define WM8960_GPIO_FN_DMICCLK 19
#define WM8960_GPIO_FN_DMICDAT 20
struct wm8960_data {
bool capless; /* Headphone outputs configured in capless mode */
int dres; /* Discharge resistance for headphone outputs */
int gpio_base;
u32 gpio_init[WM8960_MAX_GPIO];
/* Setup for microphone detection, raw value to be written to
* R48(0x30) - only microphone related bits will be updated.
* Detection may be enabled here for use with signals brought
* out on the GPIOs. */
u32 mic_cfg;
bool irq_active_low;
bool spk_mono; // Speaker o
};
4、下载imx-wm8960.c文件,放到sound/soc/imx/目录下
5、修改sound/soc/imx/Makefile
将
snd-soc-imx-wm8960-objs := imx-wm8962.o
改成
snd-soc-imx-wm8960-objs := imx-wm8960.o
将
obj-$(CONFIG_SND_SOC_IMX_WM8962) += snd-soc-imx-wm8962.o
改成
obj-$(CONFIG_SND_SOC_IMX_WM8960) += snd-soc-imx-wm8960.o
6、修改sound/soc/imx/Kconfig
将以下这段
config SND_SOC_IMX_WM8962
tristate "SoC Audio support for IMX boards with WM8962"
select SND_MXC_SOC_MX2
select SND_SOC_WM8962
help
Say Y if you want to add support for SoC audio on an i.MX board with
a WM8962 codec.
改成
config SND_SOC_IMX_WM8960
tristate "SoC Audio support for IMX boards with WM8960"
select SND_MXC_SOC_MX2
select SND_SOC_WM8960
help
Say Y if you want to add support for SoC audio on an i.MX board with
a WM8960 codec.
7、关于sound/soc/imx/imx-ssi文件和sound/soc/codecs目录下的wm8960.c和wm8960.h文件官方原来的BSP里就带有,没作更改
8、重新编译内核,没有出现错误,下载到E9开发板中,执行
aplay -l
后,提示:
$ aplay -l
aplay: device_list:240: no soundcards found...
$ alsamixer
cannot open mixer: No such file or directory
由于篇幅过长,有限制,具体请看附件,请大神们给个指点,接下来该怎么做。谢谢!
|