Received: by 2002:a89:288:0:b0:1f7:eeee:6653 with SMTP id j8csp47737lqh; Mon, 6 May 2024 10:48:27 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXkC2XthS3rBRyIZuFPZ57hfW54llEIgkD+ESM+Uv/455f0jK8LtT1Ckz71a2xxVX5z656JVjaBsE2mnkrMznKamLUc0agtSIQEop/fJw== X-Google-Smtp-Source: AGHT+IF4prerUrVLQ0gVk0QJtClkOLAliyzyF7NNo8YVATb8JKE3i+XyYDO3LlyWCDQLBhg9yp+P X-Received: by 2002:a19:ca1b:0:b0:520:11b7:6caf with SMTP id a27-20020a19ca1b000000b0052011b76cafmr4531437lfg.64.1715017706971; Mon, 06 May 2024 10:48:26 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715017706; cv=pass; d=google.com; s=arc-20160816; b=zVMPl27iIfFr2XPvSUvpgY2X+wpdSswwoVmLwKoKyf2PqDrFqV7MJEB5e0f5jzQ0IY gEoNcBTUNx9t3HeTowifYR+KPaQ/rW3HdFs7HSHTFimw26yeWcO1fVc4Ib1dHzjFN254 waagvdN7Mag25EdYgwwBOITe0cwKJtrXzPGciV4iJdZXp3eKOoSs2ROJtiJ5xpMJVA87 7s2gm1hYt5d4qk1scn8zunkT0uUV5xCBMxLVxrtGsxoVQXgwtmql60YbnNXv3C1ouk/T o7PGONzWKWnjEfW06ky8euoBD3y2gwfgFGPxQ/Q+7MOu6WZer7qnpw9C1Y38nTQKiNXS 0BZA== 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=dBsffheOxnK05R9SUtLmVVgmm7gH3RBeoutwh70dcGs=; fh=cUvXs0l0by2Zp6rblCztSSHsHNNfSGQF8mqxNLZykBc=; b=rvRKRYBlhh361gbrjoOXNDgfUXrKDcJhnUE4a+GAH/Q4lMKiC9QLU9rWBHGfJwPwiR J6F8LHIMzr/o81J7F6WTJB5ZfVbFtzfmOPp01VEv1DUitOUU+oxHZqh1EwLAw5CBcl7B UC6u5mwUVPt9wxq9qQ6tdEu7qkSzec/YzvtNDf8o+gh2Whz2GOC8RbHLzH1axiLZ529r aFj0x1PkLepc8U2EPvz05K1z1+MaYfdI6sv/Kt8+g3v2Ro3ZKTaOlMoeeeT5iRUTe+PI kPBQFzgd+6axSNsL7j2jUVNVGTbR5XoNdPipcR7XxGoi92xend9BLCaTdA4Y/MCy5GIQ /YOg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@weissschuh.net header.s=mail header.b=gXbYAIfe; arc=pass (i=1 spf=pass spfdomain=weissschuh.net dkim=pass dkdomain=weissschuh.net); spf=pass (google.com: domain of linux-kernel+bounces-170246-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-170246-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id o6-20020aa7c506000000b00572ab524e30si4883812edq.387.2024.05.06.10.48.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 May 2024 10:48:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-170246-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@weissschuh.net header.s=mail header.b=gXbYAIfe; arc=pass (i=1 spf=pass spfdomain=weissschuh.net dkim=pass dkdomain=weissschuh.net); spf=pass (google.com: domain of linux-kernel+bounces-170246-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-170246-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 am.mirrors.kernel.org (Postfix) with ESMTPS id AD0631F21F6D for ; Mon, 6 May 2024 17:48:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 733D31581FD; Mon, 6 May 2024 17:48:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b="gXbYAIfe" 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 3F6C51D52C; Mon, 6 May 2024 17:48:17 +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=1715017699; cv=none; b=Aa9PbjIUgkoIwD0t1B9VzW26HeXGvbJdVtfYRmnsj2rl2UYAdfAo5MPolsJotpJeYy4msfq9csm9i7lp156STeWttmXxZ7po/pR6m2jpJ8FBW9/GGK/UDVbvn3YoEjbJV8J8KDbJMq9UbpC0h0wD3gHNazo/qKUhC2JmtQgaLhA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715017699; c=relaxed/simple; bh=MvU5sKTnLEckHFjZCqkxY/lmg1E8y33V8+9lLbUc2Ro=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=lCvTkI44hmEpE7ER9fw/FDJLw5GXLjLWIWxysk1AdhzKfp/XRaTX6gEQSJ2MiqFduiPWoI7YWFZavFW+PL8ElnPvobDOGSmqCpOcGnxRcW9R2HSZSEMmFwDEt6Zewz75yp0fqQxAr4l3xUYRNWHBXPx4ZE/6PLJ6oj0Ad4uFu8Y= 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=gXbYAIfe; 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=1715017695; bh=MvU5sKTnLEckHFjZCqkxY/lmg1E8y33V8+9lLbUc2Ro=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=gXbYAIfeiNBAdErnj8FDrF6BRufNDLS5Sy2vaGpljGRCAJ2kRHckgsEAcrqJcZEfl bt6LFheWca1yJbPM5sMNaqlAKpFN7xuoBeQZGGd+m/QDRj53JMV85P9WazbjSxkds+ YbB5YliGBGgW8lRpfM36XlLtPLMqFmmmbJg0aaFo= Date: Mon, 6 May 2024 19:48:14 +0200 From: Thomas =?utf-8?Q?Wei=C3=9Fschuh?= To: "Limonciello, Mario" Cc: Lee Jones , Benson Leung , Guenter Roeck , Tzung-Bi Shih , linux-kernel@vger.kernel.org, chrome-platform@lists.linux.dev, "Dustin L. Howett" , Sebastian Reichel , linux-pm@vger.kernel.org Subject: Re: [PATCH 1/2] platform/chrome: cros_ec_framework_laptop: introduce driver Message-ID: <7dab7267-a5f2-4b03-bb45-92b836e42c28@t-8ch.de> References: <20240505-cros_ec-framework-v1-0-402662d6276b@weissschuh.net> <20240505-cros_ec-framework-v1-1-402662d6276b@weissschuh.net> <84c58078-93a4-406a-8abb-9054854e54a0@amd.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=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <84c58078-93a4-406a-8abb-9054854e54a0@amd.com> On 2024-05-06 08:10:58+0000, Limonciello, Mario wrote: > > > On 5/5/2024 3:56 PM, Thomas Weißschuh wrote: > > Framework Laptops are using embedded controller firmware based on the > > ChromeOS EC project. > > In addition to the standard upstream commands, some vendor-specific > > ones are implemented. > > > > Add a driver for those custom EC commands. > > > > At first, provide an empty driver that only takes care of scaffolding and > > device binding. > > Further patches will add functionality to the driver. > > > > Signed-off-by: Thomas Weißschuh > > --- > > MAINTAINERS | 5 ++ > > drivers/mfd/cros_ec_dev.c | 13 ++++++ > > drivers/platform/chrome/Kconfig | 11 +++++ > > drivers/platform/chrome/Makefile | 1 + > > drivers/platform/chrome/cros_ec_framework_laptop.c | 53 ++++++++++++++++++++++ > > 5 files changed, 83 insertions(+) > > > > diff --git a/MAINTAINERS b/MAINTAINERS > > index c23fda1aa1f0..60699c289757 100644 > > --- a/MAINTAINERS > > +++ b/MAINTAINERS > > @@ -4988,6 +4988,11 @@ S: Maintained > > F: Documentation/devicetree/bindings/sound/google,cros-ec-codec.yaml > > F: sound/soc/codecs/cros_ec_codec.* > > +CHROMEOS EC FRAMEWORK LAPTOP EXTENSIONS > > +M: Thomas Weißschuh > > +S: Maintained > > +F: drivers/platform/chrome/cros_ec_framework_laptop.c > > + > > CHROMEOS EC SUBDRIVERS > > M: Benson Leung > > R: Guenter Roeck > > diff --git a/drivers/mfd/cros_ec_dev.c b/drivers/mfd/cros_ec_dev.c > > index a52d59cc2b1e..0a36e77e5039 100644 > > --- a/drivers/mfd/cros_ec_dev.c > > +++ b/drivers/mfd/cros_ec_dev.c > > @@ -145,6 +145,10 @@ static const struct mfd_cell cros_ec_vbc_cells[] = { > > { .name = "cros-ec-vbc", } > > }; > > +static const struct mfd_cell cros_ec_framework_cells[] = { > > + { .name = "cros-ec-framework", } > > +}; > > + > > static void cros_ec_class_release(struct device *dev) > > { > > kfree(to_cros_ec_dev(dev)); > > @@ -299,6 +303,15 @@ static int ec_device_probe(struct platform_device *pdev) > > retval); > > } > > + /* The EC on Framework laptops implements some nonstandard features */ > > I don't think there is a spec really for cros_ec is there? I think it will > depend upon what features you're talking about if this is the right way to > go. I equate "standard" with "mainline". > The reason I say this is that maybe some of the same kinds of features will > make sense for chromebooks that use cros_ec in the future and thus they > should be "generic" cros_ec mfd cells to probe for in some way. The commands identifiers are just numbers. So if multiple vendors use the same numbers there could be collisions. By loading the subdriver only for the correct vendors devices we avoid those. If other vendors or mainline CrOS EC implements the same commands we can revisit this and move the functionality to a generic mfd cell. But after the discussions on the cover letter, let's first see if a vendor-specific driver is needed at all. Thomas