linux/drivers/media/pci/mgb4/mgb4_core.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * This is the driver for the MGB4 video grabber card by Digiteq Automotive.
 *
 * Copyright (C) 2021-2023 Digiteq Automotive
 *     author: Martin Tuma <[email protected]>
 *
 * This is the main driver module. The DMA, I2C and SPI sub-drivers are
 * initialized here and the input/output v4l2 devices are created.
 *
 * The mgb4 card uses different expansion modules for different video sources
 * (GMSL and FPDL3 for now) so in probe() we detect the module type based on
 * what we see on the I2C bus and check if it matches the FPGA bitstream (there
 * are different bitstreams for different expansion modules). When no expansion
 * module is present, we still let the driver initialize to allow flashing of
 * the FPGA firmware using the SPI FLASH device. No v4l2 video devices are
 * created in this case.
 */

#include <linux/types.h>
#include <linux/module.h>
#include <linux/pci.h>
#include <linux/platform_device.h>
#include <linux/clk.h>
#include <linux/clk-provider.h>
#include <linux/clkdev.h>
#include <linux/i2c.h>
#include <linux/delay.h>
#include <linux/dma/amd_xdma.h>
#include <linux/platform_data/amd_xdma.h>
#include <linux/spi/xilinx_spi.h>
#include <linux/mtd/mtd.h>
#include <linux/hwmon.h>
#include <linux/debugfs.h>
#include "mgb4_dma.h"
#include "mgb4_i2c.h"
#include "mgb4_sysfs.h"
#include "mgb4_vout.h"
#include "mgb4_vin.h"
#include "mgb4_trigger.h"
#include "mgb4_core.h"

#define MGB4_USER_IRQS

#define DIGITEQ_VID
#define T100_DID
#define T200_DID

ATTRIBUTE_GROUPS();

static int flashid;

static struct xdma_chan_info h2c_chan_info =;

static struct xdma_chan_info c2h_chan_info =;

static struct xspi_platform_data spi_platform_data =;

static const struct i2c_board_info extender_info =;

#if IS_REACHABLE(CONFIG_HWMON)
static umode_t temp_is_visible(const void *data, enum hwmon_sensor_types type,
			       u32 attr, int channel)
{}

static int temp_read(struct device *dev, enum hwmon_sensor_types type, u32 attr,
		     int channel, long *val)
{}

static int temp_read_string(struct device *dev, enum hwmon_sensor_types type,
			    u32 attr, int channel, const char **str)
{}

static const struct hwmon_ops temp_ops =;

static const struct hwmon_channel_info *temp_channel_info[] =;

static const struct hwmon_chip_info temp_chip_info =;
#endif

static int match_i2c_adap(struct device *dev, void *data)
{}

static struct i2c_adapter *get_i2c_adap(struct platform_device *pdev)
{}

static int match_spi_adap(struct device *dev, void *data)
{}

static struct spi_controller *get_spi_adap(struct platform_device *pdev)
{}

static int init_spi(struct mgb4_dev *mgbdev, u32 devid)
{}

static void free_spi(struct mgb4_dev *mgbdev)
{}

static int init_i2c(struct mgb4_dev *mgbdev)
{}

static void free_i2c(struct mgb4_dev *mgbdev)
{}

static int get_serial_number(struct mgb4_dev *mgbdev)
{}

static int get_module_version(struct mgb4_dev *mgbdev)
{}

static int map_regs(struct pci_dev *pdev, struct resource *res,
		    struct mgb4_regs *regs)
{}

static int init_xdma(struct mgb4_dev *mgbdev)
{}

static void free_xdma(struct mgb4_dev *mgbdev)
{}

static int mgb4_probe(struct pci_dev *pdev, const struct pci_device_id *id)
{}

static void mgb4_remove(struct pci_dev *pdev)
{}

static const struct pci_device_id mgb4_pci_ids[] =;
MODULE_DEVICE_TABLE(pci, mgb4_pci_ids);

static struct pci_driver mgb4_pci_driver =;

module_pci_driver();

MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_LICENSE();
MODULE_SOFTDEP();