Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2097649imm; Mon, 3 Sep 2018 19:07:36 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaeF3n+E8WeWzNXMei/bBHWwLAdyzrG/EV6fmh5edPGbUuliQtKIGdO5YTUldLcVIH3zdc3 X-Received: by 2002:a17:902:8ec7:: with SMTP id x7-v6mr31646825plo.336.1536026856716; Mon, 03 Sep 2018 19:07:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536026856; cv=none; d=google.com; s=arc-20160816; b=cbK7clOlCrDCvMfMwqqrYvFU/p/Cy5VKhyGxknkgYVWe8fd1Z2Ccl504vwpJog1MJi 3lAONMjLMDawrDWaZcZCmoy+HhQO6a2r7SingG3h/f7WooCgQ5z4nopScZ1F5E8dL4zt 8BQD688uMRmnhK+yZridl5GmGYNkxBwiFBELjq1vfLmxBNGG67MddqaMyCuBOVpS8N21 DDbDpiyCuB0XSGi3Bxow1Ly3qFoBgQwTnfalx53Pni3pVYbsu9hdMErJkSNyAIkvZY17 ydSKTohmmPusiOCgWB1q7aWIIOZYVT5Iv+FZKcAJIDutuqtEbLcrAzHzjYeYh7nBC8hR dDvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=XjMqxpPQJ9fij5BCaLNtVMS3QETmSLpdGxOWWCxbZqs=; b=lynpuD34XVANxg6oWuxfDSxuUgDT78LaiCPWjMArAVzpiKhKWms7NdGposlf1AQ4sM JRRQQlVGNLAcXjCM0PuUUG7QYT3VE9YkrbFm1IZ0XeUGna75ysTIWjREEPfvKSKLGeOg NHhyMfxyqRD8f8nQpiIie9wtyfA0n7UPmNbUJ7KW+g9EGgdFkcoGq5pJL22cAJP1Aeq7 EyP+bGL9t7VKuKNPrMsaimINkC8iMt0vE0OJHJ3BwPyHhqPNav4NQFWCIxIQ7EpwKBET 9IshAoZhth1A7dwC52yPZvTg+0KN7RvmFFMnNokXWXvub7RL1UnQ0k5vXOjyjQEdhiPD Vt7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MhEtouMO; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ca2-v6si22097849plb.305.2018.09.03.19.07.08; Mon, 03 Sep 2018 19:07:36 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MhEtouMO; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726090AbeIDG1z (ORCPT + 99 others); Tue, 4 Sep 2018 02:27:55 -0400 Received: from mail-oi0-f65.google.com ([209.85.218.65]:37327 "EHLO mail-oi0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726008AbeIDG1z (ORCPT ); Tue, 4 Sep 2018 02:27:55 -0400 Received: by mail-oi0-f65.google.com with SMTP id p84-v6so3856053oic.4 for ; Mon, 03 Sep 2018 19:05:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=XjMqxpPQJ9fij5BCaLNtVMS3QETmSLpdGxOWWCxbZqs=; b=MhEtouMOLdc64myIhp1vDfz6u8vAcQN39lOiiGdARtQBCsi+8ADxJ5K4MhBw+pnU4/ eYI6QkO1kIQ9sXg0BzuSQ8nek/YdscYPdABKfLQWIszL/1m5idsiRgUYMljDZU5SkTg5 FfdQMAhmUvBJFNxvjkDKj1CHZF5sVICpxfTGE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=XjMqxpPQJ9fij5BCaLNtVMS3QETmSLpdGxOWWCxbZqs=; b=Q17tZCqEJ59HRWCgPNZNTBoJg+7TFkTt0dvrm5e1M9iFts/Qtv3ltNGMwKDqO0u8C8 ZF//vOzBbz3OWseguGWtYMtxcLd8/L2CteJDOYf5RYaYC32MWZhJGcKkFZMtvhded1zn QvG6fsaRWAELsXtjSibLgYtG8RHtnGEBN7o9gar5Y/36F7ReaEYdouCCnc4ytrkgGGaF EgUel8lkt08wYJQkZDSJdBeaIuc48neyVq09lDXK8fVeH1fh82deSNJkj+rwSp6wm8KD Xbp3WIgwb9BsZjc4f3FaFigx1B5l/8iYdILpvZz2R/eqa+BO2+Fz6dcMHmGYMJe76cGZ AMwQ== X-Gm-Message-State: APzg51B8/AltdPMQAhRJIE5HoAsxgCmyyh4a/wbBJRUBOWYOw4pt87GN FeGM1KZ+qFXb7sSn9CafEXUK/UvIKdKS/csnwFzLAw== X-Received: by 2002:aca:50cf:: with SMTP id e198-v6mr23284573oib.332.1536026707116; Mon, 03 Sep 2018 19:05:07 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a9d:1d28:0:0:0:0:0 with HTTP; Mon, 3 Sep 2018 19:05:06 -0700 (PDT) In-Reply-To: <20180903215323.GA21489@amd> References: <20180903215323.GA21489@amd> From: Baolin Wang Date: Tue, 4 Sep 2018 10:05:06 +0800 Message-ID: Subject: Re: [PATCH v7 1/2] leds: core: Introduce LED pattern trigger To: Pavel Machek Cc: Jacek Anaszewski , Bjorn Andersson , rteysseyre@gmail.com, Mark Brown , Linus Walleij , Linux LED Subsystem , LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Pavel, On 4 September 2018 at 05:53, Pavel Machek wrote: > Hi! > >> > +static int pattern_trig_start_pattern(struct led_classdev *led_cdev) >> > +{ >> > + struct pattern_trig_data *data = led_cdev->trigger_data; >> > + >> > + if (!data->npatterns) >> > + return 0; >> > + >> > + if (data->is_hw_pattern) { >> > + return led_cdev->pattern_set(led_cdev, data->patterns, >> > + data->npatterns, data->repeat); >> > + } >> >> I have doubts here if it is a good idea to enforce array of tuples >> as a generic interface for all hw_patterns. It may not fit well for >> every hw pattern engine. It seems that the only feasible solution will >> be allowing drivers to come up with their own interfaces, i.e. the >> approach you proposed at first for your driver. It seems that the >> ledtrig-pattern with software pattern mechanism will be just >> a nice side effect of this series :-) >> >> Unless someone will propose a better solution. > > I believe array of tuples will work for everyone. It is just a LED, it > can change intensity over time. > >> We need a broader consensus here. I'd like to hear Pavel's opinion, >> since he's been always in favor of common pattern interface, and >> inspired this work. > > I believe Baolin did good work here. I believe it will cover most, if > not all, hardware engines out there. I think we should merge it, and > see what happens -- it should be good enough. > > (Yes, there's still more work to do, but that will be stuff like RGB > LED synchronization.) > > (And yes, one of the LED chip has pattern engine that can compute > prime numbers on its own. I don't expect to support > _that_. Fortunately, nobody but me is likely to want that pattern, so > we are still okay :-) Thanks for your explanation here. So I think I should keep the same logics in next version. -- Baolin Wang Best Regards