Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp451533imw; Fri, 15 Jul 2022 06:30:32 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vITR86PWiYUYmINTQD3zLKTCHwCTIuh/y8PzR2KgVK7rrU+THJUPuZZO+EMVHF4/Rqy+iK X-Received: by 2002:a05:6870:8a0f:b0:10c:3bba:4cca with SMTP id p15-20020a0568708a0f00b0010c3bba4ccamr10395410oaq.53.1657891832049; Fri, 15 Jul 2022 06:30:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657891832; cv=none; d=google.com; s=arc-20160816; b=wFyKE271Y6nr7x/TDlxktSOgq66K6exvgPqHd/zko+K8PVKmbHKEwu7V5B8Jnyuymi mr74hJN6pIggD5Dlo6V0fRgyFwF6F9It3Jt+J+ewHvQFh64Lk7/vBr9bM69sAAkky5OM 05WNp3FGUyNuiseorl37klF7nicpoBrecSyf+k4G8Xo2z9/gN+BCCb7a1TpzRDTAWyfO oMLDwkXaBAlCbaMkW9Q1ri23PWbddyswX+hl6PRKD+K77Z13EfeJZUyhHlXA9I++qCGe jZr3aiqKNY+UBKXOsapTrHzvswGQutxHAbROPA6LG8SDcx3rtysB5SJ1FHIntG0INm+z TCvQ== 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=RIDFbj9Nm/Hc84YphLe1TSejCss5csMsL3XGmdeREuc=; b=koPIYi627i0v39ONOUPyLEAQ0EYXgsuY/Z/qg/bDayDhNVVutjPiselSS/L7xYpdkq n79TxhvRVSL1oOGsmw9VHw9Rjh3QDqoAp/qQwDcKYkan3mMW8W6wlhPwyvF/CJ9DdNSr zWoar8m07gMdQPWFlI7OiY7qjFrWC7v7N6hy14GQN1cpJva6vJR1+wp2sikZOwZWbzAd xfOCxOPUPIEPjreRZXhevWkRT/L1wtWntyPy4rVn2yPXkDGALxSTOxBh+vKEX8msx75D NeQ2M4s+5R4jntpWDkVHNRXxVzK80EnNW9jjKAgz2U/mrvJwcadjvrd3qhBTCOVHUr+E Hr0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="LjTUeU/V"; 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 ep36-20020a056870a9a400b000f5f064ca86si2628840oab.89.2022.07.15.06.29.55; Fri, 15 Jul 2022 06:30:32 -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="LjTUeU/V"; 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 S234580AbiGONS6 (ORCPT + 99 others); Fri, 15 Jul 2022 09:18:58 -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-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" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham 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 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