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
b94c820f
Commit
b94c820f
authored
Jan 07, 2015
by
Wolfram Sang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
i2c: cpm: make use of the new infrastructure for quirks
Signed-off-by:
Wolfram Sang
<
wsa@the-dreams.de
>
parent
994647db
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
11 deletions
+9
-11
drivers/i2c/busses/i2c-cpm.c
drivers/i2c/busses/i2c-cpm.c
+9
-11
No files found.
drivers/i2c/busses/i2c-cpm.c
View file @
b94c820f
...
...
@@ -308,22 +308,12 @@ static int cpm_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num)
struct
i2c_reg
__iomem
*
i2c_reg
=
cpm
->
i2c_reg
;
struct
i2c_ram
__iomem
*
i2c_ram
=
cpm
->
i2c_ram
;
struct
i2c_msg
*
pmsg
;
int
ret
,
i
;
int
ret
;
int
tptr
;
int
rptr
;
cbd_t
__iomem
*
tbdf
;
cbd_t
__iomem
*
rbdf
;
if
(
num
>
CPM_MAXBD
)
return
-
EINVAL
;
/* Check if we have any oversized READ requests */
for
(
i
=
0
;
i
<
num
;
i
++
)
{
pmsg
=
&
msgs
[
i
];
if
(
pmsg
->
len
>=
CPM_MAX_READ
)
return
-
EINVAL
;
}
/* Reset to use first buffer */
out_be16
(
&
i2c_ram
->
rbptr
,
in_be16
(
&
i2c_ram
->
rbase
));
out_be16
(
&
i2c_ram
->
tbptr
,
in_be16
(
&
i2c_ram
->
tbase
));
...
...
@@ -424,10 +414,18 @@ static const struct i2c_algorithm cpm_i2c_algo = {
.
functionality
=
cpm_i2c_func
,
};
/* CPM_MAX_READ is also limiting writes according to the code! */
static
struct
i2c_adapter_quirks
cpm_i2c_quirks
=
{
.
max_num_msgs
=
CPM_MAXBD
,
.
max_read_len
=
CPM_MAX_READ
,
.
max_write_len
=
CPM_MAX_READ
,
};
static
const
struct
i2c_adapter
cpm_ops
=
{
.
owner
=
THIS_MODULE
,
.
name
=
"i2c-cpm"
,
.
algo
=
&
cpm_i2c_algo
,
.
quirks
=
&
cpm_i2c_quirks
,
};
static
int
cpm_i2c_setup
(
struct
cpm_i2c
*
cpm
)
...
...
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