From nobody Tue Jun 16 08:57:46 2026 Received: from mail-lf1-f50.google.com (mail-lf1-f50.google.com [209.85.167.50]) (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 F24CC396B93 for ; Fri, 17 Apr 2026 11:42:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776426169; cv=none; b=qVjMmLdoLkif+uwKf/u2Kr6SAH+B2nWRmR6c/vzOxjRN3m+p4WJVRfVKUpZVmyGSpCtN3Fhq4z7W9QJ+IJ4xNh3TZSQYjnMOXCaNre0kRQl/4yYHUU/l7paW7P93Ga709z8jVUIkdEi6n5A11esl5j0gMiibKyNa6RgPxrgylRU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776426169; c=relaxed/simple; bh=2SoN076WkKPP9dslU6jI1ybrIMLHSTNOhkvnyADFEu0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=j7CN+YoX+YO9XS/x+/RBuBkiBcVszlFlE5WbaAlYrJX/vFA3VwT/a/L5t5xRKxL74sCSpZ6FCVZ0/EGxja+MYvkebTa1PATye2RuVifE96zT5nr6IeB7gOyc1e7U82bH6S+gQqSGM4b2h4Q20q+/icZelNKfFdHACdT2Nk+eG8k= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=U3Q+OsQr; arc=none smtp.client-ip=209.85.167.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="U3Q+OsQr" Received: by mail-lf1-f50.google.com with SMTP id 2adb3069b0e04-5a2967e5de4so634466e87.3 for ; Fri, 17 Apr 2026 04:42:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1776426166; x=1777030966; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=aIsBkEhxNk5zSXNzbm4OjEaayYLvWVn1IlfYzqWmAY8=; b=U3Q+OsQrqFj9zxxhBl6l+pnWu2fXBHRpsTivXAo2KmD6I6Fsl+1zwSkXerpJ3ipzoQ kuTU0/5BJ1Mbwxao5kHb+iisUffH5NlLjfUHdryWZMTZ69QDqvGRTyfFrEEUkNs9Thax pdwKThk8niYPRacMEtYiJVd4+/vKzs+MWoUnM8EgjHGEYQQozJUzu7V9Uby1I0hiwxcV BS+q9cNcIBMGxg0euq7sSZQzSqnucIJMyD4ML5NqpyLoQYOLfsMXGTcbxFjYJGtXcmBE NjfTjohpTdpUuWHXBxPcJqtBezN6Oa9nYT/XJ5I8EaTvigflklhEO4ukE8nuQX3INvCj MDhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776426166; x=1777030966; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=aIsBkEhxNk5zSXNzbm4OjEaayYLvWVn1IlfYzqWmAY8=; b=dR84+AE6eK9zuw1o6HTXQbEVyRYVYLZ7dyvhC1KxwS+7kDiPBQOTccaGzkM3puWYEU lD/kRWRh9/+Z0iorwRPoPAg5he/x2d3WvlmIU/2DwTa449utxPs8vlJBxxPag+lGAHmA 3/vTuPoeNHARI4sKvurrKHRPpEP+zdkjU/33ktIQN1QbHGaBRI2mF6X1luhE9oc0uXI7 A5gtF+TOILPDBAPGQ7UBh4xuGUenUP1GbHmdT98GMMqDWcwGOEakLwElSdXwZIyzzzPT j+tB6JWG9VJrmvvHPAizVsrKjO4+CkCMkTTfJPBmbQ6d10GO4H3PeapeDZiz0NU/UKF3 99Cg== X-Forwarded-Encrypted: i=1; AFNElJ/6sf8J53hC5fGJPuTCuX1JpqDV4LZ8NhEH9qSEYInJrWlySzMHr+vWAvy9wtvbEwQ95Lptjk3Tkh8uIfE=@vger.kernel.org X-Gm-Message-State: AOJu0YwIsa2LIy0PL4SDe+QT/OoSB0AkjK2NMBu0s6sn8i2qeEjmgcy8 ZDjLwn9VVrSqYgOdNjgEHvIylEWBpXPuog0cIOuFPyNy6iL+CWViuIRH X-Gm-Gg: AeBDies+9k5zFQZf6Ldomso08IATO/yElRAT7Ku3uWo1IzvaZq8wjCyaGmQ47KSovFU dR0D09bfMYdQTMZVN72BBT1mFNM/poCbne/HVRKwUAQjmTEurx3xHEmnU1yI/ddqcDW2cJiVuQ0 bAdWRSylysUfxhHU6K1/AiKCpjXPJmrszw8KsOOaUaAzAmd9ru8tuoaj02zeZ/z9ut11973pcSm RiUlyE4MF1fYKJO2nsfu3LnK4sNMD1SmmyaFdQNaKWV4KOFJb3mzoGyV1yDXLPaAIumZuuDNZ4f c+3TmHMSLvTXJHvQQY2WqhhkSf7ozSCGkE5ilha8ExMJhzICNqcGR1KGSd+Jzyic6OjqigQpfCx eoruP56q1A8L3oblnCXL8UwMpVIdVe8GeuWJSaMOzG5Ddn1CrvI1Bjdc+cTGMF1eIN4/VWq/OXj 7KZh9OUaQynRO/2Dygb9QX1KI= X-Received: by 2002:a05:6512:3b8e:b0:5a3:ff73:29d6 with SMTP id 2adb3069b0e04-5a4172bb921mr657348e87.7.1776426165787; Fri, 17 Apr 2026 04:42:45 -0700 (PDT) Received: from xeon ([188.163.112.56]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-5a4185bc672sm338636e87.34.2026.04.17.04.42.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Apr 2026 04:42:45 -0700 (PDT) From: Svyatoslav Ryhel To: Lee Jones , Pavel Machek , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Sakari Ailus , Mauro Carvalho Chehab , Svyatoslav Ryhel Cc: linux-leds@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Subject: [PATCH v1 1/5] media: lm3560: Add HWEN pin support Date: Fri, 17 Apr 2026 14:42:22 +0300 Message-ID: <20260417114226.100033-2-clamor95@gmail.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260417114226.100033-1-clamor95@gmail.com> References: <20260417114226.100033-1-clamor95@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Add HWEN - logic high hardware enable input found in LM3560 to ensure its proper operation. Signed-off-by: Svyatoslav Ryhel --- drivers/media/i2c/lm3560.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/media/i2c/lm3560.c b/drivers/media/i2c/lm3560.c index f4cc844f4e3c..e6af61415821 100644 --- a/drivers/media/i2c/lm3560.c +++ b/drivers/media/i2c/lm3560.c @@ -11,6 +11,7 @@ =20 #include #include +#include #include #include #include @@ -45,6 +46,7 @@ enum led_enable { * @dev: pointer to &struct device * @pdata: platform data * @regmap: reg. map for i2c + * @hwen_gpio: line connected to hwen pin * @lock: muxtex for serial access. * @led_mode: V4L2 LED mode * @ctrls_led: V4L2 controls @@ -54,6 +56,7 @@ struct lm3560_flash { struct device *dev; struct lm3560_platform_data *pdata; struct regmap *regmap; + struct gpio_desc *hwen_gpio; struct mutex lock; =20 enum v4l2_flash_led_mode led_mode; @@ -425,6 +428,12 @@ static int lm3560_probe(struct i2c_client *client) flash->dev =3D &client->dev; mutex_init(&flash->lock); =20 + flash->hwen_gpio =3D devm_gpiod_get_optional(&client->dev, "enable", + GPIOD_OUT_HIGH); + if (IS_ERR(flash->hwen_gpio)) + return dev_err_probe(&client->dev, PTR_ERR(flash->hwen_gpio), + "failed to get hwen gpio\n"); + rval =3D lm3560_subdev_init(flash, LM3560_LED0, "lm3560-led0"); if (rval < 0) return rval; @@ -452,6 +461,8 @@ static void lm3560_remove(struct i2c_client *client) v4l2_ctrl_handler_free(&flash->ctrls_led[i]); media_entity_cleanup(&flash->subdev_led[i].entity); } + + gpiod_set_value_cansleep(flash->hwen_gpio, 0); } =20 static const struct i2c_device_id lm3560_id_table[] =3D { --=20 2.51.0 From nobody Tue Jun 16 08:57:46 2026 Received: from mail-lf1-f50.google.com (mail-lf1-f50.google.com [209.85.167.50]) (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 D4EC1397E8E for ; Fri, 17 Apr 2026 11:42:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776426170; cv=none; b=mea7JeGmYKuG5XHbDuvDp5Z+sukevCM1vo+7sjVkOlc8JL5PWmDZuLAG9H7dhI3zMGQPVPVgH4aUM3ECVyXMBVsaY7TRBvCI1EvmqGCyt28ZzPFcEVlJBeg+TM6u3qR4mkqSMtUTsJxsVoW+KBWvVm2yIItqshT70sPpWtvanZ0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776426170; c=relaxed/simple; bh=Pji0/ofzjtQ63oZLWNDkDfpZTnQz3RIaDahYeQ6edfE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=exa4kpH3nXX8LSYobRXMdINRtrhIS2JfMt/lDxYDwc7rrQMPttPO8wG30n709Fmd2r+/itrqE5nsJ1h0BTcP3gJGHxsj9SxwUJoVsQWp/2PzKe9U+SOzLgXmiasLH8ggBztox0am/b+1hAxBVdaVukCaTnRToCEpgLVKUgtofDQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=qVN4u5g+; arc=none smtp.client-ip=209.85.167.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="qVN4u5g+" Received: by mail-lf1-f50.google.com with SMTP id 2adb3069b0e04-5a2c77c62d7so679262e87.0 for ; Fri, 17 Apr 2026 04:42:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1776426167; x=1777030967; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=bTztIzyLZUtX46/uC4DmLedmtQKgb/ItDKns9uW8WRo=; b=qVN4u5g+HrPiZXYg85xntUJPHeFQd7o11O0U71PmH9ce4MtuET8xY0Hovmqm+3ifsA uJ35nvO1sLB6BbR4G0N7JQWysH3JmNEmT+vF7ZHDMr0zX8DVVSlWY1FwniQkF1L9xTc9 OjW/v8Jm8A5IVfW/H/6RHIdt4HN/Z9VKtwQkjMwFpCMJaFtR9jzjHEnva3h4yWcR5Vdp f4TXkV12SRr5+xcjBuaAz5eBbCGjHUFbDbmSalO2Sl2r5lSnsQgOLuQmw1dPsZ3Fryp0 1Z+DLHbBzEbcS1EQH7TMsdA7PjbnxR0xzeGJX9TrRAOej6AQJVJ3yQyL2TofUz0k0lCm cSRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776426167; x=1777030967; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=bTztIzyLZUtX46/uC4DmLedmtQKgb/ItDKns9uW8WRo=; b=SdDOvcO4rDuW6LPeyxeflRd4ftIOCnEdqKH67d7xTinkGzaW4beqf3GMGd6Afd5Few h0C0n/R9ZQU4UliPMVJdKBon+tIiUSe7z31SiL8/uS9I/U/vmX5ort1veVzZC+OkscKE fiwamjkWFutJKIZrEb1xxLUtzmt0drTTfQSVMid8dLvtDHXBFUZ/teDV6K4OB3jbq2Rz YDuya1Sg8nGTyu9tYuijGPMzUlS9jX//xesUUtVolgiULfdWOBR7eeTw/07f0a3JDqxv JSJZdP8gZaDxJvLebFV+rCqTvH50umC8rseaYGdPevYwcT8j+tYTfJuTQ8EzVQu4Inum qdHQ== X-Forwarded-Encrypted: i=1; AFNElJ8Bu6ggn7daICj2T3uj9og41blz9kRXUPi5X6PlTZoKf/f7xPwb54ZrvSpnAKiM0C4udmfgQ6JoHOeau3w=@vger.kernel.org X-Gm-Message-State: AOJu0Yym94zf03Kkble8viYIuVmQgSElLn/5WQQmOO1YdHhcdHwVgcnD 4DFz17JCsNyU1OrAoNCA/j4wKtNGYVE1Q4V9pXoDKMeblIL5+tO+kvq9 X-Gm-Gg: AeBDiesMfuqYElAcpuetK+9NBgCX/PblK4cBHhNyehdzHsnG22R3J6pTimvP39Ysk2J u3v4kc9v1nkmLSeN12zAaib9MNWhJS/OBCMZPI+2hcWRVqFt00kuDmDxmGYVRy4JvkaNasqR3cs layT/p8q49d5l+DVp1GYkoMXErCKDyffNJORosbbwvFYx7HAtGpECd83mJjLSkz8fyQilMd6p0D PfBPY9pZjllqPYEM6Z2yLrA6u0XOotr89s8eHBPaUR4kEInqB4mTlb/RGDpCAMpwKxvbm6j560R FcR6b9rTyrI/rPU5pY/f+4Ta+qe4wxgOsF3RykPuAE6bp6283hH1XAg9jq8z54QhWYIqdHvgiuM Ft5sZUoJzXgHDiDLpLltm6qjG9zLcpPgn4Cejl9c0uYyKDJSlAm26z6EhcgYDzGpCFb4a72jcTD Mr9vAfYPJ1GfKBg6LiotAk3NI= X-Received: by 2002:a05:6512:6d0:b0:5a2:b487:b945 with SMTP id 2adb3069b0e04-5a4172c67afmr809260e87.18.1776426166838; Fri, 17 Apr 2026 04:42:46 -0700 (PDT) Received: from xeon ([188.163.112.56]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-5a4185bc672sm338636e87.34.2026.04.17.04.42.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Apr 2026 04:42:46 -0700 (PDT) From: Svyatoslav Ryhel To: Lee Jones , Pavel Machek , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Sakari Ailus , Mauro Carvalho Chehab , Svyatoslav Ryhel Cc: linux-leds@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Subject: [PATCH v1 2/5] media: lm3560: Add IN supply support Date: Fri, 17 Apr 2026 14:42:23 +0300 Message-ID: <20260417114226.100033-3-clamor95@gmail.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260417114226.100033-1-clamor95@gmail.com> References: <20260417114226.100033-1-clamor95@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Add IN supply (2.5V - 5.5V) found in LM3560 to ensure its proper work. Signed-off-by: Svyatoslav Ryhel --- drivers/media/i2c/lm3560.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/media/i2c/lm3560.c b/drivers/media/i2c/lm3560.c index e6af61415821..a2674af6c9fb 100644 --- a/drivers/media/i2c/lm3560.c +++ b/drivers/media/i2c/lm3560.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include @@ -434,6 +435,11 @@ static int lm3560_probe(struct i2c_client *client) return dev_err_probe(&client->dev, PTR_ERR(flash->hwen_gpio), "failed to get hwen gpio\n"); =20 + rval =3D devm_regulator_get_enable(&client->dev, "vin"); + if (rval) + return dev_err_probe(&client->dev, rval, + "failed to enable regulator\n"); + rval =3D lm3560_subdev_init(flash, LM3560_LED0, "lm3560-led0"); if (rval < 0) return rval; --=20 2.51.0 From nobody Tue Jun 16 08:57:46 2026 Received: from mail-lf1-f46.google.com (mail-lf1-f46.google.com [209.85.167.46]) (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 1D138396D3D for ; Fri, 17 Apr 2026 11:42:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776426171; cv=none; b=IZtEYIlwm3ebmOu5T4JXLp3EsDmwIfDG2cVhJ3ZoeyHPkhiwImlfKmLAeGBVyGPqPBQ8u2GYIFn3HOYttMVlYuPUO+sAyq64ZthzlPQEQ5lQIs+hDkr0ar16Sa92+5TbHPrOPtvSAR+LxrES9KJZynBcOqMRBgpdbKhv/F+ML5I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776426171; c=relaxed/simple; bh=yufkXp8REa55nKKKY25mbUUOR8zHhW1MM+JCVxnj/xY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=EdZBJcRNriqckLNrVmEnvvvke+8YybjGS9fPYWvQ26dJMCIqC5nHeCdQvLynuYvhAkjPmKPxDeR3iDooCN8NAMGDaGOhYgVvjhRksGrPjGO6GavUYkgseZCoxEjRmfPVCbBjKYFtL7iAzPwEC2VjbLPPNMQWM42pgnxpfeTKgTQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=QL7va/kr; arc=none smtp.client-ip=209.85.167.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="QL7va/kr" Received: by mail-lf1-f46.google.com with SMTP id 2adb3069b0e04-5a3fcb2c718so452062e87.0 for ; Fri, 17 Apr 2026 04:42:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1776426168; x=1777030968; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=hquw2DNWZgZvIoiMcHg+A2Rmxt4zwGE02aJk3heXeoY=; b=QL7va/krtQNJk1DjGFC5lXHZBtn/jVXUB4eP0KicKoEyd6/KdFJuX1mFYA+P7PnWbH 0iH4b7W7FXqLkgID6w0iNKNYcUgxNbnE8eX26Z+xERVS1ZY54eo9GmPZRdxmOr6FneVV 33Ze0ON74xlX5mt2UCO99XU6oQBnvgzNtaRBiBUINBEIDoEiwGOvnCskHk16K82vfHqy jlOripN24y8ldhQEgdKr7hmeMHqB0ipXkQ3Y66tWSZU+ojJVObtSB+jbR/4uO09PK8Qa 17eHp7ryZLCP6ZGCJaA7eKGmoptcxUkmihxdEDFmmAP5nJHA4v+DWm3mrFPyKNQTj3Oe 2l9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776426168; x=1777030968; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=hquw2DNWZgZvIoiMcHg+A2Rmxt4zwGE02aJk3heXeoY=; b=LLJcWFjeUr08sPJ+MAUUK9F7CXG4QTttbrdXJ4Jg76zWW0ETYk1y3NqcfleD8MlKwy vMNEYO2yx6UWdTJQEx01rHF54b5vw4YJZDaoZkz/jN5dQEAGBBjDOIFFcQNTjQHZFaNZ vgyjzggPAReh48TiA2tQVeyDxdoKy+hb63DXd6s8M9xnalgbDF52u4hV6f/+xIL7Xtkk h9ltrOXb4UX3SXF08HxhAO7vJjXZN3fC2TKaPZ7uAIkqek5P5758yIPGgZDC3j1jUQx8 IuMtE1OoJOIFC7vAN2jaqrW7eyJsLpi2fkIl4Hw4m4fo2Nq4BGItMcTsgjfJrhiQhgtI H+RQ== X-Forwarded-Encrypted: i=1; AFNElJ+DTuadr8dN27nauS8uO7zsJpx3zX5ahhKXwbdMJmPuS9HABx7rOBrowWFSvqRoefMCfJIX49qc1195h3c=@vger.kernel.org X-Gm-Message-State: AOJu0YwDMPg85xtv2d7aBHBFdsjWAUe+/WkZEsZj6Vr85FQzmLF+hslf WVIu1NpdjydddLklvy/n/8Awk4g/a0huHQ7zS0FTJrrR2mK5bjzMfIgf X-Gm-Gg: AeBDies0+BdKPHuTnsxLVhYuqoWUV23GxREui6ke1a5qkHxNU8BNkuv/ZiHXy+SEwAX 6nDFgTODxAxRCWJiyIZa2lX01mKQinju/03TIvK//IykytDoJTwwDO+ZtJyWPweI9UAI+IHTMlV UFkxfDZyT+4TsDA1lVMw7jqa3b0OtSvtsjx5J/6CkWmPKkmR6tEYljtd5vQjx7SGfEblE38mi51 Fo2+VnYrAFX6Bykdn1k4l7Dt0ZrCNEF1iFPVlTHkgqkOWaUiQNvAcDwifdg+um6abz1VPIY+AEo nUtW/62Uce+DRpmht7cHBhliua1GcdxijqLem5ikTqEb2c2Pka3vPJKinwHxcw8olh1jHfFReZ6 rnnuKLqye8wv1RsHtpk0H5AfVLA0x5+X+F59U0vLnk+stowwvv2/xawFfKnULSwL+HV7R9PPDP9 obZz5nzHRHHSBFDdrSOUBBW1yEAzumHUJJPw== X-Received: by 2002:a05:6512:108d:b0:5a3:ffc0:7882 with SMTP id 2adb3069b0e04-5a4172fc0b6mr706909e87.45.1776426168032; Fri, 17 Apr 2026 04:42:48 -0700 (PDT) Received: from xeon ([188.163.112.56]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-5a4185bc672sm338636e87.34.2026.04.17.04.42.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Apr 2026 04:42:47 -0700 (PDT) From: Svyatoslav Ryhel To: Lee Jones , Pavel Machek , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Sakari Ailus , Mauro Carvalho Chehab , Svyatoslav Ryhel Cc: linux-leds@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Subject: [PATCH v1 3/5] media: lm3560: Fix v4l2 subdev registration Date: Fri, 17 Apr 2026 14:42:24 +0300 Message-ID: <20260417114226.100033-4-clamor95@gmail.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260417114226.100033-1-clamor95@gmail.com> References: <20260417114226.100033-1-clamor95@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The existing driver does not call media subdev registration, making it invisible to the media framework. Since the LM3560 supports two independent LEDs, register each LED as a separate media entity. Signed-off-by: Svyatoslav Ryhel --- drivers/media/i2c/lm3560.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/media/i2c/lm3560.c b/drivers/media/i2c/lm3560.c index a2674af6c9fb..bee1681a1603 100644 --- a/drivers/media/i2c/lm3560.c +++ b/drivers/media/i2c/lm3560.c @@ -368,10 +368,16 @@ static int lm3560_subdev_init(struct lm3560_flash *fl= ash, goto err_out; flash->subdev_led[led_no].entity.function =3D MEDIA_ENT_F_FLASH; =20 + rval =3D v4l2_async_register_subdev(&flash->subdev_led[led_no]); + if (rval < 0) + goto err_out; + return rval; =20 err_out: v4l2_ctrl_handler_free(&flash->ctrls_led[led_no]); + media_entity_cleanup(&flash->subdev_led[led_no].entity); + return rval; } =20 --=20 2.51.0 From nobody Tue Jun 16 08:57:46 2026 Received: from mail-lj1-f174.google.com (mail-lj1-f174.google.com [209.85.208.174]) (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 20C883AEF23 for ; Fri, 17 Apr 2026 11:42:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.174 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776426172; cv=none; b=fKH9eeiIr++csrZ/CrN5Ms7ge4cyNKRKMWtStW4h+j0BBYBxsLzBuuG0hK9YbkN2dbITWM29/1EAd47x6QbgVFBRC61Fy78OKIxnofpM1+8Ilm68S9wCfwOVxIuKvs+Y2Eix2IHx9n180o7K5QQw4C8bcypNl13r+JZHvDUrbZk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776426172; c=relaxed/simple; bh=VpCpaSO1ucraQ3B7/VvBud97a5nA6kkSmvpdAqJ6roQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=K7mE75vt5Q8uLLaTDAGFTIiGkxftPsKNM+87RhJAMb5/W4DCUNQrDOVUfewlmwlO+BHRm8Ys55yb3kx6i/vxx8lMD1atZ1aQazc81eXOdwoAym+oXABOKE8hqm3Stz3/bAYm55z3AL/qYXs7aZMk9BtOzSQagB/xAs0i3diCIjI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=i8zxzGTl; arc=none smtp.client-ip=209.85.208.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="i8zxzGTl" Received: by mail-lj1-f174.google.com with SMTP id 38308e7fff4ca-38e7d983f50so6353931fa.1 for ; Fri, 17 Apr 2026 04:42:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1776426169; x=1777030969; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=CJb8co/czgyX/XI8FbsewLawUh1VhpEwCHFYYh7bdCk=; b=i8zxzGTlZc8N85l/9gh4eUnMKha+1REcPGKj9NO+ML0Wk8cwRilJmb01G8sJrjQ/Jh iO1ZWZzKMZYXb1KJiZcHQWwt8FqREC88McshsX4AtmuwyMUDePV3zdlPGFGyTZviruco N4l/piXDd720NOn9tt4xoLyXZcH8XAiOQGGQ/UCj1KOKHKcE4XvUF4ndTpBWX+fYm9q0 Qe1D63u8+sfKb05jaQ2RqX5o3ez8dOSJDwzNc6oR6sM7/DgHHCsfxq6Mx6dYKn9s9wG7 DaQLnizQ+lFaE3etYLAd159vdkGtCZoRLpKiosapOoaD/usVuY0nQfkI9sUuVO5LQvos Rm4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776426169; x=1777030969; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=CJb8co/czgyX/XI8FbsewLawUh1VhpEwCHFYYh7bdCk=; b=cuk/s6vn3IfB8k/wv0JhaQA2NOGTsJFKCN4L3H7nD6SrpRPTvFHvV28XlnHmxzBoS+ CZaNBt2IL5XwLT6iYmGAarsmD0nO6g45hT4j8T+PKld420QTP159JHlKr8jEYzGIwo+f Kxjqs/nwXVqwf2WITCSSany9+9Z+KE6uDIROedhJOltS6SV2FJdHDdoO+0Q3CoKvbWjr nKwhhSqjocAgunAJpmSc0DLQsTQjII2e+H0QQbd742DzPvPxDkMJZafEQkvGdy7P4hfL v2DVqBbOYka8S8rSq3BxFQ0nKh5WGVdDwve7+hGz1PjgFbUBTR1syWT40JlLRRp5oe2v aVFQ== X-Forwarded-Encrypted: i=1; AFNElJ+7iG5uxw9daZ+xswFK1DLdnndtQz6tqXcQzWz52/gAlmeslhGcu+4k5ZIKf93khYwaW7VT2+xEXkY37cM=@vger.kernel.org X-Gm-Message-State: AOJu0YxPtKxEKZO4uR925Ii+O6s1eVblVuV1K2SLTQgD/BXb7hJnI3M2 bIykMHYd4K8VBfhwmPJkONcYe1RP9MAA7Jhe9HKfL8zgFI8OJpMQkXN9OrGTiYCs X-Gm-Gg: AeBDieuZJzrNApo/m/wlGHsN8Tmuic+O0mzOZyxJ42l9MFxGynF8wmlasGqG2xVWXAO Lp6vkcAkBKUpp8/lfeRwo9u+OtQJObSTju/HMgCOSm4pxSt7hjvU1aat7/nPhLYbrB0J1HK8Xdx g0isYM+FpZqiVarz96HIkbUlMqy3f27kXVzZSEz8trpoji25BGbj2RXPaOVRN/D5jOyJxUSJk7A f0LQmWKbKqWOfpCwBLB0vcoxIw3AWqam4VTL7SxQfaycJzOhHPo0XTZYjQNglPuHrlfFcn8ux6G bOyGCYqw/I14MasbENK4wRmsNBrD7Y3SysOyHJOpKXhNIpW29AHw49IHkLOdfaixa+ZrMTMjMNg WDYhGbYuubPretefS2LK95DwDe7I+bkhHL1lS3Mbq1vHf0u9gqI6fMaLTVjtfmaH27itNWgmN4z OfhoM/2QVAv5HF0aW8ICHqOsA= X-Received: by 2002:a05:6512:a90:b0:5a4:d4:5c5e with SMTP id 2adb3069b0e04-5a4172dc775mr697994e87.22.1776426169121; Fri, 17 Apr 2026 04:42:49 -0700 (PDT) Received: from xeon ([188.163.112.56]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-5a4185bc672sm338636e87.34.2026.04.17.04.42.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Apr 2026 04:42:48 -0700 (PDT) From: Svyatoslav Ryhel To: Lee Jones , Pavel Machek , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Sakari Ailus , Mauro Carvalho Chehab , Svyatoslav Ryhel Cc: linux-leds@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Subject: [PATCH v1 4/5] media: lm3560: convert to use OF bindings Date: Fri, 17 Apr 2026 14:42:25 +0300 Message-ID: <20260417114226.100033-5-clamor95@gmail.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260417114226.100033-1-clamor95@gmail.com> References: <20260417114226.100033-1-clamor95@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Since there are no users of this driver via platform data, remove platform data and switch to using device tree bindings. Signed-off-by: Svyatoslav Ryhel --- drivers/media/i2c/lm3560.c | 118 +++++++++++++++++++++++++++---------- include/media/i2c/lm3560.h | 15 ----- 2 files changed, 87 insertions(+), 46 deletions(-) diff --git a/drivers/media/i2c/lm3560.c b/drivers/media/i2c/lm3560.c index bee1681a1603..dab2da87331d 100644 --- a/drivers/media/i2c/lm3560.c +++ b/drivers/media/i2c/lm3560.c @@ -14,7 +14,9 @@ #include #include #include +#include #include +#include #include #include #include @@ -45,17 +47,19 @@ enum led_enable { * struct lm3560_flash * * @dev: pointer to &struct device - * @pdata: platform data * @regmap: reg. map for i2c * @hwen_gpio: line connected to hwen pin * @lock: muxtex for serial access. * @led_mode: V4L2 LED mode * @ctrls_led: V4L2 controls * @subdev_led: V4L2 subdev + * @peak: peak current + * @max_flash_timeout: flash timeout + * @max_flash_brt: flash mode led brightness + * @max_torch_brt: torch mode led brightness */ struct lm3560_flash { struct device *dev; - struct lm3560_platform_data *pdata; struct regmap *regmap; struct gpio_desc *hwen_gpio; struct mutex lock; @@ -63,6 +67,12 @@ struct lm3560_flash { enum v4l2_flash_led_mode led_mode; struct v4l2_ctrl_handler ctrls_led[LM3560_LED_MAX]; struct v4l2_subdev subdev_led[LM3560_LED_MAX]; + + enum lm3560_peak_current peak; + u32 max_flash_timeout; + + u32 max_flash_brt[LM3560_LED_MAX]; + u32 max_torch_brt[LM3560_LED_MAX]; }; =20 #define to_lm3560_flash(_ctrl, _no) \ @@ -283,8 +293,8 @@ static int lm3560_init_controls(struct lm3560_flash *fl= ash, enum lm3560_led_id led_no) { struct v4l2_ctrl *fault; - u32 max_flash_brt =3D flash->pdata->max_flash_brt[led_no]; - u32 max_torch_brt =3D flash->pdata->max_torch_brt[led_no]; + u32 max_flash_brt =3D flash->max_flash_brt[led_no]; + u32 max_torch_brt =3D flash->max_torch_brt[led_no]; struct v4l2_ctrl_handler *hdl =3D &flash->ctrls_led[led_no]; const struct v4l2_ctrl_ops *ops =3D &lm3560_led_ctrl_ops[led_no]; =20 @@ -309,9 +319,9 @@ static int lm3560_init_controls(struct lm3560_flash *fl= ash, /* flash strobe timeout */ v4l2_ctrl_new_std(hdl, ops, V4L2_CID_FLASH_TIMEOUT, LM3560_FLASH_TOUT_MIN, - flash->pdata->max_flash_timeout, + flash->max_flash_timeout, LM3560_FLASH_TOUT_STEP, - flash->pdata->max_flash_timeout); + flash->max_flash_timeout); =20 /* flash brt */ v4l2_ctrl_new_std(hdl, ops, V4L2_CID_FLASH_INTENSITY, @@ -351,15 +361,17 @@ static const struct regmap_config lm3560_regmap =3D { }; =20 static int lm3560_subdev_init(struct lm3560_flash *flash, - enum lm3560_led_id led_no, char *led_name) + enum lm3560_led_id led_no, + struct fwnode_handle *fwnode) { struct i2c_client *client =3D to_i2c_client(flash->dev); int rval; =20 v4l2_i2c_subdev_init(&flash->subdev_led[led_no], client, &lm3560_ops); flash->subdev_led[led_no].flags |=3D V4L2_SUBDEV_FL_HAS_DEVNODE; - strscpy(flash->subdev_led[led_no].name, led_name, - sizeof(flash->subdev_led[led_no].name)); + snprintf(flash->subdev_led[led_no].name, + sizeof(flash->subdev_led[led_no].name), + "lm3560-led%d", led_no); rval =3D lm3560_init_controls(flash, led_no); if (rval) goto err_out; @@ -367,6 +379,7 @@ static int lm3560_subdev_init(struct lm3560_flash *flas= h, if (rval < 0) goto err_out; flash->subdev_led[led_no].entity.function =3D MEDIA_ENT_F_FLASH; + flash->subdev_led[led_no].fwnode =3D fwnode; =20 rval =3D v4l2_async_register_subdev(&flash->subdev_led[led_no]); if (rval < 0) @@ -388,7 +401,7 @@ static int lm3560_init_device(struct lm3560_flash *flas= h) =20 /* set peak current */ rval =3D regmap_update_bits(flash->regmap, - REG_FLASH_TOUT, 0x60, flash->pdata->peak); + REG_FLASH_TOUT, 0x60, flash->peak); if (rval < 0) return rval; /* output disable */ @@ -401,10 +414,64 @@ static int lm3560_init_device(struct lm3560_flash *fl= ash) return rval; } =20 +static int lm3560_of_probe(struct lm3560_flash *flash) +{ + struct fwnode_handle *node; + u32 peak_ua; + int rval, reg; + + flash->peak =3D LM3560_PEAK_3600mA; + rval =3D device_property_read_u32(flash->dev, + "ti,peak-current-microamp", &peak_ua); + if (!rval) { + switch (peak_ua) { + case 16000000: + flash->peak =3D LM3560_PEAK_1600mA; + break; + case 23000000: + flash->peak =3D LM3560_PEAK_2300mA; + break; + case 30000000: + flash->peak =3D LM3560_PEAK_3000mA; + break; + case 36000000: + flash->peak =3D LM3560_PEAK_3600mA; + break; + default: + return -EINVAL; + } + } + + flash->max_flash_timeout =3D LM3560_FLASH_TOUT_MAX; + device_property_read_u32(flash->dev, "ti,max-flash-timeout-ms", + &flash->max_flash_timeout); + + device_for_each_child_node(flash->dev, node) { + fwnode_property_read_u32(node, "reg", ®); + + if (reg =3D=3D LM3560_LED0 || reg =3D=3D LM3560_LED1) { + flash->max_flash_brt[reg] =3D LM3560_FLASH_BRT_MAX; + fwnode_property_read_u32(node, "ti,max-flash-current-microamp", + &flash->max_flash_brt[reg]); + + flash->max_torch_brt[reg] =3D LM3560_TORCH_BRT_MAX; + fwnode_property_read_u32(node, "ti,max-torch-current-microamp", + &flash->max_torch_brt[reg]); + + rval =3D lm3560_subdev_init(flash, reg, node); + if (rval < 0) + return dev_err_probe(flash->dev, rval, + "failed to register led%d\n", + reg); + } + } + + return 0; +} + static int lm3560_probe(struct i2c_client *client) { struct lm3560_flash *flash; - struct lm3560_platform_data *pdata =3D dev_get_platdata(&client->dev); int rval; =20 flash =3D devm_kzalloc(&client->dev, sizeof(*flash), GFP_KERNEL); @@ -417,21 +484,6 @@ static int lm3560_probe(struct i2c_client *client) return rval; } =20 - /* if there is no platform data, use chip default value */ - if (pdata =3D=3D NULL) { - pdata =3D devm_kzalloc(&client->dev, sizeof(*pdata), GFP_KERNEL); - if (pdata =3D=3D NULL) - return -ENODEV; - pdata->peak =3D LM3560_PEAK_3600mA; - pdata->max_flash_timeout =3D LM3560_FLASH_TOUT_MAX; - /* led 1 */ - pdata->max_flash_brt[LM3560_LED0] =3D LM3560_FLASH_BRT_MAX; - pdata->max_torch_brt[LM3560_LED0] =3D LM3560_TORCH_BRT_MAX; - /* led 2 */ - pdata->max_flash_brt[LM3560_LED1] =3D LM3560_FLASH_BRT_MAX; - pdata->max_torch_brt[LM3560_LED1] =3D LM3560_TORCH_BRT_MAX; - } - flash->pdata =3D pdata; flash->dev =3D &client->dev; mutex_init(&flash->lock); =20 @@ -446,11 +498,7 @@ static int lm3560_probe(struct i2c_client *client) return dev_err_probe(&client->dev, rval, "failed to enable regulator\n"); =20 - rval =3D lm3560_subdev_init(flash, LM3560_LED0, "lm3560-led0"); - if (rval < 0) - return rval; - - rval =3D lm3560_subdev_init(flash, LM3560_LED1, "lm3560-led1"); + rval =3D lm3560_of_probe(flash); if (rval < 0) return rval; =20 @@ -477,6 +525,13 @@ static void lm3560_remove(struct i2c_client *client) gpiod_set_value_cansleep(flash->hwen_gpio, 0); } =20 +static const struct of_device_id lm3560_of_match[] =3D { + { .compatible =3D "ti,lm3559" }, + { .compatible =3D "ti,lm3560" }, + { } +}; +MODULE_DEVICE_TABLE(of, lm3560_of_match); + static const struct i2c_device_id lm3560_id_table[] =3D { { LM3559_NAME }, { LM3560_NAME }, @@ -489,6 +544,7 @@ static struct i2c_driver lm3560_i2c_driver =3D { .driver =3D { .name =3D LM3560_NAME, .pm =3D NULL, + .of_match_table =3D lm3560_of_match, }, .probe =3D lm3560_probe, .remove =3D lm3560_remove, diff --git a/include/media/i2c/lm3560.h b/include/media/i2c/lm3560.h index 770d8c72c94a..b56c1ff8fd49 100644 --- a/include/media/i2c/lm3560.h +++ b/include/media/i2c/lm3560.h @@ -66,19 +66,4 @@ enum lm3560_peak_current { LM3560_PEAK_3600mA =3D 0x60 }; =20 -/* struct lm3560_platform_data - * - * @peak : peak current - * @max_flash_timeout: flash timeout - * @max_flash_brt: flash mode led brightness - * @max_torch_brt: torch mode led brightness - */ -struct lm3560_platform_data { - enum lm3560_peak_current peak; - - u32 max_flash_timeout; - u32 max_flash_brt[LM3560_LED_MAX]; - u32 max_torch_brt[LM3560_LED_MAX]; -}; - #endif /* __LM3560_H__ */ --=20 2.51.0 From nobody Tue Jun 16 08:57:46 2026 Received: from mail-lf1-f53.google.com (mail-lf1-f53.google.com [209.85.167.53]) (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 1A0443B47C1 for ; Fri, 17 Apr 2026 11:42:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776426173; cv=none; b=HmK3kTQYXMnHVKm1l46io2/s68HEtK2iBfdjzmxF/kTHFCIDwA36XDMcq2ByquY+5c4WHU7R6aY9IbBLE3f60XgA4OBUtx1kDr2l87oKcvPnE9JETC9rG/nyZSoAO2IISWmITIKJ/hdZiIrZDEAGkzM+bmeY3IxvmfQX/1XavvM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776426173; c=relaxed/simple; bh=MCepgpMAhExukEmT5X29jn6zLNNcYRcxCnOQNum1NMc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=XIfazunnEolUcXKF6k+engMkacZ/pp0tJ/oPgzuD6M5UMZYt1KJNKoCNVJ+2ZiMe1hWeC9kRbqaM6rpW/2gLw817zZmmZpHEJhaaG8QQ+NZ0XqPxhVYtMnvYOCUlYIjR965jmckj/9qv4c1ZUjbz6MZf9m8PVhQAB7SG7J+a7u4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=kIV9QktI; arc=none smtp.client-ip=209.85.167.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="kIV9QktI" Received: by mail-lf1-f53.google.com with SMTP id 2adb3069b0e04-5a2c77c62d7so679322e87.0 for ; Fri, 17 Apr 2026 04:42:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1776426170; x=1777030970; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=qYCK/+hjnviLjF2LQlcAfHWbh1kfWS18YZTqZGyrqQ8=; b=kIV9QktIMGOGBpBcLF3XkM4Kdcp7uizraT/9PZ7rRvp8h074lt9dJJOzPTtVfeq8Rs coxCJGuhvnhQx3TWM4fTsyI2dRH7wtRroyxI93xk9xH+XxpmXLuceBtgSL8CNiA+Re1Q Lhp3IuIIQwk6H7VLQo4IIPG9pWtLSbE2ui998W9PFlYE8byBAE4a1B+xCgsv2xFKRZ67 /4iKxTz6nnTZ6E47E//H5D6rNY+afYqb3L58E3c3hycMKNLVdDa3lTssVHWlxSb8Nh4e TRhDCcKCq7AKEMq1XDz24UsoljmJToGDJPIYalR65zcfh9EYCcimiVYtj11b7DCV1KI7 9eRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776426170; x=1777030970; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=qYCK/+hjnviLjF2LQlcAfHWbh1kfWS18YZTqZGyrqQ8=; b=LKjeUDoLsKOuBHRk1Wu6UyaOheUeQsKdRbA33DeD7bpRJyUoi3H2Tapjy2P1O67wA0 M63mZ2LI5ZeuRilNcGhXaOOvgBLst31pUP7QsEd1qqWA1pdX0cbcJacze1w6Gr2EDvmW bZ79H0QGFTolrfBZjK7sQIPSoO4Q+230zMrLTrQcDvLZ7qMIncTHxSpEadGTfdSchLIV oPfKs9cqaNgtYuMx0IrtIQKt0hRO4Z6ZyXbpM3xONhy/h5a38pmWJ/OgeldBd5VxOX33 PxqIWEsO/U7fwUlPpgq8qQu+s6q+VrgWrIPhmHurpRFeX4rNJ4hGPebSNCKV9ExoydEi L0JA== X-Forwarded-Encrypted: i=1; AFNElJ/m5ZYSgzGut8Nj3kDAFepyOFurUwy0dnh096Z9e1tSw+xNzuj3UiwJUwX/vxc4YVwG9rIJOxKkYNze1yQ=@vger.kernel.org X-Gm-Message-State: AOJu0YxA5ap6HFBxYK0mCD8g7bC8uhW093ZomdTP87t5gj3wYkvCATtu 7EPEHuaKr1oK8IqyCS97uqSHnHnq/spgbBzR1s6gevvise7SNPHtYO2j X-Gm-Gg: AeBDietIxsM2e0zrjQlhgoQJeEHex+DfuJyZk4Gv9+9F9DhZ9lTQf858iJnw2DHX0Jx t1avvtSPJohQsin3d/XT8abWnSE9y4eAKulo4bTQZfql6RMe0LeoAtAP/6dyTYhJNGVvegybhlv iYv/r4eg89qrvEa0BP2m7dw4RkwSIia/Caoi5LWZdrw5kqXSGnCV5+Z3M7pzHp4SizN1QeqHgiI tX0eiUqqCBuBUo62D1Wl9pMZLPgN8HniFg4D3u/BsfFzxGthhx1hBMRUs5jYPfs0l+p3k19kTrv Ezp0CLlPFpS9OkeYhEjkhUBXKT5ugAE2tZv8rgLdxaqZuLg8ZLUYfr1V0ZTgMoRIzUDq/fUHNN5 xuW99aiiXwmQcihckGZvBkRQQHgi8CotwgRq1TAW7haP2vbw+9n1v7vmdXHtDdrY1UXHPokVaZ3 BNNtUZLw32AfepHz4DEzbBjoI= X-Received: by 2002:a05:6512:114c:b0:5a1:3bfd:b87b with SMTP id 2adb3069b0e04-5a4172dd85emr780824e87.30.1776426170136; Fri, 17 Apr 2026 04:42:50 -0700 (PDT) Received: from xeon ([188.163.112.56]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-5a4185bc672sm338636e87.34.2026.04.17.04.42.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Apr 2026 04:42:49 -0700 (PDT) From: Svyatoslav Ryhel To: Lee Jones , Pavel Machek , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Sakari Ailus , Mauro Carvalho Chehab , Svyatoslav Ryhel Cc: linux-leds@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Subject: [PATCH v1 5/5] dt-bindings: leds: Document TI LM3560 Synchronous Boost Flash Driver Date: Fri, 17 Apr 2026 14:42:26 +0300 Message-ID: <20260417114226.100033-6-clamor95@gmail.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260417114226.100033-1-clamor95@gmail.com> References: <20260417114226.100033-1-clamor95@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Document TI LM3560 Synchronous Boost Flash Driver used for camera flash LEDs. Signed-off-by: Svyatoslav Ryhel --- .../devicetree/bindings/leds/ti,lm3560.yaml | 134 ++++++++++++++++++ 1 file changed, 134 insertions(+) create mode 100644 Documentation/devicetree/bindings/leds/ti,lm3560.yaml diff --git a/Documentation/devicetree/bindings/leds/ti,lm3560.yaml b/Docume= ntation/devicetree/bindings/leds/ti,lm3560.yaml new file mode 100644 index 000000000000..460ea1fbc1e5 --- /dev/null +++ b/Documentation/devicetree/bindings/leds/ti,lm3560.yaml @@ -0,0 +1,134 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/leds/ti,lm3560.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: TI LM3560 Synchronous Boost Flash Driver + +maintainers: + - Svyatoslav Ryhel + +description: + The LM3560 is a 2-MHz fixed frequency synchronous boost converter with t= wo + 1000-mA constant current drivers for high-current white LEDs. The dual h= igh- + side current sources allow for grounded cathode LED operation and can be + tied together for providing flash currents at up to 2 A through a single= LED. + An adaptive regulation method ensures the current for each LED remains in + regulation and maximizes efficiency. + +properties: + compatible: + enum: + - ti,lm3559 + - ti,lm3560 + + reg: + maxItems: 1 + + '#address-cells': + const: 1 + + '#size-cells': + const: 0 + + enable-gpios: + description: GPIO connected to the HWEN pin. + maxItems: 1 + + vin-supply: + description: Supply connected to the IN line. + + ti,peak-current-microamp: + description: + The LM3560 features 4 selectable current limits 1.6A, 2.3A, 3A, and = 3.6A. + When the current limit is reached, the LM3560 stops switching for the + remainder of the switching cycle. + enum: [16000000, 23000000, 30000000, 36000000] + default: 36000000 + + ti,max-flash-timeout-ms: + description: + Maximum flash timeout in ms with step 32ms. + minimum: 32 + maximum: 1024 + default: 1024 + +patternProperties: + '^led@[01]$': + description: LED control bank nodes. + $ref: /schemas/leds/common.yaml# + unevaluatedProperties: false + + properties: + reg: + description: Control bank selection (0 =3D bank A, 1 =3D bank B). + maximum: 1 + + ti,max-flash-current-microamp: + description: + Maximum flash current in uA with step 62500uA. + minimum: 62500 + maximum: 1000000 + default: 1000000 + + ti,max-torch-current-microamp: + description: + Maximum flash current in uA with step 31250uA. + minimum: 31250 + maximum: 250000 + default: 250000 + + required: + - reg + +required: + - compatible + - reg + - '#address-cells' + - '#size-cells' + +additionalProperties: false + +examples: + - | + #include + + i2c { + #address-cells =3D <1>; + #size-cells =3D <0>; + + led-controller@53 { + compatible =3D "ti,lm3560"; + reg =3D <0x53>; + + enable-gpios =3D <&gpio 28 GPIO_ACTIVE_HIGH>; + vin-supply =3D <&vdd_3v3_sys>; + + ti,peak-current-microamp =3D <16000000>; + ti,max-flash-timeout-ms =3D <1024>; + + #address-cells =3D <1>; + #size-cells =3D <0>; + + led@0 { + reg =3D <0>; + + label =3D "white::flash"; + linux,default-trigger =3D "flash"; + + ti,max-flash-current-microamp =3D <562500>; + ti,max-torch-current-microamp =3D <156250>; + }; + + led@1 { + reg =3D <1>; + + label =3D "yellow::flash"; + linux,default-trigger =3D "flash"; + + ti,max-flash-current-microamp =3D <562500>; + ti,max-torch-current-microamp =3D <156250>; + }; + }; + }; --=20 2.51.0