From patchwork Thu Sep 22 11:39:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Binbin Zhou X-Patchwork-Id: 608466 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E7FABC54EE9 for ; Thu, 22 Sep 2022 11:41:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229901AbiIVLl3 (ORCPT ); Thu, 22 Sep 2022 07:41:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44340 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229762AbiIVLl3 (ORCPT ); Thu, 22 Sep 2022 07:41:29 -0400 Received: from loongson.cn (mail.loongson.cn [114.242.206.163]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 66997D690E; Thu, 22 Sep 2022 04:41:27 -0700 (PDT) Received: from localhost.localdomain (unknown [112.20.112.163]) by localhost.localdomain (Coremail) with SMTP id AQAAf8AxFeLhSSxjyhYgAA--.56317S2; Thu, 22 Sep 2022 19:41:22 +0800 (CST) From: Binbin Zhou To: Wolfram Sang , Wolfram Sang , Mika Westerberg , linux-i2c@vger.kernel.org Cc: loongarch@lists.linux.dev, linux-acpi@vger.kernel.org, WANG Xuerui , Jianmin Lv , Binbin Zhou Subject: [PATCH 0/5] i2c: ls2x: Add support for the Loongson-2K/LS7A I2C Date: Thu, 22 Sep 2022 19:39:53 +0800 Message-Id: X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 X-CM-TRANSID: AQAAf8AxFeLhSSxjyhYgAA--.56317S2 X-Coremail-Antispam: 1UD129KBjvdXoWrZF1kWF1xAr1rZFWktw1fWFg_yoWkArgEkF 93XasrJF1DCF98GFyjvr4fZrWagayUW3WFk3Z7tr1fCry7Xw15KFyDZr9xGa1xXFWDWFn8 Xw4kuF1xZF1xXjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUb2kFF20E14v26r4j6ryUM7CY07I20VC2zVCF04k26cxKx2IYs7xG 6rWj6s0DM7CIcVAFz4kK6r1j6r18M28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48ve4kI8w A2z4x0Y4vE2Ix0cI8IcVAFwI0_Gr0_Xr1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI0_Cr0_ Gr1UM28EF7xvwVC2z280aVAFwI0_GcCE3s1l84ACjcxK6I8E87Iv6xkF7I0E14v26rxl6s 0DM2AIxVAIcxkEcVAq07x20xvEncxIr21l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj6xII jxv20xvE14v26r1j6r18McIj6I8E87Iv67AKxVW8JVWxJwAm72CE4IkC6x0Yz7v_Jr0_Gr 1lF7xvr2IYc2Ij64vIr41lF7I21c0EjII2zVCS5cI20VAGYxC7MxkIecxEwVAFwVW8KwCF 04k20xvY0x0EwIxGrwCFx2IqxVCFs4IE7xkEbVWUJVW8JwC20s026c02F40E14v26r1j6r 18MI8I3I0E7480Y4vE14v26r106r1rMI8E67AF67kF1VAFwI0_Jw0_GFylIxkGc2Ij64vI r41lIxAIcVC0I7IYx2IY67AKxVWUJVWUCwCI42IY6xIIjxv20xvEc7CjxVAFwI0_Jr0_Gr 1lIxAIcVCF04k26cxKx2IYs7xG6r1j6r1xMIIF0xvEx4A2jsIE14v26r1j6r4UMIIF0xvE x4A2jsIEc7CjxVAFwI0_Jr0_GrUvcSsGvfC2KfnxnUUI43ZEXa7VUj-zVUUUUUU== X-CM-SenderInfo: p2kr3uplqex0o6or00hjvr0hdfq/ Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org Hi all: This patch series adds support for the I2C module found on various Loongson systems with the Loongson-2K SoC or the Loongson LS7A bridge chip. For now, the I2C driver is suitable for DT-based or ACPI-based systems. BTW: I have only tested on the Loongson-3A5000+LS7A1000/LS7A2000 under LoongArch architecture. Thanks. Binbin Zhou (5): i2c: core: Pick i2c bus number from ACPI if present i2c: gpio: Add support on ACPI-based system dt-bindings: i2c: add bindings for Loongson LS2X I2C i2c: Add driver for Loongson-2K/LS7A I2C controller LoongArch: Enable LS2X I2C in loongson3_defconfig .../bindings/i2c/loongson,ls2x-i2c.yaml | 48 +++ arch/loongarch/configs/loongson3_defconfig | 1 + drivers/i2c/busses/Kconfig | 7 + drivers/i2c/busses/Makefile | 1 + drivers/i2c/busses/i2c-gpio.c | 41 +- drivers/i2c/busses/i2c-ls2x.c | 364 ++++++++++++++++++ drivers/i2c/i2c-core-base.c | 10 +- 7 files changed, 470 insertions(+), 2 deletions(-) create mode 100644 Documentation/devicetree/bindings/i2c/loongson,ls2x-i2c.yaml create mode 100644 drivers/i2c/busses/i2c-ls2x.c