Message ID | cover.1704357933.git.cy_huang@richtek.com |
---|---|
Headers |
Return-Path: <linux-kernel+bounces-16412-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:6f82:b0:100:9c79:88ff with SMTP id tb2csp5495234dyb; Thu, 4 Jan 2024 01:05:09 -0800 (PST) X-Google-Smtp-Source: AGHT+IFrcvMxsxJwW6qeakwwbwQXyzFQRRAXmOCp5JZvvz0TYtBvSf5P0nhwPjtShBima1L1/y8T X-Received: by 2002:a05:6512:304c:b0:50e:7c70:fbe1 with SMTP id b12-20020a056512304c00b0050e7c70fbe1mr176600lfb.100.1704359108794; Thu, 04 Jan 2024 01:05:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704359108; cv=none; d=google.com; s=arc-20160816; b=QkNbz5tWorKLRWc61pLctkpnr7SL6AE+oELstDygCyu7C1WKe8yVnOY+4wItDZ9lLb M6OyRkb3+4gidYU1/FOlR2VNtpl2a+y8tsS5KPta5Rw8JTbncMRJZiGeWXN1pFZZcPIc hreLigwU5O2Z97DSKE3Y+2ongUi5m7QPU+sbajrRpa6H0dO9NFrXPA59gKPCUlDH1SRq aEszZxaCzSXWZ3yaDKPJADNM/8V5GJ4oUY7FonJqPatUNlMvLSA4AfZHejuBYOlACI/o 7DpCSRqQbSI+0javnLVMh6fvYDvloaRFPmxHh3QQYNozliuNonarEd45S1TWWuuXSLZ3 idzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :message-id:date:subject:cc:to:from; bh=nC75Qyob5+QaVCmDb+MCV5gNkxwmeDi45ocg6wKdpyU=; fh=ueBmHjRVA09A3FtSlcus0DauMGTzwSAKpWn3bAtSSko=; b=fuQ1BhpsReFRU8nnxMoKBmBLLSyA14DVhaqg74xCzPBV9yNoy+VssK1TubeXWMTyW/ 1LnzsJWVzpSPyCaA3g0hHp9Q8qBineVkxonJkcXjLotdILXzjcBdUHizKNStJsVrSKl1 pUfo7pn17tGtR5P/S3SMaJM2FtjH/ERhYuWpWJ/cvmfN5kdHqxaUZlngYbEfR9azDiC1 ny6TBl0PtXuZEErprJlQSkRhttQX/i+2SQSc1hbX4IAkeLGWGnKCTO8ukWHkCHZaptyE IHrIUAv3RC0hmI/3SPTS4ACIjAttO1mMx7mGKHm3lH3tz1NwKnKdqzmJnJ+z7BcklYqw qBcg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-16412-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-16412-ouuuleilei=gmail.com@vger.kernel.org" Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id c20-20020a05640227d400b0055344c8cfccsi13206995ede.567.2024.01.04.01.05.08 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jan 2024 01:05:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-16412-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-16412-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-16412-ouuuleilei=gmail.com@vger.kernel.org" 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 63F9B1F24E97 for <ouuuleilei@gmail.com>; Thu, 4 Jan 2024 09:05:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DC0BC20B02; Thu, 4 Jan 2024 09:04:17 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org Received: from mg.richtek.com (mg.richtek.com [220.130.44.152]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E54831EA95; Thu, 4 Jan 2024 09:04:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=richtek.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=richtek.com X-MailGates: (SIP:2,PASS,NONE)(compute_score:DELIVER,40,3) Received: from 192.168.10.47 by mg.richtek.com with MailGates ESMTPS Server V6.0(636814:1:AUTH_RELAY) (envelope-from <cy_huang@richtek.com>) (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256/256); Thu, 04 Jan 2024 17:03:32 +0800 (CST) Received: from ex4.rt.l (192.168.10.47) by ex4.rt.l (192.168.10.47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1258.27; Thu, 4 Jan 2024 17:03:32 +0800 Received: from linuxcarl2.richtek.com (192.168.10.154) by ex4.rt.l (192.168.10.45) with Microsoft SMTP Server id 15.2.1258.27 via Frontend Transport; Thu, 4 Jan 2024 17:03:32 +0800 From: <cy_huang@richtek.com> To: Jonathan Cameron <jic23@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Conor Dooley <conor+dt@kernel.org> CC: Lars-Peter Clausen <lars@metafoo.de>, Rob Herring <robh+dt@kernel.org>, ChiYuan Huang <cy_huang@richtek.com>, =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= <u.kleine-koenig@pengutronix.de>, <linux-iio@vger.kernel.org>, <devicetree@vger.kernel.org>, <linux-kernel@vger.kernel.org> Subject: [PATCH v4 0/2] RTQ6056: Add compatible for the same chip family Date: Thu, 4 Jan 2024 17:03:29 +0800 Message-ID: <cover.1704357933.git.cy_huang@richtek.com> X-Mailer: git-send-email 1.8.3.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Type: text/plain X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1787150057029534393 X-GMAIL-MSGID: 1787150057029534393 |
Series |
RTQ6056: Add compatible for the same chip family
|
|
Message
ChiYuan Huang
Jan. 4, 2024, 9:03 a.m. UTC
From: ChiYuan Huang <cy_huang@richtek.com>
RTQ6053 and RTQ6059 are the same RTQ6056 family.
The differences are listed below
- RTQ6053
Only change chip package type
- RTQ6059
1. Enlarge the shunt voltage sensing range
2. Shrink the pinout for VBUS sense pin
3. Due to 1, the scale value is also changed
Since v4:
- Remove the unused chip type enum
- Directly return in switch case of read_channel function
- Refine in write_raw switch case for IIO_CHAN_INFO_SAMP_FREQ
If sample frequency is fixed, return invalid and break switch case
- Use devdata->num_channels to replace the predefined constant
- Change the rtq6059 difference part for the control bitfield name from
the general 'F_xxx' to 'F_RTQ6059_xxx'
- Fix rtq6059 average sample variable store problem in 'set_average' function
Since v3:
- Add Reviewed-by tag in binding document patch
- Resotre the enum for control field.
- Put all the predefined datas/callbacks in dev_data.
- Remove the unused 'rtq6059_info'.
- Change 'default_conv_time' to 'default_conv_time_us'.
- Move the comment for default config above the dev_data setting line.
Since v2:
- Refine the description of 'compatible' property
ChiYuan Huang (2):
dt-bindings: iio: adc: rtq6056: add support for the whole RTQ6056
family
iio: adc: rtq6056: Add support for the whole RTQ6056 family
.../bindings/iio/adc/richtek,rtq6056.yaml | 9 +-
drivers/iio/adc/rtq6056.c | 275 ++++++++++++++++--
2 files changed, 263 insertions(+), 21 deletions(-)
base-commit: 610a9b8f49fbcf1100716370d3b5f6f884a2835a
Comments
On Thu, 4 Jan 2024 17:03:31 +0800 <cy_huang@richtek.com> wrote: > From: ChiYuan Huang <cy_huang@richtek.com> > > RTQ6053 and RTQ6059 are the same series of RTQ6056. > > The respective differences with RTQ6056 are listed below > RTQ6053 > - chip package type > > RTQ6059 > - Reduce the pinout for vbus sensing pin > - Some internal ADC scaling change > > Signed-off-by: ChiYuan Huang <cy_huang@richtek.com> Hi. One last follow on comment based on v4 changes to the enum naming. I think you missed one place they should be updated - the reg_field definitions. Thanks, Jonathan > > +/* > + * The enum is to present the 0x00 CONFIG RG bitfield for the 16bit RG value > + * field value order from LSB to MSB > + * RTQ6053/6 is OPMODE->VSHUNTCT->VBUSCT->AVG->RESET > + * RTQ6059 is OPMODE->SADC->BADC->PGA->RESET > + */ > enum { > F_OPMODE = 0, > F_VSHUNTCT, > + F_RTQ6059_SADC = F_VSHUNTCT, > F_VBUSCT, > + F_RTQ6059_BADC = F_VBUSCT, > F_AVG, > + F_RTQ6059_PGA = F_AVG, > F_RESET, > F_MAX_FIELDS > }; > > +static const struct reg_field rtq6059_reg_fields[F_MAX_FIELDS] = { > + [F_OPMODE] = REG_FIELD(RTQ6056_REG_CONFIG, 0, 2), > + [F_VSHUNTCT] = REG_FIELD(RTQ6056_REG_CONFIG, 3, 6), > + [F_VBUSCT] = REG_FIELD(RTQ6056_REG_CONFIG, 7, 10), > + [F_AVG] = REG_FIELD(RTQ6056_REG_CONFIG, 11, 12), > + [F_RESET] = REG_FIELD(RTQ6056_REG_CONFIG, 15, 15), Given these are the rtq6059 regfield definitions should they not be using the new enum names? > +}; > +