From patchwork Fri Apr 7 16:05:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Svyatoslav Ryhel X-Patchwork-Id: 80904 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp394842vqo; Fri, 7 Apr 2023 09:24:02 -0700 (PDT) X-Google-Smtp-Source: AKy350aThpC2bgAk0RI5zG6zs0mDu0GD1Gcv5/Oy8EvjPeA06QIoBV+6dHAq4Ncu4JDmEOuP5mZL X-Received: by 2002:a17:90b:4b07:b0:23b:49ad:a350 with SMTP id lx7-20020a17090b4b0700b0023b49ada350mr3171332pjb.9.1680884641782; Fri, 07 Apr 2023 09:24:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680884641; cv=none; d=google.com; s=arc-20160816; b=aOr9i3gGqLKZk6syEl/Ai/kIfIN7rqevJpBTxbld0b/OWJRXqzWomUvBhEmH6DJwzE mWAGYTZ0hSDFi/UC3Zp9REqeBWymEKgl4L3LRudasqqCCHkNBh8FjdxiC9FNlp5UMFh0 gYnTxNPM+oyYeNUhQ4qz/YZ7CCWob89AIOjRzjTrxTVk++CEw2LNEXiv86gO44VzTNTz 1S0i9I1L2+BIKB08SAlvKrnEitgtNI01PRykuLwLPMdoQm6LVSLUI77GLq75Nnx8rve5 3FofRGfzFcwOQA9lMq3dR6Ivw3OEr3lMIb8kuJj+HvvcbPc1OY/wxjVHWQemHat4rF3t Dmjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=wCfQI5H/IeKkKNwHRcXn8+odI3X7WyBM8i0fjwltF7k=; b=i+QMNDUsMiuz1bTGqTzCgjT0irq4jqmgiEfXayB0DNRvOpa5AJ+7PiEo8MKysYtCy5 GgeCdVuGFLZpsJjd9dLKUDlI9NeAcFV+kGqy8hTD0JDa84AmqXBZTo0Nry5xJq6/Td+v 2F3QoZ7in5q4Nq/pj6DWW7e0QjfB+sBOvZE7VywE4lCX0b0pHtAcvGqOntSRqmdMaaDS NboO68ym5VC+rFyMUcSmBascEq4si/0sC0J8YpSScpI9EJ9f2jNypDoFWWSKw/Utx9BC dTLXCAPhAWGYoID86LPxDFkuDLopcVZewgV3Ly9Xfq+emFQJna8gbnu7apTVa/c86BuY Ty9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=HNqR5326; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b20-20020a17090a991400b0023670bc014dsi2018135pjp.110.2023.04.07.09.23.49; Fri, 07 Apr 2023 09:24:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=HNqR5326; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234150AbjDGQFo (ORCPT + 99 others); Fri, 7 Apr 2023 12:05:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40114 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232599AbjDGQFi (ORCPT ); Fri, 7 Apr 2023 12:05:38 -0400 Received: from mail-ej1-x629.google.com (mail-ej1-x629.google.com [IPv6:2a00:1450:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1C00793F7; Fri, 7 Apr 2023 09:05:37 -0700 (PDT) Received: by mail-ej1-x629.google.com with SMTP id by26so9336002ejb.2; Fri, 07 Apr 2023 09:05:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1680883535; x=1683475535; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=wCfQI5H/IeKkKNwHRcXn8+odI3X7WyBM8i0fjwltF7k=; b=HNqR5326kJmWXU0ZtNwFpVFizD3u6TQfamQEFGsMyZvrKQSr0ALzvN139R9Mh4rNSw 1oi4T4+76roxk7BpyQ+FGw/skyEbL2rTMU/Z8fjF6uemqWTWcRdXgu3ZRVqS/H8MkQ+y JNvWwyoTTkB4ny7qaVo6/0gx5EePsVKDWR75uxDsQukLUX8LFdP7dNTyMNAApph4cMaO ukiiqs5hYDgjwyGjku8foeaRsjKLtygZWUTxrFHkr2JgCgxsc8ZTHNa0g8LSGHTQSShd 0E+1Zd3AJrdsp0qeHtWoCPtX3G+4dls8fbg9nfMFy3eo6zyyasM84iF5yW5OFcVm3C3J nx1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680883535; x=1683475535; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wCfQI5H/IeKkKNwHRcXn8+odI3X7WyBM8i0fjwltF7k=; b=qG47Paj9TLaw+5Q4wPOGYaFeZRbgbfVZddeFzabpDikOLFm1Aj2PqPaCqaNyTSdXsw AotYe91ZTon0DyaWlSLPbiyX9XK4pqPieaF1yQlDWBhOs5/5y2US2/KPmTh+OZBNWqyW lm0jHS08difx5Uzfz4OHmE5wsixSHE+UYy3zK6TMl2eU77398CNOVeQy2K8vWSqBsFEx DgxekFcUIRR2Fu3k+vkfAGVb5PMksiGT0SzSRTpYZPI3x2DZi78g4uPFB3LrnNp30grk q8xLvzNTVS1Gd588ZRTgFRdaLc+Q1SEqcezLPktfxCSs7eGpNfi2914PaonN+w30sVPh xVhg== X-Gm-Message-State: AAQBX9dwU5BbWX5Y+TTFHaUwnC371OQTUTevlv+HpQAnWttwkiY+TTUA 0Lm+7RJc2ry6nhfs17Bclgw= X-Received: by 2002:a17:907:7e95:b0:932:f88c:c2ff with SMTP id qb21-20020a1709077e9500b00932f88cc2ffmr11244427ejc.34.1680883535614; Fri, 07 Apr 2023 09:05:35 -0700 (PDT) Received: from xeon.. ([188.163.112.79]) by smtp.gmail.com with ESMTPSA id lf11-20020a170907174b00b0092b546b57casm2147585ejc.195.2023.04.07.09.05.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Apr 2023 09:05:35 -0700 (PDT) From: Svyatoslav Ryhel To: Guenter Roeck , Jean Delvare , Rob Herring , Krzysztof Kozlowski , Svyatoslav Ryhel Cc: linux-hwmon@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 1/2] dt-bindings: hwmon: ina2xx: add supply property Date: Fri, 7 Apr 2023 19:05:07 +0300 Message-Id: <20230407160508.20479-2-clamor95@gmail.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20230407160508.20479-1-clamor95@gmail.com> References: <20230407160508.20479-1-clamor95@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=0.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1762535293763491126?= X-GMAIL-MSGID: =?utf-8?q?1762535293763491126?= Add vs-supply property. Signed-off-by: Svyatoslav Ryhel Acked-by: Rob Herring --- Documentation/devicetree/bindings/hwmon/ti,ina2xx.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Documentation/devicetree/bindings/hwmon/ti,ina2xx.yaml b/Documentation/devicetree/bindings/hwmon/ti,ina2xx.yaml index 47af97bb4ced..8648877d2d01 100644 --- a/Documentation/devicetree/bindings/hwmon/ti,ina2xx.yaml +++ b/Documentation/devicetree/bindings/hwmon/ti,ina2xx.yaml @@ -57,6 +57,10 @@ properties: $ref: /schemas/types.yaml#/definitions/uint32 enum: [1, 2, 4, 8] + vs-supply: + description: phandle to the regulator that provides the VS supply typically + in range from 2.7 V to 5.5 V. + required: - compatible - reg @@ -73,5 +77,6 @@ examples: compatible = "ti,ina220"; reg = <0x44>; shunt-resistor = <1000>; + vs-supply = <&vdd_3v0>; }; }; From patchwork Fri Apr 7 16:05:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Svyatoslav Ryhel X-Patchwork-Id: 80902 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp385840vqo; Fri, 7 Apr 2023 09:09:13 -0700 (PDT) X-Google-Smtp-Source: AKy350aryemlf0RHbECTVeKQuSeeM7481Q+bxJd2l5cwO+SlB16o3D34NaFmdfRfa0IgDCPuDX/r X-Received: by 2002:a17:902:f546:b0:1a0:616d:7618 with SMTP id h6-20020a170902f54600b001a0616d7618mr3798958plf.51.1680883753450; Fri, 07 Apr 2023 09:09:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680883753; cv=none; d=google.com; s=arc-20160816; b=qh6PAj8GJ33HGT+1t7b5QgrYpNb/iyV9AWi54BofzCT+H8rCXlN8rqYklAEzc14/gx N7hYUu2al/Wl/UKbSLNtVcNBAzsiV9/QleGUkVBs+CpWl61PweFB9qf/PBTrgB7FEa3B IugijHzHTR6vukBZdpWz96YYkMi+c66WGtiZMXQeItUmAK5rc4y0kqGYQVRJ8cdRlOht GCERsbV3eOo3KVzfn0OFx/QeBA1ZMHr4oUoCfrErG6hBLwgPAERZZa2pbE7u2Dkhga9Y BUu4zuiDgIhHpsQIg6P5JOSP0iQU4bKt1VUcmGvNh1GuUGJTLGGhMOEeWe3yimyn7Avz CMpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=9Be+z7Xy+Kh/2Wz1YaqaT8qS802NhtWrhkE2FhoyrkA=; b=Iphn/4VRASgmfKTS0z7uK3EfG44xa1rOPBMiLh0xqKqdE5lWnBGoIbbOTWoazBCAOg 5Cq0LdtueDTjBEcuGJycUApluGb9Dj5lf/v2sIulE8MPMZC4u0W6vFlKaG7lHNpvIUxe ZcIORnT61GaurPDu3bpOp6uOVeWdDoy7QIkJHhekZjLlvsVSmdHG87qXBk4tMGSDWbEj vSYfn58ZCaXqExAfJx1nQ65Ij9A/72z0eSD3OP5EaiBjqF+VnVYy2nTdfdyQN8Y6OO3i 8mZxM7GPo2l4fNZQcTJll3KJUtKEvfxXwrWtqbMp+LSfr6H+D2sZJGA1tdcoyaywH1lJ LtiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=fa88eLJB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ky11-20020a170902f98b00b0019ad44844b3si4099323plb.118.2023.04.07.09.09.00; Fri, 07 Apr 2023 09:09:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=fa88eLJB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240652AbjDGQFq (ORCPT + 99 others); Fri, 7 Apr 2023 12:05:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40192 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235110AbjDGQFj (ORCPT ); Fri, 7 Apr 2023 12:05:39 -0400 Received: from mail-ej1-x62e.google.com (mail-ej1-x62e.google.com [IPv6:2a00:1450:4864:20::62e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5EBCCB742; Fri, 7 Apr 2023 09:05:38 -0700 (PDT) Received: by mail-ej1-x62e.google.com with SMTP id j22so9347428ejv.1; Fri, 07 Apr 2023 09:05:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1680883537; x=1683475537; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=9Be+z7Xy+Kh/2Wz1YaqaT8qS802NhtWrhkE2FhoyrkA=; b=fa88eLJBQATtfPY1DoSoeK+AZmGrh65RCjUN4LrdjtVXuQBIGmX1Bry/mZ1rgVKHRw oC5d3QX0fKER/4WNIXBC8xdVLMWYDZjjeHhsXctGCkYXYCVM9Gh2xSBq9cv+Qne9z+4Z sS0ymLkIsnMSvxAA16p9w19kQbBniBwcGUEz0Y7lfXaFZLts/PNl4uB6pPOsP6vwab1k H/xpCKUON6Dzl5Tr9nuLL2e0sEHwO7r6zVWGNHUPqDoXxiwVXeQA8jF0oCuLX1gqTTV7 6y2cv9RM/uKAdC+scnxrx2uwMcrUOqTKFuoCGYfn7CHbq/n+IzUhNY+Y5zn4YTDnpTAO ioqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680883537; x=1683475537; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9Be+z7Xy+Kh/2Wz1YaqaT8qS802NhtWrhkE2FhoyrkA=; b=mINHUfAV3wSUXXcBfFYXGtocF1nNhf/JZZx3++MCKVluOTILwu7fMxFmBWFbzzzhXK I4UnJYbSo6FzQAKEJUwy0u+Ns6v5HpW6HSFzzx5d6uO6M5Bmptd4NI+56fBTU6u4EVNb 1x4rSMWeQ1Yu4ab9MWVtkHydyr9AiL8CNwhizfZWYBXybdJlIWyD9wGltu249ZF0/Efh Uol1X0pw4zUZjuJllV2WOXu2b6XVvblVinN4W7eCz1N09vY5wZ3ueE/9QTT4GGIzNmq1 j6lcogyPSoNW6QlKnc6dWDoZ+nc44wy2c0k4eBR1O4RSXjuq1xgeUOlUSYLVnve/9YDi u/eQ== X-Gm-Message-State: AAQBX9f/hyWD5IFDKYRpcDlHji3IuoOo8ZuonVoG+kQWH9OjfmcfHTLL CvdVKFEIMb4QpYEO5f2z4JKmh32zvjw= X-Received: by 2002:a17:906:4094:b0:92a:11be:1a40 with SMTP id u20-20020a170906409400b0092a11be1a40mr9171921ejj.11.1680883536536; Fri, 07 Apr 2023 09:05:36 -0700 (PDT) Received: from xeon.. ([188.163.112.79]) by smtp.gmail.com with ESMTPSA id lf11-20020a170907174b00b0092b546b57casm2147585ejc.195.2023.04.07.09.05.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Apr 2023 09:05:36 -0700 (PDT) From: Svyatoslav Ryhel To: Guenter Roeck , Jean Delvare , Rob Herring , Krzysztof Kozlowski , Svyatoslav Ryhel Cc: linux-hwmon@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 2/2] hwmon: ina2xx: add optional regulator support Date: Fri, 7 Apr 2023 19:05:08 +0300 Message-Id: <20230407160508.20479-3-clamor95@gmail.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20230407160508.20479-1-clamor95@gmail.com> References: <20230407160508.20479-1-clamor95@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=0.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1762534362640659409?= X-GMAIL-MSGID: =?utf-8?q?1762534362640659409?= TI ina2xx sensors according to datasheets have dedicated vs supplies. Add it for proper work. Signed-off-by: Svyatoslav Ryhel --- drivers/hwmon/ina2xx.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/hwmon/ina2xx.c b/drivers/hwmon/ina2xx.c index 00fc70305a89..fd50d9785ccb 100644 --- a/drivers/hwmon/ina2xx.c +++ b/drivers/hwmon/ina2xx.c @@ -656,6 +656,10 @@ static int ina2xx_probe(struct i2c_client *client) return PTR_ERR(data->regmap); } + ret = devm_regulator_get_enable(dev, "vs"); + if (ret) + return dev_err_probe(dev, ret, "failed to enable vs regulator\n"); + ret = ina2xx_init(data); if (ret < 0) { dev_err(dev, "error configuring the device: %d\n", ret);