Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 302265
b: refs/heads/master
c: 411a2df
h: refs/heads/master
i:
  302263: e784d42
v: v3
  • Loading branch information
NeilBrown authored and Mark Brown committed May 9, 2012
1 parent 2ea1c2b commit bb9e228
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c30540d78e60068d5638b79f1bcc92b259c3c7e2
refs/heads/master: 411a2df5090ccb88f4c3726e4951ebed579fec11
10 changes: 4 additions & 6 deletions trunk/drivers/regulator/twl-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -395,14 +395,12 @@ static int twl6030reg_set_mode(struct regulator_dev *rdev, unsigned mode)
* VAUX3 at 3V is incorrectly listed in some TI manuals as unsupported.
* TI are revising the twl5030/tps659x0 specs to support that 3.0V setting.
*/
#ifdef CONFIG_TWL4030_ALLOW_UNSUPPORTED
#define UNSUP_MASK 0x0000
#else
#define UNSUP_MASK 0x8000
#endif

#define UNSUP(x) (UNSUP_MASK | (x))
#define IS_UNSUP(x) (UNSUP_MASK & (x))
#define IS_UNSUP(info, x) \
((UNSUP_MASK & (x)) && \
!((info)->features & TWL4030_ALLOW_UNSUPPORTED))
#define LDO_MV(x) (~UNSUP_MASK & (x))


Expand Down Expand Up @@ -476,7 +474,7 @@ static int twl4030ldo_list_voltage(struct regulator_dev *rdev, unsigned index)
struct twlreg_info *info = rdev_get_drvdata(rdev);
int mV = info->table[index];

return IS_UNSUP(mV) ? 0 : (LDO_MV(mV) * 1000);
return IS_UNSUP(info, mV) ? 0 : (LDO_MV(mV) * 1000);
}

static int
Expand Down
5 changes: 5 additions & 0 deletions trunk/include/linux/i2c/twl.h
Original file line number Diff line number Diff line change
Expand Up @@ -762,6 +762,11 @@ struct twl_regulator_driver_data {
#define TWL5031 BIT(2) /* twl5031 has different registers */
#define TWL6030_CLASS BIT(3) /* TWL6030 class */
#define TWL6025_SUBCLASS BIT(4) /* TWL6025 has changed registers */
#define TWL4030_ALLOW_UNSUPPORTED BIT(5) /* Some voltages are possible
* but not officially supported.
* This flag is necessary to
* enable them.
*/

/*----------------------------------------------------------------------*/

Expand Down

0 comments on commit bb9e228

Please sign in to comment.