Skip to content

Commit

Permalink
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel…
Browse files Browse the repository at this point in the history
…/git/lrg/voltage-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/lrg/voltage-2.6: (45 commits)
  regulator: missing index in PTR_ERR() in isl6271a_probe()
  regulator: Assign return value of mc13xxx_reg_rmw to ret
  regulator: Add initial per-regulator debugfs support
  regulator: Make regulator_has_full_constraints a bool
  regulator: Clean up logging a bit
  regulator: Optimise out noop voltage changes
  regulator: Add API to re-apply voltage to hardware
  regulator: Staticise non-exported functions in mc13892
  regulator: Only notify voltage changes when they succeed
  regulator: Provide a selector based set_voltage_sel() operation
  regulator: Factor out voltage set operation into a separate function
  regulator: Convert WM8994 to use get_voltage_sel()
  regulator: Convert WM835x to use get_voltage_sel()
  regulator: Allow modular build of mc13xxx-core
  regulator: support PMIC mc13892
  make mc13783 regulator code generic
  Change the register name definitions for mc13783
  mach-ux500: Updated and connected ab8500 regulator board configuration
  regulators: Removed macros for initialization of ab8500 regulators
  regulators: Added verbose debug messages to ab8500 regulators
  ...
  • Loading branch information
torvalds committed Jan 13, 2011
2 parents e691d24 + fa63bd4 commit 1896a13
Show file tree
Hide file tree
Showing 45 changed files with 2,960 additions and 833 deletions.
4 changes: 2 additions & 2 deletions arch/arm/mach-imx/mach-pcm038.c
Original file line number Diff line number Diff line change
Expand Up @@ -254,10 +254,10 @@ static struct regulator_init_data cam_data = {

static struct mc13783_regulator_init_data pcm038_regulators[] = {
{
.id = MC13783_REGU_VCAM,
.id = MC13783_REG_VCAM,
.init_data = &cam_data,
}, {
.id = MC13783_REGU_VMMC1,
.id = MC13783_REG_VMMC1,
.init_data = &sdhc1_data,
},
};
Expand Down
4 changes: 2 additions & 2 deletions arch/arm/mach-mx3/mach-mx31_3ds.c
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,10 @@ static struct regulator_init_data gpo_init = {

static struct mc13783_regulator_init_data mx31_3ds_regulators[] = {
{
.id = MC13783_REGU_PWGT1SPI, /* Power Gate for ARM core. */
.id = MC13783_REG_PWGT1SPI, /* Power Gate for ARM core. */
.init_data = &pwgtx_init,
}, {
.id = MC13783_REGU_PWGT2SPI, /* Power Gate for L2 Cache. */
.id = MC13783_REG_PWGT2SPI, /* Power Gate for L2 Cache. */
.init_data = &pwgtx_init,
}, {

Expand Down
4 changes: 2 additions & 2 deletions arch/arm/mach-mx3/mach-mx31moboard.c
Original file line number Diff line number Diff line change
Expand Up @@ -216,11 +216,11 @@ static struct regulator_init_data cam_vreg_data = {

static struct mc13783_regulator_init_data moboard_regulators[] = {
{
.id = MC13783_REGU_VMMC1,
.id = MC13783_REG_VMMC1,
.init_data = &sdhc_vreg_data,
},
{
.id = MC13783_REGU_VCAM,
.id = MC13783_REG_VCAM,
.init_data = &cam_vreg_data,
},
};
Expand Down
153 changes: 74 additions & 79 deletions arch/arm/mach-ux500/board-mop500-regulators.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,99 +3,94 @@
*
* License Terms: GNU General Public License v2
*
* Author: Sundar Iyer <sundar.iyer@stericsson.com>
* Authors: Sundar Iyer <sundar.iyer@stericsson.com>
* Bengt Jonsson <bengt.g.jonsson@stericsson.com>
*
* MOP500 board specific initialization for regulators
*/
#include <linux/kernel.h>
#include <linux/regulator/machine.h>
#include <linux/regulator/ab8500.h>

/* supplies to the display/camera */
static struct regulator_init_data ab8500_vaux1_regulator = {
.constraints = {
.name = "V-DISPLAY",
.min_uV = 2500000,
.max_uV = 2900000,
.valid_ops_mask = REGULATOR_CHANGE_VOLTAGE|
REGULATOR_CHANGE_STATUS,
/* AB8500 regulators */
struct regulator_init_data ab8500_regulators[AB8500_NUM_REGULATORS] = {
/* supplies to the display/camera */
[AB8500_LDO_AUX1] = {
.constraints = {
.name = "V-DISPLAY",
.min_uV = 2500000,
.max_uV = 2900000,
.valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |
REGULATOR_CHANGE_STATUS,
},
},
};

/* supplies to the on-board eMMC */
static struct regulator_init_data ab8500_vaux2_regulator = {
.constraints = {
.name = "V-eMMC1",
.min_uV = 1100000,
.max_uV = 3300000,
.valid_ops_mask = REGULATOR_CHANGE_VOLTAGE|
REGULATOR_CHANGE_STATUS,
/* supplies to the on-board eMMC */
[AB8500_LDO_AUX2] = {
.constraints = {
.name = "V-eMMC1",
.min_uV = 1100000,
.max_uV = 3300000,
.valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |
REGULATOR_CHANGE_STATUS,
},
},
};

/* supply for VAUX3, supplies to SDcard slots */
static struct regulator_init_data ab8500_vaux3_regulator = {
.constraints = {
.name = "V-MMC-SD",
.min_uV = 1100000,
.max_uV = 3300000,
.valid_ops_mask = REGULATOR_CHANGE_VOLTAGE|
REGULATOR_CHANGE_STATUS,
/* supply for VAUX3, supplies to SDcard slots */
[AB8500_LDO_AUX3] = {
.constraints = {
.name = "V-MMC-SD",
.min_uV = 1100000,
.max_uV = 3300000,
.valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |
REGULATOR_CHANGE_STATUS,
},
},
};

/* supply for tvout, gpadc, TVOUT LDO */
static struct regulator_init_data ab8500_vtvout_init = {
.constraints = {
.name = "V-TVOUT",
.valid_ops_mask = REGULATOR_CHANGE_STATUS,
/* supply for tvout, gpadc, TVOUT LDO */
[AB8500_LDO_TVOUT] = {
.constraints = {
.name = "V-TVOUT",
.valid_ops_mask = REGULATOR_CHANGE_STATUS,
},
},
};

/* supply for ab8500-vaudio, VAUDIO LDO */
static struct regulator_init_data ab8500_vaudio_init = {
.constraints = {
.name = "V-AUD",
.valid_ops_mask = REGULATOR_CHANGE_STATUS,
/* supply for ab8500-vaudio, VAUDIO LDO */
[AB8500_LDO_AUDIO] = {
.constraints = {
.name = "V-AUD",
.valid_ops_mask = REGULATOR_CHANGE_STATUS,
},
},
};

/* supply for v-anamic1 VAMic1-LDO */
static struct regulator_init_data ab8500_vamic1_init = {
.constraints = {
.name = "V-AMIC1",
.valid_ops_mask = REGULATOR_CHANGE_STATUS,
/* supply for v-anamic1 VAMic1-LDO */
[AB8500_LDO_ANAMIC1] = {
.constraints = {
.name = "V-AMIC1",
.valid_ops_mask = REGULATOR_CHANGE_STATUS,
},
},
};

/* supply for v-amic2, VAMIC2 LDO, reuse constants for AMIC1 */
static struct regulator_init_data ab8500_vamic2_init = {
.constraints = {
.name = "V-AMIC2",
.valid_ops_mask = REGULATOR_CHANGE_STATUS,
/* supply for v-amic2, VAMIC2 LDO, reuse constants for AMIC1 */
[AB8500_LDO_ANAMIC2] = {
.constraints = {
.name = "V-AMIC2",
.valid_ops_mask = REGULATOR_CHANGE_STATUS,
},
},
};

/* supply for v-dmic, VDMIC LDO */
static struct regulator_init_data ab8500_vdmic_init = {
.constraints = {
.name = "V-DMIC",
.valid_ops_mask = REGULATOR_CHANGE_STATUS,
/* supply for v-dmic, VDMIC LDO */
[AB8500_LDO_DMIC] = {
.constraints = {
.name = "V-DMIC",
.valid_ops_mask = REGULATOR_CHANGE_STATUS,
},
},
};

/* supply for v-intcore12, VINTCORE12 LDO */
static struct regulator_init_data ab8500_vintcore_init = {
.constraints = {
.name = "V-INTCORE",
.valid_ops_mask = REGULATOR_CHANGE_STATUS,
/* supply for v-intcore12, VINTCORE12 LDO */
[AB8500_LDO_INTCORE] = {
.constraints = {
.name = "V-INTCORE",
.valid_ops_mask = REGULATOR_CHANGE_STATUS,
},
},
};

/* supply for U8500 CSI/DSI, VANA LDO */
static struct regulator_init_data ab8500_vana_init = {
.constraints = {
.name = "V-CSI/DSI",
.valid_ops_mask = REGULATOR_CHANGE_STATUS,
/* supply for U8500 CSI/DSI, VANA LDO */
[AB8500_LDO_ANA] = {
.constraints = {
.name = "V-CSI/DSI",
.valid_ops_mask = REGULATOR_CHANGE_STATUS,
},
},
};

19 changes: 19 additions & 0 deletions arch/arm/mach-ux500/board-mop500-regulators.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
* Copyright (C) ST-Ericsson SA 2010
*
* License Terms: GNU General Public License v2
*
* Author: Bengt Jonsson <bengt.g.jonsson@stericsson.com> for ST-Ericsson
*
* MOP500 board specific initialization for regulators
*/

#ifndef __BOARD_MOP500_REGULATORS_H
#define __BOARD_MOP500_REGULATORS_H

#include <linux/regulator/machine.h>
#include <linux/regulator/ab8500.h>

extern struct regulator_init_data ab8500_regulators[AB8500_NUM_REGULATORS];

#endif
3 changes: 3 additions & 0 deletions arch/arm/mach-ux500/board-mop500.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
#include "devices-db8500.h"
#include "pins-db8500.h"
#include "board-mop500.h"
#include "board-mop500-regulators.h"

static pin_cfg_t mop500_pins[] = {
/* SSP0 */
Expand Down Expand Up @@ -80,6 +81,8 @@ static pin_cfg_t mop500_pins[] = {

static struct ab8500_platform_data ab8500_platdata = {
.irq_base = MOP500_AB8500_IRQ_BASE,
.regulator = ab8500_regulators,
.num_regulator = ARRAY_SIZE(ab8500_regulators),
};

static struct resource ab8500_resources[] = {
Expand Down
3 changes: 2 additions & 1 deletion drivers/regulator/88pm8607.c
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ static int choose_voltage(struct regulator_dev *rdev, int min_uV, int max_uV)
}

static int pm8607_set_voltage(struct regulator_dev *rdev,
int min_uV, int max_uV)
int min_uV, int max_uV, unsigned *selector)
{
struct pm8607_regulator_info *info = rdev_get_drvdata(rdev);
uint8_t val, mask;
Expand All @@ -263,6 +263,7 @@ static int pm8607_set_voltage(struct regulator_dev *rdev,
ret = choose_voltage(rdev, min_uV, max_uV);
if (ret < 0)
return -EINVAL;
*selector = ret;
val = (uint8_t)(ret << info->vol_shift);
mask = ((1 << info->vol_nbits) - 1) << info->vol_shift;

Expand Down
22 changes: 22 additions & 0 deletions drivers/regulator/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -186,13 +186,25 @@ config REGULATOR_PCAP
This driver provides support for the voltage regulators of the
PCAP2 PMIC.

config REGULATOR_MC13XXX_CORE
tristate

config REGULATOR_MC13783
tristate "Support regulators on Freescale MC13783 PMIC"
depends on MFD_MC13783
select REGULATOR_MC13XXX_CORE
help
Say y here to support the regulators found on the Freescale MC13783
PMIC.

config REGULATOR_MC13892
tristate "Support regulators on Freescale MC13892 PMIC"
depends on MFD_MC13XXX
select REGULATOR_MC13XXX_CORE
help
Say y here to support the regulators found on the Freescale MC13892
PMIC.

config REGULATOR_AB3100
tristate "ST-Ericsson AB3100 Regulator functions"
depends on AB3100_CORE
Expand Down Expand Up @@ -250,5 +262,15 @@ config REGULATOR_TPS6586X
help
This driver supports TPS6586X voltage regulator chips.

config REGULATOR_TPS6524X
tristate "TI TPS6524X Power regulators"
depends on SPI
help
This driver supports TPS6524X voltage regulator chips. TPS6524X
provides three step-down converters and two general-purpose LDO
voltage regulators. This device is interfaced using a customized
serial interface currently supported on the sequencer serial
port controller.

endif

3 changes: 3 additions & 0 deletions drivers/regulator/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,13 @@ obj-$(CONFIG_REGULATOR_DA903X) += da903x.o
obj-$(CONFIG_REGULATOR_PCF50633) += pcf50633-regulator.o
obj-$(CONFIG_REGULATOR_PCAP) += pcap-regulator.o
obj-$(CONFIG_REGULATOR_MC13783) += mc13783-regulator.o
obj-$(CONFIG_REGULATOR_MC13892) += mc13892-regulator.o
obj-$(CONFIG_REGULATOR_MC13XXX_CORE) += mc13xxx-regulator-core.o
obj-$(CONFIG_REGULATOR_AB3100) += ab3100.o

obj-$(CONFIG_REGULATOR_TPS65023) += tps65023-regulator.o
obj-$(CONFIG_REGULATOR_TPS6507X) += tps6507x-regulator.o
obj-$(CONFIG_REGULATOR_TPS6524X) += tps6524x-regulator.o
obj-$(CONFIG_REGULATOR_88PM8607) += 88pm8607.o
obj-$(CONFIG_REGULATOR_ISL6271A) += isl6271a-regulator.o
obj-$(CONFIG_REGULATOR_AB8500) += ab8500.o
Expand Down
5 changes: 4 additions & 1 deletion drivers/regulator/ab3100.c
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,8 @@ static int ab3100_get_best_voltage_index(struct regulator_dev *reg,
}

static int ab3100_set_voltage_regulator(struct regulator_dev *reg,
int min_uV, int max_uV)
int min_uV, int max_uV,
unsigned *selector)
{
struct ab3100_regulator *abreg = reg->reg_data;
u8 regval;
Expand All @@ -373,6 +374,8 @@ static int ab3100_set_voltage_regulator(struct regulator_dev *reg,
if (bestindex < 0)
return bestindex;

*selector = bestindex;

err = abx500_get_register_interruptible(abreg->dev, 0,
abreg->regreg, &regval);
if (err) {
Expand Down
Loading

0 comments on commit 1896a13

Please sign in to comment.