* [PATCH v3 0/2] media: i2c: mt9m114: add support for Aptina MI1040
@ 2026-03-04 18:49 Svyatoslav Ryhel
2026-03-04 18:50 ` [PATCH v3 1/2] dt-bindings: media: mt9m114: document MI1040 sensor Svyatoslav Ryhel
2026-03-04 18:50 ` [PATCH v3 2/2] media: i2c: mt9m114: add support for Aptina MI1040 Svyatoslav Ryhel
0 siblings, 2 replies; 7+ messages in thread
From: Svyatoslav Ryhel @ 2026-03-04 18:49 UTC (permalink / raw)
To: Laurent Pinchart, Mauro Carvalho Chehab, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Sakari Ailus, Svyatoslav Ryhel
Cc: linux-media, devicetree, linux-kernel
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. Add support for MI1040 into MT9M114 driver and
document it in schema.
---
Changes in v3:
- state_polling > state_standby_polling
- added check for device_get_match_data
Changes in v2:
- dropped conditional polling of command register
- switched to device_get_match_data
- cosmetic changes and typo fixes
---
Svyatoslav Ryhel (2):
dt-bindings: media: mt9m114: document MI1040 sensor
media: i2c: mt9m114: add support for Aptina MI1040
.../bindings/media/i2c/onnn,mt9m114.yaml | 4 ++-
drivers/media/i2c/mt9m114.c | 31 ++++++++++++++++---
2 files changed, 29 insertions(+), 6 deletions(-)
--
2.51.0
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH v3 1/2] dt-bindings: media: mt9m114: document MI1040 sensor
2026-03-04 18:49 [PATCH v3 0/2] media: i2c: mt9m114: add support for Aptina MI1040 Svyatoslav Ryhel
@ 2026-03-04 18:50 ` Svyatoslav Ryhel
2026-03-04 18:50 ` [PATCH v3 2/2] media: i2c: mt9m114: add support for Aptina MI1040 Svyatoslav Ryhel
1 sibling, 0 replies; 7+ messages in thread
From: Svyatoslav Ryhel @ 2026-03-04 18:50 UTC (permalink / raw)
To: Laurent Pinchart, Mauro Carvalho Chehab, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Sakari Ailus, Svyatoslav Ryhel
Cc: linux-media, devicetree, linux-kernel
The Aptina MI1040 is a slightly different version of the MT9M114 camera
module. It is used in several devices, such as the ASUS Nexus 7 (2012) and
the ASUS Transformer Prime TF201. The compatible "onnn,mt9m114" is placed
first in the enum, as it is considered the default compatible value.
Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
---
Documentation/devicetree/bindings/media/i2c/onnn,mt9m114.yaml | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/Documentation/devicetree/bindings/media/i2c/onnn,mt9m114.yaml b/Documentation/devicetree/bindings/media/i2c/onnn,mt9m114.yaml
index dffd23ca4839..e896f4db2421 100644
--- a/Documentation/devicetree/bindings/media/i2c/onnn,mt9m114.yaml
+++ b/Documentation/devicetree/bindings/media/i2c/onnn,mt9m114.yaml
@@ -17,7 +17,9 @@ description: |-
properties:
compatible:
- const: onnn,mt9m114
+ enum:
+ - onnn,mt9m114
+ - aptina,mi1040
reg:
description: I2C device address
--
2.51.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH v3 2/2] media: i2c: mt9m114: add support for Aptina MI1040
2026-03-04 18:49 [PATCH v3 0/2] media: i2c: mt9m114: add support for Aptina MI1040 Svyatoslav Ryhel
2026-03-04 18:50 ` [PATCH v3 1/2] dt-bindings: media: mt9m114: document MI1040 sensor Svyatoslav Ryhel
@ 2026-03-04 18:50 ` Svyatoslav Ryhel
2026-03-04 21:44 ` Sakari Ailus
1 sibling, 1 reply; 7+ messages in thread
From: Svyatoslav Ryhel @ 2026-03-04 18:50 UTC (permalink / raw)
To: Laurent Pinchart, Mauro Carvalho Chehab, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Sakari Ailus, Svyatoslav Ryhel
Cc: linux-media, devicetree, linux-kernel
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. The only difference found so far is lacking ability
to poll STATE register during power on sequence, which causes driver to
fail with time out error. Add state_standby_polling flag to diverge models
and address quirk found in MI1040.
Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
---
drivers/media/i2c/mt9m114.c | 31 ++++++++++++++++++++++++++-----
1 file changed, 26 insertions(+), 5 deletions(-)
diff --git a/drivers/media/i2c/mt9m114.c b/drivers/media/i2c/mt9m114.c
index 16b0ace15813..e8f74bd11cd7 100644
--- a/drivers/media/i2c/mt9m114.c
+++ b/drivers/media/i2c/mt9m114.c
@@ -368,6 +368,10 @@
* Data Structures
*/
+struct mt9m114_model_info {
+ bool state_standby_polling;
+};
+
enum mt9m114_format_flag {
MT9M114_FMT_FLAG_PARALLEL = BIT(0),
MT9M114_FMT_FLAG_CSI2 = BIT(1),
@@ -417,6 +421,8 @@ struct mt9m114 {
struct v4l2_ctrl *tpg[4];
} ifp;
+
+ const struct mt9m114_model_info *info;
};
/* -----------------------------------------------------------------------------
@@ -2284,9 +2290,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->state_standby_polling) {
+ ret = mt9m114_poll_state(sensor, MT9M114_SYS_STATE_STANDBY);
+ if (ret < 0)
+ goto error_clock;
+ }
return 0;
@@ -2532,6 +2540,10 @@ static int mt9m114_probe(struct i2c_client *client)
if (ret < 0)
return ret;
+ sensor->info = device_get_match_data(dev);
+ if (!sensor->info)
+ return -ENODEV;
+
/* Acquire clocks, GPIOs and regulators. */
sensor->clk = devm_v4l2_sensor_clk_get(dev, NULL);
if (IS_ERR(sensor->clk)) {
@@ -2646,9 +2658,18 @@ static void mt9m114_remove(struct i2c_client *client)
pm_runtime_set_suspended(dev);
}
+static const struct mt9m114_model_info mt9m114_models_default = {
+ .state_standby_polling = true,
+};
+
+static const struct mt9m114_model_info mt9m114_models_aptina = {
+ .state_standby_polling = false,
+};
+
static const struct of_device_id mt9m114_of_ids[] = {
- { .compatible = "onnn,mt9m114" },
- { /* sentinel */ },
+ { .compatible = "onnn,mt9m114", .data = &mt9m114_models_default },
+ { .compatible = "aptina,mi1040", .data = &mt9m114_models_aptina },
+ { /* sentinel */ }
};
MODULE_DEVICE_TABLE(of, mt9m114_of_ids);
--
2.51.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH v3 2/2] media: i2c: mt9m114: add support for Aptina MI1040
2026-03-04 18:50 ` [PATCH v3 2/2] media: i2c: mt9m114: add support for Aptina MI1040 Svyatoslav Ryhel
@ 2026-03-04 21:44 ` Sakari Ailus
2026-03-05 8:36 ` Svyatoslav Ryhel
0 siblings, 1 reply; 7+ messages in thread
From: Sakari Ailus @ 2026-03-04 21:44 UTC (permalink / raw)
To: Svyatoslav Ryhel
Cc: Laurent Pinchart, Mauro Carvalho Chehab, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, linux-media, devicetree,
linux-kernel
Hi Svyatoslav,
One more thing...
On Wed, Mar 04, 2026 at 08:50:01PM +0200, Svyatoslav Ryhel wrote:
> @@ -2646,9 +2658,18 @@ static void mt9m114_remove(struct i2c_client *client)
> pm_runtime_set_suspended(dev);
> }
>
> +static const struct mt9m114_model_info mt9m114_models_default = {
> + .state_standby_polling = true,
> +};
> +
> +static const struct mt9m114_model_info mt9m114_models_aptina = {
> + .state_standby_polling = false,
> +};
> +
> static const struct of_device_id mt9m114_of_ids[] = {
> - { .compatible = "onnn,mt9m114" },
> - { /* sentinel */ },
> + { .compatible = "onnn,mt9m114", .data = &mt9m114_models_default },
> + { .compatible = "aptina,mi1040", .data = &mt9m114_models_aptina },
> + { /* sentinel */ }
The driver also supports ACPI. mt9m114_models_default needs to be added to
the ACPI data, too; otherwise ACPI support breaks.
> };
> MODULE_DEVICE_TABLE(of, mt9m114_of_ids);
>
--
Kind regards,
Sakari Ailus
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v3 2/2] media: i2c: mt9m114: add support for Aptina MI1040
2026-03-04 21:44 ` Sakari Ailus
@ 2026-03-05 8:36 ` Svyatoslav Ryhel
2026-03-05 10:00 ` Sakari Ailus
0 siblings, 1 reply; 7+ messages in thread
From: Svyatoslav Ryhel @ 2026-03-05 8:36 UTC (permalink / raw)
To: Sakari Ailus
Cc: Laurent Pinchart, Mauro Carvalho Chehab, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, linux-media, devicetree,
linux-kernel
ср, 4 бер. 2026 р. о 23:43 Sakari Ailus <sakari.ailus@linux.intel.com> пише:
>
> Hi Svyatoslav,
>
> One more thing...
>
> On Wed, Mar 04, 2026 at 08:50:01PM +0200, Svyatoslav Ryhel wrote:
> > @@ -2646,9 +2658,18 @@ static void mt9m114_remove(struct i2c_client *client)
> > pm_runtime_set_suspended(dev);
> > }
> >
> > +static const struct mt9m114_model_info mt9m114_models_default = {
> > + .state_standby_polling = true,
> > +};
> > +
> > +static const struct mt9m114_model_info mt9m114_models_aptina = {
> > + .state_standby_polling = false,
> > +};
> > +
> > static const struct of_device_id mt9m114_of_ids[] = {
> > - { .compatible = "onnn,mt9m114" },
> > - { /* sentinel */ },
> > + { .compatible = "onnn,mt9m114", .data = &mt9m114_models_default },
> > + { .compatible = "aptina,mi1040", .data = &mt9m114_models_aptina },
> > + { /* sentinel */ }
>
> The driver also supports ACPI. mt9m114_models_default needs to be added to
> the ACPI data, too; otherwise ACPI support breaks.
>
So turn into
static const struct acpi_device_id mt9m114_acpi_ids[] = {
{ "INT33F0" },
{ /* sentinel */ },
};
into
static const struct acpi_device_id mt9m114_acpi_ids[] = {
{ "INT33F0", (kernel_ulong_t)&mt9m114_models_default },
{ /* sentinel */ }
};
I want to be as specific as possible to avoid any misunderstandings.
Additionally, please ensure these are all the required changes to
avoid unwanted reiterations, as I may not be as familiar with the
media framework as you are. Thank you!
> > };
> > MODULE_DEVICE_TABLE(of, mt9m114_of_ids);
> >
>
> --
> Kind regards,
>
> Sakari Ailus
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v3 2/2] media: i2c: mt9m114: add support for Aptina MI1040
2026-03-05 8:36 ` Svyatoslav Ryhel
@ 2026-03-05 10:00 ` Sakari Ailus
2026-03-05 10:13 ` Svyatoslav Ryhel
0 siblings, 1 reply; 7+ messages in thread
From: Sakari Ailus @ 2026-03-05 10:00 UTC (permalink / raw)
To: Svyatoslav Ryhel
Cc: Laurent Pinchart, Mauro Carvalho Chehab, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, linux-media, devicetree,
linux-kernel
Hi Svyatoslav,
On Thu, Mar 05, 2026 at 10:36:25AM +0200, Svyatoslav Ryhel wrote:
> ср, 4 бер. 2026 р. о 23:43 Sakari Ailus <sakari.ailus@linux.intel.com> пише:
> >
> > Hi Svyatoslav,
> >
> > One more thing...
> >
> > On Wed, Mar 04, 2026 at 08:50:01PM +0200, Svyatoslav Ryhel wrote:
> > > @@ -2646,9 +2658,18 @@ static void mt9m114_remove(struct i2c_client *client)
> > > pm_runtime_set_suspended(dev);
> > > }
> > >
> > > +static const struct mt9m114_model_info mt9m114_models_default = {
> > > + .state_standby_polling = true,
> > > +};
> > > +
> > > +static const struct mt9m114_model_info mt9m114_models_aptina = {
> > > + .state_standby_polling = false,
> > > +};
> > > +
> > > static const struct of_device_id mt9m114_of_ids[] = {
> > > - { .compatible = "onnn,mt9m114" },
> > > - { /* sentinel */ },
> > > + { .compatible = "onnn,mt9m114", .data = &mt9m114_models_default },
> > > + { .compatible = "aptina,mi1040", .data = &mt9m114_models_aptina },
> > > + { /* sentinel */ }
> >
> > The driver also supports ACPI. mt9m114_models_default needs to be added to
> > the ACPI data, too; otherwise ACPI support breaks.
> >
>
> So turn into
>
> static const struct acpi_device_id mt9m114_acpi_ids[] = {
> { "INT33F0" },
> { /* sentinel */ },
> };
>
> into
>
> static const struct acpi_device_id mt9m114_acpi_ids[] = {
> { "INT33F0", (kernel_ulong_t)&mt9m114_models_default },
> { /* sentinel */ }
> };
Looks good to me.
>
> I want to be as specific as possible to avoid any misunderstandings.
> Additionally, please ensure these are all the required changes to
> avoid unwanted reiterations, as I may not be as familiar with the
> media framework as you are. Thank you!
That's what I noticed after going through this once more.
Review won't make patches perfect (mostly) but the more issues can be found
during review, the better.
>
> > > };
> > > MODULE_DEVICE_TABLE(of, mt9m114_of_ids);
> > >
> >
--
Kind regards,
Sakari Ailus
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v3 2/2] media: i2c: mt9m114: add support for Aptina MI1040
2026-03-05 10:00 ` Sakari Ailus
@ 2026-03-05 10:13 ` Svyatoslav Ryhel
0 siblings, 0 replies; 7+ messages in thread
From: Svyatoslav Ryhel @ 2026-03-05 10:13 UTC (permalink / raw)
To: Sakari Ailus
Cc: Laurent Pinchart, Mauro Carvalho Chehab, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, linux-media, devicetree,
linux-kernel
чт, 5 бер. 2026 р. о 12:00 Sakari Ailus <sakari.ailus@linux.intel.com> пише:
>
> Hi Svyatoslav,
>
> On Thu, Mar 05, 2026 at 10:36:25AM +0200, Svyatoslav Ryhel wrote:
> > ср, 4 бер. 2026 р. о 23:43 Sakari Ailus <sakari.ailus@linux.intel.com> пише:
> > >
> > > Hi Svyatoslav,
> > >
> > > One more thing...
> > >
> > > On Wed, Mar 04, 2026 at 08:50:01PM +0200, Svyatoslav Ryhel wrote:
> > > > @@ -2646,9 +2658,18 @@ static void mt9m114_remove(struct i2c_client *client)
> > > > pm_runtime_set_suspended(dev);
> > > > }
> > > >
> > > > +static const struct mt9m114_model_info mt9m114_models_default = {
> > > > + .state_standby_polling = true,
> > > > +};
> > > > +
> > > > +static const struct mt9m114_model_info mt9m114_models_aptina = {
> > > > + .state_standby_polling = false,
> > > > +};
> > > > +
> > > > static const struct of_device_id mt9m114_of_ids[] = {
> > > > - { .compatible = "onnn,mt9m114" },
> > > > - { /* sentinel */ },
> > > > + { .compatible = "onnn,mt9m114", .data = &mt9m114_models_default },
> > > > + { .compatible = "aptina,mi1040", .data = &mt9m114_models_aptina },
> > > > + { /* sentinel */ }
> > >
> > > The driver also supports ACPI. mt9m114_models_default needs to be added to
> > > the ACPI data, too; otherwise ACPI support breaks.
> > >
> >
> > So turn into
> >
> > static const struct acpi_device_id mt9m114_acpi_ids[] = {
> > { "INT33F0" },
> > { /* sentinel */ },
> > };
> >
> > into
> >
> > static const struct acpi_device_id mt9m114_acpi_ids[] = {
> > { "INT33F0", (kernel_ulong_t)&mt9m114_models_default },
> > { /* sentinel */ }
> > };
>
> Looks good to me.
>
> >
> > I want to be as specific as possible to avoid any misunderstandings.
> > Additionally, please ensure these are all the required changes to
> > avoid unwanted reiterations, as I may not be as familiar with the
> > media framework as you are. Thank you!
>
> That's what I noticed after going through this once more.
>
> Review won't make patches perfect (mostly) but the more issues can be found
> during review, the better.
>
Yes, but the more iterations pass, more issues may occur due to
mechanical typos or unintentional misbehaviors.
> >
> > > > };
> > > > MODULE_DEVICE_TABLE(of, mt9m114_of_ids);
> > > >
> > >
>
> --
> Kind regards,
>
> Sakari Ailus
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2026-03-05 10:13 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-04 18:49 [PATCH v3 0/2] media: i2c: mt9m114: add support for Aptina MI1040 Svyatoslav Ryhel
2026-03-04 18:50 ` [PATCH v3 1/2] dt-bindings: media: mt9m114: document MI1040 sensor Svyatoslav Ryhel
2026-03-04 18:50 ` [PATCH v3 2/2] media: i2c: mt9m114: add support for Aptina MI1040 Svyatoslav Ryhel
2026-03-04 21:44 ` Sakari Ailus
2026-03-05 8:36 ` Svyatoslav Ryhel
2026-03-05 10:00 ` Sakari Ailus
2026-03-05 10:13 ` Svyatoslav Ryhel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox