Commit cc1488a1 authored by Sakari Ailus's avatar Sakari Ailus Committed by Mauro Carvalho Chehab

[media] smiapp: Explicitly define number of pads in initialisation

Define the number of pads explicitly in initialising the sub-devices.
Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: default avatarSebastian Reichel <sre@kernel.org>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent b7547ef8
...@@ -2536,7 +2536,8 @@ static void smiapp_cleanup(struct smiapp_sensor *sensor) ...@@ -2536,7 +2536,8 @@ static void smiapp_cleanup(struct smiapp_sensor *sensor)
} }
static void smiapp_create_subdev(struct smiapp_sensor *sensor, static void smiapp_create_subdev(struct smiapp_sensor *sensor,
struct smiapp_subdev *ssd, const char *name) struct smiapp_subdev *ssd, const char *name,
unsigned short num_pads)
{ {
struct i2c_client *client = v4l2_get_subdevdata(&sensor->src->sd); struct i2c_client *client = v4l2_get_subdevdata(&sensor->src->sd);
...@@ -2548,12 +2549,8 @@ static void smiapp_create_subdev(struct smiapp_sensor *sensor, ...@@ -2548,12 +2549,8 @@ static void smiapp_create_subdev(struct smiapp_sensor *sensor,
ssd->sensor = sensor; ssd->sensor = sensor;
if (ssd == sensor->pixel_array) { ssd->npads = num_pads;
ssd->npads = 1; ssd->source_pad = num_pads - 1;
} else {
ssd->npads = 2;
ssd->source_pad = 1;
}
snprintf(ssd->sd.name, snprintf(ssd->sd.name,
sizeof(ssd->sd.name), "%s %s %d-%4.4x", sensor->minfo.name, sizeof(ssd->sd.name), "%s %s %d-%4.4x", sensor->minfo.name,
...@@ -2747,9 +2744,9 @@ static int smiapp_init(struct smiapp_sensor *sensor) ...@@ -2747,9 +2744,9 @@ static int smiapp_init(struct smiapp_sensor *sensor)
if (sensor->minfo.smiapp_profile == SMIAPP_PROFILE_0) if (sensor->minfo.smiapp_profile == SMIAPP_PROFILE_0)
pll->flags |= SMIAPP_PLL_FLAG_NO_OP_CLOCKS; pll->flags |= SMIAPP_PLL_FLAG_NO_OP_CLOCKS;
smiapp_create_subdev(sensor, sensor->scaler, "scaler"); smiapp_create_subdev(sensor, sensor->scaler, "scaler", 2);
smiapp_create_subdev(sensor, sensor->binner, "binner"); smiapp_create_subdev(sensor, sensor->binner, "binner", 2);
smiapp_create_subdev(sensor, sensor->pixel_array, "pixel_array"); smiapp_create_subdev(sensor, sensor->pixel_array, "pixel_array", 1);
dev_dbg(&client->dev, "profile %d\n", sensor->minfo.smiapp_profile); dev_dbg(&client->dev, "profile %d\n", sensor->minfo.smiapp_profile);
......
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