From patchwork Wed Apr 10 17:49:58 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrik Jakobsson X-Patchwork-Id: 2422681 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork1.kernel.org (Postfix) with ESMTP id 5959D3FD8C for ; Wed, 10 Apr 2013 18:02:26 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1D594E649B for ; Wed, 10 Apr 2013 11:02:26 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-la0-f53.google.com (mail-la0-f53.google.com [209.85.215.53]) by gabe.freedesktop.org (Postfix) with ESMTP id EF5F7E6459 for ; Wed, 10 Apr 2013 10:51:04 -0700 (PDT) Received: by mail-la0-f53.google.com with SMTP id fp13so707405lab.40 for ; Wed, 10 Apr 2013 10:51:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer; bh=z/s1EN30fYeZ3koJXNquyfTdQXhkcuP2BlZYXNOTQ/g=; b=HbaQb9aQbkE7nGohaOpz1TQzdmjW8rhg2e2SrnNG33xIKMZC5ykhpUpSZYufmp3Ta7 idz0M8tZlb90aTLeKh+ZkohuH/qPTwBudVe4X2KgiyIz5FTBI7h+Iahtm3Uh8nSR/XHQ vWI08ShtftHvIHjxaDsfsboRu1ex6K+6m7uZOR1s5DeK4thEBHHgugzgoDT+AdnMLnGo IZufv9UeovXmHEwLP/yssGi3ltgLgE8zLkj2gsWLvZ4RP+sgRbi/OA/q0D6O3xk2/52a 8tQwLgyCp+09xuNJs/XyfNmC/LZdLTdb0JUS9gAXJJp44aLKkLrZF0eDsCdqjNIi39SZ LZIw== X-Received: by 10.112.58.232 with SMTP id u8mr1690633lbq.96.1365616264114; Wed, 10 Apr 2013 10:51:04 -0700 (PDT) Received: from patrik-desktop.lan (h138n8-oer-a32.ias.bredband.telia.com. [2.248.103.138]) by mx.google.com with ESMTPS id iq6sm309626lab.10.2013.04.10.10.51.03 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 10 Apr 2013 10:51:03 -0700 (PDT) From: Patrik Jakobsson To: dri-devel@lists.freedesktop.org Subject: [PATCH 13/15] drm/gma500: Add hooks for hibernation Date: Wed, 10 Apr 2013 19:49:58 +0200 Message-Id: <1365616200-26312-14-git-send-email-patrik.r.jakobsson@gmail.com> X-Mailer: git-send-email 1.7.10.4 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Currently we do whatever is done during suspend/resume but we might need some more work for hibernation so keep them in separate functions. Signed-off-by: Patrik Jakobsson --- drivers/gpu/drm/gma500/power.c | 15 +++++++++++++++ drivers/gpu/drm/gma500/power.h | 3 +++ drivers/gpu/drm/gma500/psb_drv.c | 3 +++ 3 files changed, 21 insertions(+) diff --git a/drivers/gpu/drm/gma500/power.c b/drivers/gpu/drm/gma500/power.c index 4c575a9..b6b135f 100644 --- a/drivers/gpu/drm/gma500/power.c +++ b/drivers/gpu/drm/gma500/power.c @@ -315,3 +315,18 @@ int psb_runtime_idle(struct device *dev) else return 1; } + +int gma_power_thaw(struct device *_dev) +{ + return gma_power_resume(_dev); +} + +int gma_power_freeze(struct device *_dev) +{ + return gma_power_suspend(_dev); +} + +int gma_power_restore(struct device *_dev) +{ + return gma_power_resume(_dev); +} diff --git a/drivers/gpu/drm/gma500/power.h b/drivers/gpu/drm/gma500/power.h index 1969d2e..56d8708 100644 --- a/drivers/gpu/drm/gma500/power.h +++ b/drivers/gpu/drm/gma500/power.h @@ -41,6 +41,9 @@ void gma_power_uninit(struct drm_device *dev); */ int gma_power_suspend(struct device *dev); int gma_power_resume(struct device *dev); +int gma_power_thaw(struct device *dev); +int gma_power_freeze(struct device *dev); +int gma_power_restore(struct device *_dev); /* * These are the functions the driver should use to wrap all hw access diff --git a/drivers/gpu/drm/gma500/psb_drv.c b/drivers/gpu/drm/gma500/psb_drv.c index 111e3df..bddea58 100644 --- a/drivers/gpu/drm/gma500/psb_drv.c +++ b/drivers/gpu/drm/gma500/psb_drv.c @@ -601,6 +601,9 @@ static void psb_remove(struct pci_dev *pdev) static const struct dev_pm_ops psb_pm_ops = { .resume = gma_power_resume, .suspend = gma_power_suspend, + .thaw = gma_power_thaw, + .freeze = gma_power_freeze, + .restore = gma_power_restore, .runtime_suspend = psb_runtime_suspend, .runtime_resume = psb_runtime_resume, .runtime_idle = psb_runtime_idle,