From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mout-p-202.mailbox.org (mout-p-202.mailbox.org [80.241.56.172]) (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 6ED767E0FF; Tue, 8 Jul 2025 14:11:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=80.241.56.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751983917; cv=none; b=NekQSPFMl70H8KHCiKMVSL+qiZSOZ8cbVrDE40X4nBqPRRkef1SpF6LEW6+jBuVkFgLn2iGdNj9JCTtC4faGhSyHI6p8kdls1UYrLtY71Y3BbCf5ZJUdN/LDHzgLXkfPPzQbWk9bJjlbidT02ZE328MWBL40nRPeRAYZoFN/AoU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751983917; c=relaxed/simple; bh=PfwJveXtoB8r1pqajd1Gy5HyI5tqUUZYKvtkh3o6PTA=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=Dm8+kWXnkONoiPOAZsJGy562XTrXrWzu66zCZc4JC2WxYm5/Fl1KkNEXxe7IeSviyiWCwxBv4S8T53rEsTjVukV7gT+KKEQeZIeDVWVEAIwRJUkT97fWOa87TrnsZHfPrVgkPmf1rS5oAxivWiYaQNdratTjAGG9KpJC892XOAg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=timmermann.space; spf=pass smtp.mailfrom=timmermann.space; arc=none smtp.client-ip=80.241.56.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=timmermann.space Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=timmermann.space Received: from smtp1.mailbox.org (smtp1.mailbox.org [10.196.197.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-202.mailbox.org (Postfix) with ESMTPS id 4bc32F2PTsz9sqy; Tue, 8 Jul 2025 16:11:49 +0200 (CEST) From: Lukas Timmermann To: lee@kernel.org, pavel@kernel.org, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org Cc: linux-leds@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux@timmermann.space Subject: [PATCH v7 0/2] Support for Osram as3668 LED driver Date: Tue, 8 Jul 2025 16:11:12 +0200 Message-ID: <20250708141114.134950-1-linux@timmermann.space> Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit This patch adds basic support for the as3668 driver IC via I2C interface. The IC is capable of driving four individual LEDs up to 25.5mA per channel. Hardware blinking would be theoretically possible, but this chip only supports a few set on/off-delays which makes using that feature unfeasable, therefore my driver doesn't offer that capability. It's intended applications is in mobile devices such as phones, tablets and cameras. This driver was tested and is working on a samsung-manta which is running postmarketOS with a near mainline kernel. Please note: This is my first suggested patch to the kernel. checkpatch.pl runs without warnings or errors. I've read the docs in regards to the led subsystem, coding style and submission of patches, but I'm still a bit unsure about the general workflow. I will try my best. Changes in v7: - Simplified multiple error messages. They now use dev_err_probe(). - Removed some newlines. - Link to v6: https://lore.kernel.org/all/20250611083151.22150-1-linux@timmermann.space/ Changes in v6: - Fixed missing error handling during init - Fixed missing newline in error messages - Fixed size calculation for memory allocation - Fixed error handling for memory allocation - Link to v5: https://lore.kernel.org/lkml/20250608231854.75668-1-linux@timmermann.space/ Changes in v5: - Fixed debug and error messages using wrong format specifiers. - Fixed missing include bitwise.h. - Changed commit message for dt file to fit expected style. - Link to v4: https://lore.kernel.org/lkml/20250607215049.29259-1-linux@timmermann.space/ Changes in v4: - Fixed some mistakes made in the dt file pointed out in v3. - Swapped dt and driver in patch series. DT now comes first. - Fixed errors in Kconfig due to last minute changes. - Added dt file into MAINTAINERS file. - Link to v3: https://lore.kernel.org/lkml/20250604225838.102910-2-linux@timmermann.space/ Changes in v3: - Fixed an extra whitespace in the dt bindings documentation. - Sent patch to all related lists and maintainers. - Link to v2: https://lore.kernel.org/lkml/20250531120715.302870-4-linux@timmermann.space/ Changes in v2: - Fixed reading led subnodes in dt incorrectly, which caused wrong numbering and a segfault when removing the driver module - Fixed calling of_property_read_u8 with an int, causing a compiler error - Added more error checking during writes to the i2c bus - Link to v1: https://lore.kernel.org/linux-leds/20250530184219.78085-3-linux@timmermann.space/ Signed-off-by: Lukas Timmermann Lukas Timmermann (2): dt-bindings: leds: Add new as3668 support leds: as3668: Driver for the ams Osram 4-channel i2c LED driver .../devicetree/bindings/leds/ams,as3668.yaml | 74 +++++++ MAINTAINERS | 7 + drivers/leds/Kconfig | 13 ++ drivers/leds/Makefile | 1 + drivers/leds/leds-as3668.c | 195 ++++++++++++++++++ 5 files changed, 290 insertions(+) create mode 100644 Documentation/devicetree/bindings/leds/ams,as3668.yaml create mode 100644 drivers/leds/leds-as3668.c -- 2.50.0