linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Anton Vorontsov <avorontsov@ru.mvista.com>
To: Kumar Gala <galak@kernel.crashing.org>
Cc: Scott Wood <scottwood@freescale.com>,
	linuxppc-dev@ozlabs.org, Timur Tabi <timur@freescale.com>
Subject: [PATCH 3/7] powerpc/qe: Implement QE driver for handling resume on MPC85xx
Date: Wed, 16 Sep 2009 01:43:55 +0400	[thread overview]
Message-ID: <20090915214355.GC24821@oksana.dev.rtsoft.ru> (raw)
In-Reply-To: <20090915214321.GA19377@oksana.dev.rtsoft.ru>

So far the driver is used to reset QE upon resume, which is needed on
85xx. Later we can move some QE initialization steps into probe().

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
---
 arch/powerpc/sysdev/qe_lib/qe.c |   34 ++++++++++++++++++++++++++++++++++
 1 files changed, 34 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/sysdev/qe_lib/qe.c b/arch/powerpc/sysdev/qe_lib/qe.c
index 4eaf2a9..149393c 100644
--- a/arch/powerpc/sysdev/qe_lib/qe.c
+++ b/arch/powerpc/sysdev/qe_lib/qe.c
@@ -27,6 +27,8 @@
 #include <linux/delay.h>
 #include <linux/ioport.h>
 #include <linux/crc32.h>
+#include <linux/mod_devicetable.h>
+#include <linux/of_platform.h>
 #include <asm/irq.h>
 #include <asm/page.h>
 #include <asm/pgtable.h>
@@ -647,3 +649,35 @@ unsigned int qe_get_num_of_snums(void)
 	return num_of_snums;
 }
 EXPORT_SYMBOL(qe_get_num_of_snums);
+
+#if defined(CONFIG_SUSPEND) && defined(CONFIG_PPC_85xx)
+static int qe_resume(struct of_device *ofdev)
+{
+	if (!qe_alive_during_sleep())
+		qe_reset();
+	return 0;
+}
+
+static int qe_probe(struct of_device *ofdev, const struct of_device_id *id)
+{
+	return 0;
+}
+
+static const struct of_device_id qe_ids[] = {
+	{ .compatible = "fsl,qe", },
+	{ },
+};
+
+static struct of_platform_driver qe_driver = {
+	.driver.name = "fsl-qe",
+	.match_table = qe_ids,
+	.probe = qe_probe,
+	.resume = qe_resume,
+};
+
+static int __init qe_drv_init(void)
+{
+	return of_register_platform_driver(&qe_driver);
+}
+device_initcall(qe_drv_init);
+#endif /* defined(CONFIG_SUSPEND) && defined(CONFIG_PPC_85xx) */
-- 
1.6.3.3

  parent reply	other threads:[~2009-09-15 21:43 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-15 21:43 [PATCH v4 0/7] Suspend/resume support for some 83xx/85xx/86xx boards Anton Vorontsov
2009-09-15 21:43 ` [PATCH 1/7] powerpc/qe: Make qe_reset() code path safe for repeated invocation Anton Vorontsov
2009-11-05 13:15   ` Kumar Gala
2009-09-15 21:43 ` [PATCH 2/7] powerpc/qe: QE also shuts down on MPC8568 Anton Vorontsov
2009-11-05 13:15   ` Kumar Gala
2009-09-15 21:43 ` Anton Vorontsov [this message]
2009-11-05 14:11   ` [PATCH 3/7] powerpc/qe: Implement QE driver for handling resume on MPC85xx Kumar Gala
2009-09-15 21:43 ` [PATCH 4/7] powerpc/85xx/86xx: Add suspend/resume support Anton Vorontsov
2009-11-05 14:11   ` Kumar Gala
2009-09-15 21:43 ` [PATCH 5/7] powerpc/85xx: Add power management support for MPC85xxMDS boards Anton Vorontsov
2009-11-05 13:58   ` Kumar Gala
2009-11-05 14:02     ` Kumar Gala
2009-11-05 14:08       ` Anton Vorontsov
2009-11-05 14:04     ` Anton Vorontsov
2009-11-05 14:06       ` Kumar Gala
2009-11-05 16:53         ` Scott Wood
2009-11-05 14:11   ` Kumar Gala
2009-09-15 21:44 ` [PATCH 6/7] powerpc/86xx: Add power management support for MPC8610HPCD boards Anton Vorontsov
2009-11-05 14:11   ` Kumar Gala
2009-09-15 21:44 ` [PATCH 7/7] powerpc/83xx: Add power management support for MPC83xx QE boards Anton Vorontsov
2009-11-05 14:11   ` Kumar Gala

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090915214355.GC24821@oksana.dev.rtsoft.ru \
    --to=avorontsov@ru.mvista.com \
    --cc=galak@kernel.crashing.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=scottwood@freescale.com \
    --cc=timur@freescale.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).