From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0ECC42FE04E for ; Sat, 11 Apr 2026 09:58:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=114.242.206.163 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775901526; cv=none; b=mdcjAGQFg1In+SCIdWP2FUL9oVGlC60PD4MPR9/bqbudfn+OKxSyOUzdVdPc31HL7aC8OJEScCXiA9gUlRztKwBJasdb81woogSukb2j5aW6PVm1zlV/3m8SoUPszsaDoRXGHPrWIzPMW6wSzkPA/5Mq9wblPPXxu0l3CmSXIZE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775901526; c=relaxed/simple; bh=IHAGdw1aVu7ekSu6b1/9p6ag+6/LvGrWHxRvxe4feeo=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=pbsDAOcP9MIxfmoGE6YggFQoLeWAm49MsqF+LTensH3Nm67N2yP+0TfZ/ijqjZDDVOQHpJCzEufO0/jNwhun8LQ34PIzpNeMznRD7Ui4nhxkFZW5S+ucDm/dBOTizcpZRruBTGR/NrTa0zJR+f9u0SOZIjGuRLS/blEwt62DC8U= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=loongson.cn; spf=pass smtp.mailfrom=loongson.cn; arc=none smtp.client-ip=114.242.206.163 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=loongson.cn Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=loongson.cn Received: from loongson.cn (unknown [223.64.68.17]) by gateway (Coremail) with SMTP id _____8BxFMFPG9ppDEYkAA--.53470S3; Sat, 11 Apr 2026 17:58:39 +0800 (CST) Received: from kernelserver (unknown [223.64.68.17]) by front1 (Coremail) with SMTP id qMiowJAxGMFLG9ppx_NqAA--.58577S2; Sat, 11 Apr 2026 17:58:37 +0800 (CST) From: Binbin Zhou To: Binbin Zhou , Huacai Chen , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Andi Shyti , Wolfram Sang , Andy Shevchenko , linux-i2c@vger.kernel.org Cc: Huacai Chen , Xuerui Wang , loongarch@lists.linux.dev, devicetree@vger.kernel.org, Binbin Zhou Subject: [PATCH v7 0/2] i2c: Add Loongson-2K0300 I2C controller support Date: Sat, 11 Apr 2026 17:58:23 +0800 Message-ID: X-Mailer: git-send-email 2.52.0 Precedence: bulk X-Mailing-List: loongarch@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID:qMiowJAxGMFLG9ppx_NqAA--.58577S2 X-CM-SenderInfo: p2kr3uplqex0o6or00hjvr0hdfq/1tbiAQEOCGnZ4sgBzgAAsT X-Coremail-Antispam: 1Uk129KBj93XoWxWF4DZw4fCr1DGF4xJry8tFc_yoW5Cr1kpa y5C39xKF1qgr12vrs3JFWrurySvayfJa1Sgr4xA34F9a1DZ3yUZ3ySkFs0vFWDArWxuF42 q39rKw10ka4DZFXCm3ZEXasCq-sJn29KB7ZKAUJUUUU8529EdanIXcx71UUUUU7KY7ZEXa sCq-sGcSsGvfJ3Ic02F40EFcxC0VAKzVAqx4xG6I80ebIjqfuFe4nvWSU5nxnvy29KBjDU 0xBIdaVrnRJUUUkjb4IE77IF4wAFF20E14v26r1j6r4UM7CY07I20VC2zVCF04k26cxKx2 IYs7xG6rWj6s0DM7CIcVAFz4kK6r106r15M28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48v e4kI8wA2z4x0Y4vE2Ix0cI8IcVAFwI0_Jr0_JF4l84ACjcxK6xIIjxv20xvEc7CjxVAFwI 0_Jr0_Gr1l84ACjcxK6I8E87Iv67AKxVW8JVWxJwA2z4x0Y4vEx4A2jsIEc7CjxVAFwI0_ Gr0_Gr1UM2AIxVAIcxkEcVAq07x20xvEncxIr21l57IF6xkI12xvs2x26I8E6xACxx1l5I 8CrVACY4xI64kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v26r1j6r18McIj6I8E87Iv67AK xVWUJVW8JwAm72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IYc2Ij64vIr41l42xK82IYc2Ij64 vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1lx2IqxVAqx4xG67AKxVWUJVWUGwC20s026x8G jcxK67AKxVWUGVWUWwC2zVAF1VAY17CE14v26r1q6r43MIIYrxkI7VAKI48JMIIF0xvE2I x0cI8IcVAFwI0_Jr0_JF4lIxAIcVC0I7IYx2IY6xkF7I0E14v26r1j6r4UMIIF0xvE42xK 8VAvwI8IcIk0rVWUJVWUCwCI42IY6I8E87Iv67AKxVWUJVW8JwCI42IY6I8E87Iv6xkF7I 0E14v26r1j6r4UYxBIdaVFxhVjvjDU0xZFpf9x07j8yCJUUUUU= Hi all: This patch set describes the I2C controller integrated the Loongson-2K0300 chip. It has a significantly different design from the previous I2C controller(i2c-ls2x), such as support for master-slave transfer mode, and DMA transfers (implementation in progress), etc. Therefore, we try to name it i2c-ls2x-v2. Thanks. ====== V7: - Add Reviewed-by tag from Huacai & Andy, thanks. Patch (2/2): - Add the REGMAP_MMIO Kconfig dependency; - parent_rate_MHz -> parent_rate_mhz to avoid CamelCase. Link to V6: https://lore.kernel.org/all/cover.1773991081.git.zhoubinbin@loongson.cn/ V6: - Rebase on linux-i2c/i2c-next; Patch (2/2): - Update comment; - Use regmap_get_device(); Link to V5: https://lore.kernel.org/all/cover.1773142933.git.zhoubinbin@loongson.cn/ V5: - Rebase on linux-i2c/i2c-next; Patch (2/2): - Add time.h header file; - Add the `MHz` suffix to `parent_rate` and `freq`; - Define an iterator within the for loop, with its type being `unsigned int`; - Use dev_err_probe() in loongson2_i2c_adjust_bus_speed(); - i2c_adapter_set_node()->device_set_node(). Link to V4: https://lore.kernel.org/all/cover.1772714348.git.zhoubinbin@loongson.cn/ V4: - Rebase on linux-i2c/i2c-next; Patch (2/2): - The parent_rate parameter type should be `unsigned long`; - Drop fallthrough and add missing break; - device_set_node()->i2c_adapter_set_node(); - Use i2c_parse_fw_timings(); - Use i2c_t.bus_freq_hz instead of priv->speed; - Sperate loongson2_i2c_handle_read() into loongson2_i2c_handle_read() and loongson2_i2c_handle_rx_done(). Link to V3: https://lore.kernel.org/all/cover.1772001073.git.zhoubinbin@loongson.cn/ V3: - Rebase on linux-i2c/i2c-next; Patch (2/2): - Reorder header file follow IWYU principle; - Better indentation and coding style; - Use generic macro definitions; - Amend *all* struct data types; - Correct unreasonable variable type definitions; - Refact loongson2_i2c_isr_error(); - of_property_read_u32()->device_property_read_u32(); - Remove meaningless blank lines and output. Link to V2: https://lore.kernel.org/all/cover.1769476820.git.zhoubinbin@loongson.cn/ V2: Patch (1/2): - Add Acked-by tag from Conor, thanks. Patch (2/2): - Reorder the definitions of read() and write(); - Adjust the calculation method for bus speed. Link to V1: https://lore.kernel.org/all/cover.1763018288.git.zhoubinbin@loongson.cn/ Binbin Zhou (2): dt-bindings: i2c: loongson,ls2x: Add ls2k0300-i2c compatible i2c: ls2x-v2: Add driver for Loongson-2K0300 I2C controller .../bindings/i2c/loongson,ls2x-i2c.yaml | 4 + MAINTAINERS | 1 + drivers/i2c/busses/Kconfig | 11 + drivers/i2c/busses/Makefile | 1 + drivers/i2c/busses/i2c-ls2x-v2.c | 544 ++++++++++++++++++ 5 files changed, 561 insertions(+) create mode 100644 drivers/i2c/busses/i2c-ls2x-v2.c base-commit: 8fc326e15895c9f0403e6243dd4ad468b10aab3d -- 2.52.0