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 E9311C43334 for ; Mon, 25 Jul 2022 08:55:42 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C322710FA7A; Mon, 25 Jul 2022 08:55:39 +0000 (UTC) Received: from mail-ed1-x52c.google.com (mail-ed1-x52c.google.com [IPv6:2a00:1450:4864:20::52c]) by gabe.freedesktop.org (Postfix) with ESMTPS id E352711A3A9 for ; Mon, 25 Jul 2022 08:55:37 +0000 (UTC) Received: by mail-ed1-x52c.google.com with SMTP id c12so5619072ede.3 for ; 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=pDgrCtHNka9JMGjLdBPOk0adkIQw/gEN813xLCDXsajx07ZwdFEMEdY7FKoKocMaZa ILdShHLf57b64z5bhg3tI33y9yB9z/EAh4KhkTiaucBDaZ+gHuJSDUI/7JL60s8YnYL8 We7tUrMlKSNWsuddxQBsjFTcWF05UiQx1yZ4KZ++mzCp6uw+0V6ZVO/kefjo6prsuyyW GqSK7SWbzCpo5DDns+hfaghUWNru6/IPXZkhjzGiwghYDziBYtFfDHlVCWl9xpVxAKNA 1yOv+T74KCIDPXpeLl/1tZifxIhzTyjgrQfbZlWnby4WhakkleltYM+TlRS7tqaGljgm qaZg== X-Gm-Message-State: AJIora+5ELOynFkSrdUp7vz/mDkakPJmdBlKwrgMYY3gXGgStdzeLHZ0 /uPqQST4d9iugwD91looxujywprDZs38ALbgcl0= X-Google-Smtp-Source: AGRyM1v8y+nmZhsplbXoHzO4Ve+2H3JYkbB6esC4VwvluxmYvgNwKHcXWiOtO8fBnhCqb3I9/pY7SCo8PriYmFxn6lE= 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 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 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