Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp548542pxk; Fri, 11 Sep 2020 13:59:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyB2gnTGlrDw8j0555shvA8u9U+sqAJl8/A2vtPiX/NXp98VjCkDx9m3VucBQZxzb67KhMv X-Received: by 2002:a05:6402:138a:: with SMTP id b10mr4450578edv.113.1599857968204; Fri, 11 Sep 2020 13:59:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599857968; cv=none; d=google.com; s=arc-20160816; b=z3Q+GZ/3iFbFf2d7EVuuyv0pQX+sK3d+kyECDBvZ2ame3fkGV/Cvwqf6hTW5dTKdiu ywfwK8L0fTAvT8y/SirrHRb9EN2C0jNEuj6ElT6h6vozhep3AYaGMtgCgxulZRLC6IXv 9ImjuJiz8N7KmwidHQo08ND5fQXujeB+20po68mpjFLOU7lVmBejRqlex2j7LtUsOcqZ YbxwFE1k4Igil+xP1KIRnNaiFpD9CveEa4PoqxbvGwEWM1KC5kY8iqQWfQOef66JfFL4 QnhFY8NcGfu6jr1lfviU8LdofnLZgTU0iUs3RpWlu0AhU51vhFanZZxnhOHNl/cm53Zb vG9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=EN1aXepR2pAjS7TkWhKDjvai8AQzIN3Al8VaNg0aZds=; b=WUAdyExru4jp0+KIcbhbGhPjCpKrWpMby6q8TrqmEdIM8KvqC3clq4mw3P8K+ZWaSF BaFH/dfc5YSLz8lQac7R5+m+ZpVCcq6rbgf9hw+SUl6rxWayffDyEpmm1SAQ8A2rd3as fZLwWPUv/JCM970yFmPDnUf830M4VjZrVktMd29F8rbJFHYCkC52oivRRsZhohwzrKkQ /+xGIMTtTiGs7Gk+P4/gGvgrySL2QFD65G2MJ6GET//Ajm2GyhMQozdDSNL9rT+EAgG8 2TTjm9FboGZN4LpPvQ6GWS6yZcVmYeKd2hFpApTHbUplCYaMSj0eIrTh1CnInolJ0U6z BIWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=FDN5aR1m; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t12si2283475edc.174.2020.09.11.13.59.05; Fri, 11 Sep 2020 13:59:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=FDN5aR1m; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.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: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725910AbgIKU4T (ORCPT + 99 others); Fri, 11 Sep 2020 16:56:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57108 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725811AbgIKU4P (ORCPT ); Fri, 11 Sep 2020 16:56:15 -0400 Received: from mail-ed1-x542.google.com (mail-ed1-x542.google.com [IPv6:2a00:1450:4864:20::542]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ADB4AC061573; Fri, 11 Sep 2020 13:56:14 -0700 (PDT) Received: by mail-ed1-x542.google.com with SMTP id ay8so11476786edb.8; Fri, 11 Sep 2020 13:56:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=EN1aXepR2pAjS7TkWhKDjvai8AQzIN3Al8VaNg0aZds=; b=FDN5aR1mZNsEYGXCC1BPMBu0sm0hScQh2NjkB1fe3oZh5VizOrUpX/nnaUi4GgW5va L+LDwSSw9Qw/DpnuvmcdBJi6SbQwk3quhgcGiQqSBUIyeCSl7RHdwo49O18KQTsMjIop qDAcEgE7JoYcKXoh8woTdO8sumbjYbkyObegcVrcj3VouezYf+YgwmhTIhSEqit2Ou4Y koNwrjHNpGH0dnpObyb9djReB7CKAn7StrNDCyV3qt2Gn/6kEAJMKdMGlYW2+sSQhQy0 qpX5oREBRaYK1lSFTy9AafMj8EdNSntKJ0pm4znDC7YvDZKVW5LnuiDKLfxOhAp38OBJ xAog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=EN1aXepR2pAjS7TkWhKDjvai8AQzIN3Al8VaNg0aZds=; b=slxw/Dr3tYqVODZsvURBCJgqsx2gvItxY4eIjZt/ctZwTi6inArKPLhVbo3jqVl1UF 0olq57AhKuJdKMcWlJIR5jrRo7LH+QmHuH4WZY12MlQmFuPb8W3T9Cfy3nVBZ5HIl8ZI Y0biCkVhJWg3/K3OJ/4Btfg1qk7AHLneziU+YPhuSxr4l1JBGSGz+Fug7mu49bR0jH/d qf1mJ0qdOrw3vShBol9NND17C7QED7ZyFKGo5sdRdn/W+uVs1vJ2rETIMVK6J/y+pmHV R7yeckwknH8aWLdguWSLIxBJvvCtXbm8jPFSi2lzkdqqtudvVbEjZZFyyUW/BRal4uf9 TS8g== X-Gm-Message-State: AOAM5332JDAk6J/FDOai1XchPTQFL5MTPpRbDtmgYHehYUcnWO/zc0JN hD4ol9xb9DXdyQWVXigRxB8= X-Received: by 2002:a50:8c24:: with SMTP id p33mr4421467edp.330.1599857773391; Fri, 11 Sep 2020 13:56:13 -0700 (PDT) Received: from ?IPv6:2a01:110f:b59:fd00:e953:3254:5e71:3177? ([2a01:110f:b59:fd00:e953:3254:5e71:3177]) by smtp.gmail.com with ESMTPSA id i17sm2151979ejy.79.2020.09.11.13.56.11 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 11 Sep 2020 13:56:12 -0700 (PDT) Subject: Re: [PATCH v3 1/2] leds: mt6360: Add LED driver for MT6360 To: Pavel Machek Cc: Gene Chen , robh+dt@kernel.org, matthias.bgg@gmail.com, dmurphy@ti.com, linux-leds@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, gene_chen@richtek.com, Wilma.Wu@mediatek.com, shufan_lee@richtek.com, cy_huang@richtek.com, benjamin.chao@mediatek.com References: <1599474459-20853-1-git-send-email-gene.chen.richtek@gmail.com> <1599474459-20853-2-git-send-email-gene.chen.richtek@gmail.com> <559a568e-3a2e-33c6-43aa-547a18f8e26b@gmail.com> <20200911070503.GA9818@amd> From: Jacek Anaszewski Message-ID: Date: Fri, 11 Sep 2020 22:56:10 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: <20200911070503.GA9818@amd> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Pavel, On 9/11/20 9:05 AM, Pavel Machek wrote: > Hi! > >>> +{ >>> + struct mt6360_led *led = container_of(lcdev, struct mt6360_led, flash.led_cdev); >>> + struct mt6360_priv *priv = led->priv; >>> + u32 enable_mask = MT6360_TORCHEN_MASK | MT6360_FLCSEN_MASK(led->led_no); >>> + u32 val = (level) ? MT6360_FLCSEN_MASK(led->led_no) : 0; >>> + u32 prev = priv->fled_torch_used, curr; >>> + int ret; >>> + >>> + dev_dbg(lcdev->dev, "[%d] brightness %d\n", led->led_no, level); >>> + if (priv->fled_strobe_used) { >>> + dev_warn(lcdev->dev, "Please disable strobe first [%d]\n", priv->fled_strobe_used); >> >> Doesn't hardware handle that? IOW, what happens when you have enabled >> both torch and flash? If flash just overrides torch mode, than you >> should not prevent enabling torch in this case. > > Yep, this is strange/confusing... and was reason why I asked for not > supporting strobe from sysfs. What you say now is even more confusing when we look at your ack under this patch: commit 7aea8389a77abf9fde254aca2434a605c7704f58 Author: Jacek Anaszewski Date: Fri Jan 9 07:22:51 2015 -0800 leds: Add LED Flash class extension to the LED subsystem Some LED devices support two operation modes - torch and flash. This patch provides support for flash LED devices in the LED subsystem by introducing new sysfs attributes and kernel internal interface. The attributes being introduced are: flash_brightness, flash_strobe, flash_timeout, max_flash_timeout, max_flash_brightness, flash_fault, flash_sync_strobe and available_sync_leds. All the flash related features are placed in a separate module. The modifications aim to be compatible with V4L2 framework requirements related to the flash devices management. The design assumes that V4L2 sub-device can take of the LED class device control and communicate with it through the kernel internal interface. When V4L2 Flash sub-device file is opened, the LED class device sysfs interface is made unavailable. Signed-off-by: Jacek Anaszewski Acked-by: Kyungmin Park Cc: Richard Purdie Acked-by: Pavel Machek Signed-off-by: Bryan Wu > Could I get you to remove code you are not commenting at when > reviewing? > >>> +MODULE_AUTHOR("Gene Chen "); >>> +MODULE_DESCRIPTION("MT6360 Led Driver"); > > Led -> LED. > > Pavel > -- Best regards, Jacek Anaszewski