Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp7024790rdb; Wed, 3 Jan 2024 01:50:46 -0800 (PST) X-Google-Smtp-Source: AGHT+IFZxXXBWw7e3+0nUW30Nl5/6APNM10YsV4Csn1DCBRGMH+hmaM7xEZKPoW3sUlXvy8ABHp9 X-Received: by 2002:a05:6a20:2593:b0:197:3253:8948 with SMTP id k19-20020a056a20259300b0019732538948mr3307685pzd.1.1704275446247; Wed, 03 Jan 2024 01:50:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704275446; cv=none; d=google.com; s=arc-20160816; b=t/SL4h98ir+q5Ll7XQD8Km+YRfa1XZjGO5pYM2rqzuLFqjImwfB4JlxdHsPnb73S1Y QbYb4rzPy3ZKk1c0hSV3UxdO2G+d2zgNaU6nFDxP0t0W9EecA1YKmDTyeiT95swJWwGA taozp22kAhAneMPrH0I3mSG3Qcr70cw8Lxdb0dc/vSuBbod9xGhubSbYF1wW2uf+hhvn GCgDeGtevXyz+i0BiXMadyH0tEElhhRZeX+UMu3LzvPtR1V4ptDGbaq/5v7qisrGw6iR GLdwyTL3o4813Kbqp3xoH6ccDV7O8F9fb6SIfjD8sbDpnG780W4QW78pLNWnse4GusSw Q6rA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:organization:references :in-reply-to:message-id:subject:cc:to:from:date; bh=XKgBiG8nc3TSUM0nzW8NNaBaKRtMAUIwrXnFayFfoH0=; fh=cwEs45AVQlbY3tE/01aiZxitwdzMwRM+csuKLvIWrLg=; b=oyGh6byAHux0+cnJOnsPJ4NCqEc/LQceckW6L9gHgsv+WYRs1MOmAk8640meaXFvlr dXLG0q+PQIGMoCmAJCbwhILe3aqeak55uRJ7OvYgQUJSNP4+6IabZoLe1u5g959FLgxI dWYTx2YYTHjA6RUqgbogUDjnzSTsLwm+qcpml/3sE7Duj9jV/8RUWqHRUyBO6xOhRn6A CZDH1k80lYgf4hdcScmKDb4VhA0QVan0Xzho8vDdtBfBenO4e+BxpwRf6B0Gg/AdE9dZ cSFMvF38LrdTYN81Acs8WeLB1yuV14hEXAkFO4/fWyU7R8pa3LqF8VDhAhTK11OiRU0z NdcQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-15350-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-15350-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id y8-20020a634b08000000b005cdb499a974si21693772pga.8.2024.01.03.01.50.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jan 2024 01:50:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-15350-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-15350-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-15350-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id AD50DB22E55 for ; Wed, 3 Jan 2024 09:50:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2312F18C3F; Wed, 3 Jan 2024 09:49:16 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 207ED18AE1; Wed, 3 Jan 2024 09:49:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=Huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.18.186.216]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4T4lJH4JC9z6K6Tw; Wed, 3 Jan 2024 17:47:43 +0800 (CST) Received: from lhrpeml500005.china.huawei.com (unknown [7.191.163.240]) by mail.maildlp.com (Postfix) with ESMTPS id BAE5F140B2F; Wed, 3 Jan 2024 17:49:09 +0800 (CST) Received: from localhost (10.202.227.76) by lhrpeml500005.china.huawei.com (7.191.163.240) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Wed, 3 Jan 2024 09:49:09 +0000 Date: Wed, 3 Jan 2024 09:49:08 +0000 From: Jonathan Cameron To: ChiYuan Huang CC: Jonathan Cameron , Krzysztof Kozlowski , Conor Dooley , Lars-Peter Clausen , Rob Herring , Uwe =?ISO-8859-1?Q?Kleine-K=F6nig?= , , , Subject: Re: [PATCH v2 2/2] iio: adc: rtq6056: Add support for the whole RTQ6056 family Message-ID: <20240103094908.00006baf@Huawei.com> In-Reply-To: <20240103010452.GA6655@linuxcarl2.richtek.com> References: <74db15583a9a68701dbff5a1a967c0d987d6dfb6.1703762557.git.cy_huang@richtek.com> <20231230120347.0816bd09@jic23-huawei> <20240102083042.GA13611@linuxcarl2.richtek.com> <20240102193642.0d6d2007@jic23-huawei> <20240103010452.GA6655@linuxcarl2.richtek.com> Organization: Huawei Technologies Research and Development (UK) Ltd. X-Mailer: Claws Mail 4.1.0 (GTK 3.24.33; x86_64-w64-mingw32) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-ClientProxiedBy: lhrpeml100006.china.huawei.com (7.191.160.224) To lhrpeml500005.china.huawei.com (7.191.163.240) On Wed, 3 Jan 2024 09:04:52 +0800 ChiYuan Huang wrote: > On Tue, Jan 02, 2024 at 07:36:42PM +0000, Jonathan Cameron wrote: > > On Tue, 2 Jan 2024 16:30:42 +0800 > > ChiYuan Huang wrote: > > > > > Hi, Johathan: > > > > > > Most comments are good and will be fixed in next revision. > > > > > > Still one comment I cannot make sure. > > > > > > Please see the comment that's below yours. > > > > > Hi ChiYuan, > > > > It's good practice to crop away all the parts where the discussion is finished. > > Makes it easier for people to find the bit you want discussion to continue on! > > > > I've done so in this reply. > > > > ... > > > > > + > > > > > enum { > > > > > RTQ6056_CH_VSHUNT = 0, > > > > > RTQ6056_CH_VBUS, > > > > > @@ -50,16 +60,29 @@ enum { > > > > > enum { > > > > > F_OPMODE = 0, > > > > > F_VSHUNTCT, > > > > > + F_SADC = F_VSHUNTCT, > > > > > > > > If the devices have different register fields, better to have different enums > > > > for them as well as that should result in less confusing code. > > > > > > > Actually, this is all the same register, just the control naming difference. > > > If not to define the new eum, I can remain to use the same field to handle rtq6059 part. > > > > If the bits in the register control the same thing across both parts then > > add a comment alongside the enum to make that clear. > > > > Given the naming that seems very unlikely. PGA and AVG would eman > > very different things to me for starters (oversampling vs a programmble > > gain amplifier on the front end) > > > I'm also thinking how to write this difference like as comments or a seperate enum. > But if to define a new enum, many function about the regfield controls must be seperated > for 6056 and 6059. > > > > > > > > > F_VBUSCT, > > > > > + F_BADC = F_VBUSCT, > > > > > F_AVG, > > > > > + F_PGA = F_AVG, > > > > > F_RESET, > > > > > F_MAX_FIELDS > > > > > }; > > What if to keep the original coding, just to rename the different part like as below > F_SADC -> F_RTQ6059_SDAC > F_BADC -> F_RTQ6059_BADC > F_PGA -> F_RTQ6059_PGA That works well. It makes it clear they are different across the parts. So agreed this is the best option. > > At least, the nameing already shows the difference between 6056 and 6059. > Only these three parts are different, others are the same like as F_OPMODE, F_RESET. > >