From patchwork Fri Jan 16 23:00:36 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergei Shtylyov X-Patchwork-Id: 5650661 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 731FDC058E for ; Fri, 16 Jan 2015 23:00:44 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8D3B120374 for ; Fri, 16 Jan 2015 23:00:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A370B20375 for ; Fri, 16 Jan 2015 23:00:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751502AbbAPXAm (ORCPT ); Fri, 16 Jan 2015 18:00:42 -0500 Received: from mail-la0-f44.google.com ([209.85.215.44]:49029 "EHLO mail-la0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751041AbbAPXAl (ORCPT ); Fri, 16 Jan 2015 18:00:41 -0500 Received: by mail-la0-f44.google.com with SMTP id gd6so21465881lab.3 for ; Fri, 16 Jan 2015 15:00:39 -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=9fZGYdsXppT/+HUhqlBOEQGz38rEAhkXGUlWSJNWobA=; b=ijo7qBWOTGOXASnMM1c1ev1JqltWQNMZNsEz73FhZyKJg0pPmiCYe1ePZv8xH1N7Hv 9536NTOeG1faHMh+lRxQThaxuhbJeyu4YV0LmywLIi/h3xE4Y/xorqhaQpO0kQJGG9rH PW55TtuXLs31eqWQFq7xNcAHhtfdZALYmTqKSm1kqvvnL103mg7ykameLRV1WnsBHijr SJSbPN2/9k6Mtq3U3ER7aWT1SmRYBRZfSix2TDlSuO0ZVp81VRCPKVMm2xFKQxwSXoqo zXHc5cehtXn+cJEPTAwCUIDksVEmu/S3cClEOIIUgGIV1FW8eY57GGCEXAhMeL2r7Jw0 LTBg== X-Gm-Message-State: ALoCoQn9Bj4YJCZ3n83z5LoL+cxzRo9PIPeOat5JH9/CN3KIOhYgAc2fKZ8NqzRmCDcJKCQDZ//K X-Received: by 10.112.98.99 with SMTP id eh3mr17836676lbb.32.1421449239609; Fri, 16 Jan 2015 15:00:39 -0800 (PST) Received: from wasted.cogentembedded.com (ppp27-207.pppoe.mtu-net.ru. [81.195.27.207]) by mx.google.com with ESMTPSA id z4sm1736079lal.48.2015.01.16.15.00.37 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Jan 2015 15:00:38 -0800 (PST) From: Sergei Shtylyov To: tj@kernel.org, linux-ide@vger.kernel.org Cc: linux-sh@vger.kernel.org Subject: [PATCH] sata_rcar: extend PM methods Date: Sat, 17 Jan 2015 02:00:36 +0300 Message-ID: <2490673.vl8J86zUxO@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=unavailable 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 From: Mikhail Ulyanov In order to make it possible to restore from hibernation not only in Linux but also in e.g. U-Boot, we have to extend sata_rcar_{suspend|resume}() to {freeze| thaw}() PM methods and implement the restore() PM method. Signed-off-by: Mikhail Ulyanov [Sergei: killed unused variable, changed the order of initializers, modified copyrights, renamed, modified changelog.] Signed-off-by: Sergei Shtylyov --- This patch is against the 'for-next' branch of Tejun Heo's 'libata.git' repo. drivers/ata/sata_rcar.c | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 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: libata/drivers/ata/sata_rcar.c =================================================================== --- libata.orig/drivers/ata/sata_rcar.c +++ libata/drivers/ata/sata_rcar.c @@ -2,8 +2,8 @@ * Renesas R-Car SATA driver * * Author: Vladimir Barinov - * Copyright (C) 2013 Cogent Embedded, Inc. - * Copyright (C) 2013 Renesas Solutions Corp. + * Copyright (C) 2013-2015 Cogent Embedded, Inc. + * Copyright (C) 2013-2015 Renesas Solutions Corp. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -992,9 +992,30 @@ static int sata_rcar_resume(struct devic return 0; } +static int sata_rcar_restore(struct device *dev) +{ + struct ata_host *host = dev_get_drvdata(dev); + struct sata_rcar_priv *priv = host->private_data; + + clk_prepare_enable(priv->clk); + + sata_rcar_setup_port(host); + + /* initialize host controller */ + sata_rcar_init_controller(host); + + ata_host_resume(host); + + return 0; +} + static const struct dev_pm_ops sata_rcar_pm_ops = { .suspend = sata_rcar_suspend, .resume = sata_rcar_resume, + .freeze = sata_rcar_suspend, + .thaw = sata_rcar_resume, + .poweroff = sata_rcar_suspend, + .restore = sata_rcar_restore, }; #endif