Received: by 2002:a89:413:0:b0:1fd:dba5:e537 with SMTP id m19csp198783lqs; Thu, 13 Jun 2024 07:49:56 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVHayehWLJbW4V9ZAZCz6BY+/+nZIMAMs4ykCne0MeaM3tZC7QfgHXFCi8TU/FhJJtm4Haa+FAOTmdlEHmZfUgS6hwVVmoKkgG0LuTHKg== X-Google-Smtp-Source: AGHT+IHk0C+3+rxuBsK73jhHU8knKcaiDD37+a1Bv1d/iH8zI7HblM/N2pyBjOUZ3DqTPZyP0weM X-Received: by 2002:a05:6e02:1a21:b0:375:cc11:5b16 with SMTP id e9e14a558f8ab-375cd03a808mr53789345ab.4.1718290196692; Thu, 13 Jun 2024 07:49:56 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718290196; cv=pass; d=google.com; s=arc-20160816; b=B92fFUg8zkBYrM1M2Q0UBq09EHK7mn7j9dMsSF8+V7xiCg+hIZ/CAyJF7zm04tajIg WU987/nCrR0CPh+z4TEaXqjSx3K7p5NkZSgIYHot8Mc2g8CfaJiqS91utoy0YKovbmZu DkFUvt7dyfW91Fwsc6td4KHrq88D4s85RtRjMhxXP9+n3MQ9JspK8rnu5xUekIYS1pAQ kQTGcvmSzOMptN14YuAgUskSgfUlFild93tQ9WDvSKXtGPpqEonwapa5wELIQ/QGaxvP bDF08LjvsyPye+1kwgRzt1xcMRKP8Pl7UH2Qw74CriwsbzjsANL0CjFduRfR9G4iXL/K vcyQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:from :dkim-signature; bh=EqalT0GdaS2fmuavch47XlThuqGeFkUvGjhZuMLegAU=; fh=XLi9m/0X8PjVhIWQEAZtk+9KXM176oIARH6s/tAj4ok=; b=GYfQcPWsvVKPVWFgr5TwQqqt7wsU6lZZK2ftFdq9JjhUXr8QKGhC+IyVVc6Wlo9Idx wbeIAc8PZKGSm4fifI4492tVpgpFBdiqldZuTjePadXbimAXGgyjyIUgC0qZfQqYs54F MX8pQcRWT/8gXYKZfa+8Do+HxA1jxlZgdv+J9hV7WAoMI91x//OHZoyPPeAgmkvNuP2P XiHLX6WoYAExMB0z9egKTiB8m/KO4z1fRH2bd1VBod8bubgMbu3Jn6Cwpz/jAdsHf2Md MlOOKmMQd2KYxMdevycnh1+WLZJyLH/oXbF10swp2CCw42KR/VWaBw/YR9m8Zwcpbwwu gUYA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@weissschuh.net header.s=mail header.b=V6ueiE8Z; arc=pass (i=1 spf=pass spfdomain=weissschuh.net dkim=pass dkdomain=weissschuh.net dmarc=pass fromdomain=weissschuh.net); spf=pass (google.com: domain of linux-kernel+bounces-213461-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-213461-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=weissschuh.net Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id 41be03b00d2f7-6fee4afff7esi1425594a12.605.2024.06.13.07.49.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Jun 2024 07:49:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-213461-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@weissschuh.net header.s=mail header.b=V6ueiE8Z; arc=pass (i=1 spf=pass spfdomain=weissschuh.net dkim=pass dkdomain=weissschuh.net dmarc=pass fromdomain=weissschuh.net); spf=pass (google.com: domain of linux-kernel+bounces-213461-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-213461-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=weissschuh.net 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 4D1CC28561E for ; Thu, 13 Jun 2024 14:49:12 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E35D6146A74; Thu, 13 Jun 2024 14:48:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b="V6ueiE8Z" Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) (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 1FB50139CFE; Thu, 13 Jun 2024 14:48:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=159.69.126.157 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718290130; cv=none; b=gozpOzTbGHz3u/elN1zJ61tX8CdubzFfEa1d8LeN6M2fxMeS8D9akP8a1ACQAjYAnIL/rW1IC8Ud59lv3wJ68rwaJeQibQsh/D8ha/j+dnIlIrSRXnjTJDXhTcuwPGSPxh5CI+rEJVOTCZrfuyKUCCOZ42L3WfyCZEamU1SKRis= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718290130; c=relaxed/simple; bh=vj3/g8xi/rqsVBNNGGFadxLIBohU3ZNx5pprWK/Fs70=; h=From:Subject:Date:Message-Id:MIME-Version:Content-Type:To:Cc; b=mYiTykbJhn+ZiG7oHoBAQpRpATW87EINqi+tb/a1ncr6u4FCSUK+0/7oWBCyBqDAO7ElztOjtvRl4+VhE5QtCVYGoHLpzzs9/cTpajnemE/RhjUvFrahuVq0YcAYqF/pXLKv021SeVcI0WZgIlhzu6p0yythd+P2FyU0u3OQQNo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=weissschuh.net; spf=pass smtp.mailfrom=weissschuh.net; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b=V6ueiE8Z; arc=none smtp.client-ip=159.69.126.157 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=weissschuh.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1718290120; bh=vj3/g8xi/rqsVBNNGGFadxLIBohU3ZNx5pprWK/Fs70=; h=From:Subject:Date:To:Cc:From; b=V6ueiE8ZnYjEcsZDV//CL73SC7OXpdUlk+xQ2PVw6lC7dvp5jt7po+hOPdYSOTCpQ lP+4qsahJtPDNG4aQzXXnkZJCCYgYT4ashJgFHcqKXiZzvgpytmgzSm3Tz32gKzOQb DRmRVZ/M8sWXwnqDbnq4sO5ydynTOzuH7UzXPhYg= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Subject: [PATCH v3 0/5] ChromeOS Embedded Controller LED driver Date: Thu, 13 Jun 2024 16:48:35 +0200 Message-Id: <20240613-cros_ec-led-v3-0-500b50f41e0f@weissschuh.net> 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: 8bit X-B4-Tracking: v=1; b=H4sIAMMGa2YC/2XN3QqCQBCG4VuRPW5j/xTtqPuICBvHdiBUdmwrx HtvlQ6SDt8P5plJMAZCFodsEgEjMfVdCrvLBPi6u6GkJrUwyjiV60pC6PmCIO/YSIttbRzaqtI o0sUQsKXXqp3OqT3x2If3ike9rF/HqI0TtVTSqaJsIYf0pT4+kZgZ/MPvOxzFgkXzA1i9BUwCC gDrnCqvTjV/wDzPHz+ZYx/sAAAA To: Pavel Machek , Lee Jones , =?utf-8?q?Thomas_Wei=C3=9Fschuh?= , Benson Leung , Guenter Roeck , Tzung-Bi Shih Cc: linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org, chrome-platform@lists.linux.dev, Dustin Howett , Mario Limonciello , =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1718290119; l=2145; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=vj3/g8xi/rqsVBNNGGFadxLIBohU3ZNx5pprWK/Fs70=; b=JZaCj+2EKSUjqtG09d0GNhSypb4H14/noMrvE7EiLXUeUzYjRkV4dGQ5xp5WfM8fZqtLsK8mS RgosXfYio7cCz+JgiSZJk53itTMlWgOf47EH+kN/zrzMbomRIBInS5k X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= Add a LED driver that supports the LED devices exposed by the ChromeOS Embedded Controller. Patch 1-3 add a utility function to the led subsystem. Patch 4 introduces the actual driver. Patch 5 registers the driver through the cros_ec mfd devices. Currently the driver introduces some non-standard LED functions. (See "cros_ec_led_functions") Tested on a Framework 13 AMD, Firmware 3.05. Signed-off-by: Thomas Weißschuh --- Changes in v3: - Set default_trigger explicitly as the LED core doesn't do this anymore - Only set intensity for first subled by default - Link to v2: https://lore.kernel.org/r/20240531-cros_ec-led-v2-0-6cc34408b40d@weissschuh.net Changes in v2: - Cosmetic cleanups (Tzung-Bi) - Add trailing comma to MFD cell array - Rename LEDs and trigger to "chromeos" prefix, to align with kbd backlight driver - Don't use type "rgb" anymore, they are only "multicolor" - Align commit messages and subject to subsystem standards (Lee) - Rename led_color_name() to led_get_color_name() - The same for cros_ec_led_color_name() - Link to v1: https://lore.kernel.org/r/20240520-cros_ec-led-v1-0-4068fc5c051a@weissschuh.net --- Thomas Weißschuh (5): leds: core: Introduce led_get_color_name() function leds: multicolor: Use led_get_color_name() function leds: core: Unexport led_colors[] array leds: Add ChromeOS EC driver mfd: cros_ec: Register LED subdevice MAINTAINERS | 5 + drivers/leds/Kconfig | 15 ++ drivers/leds/Makefile | 1 + drivers/leds/led-class-multicolor.c | 2 +- drivers/leds/led-core.c | 12 +- drivers/leds/leds-cros_ec.c | 299 ++++++++++++++++++++++++++++++++++++ drivers/leds/leds.h | 1 - drivers/mfd/cros_ec_dev.c | 9 ++ include/linux/leds.h | 10 ++ 9 files changed, 350 insertions(+), 4 deletions(-) --- base-commit: 2ccbdf43d5e758f8493a95252073cf9078a5fea5 change-id: 20240519-cros_ec-led-3efa24e3991e Best regards, -- Thomas Weißschuh