Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp3222333imm; Fri, 24 Aug 2018 12:51:19 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYitC/gvMUUdWdC3I5qIFh72566aCkDIvO2YWwVmnBHZ+PvvtyYnslXwaVBVHog4r68Hhlg X-Received: by 2002:a62:63c2:: with SMTP id x185-v6mr3321372pfb.13.1535140279122; Fri, 24 Aug 2018 12:51:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535140279; cv=none; d=google.com; s=arc-20160816; b=VthZgVDue45VyXhcu51Gn8qEr89xPtwWHq2JlXt1bHwqEwyLQbSgBISD7/E4Rn5Cap ceAszULNju7ifxFgqNs+SFeN9t+nY5A5FwWyUF9gZUAdudXX+xZuUHAOOIJK3UeTURqD jBRZFQ8Fpw596uh8wSRBvANA8Q1QVZNcEG5jM5FET0ORNuIgKe0I5rtaIHtxtY8Ck9IT /f0KNtdMSswl1XswbcfMbZt7Aj6gMHEHwsH5Sx9VLXqInFOUuCuFOmKMae6MzvK43bmh 2E9b43/BXzguhdRklW0icG3eS8hNZWLNIHOmFkbfLZM6MH6RNCnh6mK1n8ub1MCnhPIV yIqQ== 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 :arc-authentication-results; bh=Ru+wvZiJTsANwUteOAlyY/jldnlAmHkLO3D/zxuRlUU=; b=vKnNilOewVWrvp2wf0qtblY5koPAYoCbkzffOiYwqpqiNA3ynOnIWfhH+ab6rLyDHg KAntImi5M1w4CHWjRu0RR51YEL9x9d0CccLiP5Xe8UQfRc83fLnI/XTsPFPjojK6Xijk 3OrZ25w9TTVcc41LJ4Uqe2lzds42E+X9tv7vJX3DwlsmihuKvhNVBSccd5Kk+k02Yyuv 3rXwAHjTTaLHM/n3WtzZba9fdxRtuPD5eyj8n5397znpBoYku6ORlTneREgHxI3y3Bj2 hVXMQXMmmvp4+jKIoOg4ZlGrZThODIaTlBcRT5Em5eVnubVCvNdghzMglzL4NqEgR29g jNBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=TU1v9YEZ; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p126-v6si8153916pfb.77.2018.08.24.12.51.03; Fri, 24 Aug 2018 12:51:19 -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=@gmail.com header.s=20161025 header.b=TU1v9YEZ; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727342AbeHXXZ4 (ORCPT + 99 others); Fri, 24 Aug 2018 19:25:56 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:39780 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726277AbeHXXZ4 (ORCPT ); Fri, 24 Aug 2018 19:25:56 -0400 Received: by mail-wr1-f66.google.com with SMTP id o37-v6so8363442wrf.6; Fri, 24 Aug 2018 12:49:54 -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=Ru+wvZiJTsANwUteOAlyY/jldnlAmHkLO3D/zxuRlUU=; b=TU1v9YEZoa+124yfF1GOjssmFET4kzIIk9QI6sqvcW/KUOTZ8BCy/ag0CeODz7axVa S4oJVJplSDE1rWGlmBy4xtN90l/ftsDva6nvVB8/YDpR0U1Www0QTURtZ91A2xi4LLaq oHGiMbI8ojPteFeDIT0iGQ2b+mFgWKM6Ao33/BSd5GV+0xj3IjsZndxpy9vRDubUlvgL 5s3U7094rfW16e/sK44hWIyRckCYEQDtUNIHcHDstldDoC5lJ+IdUla9atXGFUPsGgpu WkFeQoQ0lDcVrtfd0EAn66CSWjydndQw3PJ/ei3oJN7xmeObdOmgU1n8ka7tNBsNDz+X wc2Q== 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=Ru+wvZiJTsANwUteOAlyY/jldnlAmHkLO3D/zxuRlUU=; b=Cyr4xiehoZXTxV94kpV7cw4LaGq4UnWps9cweeSRcKefjUUtukLtlBUtKP4mFMEYeR e+1U3tCo44DHfo/3y+XRQvyTcreSjTZWRyRbhCoaXIedVSlNiFDx4+177pOUJN06KocI upw+KUCy1YuDFwTOefsLuyzKRxgOH+1NChTSjMb1hFV/q1I3fQOEjtK27bmhW9jrSnP6 3xxYhp8MlVqasAmM6uvSV2KKUSiW7xIQrZ8Id7UuGStdHYxnX923YLrgTlDgAq0rkU7Q k/p5Lj/gMhssRCyBeu9xGH4aWg3I5rHMZ2+naeosC/A78ietkJKrOCqpSTo63r1uIGOO NKPA== X-Gm-Message-State: APzg51Dj6PtmOC6Iy8ZtWZbJSJtU6KsHILp5yRNGsiMjr/VZHyehiUD+ 2gryoTJsrQA06xLhhoHrApdHhplr X-Received: by 2002:adf:8485:: with SMTP id 5-v6mr2134120wrg.34.1535140193125; Fri, 24 Aug 2018 12:49:53 -0700 (PDT) Received: from [192.168.1.18] (bga163.neoplus.adsl.tpnet.pl. [83.28.64.163]) by smtp.gmail.com with ESMTPSA id y206-v6sm4000800wmg.14.2018.08.24.12.49.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 24 Aug 2018 12:49:52 -0700 (PDT) Subject: Re: [PATCH v5 1/2] leds: core: Introduce LED pattern trigger To: Pavel Machek Cc: Baolin Wang , rteysseyre@gmail.com, bjorn.andersson@linaro.org, broonie@kernel.org, linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org References: <1dc5d394324b2bf1ffe229b8e42691fab6d749e0.1533556992.git.baolin.wang@linaro.org> <20180824101145.GA1510@amd> From: Jacek Anaszewski Message-ID: <9bb7ac19-36a6-d11a-6d46-fc65c2026201@gmail.com> Date: Fri, 24 Aug 2018 21:49:50 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20180824101145.GA1510@amd> Content-Type: text/plain; charset=windows-1252 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 08/24/2018 12:11 PM, Pavel Machek wrote: > Hi! > >> 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 > > I'd recommend keeping it simple. We use hardware engine if driver > author thinks pattern is "close enough". The thing is that in the ledtrig-pattern v5 implementation there is no option of using software fallback if pattern_set op is initialized: + if (led_cdev->pattern_set) { + return led_cdev->pattern_set(led_cdev, data->patterns, + data->npatterns, data->repeat); + } > If human can not tell the difference, it probably is. > > We may want to do something more formal later. -- Best regards, Jacek Anaszewski