From patchwork Tue Jun 14 19:42:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: saravanan sekar X-Patchwork-Id: 12881504 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 B5E1FCCA480 for ; Tue, 14 Jun 2022 19:42:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239084AbiFNTmf (ORCPT ); Tue, 14 Jun 2022 15:42:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49966 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231372AbiFNTme (ORCPT ); Tue, 14 Jun 2022 15:42:34 -0400 Received: from mail-ej1-x62d.google.com (mail-ej1-x62d.google.com [IPv6:2a00:1450:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DB02F11C3D; Tue, 14 Jun 2022 12:42:32 -0700 (PDT) Received: by mail-ej1-x62d.google.com with SMTP id bg6so19277863ejb.0; Tue, 14 Jun 2022 12:42:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=K/Bb9QNZS4KUSJsXgLquKvLX7xOgHLYAfEYnI8Rwogk=; b=mG/eHEL8IHiiXX3lwQqj1ByYG2yfyG2p/ABwKfFepjbu51p8bk72vj3vwigthhvUZd OmNkAzGH8WChgCCGbskRfmp8fwYA7Yo07SDKpKTTYQfIXkbX9BD+VnQ/LueokRpxC3xF m+6ezwYpOdOekV2qf82AZR4FwDlPsvn8+R+Hndet0eCEzwchA9XtatzIIxObArp8HNvW b1tueDp0Gzq52gv0NFv2+rSL7HPYE5Lu4GEjhwynfW4JlKp9OxVm0IoLxUGzyCEQI+yk opWsH0HZsJCwcU0SO/KucZSVFDfQp9wVezyINtUiUh/hoA1h+3MUXDgCojU+F/K3yJEW QDdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=K/Bb9QNZS4KUSJsXgLquKvLX7xOgHLYAfEYnI8Rwogk=; b=dVBMlxfETJWZWksptHylSgEBVLC0/tK2L4d8p5MRIgMRgQOGHh+KvUgrsyH9Hp1ZVn VO0DwjIQ6TFZkOINsQ39UUU/g+J2GoN6W+sx0ZjhhfLxhLEtKVFmnN2Y7TUgCwKjQHZV rzTrezlSekwyQ6RQ0EIVBZdqmk8aWsq4hWK69sZjWScSM1Z5fKXw/+cxeiJ2unpO8tgx bOc5RugNbr3eAIFhH8kPh4bojkn4+JvCY06vSHmbThX4lwLGnzoAmybZaEiAhU4YlKwn QMwgFKsxcJiJduyO0llC/zUYWIS1g2DG/C/aLvm9lqbsn+degrHIvs/OQIPHmCemA3yx 0tNg== X-Gm-Message-State: AOAM532xffy2gIpStvQmOcphIRL+S2ywo0uMmoeMP7Pl9+qX7n4FRMU8 JNQFIKDSqvs6M4aYfI4gu0I= X-Google-Smtp-Source: AGRyM1sholsx+b9UD9l3BsHE6Sq67aqZchS39iu04cYO0cmXVVcj+06mgjn4CLJP/bgGew8Xtt2NPw== X-Received: by 2002:a17:906:2086:b0:717:4e91:f1db with SMTP id 6-20020a170906208600b007174e91f1dbmr5633590ejq.345.1655235751260; Tue, 14 Jun 2022 12:42:31 -0700 (PDT) Received: from localhost.localdomain (p5b3f7f9c.dip0.t-ipconnect.de. [91.63.127.156]) by smtp.gmail.com with ESMTPSA id vw5-20020a170907058500b00712057b037fsm5306699ejb.167.2022.06.14.12.42.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Jun 2022 12:42:29 -0700 (PDT) From: Saravanan Sekar To: sre@kernel.org, lee.jones@linaro.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, jic23@kernel.org, lars@metafoo.de, andy.shevchenko@gmail.com Cc: linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-iio@vger.kernel.org, Saravanan Sekar Subject: [PATCH v2 1/6] iio: adc: mp2629: fix wrong comparison of channel Date: Tue, 14 Jun 2022 21:42:20 +0200 Message-Id: <20220614194225.2226447-1-sravanhome@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org Input voltage channel enum is compared against iio address instead of channel. Fixes: 7abd9fb64682 ("iio: adc: mp2629: Add support for mp2629 ADC driver") Signed-off-by: Saravanan Sekar Reviewed-by: Andy Shevchenko --- drivers/iio/adc/mp2629_adc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/adc/mp2629_adc.c b/drivers/iio/adc/mp2629_adc.c index aca084f1e78a..e7fbfe92e884 100644 --- a/drivers/iio/adc/mp2629_adc.c +++ b/drivers/iio/adc/mp2629_adc.c @@ -73,7 +73,7 @@ static int mp2629_read_raw(struct iio_dev *indio_dev, if (ret) return ret; - if (chan->address == MP2629_INPUT_VOLT) + if (chan->channel == MP2629_INPUT_VOLT) rval &= GENMASK(6, 0); *val = rval; return IIO_VAL_INT; From patchwork Tue Jun 14 19:42:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: saravanan sekar X-Patchwork-Id: 12881502 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 3E45BC43334 for ; Tue, 14 Jun 2022 19:42:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243571AbiFNTmf (ORCPT ); Tue, 14 Jun 2022 15:42:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49968 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239084AbiFNTme (ORCPT ); Tue, 14 Jun 2022 15:42:34 -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 1162C1AF11; Tue, 14 Jun 2022 12:42:34 -0700 (PDT) Received: by mail-ej1-x62e.google.com with SMTP id m20so19112942ejj.10; Tue, 14 Jun 2022 12:42:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=hZ1It0Vji/uE1zL1NVsuKRSwGtzM25+5b2pW/UiacoM=; b=bG2s7f9s4KR5wI0lk+iLuurCztbJKiT/HvGkbacOb38P0PQQdKOnIo3PAn8W3Yt/3I Sx9VnUrA+xqOorczn34EbUQ6GV4b6ET1kNFhoyRUTBxQHbEt5Go/5OmnQAGD5h09eStw BcsKraHMBEv7ya/xq8HsnERloZytbq3s9e8lDDypOUlUEQIh5qFC0Gtp8ZHtxFmaMF0a xlQ0OiKTakNfNbXjPUHdn1+qV0S6bYfy39IsOpMGpyd4hoR9wMpRbR3PoiVUWQ+JiwW0 QJkyP05/eloF+vMOWOM2B9ehj9L/NpaTtLMvnTRO5mXBvbBOlGyfkzekSdJ5ukuSmmMI /Ukw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=hZ1It0Vji/uE1zL1NVsuKRSwGtzM25+5b2pW/UiacoM=; b=DNK6IUk0Kf5sdmSpvhCmHTKocHJk5C1+siVKTqfmPbNc0q1fXbLJj9/P0x5qRmPIWD FGORfhdypx7sko88s0QYj8jd0C5e/OkB+VX/QU7MLm7bxXbr+QX3hknifRj5tnKtANZC VnA4R9y0tK16q2E2d/aWIU1Ka3uQUAcSmZgwfxaaPdxhOoBdAWo6DHyzf+YEQBxhSeGe qUJCtg6c1H7F3XaZ2nTKdwnrIAdGbkzUamQDarm6q1BduX41NlAcNI20jn1o2rdsFlFc hQ8GK89lUN8dQEHFs86EtG+sL+Yg/vUZY58FITsumyALlUfEXNiU151YVvrkgLSnk9Xi TZtg== X-Gm-Message-State: AOAM531bj750O0sKgwzyhHRYv+VO49hGkSXPKaTl6OtGQEY5ihKLbuvj tqNFWjU4JflzDt0gRdclgG4= X-Google-Smtp-Source: ABdhPJwGLThmOY/gqw8ITxsfPAEBmH65HGNKJE2v/7+lMQIbf6utq9eUYuJEwi9ainPLwysM/wptog== X-Received: by 2002:a17:906:3e8e:b0:70f:9a81:8218 with SMTP id a14-20020a1709063e8e00b0070f9a818218mr5689405ejj.525.1655235752571; Tue, 14 Jun 2022 12:42:32 -0700 (PDT) Received: from localhost.localdomain (p5b3f7f9c.dip0.t-ipconnect.de. [91.63.127.156]) by smtp.gmail.com with ESMTPSA id vw5-20020a170907058500b00712057b037fsm5306699ejb.167.2022.06.14.12.42.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Jun 2022 12:42:31 -0700 (PDT) From: Saravanan Sekar To: sre@kernel.org, lee.jones@linaro.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, jic23@kernel.org, lars@metafoo.de, andy.shevchenko@gmail.com Cc: linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-iio@vger.kernel.org, Saravanan Sekar Subject: [PATCH v2 2/6] dt-bindings: mfd: Add mp2733 compatible Date: Tue, 14 Jun 2022 21:42:21 +0200 Message-Id: <20220614194225.2226447-2-sravanhome@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220614194225.2226447-1-sravanhome@gmail.com> References: <20220614194225.2226447-1-sravanhome@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org Add new compatible for mp2733 mfd driver. Signed-off-by: Saravanan Sekar --- Documentation/devicetree/bindings/mfd/mps,mp2629.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/mfd/mps,mp2629.yaml b/Documentation/devicetree/bindings/mfd/mps,mp2629.yaml index f91acc42d652..fe13869e2c58 100644 --- a/Documentation/devicetree/bindings/mfd/mps,mp2629.yaml +++ b/Documentation/devicetree/bindings/mfd/mps,mp2629.yaml @@ -19,6 +19,7 @@ description: | properties: compatible: const: mps,mp2629 + const: mps,mp2733 reg: maxItems: 1 From patchwork Tue Jun 14 19:42:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: saravanan sekar X-Patchwork-Id: 12881503 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 5B35CC43334 for ; Tue, 14 Jun 2022 19:42:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245396AbiFNTmh (ORCPT ); Tue, 14 Jun 2022 15:42:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50094 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231372AbiFNTmg (ORCPT ); Tue, 14 Jun 2022 15:42:36 -0400 Received: from mail-ej1-x636.google.com (mail-ej1-x636.google.com [IPv6:2a00:1450:4864:20::636]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7D7CF1AF11; Tue, 14 Jun 2022 12:42:35 -0700 (PDT) Received: by mail-ej1-x636.google.com with SMTP id n10so19154340ejk.5; Tue, 14 Jun 2022 12:42:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=oYPUCPpmxpyEx42uQE8MmC44ye7jAfGebCzFBDxBGfk=; b=iEXSYdiBWaLdBCUYldspwmvfN9OdfW6aYTrBwMkQB2QU53/BLVhomXFC3CW/mmPefM 7TIt6DIx5jijYPpDFYE5qp0WssDS6XfIk8Tg9jRXlEn+eafUdLTWN4Od6VmEgnjyS5/4 sHXr8Htxj9eg6MTUQ1eXABFy+1L9T2eWklhlbycOAkV86kwHzUDtZX7UGb2W2EC7Gh2U BwL9tMIcj+rJWvxcMA7XFBrqT/ffbrXmKp7Vq0NnbGZesrjDaQ4I7VAFpnvVWXRuirE3 oqz8iDVxc5QRt5AfuMFaHumJq9ivpfFS9UHxCRYTxgpyJWqp8FAY6xCZ6chX465rfRzn 9UUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=oYPUCPpmxpyEx42uQE8MmC44ye7jAfGebCzFBDxBGfk=; b=A/kXb4ZqHv3zXtJJLRLvx2sRbUXVmwKGCdth1gFnZhW+PthKnXlFOhURNIMVK+IgoD 1xOOWqV3kathG+ga6htgkqspws0nxa7wZigkKfBNozb5SoyeL8hdJn9erHiIf5DBltOA HCNbOjH8pzh4z+nh/R992y5S7eWcZpP8mRVYjJemhkCsi2jo2WDWU8gDYFzp8KAq+heA LjvF/4JKVmv21MczZnkADfzCxB5OCN0KYUWLIFKB/Q7/Z1aAFoXcY2HvPMhZXO5jAnD5 OnLVRdyWJvlfexeE4ulXXRD8YydYG+PeAF+tQbprP1WUD5DFFWwUljrTbklfWsBj0S+G FvVA== X-Gm-Message-State: AOAM530rwzwiMz4ro+4YUjpVCNMmXop93bAK4ajuFKFblNoVBeLWXIBk c/PN5BDo6whXbLGuGeqBUMM+arbrHXxQJw9b X-Google-Smtp-Source: ABdhPJx0BzhFdxFNd0KSOCMUDpab8aoaYbBp0VpBfwaiMX7znUHo9mGkZ9ddST3AsWI73z3E/F1Dyg== X-Received: by 2002:a17:906:7484:b0:712:1178:dbf3 with SMTP id e4-20020a170906748400b007121178dbf3mr5623038ejl.72.1655235753895; Tue, 14 Jun 2022 12:42:33 -0700 (PDT) Received: from localhost.localdomain (p5b3f7f9c.dip0.t-ipconnect.de. [91.63.127.156]) by smtp.gmail.com with ESMTPSA id vw5-20020a170907058500b00712057b037fsm5306699ejb.167.2022.06.14.12.42.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Jun 2022 12:42:33 -0700 (PDT) From: Saravanan Sekar To: sre@kernel.org, lee.jones@linaro.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, jic23@kernel.org, lars@metafoo.de, andy.shevchenko@gmail.com Cc: linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-iio@vger.kernel.org, Saravanan Sekar Subject: [PATCH v2 3/6] mfd: mp2629: Add support for mps mp2733 battery charger Date: Tue, 14 Jun 2022 21:42:22 +0200 Message-Id: <20220614194225.2226447-3-sravanhome@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220614194225.2226447-1-sravanhome@gmail.com> References: <20220614194225.2226447-1-sravanhome@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org mp2733 is updated version of mp2629 battery charge management device for single-cell Li-ion or Li-polymer battery. Additionally supports usb fast-charge and higher range of input voltage. Signed-off-by: Saravanan Sekar --- drivers/mfd/mp2629.c | 5 ++++- include/linux/mfd/mp2629.h | 6 ++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/mfd/mp2629.c b/drivers/mfd/mp2629.c index 16840ec5fd1c..f59c97e70f83 100644 --- a/drivers/mfd/mp2629.c +++ b/drivers/mfd/mp2629.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include @@ -43,6 +44,7 @@ static int mp2629_probe(struct i2c_client *client) return -ENOMEM; ddata->dev = &client->dev; + ddata->chip_id = (uintptr_t)device_get_match_data(&client->dev); i2c_set_clientdata(client, ddata); ddata->regmap = devm_regmap_init_i2c(client, &mp2629_regmap_config); @@ -60,7 +62,8 @@ static int mp2629_probe(struct i2c_client *client) } static const struct of_device_id mp2629_of_match[] = { - { .compatible = "mps,mp2629"}, + { .compatible = "mps,mp2629", .data = (void *)CHIP_ID_MP2629 }, + { .compatible = "mps,mp2733", .data = (void *)CHIP_ID_MP2733 }, { } }; MODULE_DEVICE_TABLE(of, mp2629_of_match); diff --git a/include/linux/mfd/mp2629.h b/include/linux/mfd/mp2629.h index 89b706900b57..ee0e65720c75 100644 --- a/include/linux/mfd/mp2629.h +++ b/include/linux/mfd/mp2629.h @@ -9,9 +9,15 @@ #include #include +enum mp2xx_chip_id { + CHIP_ID_MP2629, + CHIP_ID_MP2733, +}; + struct mp2629_data { struct device *dev; struct regmap *regmap; + enum mp2xx_chip_id chip_id; }; enum mp2629_adc_chan { From patchwork Tue Jun 14 19:42:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: saravanan sekar X-Patchwork-Id: 12881505 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 AE0F3CCA481 for ; Tue, 14 Jun 2022 19:42:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245736AbiFNTmh (ORCPT ); Tue, 14 Jun 2022 15:42:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50148 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245256AbiFNTmh (ORCPT ); Tue, 14 Jun 2022 15:42:37 -0400 Received: from mail-ej1-x62d.google.com (mail-ej1-x62d.google.com [IPv6:2a00:1450:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 711C01C91F; Tue, 14 Jun 2022 12:42:36 -0700 (PDT) Received: by mail-ej1-x62d.google.com with SMTP id o7so19175406eja.1; Tue, 14 Jun 2022 12:42:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=18oHUFXG2mUdcVQ1YXANbaKmOh1LlQNFTNBa3/M0B6U=; b=CGKqFqYtINJLcYasTd31Lo3Jgb+PK0ks3CCzmX9ymkKJwWIyb/UtJzQ0j7C7XsGKa0 r68s7fJsZVp/4i6ik8PQAPa2RoVlIAAy4LIEqMKY2raPVz2EeuXyJp7X4Ixsf15ysoU7 difKbRonDfW+jR2mynsHDefRzl1mDvZf5ebgT/s0igQMs+KaRDLn9A9tjcrPSjMKmMxi WIV2sYlG4Y3P3B5OK5LD4kKIA9JjRITnPfTkHaurq/U2UGKgxhOlqlpvddatIIZsfee3 Yk9l2nipXY2kS9t71o7WPMG2hBi3FpenB4RxRdoV5wP3e09Y/UfM/KYvlIlr+jzwpMu/ hibg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=18oHUFXG2mUdcVQ1YXANbaKmOh1LlQNFTNBa3/M0B6U=; b=ZirrASoE9KkRTosw/EWpG0MbCo4dw4vbF1J6kC1Io8NgfeKi+RvE7lahttUennCPed 3I9SLEzvnAkZxtoNa0+QrQLtQAAq3MmmfdrTKHjLN6b+8MTx1Iow1JSdT2Yibs3FAJcs 86AGR+ksMRZVWSKe5hJFknU68ni9OEuvzmeySRd1F7tHK6nSYsZ5SlYAGib2Sg7DCkba 6vSA1h/abXL0+Ptp/0Iay11fSA9+gdQ0+OmzVNBLNTU6h/UksSdH012smnOgaCSMPO4V FNg9lrmryy9eSZq1oUiTVimC2A8RKSkM4wbp8xCT803hVYFtjuaFsKzZRppUJ6eEnsmw VV1w== X-Gm-Message-State: AOAM5311l9oKXthsWA3S0O4i8bqnWt64Qdvz72s+68FolCoRsEWE3HOg TyALJ3gPcnlYYZZCSWkhDE4= X-Google-Smtp-Source: ABdhPJxdALFhwQI2RlqE7TUoCCGB1gDIlxTax01tTePsyJZMOt7kPZAcfI+I1a2wNH9zxooxDDVjrQ== X-Received: by 2002:a17:907:1c01:b0:6f4:2692:e23 with SMTP id nc1-20020a1709071c0100b006f426920e23mr5427263ejc.243.1655235755002; Tue, 14 Jun 2022 12:42:35 -0700 (PDT) Received: from localhost.localdomain (p5b3f7f9c.dip0.t-ipconnect.de. [91.63.127.156]) by smtp.gmail.com with ESMTPSA id vw5-20020a170907058500b00712057b037fsm5306699ejb.167.2022.06.14.12.42.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Jun 2022 12:42:34 -0700 (PDT) From: Saravanan Sekar To: sre@kernel.org, lee.jones@linaro.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, jic23@kernel.org, lars@metafoo.de, andy.shevchenko@gmail.com Cc: linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-iio@vger.kernel.org, Saravanan Sekar Subject: [PATCH v2 4/6] iio: adc: mp2629: restrict input voltage mask for mp2629 Date: Tue, 14 Jun 2022 21:42:23 +0200 Message-Id: <20220614194225.2226447-4-sravanhome@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220614194225.2226447-1-sravanhome@gmail.com> References: <20220614194225.2226447-1-sravanhome@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org add support for mp2733 which is updated version of mp2629 with a higher range of input voltage. Signed-off-by: Saravanan Sekar --- drivers/iio/adc/mp2629_adc.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/iio/adc/mp2629_adc.c b/drivers/iio/adc/mp2629_adc.c index e7fbfe92e884..28d048eefce3 100644 --- a/drivers/iio/adc/mp2629_adc.c +++ b/drivers/iio/adc/mp2629_adc.c @@ -64,6 +64,7 @@ static int mp2629_read_raw(struct iio_dev *indio_dev, int *val, int *val2, long mask) { struct mp2629_adc *info = iio_priv(indio_dev); + struct mp2629_data *ddata = dev_get_drvdata(info->dev); unsigned int rval; int ret; @@ -73,8 +74,10 @@ static int mp2629_read_raw(struct iio_dev *indio_dev, if (ret) return ret; - if (chan->channel == MP2629_INPUT_VOLT) + if (chan->channel == MP2629_INPUT_VOLT && + ddata->chip_id == CHIP_ID_MP2629) rval &= GENMASK(6, 0); + *val = rval; return IIO_VAL_INT; From patchwork Tue Jun 14 19:42:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: saravanan sekar X-Patchwork-Id: 12881506 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 9A4F7CCA47B for ; Tue, 14 Jun 2022 19:42:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344143AbiFNTmi (ORCPT ); Tue, 14 Jun 2022 15:42:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50210 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343925AbiFNTmi (ORCPT ); Tue, 14 Jun 2022 15:42:38 -0400 Received: from mail-ej1-x62d.google.com (mail-ej1-x62d.google.com [IPv6:2a00:1450:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DA2581EC76; Tue, 14 Jun 2022 12:42:36 -0700 (PDT) Received: by mail-ej1-x62d.google.com with SMTP id bg6so19277863ejb.0; Tue, 14 Jun 2022 12:42:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=iHBrk/R6rOQSUwzKFPbJ8q27LHisn+BQKnnz2b2fGcs=; b=H35454TY3tR6vSzQkhYmJu9fksU5jHiSzl8VMbQvIuHJk8ZutH7z51kTeodM7RSKiM QfN/1iorvITM7Zavlr+Lro3sKnwKo2AgKr4v02lqwBO34HxkFR4fflgJ14CMJHuHwima PbBEmadtFxXN1ozVqhCg4FEoxDH6bbA+oS5bKI7RpXMcAnrUPNaDKK09VpDXnSA2vPUN vugrz4jNcmN8pHeL0BJxhYMzG6zDCKSf9iLb95kzrHwpcHYKSFTRSTaaenqfmXv1EKLh hV1FkeGw54Q5/b5Dh+dtFnjrj9UAWZLjGa7HqZYJD9zReEAFBmrj2qbuk2xsX2IevdRo qLhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=iHBrk/R6rOQSUwzKFPbJ8q27LHisn+BQKnnz2b2fGcs=; b=nt6iDgIxJ/pwnoP2eKoUz0n1qFcyazJJPCjznOrYCzVlU2DWeBsdkjp1mm2M8UTkgL 6fKTOKQy2BzT3qqL/In0KVTc/nwtJaRr51QSpyqhmjHurGLxfXBWCBx0WlGXux071MQ4 KjMphBQkbVLZhusACDTZvWbw8Atr1Nd4h1VB+zbg96HSp6tWT0uyVln5m1rWkTnkF+Jb 5vipTwIlYly0I7TmBE+Hdc/YOG6Ep+m0C8Ov990j97Y6kN5irrVujLoUOLaVobH6IbPI Ci+hV3nDQPfasIlr9UUMeuHjXnhdyPVjGBSU18JViN93qRfpg+amPutzMiS7hwW7XFmo fSQw== X-Gm-Message-State: AOAM5329HcHeO0GRhngepRKfIyM3fpnVVi2xueKzGFTbIdQSxpa1//nY z+bbgUi+aFL73I1wZ9Qq8Zk= X-Google-Smtp-Source: ABdhPJzMSFIfMhIpaGGdIJmGyaXGao5nSGLm0+g1w6dlE+B1pA4SvyiRCWyOEoJ6sWU11eKV2pUu6g== X-Received: by 2002:a17:906:c01:b0:711:917c:4c58 with SMTP id s1-20020a1709060c0100b00711917c4c58mr5869170ejf.291.1655235756336; Tue, 14 Jun 2022 12:42:36 -0700 (PDT) Received: from localhost.localdomain (p5b3f7f9c.dip0.t-ipconnect.de. [91.63.127.156]) by smtp.gmail.com with ESMTPSA id vw5-20020a170907058500b00712057b037fsm5306699ejb.167.2022.06.14.12.42.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Jun 2022 12:42:35 -0700 (PDT) From: Saravanan Sekar To: sre@kernel.org, lee.jones@linaro.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, jic23@kernel.org, lars@metafoo.de, andy.shevchenko@gmail.com Cc: linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-iio@vger.kernel.org, Saravanan Sekar Subject: [PATCH v2 5/6] power: supply: Add support for mp2733 battery charger Date: Tue, 14 Jun 2022 21:42:24 +0200 Message-Id: <20220614194225.2226447-5-sravanhome@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220614194225.2226447-1-sravanhome@gmail.com> References: <20220614194225.2226447-1-sravanhome@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org mp2733 is updated version of mp2629 battery charge management which supports USB fast-charge and higher range of input voltage. Signed-off-by: Saravanan Sekar --- drivers/power/supply/mp2629_charger.c | 208 ++++++++++++++++++++++---- 1 file changed, 179 insertions(+), 29 deletions(-) diff --git a/drivers/power/supply/mp2629_charger.c b/drivers/power/supply/mp2629_charger.c index bf9c27b463a8..8d4175d0504f 100644 --- a/drivers/power/supply/mp2629_charger.c +++ b/drivers/power/supply/mp2629_charger.c @@ -30,12 +30,15 @@ #define MP2629_REG_INTERRUPT 0x0b #define MP2629_REG_STATUS 0x0c #define MP2629_REG_FAULT 0x0d +#define MP2629_REG_FAST_CHARGE 0x17 #define MP2629_MASK_INPUT_TYPE GENMASK(7, 5) #define MP2629_MASK_CHARGE_TYPE GENMASK(4, 3) #define MP2629_MASK_CHARGE_CTRL GENMASK(5, 4) #define MP2629_MASK_WDOG_CTRL GENMASK(5, 4) #define MP2629_MASK_IMPEDANCE GENMASK(7, 4) +#define MP2733_MASK_FAST_CHARGE GENMASK(2, 1) +#define MP2733_MASK_FAST_CHARGE_RESET BIT(0) #define MP2629_INPUTSOURCE_CHANGE GENMASK(7, 5) #define MP2629_CHARGING_CHANGE GENMASK(4, 3) @@ -62,6 +65,17 @@ enum mp2629_source_type { MP2629_SOURCE_TYPE_OTG = 7, }; +enum mp2733_source_type { + MP2733_SOURCE_TYPE_NO_INPUT, + MP2733_SOURCE_TYPE_NON_STD, + MP2733_SOURCE_TYPE_APPLE_1p0, + MP2733_SOURCE_TYPE_APPLE_2p1, + MP2733_SOURCE_TYPE_APPLE_2p4, + MP2733_SOURCE_TYPE_SDP, + MP2733_SOURCE_TYPE_CDP, + MP2733_SOURCE_TYPE_DCP, +}; + enum mp2629_field { INPUT_ILIM, INPUT_VLIM, @@ -72,11 +86,30 @@ enum mp2629_field { MP2629_MAX_FIELD }; +struct mp2629_prop { + int reg; + int mask; + int min; + int max; + int step; + int shift; +}; + +struct mp2xx_chip_info { + const struct reg_field *rfields; + struct mp2629_prop *chip_props; + bool has_impedance; + bool has_fast_charge; + + int (*mpxx_get_usb_type)(unsigned int rval); +}; + struct mp2629_charger { struct device *dev; int status; int fault; + const struct mp2xx_chip_info *chip_info; struct regmap *regmap; struct regmap_field *regmap_fields[MP2629_MAX_FIELD]; struct mutex lock; @@ -85,15 +118,6 @@ struct mp2629_charger { struct iio_channel *iiochan[MP2629_ADC_CHAN_END]; }; -struct mp2629_prop { - int reg; - int mask; - int min; - int max; - int step; - int shift; -}; - static enum power_supply_usb_type mp2629_usb_types[] = { POWER_SUPPLY_USB_TYPE_SDP, POWER_SUPPLY_USB_TYPE_DCP, @@ -126,7 +150,25 @@ static enum power_supply_property mp2629_charger_bat_props[] = { POWER_SUPPLY_PROP_CONSTANT_CHARGE_VOLTAGE_MAX, }; -static struct mp2629_prop props[] = { +static struct mp2629_prop mp2733_chip_props[] = { + MP2629_PROPS(INPUT_ILIM, 100000, 3250000, 50000), + MP2629_PROPS(INPUT_VLIM, 3800000, 15200000, 100000), + MP2629_PROPS(CHARGE_ILIM, 320000, 4520000, 40000), + MP2629_PROPS(CHARGE_VLIM, 3400000, 4670000, 10000), + MP2629_PROPS(PRECHARGE, 120000, 720000, 40000), + MP2629_PROPS(TERM_CURRENT, 80000, 680000, 40000), +}; + +static const struct reg_field mp2733_reg_fields[] = { + [INPUT_ILIM] = REG_FIELD(MP2629_REG_INPUT_ILIM, 0, 5), + [INPUT_VLIM] = REG_FIELD(MP2629_REG_INPUT_VLIM, 0, 6), + [CHARGE_ILIM] = REG_FIELD(MP2629_REG_CHARGE_ILIM, 0, 6), + [CHARGE_VLIM] = REG_FIELD(MP2629_REG_CHARGE_VLIM, 1, 7), + [PRECHARGE] = REG_FIELD(MP2629_REG_PRECHARGE, 4, 7), + [TERM_CURRENT] = REG_FIELD(MP2629_REG_TERM_CURRENT, 0, 3), +}; + +static struct mp2629_prop mp2629_chip_props[] = { MP2629_PROPS(INPUT_ILIM, 100000, 3250000, 50000), MP2629_PROPS(INPUT_VLIM, 3800000, 5300000, 100000), MP2629_PROPS(CHARGE_ILIM, 320000, 4520000, 40000), @@ -174,6 +216,7 @@ static int mp2629_get_prop(struct mp2629_charger *charger, { int ret; unsigned int rval; + struct mp2629_prop *props = charger->chip_info->chip_props; ret = regmap_field_read(charger->regmap_fields[fld], &rval); if (ret) @@ -189,6 +232,7 @@ static int mp2629_set_prop(struct mp2629_charger *charger, const union power_supply_propval *val) { unsigned int rval; + struct mp2629_prop *props = charger->chip_info->chip_props; if (val->intval < props[fld].min || val->intval > props[fld].max) return -EINVAL; @@ -311,6 +355,16 @@ static int mp2629_charger_battery_get_prop(struct power_supply *psy, default: val->intval = POWER_SUPPLY_CHARGE_TYPE_UNKNOWN; } + + if (charger->chip_info->has_fast_charge) { + ret = regmap_read(charger->regmap, + MP2629_REG_FAST_CHARGE, &rval); + if (ret) + break; + + if (rval & BIT(6)) + val->intval = POWER_SUPPLY_CHARGE_TYPE_FAST; + } break; default: @@ -344,6 +398,40 @@ static int mp2629_charger_battery_set_prop(struct power_supply *psy, } } +static int mp2733_get_usb_type(unsigned int rval) +{ + switch (rval) { + case MP2733_SOURCE_TYPE_APPLE_1p0: + case MP2733_SOURCE_TYPE_APPLE_2p1: + case MP2733_SOURCE_TYPE_APPLE_2p4: + return POWER_SUPPLY_USB_TYPE_APPLE_BRICK_ID; + case MP2733_SOURCE_TYPE_SDP: + return POWER_SUPPLY_USB_TYPE_SDP; + case MP2733_SOURCE_TYPE_CDP: + return POWER_SUPPLY_USB_TYPE_CDP; + case MP2733_SOURCE_TYPE_DCP: + return POWER_SUPPLY_USB_TYPE_DCP; + default: + return POWER_SUPPLY_USB_TYPE_UNKNOWN; + } +} + +static int mp2629_get_usb_type(unsigned int rval) +{ + switch (rval) { + case MP2629_SOURCE_TYPE_SDP: + return POWER_SUPPLY_USB_TYPE_SDP; + case MP2629_SOURCE_TYPE_CDP: + return POWER_SUPPLY_USB_TYPE_CDP; + case MP2629_SOURCE_TYPE_DCP: + return POWER_SUPPLY_USB_TYPE_DCP; + case MP2629_SOURCE_TYPE_OTG: + return POWER_SUPPLY_USB_TYPE_PD_DRP; + default: + return POWER_SUPPLY_USB_TYPE_UNKNOWN; + } +} + static int mp2629_charger_usb_get_prop(struct power_supply *psy, enum power_supply_property psp, union power_supply_propval *val) @@ -367,23 +455,7 @@ static int mp2629_charger_usb_get_prop(struct power_supply *psy, break; rval = (rval & MP2629_MASK_INPUT_TYPE) >> 5; - switch (rval) { - case MP2629_SOURCE_TYPE_SDP: - val->intval = POWER_SUPPLY_USB_TYPE_SDP; - break; - case MP2629_SOURCE_TYPE_CDP: - val->intval = POWER_SUPPLY_USB_TYPE_CDP; - break; - case MP2629_SOURCE_TYPE_DCP: - val->intval = POWER_SUPPLY_USB_TYPE_DCP; - break; - case MP2629_SOURCE_TYPE_OTG: - val->intval = POWER_SUPPLY_USB_TYPE_PD_DRP; - break; - default: - val->intval = POWER_SUPPLY_USB_TYPE_UNKNOWN; - break; - } + val->intval = charger->chip_info->mpxx_get_usb_type(rval); break; case POWER_SUPPLY_PROP_VOLTAGE_NOW: @@ -556,6 +628,60 @@ static struct attribute *mp2629_charger_sysfs_attrs[] = { }; ATTRIBUTE_GROUPS(mp2629_charger_sysfs); +static ssize_t usb_fast_charge_show(struct device *dev, + struct device_attribute *attr, + char *buf) +{ + struct mp2629_charger *charger = dev_get_drvdata(dev->parent); + unsigned int rval; + int ret; + + ret = regmap_read(charger->regmap, MP2629_REG_INTERRUPT, &rval); + if (ret) + return ret; + + return sysfs_emit(buf, "USB DP %u:DM %u\n", !!(rval & BIT(2)), + !!(rval & BIT(1))); +} + +static ssize_t usb_fast_charge_store(struct device *dev, + struct device_attribute *attr, + const char *buf, + size_t count) +{ + struct mp2629_charger *charger = dev_get_drvdata(dev->parent); + unsigned int val; + int ret; + + ret = kstrtouint(buf, 10, &val); + if (ret) + return ret; + + if (val > 3) + return -ERANGE; + + ret = regmap_update_bits(charger->regmap, MP2629_REG_INTERRUPT, + MP2733_MASK_FAST_CHARGE, val << 1); + if (ret) + return ret; + + ret = regmap_update_bits(charger->regmap, MP2629_REG_INTERRUPT, + MP2733_MASK_FAST_CHARGE_RESET, + MP2733_MASK_FAST_CHARGE_RESET); + if (ret) + return ret; + + return count; +} + +static DEVICE_ATTR_RW(usb_fast_charge); + +static struct attribute *mp2733_charger_sysfs_attrs[] = { + &dev_attr_usb_fast_charge.attr, + NULL +}; +ATTRIBUTE_GROUPS(mp2733_charger_sysfs); + static void mp2629_charger_disable(void *data) { struct mp2629_charger *charger = data; @@ -564,6 +690,23 @@ static void mp2629_charger_disable(void *data) MP2629_MASK_CHARGE_CTRL, 0); } +static const struct mp2xx_chip_info mp2xx_chip_info_tbl[] = { + [CHIP_ID_MP2629] = { + .rfields = mp2629_reg_fields, + .chip_props = mp2629_chip_props, + .has_impedance = 1, + + .mpxx_get_usb_type = mp2629_get_usb_type, + }, + [CHIP_ID_MP2733] = { + .rfields = mp2733_reg_fields, + .chip_props = mp2733_chip_props, + .has_fast_charge = 1, + + .mpxx_get_usb_type = mp2733_get_usb_type, + }, +}; + static int mp2629_charger_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; @@ -578,6 +721,7 @@ static int mp2629_charger_probe(struct platform_device *pdev) charger->regmap = ddata->regmap; charger->dev = dev; + charger->chip_info = &mp2xx_chip_info_tbl[ddata->chip_id]; platform_set_drvdata(pdev, charger); irq = platform_get_irq(to_platform_device(dev->parent), 0); @@ -586,7 +730,8 @@ static int mp2629_charger_probe(struct platform_device *pdev) for (i = 0; i < MP2629_MAX_FIELD; i++) { charger->regmap_fields[i] = devm_regmap_field_alloc(dev, - charger->regmap, mp2629_reg_fields[i]); + charger->regmap, + charger->chip_info->rfields[i]); if (IS_ERR(charger->regmap_fields[i])) { dev_err(dev, "regmap field alloc fail %d\n", i); return PTR_ERR(charger->regmap_fields[i]); @@ -613,7 +758,12 @@ static int mp2629_charger_probe(struct platform_device *pdev) } psy_cfg.drv_data = charger; - psy_cfg.attr_grp = mp2629_charger_sysfs_groups; + if (charger->chip_info->has_impedance) + psy_cfg.attr_grp = mp2629_charger_sysfs_groups; + + if (charger->chip_info->has_fast_charge) + psy_cfg.attr_grp = mp2733_charger_sysfs_groups; + charger->battery = devm_power_supply_register(dev, &mp2629_battery_desc, &psy_cfg); if (IS_ERR(charger->battery)) { From patchwork Tue Jun 14 19:42:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: saravanan sekar X-Patchwork-Id: 12881507 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 02CBDC433EF for ; Tue, 14 Jun 2022 19:42:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344345AbiFNTml (ORCPT ); Tue, 14 Jun 2022 15:42:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50410 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344422AbiFNTmk (ORCPT ); Tue, 14 Jun 2022 15:42:40 -0400 Received: from mail-ej1-x62d.google.com (mail-ej1-x62d.google.com [IPv6:2a00:1450:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 24D25205F1; Tue, 14 Jun 2022 12:42:39 -0700 (PDT) Received: by mail-ej1-x62d.google.com with SMTP id me5so19204827ejb.2; Tue, 14 Jun 2022 12:42:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=+z2+RuzeYw1a0nCJ6ZCCmp0DVelodSSgQsNMZ7jN89U=; b=cJ7kX6JQZRzP8EB/VLzZ/rsoluvg54LWlfIOnE6HF4ij2gnlskznyS4QUGMtgGXr2u 7CtN7qgsyjet5Azz53Yv+Yds9SEGess/Xr0xf0/EcaxfEE8q0xh2vREuD6eVMn3bHMbH qw585uOE3P0nhauW1STCiWoNTw6LycRESp0yYBCp0rtyEMxWGSaGTudKSf3BO+PcR+04 5NdMeMGW1oJTCeOWeGfiDEWCVDcYcCSdgLFYp5G0GfzTc//NHhdEary5SchmPIYxtv9q p3COrGJeiXHCHHnNmGnyReGVTl9eYdoBjH4NTECAI7HO8wnjeJuk1BCJQW1WoaJ/2MiU bADQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=+z2+RuzeYw1a0nCJ6ZCCmp0DVelodSSgQsNMZ7jN89U=; b=A3XJQDnvqxRmqiaWUyuGrYOy+cVWe+nxQ79dM1Zvymvhs6d3WE9SemgEpC53K9ezlo IrvmkvkCAJaTyQ4b/sUYm/gucyqsBySMy9OJ95ae3IDGfNe1KZDii4W5pR0b0l+9/SiN w2jyPwccawlhc1UVCgrbuxkwh864y+zEpmKs4WR+7lXY7+V685VDhjDr7jL6a+hgkmMU fEVrkPyf7deWXIugnF1Mz1yCZ9BdzT1SY9mdgG9xp94PUuf0c8lc0YAHuxjAvAwQj3SY /rW9SNFdJnmVqSuET9YXafRcU1gaCEVApZOoVhq7szkZcaXGg39Iw6V+ho0UAWTeKdr+ jPqg== X-Gm-Message-State: AOAM533sJw/2Tgw/uzKV4t7BYTtukejtWAm8RLQWyKBcle1RhJhF348/ QmriwA8GRgMxk2kNkDBdE6A= X-Google-Smtp-Source: ABdhPJx2p8pxoJOxCffu8kDS/0ExN/Cx+SMmSX/pDxRibwiNirhzMWLOhgbfP6jvibvPNJXd5dF20A== X-Received: by 2002:a17:907:da2:b0:711:f408:f098 with SMTP id go34-20020a1709070da200b00711f408f098mr5704530ejc.208.1655235757695; Tue, 14 Jun 2022 12:42:37 -0700 (PDT) Received: from localhost.localdomain (p5b3f7f9c.dip0.t-ipconnect.de. [91.63.127.156]) by smtp.gmail.com with ESMTPSA id vw5-20020a170907058500b00712057b037fsm5306699ejb.167.2022.06.14.12.42.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Jun 2022 12:42:37 -0700 (PDT) From: Saravanan Sekar To: sre@kernel.org, lee.jones@linaro.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, jic23@kernel.org, lars@metafoo.de, andy.shevchenko@gmail.com Cc: linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-iio@vger.kernel.org, Saravanan Sekar Subject: [PATCH v2 6/6] power: supply: mp2629: Add usb fast charge settings Date: Tue, 14 Jun 2022 21:42:25 +0200 Message-Id: <20220614194225.2226447-6-sravanhome@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220614194225.2226447-1-sravanhome@gmail.com> References: <20220614194225.2226447-1-sravanhome@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org Allows the user to change the usb device fast charge setting to advertise host on enumeration helps to accelerate the charging cycle. Altering this value resets USB existing connection. Signed-off-by: Saravanan Sekar --- .../ABI/testing/sysfs-class-power-mp2629 | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Documentation/ABI/testing/sysfs-class-power-mp2629 b/Documentation/ABI/testing/sysfs-class-power-mp2629 index 914d67caac0d..6f1832761fba 100644 --- a/Documentation/ABI/testing/sysfs-class-power-mp2629 +++ b/Documentation/ABI/testing/sysfs-class-power-mp2629 @@ -1,3 +1,19 @@ +What: /sys/class/power_supply/mp2629_battery/usb_fast_charge +Date: June 2022 +KernelVersion: 5.20 +Description: + Represents a usb device fast charge settings.Altering this + value resets usb existing connection + USB DP:DM[0:0] 0.6V : Hi-Z + USB DP:DM[0:1] 3.3V : 0.6V + USB DP:DM[1:0] 0.6V : 0.6V + USB DP:DM[1:1] 0.6V : 3.3V + + Access: Read, Write + + Valid values: Represented in bit DP & DM setting. Valid + range is [0, 3]. + What: /sys/class/power_supply/mp2629_battery/batt_impedance_compen Date: April 2020 KernelVersion: 5.7