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