Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp895446iob; Thu, 28 Apr 2022 13:13:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzriYxecKQd1dP4zkpUQRXDHcHAX849icVIAor5yoxE/0VIAl3mqKVxKtps32h8qYrXqv+D X-Received: by 2002:a2e:7513:0:b0:24f:13ac:e5ef with SMTP id q19-20020a2e7513000000b0024f13ace5efmr13532126ljc.512.1651176807182; Thu, 28 Apr 2022 13:13:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651176807; cv=none; d=google.com; s=arc-20160816; b=f3r8hFb5JhkOcPzcqncGHDYfgUMVNXOpZV4rmOw6iOr70giheeCzufGojsX06dGLwW e1zj97HOIazkGsFFHVs0sL6UFAoAkcgk3qgN8gjBaldhCE6oQ8g6uOAkZVoTSjsaY2eJ QUJTArCFyiBf71U5B8BMjS8HNJwiQyiEXfxI4yU4c4VRY6sP3jMHkwF8ch6d8zSQ6Kw4 49UxpiSEvMIvrbsncLpIzcdCbJmWkFNA0Vrjo7vLG8IQjwikQ3mFJGsKiZJkTZ5bL9v+ DC5IXYQOk4RG7pBS6yc5du52LVY2TfUgLhC1X3ffNorXV9/rAO2s1daDgukFhuRVPi0U 2drA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=edaPhOqJ6sNMjVlH4NUtpjaeXKOnbtBwCPOsuCBJZKU=; b=oi5YcaQuM3ix0ND4vhIr8LXjEim8xNmnO+uziRUr8kOX9AZ+9GCZIxHKCKYZD0l9x+ 3OYwa2VCpEeB/k4e437BqHIsEj/nhs+p3bV93jye/d6ueC1SD4yzLK6ui9CYE8X7RDaF Vq2XZxNSDqvdI5c3BrH+2uh4J9MQ7jKyozZuP5E2a9J1SyUA10TYi44A8vkF5rVArgIK StzTNIMnh2MbW4WCva/Ij7d+C3yH1iI6skws1i06SK0Q0JkVn4xLJEbAPDsFvdwAbWmx WqbKBie03uRDaRrv/qst84W6lwiWuza2fNDtkaWnCiMhJo33tz5g+EqtSE8KygdvUBi7 4jLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=YfTcS3mT; 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 z1-20020a2e9b81000000b0024b503a505bsi4978836lji.131.2022.04.28.13.12.59; Thu, 28 Apr 2022 13:13:27 -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=YfTcS3mT; 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 S1348654AbiD1PAc (ORCPT + 99 others); Thu, 28 Apr 2022 11:00:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50740 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348593AbiD1PAb (ORCPT ); Thu, 28 Apr 2022 11:00:31 -0400 Received: from mail-lf1-x12e.google.com (mail-lf1-x12e.google.com [IPv6:2a00:1450:4864:20::12e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A0D824968D; Thu, 28 Apr 2022 07:57:15 -0700 (PDT) Received: by mail-lf1-x12e.google.com with SMTP id bq30so9136525lfb.3; Thu, 28 Apr 2022 07:57:15 -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:content-transfer-encoding; bh=edaPhOqJ6sNMjVlH4NUtpjaeXKOnbtBwCPOsuCBJZKU=; b=YfTcS3mTCtPbXgS8Mwgqg8cvzUAYE7YiXXqaZMlJMg6VhBO0FpM4yubZ5zDlAEJeuj Opn7DtAg0Lyfl7G6/w/ZoaDy6IqOeHkqdmHFm7+L/6y8wXYDN3zzf49jG856cDtCkdoj VM0y4iuzePK/m9x6gD1bW5WejAuEXrFHWlfWumymOhIsWoorhrvFSANFrJo7ra2oSRTj 3H+wdUUR8J+cJ8UQ6Z22bhnfGtTTGpsiDNLu4CvozwQfPtN/5RyI2I4o5gUnQ9yd0ltR 3/76dovmgnl4nZBok+n2ZmwSYaN7oprqbMTMMQboH4149gdOLG22zYmLhfpENXufD7fu U+Kw== 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:content-transfer-encoding; bh=edaPhOqJ6sNMjVlH4NUtpjaeXKOnbtBwCPOsuCBJZKU=; b=VNQOE4+0luLKqwcXdYNKvSEzJXN0B0uvmGq9AOc5zvo2q273jlrBggqADONLkAguNa l5nX4+sPj9aIevG5FbjedBPj/VHTkRiYengJ+uy4sAqDejnYdWNtn2Ba30cePRs5Xt6J Lx4rkACdST1AngKWqU7O6hiLSKzUUcV9E43AOTUDhzk2oIWBX3pevUp60BKEA8O+zifl qrmh7VCgz9qHVarcF7rE2RegyTg/7C1X6ESoPaIZ3BM2fFrRCq6oaJF/7zU0WQKQog2H IpwpHFqYmOTGXWFLAcRBia3r9PzJmSxqcGPM3HyAMlF2l8IMakVDQ9jbw5wm8Jo6TecS PyHw== X-Gm-Message-State: AOAM5307HNajJg7N0MWuXrs0PUOC1TL9dnDH8Gn13X+WH/EFh+TguQ87 /EGm6ow+gxdNM6x7KrURr1syWQn+zDTBIBun8a0= X-Received: by 2002:a19:fc0e:0:b0:471:ff7d:ab35 with SMTP id a14-20020a19fc0e000000b00471ff7dab35mr17334833lfi.345.1651157833665; Thu, 28 Apr 2022 07:57:13 -0700 (PDT) MIME-Version: 1.0 References: <1651138365-17362-1-git-send-email-u0084500@gmail.com> <1651138365-17362-5-git-send-email-u0084500@gmail.com> In-Reply-To: From: ChiYuan Huang Date: Thu, 28 Apr 2022 22:57:01 +0800 Message-ID: Subject: Re: [PATCH 4/4] leds: flash: mt6360: Add mt6360 isnk channel hardwre breath mode support To: Matti Vaittinen Cc: Pavel Machek , Matthias Brugger , ChiYuan Huang , Jacek Anaszewski , Gene Chen , Linux LED Subsystem , linux-arm Mailing List , "moderated list:ARM/Mediatek SoC support" , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, 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 Matti Vaittinen =E6=96=BC 2022=E5=B9=B44=E6=9C= =8828=E6=97=A5 =E9=80=B1=E5=9B=9B =E4=B8=8B=E5=8D=887:51=E5=AF=AB=E9=81=93= =EF=BC=9A > > Hi ChiYuan! > > On Thu, Apr 28, 2022 at 1:03 PM cy_huang wrote: > > From: ChiYuan Huang > > > > Add mt6360 isnk channel hardware breath mode support. > > > > Signed-off-by: ChiYuan Huang > > > > +static int mt6360_gen_breath_reg_config(struct led_pattern *pattern, u= 32 len, > > + u8 *vals, int val_len) > > +{ > > + static const struct linear_range tranges[MT6360_ILED_RANGE_MAX]= =3D { > > + { 125, 0, 15, 250 }, /* tr/f12 and ton, unit: milliseco= nd */ > > + { 250, 0, 15, 500 }, /* toff, unit: millisecond */ > > + }; > > It's nice to see you are using the linear_ranges helpers here! Just a > minor remark - do you think you could use field names in linear_ranges > initializations? That would make it less likely the driver breaks if > someone changes the struct linear_range definition. Eg, use something > like: > > static const struct linear_range tranges[MT6360_ILED_RANGE_MAX] =3D { > /* tr/f12 and ton, unit: millisecond */ > { .min =3D 125, .min_sel =3D 0, .max_sel =3D 15, .step =3D 250 }, > /* toff, unit: millisecond */ > { .min =3D 250, .min_sel =3D 0, .max_sel =3D 15, .step =3D 500 }, > }; > > Do you think that would work? Sure, it works. To specify the field name can be compatible if the struct changes in the fu= ture. Thanks. > > Best Regards > -- Matti > > -- > > Matti Vaittinen > Linux kernel developer at ROHM Semiconductors > Oulu Finland > > ~~ When things go utterly wrong vim users can always type :help! ~~ > > Discuss - Estimate - Plan - Report and finally accomplish this: > void do_work(int time) __attribute__ ((const));