From patchwork Wed Jun 8 01:04:28 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Agner X-Patchwork-Id: 9163171 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 1FCCA60572 for ; Wed, 8 Jun 2016 01:15:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1108E28372 for ; Wed, 8 Jun 2016 01:15:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 05BAE28377; Wed, 8 Jun 2016 01:15:28 +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=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 9DB5A28372 for ; Wed, 8 Jun 2016 01:15:27 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1bAS3s-0000Nf-IG; Wed, 08 Jun 2016 01:13:36 +0000 Received: from mail.kmu-office.ch ([178.209.48.109]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1bARvp-0003Wd-4s; Wed, 08 Jun 2016 01:05:57 +0000 Received: from trochilidae.toradex.int (75-146-58-181-Washington.hfc.comcastbusiness.net [75.146.58.181]) by mail.kmu-office.ch (Postfix) with ESMTPSA id 8FC665C1959; Wed, 8 Jun 2016 03:02:03 +0200 (CEST) From: Stefan Agner To: lee.jones@linaro.org, lgirdwood@gmail.com, broonie@kernel.org, khilman@baylibre.com, carlo@caione.org Subject: [PATCH v2 4/5] mfd: rn5t618: register power off callback optionally Date: Tue, 7 Jun 2016 18:04:28 -0700 Message-Id: <20160608010429.19618-5-stefan@agner.ch> X-Mailer: git-send-email 2.8.3 In-Reply-To: <20160608010429.19618-1-stefan@agner.ch> References: <20160608010429.19618-1-stefan@agner.ch> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=agner.ch; s=dkim; t=1465347727; bh=g2RB8KOr0dI1SCvN6SHsi7/sI0axgcB845Mw3v9wDHg=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=xzSyYkVQBZY3UgskjYgzAjYj3vZ4P8xXtKD5n7erjyueRLkLYh2Ru+RRnUXEsKHr/rN+UJkYW9CZn47lsM+ry01bgKweeToFYFkgVHs465k5ooeC9vj5P7KyoRrj/NL1HOZIi6pBVG+jJQo+YMtgXETy7AXQZ2tFP3km9NViDKo= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160607_180519_196988_38F0601B X-CRM114-Status: UNSURE ( 9.16 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mark.rutland@arm.com, devicetree@vger.kernel.org, pawel.moll@arm.com, ijc+devicetree@hellion.org.uk, max.oss.09@gmail.com, linux@armlinux.org.uk, Stefan Agner , linux-kernel@vger.kernel.org, b.galvani@gmail.com, robh+dt@kernel.org, marcel@ziswiler.com, galak@codeaurora.org, linux-amlogic@lists.infradead.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Only register power off if the PMIC is defined as system power controller (see Documentation/devicetree/bindings/power/ power-controller.txt). Reviewed-by: Marcel Ziswiler Signed-off-by: Stefan Agner --- drivers/mfd/rn5t618.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/mfd/rn5t618.c b/drivers/mfd/rn5t618.c index 7607ced..d9b4d40 100644 --- a/drivers/mfd/rn5t618.c +++ b/drivers/mfd/rn5t618.c @@ -103,9 +103,13 @@ static int rn5t618_i2c_probe(struct i2c_client *i2c, return ret; } - if (!pm_power_off) { - rn5t618_pm_power_off = priv; - pm_power_off = rn5t618_power_off; + if (of_device_is_system_power_controller(i2c->dev.of_node)) { + if (!pm_power_off) { + rn5t618_pm_power_off = priv; + pm_power_off = rn5t618_power_off; + } else { + dev_err(&i2c->dev, "Failed to set poweroff capability, already defined\n"); + } } return 0;