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
e0c7800a
Commit
e0c7800a
authored
Nov 14, 2022
by
Wolfram Sang
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'i2c/client_device_id_helper-immutable' into i2c/for-mergewindow
parents
e826192c
66223373
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
0 deletions
+15
-0
drivers/i2c/i2c-core-base.c
drivers/i2c/i2c-core-base.c
+14
-0
include/linux/i2c.h
include/linux/i2c.h
+1
-0
No files found.
drivers/i2c/i2c-core-base.c
View file @
e0c7800a
...
...
@@ -2236,6 +2236,20 @@ int i2c_get_device_id(const struct i2c_client *client,
}
EXPORT_SYMBOL_GPL
(
i2c_get_device_id
);
/**
* i2c_client_get_device_id - get the driver match table entry of a device
* @client: the device to query. The device must be bound to a driver
*
* Returns a pointer to the matching entry if found, NULL otherwise.
*/
const
struct
i2c_device_id
*
i2c_client_get_device_id
(
const
struct
i2c_client
*
client
)
{
const
struct
i2c_driver
*
drv
=
to_i2c_driver
(
client
->
dev
.
driver
);
return
i2c_match_id
(
drv
->
id_table
,
client
);
}
EXPORT_SYMBOL_GPL
(
i2c_client_get_device_id
);
/* ----------------------------------------------------
* the i2c address scanning function
* Will not work for 10-bit addresses!
...
...
include/linux/i2c.h
View file @
e0c7800a
...
...
@@ -189,6 +189,7 @@ s32 i2c_smbus_read_i2c_block_data_or_emulated(const struct i2c_client *client,
u8
*
values
);
int
i2c_get_device_id
(
const
struct
i2c_client
*
client
,
struct
i2c_device_identity
*
id
);
const
struct
i2c_device_id
*
i2c_client_get_device_id
(
const
struct
i2c_client
*
client
);
#endif
/* I2C */
/**
...
...
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