i2c: add support for the MT7621 I2C controller
authorJustin Swartz <justin.swartz@risingedge.co.za>
Mon, 27 Oct 2025 13:09:42 +0000 (15:09 +0200)
committerHeiko Schocher <hs@nabladev.com>
Tue, 28 Oct 2025 08:49:57 +0000 (09:49 +0100)
commit9ffbce80df0a70d4b636b6b1d2b9faf3728d556a
treea36afdeb385b9a4c098cacc94bf1b5789ee298c1
parent23987e10905146def3ab61e55ec912c6e742efdc
i2c: add support for the MT7621 I2C controller

This commit introduces a port of the Linux kernel's driver for the
Mediatek's MT7621 I2C controller.

The port was undertaken as the existing driver intended for Mediatek
I2C controllers (mtk_i2c.c) is not compatible with the MT7621.

To use the driver:

  1.  Ensure that the mode of the i2c pin group is
      configured for "i2c" rather than "gpio".

  2.  Delete the existing (bitbanged) i2c node from
      arch/mips/dts/mt7621.dtsi, or specify:

        /delete-node/ &i2c;

  3.  Declare:

        i2c: i2c@1e000900 {
                compatible = "mediatek,mt7621-i2c";
                reg = <0x1e000900 0x100>;

                clocks = <&clk50m>;
                clock-names = "sys_clock";

                resets = <&rstctrl RST_I2C>;
                reset-names = "i2c_reset";

                pinctrl-names = "default";
                pinctrl-0 = <&i2c_pins>;

                #address-cells = <1>;
                #size-cells = <0>;
                status = "okay";
        };

Signed-off-by: Justin Swartz <justin.swartz@risingedge.co.za>
Reviewed-by: Heiko Schocher <hs@nabladev.com>
drivers/i2c/Kconfig
drivers/i2c/Makefile
drivers/i2c/mt7621_i2c.c [new file with mode: 0644]