summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpio/gpio-tps65910.c4
-rw-r--r--drivers/mfd/tps65910.c31
-rw-r--r--drivers/regulator/core.c13
-rw-r--r--drivers/regulator/omap-pmic-regulator.c32
4 files changed, 66 insertions, 14 deletions
diff --git a/drivers/gpio/gpio-tps65910.c b/drivers/gpio/gpio-tps65910.c
index d64de51db97..06146219d9d 100644
--- a/drivers/gpio/gpio-tps65910.c
+++ b/drivers/gpio/gpio-tps65910.c
@@ -82,7 +82,7 @@ static int tps65910_gpio_input(struct gpio_chip *gc, unsigned offset)
GPIO_CFG_MASK);
}
-#if 0 /* #ifdef CONFIG_OF - olio: We DO have a DT, but no tps info there. */
+#ifdef CONFIG_OF
static struct tps65910_board *tps65910_parse_dt_for_gpio(struct device *dev,
struct tps65910 *tps65910, int chip_ngpio)
{
@@ -149,7 +149,7 @@ static int tps65910_gpio_probe(struct platform_device *pdev)
tps65910_gpio->gpio_chip.set = tps65910_gpio_set;
tps65910_gpio->gpio_chip.get = tps65910_gpio_get;
tps65910_gpio->gpio_chip.dev = &pdev->dev;
-#if 0 /* #ifdef CONFIG_OF_GPIO */
+#ifdef CONFIG_OF_GPIO
tps65910_gpio->gpio_chip.of_node = tps65910->dev->of_node;
#endif
if (pdata && pdata->gpio_base)
diff --git a/drivers/mfd/tps65910.c b/drivers/mfd/tps65910.c
index f4b99d84396..28219d12a9f 100644
--- a/drivers/mfd/tps65910.c
+++ b/drivers/mfd/tps65910.c
@@ -312,6 +312,23 @@ static int tps65910_ck32k_init(struct tps65910 *tps65910,
return 0;
}
+static void tps65910_clear_interrupts(struct tps65910 *tps65910)
+{
+ u32 val;
+ int ret;
+
+ ret = tps65910_reg_read(tps65910, TPS65910_INT_STS, &val);
+
+ /* interrupts are cleared by writing '1' to the bit */
+ if (val)
+ ret = tps65910_reg_write(tps65910, TPS65910_INT_STS, val);
+
+ ret = tps65910_reg_read(tps65910, TPS65910_INT_STS2, &val);
+
+ if (val)
+ ret = tps65910_reg_write(tps65910, TPS65910_INT_STS2, val);
+}
+
static int tps65910_sleepinit(struct tps65910 *tps65910,
struct tps65910_board *pmic_pdata)
{
@@ -320,8 +337,13 @@ static int tps65910_sleepinit(struct tps65910 *tps65910,
dev = tps65910->dev;
- if (!pmic_pdata->en_dev_slp)
- return 0;
+ /* set polarity of SLLEEPSIG requst ot enter OFF mode */
+ ret = tps65910_reg_set_bits(tps65910, TPS65910_DEVCTRL2,
+ DEVCTRL2_SLEEPSIG_POL_MASK);
+ if (ret < 0) {
+ dev_err(dev, "set sleepsig_pol failed: %d\n", ret);
+ goto err_sleep_init;
+ }
/* enabling SLEEP device state */
ret = tps65910_reg_set_bits(tps65910, TPS65910_DEVCTRL,
@@ -497,6 +519,11 @@ static int tps65910_i2c_probe(struct i2c_client *i2c,
init_data->irq = pmic_plat_data->irq;
init_data->irq_base = pmic_plat_data->irq_base;
+ /*
+ * clear pending interrupts - power on event generate several
+ * interrupts.
+ */
+ tps65910_clear_interrupts(tps65910);
tps65910_irq_init(tps65910, init_data->irq, init_data);
tps65910_ck32k_init(tps65910, pmic_plat_data);
tps65910_sleepinit(tps65910, pmic_plat_data);
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index 7c75ab88f9b..815d6df8bd5 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -3673,9 +3673,8 @@ regulator_register(const struct regulator_desc *regulator_desc,
add_dev:
/* add consumers devices */
-
if (init_data) {
- for (i = 0; i < init_data->num_consumer_supplies; i++) {
+ for (i = 0; i < init_data->num_consumer_supplies; i++) {
ret = set_consumer_device_supply(rdev,
init_data->consumer_supplies[i].dev_name,
init_data->consumer_supplies[i].supply);
@@ -3685,14 +3684,13 @@ add_dev:
goto unset_supplies;
}
}
- }
+ }
list_add(&rdev->list, &regulator_list);
rdev_init_debugfs(rdev);
out:
mutex_unlock(&regulator_list_mutex);
-
return rdev;
unset_supplies:
@@ -3712,8 +3710,7 @@ wash:
clean:
kfree(rdev);
rdev = ERR_PTR(ret);
-
- goto out;
+ goto out;
}
EXPORT_SYMBOL_GPL(regulator_register);
@@ -3983,12 +3980,8 @@ static int __init regulator_init_complete(void)
* with DT to provide them just assume that a DT enabled
* system has full constraints.
*/
-
-#if 0
- // TODO OLIO: This assumption isn't true for us. Not yet, at least.
if (of_have_populated_dt())
has_full_constraints = true;
-#endif
mutex_lock(&regulator_list_mutex);
diff --git a/drivers/regulator/omap-pmic-regulator.c b/drivers/regulator/omap-pmic-regulator.c
index 2eab7c158e2..ca71c9fd85b 100644
--- a/drivers/regulator/omap-pmic-regulator.c
+++ b/drivers/regulator/omap-pmic-regulator.c
@@ -518,6 +518,36 @@ static const struct omap_pmic_info omap_tps65912_dcdc4 = {
.voltage_selector_zero = true,
};
+static const struct omap_pmic_info omap_tps65910_vdd1 = {
+ .slave_addr = 0x12,
+ .voltage_reg_addr = 0x22,
+ .cmd_reg_addr = 0x23,
+ .i2c_timeout_us = 200,
+ .slew_rate_uV = 7500,
+ .step_size_uV = 12500,
+ .min_uV = 562500,
+ .max_uV = 1350000,
+ .voltage_selector_offset = 0,
+ .voltage_selector_mask = 0x7F,
+ .voltage_selector_setbits = 0x0,
+ .voltage_selector_zero = true,
+};
+
+static const struct omap_pmic_info omap_tps65910_vdd2 = {
+ .slave_addr = 0x12,
+ .voltage_reg_addr = 0x24,
+ .cmd_reg_addr = 0x25,
+ .i2c_timeout_us = 200,
+ .slew_rate_uV = 7500,
+ .step_size_uV = 12500,
+ .min_uV = 562500,
+ .max_uV = 1200000,
+ .voltage_selector_offset = 0,
+ .voltage_selector_mask = 0x7F,
+ .voltage_selector_setbits = 0x0,
+ .voltage_selector_zero = true,
+};
+
static const struct of_device_id omap_pmic_of_match_tbl[] = {
{.compatible = "ti,omap-twl4030-vdd1", .data = &omap_twl4030_vdd1,},
{.compatible = "ti,omap-twl4030-vdd2", .data = &omap_twl4030_vdd2,},
@@ -533,6 +563,8 @@ static const struct of_device_id omap_pmic_of_match_tbl[] = {
{.compatible = "ti,omap-twl6035-smps8", .data = &omap_twl6035_smps8,},
{.compatible = "ti,omap-tps65912-dcdc1", .data = &omap_tps65912_dcdc1,},
{.compatible = "ti,omap-tps65912-dcdc4", .data = &omap_tps65912_dcdc4,},
+ {.compatible = "ti,omap-tps65910-vdd1", .data = &omap_tps65910_vdd1,},
+ {.compatible = "ti,omap-tps65910-vdd2", .data = &omap_tps65910_vdd2,},
{},
};
MODULE_DEVICE_TABLE(of, omap_pmic_of_match_tbl);