File Index
Files and directories
Sign in
FILE

vsp1.h

File preview with syntax highlighting.

linux-6.19.14/drivers/media/platform/renesas/vsp1/vsp1.h C
  1/* SPDX-License-Identifier: GPL-2.0+ */
  2/*
  3 * vsp1.h  --  R-Car VSP1 Driver
  4 *
  5 * Copyright (C) 2013-2014 Renesas Electronics Corporation
  6 *
  7 * Contact: Laurent Pinchart (laurent.pinchart@ideasonboard.com)
  8 */
  9#ifndef __VSP1_H__
 10#define __VSP1_H__
 11
 12#include <linux/io.h>
 13#include <linux/list.h>
 14#include <linux/mutex.h>
 15
 16#include <media/media-device.h>
 17#include <media/v4l2-device.h>
 18#include <media/v4l2-subdev.h>
 19
 20#include "vsp1_regs.h"
 21
 22struct clk;
 23struct device;
 24struct rcar_fcp_device;
 25struct reset_control;
 26
 27struct vsp1_drm;
 28struct vsp1_entity;
 29struct vsp1_platform_data;
 30struct vsp1_brx;
 31struct vsp1_clu;
 32struct vsp1_hgo;
 33struct vsp1_hgt;
 34struct vsp1_hsit;
 35struct vsp1_iif;
 36struct vsp1_lif;
 37struct vsp1_lut;
 38struct vsp1_rwpf;
 39struct vsp1_sru;
 40struct vsp1_uds;
 41struct vsp1_uif;
 42
 43#define VSP1_MAX_LIF		2
 44#define VSP1_MAX_RPF		5
 45#define VSP1_MAX_UDS		3
 46#define VSP1_MAX_UIF		2
 47#define VSP1_MAX_WPF		4
 48
 49#define VSP1_HAS_LUT		BIT(1)
 50#define VSP1_HAS_SRU		BIT(2)
 51#define VSP1_HAS_BRU		BIT(3)
 52#define VSP1_HAS_CLU		BIT(4)
 53#define VSP1_HAS_WPF_VFLIP	BIT(5)
 54#define VSP1_HAS_WPF_HFLIP	BIT(6)
 55#define VSP1_HAS_HGO		BIT(7)
 56#define VSP1_HAS_HGT		BIT(8)
 57#define VSP1_HAS_BRS		BIT(9)
 58#define VSP1_HAS_EXT_DL		BIT(10)
 59#define VSP1_HAS_NON_ZERO_LBA	BIT(11)
 60#define VSP1_HAS_IIF		BIT(12)
 61#define VSP1_HAS_HSIT		BIT(13)
 62
 63struct vsp1_device_info {
 64	u32 version;
 65	const char *model;
 66	unsigned int gen;
 67	unsigned int features;
 68	unsigned int lif_count;
 69	unsigned int rpf_count;
 70	unsigned int uds_count;
 71	unsigned int uif_count;
 72	unsigned int wpf_count;
 73	unsigned int num_bru_inputs;
 74	u8 soc;
 75	bool uapi;
 76};
 77
 78#define vsp1_feature(vsp1, f) ((vsp1)->info->features & (f))
 79
 80struct vsp1_device {
 81	struct device *dev;
 82	const struct vsp1_device_info *info;
 83	u32 version;
 84
 85	void __iomem *mmio;
 86	struct rcar_fcp_device *fcp;
 87	struct device *bus_master;
 88	struct reset_control *rstc;
 89
 90	struct vsp1_brx *brs;
 91	struct vsp1_brx *bru;
 92	struct vsp1_clu *clu;
 93	struct vsp1_hgo *hgo;
 94	struct vsp1_hgt *hgt;
 95	struct vsp1_hsit *hsi;
 96	struct vsp1_hsit *hst;
 97	struct vsp1_iif *iif;
 98	struct vsp1_lif *lif[VSP1_MAX_LIF];
 99	struct vsp1_lut *lut;
100	struct vsp1_rwpf *rpf[VSP1_MAX_RPF];
101	struct vsp1_sru *sru;
102	struct vsp1_uds *uds[VSP1_MAX_UDS];
103	struct vsp1_uif *uif[VSP1_MAX_UIF];
104	struct vsp1_rwpf *wpf[VSP1_MAX_WPF];
105
106	struct list_head entities;
107	struct list_head videos;
108
109	struct v4l2_device v4l2_dev;
110	struct media_device media_dev;
111	struct media_entity_operations media_ops;
112
113	struct vsp1_drm *drm;
114	struct vsp1_vspx *vspx;
115};
116
117int vsp1_device_get(struct vsp1_device *vsp1);
118void vsp1_device_put(struct vsp1_device *vsp1);
119
120int vsp1_reset_wpf(struct vsp1_device *vsp1, unsigned int index);
121
122static inline u32 vsp1_read(struct vsp1_device *vsp1, u32 reg)
123{
124	return ioread32(vsp1->mmio + reg);
125}
126
127static inline void vsp1_write(struct vsp1_device *vsp1, u32 reg, u32 data)
128{
129	iowrite32(data, vsp1->mmio + reg);
130}
131
132#endif /* __VSP1_H__ */
~/ Read-only file preview.