Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp2525397imm; Sat, 12 May 2018 13:46:33 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrR8157T37hE2D7UtHlSFER7m6lJh/7s5brVGPgZ6RFSE9yujdA0i+u3cV2P6OpDgWlOfHJ X-Received: by 2002:a17:902:3a5:: with SMTP id d34-v6mr3764125pld.103.1526157993177; Sat, 12 May 2018 13:46:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526157993; cv=none; d=google.com; s=arc-20160816; b=CdwbpVEO6i26Ex8LZ8zH1wZhVl7Ox2gkFVHW2lK6MmYntGrgWyA5g52ULLkDmgA0OA 4yAiscx/x04vDxzcIkYuEH7yi2zYDisJtGRrSz5czk4kiSeMkD+hCAtnkODyiGbABskH SezF2+ObxEpNJx/Au+rn8p370B4WFJgPR+spW1dbwxPoUZ3AxEwr6pNSshtODQR/YM6k l9aErf9GgDaH5n4uLXdjgKwvNnaO6l3gaAiFlkSq9w5cKEST0n1IRKN5jeWloNE2a42r 4KhltUelF0s3+VOKyvpem5L0FzqbZB3VaZTI8C2ysveAWuYzVru1HP8eTnMCd/dmSS+1 C6zw== 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:in-reply-to :mime-version:user-agent:date:message-id:from:cc:references:to :subject:dkim-signature:arc-authentication-results; bh=ehfRW5gXsmTh9ubh61WlP/3yf+qVAvzLu4CZuaPcSz8=; b=WcchLnR0PghAxVJdP+bPT7lVYiy9Qpw4/0hFMcjYNzz6GD/b9RRhlbelMtNab+tG9l 3wTH7g3yBX0Ql2E1kKmKNRs5FFZKfWZMjzsz+z2uLQsMFDM9stkXLE+sZ84/8D/yd/4L mnTNpx2Aj1Oi5zgZa8pKN+AJcvrd8KdJsAY2o5hfzqrZEDEo4TeLcgyJDLlIIgmji21h bq4Tv/vK6R+mW9YD8/WeoULrK78atD3zzqVU2eBU7Opmrd9DD/VeLNjAOpSA1NiAy7hi HBSMKz8GtjSzUhmjwRWxrC8FXQ4BIzZymULzMBrVz3UPlh05n1GVM4bcJA1UC8EdC7m0 xdBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ORF1gHeD; 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 n11-v6si5085934pgt.679.2018.05.12.13.46.05; Sat, 12 May 2018 13:46:33 -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=ORF1gHeD; 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 S1751879AbeELUp4 (ORCPT + 99 others); Sat, 12 May 2018 16:45:56 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:37169 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751270AbeELUpx (ORCPT ); Sat, 12 May 2018 16:45:53 -0400 Received: by mail-wm0-f67.google.com with SMTP id l1-v6so8717004wmb.2; Sat, 12 May 2018 13:45:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=ehfRW5gXsmTh9ubh61WlP/3yf+qVAvzLu4CZuaPcSz8=; b=ORF1gHeDbyAlXKOEteCvRr6CVYTC6i/1mXYyNZik0muRNVKG+93UGHkf+NwFfRAcQ1 ANW82whSOFaWP+SAiKmWSY9gpMOd3uAbzBTMfvL4arr1Wivmg+P0V4egZdMMkzhhq7kB RvzngXB63MxjRXWmyZkcCVhi7Vr4alVPQ59Ov2g1gBNmGvoKRWIH1Na5tf48o4CCirJB wmhVrFM+ArHEw76piRLO/yWhAXS9310uFaNF01K9Z+UkpWxapM+O/mxz/akrVoXxX7GN ED4Lja7wQb8LMaifqaQOjf3CYUErf3YWE/bH3+53FQkju1ga2d3nNBa1oUdmOt+Pf8dw UmPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=ehfRW5gXsmTh9ubh61WlP/3yf+qVAvzLu4CZuaPcSz8=; b=X7Fuk/Ng8bJ2le718HJD3iSchAW+FiQz+3yPnaKtW0vqqSErFZJYWBG5tsdZvsg+Nc o0aEm+YDaT8pgfg93/v3jSbqFzLsYv0wDg5zP7OTC/LzJFQBKhUdGsuFGHNay/X09UUJ zVrODqB5RHqW3gDiFQwU3q33Rs2bMlDtf0WP9a2ie4MyivwFvPziUOmYfLMoSHLEvRGt YsIwg2n+mNV5pGOtD3mGlhtNGu6ybWafUhgqfzpYOctPCDOPxdQHgGa133M9S8YX+3RM dGYceN0U4cPCJSAfdfYIEPUyO025986CVJnwkIdOui0W4s1o/KX9n9kz6j+f64gRDgtZ f17g== X-Gm-Message-State: ALKqPwdUo/SusCG2Gbze6PrYGZhKMtm466fF84GeCEMW84mcrt9hFMEA uw0cgkFaOpWxxwzVgUcWolVTuzty X-Received: by 2002:a1c:1f13:: with SMTP id f19-v6mr1647570wmf.73.1526157952055; Sat, 12 May 2018 13:45:52 -0700 (PDT) Received: from [192.168.1.18] (cjl3.neoplus.adsl.tpnet.pl. [83.31.61.3]) by smtp.gmail.com with ESMTPSA id a129-v6sm4036028wme.34.2018.05.12.13.45.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 12 May 2018 13:45:51 -0700 (PDT) Subject: Re: [PATCH v2 2/2] leds: Add Spreadtrum SC27xx breathing light controller driver To: Pavel Machek References: <9a2a07b8eb313ae3ba64af911337ee7ff7c9ad43.1525757122.git.baolin.wang@linaro.org> <20180509142539.GB25131@amd> <20180510113749.GG6977@amd> <6289571e-7224-ca5e-1acf-5b099be57302@gmail.com> <20180512083559.GB8944@amd> Cc: Baolin Wang , robh+dt@kernel.org, mark.rutland@arm.com, xiaotong.lu@spreadtrum.com, broonie@kernel.org, linux-leds@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org From: Jacek Anaszewski Message-ID: <7c9d5eec-4e6b-9b26-470c-f8002cca5f27@gmail.com> Date: Sat, 12 May 2018 22:44:14 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <20180512083559.GB8944@amd> Content-Type: text/plain; charset=windows-1252; format=flowed 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 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 -- Best regards, Jacek Anaszewski