From nobody Tue Apr 7 23:45:13 2026 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (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 7C93F3D6CDC for ; Wed, 11 Mar 2026 12:27:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773232058; cv=none; b=BDbC+ztc6xSC9FS/1OctAGhiiWbhdD8EcFyWoiYt7/glEj1vq+aQrJ7ZGcMeK3BNXAhuC2L6c6jTmic9rhp4lx7qDpfFUbt/FAbNGXKQb6XSnCxew8FwVMeVRyLTJm2kmAkNzNbtugyFPIKW0ZwS+7Bd19G6qgwxJRjZ9AG11us= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773232058; c=relaxed/simple; bh=mfhkxsjmBeSJ4HS58+gXzwez8JwxInYbuUEkE7wBk48=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=cafW/JXKO20xbphtE/RbIjJdjR0KwJd+tjiVtjWY/8CYk1AfMP6N1mOFuxrV9x3o83nCQaCNOEXqkySSaouPewpSP/U72kIiUH6nIayLfciTza832AuZmRAlP43C/IifV/W/e93ClQmi2GwUckV57l6asIGH+Cd/9tmsicnIYgQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Received: from ptz.office.stw.pengutronix.de ([2a0a:edc0:0:900:1d::77] helo=ratatoskr.trumtrar.info) by metis.whiteo.stw.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1w0Iez-0002PX-Rt; Wed, 11 Mar 2026 13:27:33 +0100 From: Steffen Trumtrar Date: Wed, 11 Mar 2026 13:27:01 +0100 Subject: [PATCH v2 1/2] led: lp5860: expose fault state via sysfs 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-Transfer-Encoding: quoted-printable Message-Id: <20260311-v6-19-topic-ti-lp5860-fault-v2-1-f9454910f009@pengutronix.de> References: <20260311-v6-19-topic-ti-lp5860-fault-v2-0-f9454910f009@pengutronix.de> In-Reply-To: <20260311-v6-19-topic-ti-lp5860-fault-v2-0-f9454910f009@pengutronix.de> To: Lee Jones , Pavel Machek Cc: linux-kernel@vger.kernel.org, linux-leds@vger.kernel.org, Steffen Trumtrar , Mark Brown , linux-spi@vger.kernel.org X-Mailer: b4 0.14.3 X-SA-Exim-Connect-IP: 2a0a:edc0:0:900:1d::77 X-SA-Exim-Mail-From: s.trumtrar@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Return the fault state to the userspase via sysfs and allow to reset it. The LP5860 has a global fault state, that just indicates that a short or open fault was detected on any LED. This is exposed via 'fault_state'. The 'fault_state_open' exposes the LED name and channel where an open condition was detected. The 'fault_state_short' exposes the LED name and channel where a short condition was detected. To: Mark Brown Cc: linux-spi@vger.kernel.org Signed-off-by: Steffen Trumtrar --- Documentation/ABI/testing/sysfs-class-spi-lp5860 | 49 ++++++++++++++++++++= ++++ 1 file changed, 49 insertions(+) diff --git a/Documentation/ABI/testing/sysfs-class-spi-lp5860 b/Documentati= on/ABI/testing/sysfs-class-spi-lp5860 new file mode 100644 index 0000000000000..31082bd78f51e --- /dev/null +++ b/Documentation/ABI/testing/sysfs-class-spi-lp5860 @@ -0,0 +1,49 @@ +What: /sys/class/spi_master/spi/spi./fault_state +Date: March 2026 +KernelVersion: 7.0 +Contact: Steffen Trumtrar +Description: + Contains and sets the global fault state: + + * 3: Open and short detected + * 2: Open detected + * 1: Short detected + + Can be cleared by writing the corresponding value back to fault_state. + + Example usage:: + + ## Read + # cat /sys/class/spi_master/spi/spi./fault_state + 2 + + ## Write + # echo 2 > /sys/class/spi_master/spi/spi./fault_state + +What: /sys/class/spi_master/spi/spi./fault_state_= open +Date: March 2026 +KernelVersion: 7.0 +Contact: Steffen Trumtrar +Description: + Contains all LEDs and channels where an open condition was detected. + The format is ledname:channel. + + Example usage:: + + ## Read + # cat /sys/class/spi_master/spi/spi./fault_state_open + rgb1:0 rgb2:4 + +What: /sys/class/spi_master/spi/spi./fault_state_= short +Date: March 2026 +KernelVersion: 7.0 +Contact: Steffen Trumtrar +Description: + Contains all LEDs and channels where a short condition was detected. + The format is ledname:channel. + + Example usage:: + + ## Read + # cat /sys/class/spi_master/spi/spi./fault_state_short + rgb1:0 rgb2:4 --=20 2.51.0