diff options
author | Andrew Lunn <andrew@lunn.ch> | 2014-02-25 12:34:01 -0500 |
---|---|---|
committer | Jason Cooper <jason@lakedaemon.net> | 2014-02-25 15:32:16 -0500 |
commit | b02b64384696ad13d6a827dc7775489d01b3dfd9 (patch) | |
tree | afdb11754f61b7004c181b2d3f1221a63c7edc4f | |
parent | 1b82af4f1749119fca8e07451223da10d3ca938d (diff) |
ARM: kirkwood: Add HP T5325 thin client
Convert the kirkwood t5325-setup.c to mostly device tree for
mach-mvebu. Part of the audio setup needs to remain in C for the
moment until suitable bindings are designed and implemented. So add
board code, triggered by the compatibility string.
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
-rw-r--r-- | arch/arm/mach-mvebu/Kconfig | 7 | ||||
-rw-r--r-- | arch/arm/mach-mvebu/Makefile | 1 | ||||
-rw-r--r-- | arch/arm/mach-mvebu/board-t5325.c | 41 | ||||
-rw-r--r-- | arch/arm/mach-mvebu/board.h | 22 | ||||
-rw-r--r-- | arch/arm/mach-mvebu/kirkwood.c | 11 |
5 files changed, 81 insertions, 1 deletions
diff --git a/arch/arm/mach-mvebu/Kconfig b/arch/arm/mach-mvebu/Kconfig index 2d7af55e9f75..5e533612e734 100644 --- a/arch/arm/mach-mvebu/Kconfig +++ b/arch/arm/mach-mvebu/Kconfig | |||
@@ -63,6 +63,13 @@ config MACH_KIRKWOOD | |||
63 | Say 'Y' here if you want your kernel to support boards based | 63 | Say 'Y' here if you want your kernel to support boards based |
64 | on the Marvell Kirkwood device tree. | 64 | on the Marvell Kirkwood device tree. |
65 | 65 | ||
66 | config MACH_T5325 | ||
67 | bool "HP T5325 thin client" | ||
68 | depends on MACH_KIRKWOOD | ||
69 | help | ||
70 | Say 'Y' here if you want your kernel to support the | ||
71 | HP T5325 Thin client | ||
72 | |||
66 | endmenu | 73 | endmenu |
67 | 74 | ||
68 | endif | 75 | endif |
diff --git a/arch/arm/mach-mvebu/Makefile b/arch/arm/mach-mvebu/Makefile index 6809ec769dd6..a903f8ad8a4a 100644 --- a/arch/arm/mach-mvebu/Makefile +++ b/arch/arm/mach-mvebu/Makefile | |||
@@ -8,3 +8,4 @@ obj-$(CONFIG_MACH_ARMADA_370_XP) += armada-370-xp.o | |||
8 | obj-$(CONFIG_SMP) += platsmp.o headsmp.o | 8 | obj-$(CONFIG_SMP) += platsmp.o headsmp.o |
9 | obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o | 9 | obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o |
10 | obj-$(CONFIG_MACH_KIRKWOOD) += kirkwood.o kirkwood-pm.o | 10 | obj-$(CONFIG_MACH_KIRKWOOD) += kirkwood.o kirkwood-pm.o |
11 | obj-$(CONFIG_MACH_T5325) += board-t5325.o | ||
diff --git a/arch/arm/mach-mvebu/board-t5325.c b/arch/arm/mach-mvebu/board-t5325.c new file mode 100644 index 000000000000..65ace6db9f28 --- /dev/null +++ b/arch/arm/mach-mvebu/board-t5325.c | |||
@@ -0,0 +1,41 @@ | |||
1 | /* | ||
2 | * HP T5325 Board Setup | ||
3 | * | ||
4 | * Copyright (C) 2014 | ||
5 | * | ||
6 | * Andrew Lunn <andrew@lunn.ch> | ||
7 | * | ||
8 | * This file is licensed under the terms of the GNU General Public | ||
9 | * License version 2. This program is licensed "as is" without any | ||
10 | * warranty of any kind, whether express or implied. | ||
11 | */ | ||
12 | |||
13 | #include <linux/kernel.h> | ||
14 | #include <linux/i2c.h> | ||
15 | #include <linux/init.h> | ||
16 | #include <linux/platform_device.h> | ||
17 | #include <sound/alc5623.h> | ||
18 | #include "board.h" | ||
19 | |||
20 | static struct platform_device hp_t5325_audio_device = { | ||
21 | .name = "t5325-audio", | ||
22 | .id = -1, | ||
23 | }; | ||
24 | |||
25 | static struct alc5623_platform_data alc5621_data = { | ||
26 | .add_ctrl = 0x3700, | ||
27 | .jack_det_ctrl = 0x4810, | ||
28 | }; | ||
29 | |||
30 | static struct i2c_board_info i2c_board_info[] __initdata = { | ||
31 | { | ||
32 | I2C_BOARD_INFO("alc5621", 0x1a), | ||
33 | .platform_data = &alc5621_data, | ||
34 | }, | ||
35 | }; | ||
36 | |||
37 | void __init t5325_init(void) | ||
38 | { | ||
39 | i2c_register_board_info(0, i2c_board_info, ARRAY_SIZE(i2c_board_info)); | ||
40 | platform_device_register(&hp_t5325_audio_device); | ||
41 | } | ||
diff --git a/arch/arm/mach-mvebu/board.h b/arch/arm/mach-mvebu/board.h new file mode 100644 index 000000000000..de7f0a191394 --- /dev/null +++ b/arch/arm/mach-mvebu/board.h | |||
@@ -0,0 +1,22 @@ | |||
1 | /* | ||
2 | * Board functions for Marvell System On Chip | ||
3 | * | ||
4 | * Copyright (C) 2014 | ||
5 | * | ||
6 | * Andrew Lunn <andrew@lunn.ch> | ||
7 | * | ||
8 | * This file is licensed under the terms of the GNU General Public | ||
9 | * License version 2. This program is licensed "as is" without any | ||
10 | * warranty of any kind, whether express or implied. | ||
11 | */ | ||
12 | |||
13 | #ifndef __ARCH_MVEBU_BOARD_H | ||
14 | #define __ARCH_MVEBU_BOARD_H | ||
15 | |||
16 | #ifdef CONFIG_MACH_T5325 | ||
17 | void t5325_init(void); | ||
18 | #else | ||
19 | static inline void t5325_init(void) {}; | ||
20 | #endif | ||
21 | |||
22 | #endif | ||
diff --git a/arch/arm/mach-mvebu/kirkwood.c b/arch/arm/mach-mvebu/kirkwood.c index 8a38b10532e5..120207fc36f1 100644 --- a/arch/arm/mach-mvebu/kirkwood.c +++ b/arch/arm/mach-mvebu/kirkwood.c | |||
@@ -25,6 +25,7 @@ | |||
25 | #include "kirkwood.h" | 25 | #include "kirkwood.h" |
26 | #include "kirkwood-pm.h" | 26 | #include "kirkwood-pm.h" |
27 | #include "common.h" | 27 | #include "common.h" |
28 | #include "board.h" | ||
28 | 29 | ||
29 | static struct resource kirkwood_cpufreq_resources[] = { | 30 | static struct resource kirkwood_cpufreq_resources[] = { |
30 | [0] = { | 31 | [0] = { |
@@ -158,6 +159,11 @@ void kirkwood_disable_mbus_error_propagation(void) | |||
158 | writel(readl(cpu_config) & ~CPU_CONFIG_ERROR_PROP, cpu_config); | 159 | writel(readl(cpu_config) & ~CPU_CONFIG_ERROR_PROP, cpu_config); |
159 | } | 160 | } |
160 | 161 | ||
162 | static struct of_dev_auxdata auxdata[] __initdata = { | ||
163 | OF_DEV_AUXDATA("marvell,kirkwood-audio", 0xf10a0000, | ||
164 | "mvebu-audio", NULL), | ||
165 | { /* sentinel */ } | ||
166 | }; | ||
161 | 167 | ||
162 | static void __init kirkwood_dt_init(void) | 168 | static void __init kirkwood_dt_init(void) |
163 | { | 169 | { |
@@ -174,7 +180,10 @@ static void __init kirkwood_dt_init(void) | |||
174 | kirkwood_pm_init(); | 180 | kirkwood_pm_init(); |
175 | kirkwood_dt_eth_fixup(); | 181 | kirkwood_dt_eth_fixup(); |
176 | 182 | ||
177 | of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); | 183 | if (of_machine_is_compatible("hp,t5325")) |
184 | t5325_init(); | ||
185 | |||
186 | of_platform_populate(NULL, of_default_bus_match_table, auxdata, NULL); | ||
178 | } | 187 | } |
179 | 188 | ||
180 | static const char * const kirkwood_dt_board_compat[] = { | 189 | static const char * const kirkwood_dt_board_compat[] = { |