diff options
author | Peter Ujfalusi <peter.ujfalusi@ti.com> | 2011-06-04 01:16:41 -0400 |
---|---|---|
committer | Peter Ujfalusi <peter.ujfalusi@ti.com> | 2011-07-04 11:43:27 -0400 |
commit | a53b8e3b995f8b7c8a8c4ef5aa367958e46139b3 (patch) | |
tree | b6fea956eb93a06aa4b7d66338e27717e140b9d5 /arch/arm/mach-omap2/twl-common.c | |
parent | 48cb1258e8b0f8c81cfb699b42326c5b2147b3f8 (diff) |
OMAP: New twl-common for common TWL configuration
Introduce a new file, which will be used to configure
common pmic (TWL) devices, regulators, and TWL audio.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm/mach-omap2/twl-common.c')
-rw-r--r-- | arch/arm/mach-omap2/twl-common.c | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/twl-common.c b/arch/arm/mach-omap2/twl-common.c new file mode 100644 index 000000000000..4f7b24c1a264 --- /dev/null +++ b/arch/arm/mach-omap2/twl-common.c | |||
@@ -0,0 +1,46 @@ | |||
1 | /* | ||
2 | * twl-common.c | ||
3 | * | ||
4 | * Copyright (C) 2011 Texas Instruments, Inc.. | ||
5 | * Author: Peter Ujfalusi <peter.ujfalusi@ti.com> | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or | ||
8 | * modify it under the terms of the GNU General Public License | ||
9 | * version 2 as published by the Free Software Foundation. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, but | ||
12 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
14 | * General Public License for more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public License | ||
17 | * along with this program; if not, write to the Free Software | ||
18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | ||
19 | * 02110-1301 USA | ||
20 | * | ||
21 | */ | ||
22 | |||
23 | #include <linux/i2c.h> | ||
24 | #include <linux/i2c/twl.h> | ||
25 | #include <linux/gpio.h> | ||
26 | |||
27 | #include <plat/i2c.h> | ||
28 | |||
29 | #include "twl-common.h" | ||
30 | |||
31 | static struct i2c_board_info __initdata pmic_i2c_board_info = { | ||
32 | .addr = 0x48, | ||
33 | .flags = I2C_CLIENT_WAKE, | ||
34 | }; | ||
35 | |||
36 | void __init omap_pmic_init(int bus, u32 clkrate, | ||
37 | const char *pmic_type, int pmic_irq, | ||
38 | struct twl4030_platform_data *pmic_data) | ||
39 | { | ||
40 | strncpy(pmic_i2c_board_info.type, pmic_type, | ||
41 | sizeof(pmic_i2c_board_info.type)); | ||
42 | pmic_i2c_board_info.irq = pmic_irq; | ||
43 | pmic_i2c_board_info.platform_data = pmic_data; | ||
44 | |||
45 | omap_register_i2c_bus(bus, clkrate, &pmic_i2c_board_info, 1); | ||
46 | } | ||