Audio: Add codec config methods for external I2S master.

This commit is contained in:
Jared Boone 2017-08-06 12:43:39 -07:00
parent 6c3a1384fb
commit ac423ee769
4 changed files with 20 additions and 0 deletions

View File

@ -46,6 +46,12 @@ void AK4951::configure_digital_interface_external_slave() {
update(Register::PowerManagement2);
}
void AK4951::configure_digital_interface_external_master() {
map.r.power_management_2.MS = 1; // Master mode
map.r.power_management_2.PMPLL = 0; // EXT mode
update(Register::PowerManagement2);
}
void AK4951::init() {
reset();

View File

@ -866,6 +866,7 @@ private:
void configure_digital_interface_i2s();
void configure_digital_interface_external_slave();
void configure_digital_interface_external_master();
void set_digtal_volume_control(const reg_t value);
void set_dac_power(const bool enable);
void set_headphone_power(const bool enable);

View File

@ -37,6 +37,18 @@ void WM8731::configure_interface_i2s_slave() {
});
}
void WM8731::configure_interface_i2s_master() {
write(DigitalAudioInterfaceFormat {
.format = 2,
.iwl = 0,
.lrp = 0,
.lrswap = 0,
.ms = 1,
.bclkinv = 0,
.reserved0 = 0,
});
}
void WM8731::init() {
reset();

View File

@ -376,6 +376,7 @@ private:
volume_t headphone_volume = -60.0_dB;
void configure_interface_i2s_slave();
void configure_interface_i2s_master();
bool write(const Register reg);