commit: http://blackfin.uclinux.org/git/?p=linux-kernel;a=commitdiff;h=21828c6bf1774ab90bbe545e11a5a8e52ad99bdd
branch: http://blackfin.uclinux.org/git/?p=linux-kernel;a=shortlog;h=refs/heads/2012R1

Signed-off-by: Steven Miao <[email protected]>
---
 arch/blackfin/mach-bf609/boards/ezkit.c |   17 +++++++++++++++-
 drivers/mtd/maps/bfin_bf60x.c           |   32 +++++++++++++++++++++++++++++++
 2 files changed, 48 insertions(+), 1 deletions(-)

diff --git a/arch/blackfin/mach-bf609/boards/ezkit.c b/arch/blackfin/mach-bf609/boards/ezkit.c
index 1222cfb..fb32a64 100644
--- a/arch/blackfin/mach-bf609/boards/ezkit.c
+++ b/arch/blackfin/mach-bf609/boards/ezkit.c
@@ -676,10 +676,25 @@ int bf609_nor_flash_init(struct platform_device *dev)
 	return 0;
 }
 
+void bf609_nor_flash_exit(struct platform_device *dev)
+{
+	const unsigned short pins[] = {
+		P_A3, P_A4, P_A5, P_A6, P_A7, P_A8, P_A9, P_A10, P_A11, P_A12,
+		P_A13, P_A14, P_A15, P_A16, P_A17, P_A18, P_A19, P_A20, P_A21,
+		P_A22, P_A23, P_A24, P_A25, P_NORCK, 0,
+	};
+
+	peripheral_free_list(pins);
+
+	bfin_write32(SMC_GCTL, 0);
+	return 0;
+}
+
 static struct physmap_flash_data ezkit_flash_data = {
 	.width      = 2,
 	.parts      = ezkit_partitions,
-	.init 	    = bf609_nor_flash_init,
+	.init       = bf609_nor_flash_init,
+	.exit       = bf609_nor_flash_exit,
 	.nr_parts   = ARRAY_SIZE(ezkit_partitions),
 };
 
diff --git a/drivers/mtd/maps/bfin_bf60x.c b/drivers/mtd/maps/bfin_bf60x.c
index 48de812..5785c14 100644
--- a/drivers/mtd/maps/bfin_bf60x.c
+++ b/drivers/mtd/maps/bfin_bf60x.c
@@ -198,6 +198,34 @@ err_out:
 }
 
 #ifdef CONFIG_PM
+static int bf60x_flash_suspend(struct platform_device *dev, pm_message_t state)
+{
+	struct physmap_flash_data *bf60x_data;
+
+	bf60x_data = dev->dev.platform_data;
+	if (bf60x_data == NULL)
+		return -ENODEV;
+	if (bf60x_data->exit)
+		bf60x_data->exit(dev);
+
+	return 0;
+}
+
+static int bf60x_flash_resume(struct platform_device *dev)
+{
+	struct physmap_flash_data *bf60x_data;
+	int err = 0;
+
+	bf60x_data = dev->dev.platform_data;
+	if (bf60x_data == NULL)
+		return -ENODEV;
+
+	if (bf60x_data->init)
+		err = bf60x_data->init(dev);
+
+	return err;
+}
+
 static void bf60x_flash_shutdown(struct platform_device *dev)
 {
 	struct bf60x_flash_info *info = platform_get_drvdata(dev);
@@ -216,6 +244,10 @@ static struct platform_driver bf60x_flash_driver = {
 	.probe		= bf60x_flash_probe,
 	.remove		= bf60x_flash_remove,
 	.shutdown	= bf60x_flash_shutdown,
+#ifdef CONFIG_PM
+	.suspend	= bf60x_flash_suspend,
+	.resume		= bf60x_flash_resume,
+#endif
 	.driver		= {
 		.name	= "bf60x-flash",
 		.owner	= THIS_MODULE,
_______________________________________________
Linux-kernel-commits mailing list
[email protected]
https://blackfin.uclinux.org/mailman/listinfo/linux-kernel-commits

Reply via email to