media: i2c: modify sensors probe time if CONFIG_VIDEO_REVERSE_IMAGE=y

Signed-off-by: Jianwei Fan <jianwei.fan@rock-chips.com>
Change-Id: I28a86e4f88425c90270b5d85ac68104bed93433a
This commit is contained in:
Jianwei Fan
2022-08-02 12:00:26 +00:00
committed by Tao Huang
parent edfb48bcad
commit 6abb75642a
6 changed files with 53 additions and 6 deletions

View File

@@ -39,6 +39,7 @@
#include "jaguar1_video_eq.h"
#include "jaguar1_mipi.h"
#include "jaguar1_drv.h"
#include "jaguar1_v4l2.h"
#define DRIVER_VERSION KERNEL_VERSION(0, 0x01, 0x1)
@@ -987,6 +988,8 @@ static int jaguar1_probe(struct i2c_client *client,
pm_runtime_enable(dev);
pm_runtime_idle(dev);
v4l2_info(sd, "%s found @ 0x%x (%s)\n", client->name,
client->addr << 1, client->adapter->name);
return 0;
err_power_off:
@@ -1041,17 +1044,20 @@ static struct i2c_driver jaguar1_i2c_driver = {
.id_table = jaguar1_match_id,
};
static int __init sensor_mod_init(void)
int nvp6324_sensor_mod_init(void)
{
return i2c_add_driver(&jaguar1_i2c_driver);
}
#ifndef CONFIG_VIDEO_REVERSE_IMAGE
device_initcall_sync(nvp6324_sensor_mod_init);
#endif
static void __exit sensor_mod_exit(void)
{
i2c_del_driver(&jaguar1_i2c_driver);
}
device_initcall_sync(sensor_mod_init);
module_exit(sensor_mod_exit);
MODULE_DESCRIPTION("jaguar1 sensor driver");

View File

@@ -0,0 +1,11 @@
/* SPDX-License-Identifier: GPL-2.0 */
/*
* jaguar1 driver
*
*/
#ifndef _JAGUAR1_V4L2_H_
#define _JAGUAR1_V4L2_H_
int nvp6324_sensor_mod_init(void);
#endif

View File

@@ -26,6 +26,7 @@
#include <media/v4l2-ctrls.h>
#include <media/v4l2-subdev.h>
#include <linux/pinctrl/consumer.h>
#include "max96714.h"
#define DRIVER_VERSION KERNEL_VERSION(0, 0x01, 0x00)
@@ -1089,17 +1090,20 @@ static struct i2c_driver max96714_i2c_driver = {
.id_table = max96714_match_id,
};
static int __init sensor_mod_init(void)
int max96714_sensor_mod_init(void)
{
return i2c_add_driver(&max96714_i2c_driver);
}
#ifndef CONFIG_VIDEO_REVERSE_IMAGE
device_initcall_sync(max96714_sensor_mod_init);
#endif
static void __exit sensor_mod_exit(void)
{
i2c_del_driver(&max96714_i2c_driver);
}
device_initcall_sync(sensor_mod_init);
module_exit(sensor_mod_exit);
MODULE_DESCRIPTION("Maxim max96714 sensor driver");

View File

@@ -0,0 +1,11 @@
/* SPDX-License-Identifier: GPL-2.0 */
/*
* max96714 driver
*
*/
#ifndef _MAX96714_H_
#define _MAX96714_H_
int max96714_sensor_mod_init(void);
#endif

View File

@@ -42,6 +42,7 @@
#include <linux/platform_device.h>
#include <linux/input.h>
#include "nvp6188.h"
#define DRIVER_VERSION KERNEL_VERSION(0, 0x01, 0x2)
@@ -2743,17 +2744,20 @@ static struct i2c_driver nvp6188_i2c_driver = {
.id_table = nvp6188_match_id,
};
static int __init sensor_mod_init(void)
int nvp6188_sensor_mod_init(void)
{
return i2c_add_driver(&nvp6188_i2c_driver);
}
#ifndef CONFIG_VIDEO_REVERSE_IMAGE
device_initcall_sync(nvp6188_sensor_mod_init);
#endif
static void __exit sensor_mod_exit(void)
{
i2c_del_driver(&nvp6188_i2c_driver);
}
device_initcall_sync(sensor_mod_init);
module_exit(sensor_mod_exit);
MODULE_AUTHOR("Vicent Chi <vicent.chi@rock-chips.com>");

View File

@@ -0,0 +1,11 @@
/* SPDX-License-Identifier: GPL-2.0 */
/*
* nvp6188 driver
*
*/
#ifndef _NVP6188_H_
#define _NVP6188_H_
int nvp6188_sensor_mod_init(void);
#endif