Received: by 2002:ac0:e350:0:0:0:0:0 with SMTP id g16csp1906376imn; Mon, 1 Aug 2022 04:41:59 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sLqFXQwuEaDCbxT8NHsoVgu/qZ0tSEMtIbLQLJZwhWx889dOXXXky/ryiMRiViIHPucp+l X-Received: by 2002:a05:6a00:150d:b0:52b:1ffb:503c with SMTP id q13-20020a056a00150d00b0052b1ffb503cmr15955162pfu.44.1659354119721; Mon, 01 Aug 2022 04:41:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659354119; cv=none; d=google.com; s=arc-20160816; b=YCEPNb10NxA97NiS187agOxGUwSOkhDf+lGn6A/C2nvufj2VI32+uIyDPI8uF0Odm9 ihwOgucMRK6YevD+1tsrEcTBUEcBu+lve9XUdmDL9w+5lbIMetQVV9dAl8PrlIvNts3d o2DEf2gj15Hr3AMuDn7v5tn2huEgWs7dz7fA3QWmcNKAz0oO8BTGoQvzrB0zkgEvIG2Y GdsnNIu2PiL3lcplEy4NL/ck1OAsf1Vg22iJ8eaC+BBm/57klcgiCb2AOZV/KeSnMFMb ZtjrWU59b9CjZWCJk4qId+4mQGKDcZaCD4jcmVhenjTaEXHygbpdPjSZg/uyiZcSDKjF Z34w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=2Gqy3kjqVmWzxUP62nTPzf8theCbyE+qqatOlfzLFUg=; b=ULU6BEgoLeWRcWKMNfF1cU+mI0Hk11aHy5T1rT/CM0WYNCDmWM7h6oGhRQqqEgZaPu 3pvQHUqMw+5b9NZJCYKjR4pOB/tLakB4lT0mM+akOvas0UMR/RwnYM9udgAb3rqtmdFm vTayB6NPw3hwDFarLUnz9GE1W7tpcP6NJBugawTxXdKWfINTXIhQtc67pXliRDr1bmJz aJFI0y/ja1aFhwFNRSTKkMTOMOvRmGAOijSoT/pbELZONuyWoCFSv4RskCfMkDTnlmYT FR3m2uSJ0S35ZlLprDOwtW9Nt/tilAu1FxYTRg59MoCFQtcuVBvhjDMaHifm25PANeS0 WE6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=TvpOsf1+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w29-20020a63475d000000b0041a88ab4ff7si13689458pgk.72.2022.08.01.04.41.44; Mon, 01 Aug 2022 04:41:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=TvpOsf1+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230032AbiHALhe (ORCPT + 99 others); Mon, 1 Aug 2022 07:37:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51306 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230202AbiHALh3 (ORCPT ); Mon, 1 Aug 2022 07:37:29 -0400 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6516731928; Mon, 1 Aug 2022 04:37:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1659353847; x=1690889847; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=X5Q8WbtPRI7SqkAlXyWf25H8CJnz0SH6tCH8FxNgIp8=; b=TvpOsf1+ATvvC3EntH3xruQ80ndCvHpnNc5wamAcPgRBcbo4gzz33mmR L0PjW3E8j7k/Y/L2fWE8Nwfi3svIAiAbXHRuNYKvkwF5SHcTbR4fyadLV kvAGv6/TG6z7ZbcXlhna4MTHOdZPpsq+XlKPSq+mOnMWAkTz9ikKi/QZC 42s7NDmlfClor//NzcBK6PVUDI6S87b9VuerH24d6XMBo9timWXDTxW93 Z6Jgnj5+RzIW+juuKDoYqoP9fIDoiaTdIoKoLvkzOHy6MhcLeavmzv5eg 3e1gPToFdZTduZOIXBsR9UFoupxoMtS1YokPH8t4S/DLgaSwqDi9k4m3i A==; X-IronPort-AV: E=McAfee;i="6400,9594,10425"; a="353128203" X-IronPort-AV: E=Sophos;i="5.93,206,1654585200"; d="scan'208";a="353128203" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Aug 2022 04:37:26 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,206,1654585200"; d="scan'208";a="744234884" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga001.fm.intel.com with ESMTP; 01 Aug 2022 04:37:25 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id B4DACF7; Mon, 1 Aug 2022 14:37:35 +0300 (EEST) From: Andy Shevchenko To: Hans de Goede , Andy Shevchenko , platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Mark Gross Subject: [PATCH v2 1/4] platform/x86: pmc_atom: Fix SLP_TYPx bitfield mask Date: Mon, 1 Aug 2022 14:37:31 +0300 Message-Id: <20220801113734.36131-1-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Intel hardware the SLP_TYPx bitfield occupies bits 10-12 as per ACPI specification (see Table 4.13 "PM1 Control Registers Fixed Hardware Feature Control Bits" for the details). Fix the mask and other related definitions accordingly. Fixes: 93e5eadd1f6e ("x86/platform: New Intel Atom SOC power management controller driver") Signed-off-by: Andy Shevchenko --- v2: addressed compilation error drivers/platform/x86/pmc_atom.c | 2 +- include/linux/platform_data/x86/pmc_atom.h | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/platform/x86/pmc_atom.c b/drivers/platform/x86/pmc_atom.c index b8b1ed1406de..c220172fefbb 100644 --- a/drivers/platform/x86/pmc_atom.c +++ b/drivers/platform/x86/pmc_atom.c @@ -232,7 +232,7 @@ static void pmc_power_off(void) pm1_cnt_port = acpi_base_addr + PM1_CNT; pm1_cnt_value = inl(pm1_cnt_port); - pm1_cnt_value &= SLEEP_TYPE_MASK; + pm1_cnt_value &= ~SLEEP_TYPE_MASK; pm1_cnt_value |= SLEEP_TYPE_S5; pm1_cnt_value |= SLEEP_ENABLE; diff --git a/include/linux/platform_data/x86/pmc_atom.h b/include/linux/platform_data/x86/pmc_atom.h index 6807839c718b..ea01dd80153b 100644 --- a/include/linux/platform_data/x86/pmc_atom.h +++ b/include/linux/platform_data/x86/pmc_atom.h @@ -7,6 +7,8 @@ #ifndef PMC_ATOM_H #define PMC_ATOM_H +#include + /* ValleyView Power Control Unit PCI Device ID */ #define PCI_DEVICE_ID_VLV_PMC 0x0F1C /* CherryTrail Power Control Unit PCI Device ID */ @@ -139,9 +141,9 @@ #define ACPI_MMIO_REG_LEN 0x100 #define PM1_CNT 0x4 -#define SLEEP_TYPE_MASK 0xFFFFECFF +#define SLEEP_TYPE_MASK GENMASK(12, 10) #define SLEEP_TYPE_S5 0x1C00 -#define SLEEP_ENABLE 0x2000 +#define SLEEP_ENABLE BIT(13) extern int pmc_atom_read(int offset, u32 *value); -- 2.35.1