Commit e838b8c6 authored by Hans de Goede's avatar Hans de Goede Committed by Mauro Carvalho Chehab

media: atomisp: Drop intel_v4l2_subdev_type

intel_v4l2_subdev_type / atomisp_input_subdev.type now always is
RAW_CAMERA, drop it.
Reviewed-by: default avatarAndy Shevchenko <andy@kernel.org>
Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
parent 659a6699
...@@ -852,7 +852,7 @@ static int gc2235_probe(struct i2c_client *client) ...@@ -852,7 +852,7 @@ static int gc2235_probe(struct i2c_client *client)
if (ret) if (ret)
gc2235_remove(client); gc2235_remove(client);
return atomisp_register_i2c_module(&dev->sd, gcpdev, RAW_CAMERA); return atomisp_register_i2c_module(&dev->sd, gcpdev);
out_free: out_free:
v4l2_device_unregister_subdev(&dev->sd); v4l2_device_unregister_subdev(&dev->sd);
......
...@@ -1552,7 +1552,7 @@ static int mt9m114_probe(struct i2c_client *client) ...@@ -1552,7 +1552,7 @@ static int mt9m114_probe(struct i2c_client *client)
return ret; return ret;
} }
ret = atomisp_register_i2c_module(&dev->sd, pdata, RAW_CAMERA); ret = atomisp_register_i2c_module(&dev->sd, pdata);
if (ret) { if (ret) {
v4l2_device_unregister_subdev(&dev->sd); v4l2_device_unregister_subdev(&dev->sd);
kfree(dev); kfree(dev);
......
...@@ -992,7 +992,7 @@ static int ov2722_probe(struct i2c_client *client) ...@@ -992,7 +992,7 @@ static int ov2722_probe(struct i2c_client *client)
if (ret) if (ret)
ov2722_remove(client); ov2722_remove(client);
return atomisp_register_i2c_module(&dev->sd, ovpdev, RAW_CAMERA); return atomisp_register_i2c_module(&dev->sd, ovpdev);
out_ctrl_handler_free: out_ctrl_handler_free:
v4l2_ctrl_handler_free(&dev->ctrl_handler); v4l2_ctrl_handler_free(&dev->ctrl_handler);
......
...@@ -19,8 +19,7 @@ ...@@ -19,8 +19,7 @@
#include "atomisp_platform.h" #include "atomisp_platform.h"
int atomisp_register_i2c_module(struct v4l2_subdev *subdev, int atomisp_register_i2c_module(struct v4l2_subdev *subdev,
struct camera_sensor_platform_data *plat_data, struct camera_sensor_platform_data *plat_data);
enum intel_v4l2_subdev_type type);
int atomisp_gmin_remove_subdev(struct v4l2_subdev *sd); int atomisp_gmin_remove_subdev(struct v4l2_subdev *sd);
int gmin_get_var_int(struct device *dev, bool is_gmin, int gmin_get_var_int(struct device *dev, bool is_gmin,
const char *var, int def); const char *var, int def);
......
...@@ -109,18 +109,7 @@ enum atomisp_input_format { ...@@ -109,18 +109,7 @@ enum atomisp_input_format {
#define N_ATOMISP_INPUT_FORMAT (ATOMISP_INPUT_FORMAT_USER_DEF8 + 1) #define N_ATOMISP_INPUT_FORMAT (ATOMISP_INPUT_FORMAT_USER_DEF8 + 1)
enum intel_v4l2_subdev_type {
RAW_CAMERA = 1,
};
struct intel_v4l2_subdev_id {
char name[17];
enum intel_v4l2_subdev_type type;
enum atomisp_camera_port port;
};
struct intel_v4l2_subdev_table { struct intel_v4l2_subdev_table {
enum intel_v4l2_subdev_type type;
enum atomisp_camera_port port; enum atomisp_camera_port port;
unsigned int lanes; unsigned int lanes;
struct v4l2_subdev *subdev; struct v4l2_subdev *subdev;
......
...@@ -126,7 +126,7 @@ static DEFINE_MUTEX(gmin_regulator_mutex); ...@@ -126,7 +126,7 @@ static DEFINE_MUTEX(gmin_regulator_mutex);
static int gmin_v1p8_enable_count; static int gmin_v1p8_enable_count;
static int gmin_v2p8_enable_count; static int gmin_v2p8_enable_count;
/* The atomisp uses type==0 for the end-of-list marker, so leave space. */ /* The atomisp uses subdev==NULL for the end-of-list marker, so leave space. */
static struct intel_v4l2_subdev_table pdata_subdevs[MAX_SUBDEVS + 1]; static struct intel_v4l2_subdev_table pdata_subdevs[MAX_SUBDEVS + 1];
static const struct atomisp_platform_data pdata = { static const struct atomisp_platform_data pdata = {
...@@ -145,16 +145,13 @@ const struct atomisp_platform_data *atomisp_get_platform_data(void) ...@@ -145,16 +145,13 @@ const struct atomisp_platform_data *atomisp_get_platform_data(void)
EXPORT_SYMBOL_GPL(atomisp_get_platform_data); EXPORT_SYMBOL_GPL(atomisp_get_platform_data);
int atomisp_register_i2c_module(struct v4l2_subdev *subdev, int atomisp_register_i2c_module(struct v4l2_subdev *subdev,
struct camera_sensor_platform_data *plat_data, struct camera_sensor_platform_data *plat_data)
enum intel_v4l2_subdev_type type)
{ {
int i; int i;
struct gmin_subdev *gs; struct gmin_subdev *gs;
struct i2c_client *client = v4l2_get_subdevdata(subdev); struct i2c_client *client = v4l2_get_subdevdata(subdev);
struct acpi_device *adev = ACPI_COMPANION(&client->dev); struct acpi_device *adev = ACPI_COMPANION(&client->dev);
dev_info(&client->dev, "register atomisp i2c module type %d\n", type);
/* The windows driver model (and thus most BIOSes by default) /* The windows driver model (and thus most BIOSes by default)
* uses ACPI runtime power management for camera devices, but * uses ACPI runtime power management for camera devices, but
* we don't. Disable it, or else the rails will be needlessly * we don't. Disable it, or else the rails will be needlessly
...@@ -172,10 +169,10 @@ int atomisp_register_i2c_module(struct v4l2_subdev *subdev, ...@@ -172,10 +169,10 @@ int atomisp_register_i2c_module(struct v4l2_subdev *subdev,
adev->power.flags.power_resources = 0; adev->power.flags.power_resources = 0;
for (i = 0; i < MAX_SUBDEVS; i++) for (i = 0; i < MAX_SUBDEVS; i++)
if (!pdata.subdevs[i].type) if (!pdata.subdevs[i].subdev)
break; break;
if (pdata.subdevs[i].type) if (i == MAX_SUBDEVS)
return -ENOMEM; return -ENOMEM;
/* Note subtlety of initialization order: at the point where /* Note subtlety of initialization order: at the point where
...@@ -187,7 +184,6 @@ int atomisp_register_i2c_module(struct v4l2_subdev *subdev, ...@@ -187,7 +184,6 @@ int atomisp_register_i2c_module(struct v4l2_subdev *subdev,
if (!gs) if (!gs)
return -ENODEV; return -ENODEV;
pdata.subdevs[i].type = type;
pdata.subdevs[i].port = gs->csi_port; pdata.subdevs[i].port = gs->csi_port;
pdata.subdevs[i].lanes = gs->csi_lanes; pdata.subdevs[i].lanes = gs->csi_lanes;
pdata.subdevs[i].subdev = subdev; pdata.subdevs[i].subdev = subdev;
...@@ -1136,7 +1132,7 @@ int atomisp_register_sensor_no_gmin(struct v4l2_subdev *subdev, u32 lanes, ...@@ -1136,7 +1132,7 @@ int atomisp_register_sensor_no_gmin(struct v4l2_subdev *subdev, u32 lanes,
} }
for (i = 0; i < MAX_SUBDEVS; i++) for (i = 0; i < MAX_SUBDEVS; i++)
if (!pdata.subdevs[i].type) if (!pdata.subdevs[i].subdev)
break; break;
if (i >= MAX_SUBDEVS) { if (i >= MAX_SUBDEVS) {
...@@ -1148,7 +1144,6 @@ int atomisp_register_sensor_no_gmin(struct v4l2_subdev *subdev, u32 lanes, ...@@ -1148,7 +1144,6 @@ int atomisp_register_sensor_no_gmin(struct v4l2_subdev *subdev, u32 lanes,
if (ret) if (ret)
return ret; return ret;
pdata.subdevs[i].type = RAW_CAMERA;
pdata.subdevs[i].port = port; pdata.subdevs[i].port = port;
pdata.subdevs[i].lanes = lanes; pdata.subdevs[i].lanes = lanes;
pdata.subdevs[i].subdev = subdev; pdata.subdevs[i].subdev = subdev;
...@@ -1166,7 +1161,6 @@ void atomisp_unregister_subdev(struct v4l2_subdev *subdev) ...@@ -1166,7 +1161,6 @@ void atomisp_unregister_subdev(struct v4l2_subdev *subdev)
camera_sensor_csi_free(subdev); camera_sensor_csi_free(subdev);
pdata.subdevs[i].subdev = NULL; pdata.subdevs[i].subdev = NULL;
pdata.subdevs[i].type = 0;
pdata.subdevs[i].port = 0; pdata.subdevs[i].port = 0;
break; break;
} }
......
...@@ -121,7 +121,6 @@ ...@@ -121,7 +121,6 @@
round_down((2 * (n) + (d) * (step)) / (2 * (d)), (step)) round_down((2 * (n) + (d) * (step)) / (2 * (d)), (step))
struct atomisp_input_subdev { struct atomisp_input_subdev {
unsigned int type;
enum atomisp_camera_port port; enum atomisp_camera_port port;
u32 code; /* MEDIA_BUS_FMT_* */ u32 code; /* MEDIA_BUS_FMT_* */
bool binning_support; bool binning_support;
......
...@@ -406,7 +406,6 @@ static int atomisp_enum_input(struct file *file, void *fh, ...@@ -406,7 +406,6 @@ static int atomisp_enum_input(struct file *file, void *fh,
input->type = V4L2_INPUT_TYPE_CAMERA; input->type = V4L2_INPUT_TYPE_CAMERA;
input->index = index; input->index = index;
input->reserved[0] = isp->inputs[index].type;
input->reserved[1] = isp->inputs[index].port; input->reserved[1] = isp->inputs[index].port;
return 0; return 0;
......
...@@ -803,32 +803,25 @@ static int atomisp_subdev_probe(struct atomisp_device *isp) ...@@ -803,32 +803,25 @@ static int atomisp_subdev_probe(struct atomisp_device *isp)
* converting them to standard v4l2 sensor drivers using runtime-pm + * converting them to standard v4l2 sensor drivers using runtime-pm +
* ACPI for pm and v4l2_async_register_subdev_sensor() registration. * ACPI for pm and v4l2_async_register_subdev_sensor() registration.
*/ */
for (subdevs = pdata->subdevs; subdevs->type; ++subdevs) { for (subdevs = pdata->subdevs; subdevs->subdev; subdevs++) {
ret = v4l2_device_register_subdev(&isp->v4l2_dev, subdevs->subdev); ret = v4l2_device_register_subdev(&isp->v4l2_dev, subdevs->subdev);
if (ret) if (ret)
continue; continue;
switch (subdevs->type) { if (subdevs->port >= ATOMISP_CAMERA_NR_PORTS) {
case RAW_CAMERA: dev_err(isp->dev, "port %d not supported\n", subdevs->port);
if (subdevs->port >= ATOMISP_CAMERA_NR_PORTS) { continue;
dev_err(isp->dev, "port %d not supported\n", subdevs->port); }
break;
}
if (isp->sensor_subdevs[subdevs->port]) {
dev_err(isp->dev, "port %d already has a sensor attached\n",
subdevs->port);
break;
}
mipi_port = atomisp_port_to_mipi_port(isp, subdevs->port); if (isp->sensor_subdevs[subdevs->port]) {
isp->sensor_lanes[mipi_port] = subdevs->lanes; dev_err(isp->dev, "port %d already has a sensor attached\n",
isp->sensor_subdevs[subdevs->port] = subdevs->subdev; subdevs->port);
break; continue;
default:
dev_dbg(isp->dev, "unknown subdev probed\n");
break;
} }
mipi_port = atomisp_port_to_mipi_port(isp, subdevs->port);
isp->sensor_lanes[mipi_port] = subdevs->lanes;
isp->sensor_subdevs[subdevs->port] = subdevs->subdev;
} }
return atomisp_csi_lane_config(isp); return atomisp_csi_lane_config(isp);
...@@ -1039,7 +1032,6 @@ int atomisp_register_device_nodes(struct atomisp_device *isp) ...@@ -1039,7 +1032,6 @@ int atomisp_register_device_nodes(struct atomisp_device *isp)
input = &isp->inputs[isp->input_cnt]; input = &isp->inputs[isp->input_cnt];
input->type = RAW_CAMERA;
input->port = i; input->port = i;
input->camera = isp->sensor_subdevs[i]; input->camera = isp->sensor_subdevs[i];
input->csi_port = &isp->csi2_port[i].subdev; input->csi_port = &isp->csi2_port[i].subdev;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment