File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ use crate::{
9
9
device:: RawDevice ,
10
10
driver:: { self , RawDeviceId } ,
11
11
error:: { from_result, to_result, Result } ,
12
+ of,
12
13
str:: { BStr , CStr } ,
13
14
types:: ForeignOwnable ,
14
15
ThisModule ,
@@ -106,6 +107,9 @@ impl<T: Driver> driver::DriverOps for Adapter<T> {
106
107
if let Some ( t) = T :: I2C_DEVICE_ID_TABLE {
107
108
i2cdrv. id_table = t. as_ref ( ) ;
108
109
}
110
+ if let Some ( t) = T :: OF_DEVICE_ID_TABLE {
111
+ i2cdrv. driver . of_match_table = t. as_ref ( ) ;
112
+ }
109
113
110
114
// SAFETY:
111
115
// - `pdrv` lives at least until the call to `platform_driver_unregister()` returns.
@@ -169,6 +173,9 @@ pub trait Driver {
169
173
/// The table of device ids supported by the driver.
170
174
const I2C_DEVICE_ID_TABLE : Option < driver:: IdTable < ' static , DeviceId , Self :: IdInfo > > = None ;
171
175
176
+ /// The table of device ids supported by the driver.
177
+ const OF_DEVICE_ID_TABLE : Option < driver:: IdTable < ' static , of:: DeviceId , Self :: IdInfo > > = None ;
178
+
172
179
/// I2C driver probe.
173
180
///
174
181
/// Called when a new i2c client is added or discovered.
You can’t perform that action at this time.
0 commit comments