From patchwork Mon Sep 25 19:21:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Stezenbach X-Patchwork-Id: 9970387 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B3ED96038E for ; Mon, 25 Sep 2017 19:21:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A381A28CB5 for ; Mon, 25 Sep 2017 19:21:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 984BC28CCB; Mon, 25 Sep 2017 19:21:23 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4072328CE3 for ; Mon, 25 Sep 2017 19:21:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965742AbdIYTVW (ORCPT ); Mon, 25 Sep 2017 15:21:22 -0400 Received: from mail.sig21.net ([80.244.240.74]:49077 "EHLO mail.sig21.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965005AbdIYTVV (ORCPT ); Mon, 25 Sep 2017 15:21:21 -0400 Received: from p5ddc7999.dip0.t-ipconnect.de ([93.220.121.153] helo=abc.local) by mail.sig21.net with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dwYwK-0006Uj-5d; Mon, 25 Sep 2017 21:21:13 +0200 Received: from js by abc.local with local (Exim 4.89) (envelope-from ) id 1dwYwH-0003Vq-4Z; Mon, 25 Sep 2017 21:21:09 +0200 Date: Mon, 25 Sep 2017 21:21:09 +0200 From: Johannes Stezenbach To: "Rafael J. Wysocki" Cc: Pierre-Louis Bossart , linux-clk@vger.kernel.org, linux-pm@vger.kernel.org, Carlo Caione , Andy Shevchenko , Darren Hart , Enric Balletbo i Serra , Takashi Iwai , linux-acpi@vger.kernel.org Subject: [RFC PATCH 1/2] platform/x86: add Atom PMC quirk to disable SATA Message-ID: <20170925192109.rty2fnm7c4jnj3vx@sig21.net> References: <20170906204237.24x6fzlfmq7jmuce@sig21.net> <4254964.MfDMP6QAfg@aspire.rjw.lan> <20170922080453.3bwad4ale4zizf42@sig21.net> <1555462.9U3gvkyXAX@aspire.rjw.lan> <20170925191749.2oamusbajgs6clcg@sig21.net> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20170925191749.2oamusbajgs6clcg@sig21.net> User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP SATA controller is enabled on Asus E200HA even though the machine doesn't use it (it has eMMC storage), however SATA being on blocks S0ix entry so we need to disable it. Signed-off-by: Johannes Stezenbach --- drivers/platform/x86/pmc_atom.c | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/drivers/platform/x86/pmc_atom.c b/drivers/platform/x86/pmc_atom.c index 8d13c86cc418..b5dd38712268 100644 --- a/drivers/platform/x86/pmc_atom.c +++ b/drivers/platform/x86/pmc_atom.c @@ -17,6 +17,7 @@ #include #include +#include #include #include #include @@ -57,6 +58,9 @@ struct pmc_dev { static struct pmc_dev pmc_device; static u32 acpi_base_addr; +static u32 quirks; +#define QUIRK_DISABLE_SATA BIT(0) + static const struct pmc_clk byt_clks[] = { { .name = "xtal", @@ -271,6 +275,15 @@ static void pmc_hw_reg_setup(struct pmc_dev *pmc) * - GPIO_SCORE shared IRQ */ pmc_reg_write(pmc, PMC_S0IX_WAKE_EN, (u32)PMC_WAKE_EN_SETTING); + + if (quirks & QUIRK_DISABLE_SATA) { + u32 func_dis; + + pr_info("pmc: disable SATA IP\n"); + func_dis = pmc_reg_read(pmc, PMC_FUNC_DIS); + func_dis |= BIT_SATA; + pmc_reg_write(pmc, PMC_FUNC_DIS, func_dis); + } } #ifdef CONFIG_DEBUG_FS @@ -500,6 +513,24 @@ static struct pmc_notifier_block pmc_freeze_nb = { }; #endif +static int cht_asus_e200ha_cb(const struct dmi_system_id *id) +{ + pr_info("pmc: Asus E200HA detected\n"); + quirks |= QUIRK_DISABLE_SATA; + return 1; +} + +static const struct dmi_system_id cht_table[] = { + { + .callback = cht_asus_e200ha_cb, + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), + DMI_MATCH(DMI_PRODUCT_NAME, "E200HA"), + }, + }, + { } +}; + static int pmc_setup_dev(struct pci_dev *pdev, const struct pci_device_id *ent) { struct pmc_dev *pmc = &pmc_device; @@ -526,6 +557,8 @@ static int pmc_setup_dev(struct pci_dev *pdev, const struct pci_device_id *ent) pmc->map = map; + dmi_check_system(cht_table); + /* PMC hardware registers setup */ pmc_hw_reg_setup(pmc);