Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp2871103rwb; Mon, 19 Sep 2022 11:12:15 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7EfuT2PA2/AmL2nIKNx5K6EGHr04nCCI19cQEmzizGJVRPI73mYS1uZRRD+SBT8NhukT0m X-Received: by 2002:a17:903:2cb:b0:171:4f0d:beb6 with SMTP id s11-20020a17090302cb00b001714f0dbeb6mr953920plk.53.1663611135059; Mon, 19 Sep 2022 11:12:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663611135; cv=none; d=google.com; s=arc-20160816; b=NHpipR8mOQ/yNbraSzjpPFdzALNaUfM18KgVhiZDyGW1DtIHX1puUCa6Eie0K7Ye+M matul4o0cZRHxEe37lbdq+1iQR6/9DSEkAXdJhcFr9yDrTklYtMorpKuPyjP3yBJRmjw yHlpOkra/vXUZ5BeVmfvBjfL55kI0ZeTB+OGuE8/SJAHVnprvxsQcw/fs/yTiQIH5F+z z4ythefdpqknNIP/45gGCmhi871V/OOGheuG1ey6yrFsPjdHx4+Ks7xT/tCSl9cnMB1k 15WzsXSLiAxnmIt4JCuylBV6Nu3AjLCL/9Ypnc72+K/QAFcCcor+xjV1/99WJXAF8zPz KN2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=Z2qqTrrN6kShteitbjR35g7S7qrCS9DZUBwzI+m+a/Y=; b=XZ77A4ULGjrgscyWbfrUhtAP4iWX3QVSkrkaYqGCpHEDPHo8Cx+DLgS/KAeXBXtlA5 WGbDrgre7PW+QbbWJtHcRdI56nmXSxX1aTEBBe1ruZfpYVB5AvL/IppqbmM3iaJVFLqh 5j2966Oon4+2vzXaOyocu0FFrl2LeXkYtnsxEu7vprjSfNeattJh3i+nqPaf9Nc1yhnU C3RixFos8sDqJc/rdCnFUD5E5GzYmLf+olNqGlKteUPhksCbBvCl+64k1xIpI2zlORLH lnHmZ+lY+w6FyJX0KE9aGb+DEOskIS4RoYXUzhi+aHkjyBubNWsIOar+omFyq89CqnVs oMoA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h13-20020a170902f70d00b001769d172607si8941376plo.476.2022.09.19.11.12.02; Mon, 19 Sep 2022 11:12:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231177AbiISRgB (ORCPT + 99 others); Mon, 19 Sep 2022 13:36:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47276 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231245AbiISRfw (ORCPT ); Mon, 19 Sep 2022 13:35:52 -0400 Received: from mx.gpxsee.org (mx.gpxsee.org [37.205.14.76]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 9F1663AB0F; Mon, 19 Sep 2022 10:35:49 -0700 (PDT) Received: from mgb4.digiteq.red (unknown [62.77.71.229]) by mx.gpxsee.org (Postfix) with ESMTPSA id 1550745125; Mon, 19 Sep 2022 18:56:19 +0200 (CEST) From: tumic@gpxsee.org To: Mauro Carvalho Chehab , Vinod Koul , Michal Simek Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, dmaengine@vger.kernel.org, linux-i2c@vger.kernel.org, =?UTF-8?q?Martin=20T=C5=AFma?= Subject: [PATCH v2 0/3] Digiteq Automotive MGB4 driver Date: Mon, 19 Sep 2022 20:55:53 +0200 Message-Id: <20220919185556.5215-1-tumic@gpxsee.org> X-Mailer: git-send-email 2.37.2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Martin Tůma Hi, This series of patches adds a driver for the Digiteq Automotive MGB4 grabber card. MGB4 is a modular frame grabber PCIe card for automotive video interfaces (FPD-Link and GMSL for now). It is based on a Xilinx FPGA and uses their XDMA IP core for DMA transfers. Additionally, Xilinx I2C and SPI IP cores which already have drivers in linux are used in the design. Except of the required xiic driver alias, the patches are split into two parts: the XDMA driver and a "standard" v4l2 device driver. The XDMA driver is originally based on Xilinx's sample code that can be found at: https://github.com/Xilinx/dma_ip_drivers The rest is a quite standard v4l2 driver, with one exception - there are a lot of sysfs options that may/must be set before opening the v4l2 device to adapt the card on a specific signal (see mgb4-sysfs.rst for details) as the card must be able to work with various signal sources (or displays) that can not be auto-detected. I have run the driver through the v4l2-compliance test suite for both the input and the output and the results look fine to me (I can provide the output if required). Changes in v2: * Completely rewritten the original Xilinx's XDMA driver to meet kernel code standards. * Added all required "to" and "cc" mail addresses. Martin Tůma (3): Added platform module alias for the xiic I2C driver Added Xilinx XDMA IP core driver Added Digiteq Automotive MGB4 driver Documentation/admin-guide/media/mgb4-iio.rst | 30 + Documentation/admin-guide/media/mgb4-mtd.rst | 16 + .../admin-guide/media/mgb4-sysfs.rst | 297 +++ drivers/dma/Kconfig | 7 + drivers/dma/xilinx/Makefile | 1 + drivers/dma/xilinx/xilinx_xdma.c | 2042 +++++++++++++++++ drivers/i2c/busses/i2c-xiic.c | 1 + drivers/media/pci/Kconfig | 1 + drivers/media/pci/Makefile | 1 + drivers/media/pci/mgb4/Kconfig | 17 + drivers/media/pci/mgb4/Makefile | 6 + drivers/media/pci/mgb4/mgb4_cmt.c | 243 ++ drivers/media/pci/mgb4/mgb4_cmt.h | 16 + drivers/media/pci/mgb4/mgb4_core.c | 554 +++++ drivers/media/pci/mgb4/mgb4_core.h | 58 + drivers/media/pci/mgb4/mgb4_i2c.c | 139 ++ drivers/media/pci/mgb4/mgb4_i2c.h | 35 + drivers/media/pci/mgb4/mgb4_io.h | 36 + drivers/media/pci/mgb4/mgb4_regs.c | 30 + drivers/media/pci/mgb4/mgb4_regs.h | 35 + drivers/media/pci/mgb4/mgb4_sysfs.h | 18 + drivers/media/pci/mgb4/mgb4_sysfs_in.c | 750 ++++++ drivers/media/pci/mgb4/mgb4_sysfs_out.c | 734 ++++++ drivers/media/pci/mgb4/mgb4_sysfs_pci.c | 83 + drivers/media/pci/mgb4/mgb4_trigger.c | 202 ++ drivers/media/pci/mgb4/mgb4_trigger.h | 8 + drivers/media/pci/mgb4/mgb4_vin.c | 656 ++++++ drivers/media/pci/mgb4/mgb4_vin.h | 64 + drivers/media/pci/mgb4/mgb4_vout.c | 502 ++++ drivers/media/pci/mgb4/mgb4_vout.h | 58 + include/linux/dma/xilinx_xdma.h | 44 + 31 files changed, 6684 insertions(+) create mode 100644 Documentation/admin-guide/media/mgb4-iio.rst create mode 100644 Documentation/admin-guide/media/mgb4-mtd.rst create mode 100644 Documentation/admin-guide/media/mgb4-sysfs.rst create mode 100644 drivers/dma/xilinx/xilinx_xdma.c create mode 100644 drivers/media/pci/mgb4/Kconfig create mode 100644 drivers/media/pci/mgb4/Makefile create mode 100644 drivers/media/pci/mgb4/mgb4_cmt.c create mode 100644 drivers/media/pci/mgb4/mgb4_cmt.h create mode 100644 drivers/media/pci/mgb4/mgb4_core.c create mode 100644 drivers/media/pci/mgb4/mgb4_core.h create mode 100644 drivers/media/pci/mgb4/mgb4_i2c.c create mode 100644 drivers/media/pci/mgb4/mgb4_i2c.h create mode 100644 drivers/media/pci/mgb4/mgb4_io.h create mode 100644 drivers/media/pci/mgb4/mgb4_regs.c create mode 100644 drivers/media/pci/mgb4/mgb4_regs.h create mode 100644 drivers/media/pci/mgb4/mgb4_sysfs.h create mode 100644 drivers/media/pci/mgb4/mgb4_sysfs_in.c create mode 100644 drivers/media/pci/mgb4/mgb4_sysfs_out.c create mode 100644 drivers/media/pci/mgb4/mgb4_sysfs_pci.c create mode 100644 drivers/media/pci/mgb4/mgb4_trigger.c create mode 100644 drivers/media/pci/mgb4/mgb4_trigger.h create mode 100644 drivers/media/pci/mgb4/mgb4_vin.c create mode 100644 drivers/media/pci/mgb4/mgb4_vin.h create mode 100644 drivers/media/pci/mgb4/mgb4_vout.c create mode 100644 drivers/media/pci/mgb4/mgb4_vout.h create mode 100644 include/linux/dma/xilinx_xdma.h -- 2.37.2