aboutsummaryrefslogtreecommitdiff
path: root/arch/arm/mach-omap1/board-h2.c
diff options
context:
space:
mode:
authorDavid Brownell <david-b@pacbell.net>2007-10-13 23:56:30 +0200
committerJean Delvare <khali@hyperion.delvare>2007-10-13 23:56:30 +0200
commit8056c6cb2bb1632aa9221dce0e43a61db37b420f (patch)
tree4ca321bba9db87c80c77f841c9a52c456be63aa5 /arch/arm/mach-omap1/board-h2.c
parentb5067f8ff37ed6cfa024170a9819bb09d55e9c1f (diff)
i2c/tps65010: New-style driver updates, part 2
Switch the tps65010 driver into a "new-style" I2C driver, and convert all of its in-tree users (board support for OSK, H2, H3) accordingly. That accounts for most of the board-specific code in this driver; the rest of that code is now moved into board-specific initcalls. Also remove some of the many now-superfluous #includes. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Jean Delvare <khali@linux-fr.org>
Diffstat (limited to 'arch/arm/mach-omap1/board-h2.c')
-rw-r--r--arch/arm/mach-omap1/board-h2.c45
1 files changed, 42 insertions, 3 deletions
diff --git a/arch/arm/mach-omap1/board-h2.c b/arch/arm/mach-omap1/board-h2.c
index 48c8c9195dc..2f8f6ecf111 100644
--- a/arch/arm/mach-omap1/board-h2.c
+++ b/arch/arm/mach-omap1/board-h2.c
@@ -20,22 +20,23 @@
*/
#include <linux/kernel.h>
-#include <linux/init.h>
#include <linux/platform_device.h>
#include <linux/delay.h>
+#include <linux/i2c.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/nand.h>
#include <linux/mtd/partitions.h>
#include <linux/input.h>
-#include <linux/workqueue.h>
#include <asm/hardware.h>
+#include <asm/gpio.h>
+
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
#include <asm/mach/flash.h>
#include <asm/mach/map.h>
-#include <asm/arch/gpio.h>
+#include <asm/arch/tps65010.h>
#include <asm/arch/mux.h>
#include <asm/arch/tc.h>
#include <asm/arch/irda.h>
@@ -277,6 +278,20 @@ static struct platform_device *h2_devices[] __initdata = {
&h2_mcbsp1_device,
};
+static struct i2c_board_info __initdata h2_i2c_board_info[] = {
+ {
+ I2C_BOARD_INFO("tps65010", 0x48),
+ .type = "tps65010",
+ .irq = OMAP_GPIO_IRQ(58),
+ },
+ /* TODO when driver support is ready:
+ * - isp1301 OTG transceiver
+ * - optional ov9640 camera sensor at 0x30
+ * - pcf9754 for aGPS control
+ * - ... etc
+ */
+};
+
static void __init h2_init_smc91x(void)
{
if ((omap_request_gpio(0)) < 0) {
@@ -367,6 +382,14 @@ static void __init h2_init(void)
omap_board_config = h2_config;
omap_board_config_size = ARRAY_SIZE(h2_config);
omap_serial_init();
+
+ /* irq for tps65010 chip */
+ omap_cfg_reg(W4_GPIO58);
+ if (gpio_request(58, "tps65010") == 0)
+ gpio_direction_input(58);
+
+ i2c_register_board_info(1, h2_i2c_board_info,
+ ARRAY_SIZE(h2_i2c_board_info));
}
static void __init h2_map_io(void)
@@ -374,6 +397,22 @@ static void __init h2_map_io(void)
omap1_map_common_io();
}
+#ifdef CONFIG_TPS65010
+static int __init h2_tps_init(void)
+{
+ if (!machine_is_omap_h2())
+ return 0;
+
+ /* gpio3 for SD, gpio4 for VDD_DSP */
+ /* FIXME send power to DSP iff it's configured */
+
+ /* Enable LOW_PWR */
+ tps65010_set_low_pwr(ON);
+ return 0;
+}
+fs_initcall(h2_tps_init);
+#endif
+
MACHINE_START(OMAP_H2, "TI-H2")
/* Maintainer: Imre Deak <imre.deak@nokia.com> */
.phys_io = 0xfff00000,