lkml.org 
[lkml]   [2011]   [Oct]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [alsa-devel] [PATCH 7/9] ASoC: da7210: Add support for ALC and Noise suppression
On Wed, Oct 12, 2011 at 08:37:50PM +0530, Ashish Chavan wrote:

> + if (ucontrol->value.integer.value[0]) {
> + /* Check if noise suppression is enabled */
> + if (reg_cache[DA7210_CONTROL] & DA7210_NOISE_SUP_EN) {

No, don't go peering directly into the register cache. This is going to
explode if the board configures a different cache style and means you
can't change the cache type later. Just read the register and trust
that the cache will do something sane.

> + dev_dbg(codec->dev, "Failed to enable ALC\n");
> + return -EPERM;
> + }

Either drop the debug print or make it say what the problem is.

similar problems in the rest of the patch.

> + SOC_SINGLE("ALC Capture Max Gain", DA7210_ALC_MAX, 0, 0x3F, 0),
> + SOC_SINGLE("ALC Capture Min Gain", DA7210_ALC_MIN, 0, 0x3F, 0),
> + SOC_SINGLE("ALC Capture Noise Gain", DA7210_ALC_NOIS, 0, 0x3F, 0),

Volume.


\
 
 \ /
  Last update: 2011-10-12 17:07    [W:0.052 / U:0.224 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site