xref: /linux/drivers/media/platform/dreamchip/rppx1/rppx1.h (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 #ifndef __MEDIA_RPPX1_H__
9 #define __MEDIA_RPPX1_H__
10 
11 #include <linux/device.h>
12 #include <linux/types.h>
13 
14 #include "rpp_module.h"
15 
16 #define RPPX1_IRQ_ID_256HIST			BIT(27)
17 #define RPPX1_IRQ_ID_PRE2_DPCC			BIT(25)
18 #define RPPX1_IRQ_ID_PRE1_DPCC			BIT(24)
19 #define RPPX1_IRQ_ID_MV_OUT_FRAME_OUT		BIT(23)
20 #define RPPX1_IRQ_ID_MV_OUT_OFF			BIT(22)
21 #define RPPX1_IRQ_ID_POST_AWB_MEAS		BIT(21)
22 #define RPPX1_IRQ_ID_POST_HIST_MEAS		BIT(20)
23 #define RPPX1_IRQ_ID_POST_TM			BIT(19)
24 #define RPPX1_IRQ_ID_PRE1_EXM			BIT(18)
25 #define RPPX1_IRQ_ID_PRE1_HIST			BIT(17)
26 #define RPPX1_IRQ_ID_PRE1_FRAME_IN		BIT(16)
27 #define RPPX1_IRQ_ID_PRE1_HSTART		BIT(15)
28 #define RPPX1_IRQ_ID_PRE1_VSTART		BIT(14)
29 #define RPPX1_IRQ_ID_PRE2_EXM			BIT(13)
30 #define RPPX1_IRQ_ID_PRE2_HIST			BIT(12)
31 #define RPPX1_IRQ_ID_PRE2_FRAME_IN		BIT(11)
32 #define RPPX1_IRQ_ID_PRE2_HSTART		BIT(10)
33 #define RPPX1_IRQ_ID_PRE2_VSTART		BIT(9)
34 #define RPPX1_IRQ_ID_OUT_FRAME			BIT(3)
35 #define RPPX1_IRQ_ID_OUT_OFF			BIT(2)
36 #define RPPX1_IRQ_ID_RMAP_MEAS			BIT(1)
37 #define RPPX1_IRQ_ID_RMAP_DONE			BIT(0)
38 
39 struct rppx1 {
40 	struct device *dev;
41 	void __iomem *base;
42 
43 	struct {
44 		struct rpp_module acq;
45 		struct rpp_module bls;
46 		struct rpp_module lin;
47 		struct rpp_module lsc;
48 		struct rpp_module awbg;
49 		struct rpp_module dpcc;
50 		struct rpp_module bd;
51 		struct rpp_module hist;
52 		struct rpp_module hist256;
53 		struct rpp_module exm;
54 	} pre1;
55 
56 	struct {
57 		struct rpp_module acq;
58 		struct rpp_module bls;
59 		struct rpp_module lin;
60 		struct rpp_module lsc;
61 		struct rpp_module awbg;
62 		struct rpp_module dpcc;
63 		struct rpp_module bd;
64 		struct rpp_module hist;
65 		struct rpp_module exm;
66 	} pre2;
67 
68 	struct {
69 		struct rpp_module awbg;
70 		struct rpp_module ccor;
71 		struct rpp_module hist;
72 		struct rpp_module db;
73 		struct rpp_module cac;
74 		struct rpp_module ltm;
75 		struct rpp_module ltmmeas;
76 		struct rpp_module wbmeas;
77 		struct rpp_module bdrgb;
78 		struct rpp_module shrp;
79 	} post;
80 
81 	struct {
82 		struct rpp_module ga;
83 		struct rpp_module is;
84 		struct rpp_module ccor;
85 		struct rpp_module outif;
86 		struct rpp_module outregs;
87 	} hv;
88 
89 	struct {
90 		struct rpp_module ga;
91 		struct rpp_module is;
92 		struct rpp_module ccor;
93 		struct rpp_module outif;
94 		struct rpp_module outregs;
95 		struct rpp_module xyz2luv;
96 	} mv;
97 
98 	struct rpp_module rmap;
99 	struct rpp_module rmapmeas;
100 };
101 
102 void rppx1_write(struct rppx1 *rpp, u32 offset, u32 value);
103 u32 rppx1_read(struct rppx1 *rpp, u32 offset);
104 
105 #endif /* __MEDIA_RPPX1_H__ */
106