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
Kirill Smelkov
linux
Commits
3aef6649
Commit
3aef6649
authored
Feb 16, 2016
by
Michael Turquette
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'clk-bcm2835' into clk-next
parents
70750ff2
79c1e2fc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
16 deletions
+9
-16
drivers/clk/bcm/clk-bcm2835.c
drivers/clk/bcm/clk-bcm2835.c
+9
-16
No files found.
drivers/clk/bcm/clk-bcm2835.c
View file @
3aef6649
...
@@ -1060,16 +1060,7 @@ static long bcm2835_pll_divider_round_rate(struct clk_hw *hw,
...
@@ -1060,16 +1060,7 @@ static long bcm2835_pll_divider_round_rate(struct clk_hw *hw,
static
unsigned
long
bcm2835_pll_divider_get_rate
(
struct
clk_hw
*
hw
,
static
unsigned
long
bcm2835_pll_divider_get_rate
(
struct
clk_hw
*
hw
,
unsigned
long
parent_rate
)
unsigned
long
parent_rate
)
{
{
struct
bcm2835_pll_divider
*
divider
=
bcm2835_pll_divider_from_hw
(
hw
);
return
clk_divider_ops
.
recalc_rate
(
hw
,
parent_rate
);
struct
bcm2835_cprman
*
cprman
=
divider
->
cprman
;
const
struct
bcm2835_pll_divider_data
*
data
=
divider
->
data
;
u32
div
=
cprman_read
(
cprman
,
data
->
a2w_reg
);
div
&=
(
1
<<
A2W_PLL_DIV_BITS
)
-
1
;
if
(
div
==
0
)
div
=
256
;
return
parent_rate
/
div
;
}
}
static
void
bcm2835_pll_divider_off
(
struct
clk_hw
*
hw
)
static
void
bcm2835_pll_divider_off
(
struct
clk_hw
*
hw
)
...
@@ -1107,13 +1098,15 @@ static int bcm2835_pll_divider_set_rate(struct clk_hw *hw,
...
@@ -1107,13 +1098,15 @@ static int bcm2835_pll_divider_set_rate(struct clk_hw *hw,
struct
bcm2835_pll_divider
*
divider
=
bcm2835_pll_divider_from_hw
(
hw
);
struct
bcm2835_pll_divider
*
divider
=
bcm2835_pll_divider_from_hw
(
hw
);
struct
bcm2835_cprman
*
cprman
=
divider
->
cprman
;
struct
bcm2835_cprman
*
cprman
=
divider
->
cprman
;
const
struct
bcm2835_pll_divider_data
*
data
=
divider
->
data
;
const
struct
bcm2835_pll_divider_data
*
data
=
divider
->
data
;
u32
cm
;
u32
cm
,
div
,
max_div
=
1
<<
A2W_PLL_DIV_BITS
;
int
ret
;
ret
=
clk_divider_ops
.
set_rate
(
hw
,
rate
,
parent_rate
);
div
=
DIV_ROUND_UP_ULL
(
parent_rate
,
rate
);
if
(
ret
)
return
ret
;
div
=
min
(
div
,
max_div
);
if
(
div
==
max_div
)
div
=
0
;
cprman_write
(
cprman
,
data
->
a2w_reg
,
div
);
cm
=
cprman_read
(
cprman
,
data
->
cm_reg
);
cm
=
cprman_read
(
cprman
,
data
->
cm_reg
);
cprman_write
(
cprman
,
data
->
cm_reg
,
cm
|
data
->
load_mask
);
cprman_write
(
cprman
,
data
->
cm_reg
,
cm
|
data
->
load_mask
);
cprman_write
(
cprman
,
data
->
cm_reg
,
cm
&
~
data
->
load_mask
);
cprman_write
(
cprman
,
data
->
cm_reg
,
cm
&
~
data
->
load_mask
);
...
@@ -1428,7 +1421,7 @@ bcm2835_register_pll_divider(struct bcm2835_cprman *cprman,
...
@@ -1428,7 +1421,7 @@ bcm2835_register_pll_divider(struct bcm2835_cprman *cprman,
divider
->
div
.
reg
=
cprman
->
regs
+
data
->
a2w_reg
;
divider
->
div
.
reg
=
cprman
->
regs
+
data
->
a2w_reg
;
divider
->
div
.
shift
=
A2W_PLL_DIV_SHIFT
;
divider
->
div
.
shift
=
A2W_PLL_DIV_SHIFT
;
divider
->
div
.
width
=
A2W_PLL_DIV_BITS
;
divider
->
div
.
width
=
A2W_PLL_DIV_BITS
;
divider
->
div
.
flags
=
0
;
divider
->
div
.
flags
=
CLK_DIVIDER_MAX_AT_ZERO
;
divider
->
div
.
lock
=
&
cprman
->
regs_lock
;
divider
->
div
.
lock
=
&
cprman
->
regs_lock
;
divider
->
div
.
hw
.
init
=
&
init
;
divider
->
div
.
hw
.
init
=
&
init
;
divider
->
div
.
table
=
NULL
;
divider
->
div
.
table
=
NULL
;
...
...
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