diff --git a/firmware/drivers/audio/wm8751.c b/firmware/drivers/audio/wm8751.c index 78e129803e..c4e1a62e50 100644 --- a/firmware/drivers/audio/wm8751.c +++ b/firmware/drivers/audio/wm8751.c @@ -100,6 +100,10 @@ static int adaptivebass2hw(int value) /* Reset and power up the WM8751 */ void audiohw_preinit(void) { +#ifdef CPU_PP502x + i2s_reset(); +#endif + /* * 1. Switch on power supplies. * By default the WM8751 is in Standby Mode, the DAC is diff --git a/firmware/export/config-mrobe100.h b/firmware/export/config-mrobe100.h index 8866bd0da9..0d49023b63 100644 --- a/firmware/export/config-mrobe100.h +++ b/firmware/export/config-mrobe100.h @@ -56,11 +56,7 @@ #define PLUGIN_BUFFER_SIZE 0x80000 /* Wolfsom audio codec */ -/* TODO: #define HAVE_WM8751 */ -#define HAVE_WM8731 - -/* WM8731 has no tone controls, so we use the software ones */ -#define HAVE_SW_TONE_CONTROLS +#define HAVE_WM8751 #define AB_REPEAT_ENABLE 1 diff --git a/firmware/target/arm/pcm-pp.c b/firmware/target/arm/pcm-pp.c index d2a503c0da..5a9d3b3670 100644 --- a/firmware/target/arm/pcm-pp.c +++ b/firmware/target/arm/pcm-pp.c @@ -23,6 +23,10 @@ #include "audio.h" #include "sound.h" +#ifdef HAVE_WM8751 +#define MROBE100_44100HZ (0x40|(0x11 << 1)|1) +#endif + /** DMA **/ #ifdef CPU_PP502x @@ -81,15 +85,25 @@ struct dma_data dma_play_data NOCACHEBSS_ATTR = }; static unsigned long pcm_freq NOCACHEDATA_ATTR = HW_SAMPR_DEFAULT; /* 44.1 is default */ +#ifdef HAVE_WM8751 +/* Samplerate control for audio codec */ +static int sr_ctrl = MROBE100_44100HZ; +#endif void pcm_set_frequency(unsigned int frequency) { (void)frequency; pcm_freq = HW_SAMPR_DEFAULT; +#ifdef HAVE_WM8751 + sr_ctrl = MROBE100_44100HZ; +#endif } void pcm_apply_settings(void) { +#ifdef HAVE_WM8751 + audiohw_set_frequency(sr_ctrl); +#endif pcm_curr_sampr = pcm_freq; } @@ -308,7 +322,7 @@ void pcm_play_dma_init(void) /* Initialize default register values. */ audiohw_init(); -#ifndef HAVE_WM8731 +#if !defined(HAVE_WM8731) && !defined(HAVE_WM8751) /* Power on */ audiohw_enable_output(true); /* Unmute the master channel (DAC should be at zero point now). */ diff --git a/firmware/target/arm/wmcodec-pp.c b/firmware/target/arm/wmcodec-pp.c index 1f688d135f..c9e034a188 100644 --- a/firmware/target/arm/wmcodec-pp.c +++ b/firmware/target/arm/wmcodec-pp.c @@ -28,7 +28,7 @@ #include "audiohw.h" #include "i2c-pp.h" -#if defined(IRIVER_H10) || defined(IRIVER_H10_5GB) +#if defined(IRIVER_H10) || defined(IRIVER_H10_5GB) || defined(MROBE_100) /* The H10's audio codec uses an I2C address of 0x1b */ #define I2C_AUDIO_ADDRESS 0x1b #else @@ -96,13 +96,13 @@ void audiohw_init(void) { #endif /* IPOD_1G2G/3G */ #endif -#ifdef HAVE_WM8731 +#if defined(HAVE_WM8731) || defined(HAVE_WM8751) audiohw_preinit(); #endif } -#ifndef HAVE_WM8731 +#if !defined(HAVE_WM8731) && !defined(HAVE_WM8751) void audiohw_postinit(void) { }