Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp977160lqo; Sat, 11 May 2024 02:05:34 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWOy0pN+CZLojdVhxhmFMxrgqZuuTqK79kge8/5UGOnczXY/iYFgEjZ8n1IsxVhaT88Dht23fInwwjxvflUUASJS2IIBA9MgPW3HkkVtg== X-Google-Smtp-Source: AGHT+IGYMDjGLDvkYCRhz26Si7a4RPugpLpD+o/COYGZQGZN9ZGlGnMsInuN+mA0w5AErM6bWE7Z X-Received: by 2002:a05:620a:1359:b0:78e:fd59:3c3b with SMTP id af79cd13be357-792c6ec81d2mr780016185a.35.1715418333687; Sat, 11 May 2024 02:05:33 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715418333; cv=pass; d=google.com; s=arc-20160816; b=n4u2p6sKGIWGy+Mx93pt3zs523DQ4YnSE/qcQSwyJTGIF1ad/4RvBWo2BAwWwgPuAC Y3RLt3J+1U9iIoNN9HxH//O3avxo8c2HcO2vXqDlud7iMbTOJd2sn3wpet11vAKJyELb 2QyoFrUonKN/iKadqO1aKpcLvTcsFoiBcdtCU4JsvBSEjfHO1rGtpZT6CtfWwtz20UX/ nkqYELMZTkmE1JkznLWFLyrJsiSnUFACwAD0jpJbU0Sp2VQo4UD28M9nkFFsbd0UUIzW aTwxhgJdR4Ov69n7mD1w/bEJQFZcksQfN/hMD1UlItOdyeWJY8F6Wi6MaREGVQ19E+av th1A== 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=zVAIhw93V8UV/OA0Mm4cagXQClb+OuYl4CbUUrH4ZXI=; fh=vAGlr30tiBxGPEhMMptB4MccNgOqlXs4d+HZRjv78hI=; b=rylGm+Q0fNYeOY75kjIc6j5JT9u53mAncosNFhPlZO/JhaVChZPzYi+WuDNhvYgAJK YKZEvM+GxWYQbFnlTMZJ54CXF7YuUALZkBJ8PundEbeHuw4NvWCSzBa5iFiP/PqQIdd1 mopXq2r0DBgj/uSxF9+KYhcQnn7/KJvUh6wsg87t6qYmbrnS9jDEvneezzmf4VXRSMFq O/jX9rXOkgU97FRr2VNg6WX/XFKbTUL+87g9qXJvn+a4/PrI/AE1nP77+ZnMrXy1fWbq iml6v/eaBqNfiME/PC++tbP+1F62IpVUxJN5QVdTaSZd4eyRyZvqBSTWh0EW87BzPaAT dJAA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@weissschuh.net header.s=mail header.b=hof7zviL; arc=pass (i=1 spf=pass spfdomain=weissschuh.net dkim=pass dkdomain=weissschuh.net); spf=pass (google.com: domain of linux-kernel+bounces-176463-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-176463-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id af79cd13be357-792bf29728csi517272185a.190.2024.05.11.02.05.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 11 May 2024 02:05:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-176463-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@weissschuh.net header.s=mail header.b=hof7zviL; arc=pass (i=1 spf=pass spfdomain=weissschuh.net dkim=pass dkdomain=weissschuh.net); spf=pass (google.com: domain of linux-kernel+bounces-176463-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-176463-linux.lists.archive=gmail.com@vger.kernel.org" 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 62C961C20B35 for ; Sat, 11 May 2024 09:05:33 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E1165537F5; Sat, 11 May 2024 09:05:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b="hof7zviL" 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 6F40142045 for ; Sat, 11 May 2024 09:05:23 +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=1715418326; cv=none; b=D03kjZ3nWltc8L8pmynQuRKxvXHmENQYRcFx4+OgKp/hseNlRjNL8uI12yuPxj4QuVLph1VwlldUtQ886W+ua+HpvIQtGuzRMAxybVz27OeTgK0EDD5pEk0o6F97moV9ZZlxJfmi68wEkVh6lOP5zGNo4qt7xWIvnoH+xz8RKQU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715418326; c=relaxed/simple; bh=EUxaiApsNK6zh7PGenlNCHnyPfCDjkWN62rs+PnisIE=; h=From:Subject:Date:Message-Id:MIME-Version:Content-Type:To:Cc; b=j1HhgEiezfddZ/krQjjfuFAqUvY0UnTqjIsHi5TdURgk9zkMkrJvfUhJ7WCUUs9aPalQtUD/QLLjvPaRXuZGpnuJbgAye3Y4FMXvsUJG49meoWcRQp/glO1raYujj7H5nScJTW5P6PsCJPQbYlJlC7BFZMX8vr8HfU/6rEqNW44= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none 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=hof7zviL; arc=none smtp.client-ip=159.69.126.157 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none 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=1715418315; bh=EUxaiApsNK6zh7PGenlNCHnyPfCDjkWN62rs+PnisIE=; h=From:Subject:Date:To:Cc:From; b=hof7zviL4nbxgdHC2oKynsxbyFFFtVFN1erSYAMWC0Cf5nr3mZD1s2Y9uhdLrlv5z gyko8+lLNXIj7XpKUZ9W+ZuLE2a95Dj1fkUvzp8i60Rtz1OLBg5eDL1aLDQnyHe6Sm N4+/3wR5wSpOiVcpKwgU1zWneQyQdxB0H4ucYEac= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Subject: [PATCH v2 0/2] cros_kbd_led_backlight: allow binding through cros_ec mfd device Date: Sat, 11 May 2024 11:05:11 +0200 Message-Id: <20240511-cros_ec-kbd-led-framework-v2-0-b20c48109e46@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=H4sIAMc0P2YC/42NQQ6CMBBFr0K6dkxbRNSV9zDEwHSwDUrNDIKGc HcrJ3D5XvLfn5UQBxJ1ymbFNAYJsU9gN5lCX/c3guASK6vtThe6AOQoV0LoGgd3ctBy/aApcgc lWTrkpsHyiCrtn0xteK/tS5XYBxkif9ar0fzsP9XRgIGmRaz3R21yZ88TBRFB//LbngZVLcvyB RpcXNLHAAAA To: Lee Jones , Benson Leung , Guenter Roeck , Tzung-Bi Shih Cc: chrome-platform@lists.linux.dev, linux-kernel@vger.kernel.org, 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=1715418314; l=1459; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=EUxaiApsNK6zh7PGenlNCHnyPfCDjkWN62rs+PnisIE=; b=aP8fvKaYXjODjTH2ODPYM54KB3RhOuXBAaFyF8Og/Nds6iRsZ0NqAgnu1ladY7R7WuDOKlPl5 sT+5Jvm9w1TB/WqOYCgdT60CisTfNS+7AwG75HNG8GXG4KgfF/wvMqU X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= Extend the cros_ec MFD device to also load cros_kbd_led_backlight when the EC reports EC_FEATURE_PWM_KEYB. Tested on a Framework 13 AMD, Firmware 3.05. This is based on https://git.kernel.org/pub/scm/linux/kernel/git/chrome-platform/linux.git for-next The helper keyboard_led_is_mfd_device is a bit iffy, but I couldn't find a nicer way. * driver_data from platform_device_id is overwritten by the mfd platform data * Setting the driver_data in drivers/mfd/cros_ec_dev.c would expose the internals of cros_kbd_led_backlight Signed-off-by: Thomas Weißschuh --- Changes in v2: - Fix build with CONFIG_MFD_CROS_EC_DEV=n (kernel test robot) - Split out mfd registration into own commit (Lee) - Simplify keyboard_led_is_mfd_device() with mfd_get_cell() - Link to v1: https://lore.kernel.org/r/20240505-cros_ec-kbd-led-framework-v1-1-bfcca69013d2@weissschuh.net --- Thomas Weißschuh (2): platform/chrome: cros_kbd_led_backlight: allow binding through mfd device mfd: cros_ec: Register keyboard backlight subdevice drivers/mfd/cros_ec_dev.c | 9 ++++++ drivers/platform/chrome/cros_kbd_led_backlight.c | 36 +++++++++++++++++++++++- 2 files changed, 44 insertions(+), 1 deletion(-) --- base-commit: 2fbe479c0024e1c6b992184a799055e19932aa48 change-id: 20240505-cros_ec-kbd-led-framework-7e2e831bc79c Best regards, -- Thomas Weißschuh