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
cf1466fb
Commit
cf1466fb
authored
Feb 19, 2013
by
Mark Brown
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'regulator/topic/of' into regulator-next
parents
c99f21c2
86f66733
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
30 additions
and
19 deletions
+30
-19
drivers/regulator/88pm8607.c
drivers/regulator/88pm8607.c
+2
-1
drivers/regulator/da9052-regulator.c
drivers/regulator/da9052-regulator.c
+3
-2
drivers/regulator/max8907-regulator.c
drivers/regulator/max8907-regulator.c
+4
-3
drivers/regulator/max8925-regulator.c
drivers/regulator/max8925-regulator.c
+2
-1
drivers/regulator/max8997.c
drivers/regulator/max8997.c
+4
-4
drivers/regulator/mc13xxx-regulator-core.c
drivers/regulator/mc13xxx-regulator-core.c
+9
-6
drivers/regulator/palmas-regulator.c
drivers/regulator/palmas-regulator.c
+2
-0
drivers/regulator/tps65910-regulator.c
drivers/regulator/tps65910-regulator.c
+4
-2
No files found.
drivers/regulator/88pm8607.c
View file @
cf1466fb
...
@@ -347,7 +347,7 @@ static int pm8607_regulator_dt_init(struct platform_device *pdev,
...
@@ -347,7 +347,7 @@ static int pm8607_regulator_dt_init(struct platform_device *pdev,
struct
regulator_config
*
config
)
struct
regulator_config
*
config
)
{
{
struct
device_node
*
nproot
,
*
np
;
struct
device_node
*
nproot
,
*
np
;
nproot
=
pdev
->
dev
.
parent
->
of_node
;
nproot
=
of_node_get
(
pdev
->
dev
.
parent
->
of_node
)
;
if
(
!
nproot
)
if
(
!
nproot
)
return
-
ENODEV
;
return
-
ENODEV
;
nproot
=
of_find_node_by_name
(
nproot
,
"regulators"
);
nproot
=
of_find_node_by_name
(
nproot
,
"regulators"
);
...
@@ -363,6 +363,7 @@ static int pm8607_regulator_dt_init(struct platform_device *pdev,
...
@@ -363,6 +363,7 @@ static int pm8607_regulator_dt_init(struct platform_device *pdev,
break
;
break
;
}
}
}
}
of_node_put
(
nproot
);
return
0
;
return
0
;
}
}
#else
#else
...
...
drivers/regulator/da9052-regulator.c
View file @
cf1466fb
...
@@ -366,9 +366,9 @@ static int da9052_regulator_probe(struct platform_device *pdev)
...
@@ -366,9 +366,9 @@ static int da9052_regulator_probe(struct platform_device *pdev)
config
.
init_data
=
pdata
->
regulators
[
pdev
->
id
];
config
.
init_data
=
pdata
->
regulators
[
pdev
->
id
];
}
else
{
}
else
{
#ifdef CONFIG_OF
#ifdef CONFIG_OF
struct
device_node
*
nproot
=
da9052
->
dev
->
of_node
;
struct
device_node
*
nproot
,
*
np
;
struct
device_node
*
np
;
nproot
=
of_node_get
(
da9052
->
dev
->
of_node
);
if
(
!
nproot
)
if
(
!
nproot
)
return
-
ENODEV
;
return
-
ENODEV
;
...
@@ -385,6 +385,7 @@ static int da9052_regulator_probe(struct platform_device *pdev)
...
@@ -385,6 +385,7 @@ static int da9052_regulator_probe(struct platform_device *pdev)
break
;
break
;
}
}
}
}
of_node_put
(
nproot
);
#endif
#endif
}
}
...
...
drivers/regulator/max8907-regulator.c
View file @
cf1466fb
...
@@ -224,11 +224,11 @@ static struct of_regulator_match max8907_matches[] = {
...
@@ -224,11 +224,11 @@ static struct of_regulator_match max8907_matches[] = {
static
int
max8907_regulator_parse_dt
(
struct
platform_device
*
pdev
)
static
int
max8907_regulator_parse_dt
(
struct
platform_device
*
pdev
)
{
{
struct
device_node
*
np
=
pdev
->
dev
.
parent
->
of_node
;
struct
device_node
*
np
,
*
regulators
;
struct
device_node
*
regulators
;
int
ret
;
int
ret
;
if
(
!
pdev
->
dev
.
parent
->
of_node
)
np
=
of_node_get
(
pdev
->
dev
.
parent
->
of_node
);
if
(
!
np
)
return
0
;
return
0
;
regulators
=
of_find_node_by_name
(
np
,
"regulators"
);
regulators
=
of_find_node_by_name
(
np
,
"regulators"
);
...
@@ -239,6 +239,7 @@ static int max8907_regulator_parse_dt(struct platform_device *pdev)
...
@@ -239,6 +239,7 @@ static int max8907_regulator_parse_dt(struct platform_device *pdev)
ret
=
of_regulator_match
(
&
pdev
->
dev
,
regulators
,
max8907_matches
,
ret
=
of_regulator_match
(
&
pdev
->
dev
,
regulators
,
max8907_matches
,
ARRAY_SIZE
(
max8907_matches
));
ARRAY_SIZE
(
max8907_matches
));
of_node_put
(
regulators
);
if
(
ret
<
0
)
{
if
(
ret
<
0
)
{
dev_err
(
&
pdev
->
dev
,
"Error parsing regulator init data: %d
\n
"
,
dev_err
(
&
pdev
->
dev
,
"Error parsing regulator init data: %d
\n
"
,
ret
);
ret
);
...
...
drivers/regulator/max8925-regulator.c
View file @
cf1466fb
...
@@ -252,7 +252,7 @@ static int max8925_regulator_dt_init(struct platform_device *pdev,
...
@@ -252,7 +252,7 @@ static int max8925_regulator_dt_init(struct platform_device *pdev,
{
{
struct
device_node
*
nproot
,
*
np
;
struct
device_node
*
nproot
,
*
np
;
int
rcount
;
int
rcount
;
nproot
=
pdev
->
dev
.
parent
->
of_node
;
nproot
=
of_node_get
(
pdev
->
dev
.
parent
->
of_node
)
;
if
(
!
nproot
)
if
(
!
nproot
)
return
-
ENODEV
;
return
-
ENODEV
;
np
=
of_find_node_by_name
(
nproot
,
"regulators"
);
np
=
of_find_node_by_name
(
nproot
,
"regulators"
);
...
@@ -263,6 +263,7 @@ static int max8925_regulator_dt_init(struct platform_device *pdev,
...
@@ -263,6 +263,7 @@ static int max8925_regulator_dt_init(struct platform_device *pdev,
rcount
=
of_regulator_match
(
&
pdev
->
dev
,
np
,
rcount
=
of_regulator_match
(
&
pdev
->
dev
,
np
,
&
max8925_regulator_matches
[
ridx
],
1
);
&
max8925_regulator_matches
[
ridx
],
1
);
of_node_put
(
np
);
if
(
rcount
<
0
)
if
(
rcount
<
0
)
return
-
ENODEV
;
return
-
ENODEV
;
config
->
init_data
=
max8925_regulator_matches
[
ridx
].
init_data
;
config
->
init_data
=
max8925_regulator_matches
[
ridx
].
init_data
;
...
...
drivers/regulator/max8997.c
View file @
cf1466fb
...
@@ -917,7 +917,7 @@ static int max8997_pmic_dt_parse_pdata(struct platform_device *pdev,
...
@@ -917,7 +917,7 @@ static int max8997_pmic_dt_parse_pdata(struct platform_device *pdev,
struct
max8997_regulator_data
*
rdata
;
struct
max8997_regulator_data
*
rdata
;
unsigned
int
i
,
dvs_voltage_nr
=
1
,
ret
;
unsigned
int
i
,
dvs_voltage_nr
=
1
,
ret
;
pmic_np
=
iodev
->
dev
->
of_node
;
pmic_np
=
of_node_get
(
iodev
->
dev
->
of_node
)
;
if
(
!
pmic_np
)
{
if
(
!
pmic_np
)
{
dev_err
(
&
pdev
->
dev
,
"could not find pmic sub-node
\n
"
);
dev_err
(
&
pdev
->
dev
,
"could not find pmic sub-node
\n
"
);
return
-
ENODEV
;
return
-
ENODEV
;
...
@@ -930,13 +930,12 @@ static int max8997_pmic_dt_parse_pdata(struct platform_device *pdev,
...
@@ -930,13 +930,12 @@ static int max8997_pmic_dt_parse_pdata(struct platform_device *pdev,
}
}
/* count the number of regulators to be supported in pmic */
/* count the number of regulators to be supported in pmic */
pdata
->
num_regulators
=
0
;
pdata
->
num_regulators
=
of_get_child_count
(
regulators_np
);
for_each_child_of_node
(
regulators_np
,
reg_np
)
pdata
->
num_regulators
++
;
rdata
=
devm_kzalloc
(
&
pdev
->
dev
,
sizeof
(
*
rdata
)
*
rdata
=
devm_kzalloc
(
&
pdev
->
dev
,
sizeof
(
*
rdata
)
*
pdata
->
num_regulators
,
GFP_KERNEL
);
pdata
->
num_regulators
,
GFP_KERNEL
);
if
(
!
rdata
)
{
if
(
!
rdata
)
{
of_node_put
(
regulators_np
);
dev_err
(
&
pdev
->
dev
,
"could not allocate memory for regulator data
\n
"
);
dev_err
(
&
pdev
->
dev
,
"could not allocate memory for regulator data
\n
"
);
return
-
ENOMEM
;
return
-
ENOMEM
;
}
}
...
@@ -959,6 +958,7 @@ static int max8997_pmic_dt_parse_pdata(struct platform_device *pdev,
...
@@ -959,6 +958,7 @@ static int max8997_pmic_dt_parse_pdata(struct platform_device *pdev,
rdata
->
reg_node
=
reg_np
;
rdata
->
reg_node
=
reg_np
;
rdata
++
;
rdata
++
;
}
}
of_node_put
(
regulators_np
);
if
(
of_get_property
(
pmic_np
,
"max8997,pmic-buck1-uses-gpio-dvs"
,
NULL
))
if
(
of_get_property
(
pmic_np
,
"max8997,pmic-buck1-uses-gpio-dvs"
,
NULL
))
pdata
->
buck1_gpiodvs
=
true
;
pdata
->
buck1_gpiodvs
=
true
;
...
...
drivers/regulator/mc13xxx-regulator-core.c
View file @
cf1466fb
...
@@ -164,17 +164,16 @@ EXPORT_SYMBOL_GPL(mc13xxx_fixed_regulator_ops);
...
@@ -164,17 +164,16 @@ EXPORT_SYMBOL_GPL(mc13xxx_fixed_regulator_ops);
#ifdef CONFIG_OF
#ifdef CONFIG_OF
int
mc13xxx_get_num_regulators_dt
(
struct
platform_device
*
pdev
)
int
mc13xxx_get_num_regulators_dt
(
struct
platform_device
*
pdev
)
{
{
struct
device_node
*
parent
,
*
child
;
struct
device_node
*
parent
;
int
num
=
0
;
int
num
;
of_node_get
(
pdev
->
dev
.
parent
->
of_node
);
of_node_get
(
pdev
->
dev
.
parent
->
of_node
);
parent
=
of_find_node_by_name
(
pdev
->
dev
.
parent
->
of_node
,
"regulators"
);
parent
=
of_find_node_by_name
(
pdev
->
dev
.
parent
->
of_node
,
"regulators"
);
if
(
!
parent
)
if
(
!
parent
)
return
-
ENODEV
;
return
-
ENODEV
;
for_each_child_of_node
(
parent
,
child
)
num
=
of_get_child_count
(
parent
);
num
++
;
of_node_put
(
parent
);
return
num
;
return
num
;
}
}
EXPORT_SYMBOL_GPL
(
mc13xxx_get_num_regulators_dt
);
EXPORT_SYMBOL_GPL
(
mc13xxx_get_num_regulators_dt
);
...
@@ -197,8 +196,11 @@ struct mc13xxx_regulator_init_data *mc13xxx_parse_regulators_dt(
...
@@ -197,8 +196,11 @@ struct mc13xxx_regulator_init_data *mc13xxx_parse_regulators_dt(
data
=
devm_kzalloc
(
&
pdev
->
dev
,
sizeof
(
*
data
)
*
priv
->
num_regulators
,
data
=
devm_kzalloc
(
&
pdev
->
dev
,
sizeof
(
*
data
)
*
priv
->
num_regulators
,
GFP_KERNEL
);
GFP_KERNEL
);
if
(
!
data
)
if
(
!
data
)
{
of_node_put
(
parent
);
return
NULL
;
return
NULL
;
}
p
=
data
;
p
=
data
;
for_each_child_of_node
(
parent
,
child
)
{
for_each_child_of_node
(
parent
,
child
)
{
...
@@ -217,6 +219,7 @@ struct mc13xxx_regulator_init_data *mc13xxx_parse_regulators_dt(
...
@@ -217,6 +219,7 @@ struct mc13xxx_regulator_init_data *mc13xxx_parse_regulators_dt(
}
}
}
}
}
}
of_node_put
(
parent
);
*
num_parsed
=
parsed
;
*
num_parsed
=
parsed
;
return
data
;
return
data
;
...
...
drivers/regulator/palmas-regulator.c
View file @
cf1466fb
...
@@ -527,6 +527,7 @@ static void palmas_dt_to_pdata(struct device *dev,
...
@@ -527,6 +527,7 @@ static void palmas_dt_to_pdata(struct device *dev,
u32
prop
;
u32
prop
;
int
idx
,
ret
;
int
idx
,
ret
;
node
=
of_node_get
(
node
);
regulators
=
of_find_node_by_name
(
node
,
"regulators"
);
regulators
=
of_find_node_by_name
(
node
,
"regulators"
);
if
(
!
regulators
)
{
if
(
!
regulators
)
{
dev_info
(
dev
,
"regulator node not found
\n
"
);
dev_info
(
dev
,
"regulator node not found
\n
"
);
...
@@ -535,6 +536,7 @@ static void palmas_dt_to_pdata(struct device *dev,
...
@@ -535,6 +536,7 @@ static void palmas_dt_to_pdata(struct device *dev,
ret
=
of_regulator_match
(
dev
,
regulators
,
palmas_matches
,
ret
=
of_regulator_match
(
dev
,
regulators
,
palmas_matches
,
PALMAS_NUM_REGS
);
PALMAS_NUM_REGS
);
of_node_put
(
regulators
);
if
(
ret
<
0
)
{
if
(
ret
<
0
)
{
dev_err
(
dev
,
"Error parsing regulator init data: %d
\n
"
,
ret
);
dev_err
(
dev
,
"Error parsing regulator init data: %d
\n
"
,
ret
);
return
;
return
;
...
...
drivers/regulator/tps65910-regulator.c
View file @
cf1466fb
...
@@ -964,8 +964,7 @@ static struct tps65910_board *tps65910_parse_dt_reg_data(
...
@@ -964,8 +964,7 @@ static struct tps65910_board *tps65910_parse_dt_reg_data(
{
{
struct
tps65910_board
*
pmic_plat_data
;
struct
tps65910_board
*
pmic_plat_data
;
struct
tps65910
*
tps65910
=
dev_get_drvdata
(
pdev
->
dev
.
parent
);
struct
tps65910
*
tps65910
=
dev_get_drvdata
(
pdev
->
dev
.
parent
);
struct
device_node
*
np
=
pdev
->
dev
.
parent
->
of_node
;
struct
device_node
*
np
,
*
regulators
;
struct
device_node
*
regulators
;
struct
of_regulator_match
*
matches
;
struct
of_regulator_match
*
matches
;
unsigned
int
prop
;
unsigned
int
prop
;
int
idx
=
0
,
ret
,
count
;
int
idx
=
0
,
ret
,
count
;
...
@@ -978,6 +977,7 @@ static struct tps65910_board *tps65910_parse_dt_reg_data(
...
@@ -978,6 +977,7 @@ static struct tps65910_board *tps65910_parse_dt_reg_data(
return
NULL
;
return
NULL
;
}
}
np
=
of_node_get
(
pdev
->
dev
.
parent
->
of_node
);
regulators
=
of_find_node_by_name
(
np
,
"regulators"
);
regulators
=
of_find_node_by_name
(
np
,
"regulators"
);
if
(
!
regulators
)
{
if
(
!
regulators
)
{
dev_err
(
&
pdev
->
dev
,
"regulator node not found
\n
"
);
dev_err
(
&
pdev
->
dev
,
"regulator node not found
\n
"
);
...
@@ -994,11 +994,13 @@ static struct tps65910_board *tps65910_parse_dt_reg_data(
...
@@ -994,11 +994,13 @@ static struct tps65910_board *tps65910_parse_dt_reg_data(
matches
=
tps65911_matches
;
matches
=
tps65911_matches
;
break
;
break
;
default:
default:
of_node_put
(
regulators
);
dev_err
(
&
pdev
->
dev
,
"Invalid tps chip version
\n
"
);
dev_err
(
&
pdev
->
dev
,
"Invalid tps chip version
\n
"
);
return
NULL
;
return
NULL
;
}
}
ret
=
of_regulator_match
(
&
pdev
->
dev
,
regulators
,
matches
,
count
);
ret
=
of_regulator_match
(
&
pdev
->
dev
,
regulators
,
matches
,
count
);
of_node_put
(
regulators
);
if
(
ret
<
0
)
{
if
(
ret
<
0
)
{
dev_err
(
&
pdev
->
dev
,
"Error parsing regulator init data: %d
\n
"
,
dev_err
(
&
pdev
->
dev
,
"Error parsing regulator init data: %d
\n
"
,
ret
);
ret
);
...
...
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