Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp3242062imm; Fri, 24 Aug 2018 13:13:51 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaFiT4bR/tp8MgohHva23FrJQOjsYJu1J+kQzxcDui/Tk+2594oIgW8xlwuxtyUlU5cnx0y X-Received: by 2002:a63:ce43:: with SMTP id r3-v6mr3027651pgi.439.1535141631499; Fri, 24 Aug 2018 13:13:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535141631; cv=none; d=google.com; s=arc-20160816; b=BuNv7NKCromy3A2d2QElZbln9QYZNkElxijXKb+c9j0ICN+gD9jXpwNCg/CzSW2eTZ Gu2jKUcuKO07u8GxCyk57Z6WsJpMWnIqVtF6U270kQaj0xb7vTzi+E3TwzDxyZtUKwS3 KHiaI0VEdHCltKFSUk7ZJIBv/Z2TTfejL2QR23+r0D0N0mr11P9JMXp2662rNqffud/Q R8OC4kIVQums6cPO/o8Ts//bT3RHM6kwS2IStK35eP1Cb7EtRXW46fUvlWs3cKbw7dJX ZV/0nUGwGrQDODSlFbC4m5YooA1nsONrGlgxD8JmvCDFiz/Z860HC6IunewJM7S1t+XW QZLQ== 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=udEz4Y8c/JDDK+YsmKDV/JCf6hAOgl9LzXW+O8bF0hI=; b=LtzKZit0jDu+1hIqezDmddqwEjd7rD0/mOcQ+74bwWHzyt9S6EdC48Pba4Ms3XWY3q 9hGrOHdRpE44nWauM631jPfaD1o9JoXoO72UdC+M+yX5KB6oCCv7HkV5cxMF9tX3YarF 5W2ANJxj6v1qVqifKujS1YkEhAvsNCmb5QCj+gAG/OYaLWjmDDyDNOdZwH6nnd+BjsU8 KoqYr7DdepzP3q1eRZ/MsOZYpPaaSZLfc1iaaAX90frQ3H4V1SGEWhY0CWTzDGCBMTbb rjKB+tARAmIf9BMe6Bb5jd88A86kd1wF7/gsFLwfJdRk+0hTofp0QlL47XjdCNf5NaRy WjIw== 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 c17-v6si7701192pge.273.2018.08.24.13.13.36; Fri, 24 Aug 2018 13:13:51 -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 S1727415AbeHXXsk (ORCPT + 99 others); Fri, 24 Aug 2018 19:48:40 -0400 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]:53219 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726675AbeHXXsj (ORCPT ); Fri, 24 Aug 2018 19:48:39 -0400 Received: by atrey.karlin.mff.cuni.cz (Postfix, from userid 512) id BC2BD83F58; Fri, 24 Aug 2018 22:12:30 +0200 (CEST) Date: Fri, 24 Aug 2018 22:12:27 +0200 From: Pavel Machek To: Jacek Anaszewski Cc: Baolin Wang , rteysseyre@gmail.com, bjorn.andersson@linaro.org, broonie@kernel.org, linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v5 1/2] leds: core: Introduce LED pattern trigger Message-ID: <20180824201227.GB17146@amd> References: <1dc5d394324b2bf1ffe229b8e42691fab6d749e0.1533556992.git.baolin.wang@linaro.org> <20180824101145.GA1510@amd> <9bb7ac19-36a6-d11a-6d46-fc65c2026201@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="p2kqVDKq5asng8Dg" Content-Disposition: inline In-Reply-To: <9bb7ac19-36a6-d11a-6d46-fc65c2026201@gmail.com> 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 --p2kqVDKq5asng8Dg Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri 2018-08-24 21:49:50, Jacek Anaszewski wrote: > Hi Pavel, >=20 > On 08/24/2018 12:11 PM, Pavel Machek wrote: > > Hi! > >=20 > >> I think that it would be more flexible if software pattern fallback > >> was applied in case of pattern_set failure. Otherwise, it would > >> lead to the situation where LED class devices that support hardware > >> blinking couldn't be applied the same set of patterns as LED class > >> devices that don't implement pattern_set. The latter will always have = to > >> resort to using software pattern engine which will accept far greater > >> amount of pattern combinations. > >> > >> In this case we need to discuss on what basis the decision will be > >> made on whether hardware or software engine will be used. > >> > >> Possible options coming to mind: > >> - an interface will be provided to determine max difference between > >> the settings supported by the hardware and the settings requested by > >> the user, that will result in aligning user's setting to the hardware > >> capabilities > >> - the above alignment rate will be predefined instead > >> - hardware engine will be used only if user requests supported settings > >> on the whole span of the requested pattern > >> - in each of the above cases it would be worth to think of the > >> interface to show the scope of the settings supported by hardware > >=20 > > I'd recommend keeping it simple. We use hardware engine if driver > > author thinks pattern is "close enough". >=20 > The thing is that in the ledtrig-pattern v5 implementation there > is no option of using software fallback if pattern_set op > is initialized: >=20 > + if (led_cdev->pattern_set) { > + return led_cdev->pattern_set(led_cdev, data->patterns, > + data->npatterns, data->repeat); > + } Yeah, that sounds wrong. (Sorry I did not pay enough attention). It pattern_set() returns special error code, it should just continue and use software pattern fallback. Pavel --=20 (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blo= g.html --p2kqVDKq5asng8Dg Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAluAZqsACgkQMOfwapXb+vL6qACfUF2J7US+MKxUh5rbg3o0Pz2L w8EAnjdHFhPzPYHAXmpCrKfW4jdnOlLp =XQ6Y -----END PGP SIGNATURE----- --p2kqVDKq5asng8Dg--