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: 5672331 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: X-Original-To: patchwork-linux-sh@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 46C6DC058D for ; Tue, 20 Jan 2015 21:13:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 51B0F20498 for ; Tue, 20 Jan 2015 21:13:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 494B320497 for ; Tue, 20 Jan 2015 21:13:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752245AbbATVN0 (ORCPT ); Tue, 20 Jan 2015 16:13:26 -0500 Received: from mail-la0-f47.google.com ([209.85.215.47]:54439 "EHLO mail-la0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751649AbbATVNZ (ORCPT ); Tue, 20 Jan 2015 16:13:25 -0500 Received: by mail-la0-f47.google.com with SMTP id hz20so3488330lab.6 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=WSjyY/BDxCYXRutOZHt9Iwm27Gw7vx74j5nbtlXuV9Gj4pQUA75Jqls9XFS4IXSkrs d5kyVRV23F8fAACITCz7NH4/DhjTnEt/KhGL++jzg8Wj1ZjoojE5uC60ep4Hh0ROHdWT E0DSbcFx8NM6ouuuWp8es5wAXsXcIgWlaEVKODbYbq4C3+v7UudeYQ5Q7zF8FTGYxcre 2xc1nE8GzHzk3kZX6JytCZTyK8T674XnKLIUMVqc+19JCa439O/XXSABUo0bRFvSDjLu Tz4GQzIfgv+9P7jhjvBxAZMe1vzMEz0wMmA0QOqnUXWQofkoQpGFqfYAwppgDYzipvq2 KNsg== X-Gm-Message-State: ALoCoQnaxjzaT+xlO2gJGt/dER8TdskijwaE24IaXPucMs8+Lmf4fgC7arKwfKzMSJ9Mgrf8F6U1 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: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@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 linux-sh" 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) };