Received: by 2002:ac0:e34a:0:0:0:0:0 with SMTP id g10csp410717imn; Mon, 25 Jul 2022 21:40:13 -0700 (PDT) X-Google-Smtp-Source: AGRyM1s0nvhWxBqvyGiAEpMTeGGBKE+ROW/9AWZP2pdJK6Vx3wb0sLJt4Op9urmyYM14hVLidqgD X-Received: by 2002:a05:6402:5299:b0:435:61da:9bb9 with SMTP id en25-20020a056402529900b0043561da9bb9mr16771572edb.21.1658810413341; Mon, 25 Jul 2022 21:40:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658810413; cv=none; d=google.com; s=arc-20160816; b=ndeuVgttqbqQ+fn4J9a/Grhc766sYm585LUraSue0dcM39oDAbySFlxNaTtSdVt8Oi HKwUdLLQ7tPq7tyzCUTjtpZhH+e2C/dEqMNnLDM/D+flKytsTDEfSvKocr+cZWDCSsZC JGxQtWQA/ycYRQnmfdDA3tt8k0nYHNiKUjvwQkrjR+o9bidYJK9Ol3OrPs2TV5Aggw2U w+1RkBR41Or1BtBtC4xdb974LI03hZFoBcfnFY5r+dvgmP/uomWGZpbsW/xSKbDtz4id wQ+QAZaKZ9DGKnnj7VwtEnc5kBNmioU0GFPACIxXceGitfbQbfmldPgny/ToXcDtNXWL Ue6g== 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=lL85hlJEWNpWq8aoVq7T9RPrHigl/wy3kQyoeNe4Sas=; b=Vn+d3QCSaxSxLTvpOOuMLPREtkAEn0h39S17TIPbSCLuqnGiNL7hxSf+81Wvw1mDJs yYktn/ixpN98IfdpapxhKX53QxGNhHzeKsQbOuBHQ26148voqHcklQ+eYbTRgncj0VAE 1Ygy0LPjJ8BAF++X0iHcJSVmY0xYjWkwhvIhpY9Jg8leSzdfvGcIoKPr9pvehVruDuwE 84l+Bk8Q0FtT68pblKfFWAF5wT4QsTRh95ooL1zQx/Exm4zJX+rXMxqmbJq/VFxypKZg IMzx5fKA4sW1MAYfab0wbYT3j25ZtuzLsPl+rGIYj+AJTyCcQcPKwTWrH5m3aJtMD5dk IaqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=hCdS8QSs; 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 hr34-20020a1709073fa200b0072ecfeec4cbsi17159776ejc.463.2022.07.25.21.39.46; Mon, 25 Jul 2022 21:40:13 -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=hCdS8QSs; 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 S236692AbiGZEPs (ORCPT + 99 others); Tue, 26 Jul 2022 00:15:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33296 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231440AbiGZEPr (ORCPT ); Tue, 26 Jul 2022 00:15:47 -0400 Received: from mail-yb1-xb2b.google.com (mail-yb1-xb2b.google.com [IPv6:2607:f8b0:4864:20::b2b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6E6BA240AA; Mon, 25 Jul 2022 21:15:46 -0700 (PDT) Received: by mail-yb1-xb2b.google.com with SMTP id j195so4093224ybj.11; Mon, 25 Jul 2022 21:15:46 -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=lL85hlJEWNpWq8aoVq7T9RPrHigl/wy3kQyoeNe4Sas=; b=hCdS8QSsYIw6gGaV0XS9IAV/+XD+Kk0QE5hzusxmOf5d2dTDTQQcL3NhqMYKbFY0Tn ALB21R/6DazMYeCAAzfSZS7P0Z41gJsw+nZjWX6PlQXwXANm3LVAqrB5PFsMuqAHqXem Mqmm3Ih1NTwtWzQhnAzSzRXXrf5yfCoFcjkmFFPLCmRVp2siIg3AfNjuCMTK2YESptid eeP9tz5wTm7qe3sotMpBO4iTSI2DKFf7D3YatBVRT/PbkAZVFycO+siEvHp7i27pNctb TonIMjdDnr0jjVWHRnLmYyT6Iqx8oAClUtlkGASQ6CkTyN1ePQ9WOQPU8smSEzTDkemD 7GYQ== 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=lL85hlJEWNpWq8aoVq7T9RPrHigl/wy3kQyoeNe4Sas=; b=PC6hw7zeLjOXjofpJO1WG7vc5dzxEG2re2M9lU+dBoq7396PI+/H0o18wCV6FXP3HL DVWLfwjhxo6IEwiWKCpIpEPlKmux4/qzcM4DZhZCNbMd7X6p1kvG3YPC3yJskwL6q4mR bnZe0hw9n0J+Xi3G9eMJsaUYwL6S1ZKD9cX+Q6y8lNrxlQKZnLMfAoWykBI5j3AX9D2S 9z2iIrahKCgnt+rZdzI/GVljdaBVN7YBa+n7iN2NH4LCEJgPaqB+wIKMkiopEFMVCIym DJeu1Nz5F5UxTziRTH1aPfl7zngy8kqLsJxYAKxVhaM/Amqw9AgFMiycnhTrO/p03qGt lKJA== X-Gm-Message-State: AJIora+Ml0B1VxZDIMEoOtToMqvbHpdtILIeE9WZF99630HmB0dl3Up+ GiwbnPIJXues3K50dfQsbBjTROsPpFGg5HH8f1w= X-Received: by 2002:a05:6902:10c2:b0:671:73dd:e67e with SMTP id w2-20020a05690210c200b0067173dde67emr484158ybu.16.1658808945685; Mon, 25 Jul 2022 21:15:45 -0700 (PDT) MIME-Version: 1.0 References: <20220722102407.2205-1-peterwu.pub@gmail.com> <20220722102407.2205-13-peterwu.pub@gmail.com> In-Reply-To: From: szuni chen Date: Tue, 26 Jul 2022 12:15:34 +0800 Message-ID: Subject: Re: [PATCH v6 12/13] leds: flash: mt6370: Add MediaTek MT6370 flashlight support To: Andy Shevchenko Cc: ChiaEn Wu , 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" 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 Hi Andy, > > > +#define MT6370_ITORCH_MIN_UA 25000 > > +#define MT6370_ITORCH_STEP_UA 12500 > > +#define MT6370_ITORCH_MAX_UA 400000 > > +#define MT6370_ITORCH_DOUBLE_MAX_UA 800000 > > +#define MT6370_ISTRB_MIN_UA 50000 > > +#define MT6370_ISTRB_STEP_UA 12500 > > +#define MT6370_ISTRB_MAX_UA 1500000 > > +#define MT6370_ISTRB_DOUBLE_MAX_UA 3000000 > > Perhaps _uA would be better and consistent across your series > regarding current units. > Yes, _uA will be more consistent, but in general, using upper case in the define macro is a convention, doesn't it? > > > + /* > > + * For the flash to turn on/off, need to wait for HW ramping up/down time > > we need > > > + * 5ms/500us to prevent the unexpected problem. > > + */ > > + if (!prev && curr) > > + usleep_range(5000, 6000); > > + else if (prev && !curr) > > + udelay(500); > > This still remains unanswered, why in the first place we allow > switching, and a busy loop in the other place? If I refine the description to "For the flash to turn on/off, need to wait for 5ms/500us analog settling time. If any flash led is already used, then the analog is settled done, we don't need to wait again." is it answer the question? Best regards, Alice