Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp2302662rwl; Thu, 13 Apr 2023 04:48:39 -0700 (PDT) X-Google-Smtp-Source: AKy350aLZ6PVV7UwRVPEUlCQ9aQB9s2IXUnJlX24jXpRDZwgzkqeVsW6WE0XzeWGFvsLc78FQtQg X-Received: by 2002:aa7:d78b:0:b0:504:a181:8185 with SMTP id s11-20020aa7d78b000000b00504a1818185mr2403285edq.32.1681386519397; Thu, 13 Apr 2023 04:48:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681386519; cv=none; d=google.com; s=arc-20160816; b=XyfUq/I1/5TKqlDFqXWnodcqL6V4fVV/yesTnGnM2DnRYc/uxkO7wmfa0+A7l4tRwq ap4tHRWNECndaj41myIdyps6xm7C/TUsQgi2yFH1EenwaMfejQR8SPlGxm0PM9c1/Kth dIrIpaJEk7tooedoAz6wZf4JR6C7nOQMKhJSZvyEm+FXYdQD5EBUwZ/2Phu6bgRArdWk bc5PXyfALd9ZkaSntfz53kPh4IcYVw26VjWCtPr3uw20nNJsQwMPbYJh3Js4V0glBBlX ihSf4qdwPvprCoQ0bkMv3uJgkACOUp+79xHm+QBuPwpbZiIe2l0gwqAeP/qL9JYZIFKW gokg== 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=9kTIaxk7xbg+5GTvYNzgB3ziC7qMTuB6MQ3ZhqH/tHc=; b=qTrTUKlU5HvWPGm4a8tH31Zwu6vA1xOZUogEk0cAUDjTXz1yn2dxcOe67sC7etdTs8 ohY0Hkb/ntIdWIyF8paVu03qilcQHzeGM0UtEs+diDrvTDL5LVsuWCCWwlYn4uxEAuux wsTVaHRPe9u54MpVIusYQF+Cl2Xu5vxFJ0yU6HbydZJo7d83tRdbKRCtOkc3j8tY+Pi8 zNeQVIIN+08GwRz8yygC8w2PEX8R6BBqGe+riZC5362c7f+gmXrI4OdS85CPOPsGvJf8 1K4ZeIQYm/RH3C0ZjK4PuX2pRmrSe6Oi2Nt43vfU550QrJBXHkFP6EQ+O3d1YbszaUlD PQww== 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 ff18-20020a1709069c1200b0094a6d9f31e0si1439946ejc.840.2023.04.13.04.48.13; Thu, 13 Apr 2023 04:48:39 -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 S230290AbjDMLpl (ORCPT + 99 others); Thu, 13 Apr 2023 07:45:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44968 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229853AbjDMLpk (ORCPT ); Thu, 13 Apr 2023 07:45:40 -0400 Received: from mx.gpxsee.org (mx.gpxsee.org [37.205.14.76]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id A096D2729; Thu, 13 Apr 2023 04:45:19 -0700 (PDT) Received: from mgb4.digiteq.red (unknown [62.77.71.229]) by mx.gpxsee.org (Postfix) with ESMTPSA id 0F981232A0; Thu, 13 Apr 2023 13:45:17 +0200 (CEST) From: tumic@gpxsee.org To: Mauro Carvalho Chehab Cc: Hans Verkuil , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, =?UTF-8?q?Martin=20T=C5=AFma?= Subject: [RESEND PATCH v6 0/1] Digiteq Automotive MGB4 driver Date: Thu, 13 Apr 2023 14:45:33 +0200 Message-Id: <20230413124534.7147-1-tumic@gpxsee.org> X-Mailer: git-send-email 2.40.0 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,T_SPF_HELO_TEMPERROR, T_SPF_TEMPERROR,URIBL_BLOCKED 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 patch 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. The driver 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.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 v6: * Rebased to current master that includes the Xilinx XDMA driver. Changes in v5: * Removed unused includes Changes in v4: * Redesigned the signal change handling logic. Now using the propper timings API in the video input driver and a propper open() syscall check/logic in the video output driver. * Fixed all minor issues from v3 review. * 'checkpatch.pl --strict' used for checking the code. Changes in v3: * Rebased the DMA transfers part to use the new XDMA driver from Xilinx/AMD 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 (1): Added Digiteq Automotive MGB4 driver Documentation/admin-guide/media/mgb4.rst | 352 ++++++++ .../admin-guide/media/pci-cardlist.rst | 1 + .../admin-guide/media/v4l-drivers.rst | 1 + MAINTAINERS | 7 + 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 | 247 ++++++ drivers/media/pci/mgb4/mgb4_cmt.h | 16 + drivers/media/pci/mgb4/mgb4_core.c | 641 ++++++++++++++ drivers/media/pci/mgb4/mgb4_core.h | 65 ++ drivers/media/pci/mgb4/mgb4_dma.c | 123 +++ drivers/media/pci/mgb4/mgb4_dma.h | 18 + drivers/media/pci/mgb4/mgb4_i2c.c | 140 +++ drivers/media/pci/mgb4/mgb4_i2c.h | 35 + drivers/media/pci/mgb4/mgb4_io.h | 39 + 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 | 780 ++++++++++++++++ drivers/media/pci/mgb4/mgb4_sysfs_out.c | 732 +++++++++++++++ drivers/media/pci/mgb4/mgb4_sysfs_pci.c | 86 ++ drivers/media/pci/mgb4/mgb4_trigger.c | 208 +++++ drivers/media/pci/mgb4/mgb4_trigger.h | 8 + drivers/media/pci/mgb4/mgb4_vin.c | 830 ++++++++++++++++++ drivers/media/pci/mgb4/mgb4_vin.h | 63 ++ drivers/media/pci/mgb4/mgb4_vout.c | 501 +++++++++++ drivers/media/pci/mgb4/mgb4_vout.h | 58 ++ 29 files changed, 5059 insertions(+) create mode 100644 Documentation/admin-guide/media/mgb4.rst 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_dma.c create mode 100644 drivers/media/pci/mgb4/mgb4_dma.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 base-commit: de4664485abbc0529b1eec44d0061bbfe58a28fb -- 2.40.0