mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-09 19:51:25 -04:00
media: rzg2l-cru: Add function pointer to configure CSI
Add a `csi_setup` function pointer to the `rzg2l_cru_info` structure and pass it as part of the OF data. On RZ/G3E and RZ/V2H(P) SoCs, additional register configurations are required compared to the RZ/G2L SoC. Modify `rzg2l_cru_csi2_setup()` to be referenced through this function pointer and update the code to use it accordingly. This change is in preparation for adding support for RZ/G3E and RZ/V2H(P) SoCs. Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com> Link: https://lore.kernel.org/r/20250411170624.472257-17-tommaso.merciai.xr@bp.renesas.com Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
This commit is contained in:
committed by
Hans Verkuil
parent
446c645f7f
commit
3c3433c5b3
@@ -360,6 +360,7 @@ static const struct rzg2l_cru_info rzgl2_cru_info = {
|
||||
.enable_interrupts = rzg2l_cru_enable_interrupts,
|
||||
.disable_interrupts = rzg2l_cru_disable_interrupts,
|
||||
.fifo_empty = rzg2l_fifo_empty,
|
||||
.csi_setup = rzg2l_cru_csi2_setup,
|
||||
};
|
||||
|
||||
static const struct of_device_id rzg2l_cru_of_id_table[] = {
|
||||
|
||||
@@ -89,6 +89,9 @@ struct rzg2l_cru_info {
|
||||
void (*enable_interrupts)(struct rzg2l_cru_dev *cru);
|
||||
void (*disable_interrupts)(struct rzg2l_cru_dev *cru);
|
||||
bool (*fifo_empty)(struct rzg2l_cru_dev *cru);
|
||||
void (*csi_setup)(struct rzg2l_cru_dev *cru,
|
||||
const struct rzg2l_cru_ip_format *ip_fmt,
|
||||
u8 csi_vc);
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -187,5 +190,8 @@ void rzg2l_cru_enable_interrupts(struct rzg2l_cru_dev *cru);
|
||||
void rzg2l_cru_disable_interrupts(struct rzg2l_cru_dev *cru);
|
||||
|
||||
bool rzg2l_fifo_empty(struct rzg2l_cru_dev *cru);
|
||||
void rzg2l_cru_csi2_setup(struct rzg2l_cru_dev *cru,
|
||||
const struct rzg2l_cru_ip_format *ip_fmt,
|
||||
u8 csi_vc);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -242,9 +242,9 @@ static void rzg2l_cru_initialize_axi(struct rzg2l_cru_dev *cru)
|
||||
rzg2l_cru_write(cru, AMnAXIATTR, amnaxiattr);
|
||||
}
|
||||
|
||||
static void rzg2l_cru_csi2_setup(struct rzg2l_cru_dev *cru,
|
||||
const struct rzg2l_cru_ip_format *ip_fmt,
|
||||
u8 csi_vc)
|
||||
void rzg2l_cru_csi2_setup(struct rzg2l_cru_dev *cru,
|
||||
const struct rzg2l_cru_ip_format *ip_fmt,
|
||||
u8 csi_vc)
|
||||
{
|
||||
const struct rzg2l_cru_info *info = cru->info;
|
||||
u32 icnmc = ICnMC_INF(ip_fmt->datatype);
|
||||
@@ -266,7 +266,7 @@ static int rzg2l_cru_initialize_image_conv(struct rzg2l_cru_dev *cru,
|
||||
const struct rzg2l_cru_ip_format *cru_ip_fmt;
|
||||
|
||||
cru_ip_fmt = rzg2l_cru_ip_code_to_fmt(ip_sd_fmt->code);
|
||||
rzg2l_cru_csi2_setup(cru, cru_ip_fmt, csi_vc);
|
||||
info->csi_setup(cru, cru_ip_fmt, csi_vc);
|
||||
|
||||
/* Output format */
|
||||
cru_video_fmt = rzg2l_cru_ip_format_to_fmt(cru->format.pixelformat);
|
||||
|
||||
Reference in New Issue
Block a user