Received: by 2002:ab2:6c55:0:b0:1fd:c486:4f03 with SMTP id v21csp165611lqp; Tue, 11 Jun 2024 19:25:51 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWxfbBVBVWM4T/k99/pa67JL6S6dMt2UTnYMRU4xKCeUJAT26DC6MXgjmoitTHHr1pHasCK9JvFXZiWV/159yAWCuc55fencz0PBhFBvQ== X-Google-Smtp-Source: AGHT+IEyuEfskyPBh8zoap/QD9Nx1j8p8NT80m1J7uYlncpOM3IlW5oZ5ihafqIzxvlpa+exNBwl X-Received: by 2002:a17:903:1c6:b0:1f7:c56:58a3 with SMTP id d9443c01a7336-1f83b5f78femr6864705ad.26.1718159151275; Tue, 11 Jun 2024 19:25:51 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718159151; cv=pass; d=google.com; s=arc-20160816; b=LP1RNZ80xxLaTEiwXIdtFhUUyreBGOeYmz00vvVevUE5727UTd6Bel9m7ZRWqLo0yH k91EQUshxRcicYgWiV9RSo4GszJ96oZd0kTO2uWKtb5ck76+n2EbMmFTGm5dPxv+x3Od Erp8px/knxbaY5eriEhFg2QTrT1ucBX1XecvDHNG6ebP00xN2WjRcprsYihVLW+O0gBu zHtvetFGHOFnDJLmYoYkg7Gdc9oCfCmrP/IC7VrvzLuK1twHDdQsp7Kf9/4VgTiy0fFO ztu0Bc7fM8mGWeauJNViWMdIw6dfkmLaxwBig0OqulLDN80I5SbDYGYXBdu8KbyLIk/w FLJw== 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=JdY5zEAusEjrRPIPHKfmJZ5jbHyaDpIUMa2vn3Bv71w=; fh=ZQpYTB7oQRllvSDZLwIk4JaJL9AbkcJQtSvGMVRc32M=; b=hMYpN8x+7eAHsrRsVZUx24svRoLBm1EB7mS+MlxjtN6kZy4gJxRPrDG3MbB3BzjpRr uGZcjQrktX5y22RzmquoepyvIF1FJ2CfaDFgSeeVcZzYSr7U7FE7V9N/9h7W/QBt5CMU FbaGu28N95aylRTWk21dcslv7BXL8EDo7YixC58sm3QdxpJYxQ8Ue84ohP+GKuvdUtn5 XhEHJxsRak8BfiuwfTcgZjGGrAO3iMVp9NaT/63rapKsGgLWqd4H1ArITehhhfIFw72k noxxezofRty7l4APy2/rlFFeVOslqT546JBkXlG8+AHF5PyFixSW8oi/fjrJvYSWOglD Axog==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=YZFbygVd; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-210822-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-210822-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id d9443c01a7336-1f71b597088si39718205ad.579.2024.06.11.19.25.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 19:25:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-210822-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=YZFbygVd; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-210822-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-210822-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id AA9C028AA79 for ; Wed, 12 Jun 2024 02:25:50 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A9E08BE55; Wed, 12 Jun 2024 02:25:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="YZFbygVd" 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 B8F49A34; Wed, 12 Jun 2024 02:25:42 +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=1718159142; cv=none; b=NYXpio76fhZLmfQhS/jqXIqjCjj5r1ttVjqSjyoBJS8GtxNNHVC732t9r3g0Kf0aY+POdf8IgjUQCB6O/nyMi8oCyL2ye+oQb77o34O5u6gVdhi0uoOyVlCkr6nHdB22eBrm6fLImctm2D5FTVvq7q+NYgnDR1YbyNjARcjgoJY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718159142; c=relaxed/simple; bh=ge6+rdG4NL/1L70rAxfH+r2Izoc6INz7bqA0W1h52BA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=nAWy2WJWz6BupZQtaTfuOmBMJOjZtZM0/6kB2GJ0ZQfhFXVl9lz74SzrzOr7aw+vTa2wWx7z++gpDchRU8NGU6F6M4fOu+AKcLpU64I2+SlR3SPn7qDoiy7/Oeg3MQA7+5I7MNTeDmHofuSPPDAd/VKMHNgRlFFrFpxeb69mukY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=YZFbygVd; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id C65A8C2BD10; Wed, 12 Jun 2024 02:25:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1718159142; bh=ge6+rdG4NL/1L70rAxfH+r2Izoc6INz7bqA0W1h52BA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=YZFbygVdOyelHVyIZFVWoqPHnCs2Fc8gpVLwM15UtC294nSvYisXaKpW3siCBECZ6 riO98Iz6I17HIM+Iu7lVnxRX8x//8faAFuLAX8VuX4+49S5LfEP07w7kRyQEOONXBS lQdKhIgz8HkWkE92r437LVea+h63FDEU68jRw7SlpDOSMHfyx8/vy3sqR8JzQ4EhWS H/POONZFHNqpxWgqf61O4u9lNZL+AV7D9ja8GCYbt9h//MXOffrhj5D+uu19ruM+gy PUGV/KpdTDEz2i2ltuTfBSSA2m/n1oWDzJAQw6cxDPaKFqE5qQ1zcfSsmwO2ir4T5z Rt2gTB4Rs6avQ== Date: Wed, 12 Jun 2024 02:25:37 +0000 From: Tzung-Bi Shih To: Thomas =?iso-8859-1?Q?Wei=DFschuh?= 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: References: <20240610-cros_ec-charge-control-v3-0-135e37252094@weissschuh.net> <20240610-cros_ec-charge-control-v3-3-135e37252094@weissschuh.net> <96f0d632-7fdd-4fca-9528-449440d72f5d@t-8ch.de> 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=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <96f0d632-7fdd-4fca-9528-449440d72f5d@t-8ch.de> On Tue, Jun 11, 2024 at 02:14:33PM +0200, Thomas Wei?schuh wrote: > 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: > > > + * > > > + * @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? Ack. Looks feasible.