[PATCH v9 0/3] i2c: Add Novatek NT72676 SoC I2C controller
From: nina_kuo
Date: Wed Sep 09 2026 - 23:07:46 EST
From: Ben Huang <Ben_Huang@xxxxxxxxxxxxxx>
This patch series adds support for the I2C bus controllers on
Novatek NT72676 SoC. The SoC contains generic I2C controllers and
STBC I2C controllers. These controllers share the same register
layout and transfer programming model, and use the same compatible
string.
The characteristics of these controllers are listed below:
- Generic I2C controller
- Accessible only by the host CPU
- Driven by a 96 MHz AHB clock
- STBC I2C controller
- Driven by a 12 MHz clock from STBC (Standby controller)
- Requires STBC authentication and ownership switch before CPU
access
- Identified by the novatek,stbc-syscon property
The driver supports single-message read and write transfers and combined
write-then-read transfers using the hardware subaddress feature. Both
Standard-mode and Fast-mode operation are supported.
The controller input clocks are fixed by the SoC integration. Since
there is currently no NT72676-specific clock-controller driver, the
input clocks are represented by generic fixed-clock providers. The
driver uses the common clock framework to obtain the input clock rate
and calculate the I2C bus clock divider.
This series was tested with concurrent I2C read/write operations on
two I2C buses for 1,000,000 iterations on NT72676 SoC.
No errors or data corruption were observed.
---
v9:
From Rob's review of novatek,nt72676-i2c.yaml in PATCH 1/3 and
i2c-nt72676.c and Kconfig in PATCH 2/3:
- Use the same compatible string for generic and STBC I2C controllers
- Use generic fixed-clock providers
From Sashiko AI's review:
- Reduce log
v8:
https://lore.kernel.org/lkml/20260902091318.208074-1-nina_kuo@xxxxxxxxxxxxxx/T/#t
From Sashiko AI's review of i2c-nt72676.c in PATCH 2/3:
- Modify the flow of checking the sub-address pattern for 2-message
transfer
- Modify the quirk for the hardware limitation of NT72676 I2C
- Remove IRQF_TRIGGER_HIGH in IRQ request
From internal review of i2c-nt72676.c:
- Remove unused IRQ flags
- Fix potential issue of NULL deference
v7:
https://lore.kernel.org/lkml/20260811073031.1019576-1-nina_kuo@xxxxxxxxxxxxxx/T/#t
From Sashiko AI's review of i2c-nt72676.c in PATCH 2/3:
- Modify the flow of checking the sub-address pattern for 2-message
transfer and the control to I2C_REG_CTRL and I2C_REG_SUBADDR
- Add NULL checking of i2c->comp_data
- IRQ will be enabled only before read/write operation
- Add spin lock protection to msg_complete
- Use regmap_update_bits() instead to control the STBC syscon
registers
- Advertise the I2C_AQ_NO_ZERO_LEN quirk
v6:
https://lore.kernel.org/lkml/20260806035632.777782-1-nina_kuo@xxxxxxxxxxxxxx/T/#t
- Add a Reviewed-by tag to PATCH 1/3, where novatek,nt72676-i2c.yaml
is not changed
- From Sashiko AI's review of i2c-nt72676.c in PATCH 2/3:
- Fix potential interrupt storm in the IRQ handler
- Add IRQ handling for I2C_IRQ_CLK_STR_TIMEOUT interrupt
- Add a spinlock for the synchronization of current_msg and
interrupt register control
- Check the first message type is a sub-address write and with the
maximum length of 4 bytes (32 bits)
- Interrupt registers would be cleared if failed to
i2c_add_adapter()
- Move i2c_del_adapter() before disabling I2C controller
v5:
https://lore.kernel.org/lkml/20260804033419.693819-1-nina_kuo@xxxxxxxxxxxxxx/T/#t
From Krzysztof's review:
- In novatek,nt72676-i2c.yaml:
- Remove '|' in description
- Add `clock` property
From internal review:
- In i2c-nt72676.c:
- Use dev_err_probe() for errors in probing
- Modify coding styles
v4:
https://lore.kernel.org/lkml/20260730072529.492398-1-nina_kuo@xxxxxxxxxxxxxx/T/#t
From Krzysztof's review:
- Replace all occurrences of "726xx" with "72676"
- Reorganize the patch series
- In novatek,nt72676-i2c.yaml:
- Correct the order of entries
- Change the compatible string of generic I2C to
"novatek,nt72676-i2c"
- Add the compatible string of STBC I2C as
"novatek,nt72676-stbc-i2c"
- Remove `novatek,hwmods` custom property
- In i2c-nt72676.c:
- Use dev_err() and dev_info() for driver messages
- Remove unnecessary logs
- Add different compatible data to "novatek,nt72676-i2c" and
"novatek,nt72676-stbc-i2c"
- Replace platform_get_resource() and devm_ioremap_resource() with
devm_platform_ioremap_resource()
- Remove definition of owner under nvt_i2c_driver
- Register this driver with module_platform_driver()
From internal review:
- Modify commit messages
- In novatek,nt72676-i2c.yaml:
- Add description about the I2C controllers on Novatek NT72676 SoC
- Add `novatek,stbc-syscon` custom property for STBC authentication
- Modify the examples for generic I2C and STBC I2C
- In i2c-nt72676.c:
- Add nt72676_i2c_writel() and nt72676_i2c_readl() wrappers for
register access
- Modify definitions of the I2C registers for both generic I2C and
STBC I2C use
- Use BIT() and GENMASK() for register bit definitions
- Use regmap to access STBC syscon registers for authentication
before CPU access
v3:
https://lore.kernel.org/lkml/20260715073443.147490-1-Nina_Kuo@xxxxxxxxxxxxxx/T/#t
- Only remove attached HTML messages, no code is modified.
v2:
https://lore.kernel.org/lkml/20260714094145.84387-1-Nina_Kuo@xxxxxxxxxxxxxx/T/#t
From Krzysztof's review of novatek,nt726xx-i2c.yaml:
- Explicitly specify the unique compatibles "novatek,nt72600-i2c" for
Novatek NT726xx SoCs
- Modify `maxItems` as 1 for both `reg` and `interrupts` properties
- Modify description and allowed values for `clock-frequency`
property
- Remove `minItems` for `novatek,hwmods` custom property
- Rename, fix wrong type definition and add more description for
`novatek,stbc-controllable` custom property
- Remove `bus-enable` custom property
- Add an example for dtsi declaration
From Sashiko AI's review of i2c-nt726xx.c:
- Remove flows related to `bus-enable` custom property
- Add default value 100000 (100 kHz) of `clock-frequency` property
to prevent from divide-by-zero panic
- Add flows for handling ioremap() in nvt_i2c_use_case_feature()
- Remove I2C_FUNC_SMBUS_QUICK functionality due to unsupported handling
of 0-byte messages
- Add flows of disabling IRQs in nvt_i2c_suspend() and nvt_i2c_remove()
- Add of_node_get() to release the reference to device tree node in
nvt_i2c_remove()
v1:
https://lore.kernel.org/lkml/20260604060411.355675-1-SP_ISW1_AT@xxxxxxxxxxxxxx/T/#t
Signed-off-by: Ben Huang <Ben_Huang@xxxxxxxxxxxxxx>
Signed-off-by: Nina Kuo <Nina_Kuo@xxxxxxxxxxxxxx>
Ben Huang (3):
dt-bindings: i2c: Add Novatek NT72676 I2C controller
i2c: nt72676: Add Novatek NT72676 I2C controller driver
MAINTAINERS: Add entry for Novatek NT72676 I2C controller driver
.../bindings/i2c/novatek,nt72676-i2c.yaml | 76 ++
MAINTAINERS | 7 +
drivers/i2c/busses/Kconfig | 11 +
drivers/i2c/busses/Makefile | 1 +
drivers/i2c/busses/i2c-nt72676.c | 725 ++++++++++++++++++
5 files changed, 820 insertions(+)
create mode 100644 Documentation/devicetree/bindings/i2c/novatek,nt72676-i2c.yaml
create mode 100644 drivers/i2c/busses/i2c-nt72676.c
--
2.40.1