Received: by 10.192.165.148 with SMTP id m20csp628527imm; Wed, 9 May 2018 20:13:19 -0700 (PDT) X-Google-Smtp-Source: AB8JxZo2VLvCu8ZpDuRwhvcjPDoiNkODitf0eGLa4KEHYbWuqq2rldx8LaOgrIWA3s9rmq+ossaK X-Received: by 10.98.127.145 with SMTP id a139mr46175359pfd.25.1525921999314; Wed, 09 May 2018 20:13:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525921999; cv=none; d=google.com; s=arc-20160816; b=fXsmcHk33JpPdRGCDdw3EZENVpvqaeoiSluWlnDPeYwAYaSukQviXOQ83cX5aR6y24 9LuLStopcUV9EWNDO8VcU804GpYf/yGCQt+xH1fs7iS9bQ7uqJmd40A9kPPSd7MbF1F5 RciVCaSNHpnYQ0oEyaN9EU5efxsQOR1XVFv4iNqlwJ8/EdO2B7hSotn+ukRuBW4sfsJH Zr5bzR9EmrGRwJI5BBopTuNdc6K+1XTh/WF/dmhwmQ3Q+vsMdKloPBVplTEbG/uKD6Fk 9a6SSxnlAw7Ci2K1UEHPJqF9g9OlMkxDbXZ+E+laIT4kkotdgHDmU5o6rDhebyk4I9nf lJHQ== 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=6zCTO1Mr3DZDrSMdC+qrwK2N93psxdxnn/xh3SDw3Ck=; b=BRMm4QxPjs/WkYXgIvV8e615ahKzHVN9iY6FggvMFNSMKUP5GXEAvZh5XsE4YAH6Yj 1BTcQbqTf7VcEhwaItbtXLxgwxT3Wmno6JAcLBmkKo9h8XbMWQ9YIMgwA9YuXOzD+nc4 kVKIu/Rm0M1ImfVWwFkYMVSSAUcUa8g4Yzk1JPd4HsNe0v/k2q2ADqYCByXjd04kDhXE 6GT1QnsfJp0xjmTJTSSnqOBoWDIKKByw6su9ARUDMWRZBmZE6uUUcXQOogLQb71THcoA fG+MVsk6vf/Z1rH9z25tWjzCTYbFARyLZRYPBuLB3RVX8HJehMNcbqn22ei2g3uEsGhH UUww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZzTcqYbj; 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 q3si29276854pfg.298.2018.05.09.20.13.04; Wed, 09 May 2018 20:13: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=@linaro.org header.s=google header.b=ZzTcqYbj; 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 S1756579AbeEJDMg (ORCPT + 99 others); Wed, 9 May 2018 23:12:36 -0400 Received: from mail-ot0-f195.google.com ([74.125.82.195]:42507 "EHLO mail-ot0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756394AbeEJDMe (ORCPT ); Wed, 9 May 2018 23:12:34 -0400 Received: by mail-ot0-f195.google.com with SMTP id l13-v6so722971otk.9 for ; Wed, 09 May 2018 20:12:33 -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=6zCTO1Mr3DZDrSMdC+qrwK2N93psxdxnn/xh3SDw3Ck=; b=ZzTcqYbjE9cERXONsZbwqBxqxw3SYNhP8lCbgGWJp2lRJyOsBj5nDgfdKFPiORCn+G HQsRAbTWN6ZOgV6CbU4bDOV+E46dnngldCmGtST8HKGkdDJVXmkSssmOtF3ScQ3ra1RB fBVNJA/n/6RwBoFrT+/X7cRdctcFTki/rjL7Y= 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=6zCTO1Mr3DZDrSMdC+qrwK2N93psxdxnn/xh3SDw3Ck=; b=IzseME93PrAyDhcX/MoMBa8GOvQgWkdDDXPIvJbeGA4BENz5T0QQvpH+oSb8NCt6UO 4RTyQKie0zYibKSllvZOra5qPYT9orvb07u6Ju4WBXHh/J90Tiwh4y/eoGF30nWmR+/0 nN4AnyoJwyqierZDeJnwbsiqxzQ9/jg0N/MeQrCIZMlAPJDzdQRax5+97SJu5W22NX4W IuH/HujHJ9/MObMg2b83oMwhAO4PlJ8nRiYrnaPTYWVTmQ/iH0ZzujFdhEYFbHHO0r6q u3EiR0SCseq7irKkLRdIohpE+xj0ainkzO4LATswkwrLkstG7t4d2tLJ//DG/MRte2nn Fknw== X-Gm-Message-State: ALQs6tCgmY+dj4scmBB9Qc5w9CFGJ7lc3WsUC0DLuJlQI5IKRqqY5llb NDWJBjX17EkAvJNlD96otuGlUQEsLSjmOcbwMvm+Tw== X-Received: by 2002:a9d:2fc8:: with SMTP id b8-v6mr32753911otd.177.1525921953429; Wed, 09 May 2018 20:12:33 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a9d:2d77:0:0:0:0:0 with HTTP; Wed, 9 May 2018 20:12:32 -0700 (PDT) In-Reply-To: <20180509142539.GB25131@amd> References: <9a2a07b8eb313ae3ba64af911337ee7ff7c9ad43.1525757122.git.baolin.wang@linaro.org> <20180509142539.GB25131@amd> From: Baolin Wang Date: Thu, 10 May 2018 11:12:32 +0800 Message-ID: Subject: Re: [PATCH v2 2/2] leds: Add Spreadtrum SC27xx breathing light controller driver To: Pavel Machek Cc: Jacek Anaszewski , 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 Pavel, On 9 May 2018 at 22:25, 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? With depending on what mode user selected. If user set the raise/high/fall/low time values, that means the LED will work at breathing mode, and we set brightness to turn on/off the breathing mode LED. Yes, they are independent for each LED. > > Can you generate white breathing pattern? If so, how? Yes, firstly we should set the raise/high/fall/low time values for red LED, blue LED and green LED (each LED time values are same), then set one brightness value to turn on the red LED, blue LED and green LED. > > How do you select between normal and breathing modes? As I explained, when user set the raise/high/fall/low time values, that means user selects the breathing mode of the LED. Otherwise the LED works at normal mode. > > I'd specify times in miliseconds or something, this is way too > hardware specific. But our hardware specification defines magic numbers, not times values in milliseconds. So I think we should follow our specification's definition, and user should also follow the same rules. > > 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. > > Thanks and best regards, > > Pavel > -- > (english) http://www.livejournal.com/~pavelmachek > (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html -- Baolin.wang Best Regards