mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-11 06:05:21 -05:00
Clip+: enable sound on "as3514" (as3543 in fact)
as3525 comes with a as3517, as3525v2 with a as3543, rename specific registers accordingly Existing problems: FM (line out) doesn't work, volume can't go below a certain point git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25260 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
0efbe23fe0
commit
7042c96b4a
3 changed files with 28 additions and 5 deletions
|
|
@ -7,7 +7,7 @@
|
||||||
* \/ \/ \/ \/ \/
|
* \/ \/ \/ \/ \/
|
||||||
* $Id$
|
* $Id$
|
||||||
*
|
*
|
||||||
* Driver for AS3514 audio codec
|
* Driver for AS3514 and compatible audio codec
|
||||||
*
|
*
|
||||||
* Copyright (c) 2007 Daniel Ankers
|
* Copyright (c) 2007 Daniel Ankers
|
||||||
* Copyright (c) 2007 Christian Gmeiner
|
* Copyright (c) 2007 Christian Gmeiner
|
||||||
|
|
@ -31,6 +31,13 @@
|
||||||
#include "i2s.h"
|
#include "i2s.h"
|
||||||
#include "ascodec.h"
|
#include "ascodec.h"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This drivers supports:
|
||||||
|
* as3514 , as used in the PP targets
|
||||||
|
* as3517 , as used in the as3525 targets
|
||||||
|
* as3543 , as used in the as3525v2 targets
|
||||||
|
*/
|
||||||
|
|
||||||
/* AMS Sansas based on the AS3525 use the LINE2 input for the analog radio
|
/* AMS Sansas based on the AS3525 use the LINE2 input for the analog radio
|
||||||
signal instead of LINE1 */
|
signal instead of LINE1 */
|
||||||
#if CONFIG_CPU == AS3525
|
#if CONFIG_CPU == AS3525
|
||||||
|
|
@ -170,9 +177,13 @@ void audiohw_preinit(void)
|
||||||
as3514_write(AS3514_AUDIOSET3, AUDIOSET3_HPCM_off);
|
as3514_write(AS3514_AUDIOSET3, AUDIOSET3_HPCM_off);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if CONFIG_CPU != AS3525v2
|
||||||
/* Mute and disable speaker */
|
/* Mute and disable speaker */
|
||||||
as3514_write(AS3514_LSP_OUT_R, LSP_OUT_R_SP_OVC_TO_256MS | 0x00);
|
as3514_write(AS3514_LSP_OUT_R, LSP_OUT_R_SP_OVC_TO_256MS | 0x00);
|
||||||
as3514_write(AS3514_LSP_OUT_L, LSP_OUT_L_SP_MUTE | 0x00);
|
as3514_write(AS3514_LSP_OUT_L, LSP_OUT_L_SP_MUTE | 0x00);
|
||||||
|
#else
|
||||||
|
as3514_clear(AS3543_DAC_IF, 0x80);
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Set headphone over-current to 0, Min volume */
|
/* Set headphone over-current to 0, Min volume */
|
||||||
as3514_write(AS3514_HPH_OUT_R,
|
as3514_write(AS3514_HPH_OUT_R,
|
||||||
|
|
@ -262,8 +273,15 @@ void audiohw_mute(bool mute)
|
||||||
{
|
{
|
||||||
if (mute) {
|
if (mute) {
|
||||||
as3514_set(AS3514_HPH_OUT_L, HPH_OUT_L_HP_MUTE);
|
as3514_set(AS3514_HPH_OUT_L, HPH_OUT_L_HP_MUTE);
|
||||||
|
#if CONFIG_CPU == AS3525v2
|
||||||
|
as3514_set(AS3543_DAC_IF, 0x80);
|
||||||
|
#endif
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
as3514_clear(AS3514_HPH_OUT_L, HPH_OUT_L_HP_MUTE);
|
as3514_clear(AS3514_HPH_OUT_L, HPH_OUT_L_HP_MUTE);
|
||||||
|
#if CONFIG_CPU == AS3525v2
|
||||||
|
as3514_clear(AS3543_DAC_IF, 0x80);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -284,6 +302,10 @@ void audiohw_close(void)
|
||||||
as3514_clear(AS3514_HPH_OUT_L, HPH_OUT_L_HP_ON);
|
as3514_clear(AS3514_HPH_OUT_L, HPH_OUT_L_HP_ON);
|
||||||
as3514_write(AS3514_AUDIOSET1, 0x0);
|
as3514_write(AS3514_AUDIOSET1, 0x0);
|
||||||
|
|
||||||
|
#if CONFIG_CPU == AS3525v2
|
||||||
|
as3514_set(AS3543_DAC_IF, 0x80);
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Allow caps to discharge */
|
/* Allow caps to discharge */
|
||||||
sleep(HZ/4);
|
sleep(HZ/4);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -46,10 +46,11 @@ extern void audiohw_set_lineout_vol(int vol_l, int vol_r);
|
||||||
#define AS3514_DAC_L 0x0f
|
#define AS3514_DAC_L 0x0f
|
||||||
#define AS3514_ADC_R 0x10
|
#define AS3514_ADC_R 0x10
|
||||||
#define AS3514_ADC_L 0x11
|
#define AS3514_ADC_L 0x11
|
||||||
|
#define AS3543_DAC_IF 0x12 /* only in as3543 */
|
||||||
#define AS3514_AUDIOSET1 0x14
|
#define AS3514_AUDIOSET1 0x14
|
||||||
#define AS3514_AUDIOSET2 0x15
|
#define AS3514_AUDIOSET2 0x15
|
||||||
#define AS3514_AUDIOSET3 0x16
|
#define AS3514_AUDIOSET3 0x16
|
||||||
#define AS3514_USB_UTIL 0x17 /* Only in AS3525 ? */
|
#define AS3517_USB_UTIL 0x17 /* only in as3517+ */
|
||||||
#define AS3514_PLLMODE 0x1d
|
#define AS3514_PLLMODE 0x1d
|
||||||
|
|
||||||
#define AS3514_SYSTEM 0x20
|
#define AS3514_SYSTEM 0x20
|
||||||
|
|
|
||||||
|
|
@ -122,7 +122,7 @@ void usb_drv_init(void)
|
||||||
endpoints[i].busy = false;
|
endpoints[i].busy = false;
|
||||||
|
|
||||||
ascodec_write(AS3514_CVDD_DCDC3, ascodec_read(AS3514_CVDD_DCDC3) | 1<<2);
|
ascodec_write(AS3514_CVDD_DCDC3, ascodec_read(AS3514_CVDD_DCDC3) | 1<<2);
|
||||||
ascodec_write(AS3514_USB_UTIL, ascodec_read(AS3514_USB_UTIL) & ~(1<<4));
|
ascodec_write(AS3517_USB_UTIL, ascodec_read(AS3517_USB_UTIL) & ~(1<<4));
|
||||||
|
|
||||||
/* PHY part */
|
/* PHY part */
|
||||||
CGU_USB = 1<<5 /* enable */
|
CGU_USB = 1<<5 /* enable */
|
||||||
|
|
@ -137,7 +137,7 @@ void usb_drv_init(void)
|
||||||
USB_DEV_CTRL |= 0x400; /* soft disconnect */
|
USB_DEV_CTRL |= 0x400; /* soft disconnect */
|
||||||
|
|
||||||
/* UVDD */
|
/* UVDD */
|
||||||
ascodec_write(AS3514_USB_UTIL, ascodec_read(AS3514_USB_UTIL) | (1<<4));
|
ascodec_write(AS3517_USB_UTIL, ascodec_read(AS3517_USB_UTIL) | (1<<4));
|
||||||
sleep(10); //msleep(100)
|
sleep(10); //msleep(100)
|
||||||
|
|
||||||
USB_GPIO_CSR = 0x6180000;
|
USB_GPIO_CSR = 0x6180000;
|
||||||
|
|
@ -199,7 +199,7 @@ void usb_drv_exit(void)
|
||||||
VIC_INT_EN_CLEAR = INTERRUPT_USB;
|
VIC_INT_EN_CLEAR = INTERRUPT_USB;
|
||||||
CGU_USB &= ~(1<<5);
|
CGU_USB &= ~(1<<5);
|
||||||
CGU_PERI &= ~CGU_USB_CLOCK_ENABLE;
|
CGU_PERI &= ~CGU_USB_CLOCK_ENABLE;
|
||||||
ascodec_write(AS3514_USB_UTIL, ascodec_read(AS3514_USB_UTIL) & ~(1<<4));
|
ascodec_write(AS3517_USB_UTIL, ascodec_read(AS3517_USB_UTIL) & ~(1<<4));
|
||||||
}
|
}
|
||||||
|
|
||||||
int usb_drv_port_speed(void)
|
int usb_drv_port_speed(void)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue