From patchwork Tue Jan 20 21:13:21 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergei Shtylyov X-Patchwork-Id: 5672341 Return-Path: X-Original-To: patchwork-dmaengine@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 16CCBC058E for ; Tue, 20 Jan 2015 21:13:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3D31120497 for ; Tue, 20 Jan 2015 21:13:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 521CA204E1 for ; Tue, 20 Jan 2015 21:13:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752488AbbATVN0 (ORCPT ); Tue, 20 Jan 2015 16:13:26 -0500 Received: from mail-la0-f51.google.com ([209.85.215.51]:48229 "EHLO mail-la0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751816AbbATVN0 (ORCPT ); Tue, 20 Jan 2015 16:13:26 -0500 Received: by mail-la0-f51.google.com with SMTP id ge10so15690499lab.10 for ; Tue, 20 Jan 2015 13:13:24 -0800 (PST) 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:organization :user-agent:mime-version:content-transfer-encoding:content-type; bh=Xgi/14+uJWYVm1ioIBAaLu7NUwuhc3lN52RyQaE2LOQ=; b=AZ29Yd/LLIQP7Ej5Hi7r734XE4eT+7LKiSaZ2lY2pgbk6XftYypxST/7VaLiO7wVVc wQK94Zo4CrsKOj4HPV1BSUR1qS+T85i4cHfBhlxoT1/sfhZIljDhDIRNqyHDbj63Si2S Uxw16NdtmUGmff6+LYuUGk0M7yvy/aycgpo1IOJFGyG9Yw1NwrLaT2HiqvA09oN5t4Yr 2IL+zOdUSWvx684VjIzXwLVJNMGOM1LQe5dq3HLE/OJxpP0TgfHPbt0Ti30bXejJY0LA wtBriBl05pDlJon1v4mcsbWpB/IzbJ7gMSgkB0vgQY2+QsTiRYwEsqA4b9Y9odjtVQaI /3Mw== X-Gm-Message-State: ALoCoQlFaMuKvLhynP/n20iXB0lW+59lXaS/gEXkttYV4KrcH5oPWFMap4agWrkX3MTPW5EwGA0T X-Received: by 10.112.170.36 with SMTP id aj4mr40551492lbc.3.1421788404260; Tue, 20 Jan 2015 13:13:24 -0800 (PST) Received: from wasted.cogentembedded.com (ppp17-152.pppoe.mtu-net.ru. [81.195.17.152]) by mx.google.com with ESMTPSA id mc17sm4320503lbb.1.2015.01.20.13.13.22 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 20 Jan 2015 13:13:23 -0800 (PST) From: Sergei Shtylyov To: vinod.koul@intel.com, dan.j.williams@intel.com, dmaengine@vger.kernel.org Cc: linux-sh@vger.kernel.org, mikhail.ulyanov@cogentembedded.com Subject: [PATCH v2 2/2] shdmac: extend PM methods Date: Wed, 21 Jan 2015 00:13:21 +0300 Message-ID: <1609993.2vNJXkESyr@wasted.cogentembedded.com> Organization: Cogent Embedded Inc. User-Agent: KMail/4.14.3 (Linux/3.17.8-200.fc20.x86_64; KDE/4.14.3; x86_64; ; ) MIME-Version: 1.0 Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP In order to make it possible to restore from hibernation not only in Linux but also in e.g. U-Boot, we have to use sh_dmae_{suspend|resume}() for the {freeze| thaw|restore}() PM methods. It's handy to achieve this with SIMPLE_DEV_PM_OPS() macro; since that macro doesn't do anything when CONFIG_PM_SLEEP is undefined, we don't need to #define sh_dmae_{suspend|resume} NULL anymore but we'll have to enclose sh_dmae_{suspend|resume}() into the new #ifdef... Based on original patch by Mikhail Ulyanov . Signed-off-by: Sergei Shtylyov --- The patch is against the 'next' branch of Vinod Koul's 'slave-dma.git' repo. Changes in version 2: - enclosed sh_dmae_{suspend|resume}() into #ifdef CONFIG_PM_SLEEP, modified the changelog accordingly; - fixed typo in the changelog. drivers/dma/sh/shdmac.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe dmaengine" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Index: slave-dma/drivers/dma/sh/shdmac.c =================================================================== --- slave-dma.orig/drivers/dma/sh/shdmac.c +++ slave-dma/drivers/dma/sh/shdmac.c @@ -600,7 +600,9 @@ static int sh_dmae_runtime_resume(struct return sh_dmae_rst(shdev); } +#endif +#ifdef CONFIG_PM_SLEEP static int sh_dmae_suspend(struct device *dev) { return 0; @@ -632,14 +634,10 @@ static int sh_dmae_resume(struct device return 0; } -#else -#define sh_dmae_suspend NULL -#define sh_dmae_resume NULL #endif static const struct dev_pm_ops sh_dmae_pm = { - .suspend = sh_dmae_suspend, - .resume = sh_dmae_resume, + SET_SYSTEM_SLEEP_PM_OPS(sh_dmae_suspend, sh_dmae_resume) SET_RUNTIME_PM_OPS(sh_dmae_runtime_suspend, sh_dmae_runtime_resume, NULL) };