Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1511853pxb; Thu, 4 Mar 2021 13:19:47 -0800 (PST) X-Google-Smtp-Source: ABdhPJzL+s3F7RkYnOKzs1wkVCrYs8Tv6RuGdOwXRncD56lNxjGd/aHQmfughNhtEIuNeBl056I0 X-Received: by 2002:a17:906:c0d7:: with SMTP id bn23mr6428184ejb.94.1614892787121; Thu, 04 Mar 2021 13:19:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614892787; cv=none; d=google.com; s=arc-20160816; b=M89FjBaGS9jcq6R4TOOno1FNvR1uMGs6qOLHDb0PYiNqFVdaNMqZYbcN7rOYhuldN0 pW0PpbAqdEVc1NpPDCF6jGT83XPb2wWiPuf/WZgPefez6KT1lK7IhMA+lRKGLDE3ZJCj FpXHW2iY1W+SEQrzt8t0FgwmYPZ8k/Y6HCRejgL80/ty9DfMf3AcHwkY2KIPhRQW0RS5 tiT1pVGuTcdVe9kO3IaV7BCuH4mdEUSzmi94I+QvshXUA4dktIdrew2QffEmb7aSl06Y Sdn7n4cjc7U5IZ8+ksxA6wyTN9CeX7neX/YtiW7iJpnEYWicgqokM10L0695lSB7/786 ZYoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from:ironport-sdr :ironport-sdr; bh=FGkaSVgNEeVZVQCaCC818l67i8VmUfLyG+1h3Uo6Itw=; b=XeyJl0rdUvpZn28C6tzH5/qvr3lT/Qy9ks4j/MPt2NXcJSQMAUDEi6P6qknmu9YTaI pOF+5vTPcPqOznD6SX22B59jLVbMTP5/UTkrD++bGMd20UiNRFiYLLNoNmzxFXZP8Ago pwWavFUA6ZnPYYiTnKvBedTOaVzr0EN53vScEjjiXldMZFqNximZrU9CtWzE5jhc1TL1 gvsOOl443Cg2nUIf7tvKv1Gq8EcnbUtZBHhf97JUhZJQ6+slTrZaziK7vKlBXdnnoRZz srZF+endVloxPpLA2h3CRA4Ov92SHe9etmWY886xl5gIh162DjpBkcDUT4h/5HBvXvar lNMg== 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=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id kf17si224556ejc.308.2021.03.04.13.19.23; Thu, 04 Mar 2021 13:19:47 -0800 (PST) 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1358633AbhCCMOY (ORCPT + 99 others); Wed, 3 Mar 2021 07:14:24 -0500 Received: from mga01.intel.com ([192.55.52.88]:35288 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1355277AbhCCG2n (ORCPT ); Wed, 3 Mar 2021 01:28:43 -0500 IronPort-SDR: Ux0z2ZcL7eAgh9fidPOJj/xJvlQ6Y8EOe1Z7WeCZcjHdb564c0tFXPhGm+vn3lNfVU/XYhQYEn DrMUy5GnBNQA== X-IronPort-AV: E=McAfee;i="6000,8403,9911"; a="206797464" X-IronPort-AV: E=Sophos;i="5.81,219,1610438400"; d="scan'208";a="206797464" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Mar 2021 22:28:04 -0800 IronPort-SDR: QO1PR4w9uIiXTYCgTkHLh/nhJIsQUMfyQ58OMMjSaFZgMQq1uGTOu2YgSodcg/vcvuzGCJaqiK b6I9PPPm27nA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,219,1610438400"; d="scan'208";a="600030995" Received: from host.sh.intel.com ([10.239.154.115]) by fmsmga005.fm.intel.com with ESMTP; 02 Mar 2021 22:28:03 -0800 From: Ye Xiang To: jikos@kernel.org, jic23@kernel.org, srinivas.pandruvada@linux.intel.com Cc: linux-input@vger.kernel.org, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Ye Xiang Subject: [PATCH] HID: intel_ish-hid: HBM: Use connected standby state bit during suspend/resume Date: Wed, 3 Mar 2021 14:28:25 +0800 Message-Id: <20210303062825.7724-1-xiang.ye@intel.com> X-Mailer: git-send-email 2.17.1 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ISH firmware uses connected standby state bit (CONNECTED_STANDBY_STATE_BIT bit 1) to notify current power state to sensors instead of suspend state bit (bit 0). So send both SUSPEND_STATE_BIT and CONNECTED_STANDBY_STATE_BIT to firmware to be compatible with the previous version. Signed-off-by: xiangye --- drivers/hid/intel-ish-hid/ishtp/hbm.c | 6 +++--- drivers/hid/intel-ish-hid/ishtp/hbm.h | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/hid/intel-ish-hid/ishtp/hbm.c b/drivers/hid/intel-ish-hid/ishtp/hbm.c index 30a91d068306..dbfae60f2621 100644 --- a/drivers/hid/intel-ish-hid/ishtp/hbm.c +++ b/drivers/hid/intel-ish-hid/ishtp/hbm.c @@ -914,7 +914,7 @@ static inline void fix_cl_hdr(struct ishtp_msg_hdr *hdr, size_t length, /*** Suspend and resume notification ***/ static uint32_t current_state; -static uint32_t supported_states = 0 | SUSPEND_STATE_BIT; +static uint32_t supported_states = SUSPEND_STATE_BIT | CONNECTED_STANDBY_STATE_BIT; /** * ishtp_send_suspend() - Send suspend message to FW @@ -933,7 +933,7 @@ void ishtp_send_suspend(struct ishtp_device *dev) memset(&state_status_msg, 0, len); state_status_msg.hdr.cmd = SYSTEM_STATE_STATUS; state_status_msg.supported_states = supported_states; - current_state |= SUSPEND_STATE_BIT; + current_state |= (SUSPEND_STATE_BIT | CONNECTED_STANDBY_STATE_BIT); dev->print_log(dev, "%s() sends SUSPEND notification\n", __func__); state_status_msg.states_status = current_state; @@ -959,7 +959,7 @@ void ishtp_send_resume(struct ishtp_device *dev) memset(&state_status_msg, 0, len); state_status_msg.hdr.cmd = SYSTEM_STATE_STATUS; state_status_msg.supported_states = supported_states; - current_state &= ~SUSPEND_STATE_BIT; + current_state &= ~(CONNECTED_STANDBY_STATE_BIT | SUSPEND_STATE_BIT); dev->print_log(dev, "%s() sends RESUME notification\n", __func__); state_status_msg.states_status = current_state; diff --git a/drivers/hid/intel-ish-hid/ishtp/hbm.h b/drivers/hid/intel-ish-hid/ishtp/hbm.h index 7c445b203f2a..08f3f3ceb18c 100644 --- a/drivers/hid/intel-ish-hid/ishtp/hbm.h +++ b/drivers/hid/intel-ish-hid/ishtp/hbm.h @@ -235,6 +235,7 @@ struct dma_xfer_hbm { #define SYSTEM_STATE_QUERY_SUBSCRIBERS 0x3 #define SYSTEM_STATE_STATE_CHANGE_REQ 0x4 /*indicates suspend and resume states*/ +#define CONNECTED_STANDBY_STATE_BIT (1<<0) #define SUSPEND_STATE_BIT (1<<1) struct ish_system_states_header { -- 2.17.1