devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chun-Kuang Hu <chunkuang.hu@kernel.org>
To: Louis Kuo <louis.kuo@mediatek.com>
Cc: hans.verkuil@cisco.com,
	laurent.pinchart+renesas@ideasonboard.com,
	"Tomasz Figa" <tfiga@chromium.org>,
	keiichiw@chromium.org,
	"Matthias Brugger" <matthias.bgg@gmail.com>,
	"Mauro Carvalho Chehab" <mchehab@kernel.org>,
	devicetree@vger.kernel.org,
	"Sean Cheng (鄭昇弘)" <Sean.Cheng@mediatek.com>,
	srv_heupstream <srv_heupstream@mediatek.com>,
	"Jerry-ch Chen (陳敬憲)" <Jerry-ch.Chen@mediatek.com>,
	"Jungo Lin (林明俊)" <jungo.lin@mediatek.com>,
	"Sj Huang (黃信璋)" <sj.huang@mediatek.com>,
	yuzhao@chromium.org,
	"moderated list:ARM/Mediatek SoC support"
	<linux-mediatek@lists.infradead.org>,
	zwisler@chromium.org,
	"Christie Yu (游雅惠)" <christie.yu@mediatek.com>,
	"Frederic Chen (陳俊元)" <frederic.chen@mediatek.com>,
	"Linux ARM" <linux-arm-kernel@lists.infradead.org>,
	linux-media@vger.kernel.org
Subject: Re: [RFC PATCH V7 1/3] media: platform: mtk-isp: Add Mediatek sensor interface driver
Date: Mon, 13 Jul 2020 07:14:29 +0800	[thread overview]
Message-ID: <CAAOTY__fRjytz9w4zA6rOoYKzjyRH-j=ASFqNMVNShBYGd6-5Q@mail.gmail.com> (raw)
In-Reply-To: <20200708104023.3225-2-louis.kuo@mediatek.com>

Hi, Louis:

Louis Kuo <louis.kuo@mediatek.com> 於 2020年7月8日 週三 下午6:41寫道:
>
> This patch adds Mediatek's sensor interface driver. Sensor interface
> driver is a MIPI-CSI2 host driver, namely, a HW camera interface controller.
> It support a widely adopted, simple, high-speed protocol primarily intended
> for point-to-point image and video transmission between cameras and host
> devices. The mtk-isp directory will contain drivers for multiple IP blocks
> found in Mediatek ISP system. It will include ISP Pass 1 driver, sensor
> interface driver, DIP driver and face detection driver.
>
> Signed-off-by: Louis Kuo <louis.kuo@mediatek.com>
> ---

[snip]

> +
> +enum CFG_CSI_PORT {
> +       CFG_CSI_PORT_0 = 0x0,   /* 4D1C */
> +       CFG_CSI_PORT_1,         /* 4D1C */
> +       CFG_CSI_PORT_2,         /* 4D1C */
> +       CFG_CSI_PORT_0A,        /* 2D1C */
> +       CFG_CSI_PORT_0B,        /* 2D1C */
> +       CFG_CSI_PORT_MAX_NUM,
> +       CFG_CSI_PORT_NONE       /*for non-MIPI sensor */
> +};
> +
> +enum PIXEL_MODE {
> +       ONE_PIXEL_MODE  = 0x0,
> +       TWO_PIXEL_MODE  = 0x1,
> +       FOUR_PIXEL_MODE = 0x2,
> +};
> +
> +enum SENINF_ID {
> +       SENINF_1 = 0x0,
> +       SENINF_2 = 0x1,
> +       SENINF_3 = 0x2,
> +       SENINF_4 = 0x3,
> +       SENINF_5 = 0x4,
> +       SENINF_NUM,
> +};
> +

[snip]

> +
> +static int seninf_link_setup(struct media_entity *entity,
> +                            const struct media_pad *local,
> +                            const struct media_pad *remote, u32 flags)
> +{
> +       struct v4l2_subdev *sd;
> +       struct mtk_seninf *priv;
> +       struct device *dev;
> +
> +       sd = media_entity_to_v4l2_subdev(entity);
> +       priv = v4l2_get_subdevdata(sd);
> +       dev = priv->dev;
> +
> +       if (!(flags & MEDIA_LNK_FL_ENABLED))
> +               return 0;
> +
> +       if (local->flags & MEDIA_PAD_FL_SOURCE) {
> +               priv->mux_sel = local->index - CAM_MUX_IDX_MIN;
> +       } else {
> +               /* Select port */
> +               priv->port = local->index;

I don't understand V4L2 much, but the port definition is inside this
file, how does the caller know what to pass to here? Could you explain
how does it work?

Regards,
Chun-Kuang.

> +               if (priv->port >= NUM_SENSORS) {
> +                       dev_err(dev, "port index is over number of ports\n");
> +                       return -EINVAL;
> +               }
> +       }
> +
> +       return 0;
> +}
> +

  parent reply	other threads:[~2020-07-12 23:14 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-08 10:40 [RFC PATCH V7 0/3] media: support Mediatek sensor interface driver Louis Kuo
2020-07-08 10:40 ` [RFC PATCH V7 1/3] media: platform: mtk-isp: Add " Louis Kuo
2020-07-09 13:12   ` Chun-Kuang Hu
2020-07-17  2:55     ` Louis Kuo (郭德寧)
2020-07-17 14:21       ` Chun-Kuang Hu
2020-07-17 14:33         ` Tomasz Figa
2020-07-17 15:47           ` Chun-Kuang Hu
2020-07-17 18:19             ` Tomasz Figa
2020-07-12 23:14   ` Chun-Kuang Hu [this message]
2020-07-21 16:39   ` Tomasz Figa
2020-07-08 10:40 ` [RFC PATCH V7 2/3] dt-bindings: mt8183: Add sensor interface dt-bindings Louis Kuo
2020-07-09 17:01   ` Rob Herring
2020-07-09 17:03   ` Rob Herring
2020-07-08 10:40 ` [RFC PATCH V7 3/3] dts: arm64: mt8183: Add sensor interface nodes Louis Kuo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAAOTY__fRjytz9w4zA6rOoYKzjyRH-j=ASFqNMVNShBYGd6-5Q@mail.gmail.com' \
    --to=chunkuang.hu@kernel.org \
    --cc=Jerry-ch.Chen@mediatek.com \
    --cc=Sean.Cheng@mediatek.com \
    --cc=christie.yu@mediatek.com \
    --cc=devicetree@vger.kernel.org \
    --cc=frederic.chen@mediatek.com \
    --cc=hans.verkuil@cisco.com \
    --cc=jungo.lin@mediatek.com \
    --cc=keiichiw@chromium.org \
    --cc=laurent.pinchart+renesas@ideasonboard.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=louis.kuo@mediatek.com \
    --cc=matthias.bgg@gmail.com \
    --cc=mchehab@kernel.org \
    --cc=sj.huang@mediatek.com \
    --cc=srv_heupstream@mediatek.com \
    --cc=tfiga@chromium.org \
    --cc=yuzhao@chromium.org \
    --cc=zwisler@chromium.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).