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 SC16IS75x I2C/SPI to UART/GPIO bridges #248

Merged
merged 11 commits into from
Jul 28, 2024
Merged

Conversation

Irockasingranite
Copy link
Contributor

Adds drivers for the NXP SC16IS75x series MFDs, which provide one or more UART channels and several GPIO pins over either I2C or SPI.

Closes #246.

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.

@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?

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

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

@rexut rexut self-assigned this Jul 25, 2024
@rexut rexut force-pushed the devel/nxp-sc16is75x branch from 01e20bc to 3eec8ec Compare July 27, 2024 14:35
@rexut rexut marked this pull request as draft July 27, 2024 14:36
This driver manages the MFD pseudo-bus on which child devices can
be placed, and which itself is placed on either an SPI or I2C bus.

The number of and ids of channels on a given bridge are determined
at build time based on devicetree information.

Most bus communication is performed using blocking calls, but to
perform interrupt handling some non-blocking bus operations are
needed. If the underlying bus supports asynchronous/callback based
APIs, these are utilized. Otherwise, each driver instance creates
a separate work queue for offloading bus transfers without blocking
the system work queue.

Signed-off-by: Sarah Renkhoff <[email protected]>
Signed-off-by: Stephan Linz <[email protected]>
This driver manages the GPIO controller part of an SC16IS75x MFD.
Interrupts are ultimately handled by the parent MFD, which requires
enabling non-blocking bus transfers (i.e. potentially an additional
work queue thread).

Signed-off-by: Sarah Renkhoff <[email protected]>
Signed-off-by: Stephan Linz <[email protected]>
This driver manages the UART controller part of an SC16IS75x MFD,
for a specific UART channel. Using the interrupt driven UART API
required interrupt handling on the parent MFD, which may require
an additional work queue thread to perform non-blocking bus
transfers.

Signed-off-by: Sarah Renkhoff <[email protected]>
Signed-off-by: Stephan Linz <[email protected]>
@rexut rexut marked this pull request as ready for review July 27, 2024 20:42
rexut and others added 8 commits July 27, 2024 22:44
Warning was:

  /test/w1@66660000: unnecessary #address-cells/#size-cells
  without "ranges" or child "reg" property

  /test/w1@66660000:ranges: empty "ranges" property
  but its #size-cells (0) differs from /test (1)

  /test/i2c@11112222/lis2dux12@8a: duplicate unit-address
  (also used in node /test/i2c@11112222/iis328dq@8a)

Signed-off-by: Stephan Linz <[email protected]>
Warning was:

  tstdrv-bldall-display-adj.overlay:

    unit address and first address in 'reg' (0xa)
    don't match for /test/test_mipi_dbi_adj/ili9342c@10

    unit address and first address in 'reg' (0x14)
    don't match for /test/test_mipi_dbi_xfr_16bit_adj/ili9342c@20

  tstdrv-bldall-i2c-adj.overlay:
  tstdrv-bldall-rtc-adj.overlay:
  tstdrv-bldall-uart-adj.overlay:

    unit address and first address in 'reg' (0xccccdddd)
    don't match for /test/spi@bbbbcccc

Signed-off-by: Stephan Linz <[email protected]>
Now all 'test_uart_adj' nodes located at 0xeeeeffff.

Signed-off-by: Stephan Linz <[email protected]>
- 'test_i3c_adj: i3c@bbbbaaaa {};' for I3C devices
- 'test_w1_adj: w1@ffffeeee {};' for One-Wire (W1) devices

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

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

Signed-off-by: Stephan Linz <[email protected]>
Support the SC16IS75x chip series on build all UART 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-sc16is75x branch from 3eec8ec to cceda75 Compare July 27, 2024 20:45
@rexut rexut requested a review from tobiaskaestner July 27, 2024 20:46
@rexut
Copy link
Member

rexut commented Jul 27, 2024

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

@rexut rexut added this to the v3.7.0 milestone Jul 27, 2024
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.

LGTM.

@rexut rexut merged commit cceda75 into main Jul 28, 2024
12 checks passed
@rexut rexut deleted the devel/nxp-sc16is75x branch July 28, 2024 05:09
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 SC16IS75x series I2C/SPI to UART/GPIO bridge
2 participants