Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 220539
b: refs/heads/master
c: 688fe99
h: refs/heads/master
i:
  220537: 11f0dbe
  220535: 2e1465c
v: v3
  • Loading branch information
Mark Brown authored and Liam Girdwood committed Oct 28, 2010
1 parent 74a4047 commit d819b94
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 3 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: 993af7c048f414121bc81e0d6e69456e3862a06b
refs/heads/master: 688fe99a439f7c9dfcc52fbf7cb347f140a2dc8b
3 changes: 1 addition & 2 deletions trunk/drivers/regulator/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@
#


obj-$(CONFIG_REGULATOR) += core.o
obj-$(CONFIG_REGULATOR) += core.o dummy.o
obj-$(CONFIG_REGULATOR_FIXED_VOLTAGE) += fixed.o
obj-$(CONFIG_REGULATOR_VIRTUAL_CONSUMER) += virtual.o
obj-$(CONFIG_REGULATOR_USERSPACE_CONSUMER) += userspace-consumer.o

obj-$(CONFIG_REGULATOR_AD5398) += ad5398.o
obj-$(CONFIG_REGULATOR_BQ24022) += bq24022.o
obj-$(CONFIG_REGULATOR_DUMMY) += dummy.o
obj-$(CONFIG_REGULATOR_LP3971) += lp3971.o
obj-$(CONFIG_REGULATOR_LP3972) += lp3972.o
obj-$(CONFIG_REGULATOR_MAX1586) += max1586.o
Expand Down
22 changes: 22 additions & 0 deletions trunk/drivers/regulator/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ static DEFINE_MUTEX(regulator_list_mutex);
static LIST_HEAD(regulator_list);
static LIST_HEAD(regulator_map_list);
static int has_full_constraints;
static bool board_wants_dummy_regulator;

/*
* struct regulator_map
Expand Down Expand Up @@ -1108,6 +1109,11 @@ static struct regulator *_regulator_get(struct device *dev, const char *id,
}
}

if (board_wants_dummy_regulator) {
rdev = dummy_regulator_rdev;
goto found;
}

#ifdef CONFIG_REGULATOR_DUMMY
if (!devname)
devname = "deviceless";
Expand Down Expand Up @@ -2462,6 +2468,22 @@ void regulator_has_full_constraints(void)
}
EXPORT_SYMBOL_GPL(regulator_has_full_constraints);

/**
* regulator_use_dummy_regulator - Provide a dummy regulator when none is found
*
* Calling this function will cause the regulator API to provide a
* dummy regulator to consumers if no physical regulator is found,
* allowing most consumers to proceed as though a regulator were
* configured. This allows systems such as those with software
* controllable regulators for the CPU core only to be brought up more
* readily.
*/
void regulator_use_dummy_regulator(void)
{
board_wants_dummy_regulator = true;
}
EXPORT_SYMBOL_GPL(regulator_use_dummy_regulator);

/**
* rdev_get_drvdata - get rdev regulator driver data
* @rdev: regulator
Expand Down
5 changes: 5 additions & 0 deletions trunk/include/linux/regulator/machine.h
Original file line number Diff line number Diff line change
Expand Up @@ -189,10 +189,15 @@ int regulator_suspend_prepare(suspend_state_t state);

#ifdef CONFIG_REGULATOR
void regulator_has_full_constraints(void);
void regulator_use_dummy_regulator(void);
#else
static inline void regulator_has_full_constraints(void)
{
}

static inline void regulator_use_dummy_regulator(void)
{
}
#endif

#endif

0 comments on commit d819b94

Please sign in to comment.