Received: by 2002:ac0:da4c:0:0:0:0:0 with SMTP id a12csp2572269imi; Mon, 25 Jul 2022 02:13:34 -0700 (PDT) X-Google-Smtp-Source: AGRyM1s7vsTiI5ryDhvZ4e6dy1PsNmwCUo5E1gzFIE+ukZ9nbWfJ+o6qhL3H14z3o5RjMQvJt8xV X-Received: by 2002:a05:6402:4442:b0:43b:c866:21be with SMTP id o2-20020a056402444200b0043bc86621bemr12409283edb.28.1658740414016; Mon, 25 Jul 2022 02:13:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658740414; cv=none; d=google.com; s=arc-20160816; b=H1TO/9UwZJXkO1gopDPSlEHq7CYOjbo6Pn74z1jRtV0T5SQeBuAMNRqkBnK4gZS0xM E+K4U37mYVFXPexjBOrUCz3i7CqaT0VUlUvXFPEQsCO508JjvtQsFX9k/dkVAxTxTIvq zH4F6JN9SgUQEh6kRfVa/yXBwVcNcztiyGAjejeMlhwZZI1HJx+rzaAU99Kqru7839d9 DU0e2UD/ZO8yv/Q4h1emILHEz8nyX2CujqcynZsDmjsBqbUp2btt9amx5ScSP5rI3C2v IvcuujVY3r6YIAvmzDpQC7ji9uH7UFIO4TG5Odc6L/oISpX4fVQOVIJ16RLtpFLcIZou RYzw== 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=3INTKFVzGpgdLiO6cm/tt/F3n1FdE/J8Gtrvuuomg/U=; b=qY5vp9jsJQHu6Zlhg+BKyFUlIzNLID23eGy4Ko6bdpUhe95+lIp4r/KyYf/RkPXXUo 8jhLTz//ZZ/xzqdE4UfU7jU+jnd4a83+jKR4RftX5fTSxu2jSXIPcGQ41CmPWGYQnRFt dKHhCwAatJuhsTG/uEWHM0xVaFHVWJ2aNxNWOO0ZGrZBiEFA5Bzv84L5byXUryE45Le5 PONiKHiwc6NRhYo0H4480fv/R5yPq+6AnKUiEloeK7QXeeKG2nBddNOK//4auUronknm GzdsdZn5S9WeDF5JT+N5Ye+Mj8JdW+asbkrPyr1Lw0ivMSqmlj7RhKrGRvxTC0O0N4d1 7IeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=KGUkTvms; 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 ds1-20020a170907724100b0072f38d0b8bcsi11417885ejc.700.2022.07.25.02.13.09; Mon, 25 Jul 2022 02:13:34 -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=KGUkTvms; 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 S234377AbiGYIzq (ORCPT + 99 others); Mon, 25 Jul 2022 04:55:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40364 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234384AbiGYIzj (ORCPT ); Mon, 25 Jul 2022 04:55:39 -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 D1E211582A; Mon, 25 Jul 2022 01:55:37 -0700 (PDT) Received: by mail-ed1-x535.google.com with SMTP id t3so13025556edd.0; Mon, 25 Jul 2022 01:55:37 -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=3INTKFVzGpgdLiO6cm/tt/F3n1FdE/J8Gtrvuuomg/U=; b=KGUkTvmsrFj/i/g2Txcus2neVCIeH7fS7RYDzgarpCQjAlV25rYmvRqFk4rEW2Xu6H dVkCJgHWlrXopXOfsXa7jLI7QUV58LjpMPEGgOlQAaOnihMKMqUORjOGJ0SyGVX6oPmr AMrcGRzTVPctXdbs6Q2EfqiY6PKD5GpzJSWGECpaDGigxvdYX+uHjA92klNsnuWiXkR8 KK3MgVH2qSoijeYpB69tibPEs3jLzlYrbqnbLehlkcag6TPz7QYuNOe0ls9ksOj0BiPk SOG0zIupDCmFrghFibZg1nOn4XrHoUYCdTW2Pwb7i2+PJ+hXVio5/EJxBh6mFV3wBtpH A4FQ== 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=3INTKFVzGpgdLiO6cm/tt/F3n1FdE/J8Gtrvuuomg/U=; b=dxPHoDmRgC9rpOQw/kF0dORG9HPgQXMrNb5ia19fDY/ujBHsUuEz0hYogxJtfGlxG6 /eojK5Ixf0WSISXA18Fgmxa13gAw+VnADFiGo9YTwZu9BgJ4H8XShs6A8YMXfnxQzxp0 AfkmxXd02aoHimGBZwxt5yHj3o2qeGlAvAkNyRhO10oq9KJZuWahas1GeJSqUdAMVspE MDjVtJkN0P+YKUe+ci+xpr6/vSPx8ayPH6zP3yapsJcdMzsQ9xI+eghOsAlMFLl2feOr 9C44e0MvKsQbzlkmjDsKavrMJ+nohNdH6x47ehi+36HMI+P+0hZaEsJ2y4+ypVNJ4hL3 8I4A== X-Gm-Message-State: AJIora8tTq0iBWP3JTuOMng+a9RmiL+HCn7qyylEMaN1Z02H029l8pU+ vcJ2x16a5O8tP6LPXeWQwVIRQCHSFK4f6s9pXqw= X-Received: by 2002:a05:6402:34c5:b0:43a:8f90:e643 with SMTP id w5-20020a05640234c500b0043a8f90e643mr11947835edc.88.1658739336148; Mon, 25 Jul 2022 01:55:36 -0700 (PDT) MIME-Version: 1.0 References: <20220722102407.2205-1-peterwu.pub@gmail.com> <20220722102407.2205-13-peterwu.pub@gmail.com> In-Reply-To: <20220722102407.2205-13-peterwu.pub@gmail.com> From: Andy Shevchenko Date: Mon, 25 Jul 2022 10:55:00 +0200 Message-ID: Subject: Re: [PATCH v6 12/13] leds: flash: mt6370: Add MediaTek MT6370 flashlight 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 22, 2022 at 12:25 PM ChiaEn Wu wrote: Forgot to add a couple of things... ... > +#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. ... > + /* > + * For the flash to turn on/off, need to wait 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? -- With Best Regards, Andy Shevchenko