-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
drivers: Add driver for SC18IS604 I2C controller
This driver relies on the asynchronous transfer functions provided by the MFD driver to handle interrupts through non-blocking system work queue items. The asynchronous API function is implemented via fully non-blocking work items running on the system work queue. Tracking each in-flight transfer requires ~100 bytes of heap allocation, so the driver requests some heap space by default. Signed-off-by: Sarah Renkhoff <[email protected]>
- Loading branch information
1 parent
a2dd05f
commit 1f29cd0
Showing
10 changed files
with
951 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Copyright (c) 2024 TiaC Systems | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
# Add to the existing i2c library from zephyr instead of defining our own. | ||
# It is actually required to add I2C drivers to that library, otherwise | ||
# build errors can occur! | ||
zephyr_library_amend() | ||
|
||
zephyr_library_sources_ifdef(CONFIG_I2C_SC18IS604 i2c_sc18is604.c) | ||
zephyr_library_sources_ifdef(CONFIG_I2C_CALLBACK i2c_sc18is604_callback.c) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Copyright (c) 2024 TiaC Systems | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
if I2C | ||
|
||
rsource "Kconfig.sc18is604" | ||
|
||
endif # I2C |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Copyright (c) 2024 TiaC Systems | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
menuconfig I2C_SC18IS604 | ||
bool "I2C controller part of an SC18IM604 bridge" | ||
default y | ||
depends on DT_HAS_NXP_SC18IS604_I2C_ENABLED | ||
depends on MFD_SC18IS604 | ||
select MFD_SC18IS604_ASYNC | ||
select POLL # dependency of MFD_SC18IS604_ASYNC | ||
select DYNAMIC_THREAD # dependency of MFD_SC18IS604_ASYNC | ||
select THREAD_STACK_INFO # dependency of DYNAMIC_THREAD | ||
help | ||
Enable driver for I2C controller part of an SC18IM604 bridge. | ||
|
||
config I2C_SC18IS604_INIT_PRIORITY | ||
int "Init priority" | ||
default 60 | ||
depends on I2C_SC18IS604 | ||
help | ||
Device driver initialization priority. | ||
|
||
if I2C_CALLBACK | ||
|
||
config HEAP_MEM_POOL_ADD_SIZE_I2C_SC18IS604 | ||
int | ||
default 512 # Enough for 5 in-flight async transfers | ||
|
||
endif |
Oops, something went wrong.