xref: /linux/drivers/media/platform/dreamchip/rppx1/rppx1_db.c (revision f4cdf7ca9a1fdcca413157df19753f388a5a224e)
1 // SPDX-License-Identifier: GPL-2.0
2 /*
3  * Copyright (C) 2026 Renesas Electronics Corp.
4  * Copyright (C) 2026 Ideas on Board Oy
5  * Copyright (C) 2026 Ragnatech AB
6  */
7 
8 #include "rpp_module.h"
9 
10 #define FILT_VERSION_REG		0x0000
11 
12 #define DEMOSAIC_REG			0x0004
13 #define DEMOSAIC_DEMOSAIC_BYPASS	BIT(16)
14 #define DEMOSAIC_DEMOSAIC_TH_MASK	GENMASK(15, 0)
15 
16 #define FILT_MODE_REG			0x0008
17 #define FILT_MODE_FILT_LP_SELECT_MASK	GENMASK(11, 8)
18 #define FILT_MODE_FILT_CHR_H_MODE_MASK	GENMASK(7, 6)
19 #define FILT_MODE_FILT_CHR_V_MODE_MASK	GENMASK(5, 4)
20 #define FILT_MODE_FILT_MODE		BIT(1)
21 #define FILT_MODE_FILT_ENABLE		BIT(0)
22 
23 #define FILT_THRESH_BL0_REG		0x000c
24 #define FILT_THRESH_BL1_REG		0x0010
25 #define FILT_THRESH_SH0_REG		0x0014
26 #define FILT_THRESH_SH1_REG		0x0018
27 #define FILT_LUM_WEIGHT_REG		0x001c
28 #define FILT_FAC_SH1_REG		0x0020
29 #define FILT_FAC_SH0_REG		0x0024
30 #define FILT_FAC_MID_REG		0x0028
31 #define FILT_FAC_BL0_REG		0x002c
32 #define FILT_FAC_BL1_REG		0x0030
33 
34 static int rppx1_db_probe(struct rpp_module *mod)
35 {
36 	/* Version check. */
37 	if (rpp_module_read(mod, FILT_VERSION_REG) != 5)
38 		return -EINVAL;
39 
40 	return 0;
41 }
42 
43 const struct rpp_module_ops rppx1_db_ops = {
44 	.probe = rppx1_db_probe,
45 };
46