linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] Small smiapp changes
@ 2014-03-28 14:35 Sakari Ailus
  2014-03-28 14:35 ` [PATCH 1/3] smiapp: Use I2C adapter ID and address in the sub-device name Sakari Ailus
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Sakari Ailus @ 2014-03-28 14:35 UTC (permalink / raw)
  To: linux-media

Hi,

Here are a few fairly trivial fixes and cleanups for the smiapp driver.

-- 
Regards,
Sakari


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 1/3] smiapp: Use I2C adapter ID and address in the sub-device name
  2014-03-28 14:35 [PATCH 0/3] Small smiapp changes Sakari Ailus
@ 2014-03-28 14:35 ` Sakari Ailus
  2014-03-28 14:35 ` [PATCH 2/3] smiapp: Set sub-device owner Sakari Ailus
  2014-03-28 14:35 ` [PATCH 3/3] smiapp: Make PLL flags separate from regular quirk flags Sakari Ailus
  2 siblings, 0 replies; 6+ messages in thread
From: Sakari Ailus @ 2014-03-28 14:35 UTC (permalink / raw)
  To: linux-media

The sub-device names should be unique. Should two identical sensors be
present in the same media device they would be indistinguishable. The names
will change e.g. from "vs6555 pixel array" to "vs6555 1-0010 pixel array".

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
---
 drivers/media/i2c/smiapp/smiapp-core.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/media/i2c/smiapp/smiapp-core.c b/drivers/media/i2c/smiapp/smiapp-core.c
index 8741cae..69c11ec 100644
--- a/drivers/media/i2c/smiapp/smiapp-core.c
+++ b/drivers/media/i2c/smiapp/smiapp-core.c
@@ -2543,8 +2543,9 @@ static int smiapp_registered(struct v4l2_subdev *subdev)
 		}
 
 		snprintf(this->sd.name,
-			 sizeof(this->sd.name), "%s %s",
-			 sensor->minfo.name, _this->name);
+			 sizeof(this->sd.name), "%s %d-%4.4x %s",
+			 sensor->minfo.name, i2c_adapter_id(client->adapter),
+			 client->addr, _this->name);
 
 		this->sink_fmt.width =
 			sensor->limits[SMIAPP_LIMIT_X_ADDR_MAX] + 1;
-- 
1.8.3.2


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/3] smiapp: Set sub-device owner
  2014-03-28 14:35 [PATCH 0/3] Small smiapp changes Sakari Ailus
  2014-03-28 14:35 ` [PATCH 1/3] smiapp: Use I2C adapter ID and address in the sub-device name Sakari Ailus
@ 2014-03-28 14:35 ` Sakari Ailus
  2014-07-17 10:22   ` Laurent Pinchart
  2014-03-28 14:35 ` [PATCH 3/3] smiapp: Make PLL flags separate from regular quirk flags Sakari Ailus
  2 siblings, 1 reply; 6+ messages in thread
From: Sakari Ailus @ 2014-03-28 14:35 UTC (permalink / raw)
  To: linux-media

The smiapp driver is the owner of the sub-devices exposed by the smiapp
driver. This prevents unloading the module whilst it's in use.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
---
 drivers/media/i2c/smiapp/smiapp-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/i2c/smiapp/smiapp-core.c b/drivers/media/i2c/smiapp/smiapp-core.c
index 69c11ec..5179cf4 100644
--- a/drivers/media/i2c/smiapp/smiapp-core.c
+++ b/drivers/media/i2c/smiapp/smiapp-core.c
@@ -2569,7 +2569,7 @@ static int smiapp_registered(struct v4l2_subdev *subdev)
 
 		this->sd.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
 		this->sd.internal_ops = &smiapp_internal_ops;
-		this->sd.owner = NULL;
+		this->sd.owner = THIS_MODULE;
 		v4l2_set_subdevdata(&this->sd, client);
 
 		rval = media_entity_init(&this->sd.entity,
-- 
1.8.3.2


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 3/3] smiapp: Make PLL flags separate from regular quirk flags
  2014-03-28 14:35 [PATCH 0/3] Small smiapp changes Sakari Ailus
  2014-03-28 14:35 ` [PATCH 1/3] smiapp: Use I2C adapter ID and address in the sub-device name Sakari Ailus
  2014-03-28 14:35 ` [PATCH 2/3] smiapp: Set sub-device owner Sakari Ailus
@ 2014-03-28 14:35 ` Sakari Ailus
  2 siblings, 0 replies; 6+ messages in thread
From: Sakari Ailus @ 2014-03-28 14:35 UTC (permalink / raw)
  To: linux-media

It doesn't make sense to just copy the information to the PLL flags. Add a
new fields for the quirks to contain the PLL flags.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
---
 drivers/media/i2c/smiapp/smiapp-core.c  | 4 +---
 drivers/media/i2c/smiapp/smiapp-quirk.c | 2 +-
 drivers/media/i2c/smiapp/smiapp-quirk.h | 5 ++---
 3 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/drivers/media/i2c/smiapp/smiapp-core.c b/drivers/media/i2c/smiapp/smiapp-core.c
index 5179cf4..afef659 100644
--- a/drivers/media/i2c/smiapp/smiapp-core.c
+++ b/drivers/media/i2c/smiapp/smiapp-core.c
@@ -2617,12 +2617,10 @@ static int smiapp_registered(struct v4l2_subdev *subdev)
 	pll->bus_type = SMIAPP_PLL_BUS_TYPE_CSI2;
 	pll->csi2.lanes = sensor->platform_data->lanes;
 	pll->ext_clk_freq_hz = sensor->platform_data->ext_clk;
+	pll->flags = sensor->minfo.quirk->pll_flags;
 	/* Profile 0 sensors have no separate OP clock branch. */
 	if (sensor->minfo.smiapp_profile == SMIAPP_PROFILE_0)
 		pll->flags |= SMIAPP_PLL_FLAG_NO_OP_CLOCKS;
-	if (smiapp_needs_quirk(sensor,
-			       SMIAPP_QUIRK_FLAG_OP_PIX_CLOCK_PER_LANE))
-		pll->flags |= SMIAPP_PLL_FLAG_OP_PIX_CLOCK_PER_LANE;
 	pll->scale_n = sensor->limits[SMIAPP_LIMIT_SCALER_N_MIN];
 
 	rval = smiapp_update_mode(sensor);
diff --git a/drivers/media/i2c/smiapp/smiapp-quirk.c b/drivers/media/i2c/smiapp/smiapp-quirk.c
index bb8c506..c7f5194 100644
--- a/drivers/media/i2c/smiapp/smiapp-quirk.c
+++ b/drivers/media/i2c/smiapp/smiapp-quirk.c
@@ -271,7 +271,7 @@ const struct smiapp_quirk smiapp_jt8ev1_quirk = {
 	.post_poweron = jt8ev1_post_poweron,
 	.pre_streamon = jt8ev1_pre_streamon,
 	.post_streamoff = jt8ev1_post_streamoff,
-	.flags = SMIAPP_QUIRK_FLAG_OP_PIX_CLOCK_PER_LANE,
+	.pll_flags = SMIAPP_PLL_FLAG_OP_PIX_CLOCK_PER_LANE,
 };
 
 static int tcm8500md_limits(struct smiapp_sensor *sensor)
diff --git a/drivers/media/i2c/smiapp/smiapp-quirk.h b/drivers/media/i2c/smiapp/smiapp-quirk.h
index 504a6d8..bc9d28c 100644
--- a/drivers/media/i2c/smiapp/smiapp-quirk.h
+++ b/drivers/media/i2c/smiapp/smiapp-quirk.h
@@ -43,11 +43,10 @@ struct smiapp_quirk {
 	int (*post_streamoff)(struct smiapp_sensor *sensor);
 	const struct smia_reg *regs;
 	unsigned long flags;
+	unsigned long pll_flags;
 };
 
-/* op pix clock is for all lanes in total normally */
-#define SMIAPP_QUIRK_FLAG_OP_PIX_CLOCK_PER_LANE			(1 << 0)
-#define SMIAPP_QUIRK_FLAG_8BIT_READ_ONLY			(1 << 1)
+#define SMIAPP_QUIRK_FLAG_8BIT_READ_ONLY			(1 << 0)
 
 struct smiapp_reg_8 {
 	u16 reg;
-- 
1.8.3.2


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/3] smiapp: Set sub-device owner
  2014-03-28 14:35 ` [PATCH 2/3] smiapp: Set sub-device owner Sakari Ailus
@ 2014-07-17 10:22   ` Laurent Pinchart
  2014-07-17 11:00     ` Sakari Ailus
  0 siblings, 1 reply; 6+ messages in thread
From: Laurent Pinchart @ 2014-07-17 10:22 UTC (permalink / raw)
  To: Sakari Ailus; +Cc: linux-media

Hi Sakari,

What happened to this patch ? 1/3 and 3/3 from the same series seem to have 
been applied, but not 2/3.

On Friday 28 March 2014 16:35:12 Sakari Ailus wrote:
> The smiapp driver is the owner of the sub-devices exposed by the smiapp
> driver. This prevents unloading the module whilst it's in use.
> 
> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
> ---
>  drivers/media/i2c/smiapp/smiapp-core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/media/i2c/smiapp/smiapp-core.c
> b/drivers/media/i2c/smiapp/smiapp-core.c index 69c11ec..5179cf4 100644
> --- a/drivers/media/i2c/smiapp/smiapp-core.c
> +++ b/drivers/media/i2c/smiapp/smiapp-core.c
> @@ -2569,7 +2569,7 @@ static int smiapp_registered(struct v4l2_subdev
> *subdev)
> 
>  		this->sd.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
>  		this->sd.internal_ops = &smiapp_internal_ops;
> -		this->sd.owner = NULL;
> +		this->sd.owner = THIS_MODULE;
>  		v4l2_set_subdevdata(&this->sd, client);
> 
>  		rval = media_entity_init(&this->sd.entity,

-- 
Regards,

Laurent Pinchart


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/3] smiapp: Set sub-device owner
  2014-07-17 10:22   ` Laurent Pinchart
@ 2014-07-17 11:00     ` Sakari Ailus
  0 siblings, 0 replies; 6+ messages in thread
From: Sakari Ailus @ 2014-07-17 11:00 UTC (permalink / raw)
  To: Laurent Pinchart; +Cc: Sakari Ailus, linux-media

On Thu, Jul 17, 2014 at 12:22:47PM +0200, Laurent Pinchart wrote:
> Hi Sakari,
> 
> What happened to this patch ? 1/3 and 3/3 from the same series seem to have 
> been applied, but not 2/3.

I think this must have fallen through the cracks when I added a number of
other patches to the set. Thanks for notifying me.

-- 
Kind regards,

Sakari Ailus
e-mail: sakari.ailus@iki.fi	XMPP: sailus@retiisi.org.uk

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-07-17 11:00 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-28 14:35 [PATCH 0/3] Small smiapp changes Sakari Ailus
2014-03-28 14:35 ` [PATCH 1/3] smiapp: Use I2C adapter ID and address in the sub-device name Sakari Ailus
2014-03-28 14:35 ` [PATCH 2/3] smiapp: Set sub-device owner Sakari Ailus
2014-07-17 10:22   ` Laurent Pinchart
2014-07-17 11:00     ` Sakari Ailus
2014-03-28 14:35 ` [PATCH 3/3] smiapp: Make PLL flags separate from regular quirk flags Sakari Ailus

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).