WM8731: Extract interface configuration method.

This commit is contained in:
Jared Boone 2017-08-06 12:08:12 -07:00
parent f0947a4917
commit 6c3a1384fb
2 changed files with 15 additions and 9 deletions

View File

@ -25,6 +25,18 @@
namespace wolfson {
namespace wm8731 {
void WM8731::configure_interface_i2s_slave() {
write(DigitalAudioInterfaceFormat {
.format = 2,
.iwl = 0,
.lrp = 0,
.lrswap = 0,
.ms = 0,
.bclkinv = 0,
.reserved0 = 0,
});
}
void WM8731::init() {
reset();
@ -49,15 +61,7 @@ void WM8731::init() {
// .reserved0 = 0,
// });
write(DigitalAudioInterfaceFormat {
.format = 2,
.iwl = 0,
.lrp = 0,
.lrswap = 0,
.ms = 0,
.bclkinv = 0,
.reserved0 = 0,
});
configure_interface_i2s_slave();
write(DigitalAudioPathControl {
.adchpd = 0,

View File

@ -375,6 +375,8 @@ private:
RegisterMap map { default_after_reset };
volume_t headphone_volume = -60.0_dB;
void configure_interface_i2s_slave();
bool write(const Register reg);
bool write(const address_t reg_address, const reg_t value);