Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp236844rdh; Thu, 26 Oct 2023 00:09:31 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH/Is0R70LKdRm2d9jtxun+nO6OyBrGJutt82JcTCybIVZaXWo7Fc+WjQZMfMTUPtOT5X+8 X-Received: by 2002:a81:4945:0:b0:5a7:bbc2:4e12 with SMTP id w66-20020a814945000000b005a7bbc24e12mr20171429ywa.4.1698304171411; Thu, 26 Oct 2023 00:09:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698304171; cv=none; d=google.com; s=arc-20160816; b=kMDo61sCEZpvbpVfQdfvOt7oaot/JTiLpIUmBjY1mzYgDy14vJusrcH22UjX/hbtuI Y47qbkbkTplZ2dA86JLzODRGra/2ypKJ/WQPOUPQ3xYyvxhIiHIjMmBwS9nwBvUQet9d T0t76HDL6djmYxUN4FStqgQC+Hg0KLnOxt1qJAUR22309FE0IE6RrX4M9/YhyHNdHifE in6OrZ2ylkjlqRgoh7OROyXS4PLOg3csB4mJ8k9LOdep7Tn/N2RzDIwjsiZMPzXWeVdh ZxVUH56BdeqzLakdzbv5hd0QQ8r9u5ewlbie3aRKNaG4lAHyRyVVFqZnDiH4MHQTGn7N CP4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=ySilvzOExPXGfgGL5gO3l97kd5/IWTnoOuFkLbNpPUg=; fh=lhNkkbLm/HIJ1PE6fjk142ayDM14yYFU7I5GsZU8FkM=; b=TbV4J8eIHz/bJbEdnH49SLL8r+gK8CBxBT72cp7tIvlahGSA5sLvrS3cL82/GlRohh mnICA+K8SXrynjDKmfZ23xtkndHpOc1GnKDbsULbU++CClJCK0s6z7pwDy22nhSZlz8b gqXNZwMZjY3Ym0VQip9VB4kckWiHBTwv3K/Itu9DnGnECAFyt03bgcA8gFurmKahNqfR 0V2TDFuCNJOjwrK+wf+3uzAlbuOLsy7WjyyI9Pdt6rjAoRgDrHO4fHhWPFDqp6YK30MM nJ8jmrFLDB5UOuLcHEHKGgllLhteR0oT3D8+L4sEbHOIV7VYV6fkWyDBRCWv2mOKabde Yj/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=korg header.b=biGaYkkI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id n15-20020a819e4f000000b005a2045eaec8si12669716ywj.566.2023.10.26.00.09.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Oct 2023 00:09:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=korg header.b=biGaYkkI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 0ED4B81A8AA4; Thu, 26 Oct 2023 00:09:27 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344384AbjJZHJE (ORCPT + 99 others); Thu, 26 Oct 2023 03:09:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50872 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229518AbjJZHI7 (ORCPT ); Thu, 26 Oct 2023 03:08:59 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B915118D; Thu, 26 Oct 2023 00:08:56 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPS id 4BE74C433C8; Thu, 26 Oct 2023 07:08:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux.dev; s=korg; t=1698304136; bh=DtHEPpID31tWjOLNIsg0s4zUFeieNUVEZ4/N6Xx8pBg=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=biGaYkkIUXadCEOFWeaIlYmd0qN+5dJ1N+wpmgNw8dCBl496EPn16AiOlPtfBDkaq Xyv9Is543zyCs79WwACLAlE4XpLIhSMHHzVGczIfJUIYM8fU+Zp0w6JTd7S1WYvYRh y5BCnRVy9kGS+6oIMlvAjl67lZzpi3Niqc1fd3Xc= Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2E1DAC25B6F; Thu, 26 Oct 2023 07:08:56 +0000 (UTC) From: Richard Leitner Date: Thu, 26 Oct 2023 09:08:49 +0200 Subject: [PATCH v2 1/2] hwmon: ina238: add ina237 support MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Message-Id: <20231026-ina237-v2-1-dec44811a3c9@linux.dev> References: <20231026-ina237-v2-0-dec44811a3c9@linux.dev> In-Reply-To: <20231026-ina237-v2-0-dec44811a3c9@linux.dev> To: Guenter Roeck , Jean Delvare , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: linux-kernel@vger.kernel.org, linux-hwmon@vger.kernel.org, devicetree@vger.kernel.org, Richard Leitner X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1698304135; l=1834; i=richard.leitner@linux.dev; s=20231025; h=from:subject:message-id; bh=DtHEPpID31tWjOLNIsg0s4zUFeieNUVEZ4/N6Xx8pBg=; =?utf-8?q?b=3D13wTgnzZ8eFG?= =?utf-8?q?RhrZN8Iy6HnVFnWae7sKkzOY1EB9lahUvsEaMjrzh58PdKXFtZqWYG1DlKwUCmNu?= SF/WJvJ6DCmsg0NCCMCpjc24QzR2ARIwZsT27DB5zMKxDEoZzUUd X-Developer-Key: i=richard.leitner@linux.dev; a=ed25519; pk=ZYa5+0m9RFYtnNU6DLet7sHyPehnVHa0ucJlYiAu2NU= X-Endpoint-Received: by B4 Relay for richard.leitner@linux.dev/20231025 with auth_id=90 X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Thu, 26 Oct 2023 00:09:27 -0700 (PDT) The INA237 "85-V, 16-Bit, Precision Power Monitor With I2C Interface" is basically the same as INA328. Therefore add a corresponding compatible to the driver. According to the datasheet the main difference is the current and power monitoring accuracy: +------------------------+---------------+---------------+ | | INA238 | INA237 | +------------------------+---------------+---------------+ | Offset voltage | +/- 5µV | +/- 50µV | | Offset drift | +/- 0.02µV/°C | +/- 0.02µV/°C | | Gain error | +/- 0.1% | +/- 0.3% | | Gain error drift | +/- 25ppm/°C | +/- 50ppm/°C | | Common mode rejection | 140dB | 120dB | | Power accuracy | 0.7% | 1.6% | +------------------------+---------------+---------------+ As well as the missing DEVICE_ID register at 0x3F, which is currently not in use by the driver. Signed-off-by: Richard Leitner --- drivers/hwmon/ina238.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/hwmon/ina238.c b/drivers/hwmon/ina238.c index f519c22d3907..ca9f5d2c811b 100644 --- a/drivers/hwmon/ina238.c +++ b/drivers/hwmon/ina238.c @@ -33,7 +33,7 @@ #define INA238_BUS_UNDER_VOLTAGE 0xf #define INA238_TEMP_LIMIT 0x10 #define INA238_POWER_LIMIT 0x11 -#define INA238_DEVICE_ID 0x3f +#define INA238_DEVICE_ID 0x3f /* not available on INA237 */ #define INA238_CONFIG_ADCRANGE BIT(4) @@ -622,6 +622,7 @@ static const struct i2c_device_id ina238_id[] = { MODULE_DEVICE_TABLE(i2c, ina238_id); static const struct of_device_id __maybe_unused ina238_of_match[] = { + { .compatible = "ti,ina237" }, { .compatible = "ti,ina238" }, { }, }; -- 2.40.1