Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IMX290 120fps support #6435

Draft
wants to merge 2 commits into
base: rpi-6.6.y
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion arch/arm/boot/dts/overlays/imx290_327-overlay.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
__dormant__ {
data-lanes = <1 2 3 4>;
link-frequencies =
/bits/ 64 <222750000 148500000>;
/bits/ 64 <445500000 297000000>;
};
};

Expand Down
36 changes: 22 additions & 14 deletions drivers/media/i2c/imx290.c
Original file line number Diff line number Diff line change
Expand Up @@ -440,18 +440,18 @@
*/
static inline const s64 *imx290_link_freqs_ptr(const struct imx290 *imx290)
{
if (imx290->nlanes == 2)
// if (imx290->nlanes == 2)
return imx290_link_freq_2lanes;
else
return imx290_link_freq_4lanes;
// else
// return imx290_link_freq_4lanes;
}

static inline int imx290_link_freqs_num(const struct imx290 *imx290)
{
if (imx290->nlanes == 2)
// if (imx290->nlanes == 2)
return ARRAY_SIZE(imx290_link_freq_2lanes);
else
return ARRAY_SIZE(imx290_link_freq_4lanes);
// else
// return ARRAY_SIZE(imx290_link_freq_4lanes);
}

static const struct imx290_clk_cfg imx290_1080p_clock_config[] = {
Expand Down Expand Up @@ -579,14 +579,14 @@
.bpp = 10,
.regs = imx290_10bit_settings,
.num_regs = ARRAY_SIZE(imx290_10bit_settings),
}, {
/* }, {
.code = {
[IMX290_VARIANT_COLOUR] = MEDIA_BUS_FMT_SRGGB12_1X12,
[IMX290_VARIANT_MONO] = MEDIA_BUS_FMT_Y12_1X12
},
.bpp = 12,
.regs = imx290_12bit_settings,
.num_regs = ARRAY_SIZE(imx290_12bit_settings),
.num_regs = ARRAY_SIZE(imx290_12bit_settings), */

Check failure on line 589 in drivers/media/i2c/imx290.c

View workflow job for this annotation

GitHub Actions / checkpatch review

WARNING: Block comments use a trailing */ on a separate line
}
};

Expand Down Expand Up @@ -649,7 +649,7 @@
&ret);
cci_write(imx290->regmap, IMX290_CSI_LANE_MODE, imx290->nlanes - 1,
&ret);
cci_write(imx290->regmap, IMX290_FR_FDG_SEL, 0x01, &ret);
cci_write(imx290->regmap, IMX290_FR_FDG_SEL, imx290->nlanes == 4 ? 0x00 : 0x01, &ret);

return ret;
}
Expand Down Expand Up @@ -739,7 +739,7 @@
struct imx290, ctrls);
const struct v4l2_mbus_framefmt *format;
struct v4l2_subdev_state *state;
int ret = 0, vmax;
int ret = 0, vmax, hmax;

/*
* Return immediately for controls that don't need to be applied to the
Expand Down Expand Up @@ -800,8 +800,11 @@
break;

case V4L2_CID_HBLANK:
hmax = ctrl->val + imx290->current_mode->width;
if (imx290->nlanes == 4)
hmax >>= 1;
ret = cci_write(imx290->regmap, IMX290_HMAX,
ctrl->val + imx290->current_mode->width, NULL);
hmax, NULL);
break;

case V4L2_CID_HFLIP:
Expand Down Expand Up @@ -908,9 +911,14 @@
if (imx290->link_freq)
imx290->link_freq->flags |= V4L2_CTRL_FLAG_READ_ONLY;

v4l2_ctrl_new_std(&imx290->ctrls, &imx290_ctrl_ops, V4L2_CID_PIXEL_RATE,
IMX290_PIXEL_RATE, IMX290_PIXEL_RATE, 1,
IMX290_PIXEL_RATE);
if (imx290->nlanes == 4)
v4l2_ctrl_new_std(&imx290->ctrls, &imx290_ctrl_ops, V4L2_CID_PIXEL_RATE,
IMX290_PIXEL_RATE << 1, IMX290_PIXEL_RATE << 1, 1,
IMX290_PIXEL_RATE << 1);
else
v4l2_ctrl_new_std(&imx290->ctrls, &imx290_ctrl_ops, V4L2_CID_PIXEL_RATE,
IMX290_PIXEL_RATE, IMX290_PIXEL_RATE, 1,
IMX290_PIXEL_RATE);

v4l2_ctrl_new_std_menu_items(&imx290->ctrls, &imx290_ctrl_ops,
V4L2_CID_TEST_PATTERN,
Expand Down
Loading