| 1 |
/* SPDX-License-Identifier: GPL-2.0-only */ |
| 2 |
/* |
| 3 |
* Copyright (C) 2023 SKIDATA GmbH |
| 4 |
* Author: Luca Ceresoli <[email protected]> |
| 5 |
*/ |
| 6 |
|
| 7 |
#ifndef __TEGRA_VIP_H__ |
| 8 |
#define __TEGRA_VIP_H__ |
| 9 |
|
| 10 |
#include <media/media-entity.h> |
| 11 |
#include <media/v4l2-async.h> |
| 12 |
#include <media/v4l2-subdev.h> |
| 13 |
|
| 14 |
enum { |
| 15 |
TEGRA_VIP_PAD_SINK, |
| 16 |
TEGRA_VIP_PAD_SOURCE, |
| 17 |
TEGRA_VIP_PADS_NUM, |
| 18 |
}; |
| 19 |
|
| 20 |
struct tegra_vip; |
| 21 |
|
| 22 |
/** |
| 23 |
* struct tegra_vip_channel - Tegra VIP (parallel video capture) channel |
| 24 |
* |
| 25 |
* @subdev: V4L2 subdevice associated with this channel |
| 26 |
* @pads: media pads for the subdevice entity |
| 27 |
* @of_node: vip device tree node |
| 28 |
*/ |
| 29 |
struct tegra_vip_channel { |
| 30 |
struct v4l2_subdev subdev; |
| 31 |
struct media_pad pads[TEGRA_VIP_PADS_NUM]; |
| 32 |
struct device_node *of_node; |
| 33 |
}; |
| 34 |
|
| 35 |
/** |
| 36 |
* struct tegra_vip_ops - Tegra VIP operations |
| 37 |
* |
| 38 |
* @vip_start_streaming: programs vip hardware to enable streaming. |
| 39 |
*/ |
| 40 |
struct tegra_vip_ops { |
| 41 |
int (*vip_start_streaming)(struct tegra_vip_channel *vip_chan); |
| 42 |
}; |
| 43 |
|
| 44 |
/** |
| 45 |
* struct tegra_vip_soc - NVIDIA Tegra VIP SoC structure |
| 46 |
* |
| 47 |
* @ops: vip hardware operations |
| 48 |
*/ |
| 49 |
struct tegra_vip_soc { |
| 50 |
const struct tegra_vip_ops *ops; |
| 51 |
}; |
| 52 |
|
| 53 |
#if defined(CONFIG_ARCH_TEGRA_2x_SOC) |
| 54 |
extern const struct tegra_vip_soc tegra20_vip_soc; |
| 55 |
#endif |
| 56 |
|
| 57 |
/** |
| 58 |
* struct tegra_vip - NVIDIA Tegra VIP device structure |
| 59 |
* |
| 60 |
* @dev: device struct |
| 61 |
* @client: host1x_client struct |
| 62 |
* @soc: pointer to SoC data structure |
| 63 |
* @chan: the VIP channel |
| 64 |
*/ |
| 65 |
struct tegra_vip { |
| 66 |
struct device *dev; |
| 67 |
struct host1x_client client; |
| 68 |
const struct tegra_vip_soc *soc; |
| 69 |
struct tegra_vip_channel chan; |
| 70 |
}; |
| 71 |
|
| 72 |
#endif |