Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
1ad13028
Commit
1ad13028
authored
Sep 01, 2013
by
Mark Brown
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'regulator/topic/core' into regulator-next
parents
5288be36
84fcf447
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
20 deletions
+31
-20
drivers/regulator/core.c
drivers/regulator/core.c
+26
-18
include/linux/regulator/consumer.h
include/linux/regulator/consumer.h
+5
-2
No files found.
drivers/regulator/core.c
View file @
1ad13028
...
...
@@ -323,13 +323,14 @@ static ssize_t regulator_uA_show(struct device *dev,
}
static
DEVICE_ATTR
(
microamps
,
0444
,
regulator_uA_show
,
NULL
);
static
ssize_t
regulator_name_show
(
struct
device
*
dev
,
struct
device_attribute
*
attr
,
char
*
buf
)
static
ssize_t
name_show
(
struct
device
*
dev
,
struct
device_attribute
*
attr
,
char
*
buf
)
{
struct
regulator_dev
*
rdev
=
dev_get_drvdata
(
dev
);
return
sprintf
(
buf
,
"%s
\n
"
,
rdev_get_name
(
rdev
));
}
static
DEVICE_ATTR_RO
(
name
);
static
ssize_t
regulator_print_opmode
(
char
*
buf
,
int
mode
)
{
...
...
@@ -489,15 +490,16 @@ static ssize_t regulator_total_uA_show(struct device *dev,
}
static
DEVICE_ATTR
(
requested_microamps
,
0444
,
regulator_total_uA_show
,
NULL
);
static
ssize_t
regulator_num_users_show
(
struct
device
*
dev
,
struct
device_attribute
*
attr
,
char
*
buf
)
static
ssize_t
num_users_show
(
struct
device
*
dev
,
struct
device_attribute
*
attr
,
char
*
buf
)
{
struct
regulator_dev
*
rdev
=
dev_get_drvdata
(
dev
);
return
sprintf
(
buf
,
"%d
\n
"
,
rdev
->
use_count
);
}
static
DEVICE_ATTR_RO
(
num_users
);
static
ssize_t
regulator_type_show
(
struct
device
*
dev
,
struct
device_attribute
*
attr
,
char
*
buf
)
static
ssize_t
type_show
(
struct
device
*
dev
,
struct
device_attribute
*
attr
,
char
*
buf
)
{
struct
regulator_dev
*
rdev
=
dev_get_drvdata
(
dev
);
...
...
@@ -509,6 +511,7 @@ static ssize_t regulator_type_show(struct device *dev,
}
return
sprintf
(
buf
,
"unknown
\n
"
);
}
static
DEVICE_ATTR_RO
(
type
);
static
ssize_t
regulator_suspend_mem_uV_show
(
struct
device
*
dev
,
struct
device_attribute
*
attr
,
char
*
buf
)
...
...
@@ -632,12 +635,13 @@ static DEVICE_ATTR(bypass, 0444,
* These are the only attributes are present for all regulators.
* Other attributes are a function of regulator functionality.
*/
static
struct
device_attribute
regulator_dev_attrs
[]
=
{
__ATTR
(
name
,
0444
,
regulator_name_show
,
NULL
)
,
__ATTR
(
num_users
,
0444
,
regulator_num_users_show
,
NULL
)
,
__ATTR
(
type
,
0444
,
regulator_type_show
,
NULL
)
,
__ATTR_
NULL
,
static
struct
attribute
*
regulator_dev_attrs
[]
=
{
&
dev_attr_name
.
attr
,
&
dev_attr_num_users
.
attr
,
&
dev_attr_type
.
attr
,
NULL
,
};
ATTRIBUTE_GROUPS
(
regulator_dev
);
static
void
regulator_dev_release
(
struct
device
*
dev
)
{
...
...
@@ -648,7 +652,7 @@ static void regulator_dev_release(struct device *dev)
static
struct
class
regulator_class
=
{
.
name
=
"regulator"
,
.
dev_release
=
regulator_dev_release
,
.
dev_
attrs
=
regulator_dev_attr
s
,
.
dev_
groups
=
regulator_dev_group
s
,
};
/* Calculate the new optimum regulator operating mode based on the new total
...
...
@@ -1238,7 +1242,7 @@ static struct regulator_dev *regulator_dev_lookup(struct device *dev,
/* Internal regulator request function */
static
struct
regulator
*
_regulator_get
(
struct
device
*
dev
,
const
char
*
id
,
int
exclusive
)
bool
exclusive
)
{
struct
regulator_dev
*
rdev
;
struct
regulator
*
regulator
=
ERR_PTR
(
-
EPROBE_DEFER
);
...
...
@@ -1344,7 +1348,7 @@ static struct regulator *_regulator_get(struct device *dev, const char *id,
*/
struct
regulator
*
regulator_get
(
struct
device
*
dev
,
const
char
*
id
)
{
return
_regulator_get
(
dev
,
id
,
0
);
return
_regulator_get
(
dev
,
id
,
false
);
}
EXPORT_SYMBOL_GPL
(
regulator_get
);
...
...
@@ -1405,7 +1409,7 @@ EXPORT_SYMBOL_GPL(devm_regulator_get);
*/
struct
regulator
*
regulator_get_exclusive
(
struct
device
*
dev
,
const
char
*
id
)
{
return
_regulator_get
(
dev
,
id
,
1
);
return
_regulator_get
(
dev
,
id
,
true
);
}
EXPORT_SYMBOL_GPL
(
regulator_get_exclusive
);
...
...
@@ -1890,8 +1894,9 @@ int regulator_disable_deferred(struct regulator *regulator, int ms)
rdev
->
deferred_disables
++
;
mutex_unlock
(
&
rdev
->
mutex
);
ret
=
schedule_delayed_work
(
&
rdev
->
disable_work
,
msecs_to_jiffies
(
ms
));
ret
=
queue_delayed_work
(
system_power_efficient_wq
,
&
rdev
->
disable_work
,
msecs_to_jiffies
(
ms
));
if
(
ret
<
0
)
return
ret
;
else
...
...
@@ -3835,8 +3840,11 @@ void regulator_unregister(struct regulator_dev *rdev)
if
(
rdev
==
NULL
)
return
;
if
(
rdev
->
supply
)
if
(
rdev
->
supply
)
{
while
(
rdev
->
use_count
--
)
regulator_disable
(
rdev
->
supply
);
regulator_put
(
rdev
->
supply
);
}
mutex_lock
(
&
regulator_list_mutex
);
debugfs_remove_recursive
(
rdev
->
debugfs
);
flush_work
(
&
rdev
->
disable_work
.
work
);
...
...
include/linux/regulator/consumer.h
View file @
1ad13028
...
...
@@ -369,8 +369,11 @@ static inline int regulator_count_voltages(struct regulator *regulator)
static
inline
int
regulator_set_voltage_tol
(
struct
regulator
*
regulator
,
int
new_uV
,
int
tol_uV
)
{
return
regulator_set_voltage
(
regulator
,
new_uV
-
tol_uV
,
new_uV
+
tol_uV
);
if
(
regulator_set_voltage
(
regulator
,
new_uV
,
new_uV
+
tol_uV
)
==
0
)
return
0
;
else
return
regulator_set_voltage
(
regulator
,
new_uV
-
tol_uV
,
new_uV
+
tol_uV
);
}
static
inline
int
regulator_is_supported_voltage_tol
(
struct
regulator
*
regulator
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment