From patchwork Tue Mar 26 06:08:52 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 2334891 X-Patchwork-Delegate: rui.zhang@intel.com Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 0C326E014A for ; Tue, 26 Mar 2013 06:08:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757512Ab3CZGIz (ORCPT ); Tue, 26 Mar 2013 02:08:55 -0400 Received: from mail-pb0-f47.google.com ([209.85.160.47]:59605 "EHLO mail-pb0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754964Ab3CZGIy (ORCPT ); Tue, 26 Mar 2013 02:08:54 -0400 Received: by mail-pb0-f47.google.com with SMTP id rp2so4562914pbb.34 for ; Mon, 25 Mar 2013 23:08:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:date:sender:message-id:to:cc:in-reply-to:references:from :subject:mime-version:content-type; bh=TW/dhLvnHHn9AqBLXkEbJvPXpq/Zvoqo31sD3nB9he8=; b=QuH1g7zuD0QLVhYIYtOsxepP8JOEc5tkNpqeCH2kZUy4JJsgLvJL6gqIUoJfb7PTfh cJFCTkvruRTCpyaVQwI1jBqvKEYL4bybz4LIH8Pz/JOEpVf7vkI64ThxiD3s+/Tx8ueu NUNPYjHn8PJbwYGVdcxl7GVsBVr34ileCpbCekwQ/eW3VLEdW4NyEqnJbdI3LRVvK9hb MpMjoNOYgtr8Tqtwx43cXSa9C+2V3+wz6f+2sWqGGJ5C+piRRK4u//gfFgwqaaLGDBVb TlH5H0qHPN+RfEzVZUeGtUGRzuP/pbHUWAKhFysShD+GOiyKgQ102CugiAYV2AB5+Y4Z ozrA== X-Received: by 10.66.159.163 with SMTP id xd3mr22155252pab.47.1364278134027; Mon, 25 Mar 2013 23:08:54 -0700 (PDT) Received: from morimoto-Dell-XPS420.gmail.com (49.14.32.202.bf.2iij.net. [202.32.14.49]) by mx.google.com with ESMTPS id kb3sm16234163pbc.21.2013.03.25.23.08.51 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 25 Mar 2013 23:08:52 -0700 (PDT) Date: Mon, 25 Mar 2013 23:08:52 -0700 (PDT) Message-ID: <87obe6itfy.wl%kuninori.morimoto.gx@renesas.com> To: Zhang Rui Cc: Simon , Magnus , Kuninori Morimoto , linux-pm@vger.kernel.org, Linux-SH In-Reply-To: <87r4j2itio.wl%kuninori.morimoto.gx@renesas.com> References: <87620gqbbe.wl%kuninori.morimoto.gx@renesas.com> <874ng0qb9f.wl%kuninori.morimoto.gx@renesas.com> <1364200856.2465.48.camel@rzhang1-mobl4> <871ub3j9r3.wl%kuninori.morimoto.gx@renesas.com> <87sj3iiu5m.wl%kuninori.morimoto.gx@renesas.com> <87r4j2itio.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 2/2 v2] thermal: rcar: add pm_runtime_xxx() support MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Current rcar_thermal() didn't care about own power. Without this patch, rcar_thermal doesn't work on APE6 board Signed-off-by: Kuninori Morimoto --- v1 -> v2 - fixup pm_runtime_xxx() timing - fixup compile error drivers/thermal/rcar_thermal.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/thermal/rcar_thermal.c b/drivers/thermal/rcar_thermal.c index c199623..0f0f951 100644 --- a/drivers/thermal/rcar_thermal.c +++ b/drivers/thermal/rcar_thermal.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include @@ -377,6 +378,9 @@ static int rcar_thermal_probe(struct platform_device *pdev) spin_lock_init(&common->lock); common->dev = dev; + pm_runtime_enable(dev); + pm_runtime_get_sync(dev); + irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0); if (irq) { int ret; @@ -468,12 +472,16 @@ error_unregister: rcar_thermal_irq_disable(priv); } + pm_runtime_put_sync(dev); + pm_runtime_disable(dev); + return ret; } static int rcar_thermal_remove(struct platform_device *pdev) { struct rcar_thermal_common *common = platform_get_drvdata(pdev); + struct device *dev = &pdev->dev; struct rcar_thermal_priv *priv; rcar_thermal_for_each_priv(priv, common) { @@ -484,6 +492,9 @@ static int rcar_thermal_remove(struct platform_device *pdev) platform_set_drvdata(pdev, NULL); + pm_runtime_put_sync(dev); + pm_runtime_disable(dev); + return 0; }