Received: by 2002:ab2:7903:0:b0:1fb:b500:807b with SMTP id a3csp660251lqj; Sun, 2 Jun 2024 16:40:40 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXifVAbt+Jp/bXp/Notj841kfFJoBL+9Z7zYBGxfdcWqZJS648kdqhkl+kklcJwVvCPcf3fRXiDdSpbI1ienbac3x93oboWpXmc4yBk+Q== X-Google-Smtp-Source: AGHT+IE1GBV1HLhF11WcRfxNMV8DEvW2ddw+r3XkM+psaKP6VsHxzZ2LqnBVAGL5QOvMfdgT0rPs X-Received: by 2002:a05:620a:4090:b0:794:a658:ecd4 with SMTP id af79cd13be357-794f5c87f37mr986106285a.35.1717371640269; Sun, 02 Jun 2024 16:40:40 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717371640; cv=pass; d=google.com; s=arc-20160816; b=GmEuhHmNHDatkm+QRC6/ASIKOSokqcnccRrk4ghiEE9EhQImzTWIUvYnY5Dj1xdqPP 9S6UoGqxBEOwwlJpY/SM5tdUXZSJ32QSS8W3NryOtLoJsHCnuOJfWTBcS3+yJL3OiA98 FilJVdRDa/YvvEKI9M/6O4mT4wR7JBLU0ijyPh3mZA6ZFMstdyfYElOQVzOrqeAEIj4s Z3MOqeXqF5t0M3q/hv+Xxd1Q8y8mcBXP1bmReZ3+Ch7/JJ4dy9UlJrnqNPyWeLW5F0Zb mqi3O1GfxqgaATQ+d0GXbq4MIQttxY+l7WEMSN5q5XFhD8CgxSzs59SzSshlSxqcSPdx 5piQ== 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=kB05bl6nBL/GV64EJffHVt909Yg9H0aq3pdV1Zuvdyk=; fh=6Rj2r8GvnIu6gMTXCqshq/FI/Kz3DjwPo2m6ivJ11Yw=; b=if3rHfmZ8nqC2WOFesep5RAvqruJcFIylfWCDyG8KnNCVzDiPATt7OqrFRBNLh5iYv vgvuIGI43ipGun4AtygeQ26NOby7XpXkma/ZFzbjUeQYhK5cCfTrQPdIzC8qwRWDWKMU VmFL9WJ32gu4uP4YnOFvcHt7burYA+vcALmeJOYW7Dmle+j7YyCUoLlwxuqh2NSgh6Rv w9h54e2hAkBOR+3jjVfgUvYIPkcDth4mKJ7vj7y1MEdau3AAWn7z577PNpKCu3EtaYwJ 8j8X0+3mAbYIXFQVcQ0L0XIUlQ7sorHXj8luNqgAp9YZduXuNoQWXqFKYuo2LlV3kGD7 YyuA==; 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=xKOkSB7o; arc=pass (i=1 dkim=pass dkdomain=howett-net.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-198487-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-198487-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-794f2f05f5dsi692202885a.47.2024.06.02.16.40.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Jun 2024 16:40:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-198487-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=@howett-net.20230601.gappssmtp.com header.s=20230601 header.b=xKOkSB7o; arc=pass (i=1 dkim=pass dkdomain=howett-net.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-198487-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-198487-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 04CCD1C211FC for ; Sun, 2 Jun 2024 23:40:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EE86A7E586; Sun, 2 Jun 2024 23:40:32 +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="xKOkSB7o" Received: from mail-yb1-f174.google.com (mail-yb1-f174.google.com [209.85.219.174]) (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 E248E76EEA for ; Sun, 2 Jun 2024 23:40:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.174 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717371632; cv=none; b=MRZgpZtbwVTJv4DAh8xLjBskYDmRQ7E4GbG0n8RlBmiRJH07irdJUHN62XoawMsZUhPRN61O4gUQmTUnPazvdx009CytcB3+cNtjteV5PWemTrKKrsV/W8cn1kAb/bTRZZe5xoadNgz1sbHBdKVkQJKuw6joTUTcNdoRxRlI1b4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717371632; c=relaxed/simple; bh=EHRepVezwMfVoPL6Mw07oqATYl7aotVo1rQYOCPwKrQ=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=txBj1+hRVCe+abUJ2Vv9UA4+gU6yx6YRex0DWGOINMeTyujjt7+AdhVPgUHMl6QMOQaFx18eVtlpRWarNkpDcGeFMNPq0CfGbC0rmfXee50xGy5cGp+B1vUomGGgYwD7VBEknoe5aHUcecLc03syNB8SuDlopOqOqJi7D3Veo9U= 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=xKOkSB7o; arc=none smtp.client-ip=209.85.219.174 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-f174.google.com with SMTP id 3f1490d57ef6-df771959b5bso3515846276.1 for ; Sun, 02 Jun 2024 16:40:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=howett-net.20230601.gappssmtp.com; s=20230601; t=1717371630; x=1717976430; 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=kB05bl6nBL/GV64EJffHVt909Yg9H0aq3pdV1Zuvdyk=; b=xKOkSB7oh/e/9KgGaEufvfOXMLfzwsjPWwaDW7q6CrnFWn9YUtQgumz3p/1g5pGLaK TAeXTeZE3MK2lo/1FWXQRUJ+6Pck2SglvhvTKwmozzSdKMmUXcJ3ZLu3MaYKg9gUjQ/j b/KvX0sTxa8pdyIpqyPwsrOlkIS30H7OJAb/ruHu9IIwmwFzE7sgcDCX7Ma2C4VgxME1 yaLoz1liugftYl9yBPGv02gYOuA/DnudTwIvfsFlNxFrOf+IdUtoepnZaD8oVgDQjhmD j4Ei2pHB/zge1KsDjAKV9vtCCsSjTXCjDRUHmD7VLO7C6YzCA6hjjiHumdkVrJwg4ebr TdZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717371630; x=1717976430; 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=kB05bl6nBL/GV64EJffHVt909Yg9H0aq3pdV1Zuvdyk=; b=KSiTgpYsLv0qmgxP1AyyEqRIA5pXd8umn9/tkJcMrqLQcvl/mLJUU846gEMFMgt5He H18Sy0FS7L2AurXOjDOR2m2IYLuzbnnK6iOdIT0fLRnacUFV107IlD0iwFQnoEg4RXC2 rC0kkIQx3vSRmoe3eyGQmN1mTMSd6UJzerPezPAk18HaAoIOqouSYTe1i6W8FnGkI3Mo EYlndo+bxOvoQbIfHoEvalWyMGSJog7TAsv4H7newVnAKoScwZ/8+tzoslHbIdE3o7Cw nkm86JWpNVFzRe/eSrF4bHxOROlDmEJYwbePJbUzgU+iywUEbkW+avylcgsTT3z/VuLN 64ww== X-Forwarded-Encrypted: i=1; AJvYcCULloEMqQueJWBPWlb9VESFhoLAsg9jZh/DWQorCigqkzvZ4D4mVlx1ybGKtmODupRWo48xYY9+ovBPRlHXToVkXZFr1rDihm58RPJM X-Gm-Message-State: AOJu0Yz05q7iJSONLTU6HFG72n9mts6Qm+3+mHei3zlZ6cOFAVwKMBGs /7sJf4d2oJzcu7qP2cwtOdAbLrqCcAGajcbZ2W0URU1Kazt1ofo2nMz5dxGsH2kPUtpCsoz9Xlt UCzQm4O+Dk3O+5Bti/UdO2DoCwYOEZlx5WiUu X-Received: by 2002:a25:d890:0:b0:dfa:5a2f:9e56 with SMTP id 3f1490d57ef6-dfa73bed87emr6826339276.6.1717371629757; Sun, 02 Jun 2024 16:40:29 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240528-cros_ec-charge-control-v2-0-81fb27e1cff4@weissschuh.net> In-Reply-To: <20240528-cros_ec-charge-control-v2-0-81fb27e1cff4@weissschuh.net> From: Dustin Howett Date: Sun, 2 Jun 2024 18:40:18 -0500 Message-ID: Subject: Re: [PATCH v2 0/3] ChromeOS Embedded Controller charge control driver To: =?UTF-8?Q?Thomas_Wei=C3=9Fschuh?= Cc: Benson Leung , Guenter Roeck , Sebastian Reichel , Lee Jones , =?UTF-8?Q?Thomas_Wei=C3=9Fschuh?= , chrome-platform@lists.linux.dev, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, Mario Limonciello , Stephen Horvath , Rajas Paranjpe Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, May 28, 2024 at 3:05=E2=80=AFPM Thomas Wei=C3=9Fschuh wrote: > > Add a power supply driver that supports charge thresholds and behaviour > configuration. > > This is a complete rework of > "platform/chrome: cros_ec_framework_laptop: new driver" [0], which used > Framework specific EC commands. > > The driver propsed in this series only uses upstream CrOS functionality. > > Tested on a Framework 13 AMD, Firmware 3.05. > I've tested this out on the Framework Laptop 13, 11th gen intel core and AMD Ryzen 7040 editions. The problem is that the AMD framework laptop *reports* support for the CrOS charge controller, but it does not truly support it. As with the 11th Gen Intel Core (and by proxy the 12th, 13th) it still does require the OEM-specific command. This is evinced by a mismatch between the firmware-configured value and the value reported by the charge control subsystem through this driver. $ cat /sys/class/power_supply/BAT1/charge_control_end_threshold 100 $ ectool raw 0x3E03 b8 # OEM command 0x3E03 with BIT(3) in the payload is Framework's charge limit query host command Read 2 bytes 50 00 |P. | (in my case, 80 in decimal) The charge limit is managed at [1], and it does not appear to integrate with the standard charge control machinery. I'll pursue getting this board not to report support for CrOS charge control. This driver is still entirely fit for purpose, just not for this board. Cheers, d