ARM: OMAP: menelaus chip info for H4 board.
Subsystems (3)
PATCH 2/3 ARM: OMAP: menelaus chip info for H4 board.
Signature · 1 line
--Trilok Soni
From 0fc7c6966ef0732184c6680b2aa21351fe4382ff Mon Sep 17 00:00:00 2001
From: Trilok Soni <[email protected]>
Date: Sat, 26 May 2007 19:19:19 +0530
Subject: [PATCH 2/3] ARM: OMAP: menelaus chip info for H4 board.
- Add menelaus i2c chip info for H4 board.
--- arch/arm/mach-omap2/board-h4.c | 13 +++++++++++++ 1 files changed, 13 insertions(+), 0 deletions(-)
arch/arm/mach-omap2/board-h4.c +13 -0
@@ -21,6 +21,7 @@#include <linux/input.h> #include <linux/err.h> #include <linux/clk.h> +#include <linux/i2c.h> #include <asm/hardware.h> #include <asm/mach-types.h>
@@ -492,6 +493,15 @@ static void __init tusb_evm_setup(void)#endif +static struct i2c_board_info __initdata h4_i2c_board_info[] = { +#ifdef CONFIG_MENELAUS + { +I2C_BOARD_INFO ("menelaus" ,0x72 ), + .irq =INT_24XX_SYS_NIRQ , + }, +#endif +}; +static void __init omap_h4_init (void ) {/*
@@ -520,6 +530,9 @@ static void __init omap_h4_init(void)omap_cfg_reg (V19_24XX_USB1_RCV );#endif +i2c_register_board_info (1 , h4_i2c_board_info, +ARRAY_SIZE (h4_i2c_board_info)); +platform_add_devices (h4_devices,ARRAY_SIZE (h4_devices)); omap_board_config = h4_config; omap_board_config_size =ARRAY_SIZE (h4_config);
Signature · 1 line
1.5.0
See the appended patch ... the #ifdefs shouldn't exist, and if you're going to define the IRQ there (as you should) then the pinmux must move out of the driver (maybe the board uses a GPIO for some reason).
I threw in another I2C device too.
- Dave
============== CUT HERE
Tweak Trilok's h4 i2c boardinfo patch:
- Don't #ifdef
- Declare the rv5c387a RTC too
- Move irq pinmux out of the driver into board-specific init
---
NOTE: board-n800 may need a similar pinmux change... and yes, I prefer the "one board-X.c" style.
arch/arm/mach-omap2/board-h4.c | 10 ++++++++-- drivers/i2c/chips/menelaus.c | 4 ---- 2 files changed, 8 insertions(+), 6 deletions(-)
arch/arm/mach-omap2/board-h4.c +8 -2
@@ -493,12 +493,15 @@ static void __init tusb_evm_setup(void)#endif static struct i2c_board_info __initdata h4_i2c_board_info[] = { -#ifdef CONFIG_MENELAUS + { +I2C_BOARD_INFO ("rtc-rs5c372" ,0x32 ), + .type ="rv5c387a" , +/* no IRQ wired to OMAP; nINTB goes to AGPS */ + }, {I2C_BOARD_INFO ("menelaus" ,0x72 ), .irq =INT_24XX_SYS_NIRQ , }, -#endif };static void __init omap_h4_init (void )
@@ -529,6 +532,9 @@ static void __init omap_h4_init(void)omap_cfg_reg (V19_24XX_USB1_RCV );#endif +/* Menelaus interrupt */ +omap_cfg_reg (W19_24XX_SYS_NIRQ ); +i2c_register_board_info (1 , h4_i2c_board_info,ARRAY_SIZE (h4_i2c_board_info));
drivers/i2c/chips/menelaus.c +0 -4
@@ -43,7 +43,6 @@#include <asm/mach-types.h> #include <asm/mach/irq.h> -#include <asm/arch/mux.h> #include <asm/arch/gpio.h> #include <asm/arch/menelaus.h>
@@ -834,9 +833,6 @@ static int menelaus_probe(struct i2c_cli goto fail1; } -/* Most likely Menelaus interrupt is at SYS_NIRQ */ -omap_cfg_reg (W19_24XX_SYS_NIRQ ); -/* Ack and disable all Menelaus interrupts */ menelaus_write_reg (MENELAUS_INT_ACK1 ,0xff );menelaus_write_reg (MENELAUS_INT_ACK2 ,0xff );
Quoted 29 lines · David Brownell
See the appended patch ... the #ifdefs shouldn't exist, and if you're going to define the IRQ there (as you should) then the pinmux must move out of the driver (maybe the board uses a GPIO for some reason).
I threw in another I2C device too.
- Dave
============== CUT HERE
Tweak Trilok's h4 i2c boardinfo patch:- Don't #ifdef
- Declare the rv5c387a RTC too
- Move irq pinmux out of the driver into board-specific initSigned-off-by David Brownell <[email protected]>---
NOTE: board-n800 may need a similar pinmux change... and yes, I prefer the "oneboard-X.c" style.arch/arm/mach-omap2/board-h4.c | 10 ++++++++-- drivers/i2c/chips/menelaus.c | 4 ---- 2 files changed, 8 insertions(+), 6 deletions(-)
arch/arm/mach-omap2/board-h4.c 2007-05-26 19:35:24.000000000 -0700 static void __init tusb_evm_setup(void) · line 498
Quoted 7 lines
arch/arm/mach-omap2/board-h4.c 2007-05-26 19:35:24.000000000 -0700 renamed from arch/arm/mach-omap2/board-h4.c 2007-05-26 19:35:17.000000000 -0700 +3
-1@@ -493,12 +493,15 @@ static void __init tusb_evm_setup(void) #endif static struct i2c_board_info __initdata h4_i2c_board_info[] = { -#ifdef CONFIG_MENELAUS + { + I2C_BOARD_INFO("rtc-rs5c372", 0x32), + .type = "rv5c387a",
Where you have used driver_name "rtc-rs5c372" in the menelaus.c driver? while registering rtc device you have used same "menelaus" as DRIVER_NAME.
Actually I am trying to use new I2C style to TWL4030 core driver, as it has four slaves which I want to register with i2c_board_info structure along with main driver name "twl4030" and slaves being "twl4030:0", "twl4030:1" and so on. But ->probe will be called for only main driver "twl4030" not for each slaves as per the i2c core correct?
Signature · 1 line
--Trilok Soni
Quoted 5 lines · Trilok Soni
Quoted 5 lines
arch/arm/mach-omap2/board-h4.c 2007-05-26 19:35:24.000000000 -0700 renamed from arch/arm/mach-omap2/board-h4.c 2007-05-26 19:35:17.000000000 -0700 +0
-0@@ -493,12 +493,15 @@ static void __init tusb_evm_setup(void) #endif
Quoted 8 lines
arch/arm/mach-omap2/board-h4.c 2007-05-26 19:35:24.000000000 -0700 static void __init tusb_evm_setup(void) · line 498
Quoted 5 lines
arch/arm/mach-omap2/board-h4.c 2007-05-26 19:35:24.000000000 -0700 renamed from arch/arm/mach-omap2/board-h4.c 2007-05-26 19:35:17.000000000 -0700 +3
-1static struct i2c_board_info __initdata h4_i2c_board_info[] = { -#ifdef CONFIG_MENELAUS + { + I2C_BOARD_INFO("rtc-rs5c372", 0x32), + .type = "rv5c387a",Where you have used
driver_name"rtc-rs5c372" in themenelaus.cdriver?
There's an rv5c387a chip on the board too. See
http://groups.google.com/group/rtc-linux/msg/fa462b52470149d8
Quoted 2 lines
while registering rtc device you have used same "menelaus" as
DRIVER_NAME.
Sure, but that's for a different chip. Both need i2c_board_info.
Quoted 6 lines
Actually I am trying to use new I2C style to TWL4030 core driver, as it has four slaves which I want to register with
i2c_board_infostructure along with main driver name "twl4030" and slaves being "twl4030:0", "twl4030:1" and so on. But ->probe will be called for only main driver "twl4030" not for each slaves as per the i2c core correct?
I have no idea what you're talking about here. Menelaus is twl92330, yes? H4 doesn't have a twl4030...
- Dave
Quoted 17 lines · David Brownell
Quoted 5 lines · Trilok Soni
Quoted 5 lines
arch/arm/mach-omap2/board-h4.c 2007-05-26 19:35:24.000000000 -0700 renamed from arch/arm/mach-omap2/board-h4.c 2007-05-26 19:35:17.000000000 -0700 +0
-0@@ -493,12 +493,15 @@ static void __init tusb_evm_setup(void) #endifQuoted 8 lines
arch/arm/mach-omap2/board-h4.c 2007-05-26 19:35:24.000000000 -0700 static void __init tusb_evm_setup(void) · line 498
Quoted 5 lines
arch/arm/mach-omap2/board-h4.c 2007-05-26 19:35:24.000000000 -0700 renamed from arch/arm/mach-omap2/board-h4.c 2007-05-26 19:35:17.000000000 -0700 +3
-1static struct i2c_board_info __initdata h4_i2c_board_info[] = { -#ifdef CONFIG_MENELAUS + { + I2C_BOARD_INFO("rtc-rs5c372", 0x32), + .type = "rv5c387a",Where you have used
driver_name"rtc-rs5c372" in themenelaus.cdriver?There's an rv5c387a chip on the board too. See
Quoted 7 lines
http://groups.google.com/group/rtc-linux/msg/fa462b52470149d8
Quoted 2 lines
while registering rtc device you have used same "menelaus" as
DRIVER_NAME.Sure, but that's for a different chip. Both need
i2c_board_info.
Ok, understood now.
Quoted 9 lines
Quoted 8 lines
Actually I am trying to use new I2C style to TWL4030 core driver, as it has four slaves which I want to register with
i2c_board_infostructure along with main driver name "twl4030" and slaves being "twl4030:0", "twl4030:1" and so on. But ->probe will be called for only main driver "twl4030" not for each slaves as per the i2c core correct?
Quoted 3 lines
I have no idea what you're talking about here. Menelaus is twl92330, yes? H4 doesn't have a twl4030...
Yes, H4 doesn't have twl4030. 2430SDP has TWL4030, but ofcourse this needs different e-mail thread for discussion.
Signature · 1 line
--Trilok Soni