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
4ccb09f6
Commit
4ccb09f6
authored
Jun 22, 2015
by
Mark Brown
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'regulator/topic/core' into regulator-next
parents
87028bd1
5751a99f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
21 deletions
+26
-21
drivers/regulator/core.c
drivers/regulator/core.c
+26
-21
No files found.
drivers/regulator/core.c
View file @
4ccb09f6
...
...
@@ -780,58 +780,63 @@ static void print_constraints(struct regulator_dev *rdev)
{
struct
regulation_constraints
*
constraints
=
rdev
->
constraints
;
char
buf
[
160
]
=
""
;
size_t
len
=
sizeof
(
buf
)
-
1
;
int
count
=
0
;
int
ret
;
if
(
constraints
->
min_uV
&&
constraints
->
max_uV
)
{
if
(
constraints
->
min_uV
==
constraints
->
max_uV
)
count
+=
s
printf
(
buf
+
count
,
"%d mV "
,
constraints
->
min_uV
/
1000
);
count
+=
s
cnprintf
(
buf
+
count
,
len
-
count
,
"%d mV "
,
constraints
->
min_uV
/
1000
);
else
count
+=
sprintf
(
buf
+
count
,
"%d <--> %d mV "
,
constraints
->
min_uV
/
1000
,
constraints
->
max_uV
/
1000
);
count
+=
scnprintf
(
buf
+
count
,
len
-
count
,
"%d <--> %d mV "
,
constraints
->
min_uV
/
1000
,
constraints
->
max_uV
/
1000
);
}
if
(
!
constraints
->
min_uV
||
constraints
->
min_uV
!=
constraints
->
max_uV
)
{
ret
=
_regulator_get_voltage
(
rdev
);
if
(
ret
>
0
)
count
+=
sprintf
(
buf
+
count
,
"at %d mV "
,
ret
/
1000
);
count
+=
scnprintf
(
buf
+
count
,
len
-
count
,
"at %d mV "
,
ret
/
1000
);
}
if
(
constraints
->
uV_offset
)
count
+=
s
printf
(
buf
+
count
,
"%dmV offset "
,
constraints
->
uV_offset
/
1000
);
count
+=
s
cnprintf
(
buf
+
count
,
len
-
count
,
"%dmV offset "
,
constraints
->
uV_offset
/
1000
);
if
(
constraints
->
min_uA
&&
constraints
->
max_uA
)
{
if
(
constraints
->
min_uA
==
constraints
->
max_uA
)
count
+=
s
printf
(
buf
+
count
,
"%d mA "
,
constraints
->
min_uA
/
1000
);
count
+=
s
cnprintf
(
buf
+
count
,
len
-
count
,
"%d mA "
,
constraints
->
min_uA
/
1000
);
else
count
+=
sprintf
(
buf
+
count
,
"%d <--> %d mA "
,
constraints
->
min_uA
/
1000
,
constraints
->
max_uA
/
1000
);
count
+=
scnprintf
(
buf
+
count
,
len
-
count
,
"%d <--> %d mA "
,
constraints
->
min_uA
/
1000
,
constraints
->
max_uA
/
1000
);
}
if
(
!
constraints
->
min_uA
||
constraints
->
min_uA
!=
constraints
->
max_uA
)
{
ret
=
_regulator_get_current_limit
(
rdev
);
if
(
ret
>
0
)
count
+=
sprintf
(
buf
+
count
,
"at %d mA "
,
ret
/
1000
);
count
+=
scnprintf
(
buf
+
count
,
len
-
count
,
"at %d mA "
,
ret
/
1000
);
}
if
(
constraints
->
valid_modes_mask
&
REGULATOR_MODE_FAST
)
count
+=
s
printf
(
buf
+
count
,
"fast "
);
count
+=
s
cnprintf
(
buf
+
count
,
len
-
count
,
"fast "
);
if
(
constraints
->
valid_modes_mask
&
REGULATOR_MODE_NORMAL
)
count
+=
s
printf
(
buf
+
count
,
"normal "
);
count
+=
s
cnprintf
(
buf
+
count
,
len
-
count
,
"normal "
);
if
(
constraints
->
valid_modes_mask
&
REGULATOR_MODE_IDLE
)
count
+=
s
printf
(
buf
+
count
,
"idle "
);
count
+=
s
cnprintf
(
buf
+
count
,
len
-
count
,
"idle "
);
if
(
constraints
->
valid_modes_mask
&
REGULATOR_MODE_STANDBY
)
count
+=
s
printf
(
buf
+
count
,
"standby"
);
count
+=
s
cnprintf
(
buf
+
count
,
len
-
count
,
"standby"
);
if
(
!
count
)
s
printf
(
buf
,
"no parameters"
);
s
cnprintf
(
buf
,
len
,
"no parameters"
);
rdev_dbg
(
rdev
,
"%s
\n
"
,
buf
);
...
...
@@ -1192,10 +1197,10 @@ static struct regulator *create_regulator(struct regulator_dev *rdev,
if
(
regulator
->
supply_name
==
NULL
)
goto
overflow_err
;
err
=
sysfs_create_link
(
&
rdev
->
dev
.
kobj
,
&
dev
->
kobj
,
err
=
sysfs_create_link
_nowarn
(
&
rdev
->
dev
.
kobj
,
&
dev
->
kobj
,
buf
);
if
(
err
)
{
rdev_
warn
(
rdev
,
"could not add device link %s err %d
\n
"
,
rdev_
dbg
(
rdev
,
"could not add device link %s err %d
\n
"
,
dev
->
kobj
.
name
,
err
);
/* non-fatal */
}
...
...
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