Commit 74aec597ab730531600e06844c3875a0f9af1f42

  • avatar
  • phhusson
  • Fri Aug 27 00:26:39 CEST 2010
Add workaround not to have rhod's speaker always on. Still need userspace's fix
  
3232#include <asm/atomic.h>
3333#include <asm/ioctls.h>
3434#include <mach/msm_adsp.h>
35#include <mach/htc_headset.h>
3536
3637#include "audmgr.h"
3738
219219
220220static void audio_dsp_event(void *private, unsigned id, uint16_t *msg);
221221
222void disable_speaker_rhod(void);
223void enable_speaker_rhod(void);
224
222225/* must be called with audio->lock held */
223226static int audio_enable(struct audio *audio)
224227{
264264 }
265265
266266 audio->enabled = 1;
267 if(!headset_plugged())
268 enable_speaker_rhod();
267269 htc_pwrsink_set(PWRSINK_AUDIO, 100);
268270 return 0;
269271}
284284 audmgr_disable(&audio->audmgr);
285285 audio->out_needed = 0;
286286 audio_allow_sleep(audio);
287 disable_speaker_rhod();
287288 }
288289 return 0;
289290}
  
4646 break;
4747 case MACH_TYPE_HTCRHODIUM:
4848 //Needs userland fix
49 enable_speaker_rhod();
49 //Workaround, see audio_out.c
50 //enable_speaker_rhod();
5051 break;
5152 case MACH_TYPE_HTCKOVSKY:
5253 gpio_configure(0x41, GPIOF_DRIVE_OUTPUT | GPIOF_OUTPUT_HIGH);
7676}
7777
7878void speaker_vol(int arg) {
79 //Needs userland fix
7980 if(machine_is_htcrhodium())
8081 speaker_vol_rhod(arg);
8182}