From mboxrd@z Thu Jan 1 00:00:00 1970 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 69B61C43334 for ; Fri, 15 Jul 2022 13:18:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233199AbiGONS5 (ORCPT ); Fri, 15 Jul 2022 09:18:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55224 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229436AbiGONSz (ORCPT ); Fri, 15 Jul 2022 09:18:55 -0400 Received: from mail-yb1-xb29.google.com (mail-yb1-xb29.google.com [IPv6:2607:f8b0:4864:20::b29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E89EC10FE2; Fri, 15 Jul 2022 06:18:53 -0700 (PDT) Received: by mail-yb1-xb29.google.com with SMTP id f73so8362859yba.10; Fri, 15 Jul 2022 06:18:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=RIDFbj9Nm/Hc84YphLe1TSejCss5csMsL3XGmdeREuc=; b=LjTUeU/VvjExiFE7qVdoTT66INknzaksBvLAL0QX/hhMGm1S/DCmWjGAqEm1RDjTt0 nrI4wHZo/WK5aG8U5fIPVbESm+g18hEELTujXpx69+Azj8qnUnYXhFafWvDdYrxJWF8Q n4alCS65LacwduwaUDBvHdbTO5eZ4k4tWaJ199RDLEdi+Nnbu8tJ4UTjcA2YPJBeHBKH hWc3HEBwkV0/ygom4+Ivyr3ViE5siRsP8CdzKAgWRXLBXaArht7DgMtJUJb/WrGYsYt8 eWv+sETgNCGjxIJCtjEQJk1vVPGobtuRYELM3bihPsOKaqDcf5qzy1Ry+AVMll6TrQxi eYjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=RIDFbj9Nm/Hc84YphLe1TSejCss5csMsL3XGmdeREuc=; b=VxgiEGoFQGUYqSko+lJKnHxVGH2zZsKKIQ9+fWl5TxvFC5y30oyYNFiJiWM7qvcf/8 wgwp1K8xIJJaXJdX9tCKzsfm3phCcmJ8mn4KJgVmLKfgUaW8scedC4sDAnZLKvPa605J Xuf6pJD58ZF1Uq0SiLTwAMC41+W9qucdY3imNc1goVEWJk+yv7ELXTuqzLpXctX4h627 6Lx5ATaLA/TKD/lMhN21bMGyH1IWyg+s8bol5BjNho6iSX3WeTGJRDKyemoCfAUju24d SL+yk0pm9MaL8GAym0K3eMQjngBLoyRpIHnFKRNOiBj0VfNEQ/UeeZcjFVYKEv9XfV9g UJGw== X-Gm-Message-State: AJIora8ahXY1qyFHIc3AhbqzjH9ZZJ6SH3aoUgptYOIiV2Qf7yH0i2ZL +DxNEioZC3N5G67lqSRU5M1RnxHjoBI+bES87pM= X-Google-Smtp-Source: AGRyM1tX0Yj4hhKwKn8Wh56LVxsUs+zEZtzzOqfyiqtoMPojzsjlQH4dKqby9pg3kc6AYzvHnWHIojiIQybijv0fZ+I= X-Received: by 2002:a25:cbcf:0:b0:66e:8893:a02c with SMTP id b198-20020a25cbcf000000b0066e8893a02cmr14089485ybg.460.1657891133149; Fri, 15 Jul 2022 06:18:53 -0700 (PDT) MIME-Version: 1.0 References: <20220715112607.591-1-peterwu.pub@gmail.com> <20220715112607.591-10-peterwu.pub@gmail.com> In-Reply-To: <20220715112607.591-10-peterwu.pub@gmail.com> From: Andy Shevchenko Date: Fri, 15 Jul 2022 15:18:16 +0200 Message-ID: Subject: Re: [PATCH v5 09/13] iio: adc: mt6370: Add MediaTek MT6370 support To: ChiaEn Wu Cc: Lee Jones , Daniel Thompson , Jingoo Han , Pavel Machek , Rob Herring , Krzysztof Kozlowski , Matthias Brugger , Sebastian Reichel , Chunfeng Yun , Greg Kroah-Hartman , Jonathan Cameron , Lars-Peter Clausen , Liam Girdwood , Mark Brown , Guenter Roeck , "Krogerus, Heikki" , Helge Deller , ChiaEn Wu , Alice Chen , cy_huang , dri-devel , Linux LED Subsystem , devicetree , linux-arm Mailing List , "moderated list:ARM/Mediatek SoC support" , Linux Kernel Mailing List , Linux PM , USB , linux-iio , "open list:FRAMEBUFFER LAYER" , szuni chen Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-leds@vger.kernel.org On Fri, Jul 15, 2022 at 1:28 PM ChiaEn Wu wrote: > > 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. > > This adds support the MT6370 ADC driver for system monitoring, including This adds --> Add a > charger current, voltage, and temperature. ... > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include ... > +#define MT6370_AICR_400MA 0x6 > +#define MT6370_ICHG_500MA 0x4 > +#define MT6370_ICHG_900MA 0x8 _mA ? ... > + ret = regmap_read_poll_timeout(priv->regmap, > + MT6370_REG_CHG_ADC, reg_val, > + !(reg_val & MT6370_ADC_START_MASK), > + ADC_CONV_POLLING_TIME_US, > + ADC_CONV_TIME_MS * 1000 * 3); 1000 --> MILLI ? ... > +static int mt6370_adc_probe(struct platform_device *pdev) > +{ Given comment in one place in the entire series would be good to use in another where appropriate. For example, here it would also be nice to have a temporary variable struct device *dev = &pdev->dev; It will shorten some lines. > + struct mt6370_adc_data *priv; > + struct iio_dev *indio_dev; > + struct regmap *regmap; > + int ret; > +} -- With Best Regards, Andy Shevchenko From mboxrd@z Thu Jan 1 00:00:00 1970 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0142FC43334 for ; Fri, 15 Jul 2022 13:20:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=YAJQX7r0J1nj7mNl0Gq8PqC1nKqs5YEZfxm4ioJhsDI=; b=otYOkWpIW77VBD WfV8QW/HhZP14Wg8VtpDCPxGFpbculIVVxbo8m8rrNR7Lvhl+Fcn1qM2/e1nm6wZL0cSNtVszTWIV 7tvFEyYE/nGc57qDhRFZoY6Mq+d35P32qtlvrmoE8s/w9U6m0Q8ueyG1HE7yOb81vOvk0ah540k+b zL1x8pN51i4rGMVoWffNYJAx0GTcOx5x8MHL5E+Aws7fl8LER/gA6UDdWwx6TcOBza31+sHUwqwFI B7j+Hy5lMvk7f3OsNAxhMiadJNWBTIT707GdZHhDu1TBZGI0+mVcMD/pYiv/kMGzRJWgZYsPXdTmv elXe+az/YKRbtcKi4fgA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oCLDf-007CyF-A9; Fri, 15 Jul 2022 13:18:59 +0000 Received: from mail-yb1-xb2e.google.com ([2607:f8b0:4864:20::b2e]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oCLDb-007CxF-ON; Fri, 15 Jul 2022 13:18:57 +0000 Received: by mail-yb1-xb2e.google.com with SMTP id e69so8413153ybh.2; Fri, 15 Jul 2022 06:18:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=RIDFbj9Nm/Hc84YphLe1TSejCss5csMsL3XGmdeREuc=; b=LjTUeU/VvjExiFE7qVdoTT66INknzaksBvLAL0QX/hhMGm1S/DCmWjGAqEm1RDjTt0 nrI4wHZo/WK5aG8U5fIPVbESm+g18hEELTujXpx69+Azj8qnUnYXhFafWvDdYrxJWF8Q n4alCS65LacwduwaUDBvHdbTO5eZ4k4tWaJ199RDLEdi+Nnbu8tJ4UTjcA2YPJBeHBKH hWc3HEBwkV0/ygom4+Ivyr3ViE5siRsP8CdzKAgWRXLBXaArht7DgMtJUJb/WrGYsYt8 eWv+sETgNCGjxIJCtjEQJk1vVPGobtuRYELM3bihPsOKaqDcf5qzy1Ry+AVMll6TrQxi eYjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=RIDFbj9Nm/Hc84YphLe1TSejCss5csMsL3XGmdeREuc=; b=zUBdj2+J8EXNFBWYCzfpCJ/Y5FcTlO8ca3GXKnAIctYCe2ywFqTqO3blp96gdETXQ4 d6XgnjbguGWZiX+QK7aYKL5JB7L8TXzAQZ52J7JQJl7g51YpLbFJ1/Ffz+W5H1IkYqfG mXDWVIKvbb2TUk/AWXhDhZmChqcV3vuXrU/cA0qDGGFBszlOu6PJ5xkWTnlTxVeFb0gD fYJZia8ldi5pHRxkiTYwU9m9jTy2l4uuQ886yiP5RQ0ZDEVfaHgdJD9DR5IAiG14MrvO satWM801fFL/y+rV7TG34BnF32DLPurTO5Di1UIYgCJgXqE+bhtOLse0y3qLyLuGa+10 uAeA== X-Gm-Message-State: AJIora+oTdLAfXIj0RAmZ6OT3DfdW0upOItUWdDsZEoqeONZoLAArSde WA0jmjZoKn38CCLmmf1nbi2muoSxox8VXE3gBd17mNGG8mg= X-Google-Smtp-Source: AGRyM1tX0Yj4hhKwKn8Wh56LVxsUs+zEZtzzOqfyiqtoMPojzsjlQH4dKqby9pg3kc6AYzvHnWHIojiIQybijv0fZ+I= X-Received: by 2002:a25:cbcf:0:b0:66e:8893:a02c with SMTP id b198-20020a25cbcf000000b0066e8893a02cmr14089485ybg.460.1657891133149; Fri, 15 Jul 2022 06:18:53 -0700 (PDT) MIME-Version: 1.0 References: <20220715112607.591-1-peterwu.pub@gmail.com> <20220715112607.591-10-peterwu.pub@gmail.com> In-Reply-To: <20220715112607.591-10-peterwu.pub@gmail.com> From: Andy Shevchenko Date: Fri, 15 Jul 2022 15:18:16 +0200 Message-ID: Subject: Re: [PATCH v5 09/13] iio: adc: mt6370: Add MediaTek MT6370 support To: ChiaEn Wu Cc: Lee Jones , Daniel Thompson , Jingoo Han , Pavel Machek , Rob Herring , Krzysztof Kozlowski , Matthias Brugger , Sebastian Reichel , Chunfeng Yun , Greg Kroah-Hartman , Jonathan Cameron , Lars-Peter Clausen , Liam Girdwood , Mark Brown , Guenter Roeck , "Krogerus, Heikki" , Helge Deller , ChiaEn Wu , Alice Chen , cy_huang , dri-devel , Linux LED Subsystem , devicetree , linux-arm Mailing List , "moderated list:ARM/Mediatek SoC support" , Linux Kernel Mailing List , Linux PM , USB , linux-iio , "open list:FRAMEBUFFER LAYER" , szuni chen X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220715_061855_829653_96F97CE2 X-CRM114-Status: GOOD ( 16.67 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Jul 15, 2022 at 1:28 PM ChiaEn Wu wrote: > > 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. > > This adds support the MT6370 ADC driver for system monitoring, including This adds --> Add a > charger current, voltage, and temperature. ... > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include ... > +#define MT6370_AICR_400MA 0x6 > +#define MT6370_ICHG_500MA 0x4 > +#define MT6370_ICHG_900MA 0x8 _mA ? ... > + ret = regmap_read_poll_timeout(priv->regmap, > + MT6370_REG_CHG_ADC, reg_val, > + !(reg_val & MT6370_ADC_START_MASK), > + ADC_CONV_POLLING_TIME_US, > + ADC_CONV_TIME_MS * 1000 * 3); 1000 --> MILLI ? ... > +static int mt6370_adc_probe(struct platform_device *pdev) > +{ Given comment in one place in the entire series would be good to use in another where appropriate. For example, here it would also be nice to have a temporary variable struct device *dev = &pdev->dev; It will shorten some lines. > + struct mt6370_adc_data *priv; > + struct iio_dev *indio_dev; > + struct regmap *regmap; > + int ret; > +} -- With Best Regards, Andy Shevchenko _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel From mboxrd@z Thu Jan 1 00:00:00 1970 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A1B36C43334 for ; Sat, 16 Jul 2022 14:37:25 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B589B10F07F; Sat, 16 Jul 2022 14:35:31 +0000 (UTC) Received: from mail-yb1-xb33.google.com (mail-yb1-xb33.google.com [IPv6:2607:f8b0:4864:20::b33]) by gabe.freedesktop.org (Postfix) with ESMTPS id E39A410E06A for ; Fri, 15 Jul 2022 15:10:14 +0000 (UTC) Received: by mail-yb1-xb33.google.com with SMTP id y195so8976176yby.0 for ; Fri, 15 Jul 2022 08:10:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=RIDFbj9Nm/Hc84YphLe1TSejCss5csMsL3XGmdeREuc=; b=LjTUeU/VvjExiFE7qVdoTT66INknzaksBvLAL0QX/hhMGm1S/DCmWjGAqEm1RDjTt0 nrI4wHZo/WK5aG8U5fIPVbESm+g18hEELTujXpx69+Azj8qnUnYXhFafWvDdYrxJWF8Q n4alCS65LacwduwaUDBvHdbTO5eZ4k4tWaJ199RDLEdi+Nnbu8tJ4UTjcA2YPJBeHBKH hWc3HEBwkV0/ygom4+Ivyr3ViE5siRsP8CdzKAgWRXLBXaArht7DgMtJUJb/WrGYsYt8 eWv+sETgNCGjxIJCtjEQJk1vVPGobtuRYELM3bihPsOKaqDcf5qzy1Ry+AVMll6TrQxi eYjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=RIDFbj9Nm/Hc84YphLe1TSejCss5csMsL3XGmdeREuc=; b=xzr78fAC3UzMj1PAfjDYqHy2JOUjlLcUjLNYh80RlSdLfhJpDpk2WgO4EwdNI6DetE lsCR8vsyxkCY+JSm82QV/Lp4opiZ9drlzmmvEIBVOwfP/00BoUWfeqeBSAmmJ1+HtWW7 mdkOFyPsiPFU3nNHBP6whzI/hmjkUevsXfrMYFma7DE5nuRjwNDrlT8DZF55atcWc3ux 1WuyS+s2SJi8JiuUqjofvTTu/DgukQLK48CXRMeFiI9JkjjR6zOIvnpl+U/2VavlMpM5 /4te8DaMvjzXwzVr+zpyS0kNHZaeHkSo66BDElBFzvlr/lIolfaYlqflJLURKckked/+ T7tg== X-Gm-Message-State: AJIora/tSi37YptNULQpdqWswxkGg/U16FX8S+TyZHJD2w9KDS6sIQrn jgV2zbSbTsDHvWp86EwjpTqKg1cKulz9H85F0x4HHpC4btA= X-Google-Smtp-Source: AGRyM1tX0Yj4hhKwKn8Wh56LVxsUs+zEZtzzOqfyiqtoMPojzsjlQH4dKqby9pg3kc6AYzvHnWHIojiIQybijv0fZ+I= X-Received: by 2002:a25:cbcf:0:b0:66e:8893:a02c with SMTP id b198-20020a25cbcf000000b0066e8893a02cmr14089485ybg.460.1657891133149; Fri, 15 Jul 2022 06:18:53 -0700 (PDT) MIME-Version: 1.0 References: <20220715112607.591-1-peterwu.pub@gmail.com> <20220715112607.591-10-peterwu.pub@gmail.com> In-Reply-To: <20220715112607.591-10-peterwu.pub@gmail.com> From: Andy Shevchenko Date: Fri, 15 Jul 2022 15:18:16 +0200 Message-ID: Subject: Re: [PATCH v5 09/13] iio: adc: mt6370: Add MediaTek MT6370 support To: ChiaEn Wu Content-Type: text/plain; charset="UTF-8" X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "open list:FRAMEBUFFER LAYER" , "Krogerus, Heikki" , Krzysztof Kozlowski , Alice Chen , linux-iio , dri-devel , Liam Girdwood , cy_huang , Pavel Machek , Lee Jones , Linux LED Subsystem , Daniel Thompson , Helge Deller , Rob Herring , Chunfeng Yun , Guenter Roeck , devicetree , Linux PM , szuni chen , Mark Brown , "moderated list:ARM/Mediatek SoC support" , Matthias Brugger , linux-arm Mailing List , Jingoo Han , USB , Sebastian Reichel , Linux Kernel Mailing List , ChiaEn Wu , Greg Kroah-Hartman , Jonathan Cameron Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Fri, Jul 15, 2022 at 1:28 PM ChiaEn Wu wrote: > > 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. > > This adds support the MT6370 ADC driver for system monitoring, including This adds --> Add a > charger current, voltage, and temperature. ... > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include ... > +#define MT6370_AICR_400MA 0x6 > +#define MT6370_ICHG_500MA 0x4 > +#define MT6370_ICHG_900MA 0x8 _mA ? ... > + ret = regmap_read_poll_timeout(priv->regmap, > + MT6370_REG_CHG_ADC, reg_val, > + !(reg_val & MT6370_ADC_START_MASK), > + ADC_CONV_POLLING_TIME_US, > + ADC_CONV_TIME_MS * 1000 * 3); 1000 --> MILLI ? ... > +static int mt6370_adc_probe(struct platform_device *pdev) > +{ Given comment in one place in the entire series would be good to use in another where appropriate. For example, here it would also be nice to have a temporary variable struct device *dev = &pdev->dev; It will shorten some lines. > + struct mt6370_adc_data *priv; > + struct iio_dev *indio_dev; > + struct regmap *regmap; > + int ret; > +} -- With Best Regards, Andy Shevchenko