From patchwork Mon Jul 31 07:36:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Svyatoslav Ryhel X-Patchwork-Id: 708675 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 25144C04FE1 for ; Mon, 31 Jul 2023 07:36:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230155AbjGaHgz (ORCPT ); Mon, 31 Jul 2023 03:36:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45094 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231258AbjGaHgq (ORCPT ); Mon, 31 Jul 2023 03:36:46 -0400 Received: from mail-lf1-x129.google.com (mail-lf1-x129.google.com [IPv6:2a00:1450:4864:20::129]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BA9E8184; Mon, 31 Jul 2023 00:36:45 -0700 (PDT) Received: by mail-lf1-x129.google.com with SMTP id 2adb3069b0e04-4fe21e7f3d1so3832445e87.3; Mon, 31 Jul 2023 00:36:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1690789004; x=1691393804; 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=JEyRUtIvngdn2xYibH+4khtHK+n4dlGEHPyQwJGcHe4=; b=PO8oxGNHcTtgWi1NRPLGFfe54ktB+onMq+Xc77bm6mdLBo8mK9Eru0NyCXckzENbp9 VCLGcQmqHlSLmR99JjKdfJnjwkzhnUVBlMIjp4jecVwYWyR18NmCAuuueSdH1O8OvgfP zRxnTz409xJQ15OStMNHTjGb3rlO0gfPKWr2fM0rFTQZcciehI+LV8bvCuF1jjtVUNib RxSaMoV3GsoIHFdtvienaEt/idkwukYtYTIGYrr8yckrPneKWQy9Pv6KmtQGQqGLmQrw Ugb8uBONDZkjv9n0J36PrbAXjEsxELSsNpxlfOLw2+qX4eoESQzIDEVkKreZ4+5fLjRc YuJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690789004; x=1691393804; 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=JEyRUtIvngdn2xYibH+4khtHK+n4dlGEHPyQwJGcHe4=; b=AANWoNE/59OAoNhLJQU3fdHelAyZiSmdXM6hZwf0dkSYsY8Qu0jeEKDyZhWcrZhVsI berkNVBw9cCnOKVIlV/9AqAewctUXVWPtp6zkhq3sRgMA3jEz1C0Tn0gPmt24z1Nd4el bWxUTUZ7k+r8xQnYGUkvH/Ws6jDu5MgrvWCWjvAI0lGz1JDli34/BN4nXuSRfFJVp2bF cEGuduEeCzqMBn4+95IrnK3hLhJFqAmT0FsyMjxHMPaX3lcl2EuiA6QCPsfm5tTNCSto hjyKKBUjndLCVPZIcsCEYJyodi3ySpWAWmQENDO0K8MwFHYMgPEmWPsdNHLZ4V/C198b bTuw== X-Gm-Message-State: ABy/qLZx+ttxioYR9Frxl3VmmVhFg5z9NAme/VsED4A+5Aj/1bLyXqmB lbVYx+OIGCzmSvWLblX9cLA= X-Google-Smtp-Source: APBJJlGqFr6olxwW2pbc4pXOiXk6HLrOaBLUtvvbLXUPKKAC5Q9V7stexBXQklm5KlDjQVRFDcN61w== X-Received: by 2002:ac2:58c9:0:b0:4fd:cae7:2393 with SMTP id u9-20020ac258c9000000b004fdcae72393mr4853658lfo.2.1690789003805; Mon, 31 Jul 2023 00:36:43 -0700 (PDT) Received: from xeon.. ([188.163.112.48]) by smtp.gmail.com with ESMTPSA id m14-20020a056512014e00b004fe3229e584sm586898lfo.270.2023.07.31.00.36.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Jul 2023 00:36:43 -0700 (PDT) From: Svyatoslav Ryhel To: Iskren Chernev , Krzysztof Kozlowski , Marek Szyprowski , Matheus Castello , Sebastian Reichel , Rob Herring , Conor Dooley , Russell King , Alim Akhtar , Arnd Bergmann , Jernej Skrabec , Svyatoslav Ryhel , Claudiu Beznea , Stefan Hansson Cc: linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org Subject: [PATCH v3 2/4] power: max17040: pass status property from supplier Date: Mon, 31 Jul 2023 10:36:11 +0300 Message-Id: <20230731073613.10394-3-clamor95@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230731073613.10394-1-clamor95@gmail.com> References: <20230731073613.10394-1-clamor95@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Optionally pass status property from supplier if has support for it. If cell is online assume it is present as well. Signed-off-by: Svyatoslav Ryhel --- drivers/power/supply/max17040_battery.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/power/supply/max17040_battery.c b/drivers/power/supply/max17040_battery.c index d1075959dd46..3301e8a4b16c 100644 --- a/drivers/power/supply/max17040_battery.c +++ b/drivers/power/supply/max17040_battery.c @@ -389,6 +389,7 @@ static int max17040_get_property(struct power_supply *psy, switch (psp) { case POWER_SUPPLY_PROP_ONLINE: + case POWER_SUPPLY_PROP_PRESENT: val->intval = max17040_get_online(chip); break; case POWER_SUPPLY_PROP_VOLTAGE_NOW: @@ -400,6 +401,9 @@ static int max17040_get_property(struct power_supply *psy, case POWER_SUPPLY_PROP_CAPACITY_ALERT_MIN: val->intval = chip->low_soc_alert; break; + case POWER_SUPPLY_PROP_STATUS: + power_supply_get_property_from_supplier(psy, psp, val); + break; default: return -EINVAL; } @@ -415,9 +419,11 @@ static const struct regmap_config max17040_regmap = { static enum power_supply_property max17040_battery_props[] = { POWER_SUPPLY_PROP_ONLINE, + POWER_SUPPLY_PROP_PRESENT, POWER_SUPPLY_PROP_VOLTAGE_NOW, POWER_SUPPLY_PROP_CAPACITY, POWER_SUPPLY_PROP_CAPACITY_ALERT_MIN, + POWER_SUPPLY_PROP_STATUS, }; static const struct power_supply_desc max17040_battery_desc = { From patchwork Mon Jul 31 07:36:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Svyatoslav Ryhel X-Patchwork-Id: 708674 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4BF92C04E69 for ; Mon, 31 Jul 2023 07:37:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230357AbjGaHg6 (ORCPT ); Mon, 31 Jul 2023 03:36:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44546 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229813AbjGaHgt (ORCPT ); Mon, 31 Jul 2023 03:36:49 -0400 Received: from mail-lf1-x12a.google.com (mail-lf1-x12a.google.com [IPv6:2a00:1450:4864:20::12a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4A259EE; Mon, 31 Jul 2023 00:36:48 -0700 (PDT) Received: by mail-lf1-x12a.google.com with SMTP id 2adb3069b0e04-4fe0e34f498so6319506e87.2; Mon, 31 Jul 2023 00:36:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1690789006; x=1691393806; 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=6j0RW75STEI+5ZneQ+EaoJsYheY8+d1jwea7sk4EPgA=; b=T/MFohopS/BeXcEOIKcI+cKbio9xHJw754uW1T4iafV4Cpc+VMjI32RZqanKyS0c3u ClVlopqABlN0fqoAfTJQ1PEq2enBvzqMS1t65L3ynFlWX6m7Sq2zHmP0XKqYL/rEtfw8 DgZV22HlJaGMpLTaP9J+NixAUS71c+zIIQZ6o/8q/Cfdw1jPi1TAusj14G50cQHwGxcE C8NgkGO3B1UUKEMSgrPrL4wLGz43APbpoLnUIKnSbs4Uz0eVw5CU91pz7c5JnFMscf6B 5ZUrxnGap4NaiA5LuXs+0koOCjymRdigu1CsB4Kg/AHFVaSpftWmMQ504YBe4WpnuuiU sHOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690789006; x=1691393806; 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=6j0RW75STEI+5ZneQ+EaoJsYheY8+d1jwea7sk4EPgA=; b=b5RX22qso+PF+kbtNK7KlW/f2wIj+2J978XV8Dx4+2rMgkNrl759oDU2PU8fi6LXWq 0J3Qx/Rgjrxl58hFeMuh0/BcYhEHh7zSYtqE/Zn9V/RfNsxKRtdgeTAd+Ob9zpW8B14J KAG55c9uUuUjYXuTN2dYA4W7QlF/HbrcGuR+ROXpOoP2rtpgfmveBP3f3FxrwjTGP4mn M+H09ri9zywRLyonz6yE0ogLUpLflkjTbRV+qgdtTS51JytJUsy0sTxeoiIYFPkePZQc XmMGEfkahK1MURX5/Ur7gy+BQMGctJ/qCty3Xofze6C/dmM1la9yW6uUC+QcPl0MxHlx ztmA== X-Gm-Message-State: ABy/qLYlF1wuJsX3yM6eXYJL+ADu6dL99Nr1sCpBVeiqIVA+y/ufK6Mn OAzMP0PIOlhsYe6rQXtHtW1Pfs6rdvmI8A== X-Google-Smtp-Source: APBJJlEjVuG3rpNknzE+EPZVjnZ7ZAzAmvi4ufDOCu979EnSfo/KhZ/P7n7O1xJ0r5fu+kF5CV21Yw== X-Received: by 2002:ac2:5df3:0:b0:4fb:89b3:3373 with SMTP id z19-20020ac25df3000000b004fb89b33373mr4822337lfq.43.1690789006542; Mon, 31 Jul 2023 00:36:46 -0700 (PDT) Received: from xeon.. ([188.163.112.48]) by smtp.gmail.com with ESMTPSA id m14-20020a056512014e00b004fe3229e584sm586898lfo.270.2023.07.31.00.36.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Jul 2023 00:36:46 -0700 (PDT) From: Svyatoslav Ryhel To: Iskren Chernev , Krzysztof Kozlowski , Marek Szyprowski , Matheus Castello , Sebastian Reichel , Rob Herring , Conor Dooley , Russell King , Alim Akhtar , Arnd Bergmann , Jernej Skrabec , Svyatoslav Ryhel , Claudiu Beznea , Stefan Hansson Cc: linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org Subject: [PATCH v3 4/4] ARM: configs: s5pv210_defconfig: enable IIO required by MAX17040 Date: Mon, 31 Jul 2023 10:36:13 +0300 Message-Id: <20230731073613.10394-5-clamor95@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230731073613.10394-1-clamor95@gmail.com> References: <20230731073613.10394-1-clamor95@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org After adding support for passing temperature data from thermal sensor to MAX17040 it got dependency on CONFIG_IIO. From all defconfigs using MAX17040 only s5pv210_defconfig did not have IIO already enabled so let's enable it to avoid regression. Signed-off-by: Svyatoslav Ryhel --- arch/arm/configs/s5pv210_defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/configs/s5pv210_defconfig b/arch/arm/configs/s5pv210_defconfig index 4c1e480b5bbd..24070ee3d43e 100644 --- a/arch/arm/configs/s5pv210_defconfig +++ b/arch/arm/configs/s5pv210_defconfig @@ -97,6 +97,7 @@ CONFIG_MMC_SDHCI_S3C_DMA=y CONFIG_RTC_CLASS=y CONFIG_RTC_DRV_MAX8998=m CONFIG_DMADEVICES=y +CONFIG_IIO=y CONFIG_PWM=y CONFIG_PWM_SAMSUNG=y CONFIG_PHY_SAMSUNG_USB2=m