linux/drivers/media/pci/mgb4/mgb4_regs.h
Martin Tůma 0ab13674a9 media: pci: mgb4: Added Digiteq Automotive MGB4 driver
Digiteq Automotive MGB4 is a modular frame grabber PCIe card for automotive
video interfaces. As for now, two modules - FPD-Link and GMSL - are
available and supported by the driver. The card has two inputs and two
outputs (FPD-Link only).

In addition to the video interfaces it also provides a trigger signal
interface and a MTD interface for FPGA firmware upload.

Signed-off-by: Martin Tůma <martin.tuma@digiteqautomotive.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2023-10-07 10:51:58 +02:00

36 lines
803 B
C

/* SPDX-License-Identifier: GPL-2.0-only */
/*
* Copyright (C) 2021-2022 Digiteq Automotive
* author: Martin Tuma <martin.tuma@digiteqautomotive.com>
*/
#ifndef __MGB4_REGS_H__
#define __MGB4_REGS_H__
#include <linux/io.h>
struct mgb4_regs {
resource_size_t mapbase;
resource_size_t mapsize;
void __iomem *membase;
};
#define mgb4_write_reg(regs, offset, val) \
iowrite32(val, (regs)->membase + (offset))
#define mgb4_read_reg(regs, offset) \
ioread32((regs)->membase + (offset))
static inline void mgb4_mask_reg(struct mgb4_regs *regs, u32 reg, u32 mask,
u32 val)
{
u32 ret = mgb4_read_reg(regs, reg);
val |= ret & ~mask;
mgb4_write_reg(regs, reg, val);
}
int mgb4_regs_map(struct resource *res, struct mgb4_regs *regs);
void mgb4_regs_free(struct mgb4_regs *regs);
#endif