Donate to
e Foundation
|
Murena
handsets with /e/OS | Own a part of Murena!
Learn more
Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
android_kernel_teracube_emerald
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
e
devices
android_kernel_teracube_emerald
Commits
4bbc2bc1
Commit
4bbc2bc1
authored
9 years ago
by
Tony Lindgren
Browse files
Options
Downloads
Plain Diff
Merge commit 'b8c93646fd5c' into omap-for-v4.3/fixes
parents
84ad1bab
b9c93646
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Documentation/devicetree/bindings/regulator/pbias-regulator.txt
+6
-1
6 additions, 1 deletion
...ntation/devicetree/bindings/regulator/pbias-regulator.txt
drivers/regulator/pbias-regulator.c
+50
-6
50 additions, 6 deletions
drivers/regulator/pbias-regulator.c
with
56 additions
and
7 deletions
Documentation/devicetree/bindings/regulator/pbias-regulator.txt
+
6
−
1
View file @
4bbc2bc1
...
...
@@ -2,7 +2,12 @@ PBIAS internal regulator for SD card dual voltage i/o pads on OMAP SoCs.
Required properties:
- compatible:
- "ti,pbias-omap" for OMAP2, OMAP3, OMAP4, OMAP5, DRA7.
- should be "ti,pbias-dra7" for DRA7
- should be "ti,pbias-omap2" for OMAP2
- should be "ti,pbias-omap3" for OMAP3
- should be "ti,pbias-omap4" for OMAP4
- should be "ti,pbias-omap5" for OMAP5
- "ti,pbias-omap" is deprecated
- reg: pbias register offset from syscon base and size of pbias register.
- syscon : phandle of the system control module
- regulator-name : should be
...
...
This diff is collapsed.
Click to expand it.
drivers/regulator/pbias-regulator.c
+
50
−
6
View file @
4bbc2bc1
...
...
@@ -45,6 +45,10 @@ struct pbias_regulator_data {
int
voltage
;
};
struct
pbias_of_data
{
unsigned
int
offset
;
};
static
const
unsigned
int
pbias_volt_table
[]
=
{
1800000
,
3000000
...
...
@@ -102,8 +106,35 @@ static struct of_regulator_match pbias_matches[] = {
};
#define PBIAS_NUM_REGS ARRAY_SIZE(pbias_matches)
/* Offset from SCM general area (and syscon) base */
static
const
struct
pbias_of_data
pbias_of_data_omap2
=
{
.
offset
=
0x230
,
};
static
const
struct
pbias_of_data
pbias_of_data_omap3
=
{
.
offset
=
0x2b0
,
};
static
const
struct
pbias_of_data
pbias_of_data_omap4
=
{
.
offset
=
0x60
,
};
static
const
struct
pbias_of_data
pbias_of_data_omap5
=
{
.
offset
=
0x60
,
};
static
const
struct
pbias_of_data
pbias_of_data_dra7
=
{
.
offset
=
0xe00
,
};
static
const
struct
of_device_id
pbias_of_match
[]
=
{
{
.
compatible
=
"ti,pbias-omap"
,
},
{
.
compatible
=
"ti,pbias-omap2"
,
.
data
=
&
pbias_of_data_omap2
,
},
{
.
compatible
=
"ti,pbias-omap3"
,
.
data
=
&
pbias_of_data_omap3
,
},
{
.
compatible
=
"ti,pbias-omap4"
,
.
data
=
&
pbias_of_data_omap4
,
},
{
.
compatible
=
"ti,pbias-omap5"
,
.
data
=
&
pbias_of_data_omap5
,
},
{
.
compatible
=
"ti,pbias-dra7"
,
.
data
=
&
pbias_of_data_dra7
,
},
{},
};
MODULE_DEVICE_TABLE
(
of
,
pbias_of_match
);
...
...
@@ -118,6 +149,9 @@ static int pbias_regulator_probe(struct platform_device *pdev)
const
struct
pbias_reg_info
*
info
;
int
ret
=
0
;
int
count
,
idx
,
data_idx
=
0
;
const
struct
of_device_id
*
match
;
const
struct
pbias_of_data
*
data
;
unsigned
int
offset
;
count
=
of_regulator_match
(
&
pdev
->
dev
,
np
,
pbias_matches
,
PBIAS_NUM_REGS
);
...
...
@@ -133,6 +167,20 @@ static int pbias_regulator_probe(struct platform_device *pdev)
if
(
IS_ERR
(
syscon
))
return
PTR_ERR
(
syscon
);
match
=
of_match_device
(
of_match_ptr
(
pbias_of_match
),
&
pdev
->
dev
);
if
(
match
&&
match
->
data
)
{
data
=
match
->
data
;
offset
=
data
->
offset
;
}
else
{
res
=
platform_get_resource
(
pdev
,
IORESOURCE_MEM
,
0
);
if
(
!
res
)
return
-
EINVAL
;
offset
=
res
->
start
;
dev_WARN
(
&
pdev
->
dev
,
"using legacy dt data for pbias offset
\n
"
);
}
cfg
.
regmap
=
syscon
;
cfg
.
dev
=
&
pdev
->
dev
;
...
...
@@ -145,10 +193,6 @@ static int pbias_regulator_probe(struct platform_device *pdev)
if
(
!
info
)
return
-
ENODEV
;
res
=
platform_get_resource
(
pdev
,
IORESOURCE_MEM
,
0
);
if
(
!
res
)
return
-
EINVAL
;
drvdata
[
data_idx
].
syscon
=
syscon
;
drvdata
[
data_idx
].
info
=
info
;
drvdata
[
data_idx
].
desc
.
name
=
info
->
name
;
...
...
@@ -158,9 +202,9 @@ static int pbias_regulator_probe(struct platform_device *pdev)
drvdata
[
data_idx
].
desc
.
volt_table
=
pbias_volt_table
;
drvdata
[
data_idx
].
desc
.
n_voltages
=
2
;
drvdata
[
data_idx
].
desc
.
enable_time
=
info
->
enable_time
;
drvdata
[
data_idx
].
desc
.
vsel_reg
=
res
->
star
t
;
drvdata
[
data_idx
].
desc
.
vsel_reg
=
offse
t
;
drvdata
[
data_idx
].
desc
.
vsel_mask
=
info
->
vmode
;
drvdata
[
data_idx
].
desc
.
enable_reg
=
res
->
star
t
;
drvdata
[
data_idx
].
desc
.
enable_reg
=
offse
t
;
drvdata
[
data_idx
].
desc
.
enable_mask
=
info
->
enable_mask
;
drvdata
[
data_idx
].
desc
.
enable_val
=
info
->
enable
;
drvdata
[
data_idx
].
desc
.
disable_val
=
info
->
disable_val
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment