Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp2148665rwb; Sun, 14 Aug 2022 22:49:51 -0700 (PDT) X-Google-Smtp-Source: AA6agR4+/UmM593Bc+oUpzZpHgCquYeht3IPcvEAeuYNRHEvlXaqY+07wIdKyGtpc22W6D7Sa1iS X-Received: by 2002:a63:f34b:0:b0:422:e3a6:47f2 with SMTP id t11-20020a63f34b000000b00422e3a647f2mr9946045pgj.478.1660542591692; Sun, 14 Aug 2022 22:49:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660542591; cv=none; d=google.com; s=arc-20160816; b=j3LDZ6Bf87AG3PMCfFI6VXnVm1u/Nfqk4U6WPigCD+BCxaQG4vhMojnxioep27mJa6 Mi8kzQ5Tq80HUe8kkygA771LKzrm2zDviSYw2BH6FOfT+ckX0lpelyogahaXoXF3dJqR NMp0K0Wh+nJ0Dz29Dg+WgA071i1Yn4Y7y46bqAQQS8wPQ76Kv0mmqL4WG/7K+yEyLTL5 Y7kJ/akkhHjBzvyjY6Ff171OqddhN552E8vHuSx830a4BNKdb5IbtrsVkRyQBmH61v7S kwwXwz02vX636w7/ZFZqKSbm5wl/OH4uEwi82FlDcRsvIdQEI2+wugpTEstmdYpWDaeK qMrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=iwr7XkJX8s+Vxxl+k0pY94n0/ODkYyQntmhI8k+Qn6I=; b=bXI9bhRUR9uqKmH77yL7ToS4CSRj6fZ2MU9zyE7bM7WJNWXgbCHbcBi97yfPon0VPA CkFAQDrkjxfNpzNdWm4U3q4ZVM2mFKkvsgwIxGIP37brYJ9ldeaz/mnfqUhfaqFCU39L vRT0oWFFmwhq+SZY5FhOSFIq0T8HOGQutjSQCwY3YC299krtxMQl0CVMbREmd1rDjhJA ufoLnZIL/QYAF2WmlKwJwpU23wxh8GYd6PbDkEUSCGbV5IFtDrLLdR0XfEmA+ORp2/ls T64BOuaUZsMyjvaDJacSUp3dYqgaKcLeJEzzRSNzViX+65goNdkHN6s/63UDstt21nKb XdHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=ochcn0nA; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e1-20020a170902e0c100b0016f86a21198si7782458pla.610.2022.08.14.22.49.40; Sun, 14 Aug 2022 22:49:51 -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=ochcn0nA; 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 S231150AbiHOFg6 (ORCPT + 99 others); Mon, 15 Aug 2022 01:36:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41702 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229637AbiHOFg4 (ORCPT ); Mon, 15 Aug 2022 01:36:56 -0400 Received: from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com [IPv6:2a00:1450:4864:20::42b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BE35C12A88; Sun, 14 Aug 2022 22:36:52 -0700 (PDT) Received: by mail-wr1-x42b.google.com with SMTP id l4so7844939wrm.13; Sun, 14 Aug 2022 22:36:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc; bh=iwr7XkJX8s+Vxxl+k0pY94n0/ODkYyQntmhI8k+Qn6I=; b=ochcn0nAwaI+uZle8oxq2CMwsp35gCjwnpn4Q/BbMfX+/bVmddN92C70y9YQzJ8bk9 3YnkpIGDwNf+olWm8vc3x9RrD+G5wgQGS3MAgJZcxU6YZX1yYOG1exd2hYIaokrfH956 Doh55Xz+oDkE4li+WV9kkAnFw41V9U+30TY0TOjXQoGYbM69sLBEpzhqTwYI8mV5fLKW WJRd6GNgOx87Afp83QtX5xz3iCja+EjwBtPFavqCbaH5k75Sbn9DsjVz5fWlEyx4T2Ao CVtuCECiSvCTC8jfwK39UjB58B9BqZ+H5cqPn+MwyU9fzgAhXzV+uxTye3AslKkCpQPX fj2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc; bh=iwr7XkJX8s+Vxxl+k0pY94n0/ODkYyQntmhI8k+Qn6I=; b=3c27AUdYXzPTdvTlL7rM1hu7WbEcx4yAk2LlhLqJQWdWZsdlXeVHCG4r1o3Au2UOR2 BnH3TMtgXDF7XS1K0c1V2dW/MAcGe+3M/rx5TvWVIf6wLWmV0QNfEl/rRj8VMqci1Cap 6dVTOFGPzK1e/NoNOzHdwGyvy8Z81WVQU1yfKmg+mrc3xF4s38sxls50uTReU+XnXpIh F6x7Uv+HxXfrsSvC2/SwrMau46CYS1lT51V/eWacbjjIo1eWcIYEsl1yqsotoQy7auki RnDvDGPnoVhcmPEODnlVaDGLHNVA9wGChhxcXyasptz6ZkzCi6I7W5Viq38eUruhxGsD mlPQ== X-Gm-Message-State: ACgBeo2ZdrtC657nry4AhpVWiQP5bN6euIZAyFeNs4it4oy3GTuadAW2 TwX3mW9OusQdnKlUZY0UovPcBRVgb4I4gpeuXJ4= X-Received: by 2002:a05:6000:178f:b0:221:7dcb:7cbf with SMTP id e15-20020a056000178f00b002217dcb7cbfmr7791842wrg.58.1660541811221; Sun, 14 Aug 2022 22:36:51 -0700 (PDT) MIME-Version: 1.0 References: <20220805070610.3516-1-peterwu.pub@gmail.com> <20220805070610.3516-11-peterwu.pub@gmail.com> In-Reply-To: <20220805070610.3516-11-peterwu.pub@gmail.com> From: Matti Vaittinen Date: Mon, 15 Aug 2022 08:36:39 +0300 Message-ID: Subject: Re: [PATCH v7 10/13] power: supply: mt6370: Add MediaTek MT6370 charger driver To: ChiaEn Wu Cc: Lee Jones , daniel.thompson@linaro.org, jingoohan1@gmail.com, Pavel Machek , Rob Herring , krzysztof.kozlowski+dt@linaro.org, Matthias Brugger , Sebastian Reichel , chunfeng.yun@mediatek.com, Greg Kroah-Hartman , Jonathan Cameron , Lars-Peter Clausen , Liam Girdwood , Mark Brown , Guenter Roeck , Heikki Krogerus , deller@gmx.de, Andy Shevchenko , chiaen_wu@richtek.com, alice_chen@richtek.com, ChiYuan Huang , dri-devel@lists.freedesktop.org, linux-leds@vger.kernel.org, devicetree , linux-arm Mailing List , "moderated list:ARM/Mediatek SoC support" , Linux Kernel Mailing List , Linux PM list , linux-usb@vger.kernel.org, linux-iio@vger.kernel.org, linux-fbdev@vger.kernel.org, szunichen@gmail.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,FREEMAIL_REPLY, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no 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 Hi ChiaEn, pe 5. elok. 2022 klo 10.09 ChiaEn Wu (peterwu.pub@gmail.com) kirjoitti: > > From: ChiaEn Wu > > MediaTek MT6370 is a SubPMIC consisting of a single cell battery charger > with ADC monitoring, RGB LEDs, dual channel flashlight, WLED backlight > driver, display bias voltage supply, one general purpose LDO, and the > USB Type-C & PD controller complies with the latest USB Type-C and PD > standards. > > Add a support for the MediaTek MT6370 Charger driver. The charger module > of MT6370 supports High-Accuracy Voltage/Current Regulation, > Average Input Current Regulation, Battery Temperature Sensing, > Over-Temperature Protection, DPDM Detection for BC1.2. > > Signed-off-by: ChiaEn Wu > --- > > + > +#define MT6370_CHG_LINEAR_RANGE(_rfd, _min, _min_sel, _max_sel, _step) \ > +[_rfd] = { \ > + .min = _min, \ > + .min_sel = _min_sel, \ > + .max_sel = _max_sel, \ > + .step = _step, \ > +} Just a minor thing but I think this macro could be useful also for other drivers. Do you think you could rename it to LINEAR_RANGE_IDX() (or some such) and move it to the linear_range.h? That would allow also other drivers to use it instead of reinventing the wheel :) Best Regards -- Matti Vaittinen --- Matti Vaittinen Linux kernel developer at ROHM Semiconductors Oulu Finland ~~ When things go utterly wrong vim users can always type :help! ~~