~ubuntu-branches/ubuntu/precise/linux-ti-omap4/precise

« back to all changes in this revision

Viewing changes to drivers/regulator/max8925-regulator.c

  • Committer: Bazaar Package Importer
  • Author(s): Paolo Pisati
  • Date: 2011-06-29 15:23:51 UTC
  • mfrom: (26.1.1 natty-proposed)
  • Revision ID: james.westby@ubuntu.com-20110629152351-xs96tm303d95rpbk
Tags: 3.0.0-1200.2
* Rebased against 3.0.0-6.7
* BSP from TI based on 3.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
#define SD1_DVM_SHIFT           5               /* SDCTL1 bit5 */
24
24
#define SD1_DVM_EN              6               /* SDV1 bit 6 */
25
25
 
 
26
/* bit definitions in SD & LDO control registers */
 
27
#define OUT_ENABLE              0x1f            /* Power U/D sequence as I2C */
 
28
#define OUT_DISABLE             0x1e            /* Power U/D sequence as I2C */
 
29
 
26
30
struct max8925_regulator_info {
27
31
        struct regulator_desc   desc;
28
32
        struct regulator_dev    *regulator;
93
97
        struct max8925_regulator_info *info = rdev_get_drvdata(rdev);
94
98
 
95
99
        return max8925_set_bits(info->i2c, info->enable_reg,
96
 
                                1 << info->enable_bit,
97
 
                                1 << info->enable_bit);
 
100
                                OUT_ENABLE << info->enable_bit,
 
101
                                OUT_ENABLE << info->enable_bit);
98
102
}
99
103
 
100
104
static int max8925_disable(struct regulator_dev *rdev)
102
106
        struct max8925_regulator_info *info = rdev_get_drvdata(rdev);
103
107
 
104
108
        return max8925_set_bits(info->i2c, info->enable_reg,
105
 
                                1 << info->enable_bit, 0);
 
109
                                OUT_ENABLE << info->enable_bit,
 
110
                                OUT_DISABLE << info->enable_bit);
106
111
}
107
112
 
108
113
static int max8925_is_enabled(struct regulator_dev *rdev)