Skip to content
Browse files

palmas: example board file

This is an example board file to connect palmas to an omap chip

Signed-of-by: Graeme Gregory <gg@slimlogic.co.uk>
  • Loading branch information...
1 parent da9741f commit ff6303355dfa8cc05ac8f94b2e246713678bf63e @slimlogic committed Mar 2, 2012
Showing with 872 additions and 0 deletions.
  1. +421 −0 arch/arm/mach-omap2/board-omap5-palmas.c
  2. +451 −0 arch/arm/mach-omap2/board-palmas-example.c
View
421 arch/arm/mach-omap2/board-omap5-palmas.c
@@ -0,0 +1,421 @@
+#include <linux/i2c.h>
+#include <linux/i2c/twl.h>
+#include <linux/gpio.h>
+#include <linux/regulator/machine.h>
+#include <linux/regulator/fixed.h>
+#include <linux/mfd/palmas.h>
+
+#define OMAP5_IRQ_PALMAS 0xFF
+#define OMAP5_IRQ_END 0x1FF
+#define OMAP5_GPIO_END 0x2FF
+
+static struct palmas_gpadc_platform_data omap5_palmas_gpadc = {
+ .ch3_current = 0,
+ .ch0_current = 0,
+ .bat_removal = 0,
+ .start_polarity= 0,
+};
+
+/* Initialisation Data for Regulators */
+
+static struct palmas_reg_init omap5_smps123_init = {
+ .warm_reset = 0,
+ .roof_floor = 0,
+ .mode_sleep = 0,
+ .tstep = 0,
+};
+
+static struct palmas_reg_init omap5_smps45_init = {
+ .warm_reset = 0,
+ .roof_floor = 0,
+ .mode_sleep = 0,
+ .tstep = 0,
+};
+
+static struct palmas_reg_init omap5_smps6_init = {
+ .warm_reset = 0,
+ .roof_floor = 0,
+ .mode_sleep = 1,
+ .tstep = 0,
+};
+
+static struct palmas_reg_init omap5_smps7_init = {
+ .warm_reset = 0,
+ .roof_floor = 0,
+ .mode_sleep = 1,
+};
+
+static struct palmas_reg_init omap5_smps8_init = {
+ .warm_reset = 0,
+ .roof_floor = 0,
+ .mode_sleep = 0,
+ .tstep = 0,
+};
+
+static struct palmas_reg_init omap5_smps9_init = {
+ .warm_reset = 0,
+ .roof_floor = 0,
+ .mode_sleep = 0,
+};
+
+static struct palmas_reg_init omap5_smps10_init = {
+ .mode_sleep = 0,
+};
+
+static struct palmas_reg_init omap5_ldo1_init = {
+ .warm_reset = 0,
+ .mode_sleep = 0,
+};
+
+static struct palmas_reg_init omap5_ldo2_init = {
+ .warm_reset = 0,
+ .mode_sleep = 0,
+};
+
+static struct palmas_reg_init omap5_ldo3_init = {
+ .warm_reset = 0,
+ .mode_sleep = 0,
+};
+
+static struct palmas_reg_init omap5_ldo4_init = {
+ .warm_reset = 0,
+ .mode_sleep = 0,
+};
+
+static struct palmas_reg_init omap5_ldo5_init = {
+ .warm_reset = 0,
+ .mode_sleep = 0,
+};
+
+static struct palmas_reg_init omap5_ldo6_init = {
+ .warm_reset = 0,
+ .mode_sleep = 0,
+};
+
+static struct palmas_reg_init omap5_ldo7_init = {
+ .warm_reset = 0,
+ .mode_sleep = 0,
+};
+
+static struct palmas_reg_init omap5_ldo8_init = {
+ .warm_reset = 0,
+ .mode_sleep = 0,
+};
+
+static struct palmas_reg_init omap5_ldo9_init = {
+ .warm_reset = 0,
+ .mode_sleep = 0,
+};
+
+static struct palmas_reg_init omap5_ldoln_init = {
+ .warm_reset = 0,
+ .mode_sleep = 0,
+};
+
+static struct palmas_reg_init omap5_ldousb_init = {
+ .warm_reset = 0,
+ .mode_sleep = 0,
+};
+
+static struct palmas_reg_init *palmas_omap_reg_init[] = {
+ NULL, /* SMPS12 not used in this configuration */
+ &omap5_smps123_init,
+ NULL, /* SMPS3 not used in this configuration */
+ &omap5_smps45_init,
+ NULL, /* SMPS457 not used in this configuration */
+ &omap5_smps6_init,
+ &omap5_smps7_init,
+ &omap5_smps8_init,
+ &omap5_smps9_init,
+ &omap5_smps10_init,
+ &omap5_ldo1_init,
+ &omap5_ldo2_init,
+ &omap5_ldo3_init,
+ &omap5_ldo4_init,
+ &omap5_ldo5_init,
+ &omap5_ldo6_init,
+ &omap5_ldo7_init,
+ &omap5_ldo8_init,
+ &omap5_ldo9_init,
+ &omap5_ldoln_init,
+ &omap5_ldousb_init,
+
+};
+
+/* Constraints for Regulators */
+static struct regulator_init_data omap5_smps123 = {
+ .constraints = {
+ .min_uV = 600000,
+ .max_uV = 1310000,
+ .valid_modes_mask = REGULATOR_MODE_NORMAL
+ | REGULATOR_MODE_STANDBY,
+ .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
+ | REGULATOR_CHANGE_MODE
+ | REGULATOR_CHANGE_STATUS,
+ },
+};
+
+static struct regulator_init_data omap5_smps45 = {
+ .constraints = {
+ .min_uV = 600000,
+ .max_uV = 1310000,
+ .valid_modes_mask = REGULATOR_MODE_NORMAL
+ | REGULATOR_MODE_STANDBY,
+ .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
+ | REGULATOR_CHANGE_MODE
+ | REGULATOR_CHANGE_STATUS,
+ },
+};
+
+static struct regulator_init_data omap5_smps6 = {
+ .constraints = {
+ .min_uV = 1200000,
+ .max_uV = 1200000,
+ .valid_modes_mask = REGULATOR_MODE_NORMAL
+ | REGULATOR_MODE_STANDBY,
+ .valid_ops_mask = REGULATOR_CHANGE_MODE
+ | REGULATOR_CHANGE_STATUS,
+ },
+};
+
+static struct regulator_init_data omap5_smps7 = {
+ .constraints = {
+ .min_uV = 1800000,
+ .max_uV = 1800000,
+ .valid_modes_mask = REGULATOR_MODE_NORMAL
+ | REGULATOR_MODE_STANDBY,
+ .valid_ops_mask = REGULATOR_CHANGE_MODE
+ | REGULATOR_CHANGE_STATUS,
+ },
+};
+
+static struct regulator_init_data omap5_smps8 = {
+ .constraints = {
+ .min_uV = 600000,
+ .max_uV = 1310000,
+ .valid_modes_mask = REGULATOR_MODE_NORMAL
+ | REGULATOR_MODE_STANDBY,
+ .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
+ | REGULATOR_CHANGE_MODE
+ | REGULATOR_CHANGE_STATUS,
+ },
+};
+
+static struct regulator_consumer_supply omap5_adac_supply[] = {
+ REGULATOR_SUPPLY("vcc", "soc-audio"),
+};
+
+static struct regulator_init_data omap5_smps9 = {
+ .constraints = {
+ .min_uV = 2100000,
+ .max_uV = 2100000,
+ .valid_modes_mask = REGULATOR_MODE_NORMAL
+ | REGULATOR_MODE_STANDBY,
+ .valid_ops_mask = REGULATOR_CHANGE_MODE
+ | REGULATOR_CHANGE_STATUS,
+ },
+ .num_consumer_supplies = ARRAY_SIZE(omap5_adac_supply),
+ .consumer_supplies = omap5_adac_supply,
+
+};
+
+static struct regulator_init_data omap5_smps10 = {
+ .constraints = {
+ .min_uV = 5000000,
+ .max_uV = 5000000,
+ .valid_modes_mask = REGULATOR_MODE_NORMAL
+ | REGULATOR_MODE_STANDBY,
+ .valid_ops_mask = REGULATOR_CHANGE_MODE
+ | REGULATOR_CHANGE_STATUS,
+ },
+};
+
+static struct regulator_init_data omap5_ldo1 = {
+ .constraints = {
+ .min_uV = 2800000,
+ .max_uV = 2800000,
+ .valid_modes_mask = REGULATOR_MODE_NORMAL
+ | REGULATOR_MODE_STANDBY,
+ .valid_ops_mask = REGULATOR_CHANGE_MODE
+ | REGULATOR_CHANGE_STATUS,
+ },
+};
+
+static struct regulator_init_data omap5_ldo2 = {
+ .constraints = {
+ .min_uV = 2800000,
+ .max_uV = 2800000,
+ .valid_modes_mask = REGULATOR_MODE_NORMAL
+ | REGULATOR_MODE_STANDBY,
+ .valid_ops_mask = REGULATOR_CHANGE_MODE
+ | REGULATOR_CHANGE_STATUS,
+ },
+};
+
+static struct regulator_init_data omap5_ldo3 = {
+ .constraints = {
+ .min_uV = 3000000,
+ .max_uV = 3000000,
+ .valid_modes_mask = REGULATOR_MODE_NORMAL
+ | REGULATOR_MODE_STANDBY,
+ .valid_ops_mask = REGULATOR_CHANGE_MODE
+ | REGULATOR_CHANGE_STATUS,
+ },
+};
+
+static struct regulator_init_data omap5_ldo4 = {
+ .constraints = {
+ .min_uV = 2200000,
+ .max_uV = 2200000,
+ .valid_modes_mask = REGULATOR_MODE_NORMAL
+ | REGULATOR_MODE_STANDBY,
+ .valid_ops_mask = REGULATOR_CHANGE_MODE
+ | REGULATOR_CHANGE_STATUS,
+ },
+};
+
+static struct regulator_init_data omap5_ldo5 = {
+ .constraints = {
+ .min_uV = 1800000,
+ .max_uV = 1800000,
+ .valid_modes_mask = REGULATOR_MODE_NORMAL
+ | REGULATOR_MODE_STANDBY,
+ .valid_ops_mask = REGULATOR_CHANGE_MODE
+ | REGULATOR_CHANGE_STATUS,
+ },
+};
+
+static struct regulator_init_data omap5_ldo6 = {
+ .constraints = {
+ .min_uV = 1500000,
+ .max_uV = 1500000,
+ .valid_modes_mask = REGULATOR_MODE_NORMAL
+ | REGULATOR_MODE_STANDBY,
+ .valid_ops_mask = REGULATOR_CHANGE_MODE
+ | REGULATOR_CHANGE_STATUS,
+ },
+};
+
+static struct regulator_init_data omap5_ldo7 = {
+ .constraints = {
+ .min_uV = 1500000,
+ .max_uV = 1500000,
+ .valid_modes_mask = REGULATOR_MODE_NORMAL
+ | REGULATOR_MODE_STANDBY,
+ .valid_ops_mask = REGULATOR_CHANGE_MODE
+ | REGULATOR_CHANGE_STATUS,
+ },
+};
+
+static struct regulator_init_data omap5_ldo8 = {
+ .constraints = {
+ .min_uV = 1500000,
+ .max_uV = 1500000,
+ .valid_modes_mask = REGULATOR_MODE_NORMAL
+ | REGULATOR_MODE_STANDBY,
+ .valid_ops_mask = REGULATOR_CHANGE_MODE
+ | REGULATOR_CHANGE_STATUS,
+ },
+};
+
+static struct regulator_init_data omap5_ldo9 = {
+ .constraints = {
+ .min_uV = 1800000,
+ .max_uV = 1800000,
+ .valid_modes_mask = REGULATOR_MODE_NORMAL
+ | REGULATOR_MODE_STANDBY,
+ .valid_ops_mask = REGULATOR_CHANGE_MODE
+ | REGULATOR_CHANGE_STATUS,
+ },
+};
+
+static struct regulator_init_data omap5_ldoln = {
+ .constraints = {
+ .min_uV = 1800000,
+ .max_uV = 1800000,
+ .valid_modes_mask = REGULATOR_MODE_NORMAL
+ | REGULATOR_MODE_STANDBY,
+ .valid_ops_mask = REGULATOR_CHANGE_MODE
+ | REGULATOR_CHANGE_STATUS,
+ },
+};
+
+static struct regulator_init_data omap5_ldousb = {
+ .constraints = {
+ .min_uV = 3250000,
+ .max_uV = 3250000,
+ .valid_modes_mask = REGULATOR_MODE_NORMAL
+ | REGULATOR_MODE_STANDBY,
+ .valid_ops_mask = REGULATOR_CHANGE_MODE
+ | REGULATOR_CHANGE_STATUS,
+ },
+};
+
+static struct regulator_init_data *palmas_omap5_reg[] = {
+ NULL, /* SMPS12 not used in this configuration */
+ &omap5_smps123,
+ NULL, /* SMPS3 not used in this configuration */
+ &omap5_smps45,
+ NULL, /* SMPS457 not used in this configuration */
+ &omap5_smps6,
+ &omap5_smps7,
+ &omap5_smps8,
+ &omap5_smps9,
+ &omap5_smps10,
+
+ &omap5_ldo1,
+ &omap5_ldo2,
+ &omap5_ldo3,
+ &omap5_ldo4,
+ &omap5_ldo5,
+ &omap5_ldo6,
+ &omap5_ldo7,
+ &omap5_ldo8,
+ &omap5_ldo9,
+ &omap5_ldoln,
+ &omap5_ldousb,
+};
+
+static struct palmas_pmic_platform_data omap5_palmas_pmic = {
+ .reg_data = palmas_omap5_reg,
+ .reg_init= palmas_omap_reg_init,
+
+ .ldo6_vibrator = 0,
+};
+
+static struct palmas_resource_platform_data omap5_palmas_resource = {
+ .clk32kg_mode_sleep = 0,
+ .clk32kgaudio_mode_sleep = 0,
+ .regen1_mode_sleep = 0,
+ .regen2_mode_sleep = 0,
+ .sysen1_mode_sleep = 0,
+ .sysen2_mode_sleep = 0,
+
+ .nsleep_res = 0,
+ .nsleep_smps = 0,
+ .nsleep_ldo1 = 0,
+ .nsleep_ldo2 = 0,
+
+ .enable1_res = 0,
+ .enable1_smps = 0,
+ .enable1_ldo1 = 0,
+ .enable1_ldo2 = 0,
+
+ .enable2_res = 0,
+ .enable2_smps = 0,
+ .enable2_ldo1 = 0,
+ .enable2_ldo2 = 0,
+};
+
+
+static struct palmas_platform_data palmas_omap5 = {
+ .irq = OMAP5_IRQ_PALMAS,
+ .irq_base = OMAP5_IRQ_END,
+
+ .gpio_base = OMAP5_GPIO_END,
+
+ .gpadc_pdata = &omap5_palmas_gpadc,
+ .pmic_pdata = &omap5_palmas_pmic,
+ /*.usb_pdata = &omap5_palmas_usb,*/
+ .resource_pdata = &omap5_palmas_resource,
+};
View
451 arch/arm/mach-omap2/board-palmas-example.c
@@ -0,0 +1,451 @@
+#include <linux/i2c.h>
+#include <linux/i2c/twl.h>
+#include <linux/gpio.h>
+#include <linux/regulator/machine.h>
+#include <linux/regulator/fixed.h>
+#include <linux/mfd/palmas.h>
+#include <plat/i2c.h>
+#include "mux.h"
+
+#define OMAP5_GPIO_END 0
+
+static struct palmas_gpadc_platform_data omap5_palmas_gpadc = {
+ .ch3_current = 0,
+ .ch0_current = 0,
+ .bat_removal = 0,
+ .start_polarity= 0,
+};
+
+/* Initialisation Data for Regulators */
+
+static struct palmas_reg_init omap5_smps12_init = {
+ .warm_reset = 0,
+ .roof_floor = 0,
+ .mode_sleep = 0,
+ .tstep = 0,
+};
+
+static struct palmas_reg_init omap5_smps45_init = {
+ .warm_reset = 0,
+ .roof_floor = 0,
+ .mode_sleep = 0,
+ .tstep = 0,
+};
+
+static struct palmas_reg_init omap5_smps6_init = {
+ .warm_reset = 0,
+ .roof_floor = 0,
+ .mode_sleep = 1,
+ .tstep = 0,
+};
+
+static struct palmas_reg_init omap5_smps7_init = {
+ .warm_reset = 0,
+ .roof_floor = 0,
+ .mode_sleep = 1,
+};
+
+static struct palmas_reg_init omap5_smps8_init = {
+ .warm_reset = 0,
+ .roof_floor = 0,
+ .mode_sleep = 0,
+ .tstep = 0,
+};
+
+static struct palmas_reg_init omap5_smps9_init = {
+ .warm_reset = 0,
+ .roof_floor = 0,
+ .mode_sleep = 0,
+ .vsel = 0xbd,
+};
+
+static struct palmas_reg_init omap5_smps10_init = {
+ .mode_sleep = 0,
+};
+
+static struct palmas_reg_init omap5_ldo1_init = {
+ .warm_reset = 0,
+ .mode_sleep = 0,
+};
+
+static struct palmas_reg_init omap5_ldo2_init = {
+ .warm_reset = 0,
+ .mode_sleep = 0,
+};
+
+static struct palmas_reg_init omap5_ldo3_init = {
+ .warm_reset = 0,
+ .mode_sleep = 0,
+};
+
+static struct palmas_reg_init omap5_ldo4_init = {
+ .warm_reset = 0,
+ .mode_sleep = 0,
+};
+
+static struct palmas_reg_init omap5_ldo5_init = {
+ .warm_reset = 0,
+ .mode_sleep = 0,
+};
+
+static struct palmas_reg_init omap5_ldo6_init = {
+ .warm_reset = 0,
+ .mode_sleep = 0,
+};
+
+static struct palmas_reg_init omap5_ldo7_init = {
+ .warm_reset = 0,
+ .mode_sleep = 0,
+};
+
+static struct palmas_reg_init omap5_ldo8_init = {
+ .warm_reset = 0,
+ .mode_sleep = 0,
+};
+
+static struct palmas_reg_init omap5_ldo9_init = {
+ .warm_reset = 0,
+ .mode_sleep = 0,
+};
+
+static struct palmas_reg_init omap5_ldoln_init = {
+ .warm_reset = 0,
+ .mode_sleep = 0,
+};
+
+static struct palmas_reg_init omap5_ldousb_init = {
+ .warm_reset = 0,
+ .mode_sleep = 0,
+};
+
+static struct palmas_reg_init *palmas_omap_reg_init[] = {
+ &omap5_smps12_init,
+ NULL, /* SMPS123 not used in this configuration */
+ NULL, /* SMPS3 not used in this configuration */
+ &omap5_smps45_init,
+ NULL, /* SMPS457 not used in this configuration */
+ &omap5_smps6_init,
+ &omap5_smps7_init,
+ &omap5_smps8_init,
+ &omap5_smps9_init,
+ &omap5_smps10_init,
+ &omap5_ldo1_init,
+ &omap5_ldo2_init,
+ &omap5_ldo3_init,
+ &omap5_ldo4_init,
+ &omap5_ldo5_init,
+ &omap5_ldo6_init,
+ &omap5_ldo7_init,
+ &omap5_ldo8_init,
+ &omap5_ldo9_init,
+ &omap5_ldoln_init,
+ &omap5_ldousb_init,
+
+};
+
+/* Constraints for Regulators */
+static struct regulator_init_data omap5_smps12 = {
+ .constraints = {
+ .min_uV = 600000,
+ .max_uV = 1310000,
+ .valid_modes_mask = REGULATOR_MODE_NORMAL
+ | REGULATOR_MODE_STANDBY,
+ .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
+ | REGULATOR_CHANGE_MODE
+ | REGULATOR_CHANGE_STATUS,
+ },
+};
+
+static struct regulator_init_data omap5_smps45 = {
+ .constraints = {
+ .min_uV = 600000,
+ .max_uV = 1310000,
+ .valid_modes_mask = REGULATOR_MODE_NORMAL
+ | REGULATOR_MODE_STANDBY,
+ .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
+ | REGULATOR_CHANGE_MODE
+ | REGULATOR_CHANGE_STATUS,
+ },
+};
+
+static struct regulator_init_data omap5_smps6 = {
+ .constraints = {
+ .min_uV = 1200000,
+ .max_uV = 1200000,
+ .valid_modes_mask = REGULATOR_MODE_NORMAL
+ | REGULATOR_MODE_STANDBY,
+ .valid_ops_mask = REGULATOR_CHANGE_MODE
+ | REGULATOR_CHANGE_STATUS,
+ },
+};
+
+static struct regulator_init_data omap5_smps7 = {
+ .constraints = {
+ .min_uV = 1800000,
+ .max_uV = 1800000,
+ .valid_modes_mask = REGULATOR_MODE_NORMAL
+ | REGULATOR_MODE_STANDBY,
+ .valid_ops_mask = REGULATOR_CHANGE_MODE
+ | REGULATOR_CHANGE_STATUS,
+ },
+};
+
+static struct regulator_init_data omap5_smps8 = {
+ .constraints = {
+ .min_uV = 600000,
+ .max_uV = 1310000,
+ .valid_modes_mask = REGULATOR_MODE_NORMAL
+ | REGULATOR_MODE_STANDBY,
+ .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
+ | REGULATOR_CHANGE_MODE
+ | REGULATOR_CHANGE_STATUS,
+ },
+};
+
+static struct regulator_consumer_supply omap5_adac_supply[] = {
+ REGULATOR_SUPPLY("vcc", "soc-audio"),
+};
+
+static struct regulator_init_data omap5_smps9 = {
+ .constraints = {
+ .min_uV = 2100000,
+ .max_uV = 2100000,
+ .valid_modes_mask = REGULATOR_MODE_NORMAL
+ | REGULATOR_MODE_STANDBY,
+ .valid_ops_mask = REGULATOR_CHANGE_MODE
+ | REGULATOR_CHANGE_STATUS,
+ },
+ .num_consumer_supplies = ARRAY_SIZE(omap5_adac_supply),
+ .consumer_supplies = omap5_adac_supply,
+
+};
+
+static struct regulator_consumer_supply omap5_vbus_supply[] = {
+ REGULATOR_SUPPLY("vbus", "palmas-usb"),
+};
+
+static struct regulator_init_data omap5_smps10 = {
+ .constraints = {
+ .min_uV = 5000000,
+ .max_uV = 5000000,
+ .valid_modes_mask = REGULATOR_MODE_NORMAL
+ | REGULATOR_MODE_STANDBY,
+ .valid_ops_mask = REGULATOR_CHANGE_MODE
+ | REGULATOR_CHANGE_STATUS,
+ },
+ .num_consumer_supplies = ARRAY_SIZE(omap5_vbus_supply),
+ .consumer_supplies = omap5_vbus_supply,
+};
+
+static struct regulator_init_data omap5_ldo1 = {
+ .constraints = {
+ .min_uV = 2800000,
+ .max_uV = 2800000,
+ .valid_modes_mask = REGULATOR_MODE_NORMAL
+ | REGULATOR_MODE_STANDBY,
+ .valid_ops_mask = REGULATOR_CHANGE_MODE
+ | REGULATOR_CHANGE_STATUS,
+ },
+};
+
+static struct regulator_init_data omap5_ldo2 = {
+ .constraints = {
+ .min_uV = 2800000,
+ .max_uV = 2800000,
+ .valid_modes_mask = REGULATOR_MODE_NORMAL
+ | REGULATOR_MODE_STANDBY,
+ .valid_ops_mask = REGULATOR_CHANGE_MODE
+ | REGULATOR_CHANGE_STATUS,
+ },
+};
+
+static struct regulator_init_data omap5_ldo3 = {
+ .constraints = {
+ .min_uV = 3000000,
+ .max_uV = 3000000,
+ .valid_modes_mask = REGULATOR_MODE_NORMAL
+ | REGULATOR_MODE_STANDBY,
+ .valid_ops_mask = REGULATOR_CHANGE_MODE
+ | REGULATOR_CHANGE_STATUS,
+ },
+};
+
+static struct regulator_init_data omap5_ldo4 = {
+ .constraints = {
+ .min_uV = 2200000,
+ .max_uV = 2200000,
+ .valid_modes_mask = REGULATOR_MODE_NORMAL
+ | REGULATOR_MODE_STANDBY,
+ .valid_ops_mask = REGULATOR_CHANGE_MODE
+ | REGULATOR_CHANGE_STATUS,
+ },
+};
+
+static struct regulator_init_data omap5_ldo5 = {
+ .constraints = {
+ .min_uV = 1800000,
+ .max_uV = 1800000,
+ .valid_modes_mask = REGULATOR_MODE_NORMAL
+ | REGULATOR_MODE_STANDBY,
+ .valid_ops_mask = REGULATOR_CHANGE_MODE
+ | REGULATOR_CHANGE_STATUS,
+ },
+};
+
+static struct regulator_init_data omap5_ldo6 = {
+ .constraints = {
+ .min_uV = 1500000,
+ .max_uV = 1500000,
+ .valid_modes_mask = REGULATOR_MODE_NORMAL
+ | REGULATOR_MODE_STANDBY,
+ .valid_ops_mask = REGULATOR_CHANGE_MODE
+ | REGULATOR_CHANGE_STATUS,
+ },
+};
+
+static struct regulator_init_data omap5_ldo7 = {
+ .constraints = {
+ .min_uV = 1500000,
+ .max_uV = 1500000,
+ .valid_modes_mask = REGULATOR_MODE_NORMAL
+ | REGULATOR_MODE_STANDBY,
+ .valid_ops_mask = REGULATOR_CHANGE_MODE
+ | REGULATOR_CHANGE_STATUS,
+ },
+};
+
+static struct regulator_init_data omap5_ldo8 = {
+ .constraints = {
+ .min_uV = 1500000,
+ .max_uV = 1500000,
+ .valid_modes_mask = REGULATOR_MODE_NORMAL
+ | REGULATOR_MODE_STANDBY,
+ .valid_ops_mask = REGULATOR_CHANGE_MODE
+ | REGULATOR_CHANGE_STATUS,
+ },
+};
+
+static struct regulator_init_data omap5_ldo9 = {
+ .constraints = {
+ .min_uV = 1800000,
+ .max_uV = 1800000,
+ .valid_modes_mask = REGULATOR_MODE_NORMAL
+ | REGULATOR_MODE_STANDBY,
+ .valid_ops_mask = REGULATOR_CHANGE_MODE
+ | REGULATOR_CHANGE_STATUS,
+ },
+};
+
+static struct regulator_init_data omap5_ldoln = {
+ .constraints = {
+ .min_uV = 1800000,
+ .max_uV = 1800000,
+ .valid_modes_mask = REGULATOR_MODE_NORMAL
+ | REGULATOR_MODE_STANDBY,
+ .valid_ops_mask = REGULATOR_CHANGE_MODE
+ | REGULATOR_CHANGE_STATUS,
+ },
+};
+
+static struct regulator_init_data omap5_ldousb = {
+ .constraints = {
+ .min_uV = 3250000,
+ .max_uV = 3250000,
+ .valid_modes_mask = REGULATOR_MODE_NORMAL
+ | REGULATOR_MODE_STANDBY,
+ .valid_ops_mask = REGULATOR_CHANGE_MODE
+ | REGULATOR_CHANGE_STATUS,
+ },
+};
+
+static struct regulator_init_data *palmas_omap5_reg[] = {
+ &omap5_smps12,
+ NULL, /* SMPS123 not used in this configuration */
+ NULL, /* SMPS3 not used in this configuration */
+ &omap5_smps45,
+ NULL, /* SMPS457 not used in this configuration */
+ &omap5_smps6,
+ &omap5_smps7,
+ &omap5_smps8,
+ &omap5_smps9,
+ &omap5_smps10,
+
+ &omap5_ldo1,
+ &omap5_ldo2,
+ &omap5_ldo3,
+ &omap5_ldo4,
+ &omap5_ldo5,
+ &omap5_ldo6,
+ &omap5_ldo7,
+ &omap5_ldo8,
+ &omap5_ldo9,
+ &omap5_ldoln,
+ &omap5_ldousb,
+};
+
+static struct palmas_pmic_platform_data omap5_palmas_pmic = {
+ .reg_data = palmas_omap5_reg,
+ .reg_init= palmas_omap_reg_init,
+
+ .ldo6_vibrator = 0,
+};
+
+static struct palmas_resource_platform_data omap5_palmas_resource = {
+ .clk32kg_mode_sleep = 0,
+ .clk32kgaudio_mode_sleep = 0,
+ .regen1_mode_sleep = 0,
+ .regen2_mode_sleep = 0,
+ .sysen1_mode_sleep = 0,
+ .sysen2_mode_sleep = 0,
+
+ .nsleep_res = 0,
+ .nsleep_smps = 0,
+ .nsleep_ldo1 = 0,
+ .nsleep_ldo2 = 0,
+
+ .enable1_res = 0,
+ .enable1_smps = 0,
+ .enable1_ldo1 = 0,
+ .enable1_ldo2 = 0,
+
+ .enable2_res = 0,
+ .enable2_smps = 0,
+ .enable2_ldo1 = 0,
+ .enable2_ldo2 = 0,
+};
+
+
+static struct palmas_platform_data palmas_omap5 = {
+ .gpio_base = OMAP5_GPIO_END,
+
+ .gpadc_pdata = &omap5_palmas_gpadc,
+ .pmic_pdata = &omap5_palmas_pmic,
+ /*.usb_pdatda = &omap5_palmas_usb,*/
+ .resource_pdata = &omap5_palmas_resource,
+
+ .mux_from_pdata = 1,
+ .pad1 = 0xDD,
+ .pad2 = 0x1B,
+};
+
+static struct i2c_board_info __initdata palmas_i2c[] = {
+ {
+ I2C_BOARD_INFO("twl6035", 0x48),
+ .platform_data = &palmas_omap5,
+ }
+};
+
+int palmas_i2c_init(void)
+{
+ int gpio;
+
+ printk(KERN_WARNING "Probing the Palmas Device\n");
+
+ omap_mux_init_gpio(140, OMAP_PIN_INPUT);
+ gpio_request_one(140, GPIOF_IN, "palmas irq");
+ palmas_i2c[0].irq = gpio_to_irq(140);
+
+ i2c_register_board_info(4, palmas_i2c, ARRAY_SIZE(palmas_i2c));
+ return 0;
+}
+

0 comments on commit ff63033

Please sign in to comment.
Something went wrong with that request. Please try again.