From patchwork Sun Jul 30 17:26:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Svyatoslav Ryhel X-Patchwork-Id: 12832 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:918b:0:b0:3e4:2afc:c1 with SMTP id s11csp1653174vqg; Sun, 30 Jul 2023 13:32:05 -0700 (PDT) X-Google-Smtp-Source: APBJJlH9PTzSK/g+z+uKHuzQ0lThIC/sPs+U1iWPWv0PxsEkP9fwC3MLIjHyUYufafSygMf/pItJ X-Received: by 2002:aa7:df02:0:b0:522:1dcb:c359 with SMTP id c2-20020aa7df02000000b005221dcbc359mr7796499edy.24.1690749125673; Sun, 30 Jul 2023 13:32:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690749125; cv=none; d=google.com; s=arc-20160816; b=r/0+1pypj1qn+5/ixEcsVq6VKn7cX6yFiYfZBWjtCza9fL244mAeSRHkTAcwE9Z+RR GkuN1D3YKlE09MKu/+WGSK0CpVaDETNOxrkI3ZYqs2jVuCfn7kqC/TwU6PFnX8Cd/zAW i7HwdxSmpeP5BQ3U0D3Nt5HHQFI08HQv60fPvx1g0xcUTc6rZJ/gq6LBX+Bm6OrXa/R1 mSfK17PeJOUyPbR+f3300smI4nGLaDLIAOlz/97hk1GaD6Zq7yPHQtmwhV5sYJrJ9U8w 0QnobkTkDQKcjXq1iZ4B7VL4AW5MEwchXGak8DHvDqSLCZzFGXfUU9AVRBsQmtKU9E7R akeA== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=dzf187hUxe2O6hKwbRXnpT5+gDrj5GGc4EGmM8OK0aQ=; fh=6EttwLj8TkcYgYcXwCN3+c7mDFZsrHr1IQ/n7Iq5Tzc=; b=boA0Ydl0mfEbs+a4J4anS8LqXHX7p+zY18xy9JBYA9Xq5pD+Fx52wkd+qn3Juf6Sjt ak78YmFpTRnhBJnjgCs+AzSXxFzcS66+kzWmqQfA5E8CD7n1IGhTMi01F6qbgM2owLBo ndJ/oLu/IBTFyk4g/xC+rEmU/4RCbewGljMEDB3OITAvj2mENju97yikUzzCQSVwAqtN l+uMubAinJ9WtzQRKYjWHhLM6KxkD+4sUP4ZlvhKgz5vdXbTjmnLh/lZogzFrswjNiYU aqng2ICr8lTNFQPY9YVkdtL9AczBBNGpHrl4ZKQrtBsDGd+crj603bgBL77P8qD6WKaC 8aUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=BOkcpZi5; 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 d26-20020aa7c1da000000b00522bb898a06si1471261edp.18.2023.07.30.13.31.42; Sun, 30 Jul 2023 13:32:05 -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=20221208 header.b=BOkcpZi5; 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 S229722AbjG3R1Q (ORCPT + 99 others); Sun, 30 Jul 2023 13:27:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44394 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229449AbjG3R1P (ORCPT ); Sun, 30 Jul 2023 13:27:15 -0400 Received: from mail-lj1-x22f.google.com (mail-lj1-x22f.google.com [IPv6:2a00:1450:4864:20::22f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A8C0818F; Sun, 30 Jul 2023 10:27:13 -0700 (PDT) Received: by mail-lj1-x22f.google.com with SMTP id 38308e7fff4ca-2b9bf52cd08so56029101fa.2; Sun, 30 Jul 2023 10:27:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1690738032; x=1691342832; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=dzf187hUxe2O6hKwbRXnpT5+gDrj5GGc4EGmM8OK0aQ=; b=BOkcpZi5YuxUHBYhh+opPkziGZPWZjGNFwUZ+E4NSDOx/MBbKBfqZ8AxLzeslVBvfn p6gQ608KilfcOB1sKPyHeQjFkCNnpCur2/WV12nPOyVQMzRBAfUe3AFT7NtzCUp9I+UT 39bX9VmuzQTHztK8gMVOqHLPNZ0T7aLUgD5s7yl2pXN0qCIdnSSoBqqys+54r3BU4d3f pvqY2EUvd2qDeW9SwOxEbbX9oQcx0NCO3bwNNUrLPW7gZy2/ZnTpXtNlOR9cZxrt+xlp gu0DJt7q/F7qnMZESELfzQvvvEHVM9bRzjrW+n59RMQYChdWfT2pI5TPWs10dwpj1fa6 jqlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690738032; x=1691342832; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=dzf187hUxe2O6hKwbRXnpT5+gDrj5GGc4EGmM8OK0aQ=; b=k2EDTPDIasbBIqzdWUlQ3GawDgaA3GfHnm5J0gL/oTn1STIx12aKIcQYU9SW2S2OCW uBP1O5MbvdZUew+EeNT3X3P4dcakgVJmhf98IBZegW9TAnef69xggfZmJj650dk9l+sI AbsdI1ugk9qT5uve3oKfWnhKqfg6c5EPDYfjKXPRwBinSgA4tFvId4yduZ5WVcwL9OtT oCaIPJnOeGnXYGp3lgSi4TfGOE2c8ADKPwNsg5rfjaXvcJF3PEVfmJjPZI8Ib6GxgQYX ya77cxWOmApaNeZjGjTNACRwppybs3n7SY3OhoQDliOTMvYQQYxRs4N4Uinx8mPuXVVP +AOQ== X-Gm-Message-State: ABy/qLZD1sqwSw6VYo1siqUOeJbqWn8bwPMlX8MreRGGven3pa97O59Z aV7p0Qkt/wrM2iJGZU98Ssw= X-Received: by 2002:a19:ca16:0:b0:4fb:89cd:9616 with SMTP id a22-20020a19ca16000000b004fb89cd9616mr4160268lfg.0.1690738031643; Sun, 30 Jul 2023 10:27:11 -0700 (PDT) Received: from xeon.. ([188.163.112.48]) by smtp.gmail.com with ESMTPSA id x6-20020ac24886000000b004f8555f7aa1sm1737117lfc.52.2023.07.30.10.27.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 30 Jul 2023 10:27:11 -0700 (PDT) From: Svyatoslav Ryhel To: Iskren Chernev , Krzysztof Kozlowski , Marek Szyprowski , Matheus Castello , Sebastian Reichel , Rob Herring , Conor Dooley , Svyatoslav Ryhel Cc: linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 0/3] Add optional properties to MAX17040 Date: Sun, 30 Jul 2023 20:26:45 +0300 Message-Id: <20230730172648.71578-1-clamor95@gmail.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham 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: INBOX X-GMAIL-THRID: 1772878955580471473 X-GMAIL-MSGID: 1772878955580471473 Extend properties supported by max17040 fuel gauge if it is accompanied by different devices. If max17040 is coupled with a charger, pass charger status since it should match and max17040 has no dedicated status detection ability. max17040_get_online can be reused for PRESENT property since if it is online it must be present. Finally, max17040 may be coupled with a dedicated thermal sensor which monitors battery temperature so lets add support for iio channel to match hw setup. --- Changes from v1: - documentation dropped monitored-battery and power-supplies (inherited from inclusion) - dropped passing charger health as battery health - dropped patch for simple battery cell support - switched iio_read_channel_raw to iio_read_channel_processed_scale - switched iio_channel_get to devm_iio_channel_get - re-organized implementation of temp channel (implemented in way *_get_optional functions usually act) --- Svyatoslav Ryhel (3): dt-bindings: power: supply: maxim,max17040: update properties power: max17040: pass status property from supplier power: max17040: get thermal data from adc if available .../bindings/power/supply/maxim,max17040.yaml | 31 +++++++++++++++++++ drivers/power/supply/max17040_battery.c | 27 ++++++++++++++++ 2 files changed, 58 insertions(+)