Received: by 10.192.165.148 with SMTP id m20csp288325imm; Wed, 9 May 2018 12:43:51 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpK2HfXQ3ktkWdskLpTSS8du+onawA21i7w6SoBuI2vlbjso4woB3ePyGVvB314r9tUZfXf X-Received: by 2002:a63:6016:: with SMTP id u22-v6mr5636513pgb.284.1525895031783; Wed, 09 May 2018 12:43:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525895031; cv=none; d=google.com; s=arc-20160816; b=Qp8TMjuP2Qajb3oGyLkMA1YD/80/nMPYEtHGgt8HLgNW8O8AYymrFSJ8YKFkPPOi29 HcJbV5HmEFI9zWN9KFIYA0pLG8bNeL1NRVSlX+TDHzDCZu9oVEADmoCNcPu71brfCFw2 2w7IsgWjDX1ltA2oVhBdylejFV0MEdlSZGrIky2th6kmAKJrOoDt+P1SaheUGX6ic1By UQ/HkPyu2py04jxnowIIULcYMVHmzzSkGy/cDLkxScukVWssAr/NBGkzPntFVMI/z4dh ENb10TVl11DMP2r3tGABwpNiF+gl5S838ISx/XVu+TAA5u4dcbE0epCMctvfbi0FqeXO 04+Q== 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=QFugtQWzJbdfL+WX8e/UgTDJvknRkwkviPPq4uXRRWw=; b=X+iTQH9JkI+Cb5DoU1AnGbPWzaey3tBTViERCmo/vdtLhqlDO7j5fQ9TMrl4Bx8sTH Vpg+IfqlZEM7Lb3TFMvQcaW8nDyAUv4dpJbcQz0foBEIwK0b3lI0QsAMI1FUzkW4bgBa C//xIR5vn87LKCt5HoQcTlWPr87RQaRCrhhUMhLwvLH+XNWRHU9wuPw3waDgipe1Maz4 E+FOxs6aUrUegOpW/+9Dd+L9kS39okFyVfWb86NWA7Z4UmFzWVLhUOVuMbFeHRb5hGAK WV2rKbquXR9BdIQbC09GJVvZxBaoIsaVLFo+uGWlefGD1pSNblONlObiK5312hFsYRLv QB2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Go56KUSx; 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 h14si27171108pfj.178.2018.05.09.12.43.37; Wed, 09 May 2018 12:43: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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Go56KUSx; 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 S965615AbeEITmA (ORCPT + 99 others); Wed, 9 May 2018 15:42:00 -0400 Received: from mail-wr0-f196.google.com ([209.85.128.196]:35640 "EHLO mail-wr0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964850AbeEITl6 (ORCPT ); Wed, 9 May 2018 15:41:58 -0400 Received: by mail-wr0-f196.google.com with SMTP id i14-v6so33483604wre.2; Wed, 09 May 2018 12:41:57 -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=QFugtQWzJbdfL+WX8e/UgTDJvknRkwkviPPq4uXRRWw=; b=Go56KUSx260eLWzSY3EROpQeXmRxlgfdGcmKBzJPu9ZEDTmYo80F6JDq8SuPv0xFbc yw2XvejN4or9mKC3Zp7upE6oN0DOWxqZEZqvcln8G5snVJIbPQLm8rCZcv+yDqGm1ftI IzaRhSILblEtrC/2bSyzwGUcpC+0imIv0VP67tRkax45/5Rq7E+xMVrIpeEvlzL2id1P LBg89YxFD0v2WzWqeaKhxYwefU1dRtP2R/SGlFzHomGHuV1yLNbSJRt7VT7i1goyvUOq er20aFW/W2QjXxOXFRcKD4m5wNomXqfnMquAnVLvt6Ixr0EbIcVGEc+RkA1MP3uzrB+y X1lw== 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=QFugtQWzJbdfL+WX8e/UgTDJvknRkwkviPPq4uXRRWw=; b=b86EbqbxeE2QUm9a0UinMzWx6MNBwJ19UhGowo1gyJgmTqt0qNQR+Ayotnot1pClJd 136W7ZhRwgk+MU75kLV9A1lPEXZV1A+KoYB6EnPG5TDKA2W4xLn/biKilzGkmkENhip8 KWeCY3i+rgJTRkkgQPJrkvoq246cMsLpS91+bRgvGyTSWde2Y2WoN9qniaeI8ZnQZFzo vLgBaKSORICK4VujxJghyAkh32q4E9noos6NwM+Gd1dfViqFxzFfsXBARXmNe5AbuPml W3kcmx8nW9L4kfO13HopwqSu2F4eIM/z+v/eIpFF+ZffL6rbvMqeTPxZU45UcfpIkUy4 SohA== X-Gm-Message-State: ALKqPwfCGV2WkYGYhqdWpgpJGE7pOX7WU2iYL9qKspSiSgrT3X/YDiuq vgKjL1805yA5KDYgyNYQkr8j4c9W X-Received: by 2002:adf:9b98:: with SMTP id d24-v6mr6492202wrc.240.1525894916548; Wed, 09 May 2018 12:41:56 -0700 (PDT) Received: from [192.168.1.18] (bla89.neoplus.adsl.tpnet.pl. [83.28.194.89]) by smtp.gmail.com with ESMTPSA id a13-v6sm26257528wrc.19.2018.05.09.12.41.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 09 May 2018 12:41:55 -0700 (PDT) Subject: Re: [PATCH v2 2/2] leds: Add Spreadtrum SC27xx breathing light controller driver To: Pavel Machek , Baolin Wang Cc: 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 References: <9a2a07b8eb313ae3ba64af911337ee7ff7c9ad43.1525757122.git.baolin.wang@linaro.org> <20180509142539.GB25131@amd> From: Jacek Anaszewski Message-ID: Date: Wed, 9 May 2018 21:40:35 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <20180509142539.GB25131@amd> Content-Type: text/plain; charset=windows-1252; format=flowed 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, On 05/09/2018 04:25 PM, Pavel Machek wrote: > On Tue 2018-05-08 13:39:45, Baolin Wang wrote: >> From: Xiaotong Lu >> >> This patch adds Spreadtrum SC27xx PMIC series breathing light controller >> driver, which can support 3 LEDs. Each LED can work at normal PWM mode >> and breathing mode. >> >> diff --git a/Documentation/ABI/testing/sysfs-class-led-driver-sc27xx b/Documentation/ABI/testing/sysfs-class-led-driver-sc27xx >> new file mode 100644 >> index 0000000..22166fb >> --- /dev/null >> +++ b/Documentation/ABI/testing/sysfs-class-led-driver-sc27xx >> @@ -0,0 +1,19 @@ >> +What: /sys/class/leds//rise_time >> +What: /sys/class/leds//high_time >> +What: /sys/class/leds//fall_time >> +What: /sys/class/leds//low_time >> +Date: May 2018 >> +KernelVersion: 4.18 >> +Contact: Xiaotong Lu >> +Description: >> + Set the pattern generator rise, high, fall and low >> + times (0..63). It's unit is 0.125s, it should be > 0. >> + >> + 1 - 125 ms >> + 2 - 250 ms >> + 3 - 375 ms >> + ... >> + ... >> + ... >> + 62 - 7.75 s >> + 63 - 7.875 s > > How does this interact with triggers? With manually setting > brightness? Are the pattern generators independend for the LEDs? > > Can you generate white breathing pattern? If so, how? > > How do you select between normal and breathing modes? > > I'd specify times in miliseconds or something, this is way too > hardware specific. Agreed. > Now... functionality like this is common between many LED > controllers. N900 could do this kind of "breathing", too, and it also > supports other patterns. > > I believe we need interface common between different LED controllers. > > And I guess it would be easiest if you dropped this part from initial > merge. 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. Regarding interaction with triggers - we could disable pattern on setting any trigger and return -EBUSY from the pattern interface if led_cdev->trigger is not NULL. [0] https://lkml.org/lkml/2017/3/23/33 [1] https://lkml.org/lkml/2017/11/15/27 -- Best regards, Jacek Anaszewski