diff options
author | Thomas Martitz <kugel@rockbox.org> | 2011-12-24 17:59:43 +0000 |
---|---|---|
committer | Thomas Martitz <kugel@rockbox.org> | 2011-12-24 17:59:43 +0000 |
commit | a1d3ed25346ab4174cb7fd066158cebc8e29fc79 (patch) | |
tree | 9418cafbf4dbbc9b34ab31f1fc5123446204f645 /firmware/drivers | |
parent | 2ec443df12cda09bd5fee6f9857bca17b7e6aa3f (diff) | |
download | rockbox-a1d3ed25346ab4174cb7fd066158cebc8e29fc79.tar.gz rockbox-a1d3ed25346ab4174cb7fd066158cebc8e29fc79.zip |
ypr0: Cleanup and simplify ascodec functions. Fix audiohw_{pre,post}init() not being called.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31423 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/drivers')
-rw-r--r-- | firmware/drivers/audio/as3514.c | 28 |
1 files changed, 1 insertions, 27 deletions
diff --git a/firmware/drivers/audio/as3514.c b/firmware/drivers/audio/as3514.c index 0fe3070c19..a430afdf88 100644 --- a/firmware/drivers/audio/as3514.c +++ b/firmware/drivers/audio/as3514.c | |||
@@ -78,13 +78,12 @@ const struct sound_settings_info audiohw_settings[] = { | |||
78 | #endif | 78 | #endif |
79 | }; | 79 | }; |
80 | 80 | ||
81 | #ifndef SAMSUNG_YPR0 | ||
82 | /* Shadow registers */ | 81 | /* Shadow registers */ |
83 | static uint8_t as3514_regs[AS3514_NUM_AUDIO_REGS]; /* 8-bit registers */ | 82 | static uint8_t as3514_regs[AS3514_NUM_AUDIO_REGS]; /* 8-bit registers */ |
84 | 83 | ||
85 | /* | 84 | /* |
86 | * little helper method to set register values. | 85 | * little helper method to set register values. |
87 | * With the help of as3514_regs, we minimize i2c | 86 | * With the help of as3514_regs, we minimize i2c/syscall |
88 | * traffic. | 87 | * traffic. |
89 | */ | 88 | */ |
90 | static void as3514_write(unsigned int reg, unsigned int value) | 89 | static void as3514_write(unsigned int reg, unsigned int value) |
@@ -111,29 +110,7 @@ static void as3514_write_masked(unsigned int reg, unsigned int bits, | |||
111 | { | 110 | { |
112 | as3514_write(reg, (as3514_regs[reg] & ~mask) | (bits & mask)); | 111 | as3514_write(reg, (as3514_regs[reg] & ~mask) | (bits & mask)); |
113 | } | 112 | } |
114 | #else | ||
115 | static void as3514_write(unsigned int reg, unsigned int value) | ||
116 | { | ||
117 | ascodec_write(reg, value); | ||
118 | } | ||
119 | 113 | ||
120 | /* Helpers to set/clear bits */ | ||
121 | static void as3514_set(unsigned int reg, unsigned int bits) | ||
122 | { | ||
123 | ascodec_write(reg, ascodec_read(reg) | bits); | ||
124 | } | ||
125 | |||
126 | static void as3514_clear(unsigned int reg, unsigned int bits) | ||
127 | { | ||
128 | ascodec_write(reg, ascodec_read(reg) & ~bits); | ||
129 | } | ||
130 | |||
131 | static void as3514_write_masked(unsigned int reg, unsigned int bits, | ||
132 | unsigned int mask) | ||
133 | { | ||
134 | ascodec_write(reg, (ascodec_read(reg) & ~mask) | (bits & mask)); | ||
135 | } | ||
136 | #endif | ||
137 | /* convert tenth of dB volume to master volume register value */ | 114 | /* convert tenth of dB volume to master volume register value */ |
138 | int tenthdb2master(int db) | 115 | int tenthdb2master(int db) |
139 | { | 116 | { |
@@ -168,11 +145,8 @@ int sound_val2phys(int setting, int value) | |||
168 | */ | 145 | */ |
169 | void audiohw_preinit(void) | 146 | void audiohw_preinit(void) |
170 | { | 147 | { |
171 | |||
172 | #ifndef SAMSUNG_YPR0 | ||
173 | /* read all reg values */ | 148 | /* read all reg values */ |
174 | ascodec_readbytes(0x0, AS3514_NUM_AUDIO_REGS, as3514_regs); | 149 | ascodec_readbytes(0x0, AS3514_NUM_AUDIO_REGS, as3514_regs); |
175 | #endif | ||
176 | 150 | ||
177 | #ifdef HAVE_AS3543 | 151 | #ifdef HAVE_AS3543 |
178 | 152 | ||