From patchwork Wed Jun 15 14:53:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saravanan Sekar X-Patchwork-Id: 582146 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 3EB72C43334 for ; Wed, 15 Jun 2022 14:54:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343758AbiFOOyJ (ORCPT ); Wed, 15 Jun 2022 10:54:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42122 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245684AbiFOOyF (ORCPT ); Wed, 15 Jun 2022 10:54:05 -0400 Received: from mail-ed1-x52f.google.com (mail-ed1-x52f.google.com [IPv6:2a00:1450:4864:20::52f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 88C9A192A8; Wed, 15 Jun 2022 07:54:04 -0700 (PDT) Received: by mail-ed1-x52f.google.com with SMTP id cn20so4134776edb.6; Wed, 15 Jun 2022 07:54:04 -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=MwALs328k5FgzGUpRLgAC7GTidVE3+ciCtqMSNIegDM=; b=G2nX8wBavzgiVm6qTk1feiExebIzlkjg+FBWWSvFbv+jF9W46cGBsT9qMpUpTBV326 yc3jvYXU82fr9FTDaIVgkYVWArGJPvROfORPuc+8g/JlNLenzx6Ni5wbdwRqnGlBoXfW KmeQ5tBqdvxWUgSzqk3dszkshF6I6bY7l84SaChfQOgQWjLqltMgOmLoHZNXYp8hMqBy j0gQ9wAngvkwp0BhYaptnwR9Gc48q05muKENmCfYRL0uTiQ6T9ILjUSjB++JE26rVgD9 EylcblpkVQk2GteelK+92jYYNQFS+D2rt6fyLrVvoaa9fI2oXYOfCLxSlHCY2cZwspn0 XQYQ== 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=MwALs328k5FgzGUpRLgAC7GTidVE3+ciCtqMSNIegDM=; b=4sata1W4XH+DemI0UQAaLhg9/E2B1RrZDRzpQBhNd5uqqT4dNm8Wx27lwGmowCpW+/ edtjeTFkHoBxM2UpPhmWKtQqxiQkVInT4UcQOpfib7s92F91xIPy6uuqhMO5ViRwBJjC zyFekPhTQEvJFND4oKYr1esfKGXNPW+8Wfp5g1LsGrKDcwsDRDatf501FEWKBqlng5j2 BS94H5OxmAA93bVbNHcL3Q7fH6JmTefFwDcCpGh22Xtp7RtulMGvUnksNtaiFnrrZcAC eHitYFJPSazQLDy3XoKa56JhG5GZNVTfbCJaIeSczOngARznlsMTIR70nv05iErY83RI P0gA== X-Gm-Message-State: AJIora/RDJrKMdZFXXPR9TxdvYWLhEBvT1TrwWub5fZ65OTuTRXmktxL ud0aDPxuDWbYYQr6v8gdc4Y= X-Google-Smtp-Source: AGRyM1u1fduoraB7MKRy6ed5uPlr6OO0A2s4x7C296lPSViw5q5cjlKNDRntfDzR7+C9sbGmIszBMg== X-Received: by 2002:aa7:cd46:0:b0:42d:d73d:be8b with SMTP id v6-20020aa7cd46000000b0042dd73dbe8bmr121475edw.85.1655304843058; Wed, 15 Jun 2022 07:54:03 -0700 (PDT) Received: from localhost.localdomain (p5dcfe5fe.dip0.t-ipconnect.de. [93.207.229.254]) by smtp.gmail.com with ESMTPSA id y2-20020a1709063a8200b00706287ba061sm6341665ejd.180.2022.06.15.07.54.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Jun 2022 07:54:02 -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 v3 1/6] iio: adc: mp2629: fix wrong comparison of channel Date: Wed, 15 Jun 2022 16:53:52 +0200 Message-Id: <20220615145357.2370044-2-sravanhome@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220615145357.2370044-1-sravanhome@gmail.com> References: <20220615145357.2370044-1-sravanhome@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Input voltage channel enum is compared against iio address instead of the channel. Fixes: 7abd9fb64682 ("iio: adc: mp2629: Add support for mp2629 ADC driver") Signed-off-by: Saravanan Sekar Reviewed-by: Andy Shevchenko Acked-by: Jonathan Cameron --- 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 Wed Jun 15 14:53:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saravanan Sekar X-Patchwork-Id: 582145 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 99182CCA483 for ; Wed, 15 Jun 2022 14:54:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345027AbiFOOyN (ORCPT ); Wed, 15 Jun 2022 10:54:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42210 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245706AbiFOOyG (ORCPT ); Wed, 15 Jun 2022 10:54:06 -0400 Received: from mail-ed1-x536.google.com (mail-ed1-x536.google.com [IPv6:2a00:1450:4864:20::536]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0D595275D3; Wed, 15 Jun 2022 07:54:06 -0700 (PDT) Received: by mail-ed1-x536.google.com with SMTP id z7so16509457edm.13; Wed, 15 Jun 2022 07:54:05 -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=KoSeXLhcP+pQzpYRIDKz9CUHwdCRufZ+841Vxxkba/M=; b=GzDZj1fjWq0OLuENvSgtzsTaifLuvkSqjzIB9ZBcWYGWbho0DmgNmf0VACWSe8+BgT D3TM/izkgeHIqlCJZzQceWtd85S8lb5fNWLU0DwdvOQDh25gMgRVBUGcXfD1j1wBN9S7 /rHD5J3LD9U8k99yZG1Ppfd1aedMplFwVidupRXLZRG1bkLvt9NrCUhSBQyPIht2Jo5A fLW7X2KXXBhPH0ABQypKgnU19/PKsT3JZcY36gCUMvjFxbfwF8wMH79qxT2F5dgGCj5f ATv+SwX9s4vE3qh37JvwW01uxU2AfPwPpkKJ2okl5kmu7tFGm/9UYbqDXRc4ZLO1By7m fd2g== 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=KoSeXLhcP+pQzpYRIDKz9CUHwdCRufZ+841Vxxkba/M=; b=wvuASUifGk1NGh4y/8OcC8mDyo/iarjyhjxHqrCqyIoF0Rs6W4kalH11wBWWtWeiBf JXT6kn80IN0tpPPmlaxBqxwIVv2Wz2sWRVw49y4g+MzmvPU1WSwoGnrgvzRFEHinm3jp Oy8aqPEJKxoUCyCPGhpDhXrowEUnmxzh0biWTdHotYKhNVqB+hhnkrjJzUEdTp9bEan5 zHLxSTSe35g/QvwU/eEPBUSpNEcfr/a9GpMLp/B0cUktUx6/W2+iFNdeKnqxytumsaRT Bk5ctcvsqAoIZ3DouSa07AQ0Ki2lASvy4+dcfRxlQdEeBw8L5p4eI4wkg2PLV25/dv9r /GWQ== X-Gm-Message-State: AJIora98KgVtf2NJFUordP4oilYbBd+Aeq9EH6kasKfwrhuFPSF2bDms CEFxHKH1483EUXj1tTYJa6I= X-Google-Smtp-Source: AGRyM1va6jB6n4XAuuoyy8sIIpV6rsqYUswhXfj7EMAscfhmV0+WxPk7jMWdXJcynUhRbRgi1882Tg== X-Received: by 2002:aa7:c744:0:b0:42d:f68f:13de with SMTP id c4-20020aa7c744000000b0042df68f13demr149823eds.294.1655304844546; Wed, 15 Jun 2022 07:54:04 -0700 (PDT) Received: from localhost.localdomain (p5dcfe5fe.dip0.t-ipconnect.de. [93.207.229.254]) by smtp.gmail.com with ESMTPSA id y2-20020a1709063a8200b00706287ba061sm6341665ejd.180.2022.06.15.07.54.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Jun 2022 07:54:03 -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 v3 2/6] dt-bindings: mfd: Add mp2733 compatible Date: Wed, 15 Jun 2022 16:53:53 +0200 Message-Id: <20220615145357.2370044-3-sravanhome@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220615145357.2370044-1-sravanhome@gmail.com> References: <20220615145357.2370044-1-sravanhome@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Add new compatible for mp2733 mfd driver. Signed-off-by: Saravanan Sekar --- Documentation/devicetree/bindings/mfd/mps,mp2629.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/mfd/mps,mp2629.yaml b/Documentation/devicetree/bindings/mfd/mps,mp2629.yaml index f91acc42d652..5ba849d78d8a 100644 --- a/Documentation/devicetree/bindings/mfd/mps,mp2629.yaml +++ b/Documentation/devicetree/bindings/mfd/mps,mp2629.yaml @@ -18,7 +18,9 @@ description: | properties: compatible: - const: mps,mp2629 + enum: + - mps,mp2629 + - mps,mp2733 reg: maxItems: 1 From patchwork Wed Jun 15 14:53:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saravanan Sekar X-Patchwork-Id: 582503 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 0A777CCA488 for ; Wed, 15 Jun 2022 14:54:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345252AbiFOOyO (ORCPT ); Wed, 15 Jun 2022 10:54:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42152 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343591AbiFOOyI (ORCPT ); Wed, 15 Jun 2022 10:54:08 -0400 Received: from mail-ed1-x535.google.com (mail-ed1-x535.google.com [IPv6:2a00:1450:4864:20::535]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3262727B23; Wed, 15 Jun 2022 07:54:07 -0700 (PDT) Received: by mail-ed1-x535.google.com with SMTP id x5so16570032edi.2; Wed, 15 Jun 2022 07:54:07 -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=3+FpnW+9MOB0iv3pWt/BniZ3+7BgHVeESC7+jb4myQI=; b=cuV2ivciKCdxDCxhZZELRYX+jVZbjtEMIdT+Vear7sbkGwU4Qca19QEQcF/olsnRBV p9KPhA50Q0XMRWU4CE9Can4dyXruDi43VPMI4REweHkeNMAl0qp64m7CUzDRtVMyod7X HSywRzNyG+CmmIb0ovlxjg+2COiqZSUbpU3Akx0Oum5WLx9TNcS3r+ybs5TyFcaT+CzU hGpbhmbgwBtK6ajveYdhzyjNluERYr12s212d6Rw3bBWWHW1guMbPNeLrXyfHY8RFgqP qEw5DZ7j6JvDCysGEivsWNNY9e1a0L+v4hdTHuqL6WcLo5LD4Em9lJE5+SWhF4PYy+Z6 XzfA== 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=3+FpnW+9MOB0iv3pWt/BniZ3+7BgHVeESC7+jb4myQI=; b=rApRZ3dteWvqublPiGEzeW2yjrbl0ieYyCOyjE7m/f7sykjFKyAButv+5ocLsiX4pu aB1idzEUlyLCheQBjS+AJbA33o2En5SfgapS5wm8771hc7xRS2stfk3ODGdwMM7WED0Y RMEqS2vNnHXeG2lp/cvrJdhB27KuG28wrrg184UEwzc2+55f0sFHGTlgEdbjvadKMtnN wyxkSHVunYUHDEpZK/+8AzjRjrcrLJXhQPb2YLN8HvObYV34Vyxej1u/segEopxRiEBO 4QGsD76i9SqSRvJtb3MmdsJn/z1KlCFhu/RWTypbc+kCHJFJ2xXpioxNvnkZRb9TNL47 TuKg== X-Gm-Message-State: AJIora9AaYDj0Mig4+F0y5AYCvdZLfjoCsTqzx7cLaIyUIry58mdc+N5 Xfiz6ABrDRfg2ovi+4lNvReWMXMdaww60w== X-Google-Smtp-Source: AGRyM1uzuerY1flspbuYVfmgRKSO9X8/XmQGohSIih93KP3rCry6/SneXEu2RsShrYEgbxLhtMHWzw== X-Received: by 2002:a05:6402:50ce:b0:42e:2208:bd8c with SMTP id h14-20020a05640250ce00b0042e2208bd8cmr162550edb.216.1655304845643; Wed, 15 Jun 2022 07:54:05 -0700 (PDT) Received: from localhost.localdomain (p5dcfe5fe.dip0.t-ipconnect.de. [93.207.229.254]) by smtp.gmail.com with ESMTPSA id y2-20020a1709063a8200b00706287ba061sm6341665ejd.180.2022.06.15.07.54.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Jun 2022 07:54:05 -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 v3 3/6] mfd: mp2629: Add support for mps mp2733 battery charger Date: Wed, 15 Jun 2022 16:53:54 +0200 Message-Id: <20220615145357.2370044-4-sravanhome@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220615145357.2370044-1-sravanhome@gmail.com> References: <20220615145357.2370044-1-sravanhome@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pm@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 Reviewed-by: Andy Shevchenko --- 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 Wed Jun 15 14:53:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saravanan Sekar X-Patchwork-Id: 582144 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 3A34FCCA481 for ; Wed, 15 Jun 2022 14:54:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345401AbiFOOyO (ORCPT ); Wed, 15 Jun 2022 10:54:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42122 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343697AbiFOOyJ (ORCPT ); Wed, 15 Jun 2022 10:54:09 -0400 Received: from mail-ed1-x52a.google.com (mail-ed1-x52a.google.com [IPv6:2a00:1450:4864:20::52a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3A00129838; Wed, 15 Jun 2022 07:54:08 -0700 (PDT) Received: by mail-ed1-x52a.google.com with SMTP id d14so16501293eda.12; Wed, 15 Jun 2022 07:54:08 -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=7dCSgUmnblCdx5KQELAz1p60pr2nFvcndhXbnKYQfrI=; b=CpxBdKLejyP3SnPKbJb623o4+1vbgmSMihmP6uzcHVcy4QCT3mv7YS+djKsClDngeL +BD/UMIAGRQ2fUgvzJKWp4q4oLSxnylrTGdCptUCQM9ycD55oMrGY7Sk+b44AcowlaAQ E7NE9jZArz7ZaHErwbQnFT6qWsI5JOJsluTj4NkjnjcSn+8ff/rfDbfxisI3TM1A5ZT0 L2wCKfRR0wHIGmM761kYBYU55FmGKBe4qLIL0b3XYEa+xz1CLh/tZzYmDmTmMZ+I8WtU gyu+qZg/FrUolDyPLNabcylgXW5otcswasZUxMyHbkRU50ToWwVB+xwc82kBxl6G21Sd st6w== 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=7dCSgUmnblCdx5KQELAz1p60pr2nFvcndhXbnKYQfrI=; b=cZUzTCHBlpp9cin5YznmxxkfXGrcwBFRjO/X+vMh+eUeZQ+QZmY9nrBF4pSBHA+KtJ piSSj0t3u9gq5+V28kH8jhmbftjNWTqcjcgswy3cgG03CMA+XZSCz00wenJyNP4rHlNq OFna3yBMYaYNELGB1gsBxhMZ5uFI5bj6nl8lCNml7z2oJygiRl4FmdG3MMNEcFp0n9l9 mblMofmti4LuBLkjLXXOQq0j52m33Pfj5DJUzPOUL1gyEEjB2s7ou+3TQH+Op4OgvwMB d0q8ejx36R3I9TEZ+yW6wr+a/zezVVuqyM+4qKO9k4dwGLAcn8mfKlRMzFQPQalB3pJq RI/A== X-Gm-Message-State: AJIora/6uUS12/M+SZWI3QYOIADa3YXCelVxF0ls63boZvkkHkROqTe+ yVSSYXP4ZlScSWzUbO3GZQg= X-Google-Smtp-Source: AGRyM1tm4YLQpvz8BzlfDA4mQvjen6CbDidW7CXzUKkWIzYScM2l53ZbIYqQqwUVAXsIh9cSXO/yhg== X-Received: by 2002:a05:6402:358a:b0:431:20d5:f4ad with SMTP id y10-20020a056402358a00b0043120d5f4admr88450edc.375.1655304846821; Wed, 15 Jun 2022 07:54:06 -0700 (PDT) Received: from localhost.localdomain (p5dcfe5fe.dip0.t-ipconnect.de. [93.207.229.254]) by smtp.gmail.com with ESMTPSA id y2-20020a1709063a8200b00706287ba061sm6341665ejd.180.2022.06.15.07.54.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Jun 2022 07:54:06 -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 v3 4/6] iio: adc: mp2629: restrict input voltage mask for mp2629 Date: Wed, 15 Jun 2022 16:53:55 +0200 Message-Id: <20220615145357.2370044-5-sravanhome@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220615145357.2370044-1-sravanhome@gmail.com> References: <20220615145357.2370044-1-sravanhome@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pm@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 Reviewed-by: Andy Shevchenko Reviewed-by: Jonathan Cameron --- 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 Wed Jun 15 14:53:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saravanan Sekar X-Patchwork-Id: 582504 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 EC257C433EF for ; Wed, 15 Jun 2022 14:54:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344786AbiFOOyM (ORCPT ); Wed, 15 Jun 2022 10:54:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42348 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344363AbiFOOyL (ORCPT ); Wed, 15 Jun 2022 10:54:11 -0400 Received: from mail-ej1-x62c.google.com (mail-ej1-x62c.google.com [IPv6:2a00:1450:4864:20::62c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 574C22A42C; Wed, 15 Jun 2022 07:54:09 -0700 (PDT) Received: by mail-ej1-x62c.google.com with SMTP id y19so23757414ejq.6; Wed, 15 Jun 2022 07:54:09 -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=AcedBwk2r7tYvHmo73Eje6rzPl3zEbryWFVuEiN3JCg=; b=h4szjHbaDW/TU7jcBPVKPwnJFnHeFWlyjo1+Kr9tpIFIKTJbimCiKqWeak9TMO7D5U AB4rPZ3tZ4lGJ104nWR3r9QhmksyxUMONYrHj10J7uFgfRbrLvsoRMimS8T8EzlfmVWd 5oW3ID9vvY1eGXuKBwyCDwfAj/kauEYT2gtz47QfG3bGOc3eFUAWHnO2B3KWHEakZ1mb AU8zsSshf3W63fg64t8EUBQDEgTYQBGFZZVaY1JHOoNyutyLS0CWhcgz50jqYkaZyqTL nGIo1mTYE0QHWSoXZAdgcKeI6M9M9UCCoYMvprdFEZsHJngmAcFbWv52+ujWRHTgYRSF HuXQ== 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=AcedBwk2r7tYvHmo73Eje6rzPl3zEbryWFVuEiN3JCg=; b=Ul9dSr5jA3OIYhm1Jhe/HyZdKT6FfMLxc2AWTH4Wo5HbQruWpbMmDRsR+TfxsH1uMs 2/cAeV66HIicXJaVYSqFtEvvonhLy+OI67cjkVpa9S4G3g8nQtvnnVX4gaRyJIxvKUXn +QHzDgpKh8ECsNSeAgvvrMExftsMCU2KC3asy5FKkq0DipFa/OP18NANxfhB2QNt0jew G/f20nEoRIkc0LrdfYXWusazRjO+whSJVj8y6+nAQgsrl+hKki/gLPMGCmX/aYg8oigT g7I0pF/4cfAzqKmQMwRByFbkEwSv1WtCgfP/umvm0st4xdRyz0Bqm1DMZPVzIopxFNJi yaiA== X-Gm-Message-State: AJIora/p74Row+e+55kzJ7yGKqDlAxPqrWWX1sqLO1aQFmLeMAuQtwUo FhkZPNtdb7uiwqlAgsGDqaNV0gslXtqV0w== X-Google-Smtp-Source: AGRyM1v2isoJAkQUSVfSQe8LCI/RZRowPItpMF1TxMsjj6BbKOx361RijhPO08BOe7ao/I6KWAoC6Q== X-Received: by 2002:a17:907:2c65:b0:711:d06c:e61 with SMTP id ib5-20020a1709072c6500b00711d06c0e61mr171877ejc.201.1655304847811; Wed, 15 Jun 2022 07:54:07 -0700 (PDT) Received: from localhost.localdomain (p5dcfe5fe.dip0.t-ipconnect.de. [93.207.229.254]) by smtp.gmail.com with ESMTPSA id y2-20020a1709063a8200b00706287ba061sm6341665ejd.180.2022.06.15.07.54.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Jun 2022 07:54:07 -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 v3 5/6] power: supply: Add support for mp2733 battery charger Date: Wed, 15 Jun 2022 16:53:56 +0200 Message-Id: <20220615145357.2370044-6-sravanhome@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220615145357.2370044-1-sravanhome@gmail.com> References: <20220615145357.2370044-1-sravanhome@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pm@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 Reviewed-by: Andy Shevchenko Acked-by: Sebastian Reichel --- 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 Wed Jun 15 14:53:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saravanan Sekar X-Patchwork-Id: 582505 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 D7B86CCA480 for ; Wed, 15 Jun 2022 14:54:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344360AbiFOOyL (ORCPT ); Wed, 15 Jun 2022 10:54:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42112 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344116AbiFOOyK (ORCPT ); Wed, 15 Jun 2022 10:54:10 -0400 Received: from mail-ed1-x536.google.com (mail-ed1-x536.google.com [IPv6:2a00:1450:4864:20::536]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5CEDA2A713; Wed, 15 Jun 2022 07:54:09 -0700 (PDT) Received: by mail-ed1-x536.google.com with SMTP id z7so16509457edm.13; Wed, 15 Jun 2022 07:54:09 -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=6Clv+JrvN5xAcPquJt0P4YgFaBe3M0B8HPlEXIs7o5U=; b=HrtHARPp1Xww8CBJG9O4NBrrfnhmef+9FXRkvUyzllK9op+K9cZGY1fehxk9grKgHY GXG8hbFJmnK1xu6+2TrgrSAG+cB24FJfiAfYcRiwqWkj93oaOlOQqXuMVjpVunw42Eh9 Ic01ViH0sn0OgIrXBmb8MLUd+fSF/U+W/2yweKyF/YHyYD4tqXI5TqM2RNiaSZ7HyAGE LhvJfMTrdPlcViZc1fR8Vog7zFnv1USEDDM/EHuikEP0KxjT28VAOXnok/WMudsIIFPe okjTVnGvKusxFqBBd8C8vPywNotJLvPbxzNfUfkack9T4AHjFsmz+LTgoOBacXGwC5dc QzxA== 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=6Clv+JrvN5xAcPquJt0P4YgFaBe3M0B8HPlEXIs7o5U=; b=rESDyNqitKt9DVc3tJQHg08ZM2pQCR13Znn4XzQSAUXoy3Zv3ZWl78v25nVzvLaj/W JqI+Tvy8SY0AcYcewMN1eDnxu8UpuD5ARZuONwe5R8sCwbEHfiSg7jklqYTrHoMgIW+M V2EBW7NY67MUtqHPY1Ay/KvTHrTfQX5y/NyrSRXC++dsOepgPozrvPKgF1HZUZy38ilb jKztQAbv8k/JmUXYhMcJ1tI4cAgifFJt/dDD9gGpx+7oVOhV32xk2/NuWFJ1rWjVC4al X69apCMDuNt1JDoi+ydKn2JtHnp70LBQgoKRV3+O1lo8inBKeQEjU4ZQQlfWH1l8pz0U BGIw== X-Gm-Message-State: AJIora+SoCENK6tjuysj1qCh2ASUih1+7zCp9TGoq98d7SKNdQKXxP7C p5x60LuWc6eYjymcP484TwI= X-Google-Smtp-Source: AGRyM1ujs1HeXOasq6DHF83w4PPcRH7kW5sgTud79flC34uP4Hx/vJhKCSdoYRUWd1SFHAiZyCK7Fw== X-Received: by 2002:a05:6402:51d4:b0:42f:b38d:dbb9 with SMTP id r20-20020a05640251d400b0042fb38ddbb9mr100501edd.255.1655304848997; Wed, 15 Jun 2022 07:54:08 -0700 (PDT) Received: from localhost.localdomain (p5dcfe5fe.dip0.t-ipconnect.de. [93.207.229.254]) by smtp.gmail.com with ESMTPSA id y2-20020a1709063a8200b00706287ba061sm6341665ejd.180.2022.06.15.07.54.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Jun 2022 07:54:08 -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 v3 6/6] power: supply: mp2629: Add USB fast charge settings Date: Wed, 15 Jun 2022 16:53:57 +0200 Message-Id: <20220615145357.2370044-7-sravanhome@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220615145357.2370044-1-sravanhome@gmail.com> References: <20220615145357.2370044-1-sravanhome@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pm@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 Reviewed-by: Andy Shevchenko --- .../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..b386d02cb010 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