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=-0.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED 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 9876EC2BA19 for ; Tue, 14 Apr 2020 09:35:44 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 6AB352076A for ; Tue, 14 Apr 2020 09:35:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="st5fuopP" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6AB352076A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=YQtOcAHf7yZ8GwWbH/io89rJTJkqcdej2E2rKeO+VAI=; b=st5fuopPHzD1i7 TD0exnicHLIGWUEaDkEVBp8OEctQwJJfVVRQbYEBRH4wCJ2h2iSIY78odrcwru/WHi+DC7OKdfgXm 8p1bfS8BUr7cB1i7FOnZ8SEbISM2MQ+3kEWWeLdey1h+pwZW3ACZP6dWenETxYB2PWthjmd5BYKO7 TDll9dox/LOJCYCVvbKqYBsAH0fhrOFaW4BRMNiR3UVhztw5ovRJDlkftS6PVSc+7b3SffyjncNO8 IfotIHGMzTTFoezvGf8Mp4oB5Vq2AMDwcWp5omlKgoNkr/0Vn+SI+gTIgI1DesWoXKX0LyqLTJScL OhABlMrTgCq+jcdmAu0g==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jOHyh-0001rH-CZ; Tue, 14 Apr 2020 09:35:35 +0000 Received: from mga01.intel.com ([192.55.52.88]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jOHyV-0001jz-Gp; Tue, 14 Apr 2020 09:35:28 +0000 IronPort-SDR: t6uILsKy17G7mkuQMd8k9FpX+K53DhKEsnZUEaOlvN/rg7uVduzCpOADY5qi+9oFysGNJsG91q 7CNMFv0LGGgQ== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Apr 2020 02:35:22 -0700 IronPort-SDR: gZMXuRG+DwMXhibMHthYrh9eztu9ABAkZ8OokL5UVQ6tf6XqedvzMK1DckUlttKussD2p8SBql /TGa6XZ+NQVw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,382,1580803200"; d="scan'208";a="253148521" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.40]) by orsmga003.jf.intel.com with ESMTP; 14 Apr 2020 02:35:12 -0700 Received: from andy by smile with local (Exim 4.93) (envelope-from ) id 1jOHyL-000UXS-Gw; Tue, 14 Apr 2020 12:35:13 +0300 Date: Tue, 14 Apr 2020 12:35:13 +0300 From: Andy Shevchenko To: Matti Vaittinen Subject: Re: [PATCH v9 05/10] power: supply: bd70528: use linear ranges Message-ID: <20200414093513.GJ34613@smile.fi.intel.com> References: <8dcf498134adb09d88bd16138cdce65e9ffa0bb6.1586849281.git.matti.vaittinen@fi.rohmeurope.com> <20200414093243.GI34613@smile.fi.intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200414093243.GI34613@smile.fi.intel.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200414_023523_571797_AA40F7C3 X-CRM114-Status: GOOD ( 16.73 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Andrei Stefanescu , Heiko Stuebner , "Rafael J. Wysocki" , Tony Lindgren , Linus Walleij , Brendan Higgins , Liam Girdwood , Andreas Kemnade , "Angelo G. Del Regno" , Hsin-Hsiung Wang , linux-samsung-soc@vger.kernel.org, linux-omap@vger.kernel.org, Axel Lin , Gregory CLEMENT , Bartlomiej Zolnierkiewicz , Krzysztof Kozlowski , Markus Reichl , Bartosz Golaszewski , Chen-Yu Tsai , Andy Gross , markus.laine@fi.rohmeurope.com, Adam Thomson , devicetree@vger.kernel.org, Charles Keepax , mazziesaccount@gmail.com, linux-arm-msm@vger.kernel.org, Richard Fitzgerald , Mark Brown , linux-mediatek@lists.infradead.org, Matthias Brugger , Thomas Gleixner , Bjorn Andersson , linux-arm-kernel@lists.infradead.org, Support Opensource , Baolin Wang , Sangbeom Kim , Greg Kroah-Hartman , linux-pm@vger.kernel.org, Randy Dunlap , Sebastian Reichel , linux-kernel@vger.kernel.org, mikko.mutanen@fi.rohmeurope.com, Vinod Koul , Rob Herring , patches@opensource.cirrus.com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org On Tue, Apr 14, 2020 at 12:32:43PM +0300, Andy Shevchenko wrote: > On Tue, Apr 14, 2020 at 11:04:21AM +0300, Matti Vaittinen wrote: > > Change the bd70528 to use common linear_range code instead of > > implementing a copy of it in this driver. > > Couple of nits below which you can take as TODO items for the future. > (Because maintainer is fine with it according to the tags) > > ... > > > config CHARGER_BD70528 > > tristate "ROHM bd70528 charger driver" > > depends on MFD_ROHM_BD70528 > > + select LINEAR_RANGES > > > default n > > At some point you can remove this kind of defaults (see [1] for the details). Missed reference [1]: commit 0192f17529fa ("clean up x86 platform driver default values") > ... > > > +static const struct linear_range current_limit_ranges[] = { > > { > > .min = 5, > > .step = 1, > > - .vals = 36, > > - .low_sel = 0, > > > + .min_sel = 0, > > Perhaps it's better to have it aligned with max_sel, i.e. be 0x00. > Same applies to the rest of a such. > > > + .max_sel = 0x22, > > }, > > ... > > > +static const struct linear_range warm_charge_curr[] = { > > { > > .min = 10, > > .step = 10, > > - .vals = 20, > > - .low_sel = 0, > > + .min_sel = 0, > > + .max_sel = 0x12 > > Perhaps leaving comma is a good thing to avoid potential churn in the future > (if any of fields will be added here). Same applies to the reset of a such. > > > }, > > -- > With Best Regards, > Andy Shevchenko > > -- With Best Regards, Andy Shevchenko _______________________________________________ Linux-mediatek mailing list Linux-mediatek@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-mediatek 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=-0.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED 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 27E2BC2BA19 for ; Tue, 14 Apr 2020 09:35:30 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 E96BB2074D for ; Tue, 14 Apr 2020 09:35:29 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="pAjmxx61" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E96BB2074D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=zY0gTCh7VmgdyRjkHpEli4YdKmK+BnQWk0+Wpn49iRo=; b=pAjmxx61tslOL5 gsrty6NCWoJ37m4QEibRDDuxIn2udLP3CEF6FyPfu+e5eSwGx+TuIDGZcO1wM5pNCQE2f9Kxle+tj SCfKM52QJPVPQ5GdmFgYYRTo2O6lOkuOHsdP9ehNXVWxn/HXZomrC+aIjstq1jlB5/BuX576kOcVH KDtvVZmvu2URfTizsh4GNTlDrtlqzVLbUJBUPrqylutgtSjiWdPDxZl0DTXbK1zydtOr9gy3Q7CnC qsr9LncRrHq7MfCmEQCP14bnmkrttoPJ4xUUK6TNH+4NfhQv6mc2Gj528814cs8GO93asbzKt3ugf Fewf3BCLy6FC/PZEEG8w==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jOHyb-0001kW-Iq; Tue, 14 Apr 2020 09:35:29 +0000 Received: from mga01.intel.com ([192.55.52.88]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jOHyV-0001jz-Gp; Tue, 14 Apr 2020 09:35:28 +0000 IronPort-SDR: t6uILsKy17G7mkuQMd8k9FpX+K53DhKEsnZUEaOlvN/rg7uVduzCpOADY5qi+9oFysGNJsG91q 7CNMFv0LGGgQ== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Apr 2020 02:35:22 -0700 IronPort-SDR: gZMXuRG+DwMXhibMHthYrh9eztu9ABAkZ8OokL5UVQ6tf6XqedvzMK1DckUlttKussD2p8SBql /TGa6XZ+NQVw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,382,1580803200"; d="scan'208";a="253148521" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.40]) by orsmga003.jf.intel.com with ESMTP; 14 Apr 2020 02:35:12 -0700 Received: from andy by smile with local (Exim 4.93) (envelope-from ) id 1jOHyL-000UXS-Gw; Tue, 14 Apr 2020 12:35:13 +0300 Date: Tue, 14 Apr 2020 12:35:13 +0300 From: Andy Shevchenko To: Matti Vaittinen Subject: Re: [PATCH v9 05/10] power: supply: bd70528: use linear ranges Message-ID: <20200414093513.GJ34613@smile.fi.intel.com> References: <8dcf498134adb09d88bd16138cdce65e9ffa0bb6.1586849281.git.matti.vaittinen@fi.rohmeurope.com> <20200414093243.GI34613@smile.fi.intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200414093243.GI34613@smile.fi.intel.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200414_023523_571797_AA40F7C3 X-CRM114-Status: GOOD ( 16.73 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Andrei Stefanescu , Heiko Stuebner , "Rafael J. Wysocki" , Tony Lindgren , Linus Walleij , Brendan Higgins , Liam Girdwood , Andreas Kemnade , "Angelo G. Del Regno" , Hsin-Hsiung Wang , linux-samsung-soc@vger.kernel.org, linux-omap@vger.kernel.org, Axel Lin , Gregory CLEMENT , Bartlomiej Zolnierkiewicz , Krzysztof Kozlowski , Markus Reichl , Bartosz Golaszewski , Chen-Yu Tsai , Andy Gross , markus.laine@fi.rohmeurope.com, Adam Thomson , devicetree@vger.kernel.org, Charles Keepax , mazziesaccount@gmail.com, linux-arm-msm@vger.kernel.org, Richard Fitzgerald , Mark Brown , linux-mediatek@lists.infradead.org, Matthias Brugger , Thomas Gleixner , Bjorn Andersson , linux-arm-kernel@lists.infradead.org, Support Opensource , Baolin Wang , Sangbeom Kim , Greg Kroah-Hartman , linux-pm@vger.kernel.org, Randy Dunlap , Sebastian Reichel , linux-kernel@vger.kernel.org, mikko.mutanen@fi.rohmeurope.com, Vinod Koul , Rob Herring , patches@opensource.cirrus.com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, Apr 14, 2020 at 12:32:43PM +0300, Andy Shevchenko wrote: > On Tue, Apr 14, 2020 at 11:04:21AM +0300, Matti Vaittinen wrote: > > Change the bd70528 to use common linear_range code instead of > > implementing a copy of it in this driver. > > Couple of nits below which you can take as TODO items for the future. > (Because maintainer is fine with it according to the tags) > > ... > > > config CHARGER_BD70528 > > tristate "ROHM bd70528 charger driver" > > depends on MFD_ROHM_BD70528 > > + select LINEAR_RANGES > > > default n > > At some point you can remove this kind of defaults (see [1] for the details). Missed reference [1]: commit 0192f17529fa ("clean up x86 platform driver default values") > ... > > > +static const struct linear_range current_limit_ranges[] = { > > { > > .min = 5, > > .step = 1, > > - .vals = 36, > > - .low_sel = 0, > > > + .min_sel = 0, > > Perhaps it's better to have it aligned with max_sel, i.e. be 0x00. > Same applies to the rest of a such. > > > + .max_sel = 0x22, > > }, > > ... > > > +static const struct linear_range warm_charge_curr[] = { > > { > > .min = 10, > > .step = 10, > > - .vals = 20, > > - .low_sel = 0, > > + .min_sel = 0, > > + .max_sel = 0x12 > > Perhaps leaving comma is a good thing to avoid potential churn in the future > (if any of fields will be added here). Same applies to the reset of a such. > > > }, > > -- > With Best Regards, > Andy Shevchenko > > -- With Best Regards, Andy Shevchenko _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel