* 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),
struct v4l2_ctrl *tpg[4];
} ifp;
+
+ const struct mt9m114_model_info *info;
};
/* -----------------------------------------------------------------------------
* 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;
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)) {
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);
static const struct acpi_device_id mt9m114_acpi_ids[] = {
- { "INT33F0" },
- { /* sentinel */ },
+ { "INT33F0", (kernel_ulong_t)&mt9m114_models_default },
+ { /* sentinel */ }
};
MODULE_DEVICE_TABLE(acpi, mt9m114_acpi_ids);