Received: by 10.192.165.148 with SMTP id m20csp1031020imm; Thu, 10 May 2018 04:39:23 -0700 (PDT) X-Google-Smtp-Source: AB8JxZo5C+XWly8JhMvVkGbY6GHgRja5CxWR74xPrsx760R3sx2Qw/7sL3pGbMxPOxLWbLcVzA87 X-Received: by 2002:a62:5d99:: with SMTP id n25-v6mr1047510pfj.143.1525952363616; Thu, 10 May 2018 04:39:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525952363; cv=none; d=google.com; s=arc-20160816; b=FKny1DkaYAd6OJKLPbUljEeD9salDhjJf1FUtrpgv4h6Hb/Qtpa+D+yXYoEk/v6Hzm Hw1lR4QJ6qMLAsPo9ZFmQVwnJ8SBdbiADXu4ALDlDb8QpScYnWOTdYjWZz+AsGj8JRgJ HfaiuvYSzXDuDPdqgtbzgOv+CGMhSjkhrTMFTLf/WLKnSmBoWK0RdNAhOky20TKDbPxj YeUQzakCNVHFXaz/ZWPNPaqeljePjQaCfKgvRbDlRP+qRHGSNPzkuIHgJoDE+5Fh8+q2 ORS2zMcKhAXt4x+u59qoE09VWn59fgW6PBtSWJMVFBK8KoNd6Xf0HGIuiqzmEwcaPfFY 0Fsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=uI/PrN5QdEyPVO83rlS9fnmaPrRaosvWoHB6ZblPsYA=; b=hjDHPM0nYiD+VZLoxNQmPJskXv42QU+UoMO4IJAnTlN92KhFe/PKhoghWs9ySd1WxS ApTf5IPe84EtVwmD/yoxP0mOXoMNGWhnk3B1emBnY2ZUFCSlqCkFDX1wjJvrw+qjflfN +4o5M0EM/naY26u1EF8lK5FD4gFfGbfzC6WrULhD93RVMvF/IYdoUqUvlhp+VpCLHSGW +oeFQt89+63tfpCmY45eqiOmkAk8HZ4eaxu7UMxgwlHIR0+sR4q0+MdpYFXvjLjvM7La VzWeeFFjR8o3zdK/pp5ax6EWzElyTtHFR+7Iy/lKEJN4JdMncyxKw+NMiZIsOy+wQ1dj 0jPg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a5-v6si652611pla.117.2018.05.10.04.39.08; Thu, 10 May 2018 04:39:23 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757071AbeEJLhx (ORCPT + 99 others); Thu, 10 May 2018 07:37:53 -0400 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]:58447 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756824AbeEJLhv (ORCPT ); Thu, 10 May 2018 07:37:51 -0400 Received: by atrey.karlin.mff.cuni.cz (Postfix, from userid 512) id 9900A804CD; Thu, 10 May 2018 13:37:49 +0200 (CEST) Date: Thu, 10 May 2018 13:37:49 +0200 From: Pavel Machek To: Jacek Anaszewski 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 Subject: Re: [PATCH v2 2/2] leds: Add Spreadtrum SC27xx breathing light controller driver Message-ID: <20180510113749.GG6977@amd> References: <9a2a07b8eb313ae3ba64af911337ee7ff7c9ad43.1525757122.git.baolin.wang@linaro.org> <20180509142539.GB25131@amd> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="p7qwJlK53pWzbayA" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --p7qwJlK53pWzbayA Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi! > >>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. >=20 > Agreed. >=20 > >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. >=20 > 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. >=20 > 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. =20 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. Best regards, Pavel --=20 (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blo= g.html --p7qwJlK53pWzbayA Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlr0Lw0ACgkQMOfwapXb+vIRVACgwnjEX9KbjsguxrZHENVrg85k DzEAoLHGFNDSqR/bS/Z/JhEioFUQBHOn =v++i -----END PGP SIGNATURE----- --p7qwJlK53pWzbayA--