public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 3/3] ARM: OMAP: Add menelaus chip info for N800
@ 2007-05-26  8:29 Trilok Soni
  2007-06-05 11:29 ` Trilok Soni
  0 siblings, 1 reply; 7+ messages in thread
From: Trilok Soni @ 2007-05-26  8:29 UTC (permalink / raw)
  To: linux-omap-open-source

[-- Attachment #1: Type: text/plain, Size: 70 bytes --]

n800 changes are compile tested only. Please test.

-- 
--Trilok Soni

[-- Attachment #2: 0003-ARM-OMAP-Add-menelaus-chip-info-for-N800.patch --]
[-- Type: text/x-patch, Size: 5859 bytes --]

From 011721150c9d51b1baebfdb113b1cc895f7fa522 Mon Sep 17 00:00:00 2001
From: Trilok Soni <soni.trilok@gmail.com>
Date: Sat, 26 May 2007 19:21:34 +0530
Subject: [PATCH 3/3] ARM: OMAP: Add menelaus chip info for N800

- Move board-n800-pm.c code to board-n800.c
- Add platform data information specific to n800

Signed-off-by: Trilok Soni <soni.trilok@gmail.com>
---
 arch/arm/mach-omap2/Makefile         |    2 +-
 arch/arm/mach-omap2/board-n800-pm.c  |   79 ----------------------------------
 arch/arm/mach-omap2/board-n800.c     |   67 ++++++++++++++++++++++++++++-
 include/asm-arm/arch-omap/menelaus.h |    3 -
 4 files changed, 67 insertions(+), 84 deletions(-)
 delete mode 100644 arch/arm/mach-omap2/board-n800-pm.c

diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index 177008e..9c1309c 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -28,7 +28,7 @@ obj-$(CONFIG_MACH_OMAP_APOLLON)		+= board-apollon.o \
 obj-$(CONFIG_MACH_NOKIA_N800)		+= board-n800.o board-n800-flash.o \
 					   board-n800-mmc.o board-n800-bt.o \
 					   board-n800-audio.o board-n800-usb.o \
-					   board-n800-dsp.o board-n800-pm.o
+					   board-n800-dsp.o
 
 # TUSB 6010 chips
 obj-$(CONFIG_MACH_OMAP2_TUSB6010)	+= usb-tusb6010.o
diff --git a/arch/arm/mach-omap2/board-n800-pm.c b/arch/arm/mach-omap2/board-n800-pm.c
deleted file mode 100644
index 33f3e4d..0000000
--- a/arch/arm/mach-omap2/board-n800-pm.c
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Nokia N800 PM code
- *
- * Copyright (C) 2006 Nokia Corporation
- * Author: Amit Kucheria <amit.kucheria@nokia.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-
-#include <linux/kernel.h>
-#include <linux/module.h>
-#include <asm/arch/menelaus.h>
-
-#ifdef CONFIG_MENELAUS
-
-static int n800_auto_sleep_regulators(void)
-{
-	u32 val;
-	int ret;
-
-	val = EN_VPLL_SLEEP | EN_VMMC_SLEEP    \
-		| EN_VAUX_SLEEP | EN_VIO_SLEEP \
-		| EN_VMEM_SLEEP | EN_DC3_SLEEP \
-		| EN_VC_SLEEP | EN_DC2_SLEEP;
-
-	ret = menelaus_set_regulator_sleep(1, val);
-	if (ret < 0) {
-		printk(KERN_ERR "Could not set regulators to sleep on "
-			"menelaus: %u\n", ret);
-		return ret;
-	}
-	return 0;
-}
-
-static int n800_auto_voltage_scale(void)
-{
-	int ret;
-
-	ret = menelaus_set_vcore_hw(1400, 1050);
-	if (ret < 0) {
-		printk(KERN_ERR "Could not set VCORE voltage on "
-			"menelaus: %u\n", ret);
-		return ret;
-	}
-	return 0;
-}
-
-static int n800_menelaus_init(struct device *dev)
-{
-	int ret;
-
-	ret = n800_auto_voltage_scale();
-	if (ret < 0)
-		return ret;
-	ret = n800_auto_sleep_regulators();
-	if (ret < 0)
-		return ret;
-	return 0;
-}
-
-static struct menelaus_platform_data n800_menelaus_platform_data = {
-	.late_init = n800_menelaus_init,
-};
-
-void __init n800_pm_init(void)
-{
-	menelaus_set_platform_data(&n800_menelaus_platform_data);
-}
-
-#else
-
-void __init n800_pm_init(void)
-{
-}
-
-#endif
-
diff --git a/arch/arm/mach-omap2/board-n800.c b/arch/arm/mach-omap2/board-n800.c
index b4c150d..a050b47 100644
--- a/arch/arm/mach-omap2/board-n800.c
+++ b/arch/arm/mach-omap2/board-n800.c
@@ -22,6 +22,7 @@
 #include <linux/delay.h>
 #include <linux/interrupt.h>
 #include <linux/irq.h>
+#include <linux/i2c.h>
 #include <asm/hardware.h>
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
@@ -474,9 +475,74 @@ static struct platform_device *n800_devices[] __initdata = {
 #endif
 };
 
+#ifdef CONFIG_MENELAUS
+static int n800_auto_sleep_regulators(void)
+{
+	u32 val;
+	int ret;
+
+	val = EN_VPLL_SLEEP | EN_VMMC_SLEEP    \
+		| EN_VAUX_SLEEP | EN_VIO_SLEEP \
+		| EN_VMEM_SLEEP | EN_DC3_SLEEP \
+		| EN_VC_SLEEP | EN_DC2_SLEEP;
+
+	ret = menelaus_set_regulator_sleep(1, val);
+	if (ret < 0) {
+		printk(KERN_ERR "Could not set regulators to sleep on "
+			"menelaus: %u\n", ret);
+		return ret;
+	}
+	return 0;
+}
+
+static int n800_auto_voltage_scale(void)
+{
+	int ret;
+
+	ret = menelaus_set_vcore_hw(1400, 1050);
+	if (ret < 0) {
+		printk(KERN_ERR "Could not set VCORE voltage on "
+			"menelaus: %u\n", ret);
+		return ret;
+	}
+	return 0;
+}
+
+static int n800_menelaus_init(struct device *dev)
+{
+	int ret;
+
+	ret = n800_auto_voltage_scale();
+	if (ret < 0)
+		return ret;
+	ret = n800_auto_sleep_regulators();
+	if (ret < 0)
+		return ret;
+	return 0;
+}
+
+static struct menelaus_platform_data n800_menelaus_platform_data = {
+	.late_init = n800_menelaus_init,
+};
+#endif
+
+static struct i2c_board_info __initdata n800_i2c_board_info[] = {
+#ifdef CONFIG_MENELAUS
+	{
+		I2C_BOARD_INFO("menelaus", 0x72),
+		.irq = INT_24XX_SYS_NIRQ,
+		.platform_data = &n800_menelaus_platform_data,
+	},
+#endif
+};
+
 static void __init nokia_n800_init(void)
 {
 	platform_add_devices(n800_devices, ARRAY_SIZE(n800_devices));
+
+	i2c_register_board_info(1, n800_i2c_board_info,
+			ARRAY_SIZE(n800_i2c_board_info));
+
 	n800_flash_init();
 	n800_mmc_init();
 	n800_bt_init();
@@ -493,7 +559,6 @@ static void __init nokia_n800_init(void)
 	tsc2301_dev_init();
 	omap_register_gpio_switches(n800_gpio_switches,
 				    ARRAY_SIZE(n800_gpio_switches));
-	n800_pm_init();
 }
 
 static void __init nokia_n800_map_io(void)
diff --git a/include/asm-arm/arch-omap/menelaus.h b/include/asm-arm/arch-omap/menelaus.h
index 0c401c4..69ed7ee 100644
--- a/include/asm-arm/arch-omap/menelaus.h
+++ b/include/asm-arm/arch-omap/menelaus.h
@@ -13,9 +13,6 @@ struct menelaus_platform_data {
 	int (* late_init)(struct device *dev);
 };
 
-/* Call only at init time. */
-extern void menelaus_set_platform_data(struct menelaus_platform_data *pdata);
-
 extern int menelaus_register_mmc_callback(void (*callback)(void *data, u8 card_mask),
 					  void *data);
 extern void menelaus_unregister_mmc_callback(void);
-- 
1.5.0


[-- Attachment #3: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2007-06-11 13:31 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-26  8:29 [PATCH 3/3] ARM: OMAP: Add menelaus chip info for N800 Trilok Soni
2007-06-05 11:29 ` Trilok Soni
2007-06-05 14:41   ` Carlos Aguiar
2007-06-06  7:34     ` Trilok Soni
2007-06-06 19:47       ` Carlos Aguiar
2007-06-07  5:29         ` Trilok Soni
2007-06-11 13:31           ` Tony Lindgren

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox