From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from layka.disroot.org (layka.disroot.org [178.21.23.139]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 809563EDE42; Fri, 15 May 2026 21:40:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=178.21.23.139 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778881228; cv=none; b=ZegZ1kfX0WUoic+01lDP+j+UhsPXTmNG8aAD0kkgM5BROHXdYovn7ovBTJoP0s1Iah20FwmeXXN4uEJQIfEja9jUZ4j6XiDGxI2+HOux+jxnWaA4AV6wzDoEHUPokB46jkeV61c6fWXfYaE+GVVN64MA5myuYrMzMV+glDIH+Rw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778881228; c=relaxed/simple; bh=vP8w8lxUF7n9TxS1NBD9u73XFc/xRv4DArDfYKdCdqk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=mSCE4ZqxcK2HIgaaupOowaM7BFAwrE6JfDGvJdkNxG7AuxpBHzFG4c4tGvBaRQsU7GnSV6vWU3yTmBF6wGVHvJo8gcFcxovLpnOipZ8WzCixihA4SjZgdt/GThGxP9ydOeJv4IJVWT48JEWYtZnUe99gdsspWUyZK8+dW2chXIs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=disroot.org; spf=pass smtp.mailfrom=disroot.org; dkim=pass (2048-bit key) header.d=disroot.org header.i=@disroot.org header.b=BZQnmMjE; arc=none smtp.client-ip=178.21.23.139 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=disroot.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=disroot.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=disroot.org header.i=@disroot.org header.b="BZQnmMjE" Received: from mail01.disroot.lan (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id 2187527163; Fri, 15 May 2026 23:40:26 +0200 (CEST) X-Virus-Scanned: SPAM Filter at disroot.org Received: from layka.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id 6CqZuTwtz8uW; Fri, 15 May 2026 23:40:25 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1778881225; bh=vP8w8lxUF7n9TxS1NBD9u73XFc/xRv4DArDfYKdCdqk=; h=From:Date:Subject:References:In-Reply-To:To:Cc; b=BZQnmMjE4Y9jH+l/tERxt0B4qoUXRIXJ8kYnKaC/0Q8J137wL54C8YDChDKnrkATC chNfKMpCV4WMA0eBFFCg7n9NaJS0xIUGRgqqFXDHnnSffBrwejMelLswH7pFebELlx gd6neew2rMkjItrgxjxUYltufwWJnvC3R3h0fozHUwgxWfgJZgvYol/v4UnPCGJDqO Kn41Qz7CvINgaW+nO6yvUh+4C5rFk3/D3eEYTwEISwqgPFrPnzmYeDJcFlaC8NmOVx 2cQ1zyCBxJBigaWTA7EhPrFRuXX5OLYK8EZSucJhSNTX5LXM2Dzw/yJ7o4xd7pAwq3 CHImU0hs3uA0w== From: Kaustabh Chakraborty Date: Sat, 16 May 2026 03:08:40 +0530 Subject: [PATCH v7 08/10] Documentation: leds: document pattern behavior of Samsung S2M series PMIC RGB LEDs Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20260516-s2mu005-pmic-v7-8-73f9702fb461@disroot.org> References: <20260516-s2mu005-pmic-v7-0-73f9702fb461@disroot.org> In-Reply-To: <20260516-s2mu005-pmic-v7-0-73f9702fb461@disroot.org> To: Lee Jones , Pavel Machek , Rob Herring , Krzysztof Kozlowski , Conor Dooley , MyungJoo Ham , Chanwoo Choi , Sebastian Reichel , Krzysztof Kozlowski , =?utf-8?q?Andr=C3=A9_Draszik?= , Alexandre Belloni , Jonathan Corbet , Shuah Khan , Nam Tran , =?utf-8?q?=C5=81ukasz_Lebiedzi=C5=84ski?= , Yassine Oudjana Cc: linux-leds@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-rtc@vger.kernel.org, linux-doc@vger.kernel.org, Kaustabh Chakraborty Add documentation to describe how hardware patterns (as defined by the documentation of leds-trigger-pattern) are parsed and implemented by the Samsung S2M series PMIC RGB LED driver. Signed-off-by: Kaustabh Chakraborty --- Documentation/leds/index.rst | 1 + Documentation/leds/leds-s2m-rgb.rst | 60 +++++++++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+) diff --git a/Documentation/leds/index.rst b/Documentation/leds/index.rst index bebf440042787..23fa9ff7aaf4b 100644 --- a/Documentation/leds/index.rst +++ b/Documentation/leds/index.rst @@ -28,6 +28,7 @@ LEDs leds-lp5812 leds-mlxcpld leds-mt6370-rgb + leds-s2m-rgb leds-sc27xx leds-st1202 leds-qcom-lpg diff --git a/Documentation/leds/leds-s2m-rgb.rst b/Documentation/leds/leds-s2m-rgb.rst new file mode 100644 index 0000000000000..4f89a8c89ea86 --- /dev/null +++ b/Documentation/leds/leds-s2m-rgb.rst @@ -0,0 +1,60 @@ +.. SPDX-License-Identifier: GPL-2.0 + +====================================== +Samsung S2M Series PMIC RGB LED Driver +====================================== + +Description +----------- + +The RGB LED on the S2M series PMIC hardware features a three-channel LED that +is grouped together as a single device. Furthermore, it supports 8-bit +brightness control for each channel. This LED is typically used as a status +indicator in mobile devices. It also supports various parameters for hardware +patterns. + +The hardware pattern can be programmed using the "pattern" trigger, using the +hw_pattern attribute. + +/sys/class/leds//repeat +---------------------------- + +The hardware supports only indefinitely repeating patterns. The repeat +attribute must be set to -1 for hardware patterns to function. + +/sys/class/leds//hw_pattern +-------------------------------- + +Specify a hardware pattern for the RGB LEDs. + +The pattern is a series of brightness levels and durations in milliseconds. +There should be only one non-zero brightness level. Unlike the results +described in leds-trigger-pattern, the transitions between on and off states +are smoothed out by the hardware. + +Simple pattern:: + + "255 3000 0 1000" + + 255 -+ ''''''-. .-'''''''-. + | '. .' '. + | \ / \ + | '. .' '. + | '-.......-' '- + 0 -+-------+-------+-------+-------+-------+-------+--> time (s) + 0 1 2 3 4 5 6 + +As described in leds-trigger-pattern, it is also possible to use zero-length +entries to disable the ramping mechanism. + +On-Off pattern:: + + "255 1000 255 0 0 1000 0 0" + + 255 -+ ------+ +-------+ +-------+ + | | | | | | + | | | | | | + | | | | | | + | +-------+ +-------+ +------- + 0 -+-------+-------+-------+-------+-------+-------+--> time (s) + 0 1 2 3 4 5 6 -- 2.53.0