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

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (C) 2021-2023 Digiteq Automotive
 *     author: Martin Tuma <[email protected]>
 *
 * This module handles all the sysfs info/configuration that is related to the
 * v4l2 output devices.
 */

#include <linux/device.h>
#include <linux/nospec.h>
#include "mgb4_core.h"
#include "mgb4_i2c.h"
#include "mgb4_vout.h"
#include "mgb4_vin.h"
#include "mgb4_cmt.h"
#include "mgb4_sysfs.h"

static int loopin_cnt(struct mgb4_vin_dev *vindev)
{}

static bool is_busy(struct video_device *dev)
{}

/* Common for both FPDL3 and GMSL */

static ssize_t output_id_show(struct device *dev,
			      struct device_attribute *attr, char *buf)
{}

static ssize_t video_source_show(struct device *dev,
				 struct device_attribute *attr, char *buf)
{}

/*
 * Video source change may affect the buffer queue of ANY video input/output on
 * the card thus if any of the inputs/outputs is in use, we do not allow
 * the change.
 *
 * As we do not want to lock all the video devices at the same time, a two-stage
 * locking strategy is used. In addition to the video device locking there is
 * a global (PCI device) variable "io_reconfig" atomically checked/set when
 * the reconfiguration is running. All the video devices check the variable in
 * their queue_setup() functions and do not allow to start the queue when
 * the reconfiguration has started.
 */
static ssize_t video_source_store(struct device *dev,
				  struct device_attribute *attr,
				  const char *buf, size_t count)
{}

static ssize_t display_width_show(struct device *dev,
				  struct device_attribute *attr, char *buf)
{}

static ssize_t display_width_store(struct device *dev,
				   struct device_attribute *attr,
				   const char *buf, size_t count)
{}

static ssize_t display_height_show(struct device *dev,
				   struct device_attribute *attr, char *buf)
{}

static ssize_t display_height_store(struct device *dev,
				    struct device_attribute *attr,
				    const char *buf, size_t count)
{}

static ssize_t frame_rate_show(struct device *dev,
			       struct device_attribute *attr, char *buf)
{}

/*
 * Frame rate change is expected to be called on live streams. Video device
 * locking/queue check is not needed.
 */
static ssize_t frame_rate_store(struct device *dev,
				struct device_attribute *attr, const char *buf,
				size_t count)
{}

static ssize_t hsync_width_show(struct device *dev,
				struct device_attribute *attr, char *buf)
{}

/*
 * HSYNC width change is expected to be called on live streams. Video device
 * locking/queue check is not needed.
 */
static ssize_t hsync_width_store(struct device *dev,
				 struct device_attribute *attr, const char *buf,
				 size_t count)
{}

static ssize_t vsync_width_show(struct device *dev,
				struct device_attribute *attr, char *buf)
{}

/*
 * VSYNC vidth change is expected to be called on live streams. Video device
 * locking/queue check is not needed.
 */
static ssize_t vsync_width_store(struct device *dev,
				 struct device_attribute *attr, const char *buf,
				 size_t count)
{}

static ssize_t hback_porch_show(struct device *dev,
				struct device_attribute *attr, char *buf)
{}

/*
 * hback porch change is expected to be called on live streams. Video device
 * locking/queue check is not needed.
 */
static ssize_t hback_porch_store(struct device *dev,
				 struct device_attribute *attr, const char *buf,
				 size_t count)
{}

static ssize_t vback_porch_show(struct device *dev,
				struct device_attribute *attr, char *buf)
{}

/*
 * vback porch change is expected to be called on live streams. Video device
 * locking/queue check is not needed.
 */
static ssize_t vback_porch_store(struct device *dev,
				 struct device_attribute *attr, const char *buf,
				 size_t count)
{}

static ssize_t hfront_porch_show(struct device *dev,
				 struct device_attribute *attr, char *buf)
{}

/*
 * hfront porch change is expected to be called on live streams. Video device
 * locking/queue check is not needed.
 */
static ssize_t hfront_porch_store(struct device *dev,
				  struct device_attribute *attr,
				  const char *buf, size_t count)
{}

static ssize_t vfront_porch_show(struct device *dev,
				 struct device_attribute *attr, char *buf)
{}

/*
 * vfront porch change is expected to be called on live streams. Video device
 * locking/queue check is not needed.
 */
static ssize_t vfront_porch_store(struct device *dev,
				  struct device_attribute *attr, const char *buf,
				  size_t count)
{}

/* FPDL3 only */

static ssize_t hsync_polarity_show(struct device *dev,
				   struct device_attribute *attr, char *buf)
{}

/*
 * HSYNC polarity change is expected to be called on live streams. Video device
 * locking/queue check is not needed.
 */
static ssize_t hsync_polarity_store(struct device *dev,
				    struct device_attribute *attr,
				    const char *buf, size_t count)
{}

static ssize_t vsync_polarity_show(struct device *dev,
				   struct device_attribute *attr, char *buf)
{}

/*
 * VSYNC polarity change is expected to be called on live streams. Video device
 * locking/queue check is not needed.
 */
static ssize_t vsync_polarity_store(struct device *dev,
				    struct device_attribute *attr,
				    const char *buf, size_t count)
{}

static ssize_t de_polarity_show(struct device *dev,
				struct device_attribute *attr, char *buf)
{}

/*
 * DE polarity change is expected to be called on live streams. Video device
 * locking/queue check is not needed.
 */
static ssize_t de_polarity_store(struct device *dev,
				 struct device_attribute *attr, const char *buf,
				 size_t count)
{}

static ssize_t fpdl3_output_width_show(struct device *dev,
				       struct device_attribute *attr, char *buf)
{}

/*
 * FPD-Link width change is expected to be called on live streams. Video device
 * locking/queue check is not needed.
 */
static ssize_t fpdl3_output_width_store(struct device *dev,
					struct device_attribute *attr,
					const char *buf, size_t count)
{}

static ssize_t pclk_frequency_show(struct device *dev,
				   struct device_attribute *attr, char *buf)
{}

static ssize_t pclk_frequency_store(struct device *dev,
				    struct device_attribute *attr,
				    const char *buf, size_t count)
{}

static DEVICE_ATTR_RO(output_id);
static DEVICE_ATTR_RW(video_source);
static DEVICE_ATTR_RW(display_width);
static DEVICE_ATTR_RW(display_height);
static DEVICE_ATTR_RW(frame_rate);
static DEVICE_ATTR_RW(hsync_polarity);
static DEVICE_ATTR_RW(vsync_polarity);
static DEVICE_ATTR_RW(de_polarity);
static DEVICE_ATTR_RW(pclk_frequency);
static DEVICE_ATTR_RW(hsync_width);
static DEVICE_ATTR_RW(vsync_width);
static DEVICE_ATTR_RW(hback_porch);
static DEVICE_ATTR_RW(hfront_porch);
static DEVICE_ATTR_RW(vback_porch);
static DEVICE_ATTR_RW(vfront_porch);

static DEVICE_ATTR_RW(fpdl3_output_width);

struct attribute *mgb4_fpdl3_out_attrs[] =;

struct attribute *mgb4_gmsl_out_attrs[] =;