1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
|
From 89137f6fe9aafee168fe116b905cd21988fe587b Mon Sep 17 00:00:00 2001
From: Koen Kooi <koen@dominion.thruhere.net>
Date: Mon, 3 May 2010 22:31:34 +0200
Subject: [PATCH 09/48] ARM: OMAP: beagleboard: initialize ds1307 and eeprom only for zippy and zippy2
---
arch/arm/mach-omap2/board-omap3beagle.c | 39 +++++++++++++++++++++++++++---
1 files changed, 35 insertions(+), 4 deletions(-)
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
index c9af202..b3c8cb7 100644
--- a/arch/arm/mach-omap2/board-omap3beagle.c
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
@@ -496,24 +496,55 @@ static struct i2c_board_info __initdata beagle_i2c1_boardinfo[] = {
},
};
+
+#if defined(CONFIG_EEPROM_AT24) || defined(CONFIG_EEPROM_AT24_MODULE)
+#include <linux/i2c/at24.h>
+
+static struct at24_platform_data m24c01 = {
+ .byte_len = SZ_1K / 8,
+ .page_size = 16,
+};
+
#if defined(CONFIG_RTC_DRV_DS1307) || \
defined(CONFIG_RTC_DRV_DS1307_MODULE)
-static struct i2c_board_info __initdata beagle_i2c2_boardinfo[] = {
+static struct i2c_board_info __initdata beagle_zippy_i2c2_boardinfo[] = {
{
I2C_BOARD_INFO("ds1307", 0x68),
},
+ {
+ I2C_BOARD_INFO("24c01", 0x50),
+ .platform_data = &m24c01,
+ },
};
#else
-static struct i2c_board_info __initdata beagle_i2c2_boardinfo[] = {};
+static struct i2c_board_info __initdata beagle_zippy_i2c2_boardinfo[] = {
+ {
+ I2C_BOARD_INFO("24c01", 0x50),
+ .platform_data = &m24c01,
+ },
+};
+#endif
+#else
+static struct i2c_board_info __initdata beagle_zippy_i2c2_boardinfo[] = {};
#endif
+static struct i2c_board_info __initdata beagle_i2c2_boardinfo[] = {};
+
static int __init omap3_beagle_i2c_init(void)
{
omap_register_i2c_bus(1, 2600, beagle_i2c1_boardinfo,
ARRAY_SIZE(beagle_i2c1_boardinfo));
- omap_register_i2c_bus(2, 400, beagle_i2c2_boardinfo,
- ARRAY_SIZE(beagle_i2c2_boardinfo));
+ if(!strcmp(expansionboard_name, "zippy") || !strcmp(expansionboard_name, "zippy2"))
+ {
+ printk(KERN_INFO "Beagle expansionboard: registering i2c2 bus for zippy/zippy2\n");
+ omap_register_i2c_bus(2, 400, beagle_zippy_i2c2_boardinfo,
+ ARRAY_SIZE(beagle_zippy_i2c2_boardinfo));
+ } else
+ {
+ omap_register_i2c_bus(2, 400, beagle_i2c2_boardinfo,
+ ARRAY_SIZE(beagle_i2c2_boardinfo));
+ }
/* Bus 3 is attached to the DVI port where devices like the pico DLP
* projector don't work reliably with 400kHz */
omap_register_i2c_bus(3, 100, NULL, 0);
--
1.6.6.1
|