Commit 91719b27 authored by Bryan O'Donoghue's avatar Bryan O'Donoghue Committed by Hans Verkuil

media: qcom: camss: Pass line_num from compat resources

line_num indicates the number of RDI - raw data interface channels which
are associated with a given IFE/VFE - image/video front end.

On several SoCs the RDI number is not static for each VFE - for example
on sm8250 VFE Lite has four RDIs where regular VFE has three.

Assigning line_num statically in the subdev_init() phase initialises
each VFE to the lower number, meaning in practical terms that we are
lobbing off one RDI on some VFEs.

Interrupt handling uses static for (i = RDI0; i < RDI2; i++) {} in some
of our VFE blocks but this can't work for situations where we have a
mixture of VFE @ 3 RDI and VFE-lite @ 4 RDI blocks.

First step to remediate is to pass line_num from a compat string
controlled data-structure and do so on a per-VFE basis.

Later patches will assign the correct number of RDI blocks per VFE.
Signed-off-by: default avatarBryan O'Donoghue <bryan.odonoghue@linaro.org>
Reviewed-by: default avatarKonrad Dybcio <konrad.dybcio@linaro.org>
Reviewed-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
parent 5900b051
...@@ -753,8 +753,6 @@ static void vfe_subdev_init(struct device *dev, struct vfe_device *vfe) ...@@ -753,8 +753,6 @@ static void vfe_subdev_init(struct device *dev, struct vfe_device *vfe)
{ {
vfe->isr_ops = vfe_isr_ops_170; vfe->isr_ops = vfe_isr_ops_170;
vfe->video_ops = vfe_video_ops_170; vfe->video_ops = vfe_video_ops_170;
vfe->line_num = VFE_LINE_NUM_GEN2;
} }
const struct vfe_hw_ops vfe_ops_170 = { const struct vfe_hw_ops vfe_ops_170 = {
......
...@@ -992,8 +992,6 @@ static void vfe_subdev_init(struct device *dev, struct vfe_device *vfe) ...@@ -992,8 +992,6 @@ static void vfe_subdev_init(struct device *dev, struct vfe_device *vfe)
vfe->isr_ops = vfe_isr_ops_gen1; vfe->isr_ops = vfe_isr_ops_gen1;
vfe->ops_gen1 = &vfe_ops_gen1_4_1; vfe->ops_gen1 = &vfe_ops_gen1_4_1;
vfe->video_ops = vfe_video_ops_gen1; vfe->video_ops = vfe_video_ops_gen1;
vfe->line_num = VFE_LINE_NUM_GEN1;
} }
const struct vfe_hw_ops vfe_ops_4_1 = { const struct vfe_hw_ops vfe_ops_4_1 = {
......
...@@ -1188,8 +1188,6 @@ static void vfe_subdev_init(struct device *dev, struct vfe_device *vfe) ...@@ -1188,8 +1188,6 @@ static void vfe_subdev_init(struct device *dev, struct vfe_device *vfe)
vfe->isr_ops = vfe_isr_ops_gen1; vfe->isr_ops = vfe_isr_ops_gen1;
vfe->ops_gen1 = &vfe_ops_gen1_4_7; vfe->ops_gen1 = &vfe_ops_gen1_4_7;
vfe->video_ops = vfe_video_ops_gen1; vfe->video_ops = vfe_video_ops_gen1;
vfe->line_num = VFE_LINE_NUM_GEN1;
} }
const struct vfe_hw_ops vfe_ops_4_7 = { const struct vfe_hw_ops vfe_ops_4_7 = {
......
...@@ -1173,8 +1173,6 @@ static void vfe_subdev_init(struct device *dev, struct vfe_device *vfe) ...@@ -1173,8 +1173,6 @@ static void vfe_subdev_init(struct device *dev, struct vfe_device *vfe)
vfe->isr_ops = vfe_isr_ops_gen1; vfe->isr_ops = vfe_isr_ops_gen1;
vfe->ops_gen1 = &vfe_ops_gen1_4_8; vfe->ops_gen1 = &vfe_ops_gen1_4_8;
vfe->video_ops = vfe_video_ops_gen1; vfe->video_ops = vfe_video_ops_gen1;
vfe->line_num = VFE_LINE_NUM_GEN1;
} }
const struct vfe_hw_ops vfe_ops_4_8 = { const struct vfe_hw_ops vfe_ops_4_8 = {
......
...@@ -569,7 +569,6 @@ static const struct camss_video_ops vfe_video_ops_480 = { ...@@ -569,7 +569,6 @@ static const struct camss_video_ops vfe_video_ops_480 = {
static void vfe_subdev_init(struct device *dev, struct vfe_device *vfe) static void vfe_subdev_init(struct device *dev, struct vfe_device *vfe)
{ {
vfe->video_ops = vfe_video_ops_480; vfe->video_ops = vfe_video_ops_480;
vfe->line_num = MAX_VFE_OUTPUT_LINES;
} }
const struct vfe_hw_ops vfe_ops_480 = { const struct vfe_hw_ops vfe_ops_480 = {
......
...@@ -1305,6 +1305,11 @@ int msm_vfe_subdev_init(struct camss *camss, struct vfe_device *vfe, ...@@ -1305,6 +1305,11 @@ int msm_vfe_subdev_init(struct camss *camss, struct vfe_device *vfe,
default: default:
return -EINVAL; return -EINVAL;
} }
if (!res->line_num)
return -EINVAL;
vfe->line_num = res->line_num;
vfe->ops->subdev_init(dev, vfe); vfe->ops->subdev_init(dev, vfe);
/* Memory */ /* Memory */
......
...@@ -123,7 +123,8 @@ static const struct camss_subdev_resources vfe_res_8x16[] = { ...@@ -123,7 +123,8 @@ static const struct camss_subdev_resources vfe_res_8x16[] = {
{ 0 }, { 0 },
{ 0 } }, { 0 } },
.reg = { "vfe0" }, .reg = { "vfe0" },
.interrupt = { "vfe0" } .interrupt = { "vfe0" },
.line_num = VFE_LINE_NUM_GEN1,
} }
}; };
...@@ -263,7 +264,8 @@ static const struct camss_subdev_resources vfe_res_8x96[] = { ...@@ -263,7 +264,8 @@ static const struct camss_subdev_resources vfe_res_8x96[] = {
{ 0 }, { 0 },
{ 0 } }, { 0 } },
.reg = { "vfe0" }, .reg = { "vfe0" },
.interrupt = { "vfe0" } .interrupt = { "vfe0" },
.line_num = VFE_LINE_NUM_GEN1,
}, },
/* VFE1 */ /* VFE1 */
...@@ -281,7 +283,8 @@ static const struct camss_subdev_resources vfe_res_8x96[] = { ...@@ -281,7 +283,8 @@ static const struct camss_subdev_resources vfe_res_8x96[] = {
{ 0 }, { 0 },
{ 0 } }, { 0 } },
.reg = { "vfe1" }, .reg = { "vfe1" },
.interrupt = { "vfe1" } .interrupt = { "vfe1" },
.line_num = VFE_LINE_NUM_GEN1,
} }
}; };
...@@ -442,7 +445,8 @@ static const struct camss_subdev_resources vfe_res_660[] = { ...@@ -442,7 +445,8 @@ static const struct camss_subdev_resources vfe_res_660[] = {
{ 0 }, { 0 },
{ 0 } }, { 0 } },
.reg = { "vfe0" }, .reg = { "vfe0" },
.interrupt = { "vfe0" } .interrupt = { "vfe0" },
.line_num = VFE_LINE_NUM_GEN1,
}, },
/* VFE1 */ /* VFE1 */
...@@ -463,7 +467,8 @@ static const struct camss_subdev_resources vfe_res_660[] = { ...@@ -463,7 +467,8 @@ static const struct camss_subdev_resources vfe_res_660[] = {
{ 0 }, { 0 },
{ 0 } }, { 0 } },
.reg = { "vfe1" }, .reg = { "vfe1" },
.interrupt = { "vfe1" } .interrupt = { "vfe1" },
.line_num = VFE_LINE_NUM_GEN1,
} }
}; };
...@@ -621,7 +626,8 @@ static const struct camss_subdev_resources vfe_res_845[] = { ...@@ -621,7 +626,8 @@ static const struct camss_subdev_resources vfe_res_845[] = {
{ 19200000, 75000000, 384000000, 538666667 }, { 19200000, 75000000, 384000000, 538666667 },
{ 384000000 } }, { 384000000 } },
.reg = { "vfe0" }, .reg = { "vfe0" },
.interrupt = { "vfe0" } .interrupt = { "vfe0" },
.line_num = VFE_LINE_NUM_GEN2,
}, },
/* VFE1 */ /* VFE1 */
...@@ -641,7 +647,8 @@ static const struct camss_subdev_resources vfe_res_845[] = { ...@@ -641,7 +647,8 @@ static const struct camss_subdev_resources vfe_res_845[] = {
{ 19200000, 75000000, 384000000, 538666667 }, { 19200000, 75000000, 384000000, 538666667 },
{ 384000000 } }, { 384000000 } },
.reg = { "vfe1" }, .reg = { "vfe1" },
.interrupt = { "vfe1" } .interrupt = { "vfe1" },
.line_num = VFE_LINE_NUM_GEN2,
}, },
/* VFE-lite */ /* VFE-lite */
...@@ -660,7 +667,8 @@ static const struct camss_subdev_resources vfe_res_845[] = { ...@@ -660,7 +667,8 @@ static const struct camss_subdev_resources vfe_res_845[] = {
{ 19200000, 75000000, 384000000, 538666667 }, { 19200000, 75000000, 384000000, 538666667 },
{ 384000000 } }, { 384000000 } },
.reg = { "vfe_lite" }, .reg = { "vfe_lite" },
.interrupt = { "vfe_lite" } .interrupt = { "vfe_lite" },
.line_num = VFE_LINE_NUM_GEN2,
} }
}; };
...@@ -787,7 +795,8 @@ static const struct camss_subdev_resources vfe_res_8250[] = { ...@@ -787,7 +795,8 @@ static const struct camss_subdev_resources vfe_res_8250[] = {
{ 0 }, { 0 },
{ 0 } }, { 0 } },
.reg = { "vfe0" }, .reg = { "vfe0" },
.interrupt = { "vfe0" } .interrupt = { "vfe0" },
.line_num = 4,
}, },
/* VFE1 */ /* VFE1 */
{ {
...@@ -805,7 +814,8 @@ static const struct camss_subdev_resources vfe_res_8250[] = { ...@@ -805,7 +814,8 @@ static const struct camss_subdev_resources vfe_res_8250[] = {
{ 0 }, { 0 },
{ 0 } }, { 0 } },
.reg = { "vfe1" }, .reg = { "vfe1" },
.interrupt = { "vfe1" } .interrupt = { "vfe1" },
.line_num = 4,
}, },
/* VFE2 (lite) */ /* VFE2 (lite) */
{ {
...@@ -822,7 +832,8 @@ static const struct camss_subdev_resources vfe_res_8250[] = { ...@@ -822,7 +832,8 @@ static const struct camss_subdev_resources vfe_res_8250[] = {
{ 400000000, 480000000 }, { 400000000, 480000000 },
{ 0 } }, { 0 } },
.reg = { "vfe_lite0" }, .reg = { "vfe_lite0" },
.interrupt = { "vfe_lite0" } .interrupt = { "vfe_lite0" },
.line_num = 4,
}, },
/* VFE3 (lite) */ /* VFE3 (lite) */
{ {
...@@ -839,7 +850,8 @@ static const struct camss_subdev_resources vfe_res_8250[] = { ...@@ -839,7 +850,8 @@ static const struct camss_subdev_resources vfe_res_8250[] = {
{ 400000000, 480000000 }, { 400000000, 480000000 },
{ 0 } }, { 0 } },
.reg = { "vfe_lite1" }, .reg = { "vfe_lite1" },
.interrupt = { "vfe_lite1" } .interrupt = { "vfe_lite1" },
.line_num = 4,
}, },
}; };
......
...@@ -48,6 +48,7 @@ struct camss_subdev_resources { ...@@ -48,6 +48,7 @@ struct camss_subdev_resources {
u32 clock_rate[CAMSS_RES_MAX][CAMSS_RES_MAX]; u32 clock_rate[CAMSS_RES_MAX][CAMSS_RES_MAX];
char *reg[CAMSS_RES_MAX]; char *reg[CAMSS_RES_MAX];
char *interrupt[CAMSS_RES_MAX]; char *interrupt[CAMSS_RES_MAX];
u8 line_num;
}; };
struct icc_bw_tbl { struct icc_bw_tbl {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment