diff options
Diffstat (limited to 'firmware/drivers/wm8758.c')
-rw-r--r-- | firmware/drivers/wm8758.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/firmware/drivers/wm8758.c b/firmware/drivers/wm8758.c index f3310f3ed6..b7894e66b7 100644 --- a/firmware/drivers/wm8758.c +++ b/firmware/drivers/wm8758.c | |||
@@ -272,3 +272,28 @@ void wmcodec_set_monitor(int enable) { | |||
272 | 272 | ||
273 | (void)enable; | 273 | (void)enable; |
274 | } | 274 | } |
275 | |||
276 | void wmcodec_set_equalizer_band(int band, int freq, int bw, int gain) | ||
277 | { | ||
278 | unsigned int eq = 0; | ||
279 | |||
280 | /* Band 1..3 are peak filters */ | ||
281 | if (band >= 1 && band <= 3) { | ||
282 | eq |= (bw << 8); | ||
283 | } | ||
284 | |||
285 | eq |= (freq << 5); | ||
286 | eq |= 12 - gain; | ||
287 | |||
288 | if (band == 0) { | ||
289 | wm8758_write(EQ0, eq); | ||
290 | } else if (band == 1) { | ||
291 | wm8758_write(EQ1, eq); | ||
292 | } else if (band == 2) { | ||
293 | wm8758_write(EQ2, eq); | ||
294 | } else if (band == 3) { | ||
295 | wm8758_write(EQ3, eq); | ||
296 | } else if (band == 4) { | ||
297 | wm8758_write(EQ4, eq); | ||
298 | } | ||
299 | } | ||