//DAC配置参数说明
struct dac_platform_data {
u8 sw_differ; //软件差分 0:不使用 1:使用 (只针对FL和RL两路通道作为软件差分输出时的配置)
u8 pa_auto_mute; //暂停DAC时是否自动MUTE功放 0:不mute功放 1:MUTE功放
u8 pa_mute_port; //功放MUTE IO
u8 pa_mute_value; //MUTE电平值 0:低电平 1:高电平
u8 differ_output; //是否使用硬件差分输出模式 0:不使用 1:使用 (只适用于FL和FR、RL和RR)
u8 hw_channel; //硬件DAC模拟通道
u8 ch_num; //数字通道,软件DMA输出通道数量
u8 fade_enable; //模拟音量淡入淡出使能位
u16 mute_delay_ms; //解MUTE延时ms
u16 fade_delay_ms; //模拟音量每级模拟增益淡入淡出延时ms
u16 sr_points; //多少个采样点进一次中断,一般不建议修改
u16 vcm_init_delay_ms; //VCM电压初始化后等待稳定的延时ms
u32 poweron_delay; //低功耗睡眠时恢复DAC模块的延迟us
};
//单声道单端输出
static const struct dac_platform_data dac_data = {
.sw_differ = 0,
.pa_auto_mute = 0,
.pa_mute_port = IO_PORTB_02,
.pa_mute_value = 0,
.differ_output = 0,
.hw_channel = BIT(0),
.ch_num = 1,
};
//软件单声道差分输出
static const struct dac_platform_data dac_data = {
.sw_differ = 1,
.pa_auto_mute = 0,
.pa_mute_port = IO_PORTB_02,
.pa_mute_value = 0,
.differ_output = 0,
.hw_channel = BIT(0) | BIT(2),
.ch_num = 4,
};
//软件双声道单端输出
static const struct dac_platform_data dac_data = {
.sw_differ = 0,
.pa_auto_mute = 0,
.pa_mute_port = IO_PORTB_02,
.pa_mute_value = 0,
.differ_output = 0,
.hw_channel = BIT(0) | BIT(2),
.ch_num = 4,
};