aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-ux500/board-mop500.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-ux500/board-mop500.c')
-rw-r--r--arch/arm/mach-ux500/board-mop500.c49
1 files changed, 48 insertions, 1 deletions
diff --git a/arch/arm/mach-ux500/board-mop500.c b/arch/arm/mach-ux500/board-mop500.c
index d0076453d7ff..dc8746d7826e 100644
--- a/arch/arm/mach-ux500/board-mop500.c
+++ b/arch/arm/mach-ux500/board-mop500.c
@@ -22,6 +22,8 @@
22#include <linux/mfd/ab8500.h> 22#include <linux/mfd/ab8500.h>
23#include <linux/regulator/ab8500.h> 23#include <linux/regulator/ab8500.h>
24#include <linux/mfd/tc3589x.h> 24#include <linux/mfd/tc3589x.h>
25#include <linux/mfd/tps6105x.h>
26#include <linux/mfd/ab8500/gpio.h>
25#include <linux/leds-lp5521.h> 27#include <linux/leds-lp5521.h>
26#include <linux/input.h> 28#include <linux/input.h>
27#include <linux/gpio_keys.h> 29#include <linux/gpio_keys.h>
@@ -42,10 +44,35 @@
42#include "board-mop500.h" 44#include "board-mop500.h"
43#include "board-mop500-regulators.h" 45#include "board-mop500-regulators.h"
44 46
47static struct ab8500_gpio_platform_data ab8500_gpio_pdata = {
48 .gpio_base = MOP500_AB8500_GPIO(0),
49 .irq_base = MOP500_AB8500_VIR_GPIO_IRQ_BASE,
50 /* config_reg is the initial configuration of ab8500 pins.
51 * The pins can be configured as GPIO or alt functions based
52 * on value present in GpioSel1 to GpioSel6 and AlternatFunction
53 * register. This is the array of 7 configuration settings.
54 * One has to compile time decide these settings. Below is the
55 * explaination of these setting
56 * GpioSel1 = 0x00 => Pins GPIO1 to GPIO8 are not used as GPIO
57 * GpioSel2 = 0x1E => Pins GPIO10 to GPIO13 are configured as GPIO
58 * GpioSel3 = 0x80 => Pin GPIO24 is configured as GPIO
59 * GpioSel4 = 0x01 => Pin GPIo25 is configured as GPIO
60 * GpioSel5 = 0x7A => Pins GPIO34, GPIO36 to GPIO39 are conf as GPIO
61 * GpioSel6 = 0x00 => Pins GPIO41 & GPIo42 are not configured as GPIO
62 * AlternaFunction = 0x00 => If Pins GPIO10 to 13 are not configured
63 * as GPIO then this register selectes the alternate fucntions
64 */
65 .config_reg = {0x00, 0x1E, 0x80, 0x01,
66 0x7A, 0x00, 0x00},
67};
68
45static struct ab8500_platform_data ab8500_platdata = { 69static struct ab8500_platform_data ab8500_platdata = {
46 .irq_base = MOP500_AB8500_IRQ_BASE, 70 .irq_base = MOP500_AB8500_IRQ_BASE,
71 .regulator_reg_init = ab8500_regulator_reg_init,
72 .num_regulator_reg_init = ARRAY_SIZE(ab8500_regulator_reg_init),
47 .regulator = ab8500_regulators, 73 .regulator = ab8500_regulators,
48 .num_regulator = ARRAY_SIZE(ab8500_regulators), 74 .num_regulator = ARRAY_SIZE(ab8500_regulators),
75 .gpio = &ab8500_gpio_pdata,
49}; 76};
50 77
51static struct resource ab8500_resources[] = { 78static struct resource ab8500_resources[] = {
@@ -67,6 +94,15 @@ struct platform_device ab8500_device = {
67}; 94};
68 95
69/* 96/*
97 * TPS61052
98 */
99
100static struct tps6105x_platform_data mop500_tps61052_data = {
101 .mode = TPS6105X_MODE_VOLTAGE,
102 .regulator_data = &tps61052_regulator,
103};
104
105/*
70 * TC35892 106 * TC35892
71 */ 107 */
72 108
@@ -136,7 +172,7 @@ static struct lp5521_platform_data __initdata lp5521_sec_data = {
136 .clock_mode = LP5521_CLOCK_EXT, 172 .clock_mode = LP5521_CLOCK_EXT,
137}; 173};
138 174
139static struct i2c_board_info mop500_i2c0_devices[] = { 175static struct i2c_board_info __initdata mop500_i2c0_devices[] = {
140 { 176 {
141 I2C_BOARD_INFO("tc3589x", 0x42), 177 I2C_BOARD_INFO("tc3589x", 0x42),
142 .irq = NOMADIK_GPIO_TO_IRQ(217), 178 .irq = NOMADIK_GPIO_TO_IRQ(217),
@@ -144,6 +180,14 @@ static struct i2c_board_info mop500_i2c0_devices[] = {
144 }, 180 },
145}; 181};
146 182
183/* I2C0 devices only available prior to HREFv60 */
184static struct i2c_board_info __initdata mop500_i2c0_old_devices[] = {
185 {
186 I2C_BOARD_INFO("tps61052", 0x33),
187 .platform_data = &mop500_tps61052_data,
188 },
189};
190
147static struct i2c_board_info __initdata mop500_i2c2_devices[] = { 191static struct i2c_board_info __initdata mop500_i2c2_devices[] = {
148 { 192 {
149 /* lp5521 LED driver, 1st device */ 193 /* lp5521 LED driver, 1st device */
@@ -406,6 +450,9 @@ static void __init mop500_init_machine(void)
406 450
407 i2c_register_board_info(0, mop500_i2c0_devices, 451 i2c_register_board_info(0, mop500_i2c0_devices,
408 ARRAY_SIZE(mop500_i2c0_devices)); 452 ARRAY_SIZE(mop500_i2c0_devices));
453 if (!machine_is_hrefv60())
454 i2c_register_board_info(0, mop500_i2c0_old_devices,
455 ARRAY_SIZE(mop500_i2c0_old_devices));
409 i2c_register_board_info(2, mop500_i2c2_devices, 456 i2c_register_board_info(2, mop500_i2c2_devices,
410 ARRAY_SIZE(mop500_i2c2_devices)); 457 ARRAY_SIZE(mop500_i2c2_devices));
411} 458}