From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.4 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4FE64CA9EAF for ; Mon, 21 Oct 2019 11:45:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 28246214AE for ; Mon, 21 Oct 2019 11:45:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="L2nU+xgC" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728608AbfJULpZ (ORCPT ); Mon, 21 Oct 2019 07:45:25 -0400 Received: from mail-wm1-f66.google.com ([209.85.128.66]:38843 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728604AbfJULpY (ORCPT ); Mon, 21 Oct 2019 07:45:24 -0400 Received: by mail-wm1-f66.google.com with SMTP id 3so12451217wmi.3 for ; Mon, 21 Oct 2019 04:45:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=umMsATXlWgFAfcuZOGKS3dhZXdI24Lzqqx5ELSjQOWM=; b=L2nU+xgCbN5LtkAhVSUAyqXKpaIpDb2NbqaWZD/9o/EUs39LUEO2TGEXCZnz/+1GMK vmYJLj9mwZ8wqiG/kirdJIyY//VurXZfTQCPxCtOY9IL1skWqhSDbep7FMWDaLf13PQ/ K/qp+YDO47tUKlxjf4r2zecpRPk3YMUhUEBQLnU3Q0XHC57ZyUaPxmpuZHIIAQIzaN+r Y/Xqo9jpEBUc0N9HPFcmvN3EWnuoZGNRmYXpqVEg0baVbVZf+XMCdVLcukyYbTdNbr2J T9Lw2o/kyFrxYKTVufYqj0aVqDHuuCSO2Xl0SadOAKJWb8w3occPpbjoyIxp+cJPLyhh MHfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=umMsATXlWgFAfcuZOGKS3dhZXdI24Lzqqx5ELSjQOWM=; b=R7dTNN3mmB4STIe1FuPQGr4UXPETZ55+w8SJhdCvu7pxpe5kiBwSCL6164gHn6yeWH 6dygFtErYXLyUVSG29CtYIgspZNHqZOpd0j8qyd7JZdtmzaEsbhKYQaHZzns9kVOJuG+ tRFxZF2hM83o0W8CAx9Qd1xUOSyrfT/7wp99mef3O855Z7252pPcAlg1MYMpd0NvpZaz 4uULko0IhG1g58mdFFPc2uGNLGb7SsvtoiVrFiGH3BVxouYUzRQo1fTr4muBjSkX2HLa eAzxPCSvK5FQrNXnlyKItMkhLL/Y/LrQP47DiWorfd4gdC+zrraIxAw+q+P4egwmpzki CjnA== X-Gm-Message-State: APjAAAX++EqzitOwjMfGSuUp9xcCX1uF008zHDRsMbKDDkTSAcEd+tAf VXiyFPWqFqJI1/9JMeKvMHNQtg== X-Google-Smtp-Source: APXvYqxEr92jhtBT1uFAamq5FfTEOFtNLr64Fwysmfw5liFBfPgdTxylfL+k5nkA5UswqABKpIGI9A== X-Received: by 2002:a1c:6a07:: with SMTP id f7mr6276449wmc.124.1571658322488; Mon, 21 Oct 2019 04:45:22 -0700 (PDT) Received: from dell ([95.149.164.99]) by smtp.gmail.com with ESMTPSA id o4sm24943791wre.91.2019.10.21.04.45.21 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 21 Oct 2019 04:45:22 -0700 (PDT) Date: Mon, 21 Oct 2019 12:45:20 +0100 From: Lee Jones To: Srinivas Kandagatla Cc: robh@kernel.org, broonie@kernel.org, linus.walleij@linaro.org, vinod.koul@linaro.org, alsa-devel@alsa-project.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, spapothi@codeaurora.org, bgoswami@codeaurora.org, linux-gpio@vger.kernel.org Subject: Re: [PATCH v2 02/11] mfd: wcd934x: add support to wcd9340/wcd9341 codec Message-ID: <20191021114520.GD4365@dell> References: <20191018001849.27205-1-srinivas.kandagatla@linaro.org> <20191018001849.27205-3-srinivas.kandagatla@linaro.org> <20191021104611.GZ4365@dell> <1af8a875-8f55-6b7e-4204-ecedc1608889@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1af8a875-8f55-6b7e-4204-ecedc1608889@linaro.org> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org On Mon, 21 Oct 2019, Srinivas Kandagatla wrote: > Thanks Lee for taking time to review. > > I agree with most of the style related comments, will fix them in next > version. For others I have replied it inline. [...] > > > +static int wcd934x_bring_up(struct wcd934x_data *wcd) > > > +{ > > > + struct regmap *rm = wcd->regmap; > > > > It's much more common to use 'regmap' or 'map'. > > Only reason to make it short here is to save some lines! > If you prefer regmap, I will add that in next version! I doubt it'd save many (any?) lines. [...] > > > +static int wcd934x_slim_status(struct slim_device *sdev, > > > + enum slim_device_status status) > > > +{ > > > + struct device *dev = &sdev->dev; > > > + struct wcd934x_data *wcd; > > > + int ret; > > > > This is semantically odd! Why are you doing most of the > > initialisation and bring-up in 'status' and not 'probe'. Seems > > broken to me. > > SLIMBus device will not be in a state to communicate before enumeration (at > probe), so all the device initialization is done in status callback where it > is ready for communication. Why do we need the device to be up *before* calling probe? > This is same with SoundWire Bus as well! [...] > > > + struct device *dev; > > > + struct clk *extclk; > > > + struct regmap *regmap; > > > + struct slim_device *sdev; > > > > You don't need 'sdev' and 'dev'. > > slim_device instance (sdev) is required by audio codec driver to allocate > stream runtime. You can extrapolate one from the other. -- Lee Jones [李琼斯] Linaro Services Technical Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.2 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D116CCA9EAF for ; Mon, 21 Oct 2019 11:46:19 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5685B20656 for ; Mon, 21 Oct 2019 11:46:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="uI9BQcZt"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="L2nU+xgC" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5685B20656 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 96E5815E2; Mon, 21 Oct 2019 13:45:27 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 96E5815E2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1571658377; bh=eW78RSZ5OdLJS/Csz3Y5NelQNtbjy8FwlL5aY52D8dc=; h=Date:From:To:References:In-Reply-To:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=uI9BQcZtbnaCBpUPzUD9af1gp/Ao2ufg0a7cwjLsyRRJXybJUCCuzsuFaZIA+UcM/ EuFa7gbrogO6V69/Ua6cxEyM8FGXZzeQ93i4nLRFVBjYgbqdJofPOi7EqblmOEdUyO EfWMsbjzjFQTGXL5Z4mgHDw7oOjwTOvIC4lta/PE= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 2B0B3F80321; Mon, 21 Oct 2019 13:45:27 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id D38B9F80368; Mon, 21 Oct 2019 13:45:25 +0200 (CEST) Received: from mail-wm1-x341.google.com (mail-wm1-x341.google.com [IPv6:2a00:1450:4864:20::341]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 6EA38F80112 for ; Mon, 21 Oct 2019 13:45:23 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 6EA38F80112 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="L2nU+xgC" Received: by mail-wm1-x341.google.com with SMTP id 14so5792356wmu.0 for ; Mon, 21 Oct 2019 04:45:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=umMsATXlWgFAfcuZOGKS3dhZXdI24Lzqqx5ELSjQOWM=; b=L2nU+xgCbN5LtkAhVSUAyqXKpaIpDb2NbqaWZD/9o/EUs39LUEO2TGEXCZnz/+1GMK vmYJLj9mwZ8wqiG/kirdJIyY//VurXZfTQCPxCtOY9IL1skWqhSDbep7FMWDaLf13PQ/ K/qp+YDO47tUKlxjf4r2zecpRPk3YMUhUEBQLnU3Q0XHC57ZyUaPxmpuZHIIAQIzaN+r Y/Xqo9jpEBUc0N9HPFcmvN3EWnuoZGNRmYXpqVEg0baVbVZf+XMCdVLcukyYbTdNbr2J T9Lw2o/kyFrxYKTVufYqj0aVqDHuuCSO2Xl0SadOAKJWb8w3occPpbjoyIxp+cJPLyhh MHfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=umMsATXlWgFAfcuZOGKS3dhZXdI24Lzqqx5ELSjQOWM=; b=IHjOFvM9K7C5y+1DxrVAUyQfiqxf4g+agewjebN0gNAidDXMYGLIfoun6rx5FPvnfc 23qbAVvuCh5WAE2YCsXce/7zDCKzuj346AbiQ2b0lNDBrXg8vuboS0k+KV161LWE9jyB cQUcvUgRWan3GIzCwa2yBqfNV9mj4tsAMyL9XN2S33obLSEKJSC/R1ZoFJgjTZcD5Ti1 TxbaW/I1UBS5GRZTk4pCf86zQ09J4BmRt3KV9uh3EK+uPza0nFzZLPdbLwYRlU14vzeH lhe7iYz46Px8t8EZsIjtuWd7rsXCXGUfT43eyYZOffk+SQZ3NZZbRmLtkxGM2qWXfhxl OVXA== X-Gm-Message-State: APjAAAV5jQlQg+9Pa/pAVAp1UMceEt8QE7iiZIi8YNUrs80fvlVnnJSh OCspdjgF1S35jWWecSkV4VeM4hTevUc= X-Google-Smtp-Source: APXvYqxEr92jhtBT1uFAamq5FfTEOFtNLr64Fwysmfw5liFBfPgdTxylfL+k5nkA5UswqABKpIGI9A== X-Received: by 2002:a1c:6a07:: with SMTP id f7mr6276449wmc.124.1571658322488; Mon, 21 Oct 2019 04:45:22 -0700 (PDT) Received: from dell ([95.149.164.99]) by smtp.gmail.com with ESMTPSA id o4sm24943791wre.91.2019.10.21.04.45.21 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 21 Oct 2019 04:45:22 -0700 (PDT) Date: Mon, 21 Oct 2019 12:45:20 +0100 From: Lee Jones To: Srinivas Kandagatla Message-ID: <20191021114520.GD4365@dell> References: <20191018001849.27205-1-srinivas.kandagatla@linaro.org> <20191018001849.27205-3-srinivas.kandagatla@linaro.org> <20191021104611.GZ4365@dell> <1af8a875-8f55-6b7e-4204-ecedc1608889@linaro.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1af8a875-8f55-6b7e-4204-ecedc1608889@linaro.org> User-Agent: Mutt/1.9.4 (2018-02-28) Cc: robh@kernel.org, alsa-devel@alsa-project.org, bgoswami@codeaurora.org, vinod.koul@linaro.org, devicetree@vger.kernel.org, linus.walleij@linaro.org, linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, broonie@kernel.org, spapothi@codeaurora.org Subject: Re: [alsa-devel] [PATCH v2 02/11] mfd: wcd934x: add support to wcd9340/wcd9341 codec X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" T24gTW9uLCAyMSBPY3QgMjAxOSwgU3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