Received: by 2002:a89:288:0:b0:1f7:eeee:6653 with SMTP id j8csp68759lqh; Mon, 6 May 2024 11:30:01 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWH+quGhLmebxMerj53HsJUVYvlPCWls2WL7brSGrrZejO50lZkXakYbW0Tk/3CPNpW8G2IqjF6g3BCmmcM4kyCa1G8S5zGNJs1ODGWtg== X-Google-Smtp-Source: AGHT+IGFmp6k+au7RDaULdzknWoxDuXXN4jKBT4IlNPmM8oZgvpyF/A0p8RuP961xoKDniiQ4NNC X-Received: by 2002:ac8:5981:0:b0:43a:f441:b3ac with SMTP id e1-20020ac85981000000b0043af441b3acmr14717580qte.32.1715020201333; Mon, 06 May 2024 11:30:01 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715020201; cv=pass; d=google.com; s=arc-20160816; b=hsROhHKqBM5gWE7/i4ScfCHfjI3pdwJohy3QzcuUMei0ppBPO8olWMtvdKuda+h8aM OapujejZJoK+xVjiF/ZGXYDjPxqefyxP+qf4D+T2y0eFA1M4MoM09VJfF6vMjWWr3r8V m/cwhh9f+ScAhHGhODpJ+44+LrT7vSbWU5AmXLlj1bfh9ToCbGSzE3wEf6jwuOvBCCGa VeSbyXSx0mDX0lYVDt/DwmfvtaWEqXwuAe30OKJmvf6UEbKTPlfSrNeD1SGO4ZaCf/Tt /NoqD1uKCPsQfJ7gQD6LAZZUkIKkyFD7Dz5mbAnquIXztu5bJKM2vl1Oa6HMcEVoj8Fo YgQQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=VMEFfkoDH6PXpbghcbBsUEOgJ+i0OqrWW52443/7WsQ=; fh=e826O/ylIFCfUTzVTHo0e1MvZVxgjjSzFk9fqllvQmk=; b=pgecX2gQkFWclx2EOXJWyWyiyNEPMXecMGlXV/f6wcQmUrMf5jDPFbbRO+ZQ9T8J1I d9+/cNnRkPeo4gqn1Hot1PQ0SFO7AI5b41SLqt4/AbYP8n2j5k5pBQG/nN+pDXE76HSU /HKNicbioh0nwTyEidX9Rzw2lhzFc3zZeaT5GrH2bkk/Z2/WLCedymrdMbMuNIPbpTaL VIDxcYQewhhR5pvVoQXuooNtAFIlTf+hKdmiGfn2FNNIDcJfwbmzyl3a3gT0gP/n8/u3 8U8E2l7QtRAf7yvrkonbnv64yoCTJDKgInrAmC/Enm28cwuWDvrjnBjl9lj7UmGsnNwe jzTA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@howett-net.20230601.gappssmtp.com header.s=20230601 header.b=Nl8auVoG; arc=pass (i=1 dkim=pass dkdomain=howett-net.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-170287-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-170287-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id e4-20020ac85984000000b0043acbc10181si7298594qte.182.2024.05.06.11.30.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 May 2024 11:30:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-170287-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@howett-net.20230601.gappssmtp.com header.s=20230601 header.b=Nl8auVoG; arc=pass (i=1 dkim=pass dkdomain=howett-net.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-170287-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-170287-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 0100E1C219E9 for ; Mon, 6 May 2024 18:30:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 71FED158A2C; Mon, 6 May 2024 18:29:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=howett-net.20230601.gappssmtp.com header.i=@howett-net.20230601.gappssmtp.com header.b="Nl8auVoG" Received: from mail-yb1-f173.google.com (mail-yb1-f173.google.com [209.85.219.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0900A158A13 for ; Mon, 6 May 2024 18:29:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.173 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715020186; cv=none; b=ajoQMYo9QCwqAmXaQhIO7sEXS5AJV8E6LjAKHAKkvCUUsFSFHMJoT79kMAcCODjrv2xaB0BsX8OU7qBXfxNmAELLllFuNaeckRDYl2S0peBryMnsrKp9YGbfB6bMJacDKIYrK5w2vp2qibMKWYgpM6WGlNOHLi46VorwGuo3MNI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715020186; c=relaxed/simple; bh=VMEFfkoDH6PXpbghcbBsUEOgJ+i0OqrWW52443/7WsQ=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=dzmSc4EMTRnTQbslRM2P+fONjT+C0ruiUyt/im1VnyJf3WbKDQTaNR74bydT6G71QeP6teywf0rMppivpH8FC9mUCgQORp8bm9ASvuDzBt1VlGC817IFLF0ZdwlSJHUBNhfMR8DDP82nM7btEazffPxg+zpGkpKk2M0Etldq5us= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=howett.net; spf=none smtp.mailfrom=howett.net; dkim=pass (2048-bit key) header.d=howett-net.20230601.gappssmtp.com header.i=@howett-net.20230601.gappssmtp.com header.b=Nl8auVoG; arc=none smtp.client-ip=209.85.219.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=howett.net Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=howett.net Received: by mail-yb1-f173.google.com with SMTP id 3f1490d57ef6-dcd7c526cc0so2687817276.1 for ; Mon, 06 May 2024 11:29:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=howett-net.20230601.gappssmtp.com; s=20230601; t=1715020184; x=1715624984; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=VMEFfkoDH6PXpbghcbBsUEOgJ+i0OqrWW52443/7WsQ=; b=Nl8auVoGMAQHP2EI+G47Pdfl/mQFKwFuz+/BTb3KL4yeepOlH1H6cf7gihdqMdnZX8 FmqrmQohkVwoMTEK11AcNLq2LjNz6XBVvAgN3KrveaMtj/i7T0fU8CQgA2N0WUmaFoSF q1zu0zctiqmegFwdx05Gy9eWIlJw8rrrvod1NL5mfe3H2HmveqbI2WFmapNkMfk4fbhW Fwq6oGcy5hpDrHY+xN51NdOezopgmCe2C1JvH+x3YCoaQkmHUmuro+g+I0MJgR9kknTp QwYhMgJgNBW6kQOoL8iq/jpUCNQsntQvWjYgHVGA8t0/I+Fl3dwu4NwOvau7TWxcG4MW j4+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715020184; x=1715624984; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=VMEFfkoDH6PXpbghcbBsUEOgJ+i0OqrWW52443/7WsQ=; b=LZh+C2vl4+Ni1XEZ+PkzEbv6BkQpYBSLm3P4nnpcdgXYyQb2xtox/6ZhRxWRWKFBth JjHCQyjMTSGOiV6fIrl5dXumiuVCo4PYPWjQeIGrrU6VUrjmR0pJdbk4IqvO1w93hl4J f4L5MgcVz1dezOfpDWyEG6BQAXg4QxPYGb8Nb23lcQKpzEjOJ8nO0JKOx5Syiu21N3Vf vkqwdybUfqFaUkEVowMpzgjEcQxJFB/Ee9xZeVTt4P2DxpQN13/7EeCcI/HNpvyl0EfX nInhNOVAXk8a18kNplXfuYR04vgFIyGspywPJ/hy1+KsnyBYZn7gCmmlTfgdWXQpZ9BS ECPA== X-Forwarded-Encrypted: i=1; AJvYcCXbEpPX6EkI1/9PTPs8rZ9o/QPZ8IddJV1oz65AG4b1YvV4D9pas2qf1FlkKizkEjYTg5uFVqreZzqEGO13QwBbZTTy7zOY1ciSPMP5 X-Gm-Message-State: AOJu0YybU4yl5W0SKm/3X7ImJvOANS++jT3eCYxEneS/96t2PBS/XvM+ FBBLWwo2ipjuFYyE/zeAjgSLH94t0xo8jN6RXyj8cSiGkLbcFdrXgvhw8lhBoFtew8X7KlDmsK7 AZOj8nD0FC+gJEufEr20ikXq4XF/kJLm1eIs3 X-Received: by 2002:a25:aea2:0:b0:de5:5693:4e96 with SMTP id b34-20020a25aea2000000b00de556934e96mr11302424ybj.27.1715020183937; Mon, 06 May 2024 11:29:43 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240505-cros_ec-framework-v1-0-402662d6276b@weissschuh.net> <613369f9-42c5-4a59-b83f-45bd1773ffe4@t-8ch.de> In-Reply-To: From: Dustin Howett Date: Mon, 6 May 2024 13:29:32 -0500 Message-ID: Subject: Re: [PATCH 0/2] platform/chrome: cros_ec_framework_laptop: new driver To: =?UTF-8?Q?Thomas_Wei=C3=9Fschuh?= Cc: "Limonciello, Mario" , Lee Jones , Benson Leung , Guenter Roeck , Tzung-Bi Shih , linux-kernel@vger.kernel.org, chrome-platform@lists.linux.dev, Sebastian Reichel , linux-pm@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, May 6, 2024 at 12:43=E2=80=AFPM Thomas Wei=C3=9Fschuh wrote: > > On 2024-05-06 08:09:07+0000, Limonciello, Mario wrote: > > > > > > On 5/6/2024 1:09 AM, Thomas Wei=C3=9Fschuh wrote: > > > On 2024-05-05 22:56:33+0000, Thomas Wei=C3=9Fschuh wrote: > > > > Framework Laptops are using embedded controller firmware based on t= he > > > > ChromeOS EC project. > > > > In addition to the standard upstream commands some vendor-specific > > > > commands are implemented. > > > > > > > > Add a driver that implements battery charge thresholds using these > > > > custom commands. > > > > > > It turns out that standard ChromesOS EC defines EC_CMD_CHARGE_CONTROL= . > > > The kernel headers however only define v1 of the protocol, which is v= ery > > > limited. > > > > > > But in the upstream firmware repo there is a v3 which is much better. > > > > > > The Framework laptop only implements v2 which is also fine. > > > Given that v3 was only introduced late last year, it seems better to > > > stick to v2 anyways for now. > > > > > > So please disregard Patch 2, I'll see on how to use this via a normal > > > cros_ec driver. > > > > > > There are some other Framework-only features that will use Patch 1, > > > so feedback for that would still be good. > > > > What other kinds of features do you have in mind? > Definitely privacy switch reporting belongs in a driver like this. Overall, I'm not sure about making it a subjugate driver under the cros_ec_mfd virtual "bus"... even though a lot of the features take a dependency on cros_ec. Doing so centralizes the work in the platform-chrome tree and may serve as a guidepost for any future laptop OEMs that derive their embedded controller firmware from ChromeOS's. If the owners of this tree sign off on that, that's awesome! I'd be concerned about making it all their responsibility. I may be a bit biased, as I have been working on a driver of my own[1] for this purpose. It currently supports battery charge limiting[3], reporting fan speed via hwmon, the keyboard backlight[2], and has an open pull request that exposes the status of the privacy switches. It is destined--once I find the time to clean it up--for drivers\platforms\x86 instead of ...\chrome. This may be a good place for us to combine our efforts! d [1] https://github.com/DHowett/framework-laptop-kmod [2] I found that the Azalea did not report its keyboard backlight values through the standard cros ec KBLIGHT interface like hx20/30 did, so the driver as it stands implements a fallback that uses the raw PWM state. I'm sure that you'd've noticed this if it was still true... so I am always happy to drop an unnecessary workaround. :) [3] Which I believe still requires a special host command and is not integrated into the charge manager, at least as of Azalea/Lotus and _definitely_ not as of hx20/30! > [...] > > > [..] > > Thomas