Received: by 2002:a17:90b:8d0:0:0:0:0 with SMTP id ds16csp4742177pjb; Mon, 27 Jul 2020 04:06:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzg01jue0gejtmC5+wjZ3iweJEvtkzV9SQYb/s0GA3PlwkrFyWwC2mv7NQ0wI+dho7lzraI X-Received: by 2002:a17:906:924d:: with SMTP id c13mr19715129ejx.518.1595847999464; Mon, 27 Jul 2020 04:06:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595847999; cv=none; d=google.com; s=arc-20160816; b=qL+ByP/oT2hCgmzFG6PXrC5KFFfYbxXGPMl/cZRB+CV8fiz7x2tB+0PI3Gj9U2rSS3 szUOWEGUa8aj5G/5hT5dHmiIGREAMKtGBNPx5aPIz4TO0uF4pV3CjIYLgzTjU9qFKbI2 RujZfKwgHfN8rnKquII78gkf5DNichkFf6UG1IwIeAlrwwreTS/HhRZq+CTsdpN4/99D ju07uhY5ffi2HMYQyfBD/0VnI1cOVs5v0941k8Xo2BD22/E8ymj4HmfJjb9Ww4/+sq9N q7C3zvuW0MJ8AunEYBnSWY7ofno4Ib1lVvtPM9w5DHnn7u+ftuyt1+RZ2fFgwt5unT8y cvog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=uTYqeemDSPScVbheiLmyQCe1hXCX2Av/b3wS+MeE6u4=; b=YxgcmhrAlXLk9+Sv5Rv5+1FqqwmUYZGAwABqbk5JuGLwZFARRxMZCn6BN+r13qMrFX tPGXDkbPpyZP5yrK/6KJA5VvODcFCdMm0voE19mQVK9LyQcOK9kbFSN4+cFZxsMCu1Fn tu648WZwTwWrDB0pnF5zC6jZG9IRPeb9PztdmyWygFZI/lNjTN6jMdp+H48Tlg06KvbP iAS+1dqKOclsbdRJRbexXzoFmS8pZe/D/zT1+HoK/f0MN66Sk/yK0nlLwS5wEVMQOOja dsDPctFl21Yu2hZPxTKSvHbmzsSL/HyOO2ZaRRymKqi0coTCh0CbXSr5aLRyi1VP5sPY Rt/Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g26si3180056edu.335.2020.07.27.04.06.17; Mon, 27 Jul 2020 04:06:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728200AbgG0KnA (ORCPT + 99 others); Mon, 27 Jul 2020 06:43:00 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:36774 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728176AbgG0KnA (ORCPT ); Mon, 27 Jul 2020 06:43:00 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: eballetbo) with ESMTPSA id 68A53295BE9 Subject: Re: [PATCH] platform/chrome: cros_ec: Fix host command for regulator control. To: Pi-Hsun Shih Cc: Benson Leung , Guenter Roeck , Mark Brown , Tzung-Bi Shih , Gwendal Grignou , Yicheng Li , open list References: <20200724080358.619245-1-pihsun@chromium.org> From: Enric Balletbo i Serra Message-ID: <223053a7-bcee-f8d2-1b9d-68503d04126f@collabora.com> Date: Mon, 27 Jul 2020 12:42:55 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20200724080358.619245-1-pihsun@chromium.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Pi-Hsun, Mark Thank you for your patch. On 24/7/20 10:03, Pi-Hsun Shih wrote: > Since the host command number 0x012B conflicts with other EC host > command, add one to all regulator control related host command. > > Also fix a wrong alignment on struct and sync the comment with the one > in ChromeOS EC codebase. > > Fixes: dff08caf35ec ("platform/chrome: cros_ec: Add command for regulator control.") > Signed-off-by: Pi-Hsun Shih Acked-by: Enric Balletbo i Serra This needs to go through Mark Brown's regulator tree as depends on dff08caf35ec, if not, I can pick as a fix when the next merge window is closed. > --- > The original numbers were chosen before the 0x012B is used in ChromeOS > EC codebase. Since the original kernel patch got accepted before the > corresponding commit in ChromeOS EC codebase got merged, the host > command number was used by other commit first. > Ups, next time we need to make sure the EC code lands before. > Since now the commit in ChromeOS EC codebase > (https://crrev.com/c/2247431) with updated host command numbers got > merged, need this patch to sync up the host command numbers with > ChromeOS EC codebase. Sorry for the confusion. > --- > include/linux/platform_data/cros_ec_commands.h | 15 ++++++++------- > 1 file changed, 8 insertions(+), 7 deletions(-) > > diff --git a/include/linux/platform_data/cros_ec_commands.h b/include/linux/platform_data/cros_ec_commands.h > index a417b51b5764..91e77f53414d 100644 > --- a/include/linux/platform_data/cros_ec_commands.h > +++ b/include/linux/platform_data/cros_ec_commands.h > @@ -5438,7 +5438,7 @@ struct ec_response_rollback_info { > * > * Returns the regulator name and supported voltage list in mV. > */ > -#define EC_CMD_REGULATOR_GET_INFO 0x012B > +#define EC_CMD_REGULATOR_GET_INFO 0x012C > > /* Maximum length of regulator name */ > #define EC_REGULATOR_NAME_MAX_LEN 16 > @@ -5454,12 +5454,12 @@ struct ec_response_regulator_get_info { > char name[EC_REGULATOR_NAME_MAX_LEN]; > uint16_t num_voltages; > uint16_t voltages_mv[EC_REGULATOR_VOLTAGE_MAX_COUNT]; > -} __ec_align1; > +} __ec_align2; > > /* > * Configure the regulator as enabled / disabled. > */ > -#define EC_CMD_REGULATOR_ENABLE 0x012C > +#define EC_CMD_REGULATOR_ENABLE 0x012D > > struct ec_params_regulator_enable { > uint32_t index; > @@ -5471,7 +5471,7 @@ struct ec_params_regulator_enable { > * > * Returns 1 if the regulator is enabled, 0 if not. > */ > -#define EC_CMD_REGULATOR_IS_ENABLED 0x012D > +#define EC_CMD_REGULATOR_IS_ENABLED 0x012E > > struct ec_params_regulator_is_enabled { > uint32_t index; > @@ -5489,7 +5489,7 @@ struct ec_response_regulator_is_enabled { > * Also note that this might be called before the regulator is enabled, and the > * setting should be in effect after the regulator is enabled. > */ > -#define EC_CMD_REGULATOR_SET_VOLTAGE 0x012E > +#define EC_CMD_REGULATOR_SET_VOLTAGE 0x012F > > struct ec_params_regulator_set_voltage { > uint32_t index; > @@ -5500,9 +5500,10 @@ struct ec_params_regulator_set_voltage { > /* > * Get the currently configured voltage for the voltage regulator. > * > - * Note that this might be called before the regulator is enabled. > + * Note that this might be called before the regulator is enabled, and this > + * should return the configured output voltage if the regulator is enabled. > */ > -#define EC_CMD_REGULATOR_GET_VOLTAGE 0x012F > +#define EC_CMD_REGULATOR_GET_VOLTAGE 0x0130 > > struct ec_params_regulator_get_voltage { > uint32_t index; > > base-commit: 8d9f8d57e023893bfa708d83e3a787e77766a378 >