Commit fbd8071c authored by Mike Rapoport's avatar Mike Rapoport Committed by Tony Lindgren

omap: use common initialization for PMIC i2c bus

Introduce omap_pmic_init that registers i2c bus and PMIC device on that
bus and add omap2/3/4 wrappers for common cases.
Signed-off-by: default avatarMike Rapoport <mike@compulab.co.il>
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
parent 96974a24
...@@ -41,6 +41,7 @@ ...@@ -41,6 +41,7 @@
#include "mux.h" #include "mux.h"
#include "hsmmc.h" #include "hsmmc.h"
#include "common-board-devices.h"
#define SDP2430_CS0_BASE 0x04000000 #define SDP2430_CS0_BASE 0x04000000
#define SECONDARY_LCD_GPIO 147 #define SECONDARY_LCD_GPIO 147
...@@ -180,15 +181,6 @@ static struct twl4030_platform_data sdp2430_twldata = { ...@@ -180,15 +181,6 @@ static struct twl4030_platform_data sdp2430_twldata = {
.vmmc1 = &sdp2430_vmmc1, .vmmc1 = &sdp2430_vmmc1,
}; };
static struct i2c_board_info __initdata sdp2430_i2c_boardinfo[] = {
{
I2C_BOARD_INFO("twl4030", 0x48),
.flags = I2C_CLIENT_WAKE,
.irq = INT_24XX_SYS_NIRQ,
.platform_data = &sdp2430_twldata,
},
};
static struct i2c_board_info __initdata sdp2430_i2c1_boardinfo[] = { static struct i2c_board_info __initdata sdp2430_i2c1_boardinfo[] = {
{ {
I2C_BOARD_INFO("isp1301_omap", 0x2D), I2C_BOARD_INFO("isp1301_omap", 0x2D),
...@@ -201,8 +193,7 @@ static int __init omap2430_i2c_init(void) ...@@ -201,8 +193,7 @@ static int __init omap2430_i2c_init(void)
{ {
omap_register_i2c_bus(1, 100, sdp2430_i2c1_boardinfo, omap_register_i2c_bus(1, 100, sdp2430_i2c1_boardinfo,
ARRAY_SIZE(sdp2430_i2c1_boardinfo)); ARRAY_SIZE(sdp2430_i2c1_boardinfo));
omap_register_i2c_bus(2, 2600, sdp2430_i2c_boardinfo, omap2_pmic_init("twl4030", &sdp2430_twldata);
ARRAY_SIZE(sdp2430_i2c_boardinfo));
return 0; return 0;
} }
......
...@@ -528,20 +528,10 @@ static struct twl4030_platform_data sdp3430_twldata = { ...@@ -528,20 +528,10 @@ static struct twl4030_platform_data sdp3430_twldata = {
.vpll2 = &sdp3430_vpll2, .vpll2 = &sdp3430_vpll2,
}; };
static struct i2c_board_info __initdata sdp3430_i2c_boardinfo[] = {
{
I2C_BOARD_INFO("twl4030", 0x48),
.flags = I2C_CLIENT_WAKE,
.irq = INT_34XX_SYS_NIRQ,
.platform_data = &sdp3430_twldata,
},
};
static int __init omap3430_i2c_init(void) static int __init omap3430_i2c_init(void)
{ {
/* i2c1 for PMIC only */ /* i2c1 for PMIC only */
omap_register_i2c_bus(1, 2600, sdp3430_i2c_boardinfo, omap3_pmic_init("twl4030", &sdp3430_twldata);
ARRAY_SIZE(sdp3430_i2c_boardinfo));
/* i2c2 on camera connector (for sensor control) and optional isp1301 */ /* i2c2 on camera connector (for sensor control) and optional isp1301 */
omap_register_i2c_bus(2, 400, NULL, 0); omap_register_i2c_bus(2, 400, NULL, 0);
/* i2c3 on display connector (for DVI, tfp410) */ /* i2c3 on display connector (for DVI, tfp410) */
......
...@@ -42,6 +42,7 @@ ...@@ -42,6 +42,7 @@
#include "hsmmc.h" #include "hsmmc.h"
#include "timer-gp.h" #include "timer-gp.h"
#include "control.h" #include "control.h"
#include "common-board-devices.h"
#define ETH_KS8851_IRQ 34 #define ETH_KS8851_IRQ 34
#define ETH_KS8851_POWER_ON 48 #define ETH_KS8851_POWER_ON 48
...@@ -575,14 +576,6 @@ static struct twl4030_platform_data sdp4430_twldata = { ...@@ -575,14 +576,6 @@ static struct twl4030_platform_data sdp4430_twldata = {
.usb = &omap4_usbphy_data .usb = &omap4_usbphy_data
}; };
static struct i2c_board_info __initdata sdp4430_i2c_boardinfo[] = {
{
I2C_BOARD_INFO("twl6030", 0x48),
.flags = I2C_CLIENT_WAKE,
.irq = OMAP44XX_IRQ_SYS_1N,
.platform_data = &sdp4430_twldata,
},
};
static struct i2c_board_info __initdata sdp4430_i2c_3_boardinfo[] = { static struct i2c_board_info __initdata sdp4430_i2c_3_boardinfo[] = {
{ {
I2C_BOARD_INFO("tmp105", 0x48), I2C_BOARD_INFO("tmp105", 0x48),
...@@ -598,12 +591,7 @@ static struct i2c_board_info __initdata sdp4430_i2c_4_boardinfo[] = { ...@@ -598,12 +591,7 @@ static struct i2c_board_info __initdata sdp4430_i2c_4_boardinfo[] = {
}; };
static int __init omap4_i2c_init(void) static int __init omap4_i2c_init(void)
{ {
/* omap4_pmic_init("twl6030", &sdp4430_twldata);
* Phoenix Audio IC needs I2C1 to
* start with 400 KHz or less
*/
omap_register_i2c_bus(1, 400, sdp4430_i2c_boardinfo,
ARRAY_SIZE(sdp4430_i2c_boardinfo));
omap_register_i2c_bus(2, 400, NULL, 0); omap_register_i2c_bus(2, 400, NULL, 0);
omap_register_i2c_bus(3, 400, sdp4430_i2c_3_boardinfo, omap_register_i2c_bus(3, 400, sdp4430_i2c_3_boardinfo,
ARRAY_SIZE(sdp4430_i2c_3_boardinfo)); ARRAY_SIZE(sdp4430_i2c_3_boardinfo));
......
...@@ -541,19 +541,9 @@ static struct twl4030_platform_data cm_t35_twldata = { ...@@ -541,19 +541,9 @@ static struct twl4030_platform_data cm_t35_twldata = {
.vpll2 = &cm_t35_vpll2, .vpll2 = &cm_t35_vpll2,
}; };
static struct i2c_board_info __initdata cm_t35_i2c_boardinfo[] = {
{
I2C_BOARD_INFO("tps65930", 0x48),
.flags = I2C_CLIENT_WAKE,
.irq = INT_34XX_SYS_NIRQ,
.platform_data = &cm_t35_twldata,
},
};
static void __init cm_t35_init_i2c(void) static void __init cm_t35_init_i2c(void)
{ {
omap_register_i2c_bus(1, 2600, cm_t35_i2c_boardinfo, omap3_pmic_init("tps65930", &cm_t35_twldata);
ARRAY_SIZE(cm_t35_i2c_boardinfo));
} }
static void __init cm_t35_init_early(void) static void __init cm_t35_init_early(void)
......
...@@ -366,19 +366,9 @@ static struct twl4030_platform_data devkit8000_twldata = { ...@@ -366,19 +366,9 @@ static struct twl4030_platform_data devkit8000_twldata = {
.keypad = &devkit8000_kp_data, .keypad = &devkit8000_kp_data,
}; };
static struct i2c_board_info __initdata devkit8000_i2c_boardinfo[] = {
{
I2C_BOARD_INFO("tps65930", 0x48),
.flags = I2C_CLIENT_WAKE,
.irq = INT_34XX_SYS_NIRQ,
.platform_data = &devkit8000_twldata,
},
};
static int __init devkit8000_i2c_init(void) static int __init devkit8000_i2c_init(void)
{ {
omap_register_i2c_bus(1, 2600, devkit8000_i2c_boardinfo, omap3_pmic_init("tps65930", &devkit8000_twldata);
ARRAY_SIZE(devkit8000_i2c_boardinfo));
/* Bus 3 is attached to the DVI port where devices like the pico DLP /* Bus 3 is attached to the DVI port where devices like the pico DLP
* projector don't work reliably with 400kHz */ * projector don't work reliably with 400kHz */
omap_register_i2c_bus(3, 400, NULL, 0); omap_register_i2c_bus(3, 400, NULL, 0);
......
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
#include "mux.h" #include "mux.h"
#include "hsmmc.h" #include "hsmmc.h"
#include "sdram-numonyx-m65kxxxxam.h" #include "sdram-numonyx-m65kxxxxam.h"
#include "common-board-devices.h"
#define IGEP2_SMSC911X_CS 5 #define IGEP2_SMSC911X_CS 5
#define IGEP2_SMSC911X_GPIO 176 #define IGEP2_SMSC911X_GPIO 176
...@@ -536,15 +537,6 @@ static struct twl4030_platform_data igep2_twldata = { ...@@ -536,15 +537,6 @@ static struct twl4030_platform_data igep2_twldata = {
.vio = &igep2_vio, .vio = &igep2_vio,
}; };
static struct i2c_board_info __initdata igep2_i2c1_boardinfo[] = {
{
I2C_BOARD_INFO("twl4030", 0x48),
.flags = I2C_CLIENT_WAKE,
.irq = INT_34XX_SYS_NIRQ,
.platform_data = &igep2_twldata,
},
};
static struct i2c_board_info __initdata igep2_i2c3_boardinfo[] = { static struct i2c_board_info __initdata igep2_i2c3_boardinfo[] = {
{ {
I2C_BOARD_INFO("eeprom", 0x50), I2C_BOARD_INFO("eeprom", 0x50),
...@@ -555,10 +547,7 @@ static void __init igep2_i2c_init(void) ...@@ -555,10 +547,7 @@ static void __init igep2_i2c_init(void)
{ {
int ret; int ret;
ret = omap_register_i2c_bus(1, 2600, igep2_i2c1_boardinfo, omap3_pmic_init("twl4030", &igep2_twldata);
ARRAY_SIZE(igep2_i2c1_boardinfo));
if (ret)
pr_warning("IGEP2: Could not register I2C1 bus (%d)\n", ret);
/* /*
* Bus 3 is attached to the DVI port where devices like the pico DLP * Bus 3 is attached to the DVI port where devices like the pico DLP
......
...@@ -35,6 +35,7 @@ ...@@ -35,6 +35,7 @@
#include "mux.h" #include "mux.h"
#include "hsmmc.h" #include "hsmmc.h"
#include "sdram-numonyx-m65kxxxxam.h" #include "sdram-numonyx-m65kxxxxam.h"
#include "common-board-devices.h"
#define IGEP3_GPIO_LED0_GREEN 54 #define IGEP3_GPIO_LED0_GREEN 54
#define IGEP3_GPIO_LED0_RED 53 #define IGEP3_GPIO_LED0_RED 53
...@@ -349,19 +350,9 @@ static struct twl4030_platform_data igep3_twl4030_pdata = { ...@@ -349,19 +350,9 @@ static struct twl4030_platform_data igep3_twl4030_pdata = {
.vio = &igep3_vio, .vio = &igep3_vio,
}; };
static struct i2c_board_info __initdata igep3_i2c_boardinfo[] = {
{
I2C_BOARD_INFO("twl4030", 0x48),
.flags = I2C_CLIENT_WAKE,
.irq = INT_34XX_SYS_NIRQ,
.platform_data = &igep3_twl4030_pdata,
},
};
static int __init igep3_i2c_init(void) static int __init igep3_i2c_init(void)
{ {
omap_register_i2c_bus(1, 2600, igep3_i2c_boardinfo, omap3_pmic_init("twl4030", &igep3_twl4030_pdata);
ARRAY_SIZE(igep3_i2c_boardinfo));
return 0; return 0;
} }
......
...@@ -265,19 +265,9 @@ static struct twl4030_platform_data ldp_twldata = { ...@@ -265,19 +265,9 @@ static struct twl4030_platform_data ldp_twldata = {
.keypad = &ldp_kp_twl4030_data, .keypad = &ldp_kp_twl4030_data,
}; };
static struct i2c_board_info __initdata ldp_i2c_boardinfo[] = {
{
I2C_BOARD_INFO("twl4030", 0x48),
.flags = I2C_CLIENT_WAKE,
.irq = INT_34XX_SYS_NIRQ,
.platform_data = &ldp_twldata,
},
};
static int __init omap_i2c_init(void) static int __init omap_i2c_init(void)
{ {
omap_register_i2c_bus(1, 2600, ldp_i2c_boardinfo, omap3_pmic_init("twl4030", &ldp_twldata);
ARRAY_SIZE(ldp_i2c_boardinfo));
omap_register_i2c_bus(2, 400, NULL, 0); omap_register_i2c_bus(2, 400, NULL, 0);
omap_register_i2c_bus(3, 400, NULL, 0); omap_register_i2c_bus(3, 400, NULL, 0);
return 0; return 0;
......
...@@ -52,6 +52,7 @@ ...@@ -52,6 +52,7 @@
#include "hsmmc.h" #include "hsmmc.h"
#include "timer-gp.h" #include "timer-gp.h"
#include "pm.h" #include "pm.h"
#include "common-board-devices.h"
#define NAND_BLOCK_SIZE SZ_128K #define NAND_BLOCK_SIZE SZ_128K
...@@ -453,15 +454,6 @@ static struct twl4030_platform_data beagle_twldata = { ...@@ -453,15 +454,6 @@ static struct twl4030_platform_data beagle_twldata = {
.vpll2 = &beagle_vpll2, .vpll2 = &beagle_vpll2,
}; };
static struct i2c_board_info __initdata beagle_i2c_boardinfo[] = {
{
I2C_BOARD_INFO("twl4030", 0x48),
.flags = I2C_CLIENT_WAKE,
.irq = INT_34XX_SYS_NIRQ,
.platform_data = &beagle_twldata,
},
};
static struct i2c_board_info __initdata beagle_i2c_eeprom[] = { static struct i2c_board_info __initdata beagle_i2c_eeprom[] = {
{ {
I2C_BOARD_INFO("eeprom", 0x50), I2C_BOARD_INFO("eeprom", 0x50),
...@@ -470,8 +462,7 @@ static struct i2c_board_info __initdata beagle_i2c_eeprom[] = { ...@@ -470,8 +462,7 @@ static struct i2c_board_info __initdata beagle_i2c_eeprom[] = {
static int __init omap3_beagle_i2c_init(void) static int __init omap3_beagle_i2c_init(void)
{ {
omap_register_i2c_bus(1, 2600, beagle_i2c_boardinfo, omap3_pmic_init("twl4030", &beagle_twldata);
ARRAY_SIZE(beagle_i2c_boardinfo));
/* Bus 3 is attached to the DVI port where devices like the pico DLP /* Bus 3 is attached to the DVI port where devices like the pico DLP
* projector don't work reliably with 400kHz */ * projector don't work reliably with 400kHz */
omap_register_i2c_bus(3, 100, beagle_i2c_eeprom, ARRAY_SIZE(beagle_i2c_eeprom)); omap_register_i2c_bus(3, 100, beagle_i2c_eeprom, ARRAY_SIZE(beagle_i2c_eeprom));
......
...@@ -604,28 +604,13 @@ static struct twl4030_platform_data omap3evm_twldata = { ...@@ -604,28 +604,13 @@ static struct twl4030_platform_data omap3evm_twldata = {
.vdac = &omap3_evm_vdac, .vdac = &omap3_evm_vdac,
.vpll2 = &omap3_evm_vpll2, .vpll2 = &omap3_evm_vpll2,
.vio = &omap3evm_vio, .vio = &omap3evm_vio,
}; .vmmc1 = &omap3evm_vmmc1,
.vsim = &omap3evm_vsim,
static struct i2c_board_info __initdata omap3evm_i2c_boardinfo[] = {
{
I2C_BOARD_INFO("twl4030", 0x48),
.flags = I2C_CLIENT_WAKE,
.irq = INT_34XX_SYS_NIRQ,
.platform_data = &omap3evm_twldata,
},
}; };
static int __init omap3_evm_i2c_init(void) static int __init omap3_evm_i2c_init(void)
{ {
/* omap3_pmic_init("twl4030", &omap3evm_twldata);
* REVISIT: These entries can be set in omap3evm_twl_data
* after a merge with MFD tree
*/
omap3evm_twldata.vmmc1 = &omap3evm_vmmc1;
omap3evm_twldata.vsim = &omap3evm_vsim;
omap_register_i2c_bus(1, 2600, omap3evm_i2c_boardinfo,
ARRAY_SIZE(omap3evm_i2c_boardinfo));
omap_register_i2c_bus(2, 400, NULL, 0); omap_register_i2c_bus(2, 400, NULL, 0);
omap_register_i2c_bus(3, 400, NULL, 0); omap_register_i2c_bus(3, 400, NULL, 0);
return 0; return 0;
......
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
#include "hsmmc.h" #include "hsmmc.h"
#include "timer-gp.h" #include "timer-gp.h"
#include "control.h" #include "control.h"
#include "common-board-devices.h"
#include <plat/mux.h> #include <plat/mux.h>
#include <plat/board.h> #include <plat/board.h>
...@@ -93,19 +94,9 @@ static struct twl4030_platform_data omap3logic_twldata = { ...@@ -93,19 +94,9 @@ static struct twl4030_platform_data omap3logic_twldata = {
.vmmc1 = &omap3logic_vmmc1, .vmmc1 = &omap3logic_vmmc1,
}; };
static struct i2c_board_info __initdata omap3logic_i2c_boardinfo[] = {
{
I2C_BOARD_INFO("twl4030", 0x48),
.flags = I2C_CLIENT_WAKE,
.irq = INT_34XX_SYS_NIRQ,
.platform_data = &omap3logic_twldata,
},
};
static int __init omap3logic_i2c_init(void) static int __init omap3logic_i2c_init(void)
{ {
omap_register_i2c_bus(1, 2600, omap3logic_i2c_boardinfo, omap3_pmic_init("twl4030", &omap3logic_twldata);
ARRAY_SIZE(omap3logic_i2c_boardinfo));
return 0; return 0;
} }
......
...@@ -544,15 +544,6 @@ static struct twl4030_platform_data omap3pandora_twldata = { ...@@ -544,15 +544,6 @@ static struct twl4030_platform_data omap3pandora_twldata = {
.bci = &pandora_bci_data, .bci = &pandora_bci_data,
}; };
static struct i2c_board_info __initdata omap3pandora_i2c_boardinfo[] = {
{
I2C_BOARD_INFO("tps65950", 0x48),
.flags = I2C_CLIENT_WAKE,
.irq = INT_34XX_SYS_NIRQ,
.platform_data = &omap3pandora_twldata,
},
};
static struct i2c_board_info __initdata omap3pandora_i2c3_boardinfo[] = { static struct i2c_board_info __initdata omap3pandora_i2c3_boardinfo[] = {
{ {
I2C_BOARD_INFO("bq27500", 0x55), I2C_BOARD_INFO("bq27500", 0x55),
...@@ -562,8 +553,7 @@ static struct i2c_board_info __initdata omap3pandora_i2c3_boardinfo[] = { ...@@ -562,8 +553,7 @@ static struct i2c_board_info __initdata omap3pandora_i2c3_boardinfo[] = {
static int __init omap3pandora_i2c_init(void) static int __init omap3pandora_i2c_init(void)
{ {
omap_register_i2c_bus(1, 2600, omap3pandora_i2c_boardinfo, omap3_pmic_init("tps65950", &omap3pandora_twldata);
ARRAY_SIZE(omap3pandora_i2c_boardinfo));
/* i2c2 pins are not connected */ /* i2c2 pins are not connected */
omap_register_i2c_bus(3, 100, omap3pandora_i2c3_boardinfo, omap_register_i2c_bus(3, 100, omap3pandora_i2c3_boardinfo,
ARRAY_SIZE(omap3pandora_i2c3_boardinfo)); ARRAY_SIZE(omap3pandora_i2c3_boardinfo));
......
...@@ -455,15 +455,8 @@ static struct twl4030_platform_data omap3stalker_twldata = { ...@@ -455,15 +455,8 @@ static struct twl4030_platform_data omap3stalker_twldata = {
.codec = &omap3stalker_codec_data, .codec = &omap3stalker_codec_data,
.vdac = &omap3_stalker_vdac, .vdac = &omap3_stalker_vdac,
.vpll2 = &omap3_stalker_vpll2, .vpll2 = &omap3_stalker_vpll2,
}; .vmmc1 = &omap3stalker_vmmc1,
.vsim = &omap3stalker_vsim,
static struct i2c_board_info __initdata omap3stalker_i2c_boardinfo[] = {
{
I2C_BOARD_INFO("twl4030", 0x48),
.flags = I2C_CLIENT_WAKE,
.irq = INT_34XX_SYS_NIRQ,
.platform_data = &omap3stalker_twldata,
},
}; };
static struct at24_platform_data fram_info = { static struct at24_platform_data fram_info = {
...@@ -482,15 +475,7 @@ static struct i2c_board_info __initdata omap3stalker_i2c_boardinfo3[] = { ...@@ -482,15 +475,7 @@ static struct i2c_board_info __initdata omap3stalker_i2c_boardinfo3[] = {
static int __init omap3_stalker_i2c_init(void) static int __init omap3_stalker_i2c_init(void)
{ {
/* omap3_pmic_init("twl4030", &omap3stalker_twldata);
* REVISIT: These entries can be set in omap3evm_twl_data
* after a merge with MFD tree
*/
omap3stalker_twldata.vmmc1 = &omap3stalker_vmmc1;
omap3stalker_twldata.vsim = &omap3stalker_vsim;
omap_register_i2c_bus(1, 2600, omap3stalker_i2c_boardinfo,
ARRAY_SIZE(omap3stalker_i2c_boardinfo));
omap_register_i2c_bus(2, 400, NULL, 0); omap_register_i2c_bus(2, 400, NULL, 0);
omap_register_i2c_bus(3, 400, omap3stalker_i2c_boardinfo3, omap_register_i2c_bus(3, 400, omap3stalker_i2c_boardinfo3,
ARRAY_SIZE(omap3stalker_i2c_boardinfo3)); ARRAY_SIZE(omap3stalker_i2c_boardinfo3));
......
...@@ -274,15 +274,6 @@ static struct twl4030_platform_data touchbook_twldata = { ...@@ -274,15 +274,6 @@ static struct twl4030_platform_data touchbook_twldata = {
.vpll2 = &touchbook_vpll2, .vpll2 = &touchbook_vpll2,
}; };
static struct i2c_board_info __initdata touchbook_i2c_boardinfo[] = {
{
I2C_BOARD_INFO("twl4030", 0x48),
.flags = I2C_CLIENT_WAKE,
.irq = INT_34XX_SYS_NIRQ,
.platform_data = &touchbook_twldata,
},
};
static struct i2c_board_info __initdata touchBook_i2c_boardinfo[] = { static struct i2c_board_info __initdata touchBook_i2c_boardinfo[] = {
{ {
I2C_BOARD_INFO("bq27200", 0x55), I2C_BOARD_INFO("bq27200", 0x55),
...@@ -292,8 +283,7 @@ static struct i2c_board_info __initdata touchBook_i2c_boardinfo[] = { ...@@ -292,8 +283,7 @@ static struct i2c_board_info __initdata touchBook_i2c_boardinfo[] = {
static int __init omap3_touchbook_i2c_init(void) static int __init omap3_touchbook_i2c_init(void)
{ {
/* Standard TouchBook bus */ /* Standard TouchBook bus */
omap_register_i2c_bus(1, 2600, touchbook_i2c_boardinfo, omap3_pmic_init("twl4030", &touchbook_twldata);
ARRAY_SIZE(touchbook_i2c_boardinfo));
/* Additional TouchBook bus */ /* Additional TouchBook bus */
omap_register_i2c_bus(3, 100, touchBook_i2c_boardinfo, omap_register_i2c_bus(3, 100, touchBook_i2c_boardinfo,
......
...@@ -46,6 +46,7 @@ ...@@ -46,6 +46,7 @@
#include "hsmmc.h" #include "hsmmc.h"
#include "control.h" #include "control.h"
#include "mux.h" #include "mux.h"
#include "common-board-devices.h"
#define GPIO_HUB_POWER 1 #define GPIO_HUB_POWER 1
#define GPIO_HUB_NRESET 62 #define GPIO_HUB_NRESET 62
...@@ -408,15 +409,6 @@ static struct twl4030_platform_data omap4_panda_twldata = { ...@@ -408,15 +409,6 @@ static struct twl4030_platform_data omap4_panda_twldata = {
.usb = &omap4_usbphy_data, .usb = &omap4_usbphy_data,
}; };
static struct i2c_board_info __initdata omap4_panda_i2c_boardinfo[] = {
{
I2C_BOARD_INFO("twl6030", 0x48),
.flags = I2C_CLIENT_WAKE,
.irq = OMAP44XX_IRQ_SYS_1N,
.platform_data = &omap4_panda_twldata,
},
};
/* /*
* Display monitor features are burnt in their EEPROM as EDID data. The EEPROM * Display monitor features are burnt in their EEPROM as EDID data. The EEPROM
* is connected as I2C slave device, and can be accessed at address 0x50 * is connected as I2C slave device, and can be accessed at address 0x50
...@@ -429,12 +421,7 @@ static struct i2c_board_info __initdata panda_i2c_eeprom[] = { ...@@ -429,12 +421,7 @@ static struct i2c_board_info __initdata panda_i2c_eeprom[] = {
static int __init omap4_panda_i2c_init(void) static int __init omap4_panda_i2c_init(void)
{ {
/* omap4_pmic_init("twl6030", &omap4_panda_twldata);
* Phoenix Audio IC needs I2C1 to
* start with 400 KHz or less
*/
omap_register_i2c_bus(1, 400, omap4_panda_i2c_boardinfo,
ARRAY_SIZE(omap4_panda_i2c_boardinfo));
omap_register_i2c_bus(2, 400, NULL, 0); omap_register_i2c_bus(2, 400, NULL, 0);
/* /*
* Bus 3 is attached to the DVI port where devices like the pico DLP * Bus 3 is attached to the DVI port where devices like the pico DLP
......
...@@ -540,19 +540,9 @@ static struct twl4030_platform_data overo_twldata = { ...@@ -540,19 +540,9 @@ static struct twl4030_platform_data overo_twldata = {
.vpll2 = &overo_vpll2, .vpll2 = &overo_vpll2,
}; };
static struct i2c_board_info __initdata overo_i2c_boardinfo[] = {
{
I2C_BOARD_INFO("tps65950", 0x48),
.flags = I2C_CLIENT_WAKE,
.irq = INT_34XX_SYS_NIRQ,
.platform_data = &overo_twldata,
},
};
static int __init overo_i2c_init(void) static int __init overo_i2c_init(void)
{ {
omap_register_i2c_bus(1, 2600, overo_i2c_boardinfo, omap3_pmic_init("tps65950", &overo_twldata);
ARRAY_SIZE(overo_i2c_boardinfo));
/* i2c2 pins are used for gpio */ /* i2c2 pins are used for gpio */
omap_register_i2c_bus(3, 400, NULL, 0); omap_register_i2c_bus(3, 400, NULL, 0);
return 0; return 0;
......
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
#include "mux.h" #include "mux.h"
#include "hsmmc.h" #include "hsmmc.h"
#include "sdram-nokia.h" #include "sdram-nokia.h"
#include "common-board-devices.h"
static struct regulator_consumer_supply rm680_vemmc_consumers[] = { static struct regulator_consumer_supply rm680_vemmc_consumers[] = {
REGULATOR_SUPPLY("vmmc", "omap_hsmmc.1"), REGULATOR_SUPPLY("vmmc", "omap_hsmmc.1"),
...@@ -90,19 +91,9 @@ static struct twl4030_platform_data rm680_twl_data = { ...@@ -90,19 +91,9 @@ static struct twl4030_platform_data rm680_twl_data = {
/* add rest of the children here */ /* add rest of the children here */
}; };
static struct i2c_board_info __initdata rm680_twl_i2c_board_info[] = {
{
I2C_BOARD_INFO("twl5031", 0x48),
.flags = I2C_CLIENT_WAKE,
.irq = INT_34XX_SYS_NIRQ,
.platform_data = &rm680_twl_data,
},
};
static void __init rm680_i2c_init(void) static void __init rm680_i2c_init(void)
{ {
omap_register_i2c_bus(1, 2900, rm680_twl_i2c_board_info, omap_pmic_init(1, 2900, "twl5031", INT_34XX_SYS_NIRQ, &rm680_twl_data);
ARRAY_SIZE(rm680_twl_i2c_board_info));
omap_register_i2c_bus(2, 400, NULL, 0); omap_register_i2c_bus(2, 400, NULL, 0);
omap_register_i2c_bus(3, 400, NULL, 0); omap_register_i2c_bus(3, 400, NULL, 0);
} }
......
...@@ -43,6 +43,7 @@ ...@@ -43,6 +43,7 @@
#include "mux.h" #include "mux.h"
#include "hsmmc.h" #include "hsmmc.h"
#include "common-board-devices.h"
#define SYSTEM_REV_B_USES_VAUX3 0x1699 #define SYSTEM_REV_B_USES_VAUX3 0x1699
#define SYSTEM_REV_S_USES_VAUX3 0x8 #define SYSTEM_REV_S_USES_VAUX3 0x8
...@@ -777,15 +778,6 @@ static struct tpa6130a2_platform_data rx51_tpa6130a2_data __initdata_or_module = ...@@ -777,15 +778,6 @@ static struct tpa6130a2_platform_data rx51_tpa6130a2_data __initdata_or_module =
.power_gpio = 98, .power_gpio = 98,
}; };
static struct i2c_board_info __initdata rx51_peripherals_i2c_board_info_1[] = {
{
I2C_BOARD_INFO("twl5030", 0x48),
.flags = I2C_CLIENT_WAKE,
.irq = INT_34XX_SYS_NIRQ,
.platform_data = &rx51_twldata,
},
};
/* Audio setup data */ /* Audio setup data */
static struct aic3x_setup_data rx51_aic34_setup = { static struct aic3x_setup_data rx51_aic34_setup = {
.gpio_func[0] = AIC3X_GPIO1_FUNC_DISABLED, .gpio_func[0] = AIC3X_GPIO1_FUNC_DISABLED,
...@@ -833,8 +825,7 @@ static int __init rx51_i2c_init(void) ...@@ -833,8 +825,7 @@ static int __init rx51_i2c_init(void)
rx51_twldata.vaux3 = &rx51_vaux3_cam; rx51_twldata.vaux3 = &rx51_vaux3_cam;
} }
rx51_twldata.vmmc2 = &rx51_vmmc2; rx51_twldata.vmmc2 = &rx51_vmmc2;
omap_register_i2c_bus(1, 2200, rx51_peripherals_i2c_board_info_1, omap_pmic_init(1, 2200, "twl5030", INT_34XX_SYS_NIRQ, &rx51_twldata);
ARRAY_SIZE(rx51_peripherals_i2c_board_info_1));
omap_register_i2c_bus(2, 100, rx51_peripherals_i2c_board_info_2, omap_register_i2c_bus(2, 100, rx51_peripherals_i2c_board_info_2,
ARRAY_SIZE(rx51_peripherals_i2c_board_info_2)); ARRAY_SIZE(rx51_peripherals_i2c_board_info_2));
omap_register_i2c_bus(3, 400, NULL, 0); omap_register_i2c_bus(3, 400, NULL, 0);
......
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
#include "mux.h" #include "mux.h"
#include "hsmmc.h" #include "hsmmc.h"
#include "common-board-devices.h"
#define OMAP_ZOOM_WLAN_PMENA_GPIO (101) #define OMAP_ZOOM_WLAN_PMENA_GPIO (101)
#define OMAP_ZOOM_WLAN_IRQ_GPIO (162) #define OMAP_ZOOM_WLAN_IRQ_GPIO (162)
...@@ -349,15 +350,6 @@ static struct twl4030_platform_data zoom_twldata = { ...@@ -349,15 +350,6 @@ static struct twl4030_platform_data zoom_twldata = {
.vdac = &zoom_vdac, .vdac = &zoom_vdac,
}; };
static struct i2c_board_info __initdata zoom_i2c_boardinfo[] = {
{
I2C_BOARD_INFO("twl5030", 0x48),
.flags = I2C_CLIENT_WAKE,
.irq = INT_34XX_SYS_NIRQ,
.platform_data = &zoom_twldata,
},
};
static int __init omap_i2c_init(void) static int __init omap_i2c_init(void)
{ {
if (machine_is_omap_zoom2()) { if (machine_is_omap_zoom2()) {
...@@ -365,8 +357,7 @@ static int __init omap_i2c_init(void) ...@@ -365,8 +357,7 @@ static int __init omap_i2c_init(void)
zoom_audio_data.hs_extmute = 1; zoom_audio_data.hs_extmute = 1;
zoom_audio_data.set_hs_extmute = zoom2_set_hs_extmute; zoom_audio_data.set_hs_extmute = zoom2_set_hs_extmute;
} }
omap_register_i2c_bus(1, 2400, zoom_i2c_boardinfo, omap_pmic_init(1, 2400, "twl5030", INT_34XX_SYS_NIRQ, &zoom_twldata);
ARRAY_SIZE(zoom_i2c_boardinfo));
omap_register_i2c_bus(2, 400, NULL, 0); omap_register_i2c_bus(2, 400, NULL, 0);
omap_register_i2c_bus(3, 400, NULL, 0); omap_register_i2c_bus(3, 400, NULL, 0);
return 0; return 0;
......
...@@ -20,14 +20,35 @@ ...@@ -20,14 +20,35 @@
* *
*/ */
#include <linux/i2c.h>
#include <linux/i2c/twl.h>
#include <linux/gpio.h> #include <linux/gpio.h>
#include <linux/spi/spi.h> #include <linux/spi/spi.h>
#include <linux/spi/ads7846.h> #include <linux/spi/ads7846.h>
#include <plat/i2c.h>
#include <plat/mcspi.h> #include <plat/mcspi.h>
#include "common-board-devices.h" #include "common-board-devices.h"
static struct i2c_board_info __initdata pmic_i2c_board_info = {
.addr = 0x48,
.flags = I2C_CLIENT_WAKE,
};
void __init omap_pmic_init(int bus, u32 clkrate,
const char *pmic_type, int pmic_irq,
struct twl4030_platform_data *pmic_data)
{
strncpy(pmic_i2c_board_info.type, pmic_type,
sizeof(pmic_i2c_board_info.type));
pmic_i2c_board_info.irq = pmic_irq;
pmic_i2c_board_info.platform_data = pmic_data;
omap_register_i2c_bus(bus, clkrate, &pmic_i2c_board_info, 1);
}
static struct omap2_mcspi_device_config ads7846_mcspi_config = { static struct omap2_mcspi_device_config ads7846_mcspi_config = {
.turbo_mode = 0, .turbo_mode = 0,
.single_channel = 1, /* 0: slave, 1: master */ .single_channel = 1, /* 0: slave, 1: master */
......
#ifndef __OMAP_COMMON_BOARD_DEVICES__ #ifndef __OMAP_COMMON_BOARD_DEVICES__
#define __OMAP_COMMON_BOARD_DEVICES__ #define __OMAP_COMMON_BOARD_DEVICES__
struct twl4030_platform_data;
void omap_pmic_init(int bus, u32 clkrate, const char *pmic_type, int pmic_irq,
struct twl4030_platform_data *pmic_data);
static inline void omap2_pmic_init(const char *pmic_type,
struct twl4030_platform_data *pmic_data)
{
omap_pmic_init(2, 2600, pmic_type, INT_24XX_SYS_NIRQ, pmic_data);
}
static inline void omap3_pmic_init(const char *pmic_type,
struct twl4030_platform_data *pmic_data)
{
omap_pmic_init(1, 2600, pmic_type, INT_34XX_SYS_NIRQ, pmic_data);
}
static inline void omap4_pmic_init(const char *pmic_type,
struct twl4030_platform_data *pmic_data)
{
/* Phoenix Audio IC needs I2C1 to start with 400 KHz or less */
omap_pmic_init(1, 400, pmic_type, OMAP44XX_IRQ_SYS_1N, pmic_data);
}
#if defined(CONFIG_TOUCHSCREEN_ADS7846) || \ #if defined(CONFIG_TOUCHSCREEN_ADS7846) || \
defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE) defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE)
struct ads7846_platform_data; struct ads7846_platform_data;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment