Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
reform-boundary-uboot
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
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
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
Jack Humbert
reform-boundary-uboot
Commits
8c8dc4c6
Commit
8c8dc4c6
authored
10 years ago
by
Tom Rini
Browse files
Options
Downloads
Plain Diff
Merge branch 'master' of
git://git.denx.de/u-boot-i2c
parents
d283a570
f582a158
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
drivers/i2c/mv_i2c.c
+1
-1
1 addition, 1 deletion
drivers/i2c/mv_i2c.c
drivers/i2c/mvtwsi.c
+9
-8
9 additions, 8 deletions
drivers/i2c/mvtwsi.c
with
10 additions
and
9 deletions
drivers/i2c/mv_i2c.c
+
1
−
1
View file @
8c8dc4c6
...
...
@@ -73,7 +73,7 @@ static void i2c_board_init(struct mv_i2c *base)
}
#ifdef CONFIG_I2C_MULTI_BUS
static
u
32
i2c_regs
[
CONFIG_MV_I2C_NUM
]
=
CONFIG_MV_I2C_REG
;
static
u
nsigned
long
i2c_regs
[
CONFIG_MV_I2C_NUM
]
=
CONFIG_MV_I2C_REG
;
static
unsigned
int
bus_initialized
[
CONFIG_MV_I2C_NUM
];
static
unsigned
int
current_bus
;
...
...
This diff is collapsed.
Click to expand it.
drivers/i2c/mvtwsi.c
+
9
−
8
View file @
8c8dc4c6
...
...
@@ -228,13 +228,14 @@ static int twsi_stop(int status)
return
status
;
}
/*
* Ugly formula to convert m and n values to a frequency comes from
* TWSI specifications
*/
#define TWSI_FREQUENCY(m, n) \
(CONFIG_SYS_TCLK / (10 * (m + 1) * (1 << n)))
static
unsigned
int
twsi_calc_freq
(
const
int
n
,
const
int
m
)
{
#ifdef CONFIG_SUNXI
return
CONFIG_SYS_TCLK
/
(
10
*
(
m
+
1
)
*
(
1
<<
n
));
#else
return
CONFIG_SYS_TCLK
/
(
10
*
(
m
+
1
)
*
(
2
<<
n
));
#endif
}
/*
* Reset controller.
...
...
@@ -266,7 +267,7 @@ static unsigned int twsi_i2c_set_bus_speed(struct i2c_adapter *adap,
/* compute m, n setting for highest speed not above requested speed */
for
(
n
=
0
;
n
<
8
;
n
++
)
{
for
(
m
=
0
;
m
<
16
;
m
++
)
{
tmp_speed
=
TWSI_FREQUENCY
(
m
,
n
);
tmp_speed
=
twsi_calc_freq
(
n
,
m
);
if
((
tmp_speed
<=
requested_speed
)
&&
(
tmp_speed
>
highest_speed
))
{
highest_speed
=
tmp_speed
;
...
...
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