Received: by 2002:a05:7412:5112:b0:fa:6e18:a558 with SMTP id fm18csp1740363rdb; Thu, 25 Jan 2024 05:01:04 -0800 (PST) X-Google-Smtp-Source: AGHT+IFZJ1xkU6NhiElgkVJw+nikzEpszUW8zAFO9D1IuEplnNTpDK3hCCusejLuTsvm8jZR6w9a X-Received: by 2002:a17:90a:2d8a:b0:28d:1581:29e6 with SMTP id p10-20020a17090a2d8a00b0028d158129e6mr1184098pjd.13.1706187664682; Thu, 25 Jan 2024 05:01:04 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706187664; cv=pass; d=google.com; s=arc-20160816; b=HzJNHDKOb+0a/bg8lZdI7PuGfJsAPNKpZAu2ljBNo5LZz8moUxa+GGdrmSi87gKp6m r01qJ0xiONKCXvzeXr+eXFLdS/Ye7NTp/jGUtgdrxGwN562FNw6mXsa1Ewpk0IEQJmhH bdKwE6oKpgLa1VyCKXUAQM+akzQrufriglpFxLXKHFCk9TVYbuqjnU0jA2o+guLVsQCg wbWTKfaMJ2HVDHi2ycjjabqWtcloL/1TRfnids9PiTW9UPla1EGLY5KD2QpJQbpEljPG Wa7dHnAQnB3ByMeJblluIpLZct6pm3m02D42S5XhHqEnOQ/qa5/AKei5R4RoH73iFt06 IgTQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=ALu6El7plOK5ONo0p2nUAN4WSQqHv+L2MbTdyUUjW8U=; fh=3c3HiyttdJX67+Ihu1J7/lTDud8wQbKcV6405C0bm7w=; b=PYcA9Ax5jeLyi1efecHm2qU6qTQ/9MKuzIvvFYw5D/jCmeu92kwBzp3t0HnpFNrzrW eotymg1yXXvF7gNFutmOTSzERQs1nkzqVYo7t1yDuawnQHnNP89e+Kih0phWj628Sf6U NCx4F5VXsBGoYXEfz4eDbhA8uX7LIW2buFgeOAAG03ub9gMvwGXIOVfVHQJ5W+qkq47O sJyHJtk62Wl/aR9F5seK3BJ/nRE6Vt/wY/8DwF3oERJ589dzgTNOhc64F6/pQDbexbBP P2XnlD62shzFSHPZs4RapyHFXDX4KuQzaayi3tLB5OXuT3UsxnMsvxYSs043mSiAiB8p IcvQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=PkT9D3PY; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-38600-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-38600-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id k2-20020a17090a910200b00290fb867655si1273854pjo.172.2024.01.25.05.01.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jan 2024 05:01:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-38600-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=PkT9D3PY; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-38600-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-38600-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 56C4C290E80 for ; Thu, 25 Jan 2024 13:01:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A206D4F60C; Thu, 25 Jan 2024 13:00:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="PkT9D3PY" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BB87B3172D; Thu, 25 Jan 2024 13:00:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706187655; cv=none; b=RXLkE4/DlNF0HYaTEDzQCpN22U/Org+Zw0wL7ZPAQ2LuG5TRd7APh8WW9r++UUEqqc9EIl2p2CvVIvK6e9c4O/s6wNdMynBloJDtF6kXedV5KV8G/ALv+azbmohfPE1AcCXWpErR7B8mJbGkuGYNdv8uZ9ML4TGEevVa7qwLTic= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706187655; c=relaxed/simple; bh=99bv9c9eHb4ZdXwaGxVfbOS63w2nNy5OFAbWyD1Bli4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=mP8hWKUO82BAKmP5ZpIAjEgqD6Ufe/b7kPdSb4967WmlnZIJc5/sbkqXA4rMcBcrBAtQkDVR6ja3FVlvv0DBRJXm3xFJ1C06jJelTH9ZielrfUjrAMUetCnaQNY2fLef+3LD2+PRrNw5WTLwDvcLo+NnZFys6GW5c+J3hg16rAE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=PkT9D3PY; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 34BD1C433F1; Thu, 25 Jan 2024 13:00:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706187655; bh=99bv9c9eHb4ZdXwaGxVfbOS63w2nNy5OFAbWyD1Bli4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=PkT9D3PYND3pBYWrVLVUK+Re669pSmoPnHh6SkfDJ94KdzW1ClDWidO4RV1qWY4gD aMCZ7y4XLz5fhiVt0VrT7p+U1cEp5eDWOiQ99oMH/5tn09q7Fa7ayWVVArwyqu0CCE rsfuZqd4whgdal9xPYuy4xwrksrP8mlPq7aPCIbM4+3n0AECMUIyFfl9s7x7Kp011Y UwpnPGacNkJisHrmsWDIW/coQ26S/TZj8PTUSNzg4wmmw+8oxBIJ1dtLXUzVpVymRI XHjVAXIoPxDo3LzHXQN45t2TsF1aNqipwjKnKwDjlmwv3Yct4Mj/UG4xqO22EEh/t4 ivCzdQL+mKpsQ== Date: Thu, 25 Jan 2024 13:00:49 +0000 From: Lee Jones To: Martin Kurbanov , Greg Kroah-Hartman , Jacek Anaszewski Cc: Pavel Machek , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Jonathan Corbet , Andy Shevchenko , linux-kernel@vger.kernel.org, linux-leds@vger.kernel.org, devicetree@vger.kernel.org, linux-doc@vger.kernel.org, kernel@salutedevices.com, Greg Kroah-Hartman Subject: Re: [PATCH v1 1/2] leds: aw200xx: support for hw pattern controllers Message-ID: <20240125130049.GF74950@google.com> References: <20231207125938.175119-1-mmkurbanov@salutedevices.com> <20231207125938.175119-2-mmkurbanov@salutedevices.com> <20231221161011.GO10102@google.com> <85c89859-ae03-4692-9c09-5779e4c40eae@salutedevices.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <85c89859-ae03-4692-9c09-5779e4c40eae@salutedevices.com> Looping in Jacek (LEDS) and Greg (SYFS) for some knowledgable input. On Fri, 12 Jan 2024, Martin Kurbanov wrote: > On 21.12.2023 19:10, Lee Jones wrote: > > On Thu, 07 Dec 2023, Martin Kurbanov wrote: > > > >> This led-controller supports 3 pattern controllers for auto breathing or > >> group dimming control. Each pattern controller can work in auto > >> breathing or manual control mode. All breathing parameters including > >> rising/falling slope, on/off time, repeat times, min/max brightness > >> and so on are configurable. > >> > >> Signed-off-by: Martin Kurbanov > >> --- > >> .../testing/sysfs-class-led-driver-aw200xx | 108 +++ > >> Documentation/leds/leds-aw200xx.rst | 274 ++++++++ > >> drivers/leds/leds-aw200xx.c | 649 ++++++++++++++++++ > >> 3 files changed, 1031 insertions(+) > >> create mode 100644 Documentation/leds/leds-aw200xx.rst > > > > This interface is bananas. Exposing an entire register interface to > > sysfs does not sit will with me at all. When we add support to a sysfs > > class, we usually require it to be generic and work across all devices. > > Adding device specific interfaces is generally decried and to be > > avoided. Don't forget, once we commit something to sysfs, it becomes > > ABI and we have to support it forever. > > > > A far better approach would be to add support for this in userspace > > instead You can use the standard I2C character device API to achieve > > the same result. That way we don't have the same level of commitment > > and is generally a much more flexible/future-proof. > > > > I used sysfs similarly to other LED drivers (for example, leds-lm3533). > Additionally, the controller has interrupts about the completion of the pattern, > which is best to handle in the kernel. In the case of implementation in user > mode, there may be synchronization problems, as the controller has several > memory pages that can be switched by writing the page number to register 0xF0. leds-lm3533 is a 12 year old legacy exception AND has less than half of the sysfs exports proposed here. What makes aw200xx so different it needs to an incomparable interface to any other that we currently support? -- Lee Jones [李琼斯]