summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorPhilippe Langlais <philippe.langlais@linaro.org>2011-05-10 09:48:17 +0200
committerHenrik Aberg <henrik.aberg@stericsson.com>2011-05-18 09:40:04 +0200
commit102e25694b84a8e5d40850a46ccbac2fc68b3ce7 (patch)
treeda79db0a74e27158a21aebd9ad8d4d47ace24964 /arch
parent702df89333aee3925617d9c0ecee6de154fe8314 (diff)
u5500: add regulators
ST-Ericsson Linux next: - ST-Ericsson ID: WP257121 ST-Ericsson FOSS-OUT ID: Trivial Change-Id: I77938bf592016094130cec9f2ab484da2cd55d10 Signed-off-by: Rabin Vincent <rabin.vincent@stericsson.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/20655 Reviewed-by: Vijaya Kumar K-1 <vijay.kilari@stericsson.com> Reviewed-by: Bengt JONSSON <bengt.g.jonsson@stericsson.com> Conflicts: arch/arm/mach-ux500/Makefile arch/arm/mach-ux500/board-u5500.c
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-ux500/Makefile2
-rw-r--r--arch/arm/mach-ux500/board-u5500-regulators.c134
-rw-r--r--arch/arm/mach-ux500/board-u5500.c100
-rw-r--r--arch/arm/mach-ux500/board-u5500.h3
4 files changed, 189 insertions, 50 deletions
diff --git a/arch/arm/mach-ux500/Makefile b/arch/arm/mach-ux500/Makefile
index 066f131d258..4f233b3df33 100644
--- a/arch/arm/mach-ux500/Makefile
+++ b/arch/arm/mach-ux500/Makefile
@@ -19,7 +19,7 @@ obj-$(CONFIG_MACH_U8500) += board-mop500.o board-mop500-sdi.o \
board-mop500-mcde.o \
board-mop500-msp.o board-mop500-bm.o
obj-$(CONFIG_MACH_U5500) += board-u5500.o board-u5500-sdi.o \
- board-u5500-mcde.o
+ board-u5500-mcde.o board-u5500-regulators.o
obj-$(CONFIG_SMP) += platsmp.o headsmp.o
obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o
obj-$(CONFIG_LOCAL_TIMERS) += localtimer.o
diff --git a/arch/arm/mach-ux500/board-u5500-regulators.c b/arch/arm/mach-ux500/board-u5500-regulators.c
new file mode 100644
index 00000000000..38edc3c01cb
--- /dev/null
+++ b/arch/arm/mach-ux500/board-u5500-regulators.c
@@ -0,0 +1,134 @@
+/*
+ * Copyright (C) ST-Ericsson SA 2011
+ *
+ * License terms: GNU General Public License (GPL) version 2
+ */
+
+#include <linux/kernel.h>
+#include <linux/regulator/machine.h>
+#include <linux/regulator/ab5500.h>
+
+#include "board-u5500.h"
+
+static struct regulator_consumer_supply ab5500_ldo_d_consumers[] = {
+};
+
+static struct regulator_consumer_supply ab5500_ldo_g_consumers[] = {
+ REGULATOR_SUPPLY("v-MMC-SD", "sdi1"),
+};
+
+static struct regulator_consumer_supply ab5500_ldo_h_consumers[] = {
+ REGULATOR_SUPPLY("v-display", NULL),
+ REGULATOR_SUPPLY("vdd", "1-004b"), /* Synaptics */
+ REGULATOR_SUPPLY("vin", "2-0036"), /* LM3530 */
+};
+
+static struct regulator_consumer_supply ab5500_ldo_k_consumers[] = {
+ REGULATOR_SUPPLY("v-accel", "lsm303dlh.0"),
+ REGULATOR_SUPPLY("v-mag", "lsm303dlh.1"),
+ REGULATOR_SUPPLY("v-mmio-camera", "mmio_camera"),
+};
+
+static struct regulator_consumer_supply ab5500_ldo_l_consumers[] = {
+};
+
+static struct regulator_consumer_supply ab5500_ldo_s_consumers[] = {
+ REGULATOR_SUPPLY("v-ana", "mcde"),
+ REGULATOR_SUPPLY("v-ana", "mmio_camera"),
+};
+
+static struct regulator_consumer_supply ab5500_ldo_vdigmic_consumers[] = {
+};
+
+static struct regulator_consumer_supply ab5500_ldo_sim_consumers[] = {
+};
+
+static struct regulator_init_data
+ab5500_regulator_init_data[AB5500_NUM_REGULATORS] = {
+ /* AB internal analog */
+ [AB5500_LDO_D] = {
+ .constraints = {
+ .valid_ops_mask = REGULATOR_CHANGE_STATUS,
+ },
+ .consumer_supplies = ab5500_ldo_d_consumers,
+ .num_consumer_supplies = ARRAY_SIZE(ab5500_ldo_d_consumers),
+ },
+ /* SD Card */
+ [AB5500_LDO_G] = {
+ .constraints = {
+ .min_uV = 1200000,
+ .max_uV = 2910000,
+ .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |
+ REGULATOR_CHANGE_STATUS,
+ },
+ .consumer_supplies = ab5500_ldo_g_consumers,
+ .num_consumer_supplies = ARRAY_SIZE(ab5500_ldo_g_consumers),
+ },
+ /* Display */
+ [AB5500_LDO_H] = {
+ .constraints = {
+ .min_uV = 2790000,
+ .max_uV = 2790000,
+ .apply_uV = 1,
+ .boot_on = 1, /* display on during boot */
+ .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |
+ REGULATOR_CHANGE_STATUS,
+ },
+ .consumer_supplies = ab5500_ldo_h_consumers,
+ .num_consumer_supplies = ARRAY_SIZE(ab5500_ldo_h_consumers),
+ },
+ /* Camera */
+ [AB5500_LDO_K] = {
+ .constraints = {
+ .min_uV = 2790000,
+ .max_uV = 2790000,
+ .apply_uV = 1,
+ .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |
+ REGULATOR_CHANGE_STATUS,
+ },
+ .consumer_supplies = ab5500_ldo_k_consumers,
+ .num_consumer_supplies = ARRAY_SIZE(ab5500_ldo_k_consumers),
+ },
+ /* External eMMC */
+ [AB5500_LDO_L] = {
+ .constraints = {
+ .min_uV = 1200000,
+ .max_uV = 2910000,
+ .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |
+ REGULATOR_CHANGE_STATUS,
+ },
+ .consumer_supplies = ab5500_ldo_l_consumers,
+ .num_consumer_supplies = ARRAY_SIZE(ab5500_ldo_l_consumers),
+ },
+ [AB5500_LDO_S] = {
+ .constraints = {
+ .name = "VANA",
+ .valid_ops_mask = REGULATOR_CHANGE_STATUS,
+ },
+ .consumer_supplies = ab5500_ldo_s_consumers,
+ .num_consumer_supplies = ARRAY_SIZE(ab5500_ldo_s_consumers),
+ },
+ [AB5500_LDO_VDIGMIC] = {
+ .constraints = {
+ .valid_ops_mask = REGULATOR_CHANGE_STATUS,
+ },
+ .consumer_supplies = ab5500_ldo_vdigmic_consumers,
+ .num_consumer_supplies =
+ ARRAY_SIZE(ab5500_ldo_vdigmic_consumers),
+ },
+ [AB5500_LDO_SIM] = {
+ .constraints = {
+ .min_uV = 1875000,
+ .max_uV = 2900000,
+ .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |
+ REGULATOR_CHANGE_STATUS,
+ },
+ .consumer_supplies = ab5500_ldo_sim_consumers,
+ .num_consumer_supplies = ARRAY_SIZE(ab5500_ldo_sim_consumers),
+ },
+};
+
+struct ab5500_regulator_platform_data u5500_ab5500_regulator_data = {
+ .regulator = ab5500_regulator_init_data,
+ .num_regulator = ARRAY_SIZE(ab5500_regulator_init_data),
+};
diff --git a/arch/arm/mach-ux500/board-u5500.c b/arch/arm/mach-ux500/board-u5500.c
index 41610c5002e..18f33e1f16e 100644
--- a/arch/arm/mach-ux500/board-u5500.c
+++ b/arch/arm/mach-ux500/board-u5500.c
@@ -33,6 +33,7 @@
#include "pins-db5500.h"
#include "devices-db5500.h"
+#include "board-u5500.h"
/*
* GPIO
@@ -128,7 +129,7 @@ static struct synaptics_rmi4_platform_data rmi4_i2c_platformdata = {
.x_flip = false,
.y_flip = true,
#endif
- .regulator_en = false,
+ .regulator_en = true,
};
/*
@@ -196,49 +197,6 @@ static struct i2c_board_info __initdata u5500_i2c2_devices[] = {
},
};
-static struct resource ab5500_resources[] = {
- [0] = {
- /*TODO Change this when prcmu driver arrives */
- .start = IRQ_DB5500_AB5500,
- .end = IRQ_DB5500_AB5500,
- .flags = IORESOURCE_IRQ
- }
-};
-
-static struct ab5500_platform_data ab5500_plf_data = {
- .irq = {
- .base = IRQ_AB5500_BASE,
- .count = AB5500_NR_IRQS,
- },
-};
-
-static struct platform_device u5500_ab5500_device = {
- .name = "ab5500-core",
- .id = 0,
- .dev = {
- .platform_data = &ab5500_plf_data,
- },
- .num_resources = 1,
- .resource = ab5500_resources,
-};
-
-static struct platform_device *u5500_platform_devices[] __initdata = {
- &u5500_ab5500_device,
- &u5500_mcde_device,
- &ux500_hwmem_device,
- &u5500_b2r2_device,
-};
-
-static void __init u5500_i2c_init(void)
-{
- db5500_add_i2c1(&u5500_i2c1_data);
- db5500_add_i2c2(&u5500_i2c2_data);
- db5500_add_i2c3(&u5500_i2c3_data);
-
- i2c_register_board_info(1, ARRAY_AND_SIZE(u5500_i2c1_devices));
- i2c_register_board_info(2, ARRAY_AND_SIZE(u5500_i2c2_devices));
-}
-
/*
* Keypad
*/
@@ -329,6 +287,15 @@ static struct i2s_board_info stm_i2s_board_info[] __initdata = {
},
};
+static void __init u5500_msp_init(void)
+{
+ db5500_add_msp0_i2s(&u5500_msp0_data);
+ db5500_add_msp1_i2s(&u5500_msp1_data);
+ db5500_add_msp2_i2s(&u5500_msp2_data);
+
+ i2s_register_board_info(ARRAY_AND_SIZE(stm_i2s_board_info));
+}
+
/*
* SPI
*/
@@ -343,13 +310,48 @@ static void __init u5500_spi_init(void)
db5500_add_spi1(&u5500_spi1_data);
}
-static void __init u5500_msp_init(void)
+static struct resource ab5500_resources[] = {
+ [0] = {
+ /*TODO Change this when prcmu driver arrives */
+ .start = IRQ_DB5500_AB5500,
+ .end = IRQ_DB5500_AB5500,
+ .flags = IORESOURCE_IRQ
+ }
+};
+
+static struct ab5500_platform_data ab5500_plf_data = {
+ .irq = {
+ .base = IRQ_AB5500_BASE,
+ .count = AB5500_NR_IRQS,
+ },
+ .regulator = &u5500_ab5500_regulator_data,
+};
+
+static struct platform_device u5500_ab5500_device = {
+ .name = "ab5500-core",
+ .id = 0,
+ .dev = {
+ .platform_data = &ab5500_plf_data,
+ },
+ .num_resources = 1,
+ .resource = ab5500_resources,
+};
+
+static struct platform_device *u5500_platform_devices[] __initdata = {
+ &u5500_ab5500_device,
+ &u5500_mcde_device,
+ &ux500_hwmem_device,
+ &u5500_b2r2_device,
+};
+
+static void __init u5500_i2c_init(void)
{
- db5500_add_msp0_i2s(&u5500_msp0_data);
- db5500_add_msp1_i2s(&u5500_msp1_data);
- db5500_add_msp2_i2s(&u5500_msp2_data);
+ db5500_add_i2c1(&u5500_i2c1_data);
+ db5500_add_i2c2(&u5500_i2c2_data);
+ db5500_add_i2c3(&u5500_i2c3_data);
- i2s_register_board_info(ARRAY_AND_SIZE(stm_i2s_board_info));
+ i2c_register_board_info(1, ARRAY_AND_SIZE(u5500_i2c1_devices));
+ i2c_register_board_info(2, ARRAY_AND_SIZE(u5500_i2c2_devices));
}
static void __init u5500_uart_init(void)
diff --git a/arch/arm/mach-ux500/board-u5500.h b/arch/arm/mach-ux500/board-u5500.h
index 7bb0ea918bc..042b0ceb243 100644
--- a/arch/arm/mach-ux500/board-u5500.h
+++ b/arch/arm/mach-ux500/board-u5500.h
@@ -11,4 +11,7 @@
#define GPIO_MMC_CARD_CTRL 227
#define GPIO_MMC_CARD_VSEL 185
+struct ab5500_regulator_platform_data;
+extern struct ab5500_regulator_platform_data u5500_ab5500_regulator_data;
+
#endif