Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp2730408imm; Sat, 12 May 2018 19:20:20 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqXIVpjGbL1JOfL2E/p7F4Ua4LBPPG3yC91Lj0qtxRzptI+iV7Pbv4OPdRb4f6VurkHTXUo X-Received: by 2002:a62:568f:: with SMTP id h15-v6mr4954806pfj.131.1526178020132; Sat, 12 May 2018 19:20:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526178020; cv=none; d=google.com; s=arc-20160816; b=mrRyH6gJb+seqWMhPjI385OrHxcsNpbQKPM/B/s6VLNRr7Xw6hU1W7Ba6YXSiPzo7W VD4yLYpXqzdtmspqcFaeDjqZv856Gr6FX8Y2jB1hIQi4UDtnv3x1mdnpCpdItuopPV78 aKQbI8tflws2lHxCHAzZ1LO7Gmfbq8z6ZKcWS62EKQgFFlIepddVZCKO7k/wQ/RRMrr3 3tbqCNWtG5pfRkLiHoxlx+gAsCMnOg7qq+jANcQqhNdbSLeUhOeNO1NhaJyJbEEMkU+G FGRYiNRvpmMGh4y3TsvYlDEhsMIt0kqvKkl/e3s9amIvHY9XSxWue4SMhTtvWn4RCcjG dVJg== 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=AmBxYQr0uG1xtdAL9LYTTeNS59Rt91ax5GvXr6u5Otg=; b=vkRVYK7yikh+/IO86kQIUbzz1kwhO9JRF9XZ+eoFLh4StNH2+tHemxr77380S7eRFR QsZcelfdytl6f0Wbg7a84uXqKDSstanHnS4op2NQrb+HBToLZ35F9GYTrR8KyLL4C2fZ rYfcdfgveb9nzj3BBTy9ZrRfdRg92qWjd5If2e8kuqVGSJEPrht8qgC4Tw98e1bSg6IW 0fvvN30zvruEey/ilX3y1Js3YPzHRA403izWDOgVjS8+9DNgyfrlx7wctiA3l+1dEffS Ad+WOG43F00KVNJLMAapurmhIRRz6hRMhTdmCcHFgF2c6UtblGYkdNJfTV6sd+Y984q9 W76A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VYk095xE; 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 y10-v6si5287001pgs.583.2018.05.12.19.19.51; Sat, 12 May 2018 19:20:20 -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=VYk095xE; 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 S1751890AbeEMCTk (ORCPT + 99 others); Sat, 12 May 2018 22:19:40 -0400 Received: from mail-ot0-f172.google.com ([74.125.82.172]:42088 "EHLO mail-ot0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751634AbeEMCTi (ORCPT ); Sat, 12 May 2018 22:19:38 -0400 Received: by mail-ot0-f172.google.com with SMTP id l13-v6so10570325otk.9 for ; Sat, 12 May 2018 19:19:38 -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=AmBxYQr0uG1xtdAL9LYTTeNS59Rt91ax5GvXr6u5Otg=; b=VYk095xEw3GogMiB2nzDoubpbBn8z1FLjPD9TBEHga53zGGIBxTok3XTP6RyX7Us3c 2jzIe9EzlabAcVKo2gVHPlodZqHVSjiwlzUv9v75l5cdolSa5OlKe6A5XjkrqT0xDWT1 UjnCDYLZF/+UMxn0Ewt8aZobNoFhbVGeniwUw= 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=AmBxYQr0uG1xtdAL9LYTTeNS59Rt91ax5GvXr6u5Otg=; b=e+Q7oepkPIjp/CBmAekSABy64l+14SMtZ/dUpvPVdztboT8Paa4q0mRDGaCOz2RK/P 3NkagePkPEMWyLzPCZMVIdn4g0OY2sdyJ22agHayvTvNap4idfODBn841fz34OM/YH1W jTUKm1IMKBLb0PaS942Q0ujaIJHBCYHlgOHryGFk/aazXPgf1KAA1EmV7Sk/b6waQYh6 RSzaqC/CJ21KeGEPIyoUaSj1mZzxtZlhvVfwfxGWAvUKaI5jOm6grxyC9QtEVVxkTDPm IraWezcyMSrGtQQ/g7heLLLDM+B/pZpJKFd0vngXKG+NgLUsjoVjBeEckQJseWEnjIog c+Ew== X-Gm-Message-State: ALKqPwfhTxZSKvqObq0elkLvbgS1fJhnAawRdPJGRQArPKTWs7qdKOeF wnO/aTomgTggr1X617dQonHB5MJWy1DVHL6J8cNRKQ== X-Received: by 2002:a9d:5508:: with SMTP id l8-v6mr2962133oth.159.1526177977910; Sat, 12 May 2018 19:19:37 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a9d:2d77:0:0:0:0:0 with HTTP; Sat, 12 May 2018 19:19:37 -0700 (PDT) In-Reply-To: <7c9d5eec-4e6b-9b26-470c-f8002cca5f27@gmail.com> References: <9a2a07b8eb313ae3ba64af911337ee7ff7c9ad43.1525757122.git.baolin.wang@linaro.org> <20180509142539.GB25131@amd> <20180510113749.GG6977@amd> <6289571e-7224-ca5e-1acf-5b099be57302@gmail.com> <20180512083559.GB8944@amd> <7c9d5eec-4e6b-9b26-470c-f8002cca5f27@gmail.com> From: Baolin Wang Date: Sun, 13 May 2018 10:19:37 +0800 Message-ID: Subject: Re: [PATCH v2 2/2] leds: Add Spreadtrum SC27xx breathing light controller driver To: Jacek Anaszewski Cc: Pavel Machek , Rob Herring , Mark Rutland , xiaotong.lu@spreadtrum.com, Mark Brown , linux-leds@vger.kernel.org, DTML , 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 Jacek and Pavel, On 13 May 2018 at 04:44, Jacek Anaszewski wrote: > Hi Pavel, > > > On 05/12/2018 10:35 AM, Pavel Machek wrote: >> >> Hi! >> >>>>> I disagree here. We already had the same discussion at the occasion >>>>> of the patch [0] and it turned out to be a dead-end [1]. Now we have >>>>> neither the driver nor the generic pattern interface. >>>>> >>>>> We also already have some older LED class drivers that implement custom >>>>> pattern interfaces (e.g. drivers/leds/leds-lm3533.c) and the same >>>>> approach can be applied in this case. >>>> >>>> >>>> Please don't. It was mistake to implement custom pattern interfaces >>>> back then, it is still mistake now. >>> >>> >>> It turned out to be really hard to cover all known pattern generator >>> implementations with generic interface. Sure, it would be nice to have >>> one, but the whole discussion around [0] only unveiled the diversity of >>> parameters to cover. And still new devices appear on the market. >>> >>> We would have to propose a set of pattern schemes and allow to >>> add new ones to it. >> >> >> I believe that what I'm proposing below is close enough to universal. >> >>>> If we really need solution now, I'd recommend "pattern" file with >>>> >>>> " ". >>>> >>>> In this specific case, hardware only supports patterns in this format: >>>> >>>> low_time 0 rise_time 255 high_time 255 fall_time 0 >>>> >>>> so driver would simply -EINVAL on anything else. >>> >>> >>> I'm fine with the pattern file, but the pattern format would have >>> to be defined in the per-driver ABI documentation. It wouldn't much >>> differ from the custom pattern approach though, unless I'm missing some >>> gain of having pattern setting in a uniformly named single sysfs file >>> (with semantics differing from driver to driver). >> >> >> I'm proposing " ..." sysfs file. It certainly >> covers this hardware, it would be enough to cover the Qualcomm Pulse >> generator (IIRC), and it would cover most uses cases of Nokia N900's >> LED. >> >> Yes, we would need to document limitations of each chip. But it should >> be easily possible to run pattern designed for Spreadtrum on N900, >> even if it would not work the other way around. >> >> (If someone really wants to run complex patterns on simple hardware, >> we can provide software emulation using same file format. I believe I >> still have that patch somewhere.) > > > OK, I've revised the discussion under Qualcomm LPG patch set and > it seems that we have almost ready solution in [0], except the > pattern_repeat file you mention in [1]. So probably Baolin could > address your remarks from [1] and add pattern_repeat file to the > patch that begins thread [0]. > > [0] https://lkml.org/lkml/2017/11/15/27 > [1] https://lkml.org/lkml/2017/12/8/470 Thanks for your suggestion. So I will remove the sysfs part from the new driver, then send incremental patches when introducing some common LED interfaces. -- Baolin.wang Best Regards