Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp5779641ioo; Wed, 1 Jun 2022 12:25:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzoPS1IuEHFbX/GiD0dGsoT+BQRuv3Yv0SZpU9l6uGeE7LVjoM9oAx6E4oqavTLh8lpfIwb X-Received: by 2002:a17:90b:3506:b0:1e0:51a1:a8ee with SMTP id ls6-20020a17090b350600b001e051a1a8eemr949453pjb.112.1654111530689; Wed, 01 Jun 2022 12:25:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654111530; cv=none; d=google.com; s=arc-20160816; b=hnANz/fp0ADyahUZ6czkNqfq8KCA2/+WLq+ju/wrPDpFKUB9KDT1K3ud7TGN7IokP1 xgFHzBsPi/LwP/204wk1O8qCmYsm9SJsAVdobviTCsh0iZKXGFQxrRQ4FR5EvNeawdIr 2E2r1nuM5C3mr8oUNZiqrvgS2ifyTd2dNR2QFwUDa9nXK98SLDF3JXP2cVfsGvEW+GQo UDaQZtyOY/mHU7Npmk0ezvO/0ESMc+iXUd3LRYm+b02oNisVwuJCWgmnwVn67fRQya8P STlwVoqa0JucL4IiWfwmQ1Y+Toh09lfWjefHbK/M1gEzKFS4tevtpMJ987XIUZWbl41b 2rvA== 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=8PCo0X+pMIpsY2Uf1dnrZhLPPiwDltwA+NDnzoDspis=; b=hIhhHnHCyLzber04Iqx54kD2LDW7f2DT2H/31mBs2YWBqMz3WqBVlnBziLKzTLm3Ig gBUWufvwmDBX9O4xrS/WhjNZcID0v2oJfyMibTTPBsSJK0p4vjkOJLMDwQyeduT4+siP EdMVdm15GftB4+gKQJWOtyr8cPsEGEAI69WflBpOnTbWp7Ea0SODAHRyzF8XbFqGDs2z 8F8/pnLWwYkrCSCOuNlAduJMOQ4urHS4sUbZBb+27GIIMY+IQst6ytN/FnI3PZKbFVpr 8z+uqYwV0UWHOwv+NBhshEwnhoBjSkdR75ampgUEl+OmLlbSVeLhfl3/2iqhipEMFxvs 4Frg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=XhPAQhUf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id k9-20020a170902ce0900b0015873958cc9si3710637plg.515.2022.06.01.12.25.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Jun 2022 12:25:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=XhPAQhUf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id F05F0CC148; Wed, 1 Jun 2022 11:58:31 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351251AbiFAJ6G (ORCPT + 99 others); Wed, 1 Jun 2022 05:58:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36414 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350616AbiFAJ6C (ORCPT ); Wed, 1 Jun 2022 05:58:02 -0400 Received: from mail-ed1-x530.google.com (mail-ed1-x530.google.com [IPv6:2a00:1450:4864:20::530]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E55B9633BF; Wed, 1 Jun 2022 02:57:52 -0700 (PDT) Received: by mail-ed1-x530.google.com with SMTP id er5so1403784edb.12; Wed, 01 Jun 2022 02:57:52 -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=8PCo0X+pMIpsY2Uf1dnrZhLPPiwDltwA+NDnzoDspis=; b=XhPAQhUfhBI91dCm0a95O3zad9USLtdiUcVt34raOi5ptwRCbqGza/NaTDd4EyaLX1 v+lU4+0Cpv23sZE0fOO2N2HTBcIFXG/TrXkhJtsD7CDwNqGJypEeR7+wpAAfxQ1X488D dE+CRh6Hkq089m6paqTZCvDHckNRC4IMxltEdMIcZKV16VY0YAbxtda5vGAtZ+29jWIB wsP4WOukuw86fxqUt+VuAO/be5ZLtm8pPCExUs4n6YACXBrBBZ59DeQ84G1qh+H99nN5 aOtK25kj0UzNDeF/Trja2mohLceUsbRjs3gvT+99D2KTbrfsm8sfvH805b8ESjdWyxOW REyg== 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=8PCo0X+pMIpsY2Uf1dnrZhLPPiwDltwA+NDnzoDspis=; b=nedvMP7lRmLvzsUGnhIHa6lMA5bto4zrjOR/bSeb84Esg+BLzRRUolET/e/RR5yaDo HuBYJSLQEvhhb8gp3us5esp97OctNQKEYI5cps7I+n2+HIbAWiExOp/RMdKStHqrsKan 3TiVlvRRdYqA4YrAhvley4Y8ysTK6L1MBrseWbg8orSqJ6J/2YHsq0dBh6gkfzyX+X6X uzNwsjniWWVGlFd/VpH99ZAgLBM/3B+D4Ojp3JeAoHDBKZl/eAsTs2ldsIjv+qqDuaV8 X+5/39RgMip5NG5Ov6FcE1j/lvJlmKSFjqEfxu2uPuF1Tw6WiynijxTwsAzfRQw65lG8 lUhQ== X-Gm-Message-State: AOAM533QKdC+SAeD8xjd0XhUBjvJWMW/noXSpdFx3aKvNGehvSSBWPfj Rv+kh7EkkyUklihV6CfG1A7A1tXbjqA3gSwczNY= X-Received: by 2002:a05:6402:249e:b0:42d:bb88:865b with SMTP id q30-20020a056402249e00b0042dbb88865bmr21507509eda.141.1654077471168; Wed, 01 Jun 2022 02:57:51 -0700 (PDT) MIME-Version: 1.0 References: <20220531102809.11976-1-peterwu.pub@gmail.com> <20220531102809.11976-8-peterwu.pub@gmail.com> In-Reply-To: <20220531102809.11976-8-peterwu.pub@gmail.com> From: Andy Shevchenko Date: Wed, 1 Jun 2022 11:57:15 +0200 Message-ID: Subject: Re: [PATCH 07/14] leds: flashlight: 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 , cy_huang@richtek.com, alice_chen@richtek.com, chiaen_wu@richtek.com, 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=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 Tue, May 31, 2022 at 1:32 PM ChiaEn Wu wrote: > > From: Alice Chen > > Add Mediatek MT6370 flashlight support Same comments about the commit message. ... > +#include > +#include > +#include + blank line? > +#include + blank line > +enum { > + MT6370_LED_FLASH1, > + MT6370_LED_FLASH2, > + MT6370_MAX_LEDS > +}; ... > + struct mt6370_led *led = container_of(fl_cdev, struct mt6370_led, > + flash); > + struct mt6370_led *led = container_of(fl_cdev, struct mt6370_led, > + flash); Make a helper out of this #define to_mt637_led() container_of() and reuse. ... > + /* > + * For the flash turn on/off, HW rampping up/down time is 5ms/500us, ramping > + * respectively Period! > + */ ... > + const char * const states[] = { "off", "keep", "on" }; > + const char *str; > + int ret; > + > + if (!fwnode_property_read_string(init_data->fwnode, > + "default-state", &str)) { > + ret = match_string(states, ARRAY_SIZE(states), str); > + if (ret < 0) > + ret = STATE_OFF; > + > + led->default_state = ret; > + } fwnode_property_match_string()? ... > + if (!count || count > MT6370_MAX_LEDS) { > + dev_err(&pdev->dev, > + "No child node or node count over max led number %lu\n", count); > + return -EINVAL; return dev_err_probe(...); > + } -- With Best Regards, Andy Shevchenko