Received: by 2002:ab2:7903:0:b0:1fb:b500:807b with SMTP id a3csp698021lqj; Sun, 2 Jun 2024 18:54:40 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXPFM6QuQqvcjK7+W7u2MRJGqqUWkPxOo2iI82Lp7OR4nC3NoquOaBtCm3eaVpzfFSZNf8I6wnqm6bDxyoqHSfBhr0xDC6ZN7Qnz+vh1w== X-Google-Smtp-Source: AGHT+IFw++t61gZpJ5B6iHsXCF5QEJUyc75n8sT1xBkvQjQ048DcWKkOKqqVQTxUUC74BiBdKKYb X-Received: by 2002:a17:90b:2e85:b0:2bd:f3dc:62d0 with SMTP id 98e67ed59e1d1-2c1dc5c85a2mr6528659a91.37.1717379679961; Sun, 02 Jun 2024 18:54:39 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717379679; cv=pass; d=google.com; s=arc-20160816; b=aSiriyo2D3M1PWnY3+qODEKfvg5zW4ex5yL/t0QABGs9xzRsiazAJYIqmCw4STLquK apjIbfdpWiY9K737N7Mf+7IDdO1wjhvYG1EMwIKrC9Dwsw8pxjA03vyN6pOH7FPv2QCg ss2fS/69DagbGm6zvlGY0yNVXx8PqoQZ3+lyxzj2fwgKoFiT+r+XTxr8aON3lFcyEdO6 2vyYXfEXoGFRgGIlA0nv6HkCh+btNoBiP/z5PlLIeNRsxfl/Q1awuPFu4u1ccthsgWLZ Pe8FdEdBmq9JtfDidp4ED7bf14UcD5i/5G+g2YUnxvtIQUofEmmLz3O1rfI3NEw1MWsn rGfw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=qffzuRew7oVEcVNbVjoYC3maMDHSz1qs5gw+l4ZuZyw=; fh=4j32xD6tM9RzhXtiYpUWuJ/5SRt0EjqsUPqX5wvBH7c=; b=FBCJPLwKKwv2mo5ht62v2KdpBaXhBK9Ra26BfPFLASRmRE+ghb4ITISWIcg4PEq3DN xop+EUHhjrTXDHD65pEiIi0GGPEll6BlAC73ZWPtGrqp56pe859CxpMDY1yvHKykwhUD Q+x2gh6AhDbuD/F94mhq7MJBvCKG3Cm8MTXiubCPhVCBzIbDs3EVZggJL4CmeQxrqbHE /SIo8XKiftzeTCxywXhNULhQkIAzNw/8hr76hpJX5ApdldtWsGQH0H5J2Hn8ZFUCFuqC CNzCX1gzr7HtbH+sKqkwvAQVv7BcyohnVIur+VXo66TnRg65h8rGKjRJ6PhrZtSMiO7A cYiA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=qOcSQl4V; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-198538-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-198538-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id 98e67ed59e1d1-2c1a777aa36si7529977a91.58.2024.06.02.18.54.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Jun 2024 18:54:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-198538-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=@kernel.org header.s=k20201202 header.b=qOcSQl4V; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-198538-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-198538-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 8E813281439 for ; Mon, 3 Jun 2024 01:54:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B3A8A4C90; Mon, 3 Jun 2024 01:54:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="qOcSQl4V" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 CBC974696; Mon, 3 Jun 2024 01:54:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717379673; cv=none; b=XGXKj3cGyTGdsCw6cD5OFC59ensplBGlMg8stegYzSyd6NnC0CKhPrgVVcqQDNFQY2xTal23+nMJebrtJn75TtPiTVH9WahIMu+AhKFKF5spVz+V5UpYw2iSJtIrbCvm7QPrSLr93WvbA3CywvJ79bKpmvmtW43LAna3hE3Rpg0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717379673; c=relaxed/simple; bh=hMsbcjB+aZSQFprtJrmCsK/CYdACyU8P6CaHxqgJLFg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=oMm4NhUesHrh7XWqHyahO4M6TtKhNFcB6TDoy4wvqDJX99OKIlo81gFLhnnmeqOGPMSh8qYF6UrFc0lZpsgFtaO8hfdW6wQFl4XplQNCm2iF9d2VP1rgyOLPlFi9nZpjAr4ZOfKWX1fzgzD9oEzh3z7nW/hLVLFAUCEXDhQa7tc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=qOcSQl4V; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 87522C2BBFC; Mon, 3 Jun 2024 01:54:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717379673; bh=hMsbcjB+aZSQFprtJrmCsK/CYdACyU8P6CaHxqgJLFg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=qOcSQl4V1Y3Hkv/l8RT1lkEhhWoLjVeywWPA1rpZ4B5PuvsbU2ZNjApHA8UMyCtYu g3uUg85YZVmH3xSfpV3abASaw20bjsy79S7uSDlx3/P5Zcmj06c1DKs3KKbb9ZYLHE U0Go7YxKVs5RUq6O4KCvkFg6/auaIHGkp/sEtfc9ZtjuFJT6td0SOXPsWeof6Iq0Ai 6LRZTk1Wy/ngVfkPfjMLk0WLBuaneHFCSMh74w/WgNdsfpTDxyEiY58A02KYIkUZY5 FOWoKfUrhAMwUu5wHVHdLK7VaYORm+4CWjVredH5KUnQ1wXosAPz6zCkoZYVjcMV62 4t2IVVejAvwQA== Date: Mon, 3 Jun 2024 01:54:29 +0000 From: Tzung-Bi Shih To: Thomas =?iso-8859-1?Q?Wei=DFschuh?= Cc: Lee Jones , Benson Leung , Guenter Roeck , Pavel Machek , chrome-platform@lists.linux.dev, linux-kernel@vger.kernel.org, Dustin Howett , Mario Limonciello , linux-leds@vger.kernel.org, Rajas Paranjpe Subject: Re: [PATCH v3 0/4] cros_kbd_led_backlight: allow binding through cros_ec mfd device Message-ID: References: <20240526-cros_ec-kbd-led-framework-v3-0-ee577415a521@weissschuh.net> <20240531153530.GP1005600@google.com> <0172f4a6-27da-43ca-8df3-93279d1ef903@t-8ch.de> <20240531155356.GR1005600@google.com> 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=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Fri, May 31, 2024 at 05:59:01PM +0200, Thomas Wei?schuh wrote: > On 2024-05-31 16:53:56+0000, Lee Jones wrote: > > On Fri, 31 May 2024, Thomas Wei?schuh wrote: > > > > > On 2024-05-31 16:35:30+0000, Lee Jones wrote: > > > > On Sun, 26 May 2024, Thomas Wei?schuh wrote: > > > > > > > > > Extend the cros_ec MFD device to also load cros_kbd_led_backlight > > > > > when the EC reports EC_FEATURE_PWM_KEYB. > > > > > As the driver can now be probed multiple times, some preparation in the > > > > > LED core is necessary to avoid name collisions. > > > > > > > > > > Patch 1 is a general cleanup for the LED core. > > > > > Patch 2 modifies the LED core to skip the default collision handling. > > > > > Patch 3 adds the new probing logic to cros_kbd_led_backlight. > > > > > Patch 4 wires up the driver to the cros_ec mfd devices. > > > > > > > > > > The helper keyboard_led_is_mfd_device is a bit iffy. > > > > > But using match data doesn't work. > > > > > > > > > > * 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 > > > > > > > > > > Tested on a Framework 13 AMD, Firmware 3.05, and a Jinlon Chromebook. > > > > > > > > > > To: Lee Jones > > > > > To: Benson Leung > > > > > To: Guenter Roeck > > > > > To: Tzung-Bi Shih > > > > > To: Pavel Machek > > > > > Cc: chrome-platform@lists.linux.dev > > > > > Cc: linux-kernel@vger.kernel.org > > > > > Cc: Dustin Howett > > > > > Cc: Mario Limonciello > > > > > Cc: linux-leds@vger.kernel.org > > > > > Cc: Rajas Paranjpe > > > > > Signed-off-by: Thomas Wei?schuh > > > > > > > > > > Changes in v3: > > > > > - Avoid probing multiple times (Confirmed by Rajas) > > > > > - Add Kconfig dependency on MFD_CROS_EC_DEV > > > > > - Link to v2: https://lore.kernel.org/r/20240511-cros_ec-kbd-led-framework-v2-0-b20c48109e46@weissschuh.net > > > > > > > > > > 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 (4): > > > > > leds: class: warn about name collisions earlier > > > > > leds: add flag to avoid automatic renaming of led devices > > > > > platform/chrome: cros_kbd_led_backlight: allow binding through mfd device > > > > > mfd: cros_ec: Register keyboard backlight subdevice > > > > > > > > > > drivers/leds/led-class.c | 9 +++--- > > > > > drivers/mfd/cros_ec_dev.c | 9 ++++++ > > > > > drivers/platform/chrome/Kconfig | 2 +- > > > > > drivers/platform/chrome/cros_kbd_led_backlight.c | 40 ++++++++++++++++++++++-- > > > > > include/linux/leds.h | 1 + > > > > > 5 files changed, 54 insertions(+), 7 deletions(-) > > > > > > > > Looks okay. > > > > > > Thanks. > > > > > > > Does the platform patch need to be applied with the others? > > > > > > Each patch depends on all its predecessors. > > > (but I'm not sure I understood your question) > > > > Does the Platform patch have 'build-time' deps on the others? > > Yes. > > Patch 3 makes use of LED_REJECT_NAME_CONFLICT which was introduced in Patch 2. > > Patch 1, 2, 3 have build-time deps on their predecessors. > Patch 4 has a run-time deps on Patch 3. Patch 1 is independent actually.