Skip to content

Commit e9ea97e

Browse files
XenuIsWatchingkartben
authored andcommitted
drivers: i3c: add synopsys designware i3c driver
Add synopsys designware i3c driver Signed-off-by: Ryan McClelland <[email protected]>
1 parent 846b468 commit e9ea97e

File tree

7 files changed

+2461
-0
lines changed

7 files changed

+2461
-0
lines changed

drivers/i3c/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,11 @@ zephyr_library_sources_ifdef(
5454
i3c_stm32.c
5555
)
5656

57+
zephyr_library_sources_ifdef(
58+
CONFIG_I3C_DW
59+
i3c_dw.c
60+
)
61+
5762
zephyr_library_sources_ifdef(
5863
CONFIG_I3C_TEST
5964
i3c_test.c

drivers/i3c/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ comment "Device Drivers"
182182
rsource "Kconfig.nxp"
183183
rsource "Kconfig.cdns"
184184
rsource "Kconfig.npcx"
185+
rsource "Kconfig.dw"
185186
rsource "Kconfig.test"
186187
rsource "Kconfig.stm32"
187188

drivers/i3c/Kconfig.dw

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Copyright (c) 2023 Meta Platforms, Inc. and its affiliates.
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
module = I3C_DW
6+
module-str = i3c-dw
7+
source "subsys/logging/Kconfig.template.log_config"
8+
9+
config I3C_DW
10+
bool "DW I3C support"
11+
select I3C_IBI_WORKQUEUE if I3C_USE_IBI
12+
depends on DT_HAS_SNPS_DESIGNWARE_I3C_ENABLED
13+
depends on CLOCK_CONTROL
14+
default y
15+
help
16+
Enable the Synopsys Designware I3C driver

drivers/i3c/i3c_common.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,24 @@ struct i3c_device_desc *i3c_dev_list_i3c_addr_find(const struct device *dev,
216216
return ret;
217217
}
218218

219+
struct i3c_device_desc *i3c_dev_list_i3c_static_addr_find(const struct device *dev,
220+
uint8_t addr)
221+
{
222+
struct i3c_device_desc *ret = NULL;
223+
struct i3c_device_desc *desc;
224+
225+
__ASSERT_NO_MSG(dev != NULL);
226+
227+
I3C_BUS_FOR_EACH_I3CDEV(dev, desc) {
228+
if (desc->static_addr == addr) {
229+
ret = desc;
230+
break;
231+
}
232+
}
233+
234+
return ret;
235+
}
236+
219237
struct i3c_i2c_device_desc *i3c_dev_list_i2c_addr_find(const struct device *dev,
220238
uint16_t addr)
221239
{

0 commit comments

Comments
 (0)