From: Sakari Ailus <sakari.ailus@linux.intel.com>
To: Svyatoslav Ryhel <clamor95@gmail.com>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
linux-media@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v1 2/2] media: i2c: mt9m114: add support for Aptina MI1040
Date: Mon, 26 Jan 2026 11:35:27 +0200 [thread overview]
Message-ID: <aXc1XwD8Wo2yu4dv@kekkonen.localdomain> (raw)
In-Reply-To: <20260126083430.8247-3-clamor95@gmail.com>
Hi Svyatoslav,
Thanks for the patchset.
On Mon, Jan 26, 2026 at 10:34:30AM +0200, Svyatoslav Ryhel wrote:
> Slightly different version of MT9M114 camera module is used in a several
> devices like ASUS Nexus 7 (2012) or ASUS Transformer Prime TF201 and is
> called Aptina MI1040. Only difference found so far is lacking ability to
s/Only/The only/
> poll STATUS and COMMAND registers during power on sequence, which causes
> driver to fail with time out error. Add polling flag to diverge models and
> address quirk found in MI1040.
>
> Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
> ---
> drivers/media/i2c/mt9m114.c | 35 ++++++++++++++++++++++++++++-------
> 1 file changed, 28 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/media/i2c/mt9m114.c b/drivers/media/i2c/mt9m114.c
> index 4ec033c0ee84..d96a57ebcad4 100644
> --- a/drivers/media/i2c/mt9m114.c
> +++ b/drivers/media/i2c/mt9m114.c
> @@ -368,6 +368,10 @@ enum {
> * Data Structures
> */
>
> +struct mt9m114_model_info {
> + bool polling;
> +};
> +
> enum mt9m114_format_flag {
> MT9M114_FMT_FLAG_PARALLEL = BIT(0),
> MT9M114_FMT_FLAG_CSI2 = BIT(1),
> @@ -421,6 +425,8 @@ struct mt9m114 {
>
> struct v4l2_ctrl *tpg[4];
> } ifp;
> +
> + const struct mt9m114_model_info *info;
> };
>
> /* -----------------------------------------------------------------------------
> @@ -2186,9 +2192,11 @@ static int mt9m114_power_on(struct mt9m114 *sensor)
> */
> usleep_range(44500, 50000);
>
> - ret = mt9m114_poll_command(sensor, MT9M114_COMMAND_REGISTER_SET_STATE);
> - if (ret < 0)
> - goto error_clock;
> + if (sensor->info->polling) {
> + ret = mt9m114_poll_command(sensor, MT9M114_COMMAND_REGISTER_SET_STATE);
> + if (ret < 0)
> + goto error_clock;
> + }
What does the datasheet say, is there a need to do something else instead?
As the polling is there to ensure firmware has done its job, the need
appears to still be there.
>
> if (sensor->bus_cfg.bus_type == V4L2_MBUS_PARALLEL) {
> /*
> @@ -2207,9 +2215,11 @@ static int mt9m114_power_on(struct mt9m114 *sensor)
> * reaches the standby mode (either initiated manually above in
> * parallel mode, or automatically after reset in MIPI mode).
> */
> - ret = mt9m114_poll_state(sensor, MT9M114_SYS_STATE_STANDBY);
> - if (ret < 0)
> - goto error_clock;
> + if (sensor->info->polling) {
> + ret = mt9m114_poll_state(sensor, MT9M114_SYS_STATE_STANDBY);
Ditto.
> + if (ret < 0)
> + goto error_clock;
> + }
>
> return 0;
>
> @@ -2421,6 +2431,8 @@ static int mt9m114_probe(struct i2c_client *client)
> if (ret < 0)
> return ret;
>
> + sensor->info = of_device_get_match_data(dev);
You can use device_get_match_data() here.
> +
> /* Acquire clocks, GPIOs and regulators. */
> sensor->clk = devm_v4l2_sensor_clk_get(dev, NULL);
> if (IS_ERR(sensor->clk)) {
> @@ -2539,8 +2551,17 @@ static void mt9m114_remove(struct i2c_client *client)
> pm_runtime_set_suspended(dev);
> }
>
> +static const struct mt9m114_model_info mt9m114_models_default = {
> + .polling = true,
> +};
> +
> +static const struct mt9m114_model_info mt9m114_models_aptina = {
> + .polling = false,
> +};
> +
> static const struct of_device_id mt9m114_of_ids[] = {
> - { .compatible = "onnn,mt9m114" },
> + { .compatible = "onnn,mt9m114", .data = &mt9m114_models_default },
> + { .compatible = "aptina,mi1040", .data = &mt9m114_models_aptina },
> { /* sentinel */ },
The sentinel entry shouldn't have a comma. Feel free to fix that while at
it.
> };
> MODULE_DEVICE_TABLE(of, mt9m114_of_ids);
--
Kind regards,
Sakari Ailus
next prev parent reply other threads:[~2026-01-26 9:35 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-26 8:34 [PATCH v1 0/2] media: i2c: mt9m114: add support for Aptina MI1040 Svyatoslav Ryhel
2026-01-26 8:34 ` [PATCH v1 1/2] dt-bindings: media: mt9m114: document MI1040 sensor Svyatoslav Ryhel
2026-01-26 20:12 ` Conor Dooley
2026-01-26 8:34 ` [PATCH v1 2/2] media: i2c: mt9m114: add support for Aptina MI1040 Svyatoslav Ryhel
2026-01-26 9:35 ` Sakari Ailus [this message]
2026-01-26 9:50 ` Svyatoslav Ryhel
2026-01-26 10:05 ` Laurent Pinchart
2026-01-26 11:50 ` Svyatoslav Ryhel
2026-01-28 13:40 ` Laurent Pinchart
2026-01-28 14:56 ` Svyatoslav Ryhel
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=aXc1XwD8Wo2yu4dv@kekkonen.localdomain \
--to=sakari.ailus@linux.intel.com \
--cc=clamor95@gmail.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=krzk+dt@kernel.org \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=robh@kernel.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