Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1978309imm; Mon, 3 Sep 2018 14:54:46 -0700 (PDT) X-Google-Smtp-Source: ANB0Vdbu5fVs/KTk+RyEgQsRR1yJu/5Jw54h/cPqQ1DkvIZdHFZZg7tfwT3fMu8GqVYsA42p1/OJ X-Received: by 2002:a62:5a01:: with SMTP id o1-v6mr32032686pfb.0.1536011686595; Mon, 03 Sep 2018 14:54:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536011686; cv=none; d=google.com; s=arc-20160816; b=yT80lb65cifFnC6bhO36+s/g/zBwes0Ium4fHDx/SXXLGu0RZ8Wh6kkNu7pLNydZJw m96oUpbmn8Y+4q+SY9h6pBWMRqNDsJNAGEkyGCcpvzS4OTz77jT39dxEM//jfSVfyBj0 XTK8QQHrSLhO+l1FXNvqu4pbK6x9jy/yBJhCkXBQkiQ4RJaSgIjdP8dHvtbqUfM7D+nC TmGQfACrSAxtZakwrOD/NomCIFJ+JpKHXIHyJrGsMo2ujAsFCtv2e6Xjq8iXJItepBWN qkadDSAADq68oeSJUplRQsxSjNrVsMNbH9QLcQmSEUCCV6JbRt2Y0A732GVQWyumypnF ys6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=kreYiQocA5gmEdj4pxfliupjiLWpDShPkjwASSqmqdE=; b=J1p8QYK16f9+ZJ6WSbNEb9OIuge8Oxd0CsvZyC2d3gXdh1NxuCafWGJC3aXq846WMa Wq3mm9nwoTFdSOg2eDGY1cDYY1GFktS7vbVdhmrrFP4+tA3VlQXVcFrSHGAj+R9z/nB4 ILrIEGR+b9XmjLQeGeo4EjSM0EQIyvitDTeOBUFyFL50lNHgfq9xOQ+LzhQQopfwZgdD 8x6BV9G1Mjw2Ws4+Puse0KZOJNXXvWy5LstLsD2Qo6J+0NS7M5xabj/YOxE4ppgmf5wB kKU8KbEPUgu4tMGtlSf9DHxmnPya7hDynNx8slss8lEZe17j/FoeJpvPTT3hm/Sr27sD mO5w== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 205-v6si18688669pgd.271.2018.09.03.14.54.31; Mon, 03 Sep 2018 14:54:46 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727462AbeIDCPc (ORCPT + 99 others); Mon, 3 Sep 2018 22:15:32 -0400 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]:40648 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726183AbeIDCPc (ORCPT ); Mon, 3 Sep 2018 22:15:32 -0400 Received: by atrey.karlin.mff.cuni.cz (Postfix, from userid 512) id B0B5280642; Mon, 3 Sep 2018 23:53:23 +0200 (CEST) Date: Mon, 3 Sep 2018 23:53:23 +0200 From: Pavel Machek To: Jacek Anaszewski Cc: bjorn.andersson@linaro.org, Baolin Wang , rteysseyre@gmail.com, broonie@kernel.org, linus.walleij@linaro.org, linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v7 1/2] leds: core: Introduce LED pattern trigger Message-ID: <20180903215323.GA21489@amd> References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="LZvS9be/3tNcYl/X" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --LZvS9be/3tNcYl/X Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi! > > +static int pattern_trig_start_pattern(struct led_classdev *led_cdev) > > +{ > > + struct pattern_trig_data *data =3D 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); > > + } >=20 > 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 :-) >=20 > 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 :-)=20 https://gitlab.com/tui/tui/blob/master/ofone/tests.notcc/primes.nc ) Pavel --=20 (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blo= g.html --LZvS9be/3tNcYl/X Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAluNrVMACgkQMOfwapXb+vJ5fgCfZH6qXX2O1Uaq4FdANEL8rNhR BdcAn0Q95ZTd5C2NKYMwtmkOQWSzc+Lg =7xnK -----END PGP SIGNATURE----- --LZvS9be/3tNcYl/X--