Received: by 2002:ab2:69cc:0:b0:1fd:c486:4f03 with SMTP id n12csp300532lqp; Tue, 11 Jun 2024 05:14:48 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVkA/bX+mrtD/JNROuEGqiXv0yY2jgvwAvsI4gx0zr3vKVACIIl9kDQX3msAw3c9hL0fZCwQdKDXYuJEcD+GY0C7Hhv9N12uVuRCBMNow== X-Google-Smtp-Source: AGHT+IH4ahZJZTAw9cx5CZ+x5cg/s7utt/M3HCCcO/PhQvmUnFnkpYHuwYuc8RGfv2cVyjRkRMCH X-Received: by 2002:a05:620a:454e:b0:795:60b9:fd9a with SMTP id af79cd13be357-79560b9ff3amr757837485a.35.1718108087752; Tue, 11 Jun 2024 05:14:47 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718108087; cv=pass; d=google.com; s=arc-20160816; b=rqIDBdN0sY9Xw1G7FBFRMr6kk7CgolFkkmqaKdZaxumGxc+3HLOj+tlOEYdRpFcL0G Y1soh1026McLlH8WZ/ENRu5YC6OoBc5bYZ5fvzRBKHGMlHVvZrbD/9h0r63I2kCuql9A itlxeEZXJ9JiZ3QCmw/0Q+sQLFWKhJaYn1Yn+S18XJagqwU8ICX9xV4ymsy0IoguG8Id pLUxb1ZJiIJxDNxSEEHm0tO1k1lrc8Fcs3mqG5a7WSw2t8lmkN6/7A4rRvIjETH3QInU QZpOZcUC9nUpXTRPfmOu02tVC2icXl9nRF3FivY9n1JSs/N4qqLP6boGIBMzkXwcDNQ4 8gwg== 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=mpLxaFAmEgV0faqBYbi5nHZ3ePA75tc8VnzBIFgiqUI=; fh=DZiDmaaR+XTnXtx+h7VlTgf+iUzxwXuv5LLhc4URNWM=; b=JpFSW/pMC8ciLEqIIXBiW9O6WaVyCEh8qpm453J+9RdbT5O8BjoDwLv4UL7XoLvbYG ru8jcZahElRKfGMgP/TUnLMo2KKxG9IM74f3hfkgSQQ+/Ga0fWJNAQYTK7yoRAaFrXpV YRNwuF5GuaULMGVkMNs1A4pr8W7sb5pakRALSonxj3BaHst9vcuhP/NF+1/UxwtGgpZZ AU6dtTQCIqOv+jEsC9dlYffvA9I5OtDa8yo7rEIn9BLWMQfCPWymiEhuXR6HpbL7jOS0 1X48jsDfW13cWuc5CQw+T18zEKDjT4Arj8z2QXOm9NQgebtrs6MK6dsxFVK5YGB+hbPy mZuQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@weissschuh.net header.s=mail header.b=InSLXQjJ; arc=pass (i=1 spf=pass spfdomain=weissschuh.net dkim=pass dkdomain=weissschuh.net dmarc=pass fromdomain=weissschuh.net); spf=pass (google.com: domain of linux-kernel+bounces-209839-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-209839-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=weissschuh.net 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-795331d3253si1028677285a.266.2024.06.11.05.14.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 05:14:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-209839-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=@weissschuh.net header.s=mail header.b=InSLXQjJ; arc=pass (i=1 spf=pass spfdomain=weissschuh.net dkim=pass dkdomain=weissschuh.net dmarc=pass fromdomain=weissschuh.net); spf=pass (google.com: domain of linux-kernel+bounces-209839-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-209839-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=weissschuh.net 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 72D1C1C22105 for ; Tue, 11 Jun 2024 12:14:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0818317BB23; Tue, 11 Jun 2024 12:14:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b="InSLXQjJ" 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 4DF1117B437; Tue, 11 Jun 2024 12:14:36 +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=1718108079; cv=none; b=jFM3rDC9vFu1p070UwqU3JpUu2KUiQg8da7cFOEmT0IqwmNZ+MnquBiBaZarxZ1PwW69OjfCeywv+xE1FlymHnPKhTNNY62j5F4SoMmt66EC3apdrdP8eE4OrZ8FVX+8rtz/CYlPtbF9CgIRb/dFiTMpm1Mw97Er20q19MTliYA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718108079; c=relaxed/simple; bh=w7B40PWl4Af4+RQcs+mNnifx0/byH1T0JsOks/U3U5E=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=tarruPt7DVZNlJ8Nkwe+dq6XQ1xlITZfcC1JoYQTAzWyVIKClog9tCxIe0lMhjNOcgue8HcN+4e+Fb6yvbq8PvP5smWHS6bG12VyhBYSn5JsCe2QY4ek0fQZI5xraZWW9RXciC6chUvBZS42vFXPpJJUlBHcGARTaFDjyNqeh2s= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine 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=InSLXQjJ; arc=none smtp.client-ip=159.69.126.157 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine 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=1718108074; bh=w7B40PWl4Af4+RQcs+mNnifx0/byH1T0JsOks/U3U5E=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=InSLXQjJdt0FPAI3RfJ1IGJQTgNkD4rsynDmJ4EGpEKjJa3UQ6I5YvisnYhh1mSoF neKB6U27SbKBAInaB5VIEjmXsDxSr2Ycz8jK/nx9wz6+1P8TiWJnczqi1i7OIoJu6R t27zeQRRJ8Zdby3Dl8Mk2CA42TVjY6m/4Alts8BM= Date: Tue, 11 Jun 2024 14:14:33 +0200 From: Thomas =?utf-8?Q?Wei=C3=9Fschuh?= To: Tzung-Bi Shih Cc: Benson Leung , Guenter Roeck , Sebastian Reichel , "Rafael J. Wysocki" , Len Brown , Robert Moore , chrome-platform@lists.linux.dev, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, Mario Limonciello , Dustin Howett , Stephen Horvath , Rajas Paranjpe , linux-acpi@vger.kernel.org, acpica-devel@lists.linux.dev, Matt Hartley Subject: Re: [PATCH v3 3/5] platform/chrome: cros_ec_proto: Introduce cros_ec_cmd_versions() Message-ID: <96f0d632-7fdd-4fca-9528-449440d72f5d@t-8ch.de> References: <20240610-cros_ec-charge-control-v3-0-135e37252094@weissschuh.net> <20240610-cros_ec-charge-control-v3-3-135e37252094@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: On 2024-06-11 11:35:39+0000, Tzung-Bi Shih wrote: > On Mon, Jun 10, 2024 at 05:51:08PM +0200, Thomas Weißschuh wrote: > > +/** > > + * cros_ec_cmd_versions - Get supported version mask. > > I guess we would like to call it something like "cros_ec_get_cmd_versions". Ack. > > + * > > + * @ec_dev: EC device > > + * @cmd: Command to test > > + * > > + * Return: version mask on success, negative error number on failure. > > + */ > > +int cros_ec_cmd_versions(struct cros_ec_device *ec_dev, u16 cmd) > > Could it support a "version" parameter as existing EC_CMD_GET_CMD_VERSIONS > usages use both versions? An `u16 cmd` parameter and down-cast to u8 for v0 > should be fine. (ec_params_get_cmd_versions vs. ec_params_get_cmd_versions_v1) Ack. Or we could automatically use v0 if cmd <= U8_MAX?