Received: by 2002:ac0:e34a:0:0:0:0:0 with SMTP id g10csp627963imn; Tue, 26 Jul 2022 05:26:53 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vJhasHM5Ej6JXG9KzdX/4FyXFH098aptz6AS37h9Aq1cEsWTv9pak6Rwp9EEQzg9nCc0rA X-Received: by 2002:a05:6402:84d:b0:435:a764:9aad with SMTP id b13-20020a056402084d00b00435a7649aadmr18416339edz.332.1658838412831; Tue, 26 Jul 2022 05:26:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658838412; cv=none; d=google.com; s=arc-20160816; b=mZ1Ns7HT64H7csMNypOi5Um90CmkORnknDaProjw7Q2Oy6fkGSEN6fIOVWS5YRyDxS gElMvAaaD0KpFXxCBfzGlq2d46vZgYS2wJfd3+qEWTtGKym8Pn7A+oUirNHWh0cpUdrT KfwK+69ZrnVz+sYS7JvB7R1F3Y2tKgKEWbNb1HE9Qp3oz7Lyyq9dglXHRKVMdUD4NFPp hs5jfad8RMPJZFCwvwZieAM0TzGN8HI+BJ82cls3MkrYTlEeIWZK1YhK17bqJV9WPr+e RxA+PrSgYawhOsBnfCwn0zdQ6WCOYb/r/k+To91YmEzy6sP63XxCxegsTttVxj5tku5/ hvJg== 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=wL1b72wWwttocLxQ4i2N7IFKv69W21HPhWs4hRLf0o0=; b=NrypndKe1i/Es/dfcXivsAnxwp+tcYJ/KaSs3pwdwObU1QhcBc3RG3tLYKL1KYQ4LV bspH2y0JsMdx1qwnxuBbwCF5PjQL6VZ47cwcwoKZ/DqnUZGNPDIYuX5RN24iFHhHGJiK I8rFhM0SUMMOJ3ddigTOLc5EF/Ch7bWjY5LkvtQktfiZfnlXt0+UD2mVl/vN2h49G6dO ahQFADa7oeDp2Y9IC7f0/GnsZLnN/+nnecav80m2w5NmJZRPDGPsv/ZPf5T5jQ1uFBiL vZQJUQB7QoLKQ8p3jhgS/a3EIwS/1Z22RDrUipUlUGub5MWbH5TI7+DJullScKkfw/xv +xZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=AZ8qDLn4; 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 o9-20020a50fd89000000b0043c87d9eca6si610132edt.76.2022.07.26.05.26.27; Tue, 26 Jul 2022 05:26:52 -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=AZ8qDLn4; 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 S238744AbiGZLqj (ORCPT + 99 others); Tue, 26 Jul 2022 07:46:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55634 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232740AbiGZLqi (ORCPT ); Tue, 26 Jul 2022 07:46:38 -0400 Received: from mail-qt1-x82c.google.com (mail-qt1-x82c.google.com [IPv6:2607:f8b0:4864:20::82c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F413C24BDC; Tue, 26 Jul 2022 04:46:36 -0700 (PDT) Received: by mail-qt1-x82c.google.com with SMTP id u12so10232318qtk.0; Tue, 26 Jul 2022 04:46:36 -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=wL1b72wWwttocLxQ4i2N7IFKv69W21HPhWs4hRLf0o0=; b=AZ8qDLn4Znu85xCahXNOnmojv9wcePPk3Lf2KSJODsdYIL/u4rdAI0Lnw8MiXeeTQl 0fNcl+cJw4vrGMs/9mjAcX99bHsbOpeBwt1ay2R33YRq1VsVjC++YG2fmlp7hix1YwsO IKZ3zoTB97u6iKZxmk+c33+dSbGXuJXJDQz+RRlu+LRdNCgrsyBWNRh2nYIBbuWUos51 BrJUcA7G/8NE1M8r1t7zyLNEvXtcGsNdIwqfkXwOFPRNUwWDTrUivYLlX/lxHIIPKvWG uXmZtHYk57ezocXOjrXXXwhnGpuE94ql5T95iceJZSiu4iSTtJVip83p/q4s/P1JT7m/ PgVQ== 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=wL1b72wWwttocLxQ4i2N7IFKv69W21HPhWs4hRLf0o0=; b=wvpnYcrqPqDabB8SW5KSFMUYX0aK44p9eQIe9nlxcfis3Mdmi5cDaHQVkXupczyKOc GUXeWGFIfKOtsPn9HMGR1vVzNcd9Suh6fMHxm/2EpODI081YjQiCr07vZ7rdvwqoVXdU l+UhkoLymdbCOTE92gQAoUnKY/3Ln6dxdUQJz6DdDZP5m3GZOw3v0AGO8xx2pU3uQgNS El/qLbHDgfQSvvnVtETCjHvad0rx/1z2YdYdtcGMRyiShArQSuojf8xKIabwCgw/vYAu 0wSJR2ApvrkKBhrnrxD66zFVuRj2v8HJ0yrhBvON8eutSbfvNcN8Vj2m+Td1uIrxj28K jQBQ== X-Gm-Message-State: AJIora+A+mosHoqzSrnva77+s7B6I/5oJ7n4l9HJJlWqtX8if5/BxLJY m4MK65D3+ln3/uSARZx+S+8g1u8tH5TnJ8erMvE= X-Received: by 2002:ac8:5a8b:0:b0:31f:27b8:2260 with SMTP id c11-20020ac85a8b000000b0031f27b82260mr13732022qtc.198.1658835995667; Tue, 26 Jul 2022 04:46:35 -0700 (PDT) MIME-Version: 1.0 References: <20220722102407.2205-1-peterwu.pub@gmail.com> <20220722102407.2205-12-peterwu.pub@gmail.com> In-Reply-To: From: ChiaEn Wu Date: Tue, 26 Jul 2022 19:45:59 +0800 Message-ID: Subject: Re: [PATCH v6 11/13] leds: rgb: mt6370: Add MediaTek MT6370 current sink type LED Indicator support To: Andy Shevchenko 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 Mon, Jul 25, 2022 at 4:41 PM Andy Shevchenko wrote: ... > > From: ChiYuan Huang > > ^^^^ (Note this and read below) ... > In conjunction with above what SoB of Alice means? > > You really need to take your time and (re-)read > https://www.kernel.org/doc/html/latest/process/submitting-patches.html. Hi Andy, Thanks for your reply. We are very sorry for this mistake. We will revise it in the next patch. > > ... > > > + * Author: Alice Chen > > + * Author: ChiYuan Huang > > Would > * Authors: > * Name_of_Author 1 > * Name_of_Author 2 > > work for you? It looks good, thanks! We will apply this in the next patch. ... > > +struct mt6370_led { > > + union { > > + struct led_classdev isink; > > + struct led_classdev_mc mc; > > + }; > > Where is the field that makes union work? Just for saving memory space. Because these led_classdevs do not be used at the same time. Or do you think it would be better to rewrite it as follows? ------------------------------------------------------------------------------------- struct mt6370_led { struct led_classdev isink; struct led_classdev_mc mc; struct mt6370_priv *priv; u32 default_state; u32 index; }; ------------------------------------------------------------------------------------- ... > > +static int mt6370_gen_breath_pattern(struct mt6370_priv *priv, > > + struct led_pattern *pattern, u32 len, > > + u8 *pattern_val, u32 val_len) > > +{ > > + enum mt6370_led_ranges sel_range; > > + struct led_pattern *curr; > > + unsigned int sel; > > + u8 val[P_MAX_PATTERNS / 2] = {}; > > + int i; > > + > > + if (len < P_MAX_PATTERNS && val_len < P_MAX_PATTERNS / 2) > > + return -EINVAL; > > + > > + /* > > + * Pattern list > > + * tr1: byte 0, b'[7: 4] > > + * tr2: byte 0, b'[3: 0] > > + * tf1: byte 1, b'[7: 4] > > + * tf2: byte 1, b'[3: 0] > > + * ton: byte 2, b'[7: 4] > > + * toff: byte 2, b'[3: 0] > > + */ > > + for (i = 0; i < P_MAX_PATTERNS; i++) { > > + curr = pattern + i; > > + > > + sel_range = i == P_LED_TOFF ? R_LED_TOFF : R_LED_TRFON; > > + > > + linear_range_get_selector_within(priv->ranges + sel_range, > > + curr->delta_t, &sel); > > + > > + val[i / 2] |= sel << (4 * ((i + 1) % 2)); > > + } > > + > > + memcpy(pattern_val, val, 3); > > Isn't it something like put_unaligned_be24()/put_unaligned_le24()? OK, we will try to apply this method in the next patch. Thank you so much for reviewing our patches so many times and providing so many great suggestions! -- Best Regards, ChiaEn Wu