diff options
Diffstat (limited to 'arch/arm/mach-ux500/board-mop500-uib.c')
-rw-r--r-- | arch/arm/mach-ux500/board-mop500-uib.c | 97 |
1 files changed, 0 insertions, 97 deletions
diff --git a/arch/arm/mach-ux500/board-mop500-uib.c b/arch/arm/mach-ux500/board-mop500-uib.c deleted file mode 100644 index 2742eeccbcd0..000000000000 --- a/arch/arm/mach-ux500/board-mop500-uib.c +++ /dev/null | |||
@@ -1,97 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) ST-Ericsson SA 2010 | ||
3 | * | ||
4 | * Author: Rabin Vincent <rabin.vincent@stericsson.com> for ST-Ericsson | ||
5 | * License terms: GNU General Public License (GPL), version 2 | ||
6 | */ | ||
7 | |||
8 | #define pr_fmt(fmt) "mop500-uib: " fmt | ||
9 | |||
10 | #include <linux/kernel.h> | ||
11 | #include <linux/init.h> | ||
12 | #include <linux/i2c.h> | ||
13 | |||
14 | #include "board-mop500.h" | ||
15 | #include "id.h" | ||
16 | |||
17 | enum mop500_uib { | ||
18 | }; | ||
19 | |||
20 | struct uib { | ||
21 | const char *name; | ||
22 | const char *option; | ||
23 | void (*init)(void); | ||
24 | }; | ||
25 | |||
26 | static struct uib __initdata mop500_uibs[] = { | ||
27 | }; | ||
28 | |||
29 | static struct uib *mop500_uib; | ||
30 | |||
31 | static int __init mop500_uib_setup(char *str) | ||
32 | { | ||
33 | int i; | ||
34 | |||
35 | for (i = 0; i < ARRAY_SIZE(mop500_uibs); i++) { | ||
36 | struct uib *uib = &mop500_uibs[i]; | ||
37 | |||
38 | if (!strcmp(str, uib->option)) { | ||
39 | mop500_uib = uib; | ||
40 | break; | ||
41 | } | ||
42 | } | ||
43 | |||
44 | if (i == ARRAY_SIZE(mop500_uibs)) | ||
45 | pr_err("invalid uib= option (%s)\n", str); | ||
46 | |||
47 | return 1; | ||
48 | } | ||
49 | __setup("uib=", mop500_uib_setup); | ||
50 | |||
51 | /* | ||
52 | * The UIBs are detected after the I2C host controllers are registered, so | ||
53 | * i2c_register_board_info() can't be used. | ||
54 | */ | ||
55 | void mop500_uib_i2c_add(int busnum, struct i2c_board_info *info, | ||
56 | unsigned n) | ||
57 | { | ||
58 | struct i2c_adapter *adap; | ||
59 | struct i2c_client *client; | ||
60 | int i; | ||
61 | |||
62 | adap = i2c_get_adapter(busnum); | ||
63 | if (!adap) { | ||
64 | pr_err("failed to get adapter i2c%d\n", busnum); | ||
65 | return; | ||
66 | } | ||
67 | |||
68 | for (i = 0; i < n; i++) { | ||
69 | client = i2c_new_device(adap, &info[i]); | ||
70 | if (!client) | ||
71 | pr_err("failed to register %s to i2c%d\n", | ||
72 | info[i].type, busnum); | ||
73 | } | ||
74 | |||
75 | i2c_put_adapter(adap); | ||
76 | } | ||
77 | |||
78 | static void __init __mop500_uib_init(struct uib *uib, const char *why) | ||
79 | { | ||
80 | pr_info("%s (%s)\n", uib->name, why); | ||
81 | uib->init(); | ||
82 | } | ||
83 | |||
84 | int __init mop500_uib_init(void) | ||
85 | { | ||
86 | struct uib *uib = mop500_uib; | ||
87 | |||
88 | if (!cpu_is_u8500_family()) | ||
89 | return -ENODEV; | ||
90 | |||
91 | if (uib) { | ||
92 | __mop500_uib_init(uib, "from uib= boot argument"); | ||
93 | return 0; | ||
94 | } | ||
95 | |||
96 | return 0; | ||
97 | } | ||