From: Sakari Ailus <sakari.ailus@linux.intel.com>
To: linux-media@vger.kernel.org
Subject: [PATCH 2/7] smiapp: Explicitly define number of pads in initialisation
Date: Wed, 7 Sep 2016 13:30:10 +0300 [thread overview]
Message-ID: <1473244215-19432-3-git-send-email-sakari.ailus@linux.intel.com> (raw)
In-Reply-To: <1473244215-19432-1-git-send-email-sakari.ailus@linux.intel.com>
Define the number of pads explicitly in initialising the sub-devices.
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
---
drivers/media/i2c/smiapp/smiapp-core.c | 17 +++++++----------
1 file changed, 7 insertions(+), 10 deletions(-)
diff --git a/drivers/media/i2c/smiapp/smiapp-core.c b/drivers/media/i2c/smiapp/smiapp-core.c
index 5ef9177..4f96797 100644
--- a/drivers/media/i2c/smiapp/smiapp-core.c
+++ b/drivers/media/i2c/smiapp/smiapp-core.c
@@ -2528,7 +2528,8 @@ static void smiapp_cleanup(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);
@@ -2537,12 +2538,8 @@ static void smiapp_create_subdev(struct smiapp_sensor *sensor,
ssd->sensor = sensor;
- if (ssd == sensor->pixel_array) {
- ssd->npads = 1;
- } else {
- ssd->npads = 2;
- ssd->source_pad = 1;
- }
+ ssd->npads = num_pads;
+ ssd->source_pad = num_pads - 1;
snprintf(ssd->sd.name,
sizeof(ssd->sd.name), "%s %s %d-%4.4x", sensor->minfo.name,
@@ -2737,9 +2734,9 @@ static int smiapp_init(struct smiapp_sensor *sensor)
pll->flags |= SMIAPP_PLL_FLAG_NO_OP_CLOCKS;
if (sensor->scaler)
- smiapp_create_subdev(sensor, sensor->scaler, "scaler");
- smiapp_create_subdev(sensor, sensor->binner, "binner");
- smiapp_create_subdev(sensor, sensor->pixel_array, "pixel_array");
+ smiapp_create_subdev(sensor, sensor->scaler, "scaler", 2);
+ smiapp_create_subdev(sensor, sensor->binner, "binner", 2);
+ smiapp_create_subdev(sensor, sensor->pixel_array, "pixel_array", 1);
dev_dbg(&client->dev, "profile %d\n", sensor->minfo.smiapp_profile);
--
2.7.4
next prev parent reply other threads:[~2016-09-07 10:32 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-07 10:30 [PATCH 0/7] More smiapp cleanups Sakari Ailus
2016-09-07 10:30 ` [PATCH 1/7] smiapp: Move sub-device initialisation into a separate function Sakari Ailus
2016-09-07 10:30 ` Sakari Ailus [this message]
2016-09-07 10:30 ` [PATCH 3/7] smiapp: Initialise media entity after sensor init Sakari Ailus
2016-09-07 10:30 ` [PATCH 4/7] smiapp: Split off sub-device registration into two Sakari Ailus
2016-09-07 10:30 ` [PATCH 5/7] smiapp: Provide a common function to obtain native pixel array size Sakari Ailus
2016-09-07 10:30 ` [PATCH 6/7] smiapp: Remove unnecessary BUG_ON()'s Sakari Ailus
2016-09-07 10:30 ` [PATCH 7/7] smiapp: Always initialise the sensor in probe Sakari Ailus
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1473244215-19432-3-git-send-email-sakari.ailus@linux.intel.com \
--to=sakari.ailus@linux.intel.com \
--cc=linux-media@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).