mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-16 09:56:46 +00:00
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/lrg/voltage-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/lrg/voltage-2.6: regulator: fix kernel-doc for set_consumer_device_supply regulator: enable supply regulator only when use count is zero regulator: twl-regulator - fix twlreg_set_mode regulator: lock supply in regulator enable regulator: Return proper error for regulator_register() regulator: Ensure enough delay time for enabling regulator regulator: Remove a redundant device_remove_file call in create_regulator regulator: Staticise mc13783_powermisc_rmw() regulator: regulator disable supply fix
This commit is contained in:
commit
8fed709f34
@ -911,7 +911,7 @@ out:
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* set_consumer_device_supply: Bind a regulator to a symbolic supply
|
* set_consumer_device_supply - Bind a regulator to a symbolic supply
|
||||||
* @rdev: regulator source
|
* @rdev: regulator source
|
||||||
* @consumer_dev: device the supply applies to
|
* @consumer_dev: device the supply applies to
|
||||||
* @consumer_dev_name: dev_name() string for device supply applies to
|
* @consumer_dev_name: dev_name() string for device supply applies to
|
||||||
@ -1052,7 +1052,6 @@ static struct regulator *create_regulator(struct regulator_dev *rdev,
|
|||||||
printk(KERN_WARNING
|
printk(KERN_WARNING
|
||||||
"%s: could not add device link %s err %d\n",
|
"%s: could not add device link %s err %d\n",
|
||||||
__func__, dev->kobj.name, err);
|
__func__, dev->kobj.name, err);
|
||||||
device_remove_file(dev, ®ulator->dev_attr);
|
|
||||||
goto link_name_err;
|
goto link_name_err;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1268,13 +1267,17 @@ static int _regulator_enable(struct regulator_dev *rdev)
|
|||||||
{
|
{
|
||||||
int ret, delay;
|
int ret, delay;
|
||||||
|
|
||||||
/* do we need to enable the supply regulator first */
|
if (rdev->use_count == 0) {
|
||||||
if (rdev->supply) {
|
/* do we need to enable the supply regulator first */
|
||||||
ret = _regulator_enable(rdev->supply);
|
if (rdev->supply) {
|
||||||
if (ret < 0) {
|
mutex_lock(&rdev->supply->mutex);
|
||||||
printk(KERN_ERR "%s: failed to enable %s: %d\n",
|
ret = _regulator_enable(rdev->supply);
|
||||||
__func__, rdev_get_name(rdev), ret);
|
mutex_unlock(&rdev->supply->mutex);
|
||||||
return ret;
|
if (ret < 0) {
|
||||||
|
printk(KERN_ERR "%s: failed to enable %s: %d\n",
|
||||||
|
__func__, rdev_get_name(rdev), ret);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1313,10 +1316,12 @@ static int _regulator_enable(struct regulator_dev *rdev)
|
|||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
if (delay >= 1000)
|
if (delay >= 1000) {
|
||||||
mdelay(delay / 1000);
|
mdelay(delay / 1000);
|
||||||
else if (delay)
|
udelay(delay % 1000);
|
||||||
|
} else if (delay) {
|
||||||
udelay(delay);
|
udelay(delay);
|
||||||
|
}
|
||||||
|
|
||||||
} else if (ret < 0) {
|
} else if (ret < 0) {
|
||||||
printk(KERN_ERR "%s: is_enabled() failed for %s: %d\n",
|
printk(KERN_ERR "%s: is_enabled() failed for %s: %d\n",
|
||||||
@ -1359,6 +1364,7 @@ static int _regulator_disable(struct regulator_dev *rdev,
|
|||||||
struct regulator_dev **supply_rdev_ptr)
|
struct regulator_dev **supply_rdev_ptr)
|
||||||
{
|
{
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
*supply_rdev_ptr = NULL;
|
||||||
|
|
||||||
if (WARN(rdev->use_count <= 0,
|
if (WARN(rdev->use_count <= 0,
|
||||||
"unbalanced disables for %s\n",
|
"unbalanced disables for %s\n",
|
||||||
@ -2346,6 +2352,7 @@ struct regulator_dev *regulator_register(struct regulator_desc *regulator_desc,
|
|||||||
if (init_data->supply_regulator && init_data->supply_regulator_dev) {
|
if (init_data->supply_regulator && init_data->supply_regulator_dev) {
|
||||||
dev_err(dev,
|
dev_err(dev,
|
||||||
"Supply regulator specified by both name and dev\n");
|
"Supply regulator specified by both name and dev\n");
|
||||||
|
ret = -EINVAL;
|
||||||
goto scrub;
|
goto scrub;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2364,6 +2371,7 @@ struct regulator_dev *regulator_register(struct regulator_desc *regulator_desc,
|
|||||||
if (!found) {
|
if (!found) {
|
||||||
dev_err(dev, "Failed to find supply %s\n",
|
dev_err(dev, "Failed to find supply %s\n",
|
||||||
init_data->supply_regulator);
|
init_data->supply_regulator);
|
||||||
|
ret = -ENODEV;
|
||||||
goto scrub;
|
goto scrub;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -465,8 +465,8 @@ static struct regulator_ops mc13783_fixed_regulator_ops = {
|
|||||||
.get_voltage = mc13783_fixed_regulator_get_voltage,
|
.get_voltage = mc13783_fixed_regulator_get_voltage,
|
||||||
};
|
};
|
||||||
|
|
||||||
int mc13783_powermisc_rmw(struct mc13783_regulator_priv *priv, u32 mask,
|
static int mc13783_powermisc_rmw(struct mc13783_regulator_priv *priv, u32 mask,
|
||||||
u32 val)
|
u32 val)
|
||||||
{
|
{
|
||||||
struct mc13783 *mc13783 = priv->mc13783;
|
struct mc13783 *mc13783 = priv->mc13783;
|
||||||
int ret;
|
int ret;
|
||||||
|
@ -219,12 +219,12 @@ static int twlreg_set_mode(struct regulator_dev *rdev, unsigned mode)
|
|||||||
return -EACCES;
|
return -EACCES;
|
||||||
|
|
||||||
status = twl_i2c_write_u8(TWL_MODULE_PM_MASTER,
|
status = twl_i2c_write_u8(TWL_MODULE_PM_MASTER,
|
||||||
message >> 8, 0x15 /* PB_WORD_MSB */ );
|
message >> 8, TWL4030_PM_MASTER_PB_WORD_MSB);
|
||||||
if (status >= 0)
|
if (status < 0)
|
||||||
return status;
|
return status;
|
||||||
|
|
||||||
return twl_i2c_write_u8(TWL_MODULE_PM_MASTER,
|
return twl_i2c_write_u8(TWL_MODULE_PM_MASTER,
|
||||||
message, 0x16 /* PB_WORD_LSB */ );
|
message & 0xff, TWL4030_PM_MASTER_PB_WORD_LSB);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*----------------------------------------------------------------------*/
|
/*----------------------------------------------------------------------*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user