Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp3266710imm; Fri, 24 Aug 2018 13:46:12 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZGfPui923DXVeT8BHkeKQWbbulGq0cQ+VgNwBHenF3weKxaUvEay0P9CpRdx1VB5WjpvVu X-Received: by 2002:a65:6292:: with SMTP id f18-v6mr3050549pgv.85.1535143572742; Fri, 24 Aug 2018 13:46:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535143572; cv=none; d=google.com; s=arc-20160816; b=avmnO2gC4QzKcDkr16iNRNtn3KZNd23+r/dBFY7Lik81npp6o3UDGjMaVFTQVxZUOF xSSQz0CjKWkj+Nx8GLGFfuy/yKYSNNUHevexprRl2QYARNWGQdqezU0YNIjv4Zkes2pQ qImjRVNFBeIyrYiv3HVsinfoa5Chb2JEzg5MU97siydK9+y7tN25BHJHUzb1E+D59x/R gn7tRDL/fpfmS1J+tu4f1jnBtKDGOxoXtVzzhqhB/HVvXc4QiK2QJNrCzqYsW36KeaOz 2gutpsc7CRCnxCzmG4/NPLz1qjJY5A3HipkLJY5er6togsQORoI4xTANlThneCg3KtEP GTVw== 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=w6kD8DXFWMl1r9hG+XJeBOQ3lrb2s90OElvycUTMOB4=; b=IBSrZyLW+tdfonH98WtQjMTiYDhK+D5HkI+tnmU36dH8CfINbxrX7W9/HcKB6dHK8T B9P/P8nrBLwP1RP0ixnodTB/GQObnMLHt0iCVpdx+ypzRxBnVxpeBiG30a39VKqMvoJR d7OlYz+KoieTZFhOvujOxqGQGG+kvjqVEKV3H658pMeRmGYQCvqmQIrqx8FQWXpUN6E1 FJjK4VAYIo1iY2kbvwD0HYi4iRn800hyyBjbM75qR1dIlgZZ31rmJG+ckHuTI16b67EI dVa+mk0WBnKrQt5Wct870ZCCv9mr4JV67RV/zoZJGgPrETOT8YseLlDwpvfltUtZ3SZQ +R7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=gV3IBgAQ; 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 x16-v6si7443310pgf.311.2018.08.24.13.45.57; Fri, 24 Aug 2018 13:46:12 -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=gV3IBgAQ; 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 S1727342AbeHYAVG (ORCPT + 99 others); Fri, 24 Aug 2018 20:21:06 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:55504 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726855AbeHYAVG (ORCPT ); Fri, 24 Aug 2018 20:21:06 -0400 Received: by mail-wm0-f65.google.com with SMTP id f21-v6so2687235wmc.5; Fri, 24 Aug 2018 13:44:50 -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=w6kD8DXFWMl1r9hG+XJeBOQ3lrb2s90OElvycUTMOB4=; b=gV3IBgAQe4YEQ3U6AUGbciEkCx/HYUBoG2iGmoJlvBg6tKQ+ZTMzxL1mDfxsnRcvLD Gh9rJr0r2VvDnnoJmktTTsUc03+1dOsCM1PHjduWwfG1CHOG48AX2WruQH2M/om2TGRr DOFkyp6rHLGpsC9EdSHPHvd738T1mI/kPKy31kOxTiZMoi6G/1vm+tSJlwkaV4ByFGvy 79gIc3ViGUu5YGOntZSnansB8MlRTG7cgtvVt29Z5vS2EBXiyTw3bYBUULvdK8h6fHyP 0YWQ42Ynt4hKSVBCFD+glkAGBle36ZwvKGfO7N8AZthLy9g6fFI9AHkve3G7h2gQ0VP8 Eynw== 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=w6kD8DXFWMl1r9hG+XJeBOQ3lrb2s90OElvycUTMOB4=; b=FA/BNDI9uBK7CGZRqJHfxDEbFqh9dii+Hx+Nj5uGbNPQAPcIOUnN5kc1GRoHG0yHH/ ROYnApZIKM8fIWNcTYuMx/VIZroGNnnAFnwDaoIZYbAiT+5VX8ubghlDJRonvQHtwJxw sx9dZnGu9fEAFjcPxwc8aat36lMS4P2wkY9lw5auO2axDIq33qkM8hsmYcZYSXxlE8Od /nKoCHY69shie2Ujd5n0GoJXGlWDIPdY3V1PPmocz7s4vJ7m0G5SiQd/0KO2PrRcEBza w4NWyqdieZDd7sllxtrCq/9Tf4qv0ExG1YeAObl+oOnLmp5Vwo/6h3bCv1YiExW/ujAP KdEw== X-Gm-Message-State: APzg51DUHJN0haSl3kfFBVx31uGDiKCT4oLzEahWXflp4TCS5toGy822 8b/YsrOsv0EtjJCVaoCHLuzRUElr X-Received: by 2002:a1c:ac1:: with SMTP id 184-v6mr2275690wmk.119.1535143489801; Fri, 24 Aug 2018 13:44:49 -0700 (PDT) Received: from [192.168.1.18] (bga163.neoplus.adsl.tpnet.pl. [83.28.64.163]) by smtp.gmail.com with ESMTPSA id q5-v6sm3820827wru.79.2018.08.24.13.44.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 24 Aug 2018 13:44:48 -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> <9bb7ac19-36a6-d11a-6d46-fc65c2026201@gmail.com> <20180824201227.GB17146@amd> From: Jacek Anaszewski Message-ID: Date: Fri, 24 Aug 2018 22:44:47 +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: <20180824201227.GB17146@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 On 08/24/2018 10:12 PM, Pavel Machek wrote: > On Fri 2018-08-24 21:49:50, Jacek Anaszewski wrote: >> 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); >> + } > > 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. And now we can get back to the issue I was concerned about in the email you replied to, i.e. what series of [brightness delta_t] tuples should be written to the pattern file to enable hardware breathing engine. -- Best regards, Jacek Anaszewski