[PATCH SQUASH v7 10/18] media: rppx1: hist: Expose channel selection
From: Jai Luthra
Date: Fri Apr 10 2026 - 05:08:50 EST
The module supports selecting the sampling point (channel selector) in
the pipeline for histogram measurements.
Expose it in the uAPI and add support in the driver.
Note: This commit's changes will be squashed into the relevant uAPI and
driver commits. It is separate for now to ease review and highlight the
differences.
Signed-off-by: Jai Luthra <jai.luthra+renesas@xxxxxxxxxxxxxxxx>
---
drivers/media/platform/dreamchip/rppx1/rppx1_hist.c | 5 +++--
include/uapi/linux/media/dreamchip/rppx1-config.h | 2 ++
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/media/platform/dreamchip/rppx1/rppx1_hist.c b/drivers/media/platform/dreamchip/rppx1/rppx1_hist.c
index 6287f9c401dfc8ee7f1c19acef1a3e82c5036ac7..76642d2ec0959969e10a92be49c3b0995a0ea5b4 100644
--- a/drivers/media/platform/dreamchip/rppx1/rppx1_hist.c
+++ b/drivers/media/platform/dreamchip/rppx1/rppx1_hist.c
@@ -94,8 +94,9 @@ static int rppx1_hist_fill_params(struct rpp_module *mod,
return 0;
}
- /* Sample after demosaicing. */
- write(priv, mod->base + HIST_CHANNEL_SEL_REG, 7);
+ /* Select sample point */
+ write(priv, mod->base + HIST_CHANNEL_SEL_REG,
+ cfg->channel_sel & HIST_CHANNEL_SEL_CHANNEL_SELECT_MASK);
/*
* The RkISP1 histogram_predivider setting controls the pixel spacing
diff --git a/include/uapi/linux/media/dreamchip/rppx1-config.h b/include/uapi/linux/media/dreamchip/rppx1-config.h
index 2adf5f9e083b89c0308a8728f8468f326ab87c48..b247312cfde41510c6d678cb6482a3b22b9036b5 100644
--- a/include/uapi/linux/media/dreamchip/rppx1-config.h
+++ b/include/uapi/linux/media/dreamchip/rppx1-config.h
@@ -593,6 +593,7 @@ enum rppx1_histogram_mode {
* @header: block header (type = RPPX1_PARAMS_BLOCK_TYPE_HST_MEAS)
* @mode: histogram mode (from enum rppx1_histogram_mode)
* @histogram_predivider: process every Nth pixel
+ * @channel_sel: measurement point (see enum rppx1_[pre|post]_meas_chan)
* @meas_window: measurement window coordinates
* @hist_weight: weighting factors for sub-windows (5x5 grid)
*/
@@ -600,6 +601,7 @@ struct rppx1_params_hst_config {
struct v4l2_isp_params_block_header header;
__u32 mode;
__u8 histogram_predivider;
+ __u8 channel_sel;
struct rppx1_window meas_window;
__u8 hist_weight[RPPX1_HISTOGRAM_WEIGHT_GRIDS_SIZE];
};
--
2.53.0