[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <0bd19e578cd36f4b4019dd6dc1fd51b53be7774f.camel@mediatek.com>
Date: Wed, 31 Jul 2024 03:35:41 +0000
From: CK Hu (胡俊光) <ck.hu@...iatek.com>
To: "mchehab@...nel.org" <mchehab@...nel.org>, "conor+dt@...nel.org"
<conor+dt@...nel.org>, "robh@...nel.org" <robh@...nel.org>,
Andy Hsieh (謝智皓) <Andy.Hsieh@...iatek.com>,
"jstephan@...libre.com" <jstephan@...libre.com>, "matthias.bgg@...il.com"
<matthias.bgg@...il.com>, "laurent.pinchart@...asonboard.com"
<laurent.pinchart@...asonboard.com>, "krzk+dt@...nel.org"
<krzk+dt@...nel.org>, "angelogioacchino.delregno@...labora.com"
<angelogioacchino.delregno@...labora.com>
CC: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-mediatek@...ts.infradead.org" <linux-mediatek@...ts.infradead.org>,
"linux-media@...r.kernel.org" <linux-media@...r.kernel.org>,
"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
"paul.elder@...asonboard.com" <paul.elder@...asonboard.com>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>, "fsylvestre@...libre.com"
<fsylvestre@...libre.com>, "pnguyen@...libre.com" <pnguyen@...libre.com>
Subject: Re: [PATCH v6 4/5] media: platform: mediatek: isp_30: add mediatek
ISP3.0 camsv
Hi, Julien:
On Mon, 2024-07-29 at 16:48 +0200, Julien Stephan wrote:
>
> External email : Please do not click links or open attachments until you have verified the sender or the content.
> From: Phi-bang Nguyen <pnguyen@...libre.com>
>
> This driver provides a path to bypass the SoC ISP so that image data
> coming from the SENINF can go directly into memory without any image
> processing. This allows the use of an external ISP.
>
> Signed-off-by: Phi-bang Nguyen <pnguyen@...libre.com>
> Signed-off-by: Florian Sylvestre <fsylvestre@...libre.com>
> [Paul Elder fix irq locking]
> Signed-off-by: Paul Elder <paul.elder@...asonboard.com>
> Co-developed-by: Laurent Pinchart <laurent.pinchart@...asonboard.com>
> Signed-off-by: Laurent Pinchart <laurent.pinchart@...asonboard.com>
> Co-developed-by: Julien Stephan <jstephan@...libre.com>
> Signed-off-by: Julien Stephan <jstephan@...libre.com>
> ---
[snip]
> +static void mtk_camsv30_setup(struct mtk_cam_dev *cam_dev, u32 w, u32 h,
> + u32 bpl, u32 mbus_fmt)
> +{
> +const struct mtk_cam_conf *conf = cam_dev->conf;
> +u32 int_en = INT_ST_MASK_CAMSV;
> +u32 tmp;
> +struct mtk_cam_sparams sparams;
> +
> +fmt_to_sparams(mbus_fmt, &sparams);
> +
> +if (pm_runtime_resume_and_get(cam_dev->dev) < 0) {
> +dev_err(cam_dev->dev, "failed to get pm_runtime\n");
> +return;
> +}
> +
> +writel(conf->tg_sen_mode, cam_dev->regs_tg + CAMSV_TG_SEN_MODE);
> +
> +writel((w * sparams.w_factor) << 16U, cam_dev->regs_tg + CAMSV_TG_SEN_GRAB_PXL);
> +
> +writel(h << 16U, cam_dev->regs_tg + CAMSV_TG_SEN_GRAB_LIN);
> +
> +/* YUV_U2S_DIS: disable YUV sensor unsigned to signed */
> +writel(0x1000U, cam_dev->regs_tg + CAMSV_TG_PATH_CFG);
> +
> +/* Reset cam */
> +writel(CAMSV_SW_RST, cam_dev->regs + CAMSV_SW_CTL);
> +writel(0x0U, cam_dev->regs + CAMSV_SW_CTL);
> +writel(CAMSV_IMGO_RST_TRIG, cam_dev->regs + CAMSV_SW_CTL);
> +
> +readl_poll_timeout_atomic(cam_dev->regs + CAMSV_SW_CTL, tmp,
> + (tmp == (CAMSV_IMGO_RST_TRIG | CAMSV_IMGO_RST_ST)), 10, 200);
> +
> +writel(0x0U, cam_dev->regs + CAMSV_SW_CTL);
> +
> +writel(int_en, cam_dev->regs + CAMSV_INT_EN);
writel(INT_ST_MASK_CAMSV, cam_dev->regs + CAMSV_INT_EN);
int_en is used only once, so drop it.
> +
> +writel(conf->module_en | sparams.module_en_pak,
conf->module_en is 0x40000001, and sparams.module_en_pak could be 0x4 or 0x8.
The result is always zero. What does this do here?
Regards,
CK
> + cam_dev->regs + CAMSV_MODULE_EN);
> +writel(sparams.fmt_sel, cam_dev->regs + CAMSV_FMT_SEL);
> +writel(sparams.pak, cam_dev->regs + CAMSV_PAK);
> +
> +writel(bpl - 1U, cam_dev->regs_img0 + CAMSV_IMGO_SV_XSIZE);
> +writel(h - 1U, cam_dev->regs_img0 + CAMSV_IMGO_SV_YSIZE);
> +
> +writel(sparams.imgo_stride | bpl, cam_dev->regs_img0 + CAMSV_IMGO_SV_STRIDE);
> +
> +writel(conf->imgo_con, cam_dev->regs_img0 + CAMSV_IMGO_SV_CON);
> +writel(conf->imgo_con2, cam_dev->regs_img0 + CAMSV_IMGO_SV_CON2);
> +
> +/* CMOS_EN first */
> +writel(readl(cam_dev->regs_tg + CAMSV_TG_SEN_MODE) | CAMSV_TG_SEN_MODE_CMOS_EN,
> +cam_dev->regs_tg + CAMSV_TG_SEN_MODE);
> +
> +/* finally, CAMSV_MODULE_EN : IMGO_EN */
> +writel(readl(cam_dev->regs + CAMSV_MODULE_EN) | CAMSV_MODULE_EN_IMGO_EN,
> + cam_dev->regs + CAMSV_MODULE_EN);
> +
> +pm_runtime_put_autosuspend(cam_dev->dev);
> +}
> +
>
Powered by blists - more mailing lists