linux/drivers/media/pci/mgb4/mgb4_core.h
Martin Tůma 1724dcc9dd media: mgb4: Add support for V4L2_CAP_TIMEPERFRAME
Recent mgb4 firmwares have support for setting a variable framerate
independent of the signal framerate. Add/fix (the mgb4 driver already did
promote V4L2_CAP_TIMEPERFRAME, but it didn't work) support for
V4L2_CAP_TIMEPERFRAME to the driver to enable this feature.

Additionally add support for the DV timings API (VIDIOC_G_DV_TIMINGS,
VIDIOC_ENUM_DV_TIMINGS, ...) for the outputs that was missing. The timings
info is required/used for implementing the V4L2_CAP_TIMEPERFRAME
functionality.

Signed-off-by: Martin Tůma <martin.tuma@digiteqautomotive.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-08-14 10:05:31 +02:00

76 lines
1.7 KiB
C

/* SPDX-License-Identifier: GPL-2.0-only */
/*
* Copyright (C) 2021-2023 Digiteq Automotive
* author: Martin Tuma <martin.tuma@digiteqautomotive.com>
*/
#ifndef __MGB4_CORE_H__
#define __MGB4_CORE_H__
#include <linux/spi/flash.h>
#include <linux/mtd/partitions.h>
#include <linux/mutex.h>
#include <linux/dmaengine.h>
#include "mgb4_regs.h"
#define MGB4_HW_FREQ 125000000
#define MGB4_VIN_DEVICES 2
#define MGB4_VOUT_DEVICES 2
#define MGB4_MGB4_BAR_ID 0
#define MGB4_XDMA_BAR_ID 1
#define MGB4_IS_GMSL(mgbdev) \
((mgbdev)->module_version >> 4 == 2)
#define MGB4_IS_FPDL3(mgbdev) \
((mgbdev)->module_version >> 4 == 1)
struct mgb4_dma_channel {
struct dma_chan *chan;
struct completion req_compl;
};
struct mgb4_dev {
struct pci_dev *pdev;
struct platform_device *xdev;
struct mgb4_vin_dev *vin[MGB4_VIN_DEVICES];
struct mgb4_vout_dev *vout[MGB4_VOUT_DEVICES];
struct mgb4_dma_channel c2h_chan[MGB4_VIN_DEVICES];
struct mgb4_dma_channel h2c_chan[MGB4_VOUT_DEVICES];
struct dma_slave_map slave_map[MGB4_VIN_DEVICES + MGB4_VOUT_DEVICES];
struct mgb4_regs video;
struct mgb4_regs cmt;
struct clk_hw *i2c_clk;
struct clk_lookup *i2c_cl;
struct platform_device *i2c_pdev;
struct i2c_adapter *i2c_adap;
struct mutex i2c_lock; /* I2C bus access lock */
struct platform_device *spi_pdev;
struct flash_platform_data flash_data;
struct mtd_partition partitions[2];
char flash_name[16];
char fw_part_name[16];
char data_part_name[16];
char channel_names[MGB4_VIN_DEVICES + MGB4_VOUT_DEVICES][16];
struct iio_dev *indio_dev;
#if IS_REACHABLE(CONFIG_HWMON)
struct device *hwmon_dev;
#endif
unsigned long io_reconfig;
u8 module_version;
u32 serial_number;
#ifdef CONFIG_DEBUG_FS
struct dentry *debugfs;
#endif
};
#endif