Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drivers for NXP SC18IS604 SPI to I2C/GPIO bridge #249

Merged
merged 7 commits into from
Jul 27, 2024
Merged

Conversation

Irockasingranite
Copy link
Contributor

Adds drivers for the NXP SC18IS604 MFD, which provides an I2C bus and several (interrupt-less) GPIOs pins over SPI.

Closes #247.

Copy link

github-actions bot commented Jul 9, 2024

You can find the documentation preview for this PR at this link. It will be updated about 10 minutes after the documentation build succeeds.

Note: This comment is automatically posted by the Documentation Publishing GitHub Action.

Copy link
Contributor

@tobiaskaestner tobiaskaestner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we add a simple sample or implement our version of the all drivers test case that exists upstream?

@rexut rexut self-assigned this Jul 25, 2024
@rexut
Copy link
Member

rexut commented Jul 25, 2024

Could we add a simple sample or implement our version of the all drivers test case that exists upstream?

I'll add this, good idea.

Also I'll define a merge order in relation to the other outstanding PR #248:

  1. first merge: this PR Drivers for NXP SC18IS604 SPI to I2C/GPIO bridge #249
  2. second merge (then rebased to the first one): the other PR Drivers for NXP SC16IS75x I2C/SPI to UART/GPIO bridges #248

Irockasingranite and others added 7 commits July 27, 2024 20:08
This driver manages the MFD pseudo-bus on which child devices can
be placed, and which itself is placed on an SPI bus. Child devices
can register their own callbacks for interrupt handling, which are
fired directly from the ISR context.

Asynchronous transfer functions are necessary for correct interrupt
handling of child devices in cases where that handling itself
required bus communication.

These functions are realized through a separate work queue per driver
instance, since the particular communication needs of the SC18IS604
(very large, but exact time frame delays during SPI transfers) make
it impossible to use asynchronous SPI transfers.

Signed-off-by: Sarah Renkhoff <[email protected]>
Signed-off-by: Stephan Linz <[email protected]>
This driver manages the GPIO controller part of an SC18IS604 MFD.
It doesn't provide interrupt functionality, since the SC18IS604
doesn't generate interrupt signals for changes on its GPIO pins.

Signed-off-by: Sarah Renkhoff <[email protected]>
Signed-off-by: Stephan Linz <[email protected]>
This driver manages the I2C controller part of an SC18IS604 MFD,
and 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]>
Signed-off-by: Stephan Linz <[email protected]>
Support the SC18IS604 chip on build all MFD driver test.

Signed-off-by: Stephan Linz <[email protected]>
Support the SC18IS604 chip on build all GPIO driver test.

Signed-off-by: Stephan Linz <[email protected]>
Support the SC18IS604 chip on build all I2C driver test.

Signed-off-by: Stephan Linz <[email protected]>
Add github issue resolved by the previous commits.

Signed-off-by: Sarah Renkhoff <[email protected]>
Signed-off-by: Stephan Linz <[email protected]>
@rexut rexut force-pushed the devel/nxp-sc18is604 branch from ad0f7ac to 8b08123 Compare July 27, 2024 18:16
@rexut rexut requested a review from tobiaskaestner July 27, 2024 19:35
Copy link
Member

@rexut rexut left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tobiaskaestner now, we use the Zephyr upstream tests for build all drivers.

Copy link
Contributor

@tobiaskaestner tobiaskaestner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm, many thanks

@rexut rexut merged commit 8b08123 into main Jul 27, 2024
12 checks passed
@rexut rexut deleted the devel/nxp-sc18is604 branch July 27, 2024 20:43
@rexut rexut added this to the v3.7.0 milestone Jul 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[HW] NXP SC18IS604 SPI to I2C bridge
3 participants