Commit 74aec597ab730531600e06844c3875a0f9af1f42
Add workaround not to have rhod's speaker always on. Still need userspace's fix
| |   |
| 32 | 32 | #include <asm/atomic.h> |
| 33 | 33 | #include <asm/ioctls.h> |
| 34 | 34 | #include <mach/msm_adsp.h> |
| #include <mach/htc_headset.h> |
| 35 | 36 | |
| 36 | 37 | #include "audmgr.h" |
| 37 | 38 | |
| … | … | |
| 219 | 219 | |
| 220 | 220 | static void audio_dsp_event(void *private, unsigned id, uint16_t *msg); |
| 221 | 221 | |
| void disable_speaker_rhod(void); |
| void enable_speaker_rhod(void); |
|
| 222 | 225 | /* must be called with audio->lock held */ |
| 223 | 226 | static int audio_enable(struct audio *audio) |
| 224 | 227 | { |
| … | … | |
| 264 | 264 | } |
| 265 | 265 | |
| 266 | 266 | audio->enabled = 1; |
| if(!headset_plugged()) |
| enable_speaker_rhod(); |
| 267 | 269 | htc_pwrsink_set(PWRSINK_AUDIO, 100); |
| 268 | 270 | return 0; |
| 269 | 271 | } |
| … | … | |
| 284 | 284 | audmgr_disable(&audio->audmgr); |
| 285 | 285 | audio->out_needed = 0; |
| 286 | 286 | audio_allow_sleep(audio); |
| disable_speaker_rhod(); |
| 287 | 288 | } |
| 288 | 289 | return 0; |
| 289 | 290 | } |
| |   |
| 46 | 46 | break; |
| 47 | 47 | case MACH_TYPE_HTCRHODIUM: |
| 48 | 48 | //Needs userland fix |
| enable_speaker_rhod(); |
| //Workaround, see audio_out.c |
| //enable_speaker_rhod(); |
| 50 | 51 | break; |
| 51 | 52 | case MACH_TYPE_HTCKOVSKY: |
| 52 | 53 | gpio_configure(0x41, GPIOF_DRIVE_OUTPUT | GPIOF_OUTPUT_HIGH); |
| … | … | |
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | void speaker_vol(int arg) { |
| //Needs userland fix |
| 79 | 80 | if(machine_is_htcrhodium()) |
| 80 | 81 | speaker_vol_rhod(arg); |
| 81 | 82 | } |