Received: by 10.223.185.116 with SMTP id b49csp7131058wrg; Wed, 28 Feb 2018 23:49:30 -0800 (PST) X-Google-Smtp-Source: AG47ELvWDLYcAxmHbx6U9giLbexog153kex91i+rhn+0MRhjoORzXr4R5lglEwS8mmMdCmjK1cMe X-Received: by 10.98.28.202 with SMTP id c193mr1017708pfc.109.1519890570781; Wed, 28 Feb 2018 23:49:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519890570; cv=none; d=google.com; s=arc-20160816; b=zbSzcfobUCxd4jQMpuxD0tgq865UBWFNPE1cRf4u58fdJ7ug2q+epK4NL6JYBiVd6m i4VdL9ImeM5oOTTgeO1mn3oDlPCOCmaNvLrh3eAbKmT/KrQ8xmUezXd9LlG7t+XpcJOn KMFOwKELZLO9BjsEE8e71hUdy5pt+dPw2C8llCmzoEaKVZvQx6lLlMeZF09XHW85sTuj i8v2fLbj9UXJGeFYgwv5iVNtFPSfRJ8MNhqTR8+dlRXV4aAR/PM8bMAZDJztW0QqWJ0p iLLXW1B9ecFI+tSOJZrgX6dQGctC80PQnhTr/EhiDI2eIEAwuyMcRzvUjx/dzxW64M09 NTDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date:arc-authentication-results; bh=z7FDyj7IwN2p8tQ0cAmBHJ8p+rBnRywaG7BYdfno4TA=; b=I1bVz6tEq8C4PYj9s52aE83RuablmCB+BoiTGM3kus9g1is2tBR+KFBx4nVZsb6WMn VBSZEU7oGr3qJEe9QWX5hzKb390iNm91N0F7y/YPN8ibG4uZQLF5Eui/VlozakFsOjFL OzmKXJhpjeGsgBEaH95qfUmyNw4+yIHJNDR67PCb13hYoK0+gdHzU2K43+PC7974kfIF 4SeFLIlcgOir6YIZAazZui/Ar5rX+QW/oUhnGIIXezmonmZDsChfEYYR04wyrWJ6jUL8 e7oVgRNuU0tuoWLIlgGe/yXLcwua4Yddf1E5bnmzXfXAPR3TX3oQe32ptsOm/sFQk0kv +whw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v62si401906pfi.156.2018.02.28.23.49.15; Wed, 28 Feb 2018 23:49:30 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935496AbeCAHr3 convert rfc822-to-8bit (ORCPT + 99 others); Thu, 1 Mar 2018 02:47:29 -0500 Received: from mail.bootlin.com ([62.4.15.54]:60450 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934908AbeCAHr1 (ORCPT ); Thu, 1 Mar 2018 02:47:27 -0500 Received: by mail.bootlin.com (Postfix, from userid 110) id 85B1520715; Thu, 1 Mar 2018 08:47:23 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.free-electrons.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0 Received: from dell-desktop.home (LStLambert-657-1-97-87.w90-63.abo.wanadoo.fr [90.63.216.87]) by mail.bootlin.com (Postfix) with ESMTPSA id 0761E203A0; Thu, 1 Mar 2018 08:47:13 +0100 (CET) Date: Thu, 1 Mar 2018 08:47:13 +0100 From: =?UTF-8?B?TXlsw6huZQ==?= Josserand To: Thomas Petazzoni Cc: lgirdwood@gmail.com, broonie@kernel.org, robh+dt@kernel.org, mark.rutland@arm.com, perex@perex.cz, tiwai@suse.com, alsa-devel@alsa-project.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, alexandre.belloni@bootlin.com Subject: Re: [PATCH v1 2/4] ASoC: codecs: pcm179x: Add support for PCM1789 Message-ID: <20180301084713.24bdda4e@dell-desktop.home> In-Reply-To: <20180227225629.5cc4e802@windsurf.lan> References: <20180227212433.2189-1-mylene.josserand@bootlin.com> <20180227212433.2189-3-mylene.josserand@bootlin.com> <20180227225629.5cc4e802@windsurf.lan> Organization: Bootlin X-Mailer: Claws Mail 3.14.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, On Tue, 27 Feb 2018 22:56:29 +0100 Thomas Petazzoni wrote: > Hello, > > On Tue, 27 Feb 2018 22:24:31 +0100, Mylène Josserand wrote: > > > diff --git a/sound/soc/codecs/pcm179x-i2c.c b/sound/soc/codecs/pcm179x-i2c.c > > index 795a0657c097..83a2e1508df8 100644 > > --- a/sound/soc/codecs/pcm179x-i2c.c > > +++ b/sound/soc/codecs/pcm179x-i2c.c > > @@ -26,10 +26,13 @@ > > static int pcm179x_i2c_probe(struct i2c_client *client, > > const struct i2c_device_id *id) > > { > > - struct regmap *regmap; > > + struct regmap *regmap = NULL; > > I don't think this change is useful, since regmap is always initialized > below anyway. okay. > > > > + if (mute) > > + val = ~(PCM1789_MUTE_L_EN | PCM1789_MUTE_R_EN); > > That's not really useful with regmap_update_bits() which already does > the masking, no? Yep > > > + else > > + val = PCM1789_MUTE_L_EN | PCM1789_MUTE_R_EN; > > + ret = regmap_update_bits(priv->regmap, PCM1789_SOFT_MUTE, > > + PCM1789_MUTE_MASK, val); > > Couldn't this be: > > if (mute) > val = 0; > else > val = PCM1789_MUTE_MASK; > > ret = regmap_update_bits(priv->regmap, PCM1789_SOFT_MUTE, > PCM1789_MUTE_MASK, val); > I will update my V2 with it. > > > +static struct snd_soc_dai_driver pcm1789_dai = { > > + .name = "pcm1789-hifi", > > + .playback = { > > + .stream_name = "Playback", > > + .channels_min = 2, > > + .channels_max = 2, > > + .rates = SNDRV_PCM_RATE_CONTINUOUS, > > + .rate_min = 10000, > > + .rate_max = 200000, > > + .formats = PCM1792A_FORMATS, }, > > Nit: the closing curly brace should be on a separate line. Yep, thanks. > > > > + if (type == PCM1789) > > + return devm_snd_soc_register_component(dev, > > + &soc_component_dev_pcm1789, > > + &pcm1789_dai, 1); > > + > > Perhaps a "else" here ? Sure > > > return devm_snd_soc_register_component(dev, > > &soc_component_dev_pcm179x, &pcm179x_dai, 1); > > Thanks! > > Thomas Thank you, Mylène -- Mylène Josserand, Bootlin (formerly Free Electrons) Embedded Linux and Kernel engineering http://bootlin.com