From patchwork Mon Jan 30 19:36:32 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 92916 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp1602466qgi; Mon, 30 Jan 2017 11:44:33 -0800 (PST) X-Received: by 10.84.128.33 with SMTP id 30mr33940872pla.128.1485805473258; Mon, 30 Jan 2017 11:44:33 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g71si13528480pfd.122.2017.01.30.11.44.33; Mon, 30 Jan 2017 11:44:33 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754326AbdA3Toa (ORCPT + 13 others); Mon, 30 Jan 2017 14:44:30 -0500 Received: from mail-lf0-f54.google.com ([209.85.215.54]:35640 "EHLO mail-lf0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754324AbdA3To3 (ORCPT ); Mon, 30 Jan 2017 14:44:29 -0500 Received: by mail-lf0-f54.google.com with SMTP id n124so199740472lfd.2 for ; Mon, 30 Jan 2017 11:44:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=C1kCK6C9XXhoxGHVyvtnrHdgd364b9n+7ZyhL0j8Peo=; b=dN0u3+FwTdpdGwTWEkeAXPj+6a6EVxz2lfVyTqFFeMwQYV87tJ2O1VevvdnQmN8irz 5lK2NI20nvPtQpLPCZwEsuydMqU7pQW1y0VXo/HuKhCXtR+f+eL99KCDEq7xKEjNmInA IRaa0gxegve5nD8a7jDUOosL4YeZC9Ql1Twfo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=C1kCK6C9XXhoxGHVyvtnrHdgd364b9n+7ZyhL0j8Peo=; b=BLcE3qRd1rTlyKNckbz6OAteLuAUfCpEHHIPndmVbB3ogt4NVfOEPVAsJyc/TxBURj AKnNwBFLmyOkC6V2SYKfAvyD3aYgQtY+BB1QB3LO+y/znihliznScgr/VgdB/7vanVmO NEQVOV4cJFoehRm2NLmelYOsG49mxru3RlwJh5f46TIFifjF4mLYIRpmNTX7yY+pCHZB Gcd4HFT8UByOxP1tboLRTywTiITGYAIU6fOb0UjYlO4pT48+Hnrra11dQVz506x1FRSe pFW1d6Gq/Tw6gPukp6iVo+4jhykwcEOzcppPrB8CGV2a7fTOdBjAeZkXYEVtXtG4G/6j V7Sg== X-Gm-Message-State: AIkVDXKnAK366l5r37RCOJOVfDyc9F0PIwCZygSO0y63k6WRBVaSyJf1ALYIGLkAD1YfIYtX X-Received: by 10.46.87.73 with SMTP id r9mr8586304ljd.22.1485805004027; Mon, 30 Jan 2017 11:36:44 -0800 (PST) Received: from localhost.localdomain (c-357171d5.014-348-6c756e10.cust.bredbandsbolaget.se. [213.113.113.53]) by smtp.gmail.com with ESMTPSA id m18sm3928521lfe.45.2017.01.30.11.36.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 30 Jan 2017 11:36:43 -0800 (PST) From: Linus Walleij To: Hans Ulli Kroll , Florian Fainelli , linux-arm-kernel@lists.infradead.org, Sebastian Reichel Cc: Janos Laube , Paulius Zaleckas , openwrt-devel@openwrt.org, linux-pm@vger.kernel.org, Linus Walleij , devicetree@vger.kernel.org Subject: [PATCH 1/4] power: reset: Add Gemini poweroff DT bindings Date: Mon, 30 Jan 2017 20:36:32 +0100 Message-Id: <20170130193635.18644-1-linus.walleij@linaro.org> X-Mailer: git-send-email 2.9.3 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org This adds device tree bindings to the power management controller in the Gemini SoC. Cc: devicetree@vger.kernel.org Cc: Janos Laube Cc: Paulius Zaleckas Cc: Hans Ulli Kroll Cc: Florian Fainelli Signed-off-by: Linus Walleij --- Sebastian: please just merge this when your are pleased with it. I will funnel the ARM parts through the ARM SoC tree. --- .../devicetree/bindings/power/reset/gemini-poweroff.txt | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 Documentation/devicetree/bindings/power/reset/gemini-poweroff.txt -- 2.9.3 -- To unsubscribe from this list: send the line "unsubscribe linux-pm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/Documentation/devicetree/bindings/power/reset/gemini-poweroff.txt b/Documentation/devicetree/bindings/power/reset/gemini-poweroff.txt new file mode 100644 index 000000000000..7fec3e100214 --- /dev/null +++ b/Documentation/devicetree/bindings/power/reset/gemini-poweroff.txt @@ -0,0 +1,17 @@ +* Device-Tree bindings for Cortina Systems Gemini Poweroff + +This is a special IP block in the Cortina Gemini SoC that only +deals with different ways to power the system down. + +Required properties: +- compatible: should be "cortina,gemini-power-controller" +- reg: should contain the physical memory base and size +- interrupts: should contain the power management interrupt + +Example: + +power-controller@4b000000 { + compatible = "cortina,gemini-power-controller"; + reg = <0x4b000000 0x100>; + interrupts = <26 IRQ_TYPE_EDGE_FALLING>; +}; From patchwork Mon Jan 30 19:36:33 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 92915 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp1601901qgi; Mon, 30 Jan 2017 11:43:00 -0800 (PST) X-Received: by 10.98.8.11 with SMTP id c11mr24937211pfd.135.1485805380701; Mon, 30 Jan 2017 11:43:00 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s17si9227793pgo.49.2017.01.30.11.43.00; Mon, 30 Jan 2017 11:43:00 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754186AbdA3Tm6 (ORCPT + 13 others); Mon, 30 Jan 2017 14:42:58 -0500 Received: from mail-lf0-f42.google.com ([209.85.215.42]:33633 "EHLO mail-lf0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750883AbdA3Tm4 (ORCPT ); Mon, 30 Jan 2017 14:42:56 -0500 Received: by mail-lf0-f42.google.com with SMTP id x1so113425557lff.0 for ; Mon, 30 Jan 2017 11:42:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=aUfuB+mv9N8gzNTekHJM6xSxAOPekgI/19MmaC1Hkoc=; b=kiGzjGfeepxCtSqtjpdSufzg4pDcM9yYFgDxOCjRwBSxRpaVAh7MtcyUxoidT78EZ0 k2eYNN7JsHX64ue/Z2etatzjVpbHAPkrTV1PSXduoFE2FENbPnP46c/YmvOOD/mAJRF2 UPMr1yZY13qrv0+Aee/Jp8c3qhqdMvd1xmBlQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=aUfuB+mv9N8gzNTekHJM6xSxAOPekgI/19MmaC1Hkoc=; b=Ed9iO6Tvk8lv7cDFmcYRZujFJ/Ar3N/mhSHNjHxHmmxa+005S/muYDB3Yu9z/ubX+c iGW1L+iAqgUSH5G5wFSY3nW1yn5Aw/fJohBEvfA69BNRqP5u6N//Q/k4iGi1HCRIQriQ stQvfcoe3jubQBxNVYpaCZ9vtwsPA4nT70IJFHIOz+iSSPVMA5SzdFuieNhgjKNJ4uYy guihjEYhYnVyihQnaa1T4n+m51m+0SkA5mOXYhn+/30kqqo/dFu+r7Cpb1G6aovYB167 mnzoh37cpkh74B++IpCV868qcubno82mt7KMEjzOAO+Pp2DQK5EhSovqowfoH0TR06E5 87XA== X-Gm-Message-State: AIkVDXIFziZdWVgdGh/dHPlA79OWznvAnJH9nrjQm5UwTVk0v4BZAbEx+/JSofBJ45yuAByv X-Received: by 10.25.22.96 with SMTP id m93mr8081594lfi.101.1485805006882; Mon, 30 Jan 2017 11:36:46 -0800 (PST) Received: from localhost.localdomain (c-357171d5.014-348-6c756e10.cust.bredbandsbolaget.se. [213.113.113.53]) by smtp.gmail.com with ESMTPSA id m18sm3928521lfe.45.2017.01.30.11.36.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 30 Jan 2017 11:36:45 -0800 (PST) From: Linus Walleij To: Hans Ulli Kroll , Florian Fainelli , linux-arm-kernel@lists.infradead.org, Sebastian Reichel Cc: Janos Laube , Paulius Zaleckas , openwrt-devel@openwrt.org, linux-pm@vger.kernel.org, Linus Walleij Subject: [PATCH 2/4] power: reset: Add a driver for the Gemini poweroff Date: Mon, 30 Jan 2017 20:36:33 +0100 Message-Id: <20170130193635.18644-2-linus.walleij@linaro.org> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170130193635.18644-1-linus.walleij@linaro.org> References: <20170130193635.18644-1-linus.walleij@linaro.org> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org The Gemini (SL3516) SoC has a special power controller block that only deal with shutting down the system. If you do not register a driver and activate the block, the power button on the systems utilizing this SoC will do an uncontrolled power cut, which is why it is important to have a special poweroff driver. The most basic functionality is to just shut down the system by writing a special bit in the control register after the system has reached pm_poweroff. It also handles the poweroff from a button or other sources: When the poweroff button is pressed, or a signal is sent to poweroff from an infrared remote control, or when the RTC fires a special alarm (!) the system emits an interrupt. At this point, Linux must acknowledge the interrupt and proceed to do an orderly shutdown of the system. After adding this driver, pressing the poweroff button gives this dmesg: root@gemini:/ root@gemini:/ gemini-poweroff 4b000000.power-controller: poweroff button pressed calling shutdown scripts.. setting /dev/rtc0 from system time unmounting file systems... umount: tmpfs busy - remounted read-only umount: can't unmount /: Invalid argument The system is going down NOW! Sent SIGTERM to all processes Sent SIGKILL to all processes Requesting system poweroff uhci_hcd 0000:00:09.1: HCRESET not completed yet! uhci_hcd 0000:00:09.0: HCRESET not completed yet! reboot: Power down gemini-poweroff 4b000000.power-controller: Gemini power off Cc: Janos Laube Cc: Paulius Zaleckas Cc: Hans Ulli Kroll Cc: Florian Fainelli Cc: linux-pm@vger.kernel.org Cc: Sebastian Reichel Signed-off-by: Linus Walleij --- Sebastian: please just merge this when your are pleased with it. I will funnel the ARM parts through the ARM SoC tree. --- drivers/power/reset/Kconfig | 9 ++ drivers/power/reset/Makefile | 1 + drivers/power/reset/gemini-poweroff.c | 160 ++++++++++++++++++++++++++++++++++ 3 files changed, 170 insertions(+) create mode 100644 drivers/power/reset/gemini-poweroff.c -- 2.9.3 -- To unsubscribe from this list: send the line "unsubscribe linux-pm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/power/reset/Kconfig b/drivers/power/reset/Kconfig index abeb77217a21..0d2c4183d0ff 100644 --- a/drivers/power/reset/Kconfig +++ b/drivers/power/reset/Kconfig @@ -67,6 +67,15 @@ config POWER_RESET_BRCMSTB Say Y here if you have a Broadcom STB board and you wish to have restart support. +config POWER_RESET_GEMINI_POWEROFF + bool "Cortina Gemini power-off driver" + depends on ARCH_GEMINI || COMPILE_TEST + depends on OF && HAS_IOMEM + default ARCH_GEMINI + help + This driver supports turning off the Cortina Gemini SoC. + Select this if you're building a kernel with Gemini SoC support. + config POWER_RESET_GPIO bool "GPIO power-off driver" depends on OF_GPIO diff --git a/drivers/power/reset/Makefile b/drivers/power/reset/Makefile index 11dae3b56ff9..58cf5b30559f 100644 --- a/drivers/power/reset/Makefile +++ b/drivers/power/reset/Makefile @@ -5,6 +5,7 @@ obj-$(CONFIG_POWER_RESET_AT91_SAMA5D2_SHDWC) += at91-sama5d2_shdwc.o obj-$(CONFIG_POWER_RESET_AXXIA) += axxia-reset.o obj-$(CONFIG_POWER_RESET_BRCMKONA) += brcm-kona-reset.o obj-$(CONFIG_POWER_RESET_BRCMSTB) += brcmstb-reboot.o +obj-$(CONFIG_POWER_RESET_GEMINI_POWEROFF) += gemini-poweroff.o obj-$(CONFIG_POWER_RESET_GPIO) += gpio-poweroff.o obj-$(CONFIG_POWER_RESET_GPIO_RESTART) += gpio-restart.o obj-$(CONFIG_POWER_RESET_HISI) += hisi-reboot.o diff --git a/drivers/power/reset/gemini-poweroff.c b/drivers/power/reset/gemini-poweroff.c new file mode 100644 index 000000000000..de878fd26f27 --- /dev/null +++ b/drivers/power/reset/gemini-poweroff.c @@ -0,0 +1,160 @@ +/* + * Gemini power management controller + * Copyright (C) 2017 Linus Walleij + * + * Inspired by code from the SL3516 board support by Jason Lee + * Inspired by code from Janos Laube + */ +#include +#include +#include +#include +#include +#include +#include +#include + +#define GEMINI_PWC_ID 0x00010500 +#define GEMINI_PWC_IDREG 0x00 +#define GEMINI_PWC_CTRLREG 0x04 +#define GEMINI_PWC_STATREG 0x08 + +#define GEMINI_CTRL_SHUTDOWN BIT(0) +#define GEMINI_CTRL_ENABLE BIT(1) +#define GEMINI_CTRL_IRQ_CLR BIT(2) + +#define GEMINI_STAT_CIR BIT(4) +#define GEMINI_STAT_RTC BIT(5) +#define GEMINI_STAT_POWERBUTTON BIT(6) + +struct gemini_powercon { + struct device *dev; + void __iomem *base; +}; + +static irqreturn_t gemini_powerbutton_interrupt(int irq, void *data) +{ + struct gemini_powercon *gpw = data; + u32 val; + + /* ACK the IRQ */ + val = readl(gpw->base + GEMINI_PWC_CTRLREG); + val |= GEMINI_CTRL_IRQ_CLR; + writel(val, gpw->base + GEMINI_PWC_CTRLREG); + + val = readl(gpw->base + GEMINI_PWC_STATREG); + val &= 0x70U; + switch (val) { + case GEMINI_STAT_CIR: + dev_info(gpw->dev, "infrared poweroff\n"); + orderly_poweroff(true); + break; + case GEMINI_STAT_RTC: + dev_info(gpw->dev, "RTC poweroff\n"); + orderly_poweroff(true); + break; + case GEMINI_STAT_POWERBUTTON: + dev_info(gpw->dev, "poweroff button pressed\n"); + orderly_poweroff(true); + break; + default: + dev_info(gpw->dev, "other power management IRQ\n"); + break; + } + + return IRQ_HANDLED; +} + +/* This callback needs this static local as it has void as argument */ +static struct gemini_powercon *gpw_poweroff; + +static void gemini_poweroff(void) +{ + struct gemini_powercon *gpw = gpw_poweroff; + u32 val; + + dev_crit(gpw->dev, "Gemini power off\n"); + val = readl(gpw->base + GEMINI_PWC_CTRLREG); + val |= GEMINI_CTRL_ENABLE | GEMINI_CTRL_IRQ_CLR; + writel(val, gpw->base + GEMINI_PWC_CTRLREG); + + val &= ~GEMINI_CTRL_ENABLE; + val |= GEMINI_CTRL_SHUTDOWN; + writel(val, gpw->base + GEMINI_PWC_CTRLREG); +} + +static int gemini_poweroff_probe(struct platform_device *pdev) +{ + struct device *dev = &pdev->dev; + struct resource *res; + struct gemini_powercon *gpw; + u32 val; + int irq; + int ret; + + gpw = devm_kzalloc(dev, sizeof(*gpw), GFP_KERNEL); + if (!gpw) + return -ENOMEM; + + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); + gpw->base = devm_ioremap_resource(dev, res); + if (IS_ERR(gpw->base)) + return PTR_ERR(gpw->base); + + irq = platform_get_irq(pdev, 0); + if (!irq) + return -EINVAL; + + gpw->dev = dev; + + val = readl(gpw->base + GEMINI_PWC_IDREG); + val &= 0xFFFFFF00U; + if (val != GEMINI_PWC_ID) { + dev_err(dev, "wrong power controller ID: %08x\n", + val); + return -ENODEV; + } + + /* Clear the power management IRQ */ + val = readl(gpw->base + GEMINI_PWC_CTRLREG); + val |= GEMINI_CTRL_IRQ_CLR; + writel(val, gpw->base + GEMINI_PWC_CTRLREG); + + ret = devm_request_irq(dev, irq, gemini_powerbutton_interrupt, 0, + "poweroff", gpw); + if (ret) + return ret; + + pm_power_off = gemini_poweroff; + gpw_poweroff = gpw; + + /* + * Enable the power controller. This is crucial on Gemini + * systems: if this is not done, pressing the power button + * will result in unconditional poweroff without any warning. + * This makes the kernel handle the poweroff. + */ + val = readl(gpw->base + GEMINI_PWC_CTRLREG); + val |= GEMINI_CTRL_ENABLE; + writel(val, gpw->base + GEMINI_PWC_CTRLREG); + + dev_info(dev, "Gemini poweroff driver registered\n"); + + return 0; +} + +static const struct of_device_id gemini_poweroff_of_match[] = { + { + .compatible = "cortina,gemini-power-controller", + }, + {} +}; + +static struct platform_driver gemini_poweroff_driver = { + .probe = gemini_poweroff_probe, + .driver = { + .name = "gemini-poweroff", + .of_match_table = gemini_poweroff_of_match, + }, +}; +builtin_platform_driver(gemini_poweroff_driver); From patchwork Mon Jan 30 19:36:34 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 92914 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp1600380qgi; Mon, 30 Jan 2017 11:38:40 -0800 (PST) X-Received: by 10.84.136.34 with SMTP id 31mr33757025plk.52.1485805119993; Mon, 30 Jan 2017 11:38:39 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w10si9226284pgc.131.2017.01.30.11.38.39; Mon, 30 Jan 2017 11:38:39 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932364AbdA3Tia (ORCPT + 13 others); Mon, 30 Jan 2017 14:38:30 -0500 Received: from mail-lf0-f51.google.com ([209.85.215.51]:35582 "EHLO mail-lf0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754089AbdA3Thv (ORCPT ); Mon, 30 Jan 2017 14:37:51 -0500 Received: by mail-lf0-f51.google.com with SMTP id n124so199636486lfd.2 for ; Mon, 30 Jan 2017 11:36:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=BCjNJ3n2AXjEpNG7qYkUSfoOHp8UpB3PMUmRdt6wAPY=; b=Bqk/1+N06WW1wrr96NKzV+G2sWLVusi2K7mUycn8Af3+1HXWDoXp7KigGNekNs5Hfg tU4wAnDNAi6C0fLMzrdlT+X3TABBd8oBoBEnRIMpHPjXsIb0zr27LypzyDM4iDcUreL0 IlGT7J8zokW5c+684mjEu1DZwE02VptTaE2Eg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=BCjNJ3n2AXjEpNG7qYkUSfoOHp8UpB3PMUmRdt6wAPY=; b=mlFsXxYGoOp6Fo1CKA/utBMH3hcmCZTIfxwN3lIS6IuqpiRk2cod3bfrRVTYp46l4q 1Q2dy3BjOXB55FJQu9qlxl520i5K/dWseyanDLiPuu+Q2HU98fX/E2NboREd413i5fEx pvMsGrihA0AVLffKoGaWII60oAlx8/yaKJCY+mKQEyZieBDUZCJO1H/Dj10FrlMjTytW qD9oGCottgFMyHhB8bg/1J0T+9S6fvSIumkeDyoFLK/k1H9bnYcM5vE533M8PIVV3iqg A+7VoeAVeb+cqwMZID1S1JWnx+K88hGgYCRsc7x5+d8jI58Qmm9cTajZp+hg7SVwTah3 JaaQ== X-Gm-Message-State: AIkVDXKuP0K505z6Qd8taShIBDjiMg7rCZCypVK7TUhMdpxDsqfuYwJ8xvaZbp1xmeDJAgP6 X-Received: by 10.46.15.1 with SMTP id 1mr4168376ljp.52.1485805013752; Mon, 30 Jan 2017 11:36:53 -0800 (PST) Received: from localhost.localdomain (c-357171d5.014-348-6c756e10.cust.bredbandsbolaget.se. [213.113.113.53]) by smtp.gmail.com with ESMTPSA id m18sm3928521lfe.45.2017.01.30.11.36.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 30 Jan 2017 11:36:52 -0800 (PST) From: Linus Walleij To: Hans Ulli Kroll , Florian Fainelli , linux-arm-kernel@lists.infradead.org, Sebastian Reichel Cc: Janos Laube , Paulius Zaleckas , openwrt-devel@openwrt.org, linux-pm@vger.kernel.org, Linus Walleij Subject: [PATCH 3/4] ARM: gemini: select gemini poweroff Date: Mon, 30 Jan 2017 20:36:34 +0100 Message-Id: <20170130193635.18644-3-linus.walleij@linaro.org> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170130193635.18644-1-linus.walleij@linaro.org> References: <20170130193635.18644-1-linus.walleij@linaro.org> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org It's especially annoying if the system cannot be properly powered down so select the poweroff driver from the Kconfig. Cc: Janos Laube Cc: Paulius Zaleckas Cc: Hans Ulli Kroll Cc: Florian Fainelli Signed-off-by: Linus Walleij --- Sebastian: this patch is just for context. I will funnel the ARM parts through the ARM SoC tree. --- arch/arm/mach-gemini/Kconfig | 1 + 1 file changed, 1 insertion(+) -- 2.9.3 -- To unsubscribe from this list: send the line "unsubscribe linux-pm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/arm/mach-gemini/Kconfig b/arch/arm/mach-gemini/Kconfig index 91ea52ccf13c..4b5c059d602b 100644 --- a/arch/arm/mach-gemini/Kconfig +++ b/arch/arm/mach-gemini/Kconfig @@ -7,6 +7,7 @@ menuconfig ARCH_GEMINI select GPIOLIB select MIGHT_HAVE_PCI select POWER_RESET + select POWER_RESET_GEMINI_POWEROFF select POWER_RESET_SYSCON select SERIAL_OF_PLATFORM help From patchwork Mon Jan 30 19:36:35 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 92913 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp1600378qgi; Mon, 30 Jan 2017 11:38:39 -0800 (PST) X-Received: by 10.84.229.72 with SMTP id d8mr33833838pln.21.1485805119550; Mon, 30 Jan 2017 11:38:39 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w10si9226284pgc.131.2017.01.30.11.38.39; Mon, 30 Jan 2017 11:38:39 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932167AbdA3Thx (ORCPT + 13 others); Mon, 30 Jan 2017 14:37:53 -0500 Received: from mail-lf0-f53.google.com ([209.85.215.53]:36191 "EHLO mail-lf0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754113AbdA3Thv (ORCPT ); Mon, 30 Jan 2017 14:37:51 -0500 Received: by mail-lf0-f53.google.com with SMTP id z134so200051924lff.3 for ; Mon, 30 Jan 2017 11:36:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=mZsw8yNPp34p/LxyyYOI4QPRZ5Wuf9wwkLPpxfp6+1A=; b=bXkpCuCNMA8aD2IJeHY44CjXR6d0XkLcbUjvq5ATkAuN5bbarGma7gdBIADbuQSJm2 cFoEMQuIiBu9k5ctnWPSZM6mEzC5EzxZM+5aRv55Ak5tlUGDSmHAc62YX9/ox7n3WEII DWy4+3Ttbzi/S4KQsL665cJchSk+xI3E2noVs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=mZsw8yNPp34p/LxyyYOI4QPRZ5Wuf9wwkLPpxfp6+1A=; b=j0MPToNUmkMMGtgpVAE5CTU/bDNM72sa+WB10XVDrHph1ldvcHMJTa8YROD/nLqJZd n8jIpD7RiIB+9K6lAVwHnbjViGBbUv4gxpr9ir2zemtAX8OfzEiocgN4RQWsRCRBaKy2 8lFe4RBx/cSWbwga7HteCTpTUDrjWfbUtPoFExRRmktqCymM44N86FCOGt2lq7s3Ji2v ZatXjevb3+GbFQtLNUL0HrFMzr2TKMECEUAgX/6OkjKEBwg999B9wmK3wUC713svu1HN DaJhg/++GvW47uRG1DGi6ywQKTZGRRev3XGM7hRtdiwvDpSOSGcvzT3lhUzg6v5udAOM Qcdg== X-Gm-Message-State: AIkVDXKpgWaX07ArYahce/HcluJvlSxcquDh7eMFLNqZDIMDgdXxgkH+cmSOh9oiZFKopuAs X-Received: by 10.25.221.193 with SMTP id w62mr7488300lfi.169.1485805018347; Mon, 30 Jan 2017 11:36:58 -0800 (PST) Received: from localhost.localdomain (c-357171d5.014-348-6c756e10.cust.bredbandsbolaget.se. [213.113.113.53]) by smtp.gmail.com with ESMTPSA id m18sm3928521lfe.45.2017.01.30.11.36.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 30 Jan 2017 11:36:57 -0800 (PST) From: Linus Walleij To: Hans Ulli Kroll , Florian Fainelli , linux-arm-kernel@lists.infradead.org, Sebastian Reichel Cc: Janos Laube , Paulius Zaleckas , openwrt-devel@openwrt.org, linux-pm@vger.kernel.org, Linus Walleij Subject: [PATCH 4/4] ARM: dts: add power controller to the Gemini DTS Date: Mon, 30 Jan 2017 20:36:35 +0100 Message-Id: <20170130193635.18644-4-linus.walleij@linaro.org> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170130193635.18644-1-linus.walleij@linaro.org> References: <20170130193635.18644-1-linus.walleij@linaro.org> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org This adds the Gemini power controller to the SoC DTSI file. Cc: Janos Laube Cc: Paulius Zaleckas Cc: Hans Ulli Kroll Cc: Florian Fainelli Signed-off-by: Linus Walleij --- Sebastian: this patch is just for context. I will funnel the ARM parts through the ARM SoC tree. --- arch/arm/boot/dts/gemini.dtsi | 6 ++++++ 1 file changed, 6 insertions(+) -- 2.9.3 -- To unsubscribe from this list: send the line "unsubscribe linux-pm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/arm/boot/dts/gemini.dtsi b/arch/arm/boot/dts/gemini.dtsi index df5630958038..8a2501239ae5 100644 --- a/arch/arm/boot/dts/gemini.dtsi +++ b/arch/arm/boot/dts/gemini.dtsi @@ -70,6 +70,12 @@ #interrupt-cells = <2>; }; + power-controller@4b000000 { + compatible = "cortina,gemini-power-controller"; + reg = <0x4b000000 0x100>; + interrupts = <26 IRQ_TYPE_EDGE_FALLING>; + }; + gpio0: gpio@4d000000 { compatible = "cortina,gemini-gpio"; reg = <0x4d000000 0x100>;