Received: by 2002:a05:6500:2018:b0:1fb:9675:f89d with SMTP id t24csp531628lqh; Fri, 31 May 2024 08:35:43 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXc0v6s94OMr7RtQEQdFuYtpxyyXj9+94SJC1QHYxrvIPpbTQKWdprkqpUxxdWD19OHnJmcgs1iLZw/BIig+Mf6BjvZmYc/D5nSNtZHgQ== X-Google-Smtp-Source: AGHT+IHcGlzTpkG91XWXWN7fN9VAT+DChnlV8/Et6rrgELY3eOyX29VmCwR7w/uHIH/oIJHixmif X-Received: by 2002:a50:d541:0:b0:57a:48c:c0f4 with SMTP id 4fb4d7f45d1cf-57a363fa017mr1602177a12.17.1717169743328; Fri, 31 May 2024 08:35:43 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717169743; cv=pass; d=google.com; s=arc-20160816; b=anHYzlDNERNM1ik3yS9RrpyI+d3vv4ZZwvQEDnJRMlDSyZB8CtYzbTbtl63CpyUAnY 4qaIhZW1gn8GJuRj72ZkQB5Y2LF2rRG/gY9X8UUEtWKqkZ0SKHbEBPz1Mi5azTePYHEg CWJJo4ofLC4EJTB5XF1/z+sTj+NBcvvEWJz4Ae1itw9g43L7Cm0v2NLB9zQeBdgJFo5b /jG2ctZHMKafUc9Xxm/56krb0xoq9Iz8K95fBZB2UVYVrxKSrn1Vk3Rpb5BazixybiCM rpYR8lz0oxBZfk2C9s5pqR7poKknrnMQzYqxVtqECpb7Q2SRM26ZO28UfBtFst1KvIVR rRHw== 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=fnQi7FpggRm0DfIHhtg8kG0Gp0HK37mWIODUUsMJpTk=; fh=PoP+CsZMfwFbzvmFONKVkRhXu5GU9lMS6o90bCcK5cM=; b=x+VM8gD242Y1ai23ho2hhJhH8jtp/v+FzON5yUN5pXVrSFAmgBQyYlEx8rtGm0nSmd FqRdNJUUq/i+ytuHo3EO0MccNJYiZxZUKpY1OMXHDKTSvl5qQhcfPLGc8jj1ZkzLI5xE 3kmDxYQ72JNw7/aOWXcZiNqdX8fNILE5fTFB/WOtCbklUAP9pHt23SQzn5jKB6gJdKeU lBJpiZbcfTg98YdFbq2kMJbg4XcwqGLh0g4ThvhGO5MvRo0ZaufShzvSfayAGsom2sc1 Y5qoG3Ja86EaGXTIyyrW8fYF04PkjftkrQ7pKc8tFJZPf9XgnvRtgcMyCfjsVrlUor6w X90w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ToNkfuVf; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-197080-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-197080-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-57a31cc95c4si1064090a12.648.2024.05.31.08.35.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 May 2024 08:35:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-197080-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ToNkfuVf; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-197080-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-197080-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 0A7AD1F22BD0 for ; Fri, 31 May 2024 15:35:43 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 828B281725; Fri, 31 May 2024 15:35:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ToNkfuVf" 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 A49F8768F0; Fri, 31 May 2024 15:35:35 +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=1717169735; cv=none; b=SG4bW2/NYio7aIgLfbVp2OP0xP66Yinr25qocOq4pGlKvLSFW4yQBSFCeS7r83PTO+Eff8mWHhMLyrJqXwUAp7XMi/V97nVKYIzZS3e4wpoRDNLvFoI11e7ZjxJ9TFtPsnD5EYfDxyKNTbDVaHpPVCwodiCjYeeuigTdJrrcrXs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717169735; c=relaxed/simple; bh=5ES2tLEvuBkg9uq4oaUjnzmWyJH9et9b5IG7ptJ9X70=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=IckXDk7VWt9BxAxLaJ5SMEtQTu81k75NLtkbpGw/UOsrkqrz9p3TiSFrc4s1yGw4eDpHu+mRBQAIoWO4g+ayK8AxYme/TfAoc7Sjod4aL/tSGKKc/D0e3+xqMHJqRDVaFda19aqpMyv3rjibYNXoQ8iFqTxK3mc/JwSih3s3KQo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ToNkfuVf; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id E77EBC116B1; Fri, 31 May 2024 15:35:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717169735; bh=5ES2tLEvuBkg9uq4oaUjnzmWyJH9et9b5IG7ptJ9X70=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ToNkfuVf3H0Efp9veYa2ld7qGbzHFbFRPC/gN56lffu9WPfG1QwyzsIGXGPjYlVRT EKbQtVaeRb9psOf5GIv+WJ6vYEgs3EpcXUZu0CxfXr7J9GKfDr1weAvH93GGQNqAVI vbofgP5GN94o1vrFjbc4nKZooZE3vjupSJcoLCeY7lDPJnagJIgCjYxfLeAAjeSCX/ PkFxTLfE7goWimj0/lq+I5X+LvKnbrr8st0UfmhVbkfk4ICLX8FTexjMuBsuINlllL WWqjaRSOOhej6UO9Qj/CJkjH8WaIk6OyuJsky/4wadyLIHntNrRTdBrUHT1yaMs4Gk SLo5qg9TuHSYg== Date: Fri, 31 May 2024 16:35:30 +0100 From: Lee Jones To: Thomas =?iso-8859-1?Q?Wei=DFschuh?= Cc: Benson Leung , Guenter Roeck , Tzung-Bi Shih , 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: <20240531153530.GP1005600@google.com> References: <20240526-cros_ec-kbd-led-framework-v3-0-ee577415a521@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-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20240526-cros_ec-kbd-led-framework-v3-0-ee577415a521@weissschuh.net> 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. Does the platform patch need to be applied with the others? -- Lee Jones [李琼斯]