From patchwork Thu Jul 21 10:43:27 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Grzegorz Jaszczyk X-Patchwork-Id: 9241391 X-Patchwork-Delegate: rui.zhang@intel.com 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 0F1DE602F0 for ; Thu, 21 Jul 2016 10:39:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F391627D64 for ; Thu, 21 Jul 2016 10:39:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E7B2727DE0; Thu, 21 Jul 2016 10:39:58 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham 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 967E127D64 for ; Thu, 21 Jul 2016 10:39:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751529AbcGUKjm (ORCPT ); Thu, 21 Jul 2016 06:39:42 -0400 Received: from mail-lf0-f46.google.com ([209.85.215.46]:35973 "EHLO mail-lf0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751451AbcGUKjm (ORCPT ); Thu, 21 Jul 2016 06:39:42 -0400 Received: by mail-lf0-f46.google.com with SMTP id g62so57961950lfe.3 for ; Thu, 21 Jul 2016 03:39:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=XaTRn+VN6PrEBnAz0WTaTIu8xoPoNfezlwTN77KjXm8=; b=F+WuA9bETuzKXnxJrRhVPUxGhgVEnGyjjAU7+AfwjL00bxMLlBeO1FnEapOl6Qh5jP g4xBc3Q2yRdCP49S9ucfcVSiHzGa/Dti5PDKRLNLjyA/Go+doSfY5BEDlw80ziD4hqPx 2hG2isEkLuWid8ofdzNEP04xIEXEilMrKxU0YW7T6RX23PWN89pkaFHWUivgTSyhoZAp wnh9adlJUZFbA/vFg+86D3cH5emZ9XP+b01OpuM9yY5aNkPiTr24wfRAtjkDSjDl3Ggj Jc/XnhAmu3KIoECQesP72uPMXtVoQaN3rQKbveDahZvtHWFTUo0mZePKFMVOJa3U4UCa mpBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=XaTRn+VN6PrEBnAz0WTaTIu8xoPoNfezlwTN77KjXm8=; b=a/QuuZf0iXonqjYTVAkkTeXe93d8lRuT2CYekmWq8xG/KzwdUONANGMw5zG92m/29w pRh4aZ+ViTAwoR3eb3tVhTq8Q7lDNT9gTcGiiYAPNcVIwKxePxe6SxtHLefj3HOnz+Be A/6icX1QY0YC9e5cWg+bu1bMu8rs25ABDwi9BJHlA22IrQxpHqCgRkNr14JA4EU8kpSO b+ozgisjOb/zz/1b0cRaEggpzkjsoNIBdWp6GbAMBW68cR3kps52cjRsXD1N0uvxNmGl gBhmNeYFLRcR3momFkjp/3trbTGgRvRsIJ80gYjtgHbN1D4WkETbEzEacjoeLFQB1Crv BM6A== X-Gm-Message-State: ALyK8tIaN9DqL9M8w7Imeg8IUYuisYERfJf0K+WDAnZ/lvE8QjSvjtTJWcGLU10RT7AhOg== X-Received: by 10.25.20.87 with SMTP id k84mr24407160lfi.207.1469097580268; Thu, 21 Jul 2016 03:39:40 -0700 (PDT) Received: from enkidu.semihalf.local (31-172-191-173.noc.fibertech.net.pl. [31.172.191.173]) by smtp.gmail.com with ESMTPSA id 78sm1522229lfv.39.2016.07.21.03.39.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 Jul 2016 03:39:39 -0700 (PDT) From: Grzegorz Jaszczyk To: rui.zhang@intel.com, edubezval@gmail.com, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, thomas.petazzoni@free-electrons.com, gregory.clement@free-electrons.com Cc: mw@semihalf.com, jaz@semihalf.com, alior@marvell.com Subject: [PATCH] thermal: armada: add support for suspend/resume Date: Thu, 21 Jul 2016 12:43:27 +0200 Message-Id: <1469097807-17748-1-git-send-email-jaz@semihalf.com> X-Mailer: git-send-email 1.8.3.1 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 There is no need to implement subroutine for suspend since there is no data to store before suspending. Signed-off-by: Grzegorz Jaszczyk --- drivers/thermal/armada_thermal.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/thermal/armada_thermal.c b/drivers/thermal/armada_thermal.c index ae75328..65f9838 100644 --- a/drivers/thermal/armada_thermal.c +++ b/drivers/thermal/armada_thermal.c @@ -304,12 +304,26 @@ static int armada_thermal_exit(struct platform_device *pdev) return 0; } +static int armada_thermal_resume(struct device *dev) +{ + struct thermal_zone_device *thermal = + dev_get_drvdata(dev); + struct armada_thermal_priv *priv = thermal->devdata; + + priv->data->init_sensor(to_platform_device(dev), priv); + + return 0; +} + +static SIMPLE_DEV_PM_OPS(armada_thermal_pm_ops, NULL, armada_thermal_resume); + static struct platform_driver armada_thermal_driver = { .probe = armada_thermal_probe, .remove = armada_thermal_exit, .driver = { .name = "armada_thermal", .of_match_table = armada_thermal_id_table, + .pm = &armada_thermal_pm_ops, }, };