linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] OMAP3 ISP patches for v3.1
@ 2011-07-15 18:24 Laurent Pinchart
  2011-07-15 18:24 ` [PATCH 1/3] OMAP3: ISP: Add regulator control for omap34xx Laurent Pinchart
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Laurent Pinchart @ 2011-07-15 18:24 UTC (permalink / raw)
  To: linux-media; +Cc: linux-omap, sakari.ailus

Hi everybody,

Here are the OMAP3 ISP patches in my queue for v3.1. I'll send a pull request
in a couple of days if there's no objection.

Kalle Jokiniemi (2):
  OMAP3: ISP: Add regulator control for omap34xx
  OMAP3: RX-51: define vdds_csib regulator supply

Laurent Pinchart (1):
  omap3isp: Support configurable HS/VS polarities

 arch/arm/mach-omap2/board-rx51-peripherals.c |    5 ++++
 drivers/media/video/omap3isp/isp.h           |    6 +++++
 drivers/media/video/omap3isp/ispccdc.c       |    4 +-
 drivers/media/video/omap3isp/ispccp2.c       |   27 ++++++++++++++++++++++++-
 drivers/media/video/omap3isp/ispccp2.h       |    1 +
 5 files changed, 39 insertions(+), 4 deletions(-)

-- 
Regards,

Laurent Pinchart


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

* [PATCH 1/3] OMAP3: ISP: Add regulator control for omap34xx
  2011-07-15 18:24 [PATCH 0/3] OMAP3 ISP patches for v3.1 Laurent Pinchart
@ 2011-07-15 18:24 ` Laurent Pinchart
  2011-07-15 18:24 ` [PATCH 2/3] OMAP3: RX-51: define vdds_csib regulator supply Laurent Pinchart
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Laurent Pinchart @ 2011-07-15 18:24 UTC (permalink / raw)
  To: linux-media; +Cc: linux-omap, sakari.ailus, Kalle Jokiniemi

From: Kalle Jokiniemi <kalle.jokiniemi@nokia.com>

The current omap3isp driver is missing regulator handling
for CSIb complex in omap34xx based devices. This patch
adds a mechanism for this to the omap3isp driver.

Signed-off-by: Kalle Jokiniemi <kalle.jokiniemi@nokia.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 drivers/media/video/omap3isp/ispccp2.c |   27 +++++++++++++++++++++++++--
 drivers/media/video/omap3isp/ispccp2.h |    1 +
 2 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/drivers/media/video/omap3isp/ispccp2.c b/drivers/media/video/omap3isp/ispccp2.c
index 0e16cab..ec9e395f 100644
--- a/drivers/media/video/omap3isp/ispccp2.c
+++ b/drivers/media/video/omap3isp/ispccp2.c
@@ -30,6 +30,7 @@
 #include <linux/module.h>
 #include <linux/mutex.h>
 #include <linux/uaccess.h>
+#include <linux/regulator/consumer.h>
 
 #include "isp.h"
 #include "ispreg.h"
@@ -163,6 +164,9 @@ static void ccp2_if_enable(struct isp_ccp2_device *ccp2, u8 enable)
 	struct isp_pipeline *pipe = to_isp_pipeline(&ccp2->subdev.entity);
 	int i;
 
+	if (enable && ccp2->vdds_csib)
+		regulator_enable(ccp2->vdds_csib);
+
 	/* Enable/Disable all the LCx channels */
 	for (i = 0; i < CCP2_LCx_CHANS_NUM; i++)
 		isp_reg_clr_set(isp, OMAP3_ISP_IOMEM_CCP2, ISPCCP2_LCx_CTRL(i),
@@ -186,6 +190,9 @@ static void ccp2_if_enable(struct isp_ccp2_device *ccp2, u8 enable)
 				    ISPCCP2_LC01_IRQENABLE,
 				    ISPCCP2_LC01_IRQSTATUS_LC0_FS_IRQ);
 	}
+
+	if (!enable && ccp2->vdds_csib)
+		regulator_disable(ccp2->vdds_csib);
 }
 
 /*
@@ -1137,6 +1144,9 @@ error:
  */
 void omap3isp_ccp2_cleanup(struct isp_device *isp)
 {
+	struct isp_ccp2_device *ccp2 = &isp->isp_ccp2;
+
+	regulator_put(ccp2->vdds_csib);
 }
 
 /*
@@ -1151,14 +1161,27 @@ int omap3isp_ccp2_init(struct isp_device *isp)
 
 	init_waitqueue_head(&ccp2->wait);
 
-	/* On the OMAP36xx, the CCP2 uses the CSI PHY1 or PHY2, shared with
+	/*
+	 * On the OMAP34xx the CSI1 receiver is operated in the CSIb IO
+	 * complex, which is powered by vdds_csib power rail. Hence the
+	 * request for the regulator.
+	 *
+	 * On the OMAP36xx, the CCP2 uses the CSI PHY1 or PHY2, shared with
 	 * the CSI2c or CSI2a receivers. The PHY then needs to be explicitly
 	 * configured.
 	 *
 	 * TODO: Don't hardcode the usage of PHY1 (shared with CSI2c).
 	 */
-	if (isp->revision == ISP_REVISION_15_0)
+	if (isp->revision == ISP_REVISION_2_0) {
+		ccp2->vdds_csib = regulator_get(isp->dev, "vdds_csib");
+		if (IS_ERR(ccp2->vdds_csib)) {
+			dev_dbg(isp->dev,
+				"Could not get regulator vdds_csib\n");
+			ccp2->vdds_csib = NULL;
+		}
+	} else if (isp->revision == ISP_REVISION_15_0) {
 		ccp2->phy = &isp->isp_csiphy1;
+	}
 
 	ret = ccp2_init_entities(ccp2);
 	if (ret < 0)
diff --git a/drivers/media/video/omap3isp/ispccp2.h b/drivers/media/video/omap3isp/ispccp2.h
index 5505a86..6674e9d 100644
--- a/drivers/media/video/omap3isp/ispccp2.h
+++ b/drivers/media/video/omap3isp/ispccp2.h
@@ -81,6 +81,7 @@ struct isp_ccp2_device {
 	struct isp_interface_mem_config mem_cfg;
 	struct isp_video video_in;
 	struct isp_csiphy *phy;
+	struct regulator *vdds_csib;
 	unsigned int error;
 	enum isp_pipeline_stream_state state;
 	wait_queue_head_t wait;
-- 
1.7.3.4


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

* [PATCH 2/3] OMAP3: RX-51: define vdds_csib regulator supply
  2011-07-15 18:24 [PATCH 0/3] OMAP3 ISP patches for v3.1 Laurent Pinchart
  2011-07-15 18:24 ` [PATCH 1/3] OMAP3: ISP: Add regulator control for omap34xx Laurent Pinchart
@ 2011-07-15 18:24 ` Laurent Pinchart
  2011-07-15 18:24 ` [PATCH 3/3] omap3isp: Support configurable HS/VS polarities Laurent Pinchart
  2011-07-20 13:23 ` [PATCH 0/3] OMAP3 ISP patches for v3.1 Sakari Ailus
  3 siblings, 0 replies; 5+ messages in thread
From: Laurent Pinchart @ 2011-07-15 18:24 UTC (permalink / raw)
  To: linux-media; +Cc: linux-omap, sakari.ailus, Kalle Jokiniemi, tony

From: Kalle Jokiniemi <kalle.jokiniemi@nokia.com>

The RX-51 uses the CSIb IO complex for camera operation. The
board file is missing definition for the regulator supplying
the CSIb complex, so this is added for better power
management.

Signed-off-by: Kalle Jokiniemi <kalle.jokiniemi@nokia.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: tony@atomide.com
---
 arch/arm/mach-omap2/board-rx51-peripherals.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

Tony, can I push this patch through the V4L/DVB tree, or would you like to
pick it yourself ?

diff --git a/arch/arm/mach-omap2/board-rx51-peripherals.c b/arch/arm/mach-omap2/board-rx51-peripherals.c
index 88bd6f7..17e5685 100644
--- a/arch/arm/mach-omap2/board-rx51-peripherals.c
+++ b/arch/arm/mach-omap2/board-rx51-peripherals.c
@@ -361,6 +361,9 @@ static struct omap2_hsmmc_info mmc[] __initdata = {
 static struct regulator_consumer_supply rx51_vmmc1_supply =
 	REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0");
 
+static struct regulator_consumer_supply rx51_vaux2_supply =
+	REGULATOR_SUPPLY("vdds_csib", "omap3isp");
+
 static struct regulator_consumer_supply rx51_vaux3_supply =
 	REGULATOR_SUPPLY("vmmc", "omap_hsmmc.1");
 
@@ -424,6 +427,8 @@ static struct regulator_init_data rx51_vaux2 = {
 		.valid_ops_mask		= REGULATOR_CHANGE_MODE
 					| REGULATOR_CHANGE_STATUS,
 	},
+	.num_consumer_supplies	= 1,
+	.consumer_supplies	= &rx51_vaux2_supply,
 };
 
 /* VAUX3 - adds more power to VIO_18 rail */
-- 
1.7.3.4


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

* [PATCH 3/3] omap3isp: Support configurable HS/VS polarities
  2011-07-15 18:24 [PATCH 0/3] OMAP3 ISP patches for v3.1 Laurent Pinchart
  2011-07-15 18:24 ` [PATCH 1/3] OMAP3: ISP: Add regulator control for omap34xx Laurent Pinchart
  2011-07-15 18:24 ` [PATCH 2/3] OMAP3: RX-51: define vdds_csib regulator supply Laurent Pinchart
@ 2011-07-15 18:24 ` Laurent Pinchart
  2011-07-20 13:23 ` [PATCH 0/3] OMAP3 ISP patches for v3.1 Sakari Ailus
  3 siblings, 0 replies; 5+ messages in thread
From: Laurent Pinchart @ 2011-07-15 18:24 UTC (permalink / raw)
  To: linux-media; +Cc: linux-omap, sakari.ailus

Add two fields to the ISP parallel platform data to set the HS and VS
signals polarities.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 drivers/media/video/omap3isp/isp.h     |    6 ++++++
 drivers/media/video/omap3isp/ispccdc.c |    4 ++--
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/media/video/omap3isp/isp.h b/drivers/media/video/omap3isp/isp.h
index 2620c40..529e582 100644
--- a/drivers/media/video/omap3isp/isp.h
+++ b/drivers/media/video/omap3isp/isp.h
@@ -139,6 +139,10 @@ struct isp_reg {
  *		3 - CAMEXT[13:6] -> CAM[7:0]
  * @clk_pol: Pixel clock polarity
  *		0 - Non Inverted, 1 - Inverted
+ * @hs_pol: Horizontal synchronization polarity
+ *		0 - Active high, 1 - Active low
+ * @vs_pol: Vertical synchronization polarity
+ *		0 - Active high, 1 - Active low
  * @bridge: CCDC Bridge input control
  *		ISPCTRL_PAR_BRIDGE_DISABLE - Disable
  *		ISPCTRL_PAR_BRIDGE_LENDIAN - Little endian
@@ -147,6 +151,8 @@ struct isp_reg {
 struct isp_parallel_platform_data {
 	unsigned int data_lane_shift:2;
 	unsigned int clk_pol:1;
+	unsigned int hs_pol:1;
+	unsigned int vs_pol:1;
 	unsigned int bridge:4;
 };
 
diff --git a/drivers/media/video/omap3isp/ispccdc.c b/drivers/media/video/omap3isp/ispccdc.c
index 6766247..b8cb7dd 100644
--- a/drivers/media/video/omap3isp/ispccdc.c
+++ b/drivers/media/video/omap3isp/ispccdc.c
@@ -1148,6 +1148,8 @@ static void ccdc_configure(struct isp_ccdc_device *ccdc)
 	omap3isp_configure_bridge(isp, ccdc->input, pdata, shift);
 
 	ccdc->syncif.datsz = depth_out;
+	ccdc->syncif.hdpol = pdata ? pdata->hs_pol : 0;
+	ccdc->syncif.vdpol = pdata ? pdata->vs_pol : 0;
 	ccdc_config_sync_if(ccdc, &ccdc->syncif);
 
 	/* CCDC_PAD_SINK */
@@ -2256,8 +2258,6 @@ int omap3isp_ccdc_init(struct isp_device *isp)
 	ccdc->syncif.fldout = 0;
 	ccdc->syncif.fldpol = 0;
 	ccdc->syncif.fldstat = 0;
-	ccdc->syncif.hdpol = 0;
-	ccdc->syncif.vdpol = 0;
 
 	ccdc->clamp.oblen = 0;
 	ccdc->clamp.dcsubval = 0;
-- 
1.7.3.4


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

* Re: [PATCH 0/3] OMAP3 ISP patches for v3.1
  2011-07-15 18:24 [PATCH 0/3] OMAP3 ISP patches for v3.1 Laurent Pinchart
                   ` (2 preceding siblings ...)
  2011-07-15 18:24 ` [PATCH 3/3] omap3isp: Support configurable HS/VS polarities Laurent Pinchart
@ 2011-07-20 13:23 ` Sakari Ailus
  3 siblings, 0 replies; 5+ messages in thread
From: Sakari Ailus @ 2011-07-20 13:23 UTC (permalink / raw)
  To: Laurent Pinchart; +Cc: linux-media, linux-omap

Laurent Pinchart wrote:
> Hi everybody,
> 
> Here are the OMAP3 ISP patches in my queue for v3.1. I'll send a pull request
> in a couple of days if there's no objection.
> 
> Kalle Jokiniemi (2):
>   OMAP3: ISP: Add regulator control for omap34xx
>   OMAP3: RX-51: define vdds_csib regulator supply
> 
> Laurent Pinchart (1):
>   omap3isp: Support configurable HS/VS polarities
> 
>  arch/arm/mach-omap2/board-rx51-peripherals.c |    5 ++++
>  drivers/media/video/omap3isp/isp.h           |    6 +++++
>  drivers/media/video/omap3isp/ispccdc.c       |    4 +-
>  drivers/media/video/omap3isp/ispccp2.c       |   27 ++++++++++++++++++++++++-
>  drivers/media/video/omap3isp/ispccp2.h       |    1 +
>  5 files changed, 39 insertions(+), 4 deletions(-)

Hi Laurent,

Thanks for the patchset!

Acked-by: Sakari Ailus <sakari.ailus@iki.fi>

-- 
Sakari Ailus
sakari.ailus@maxwell.research.nokia.com

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

end of thread, other threads:[~2011-07-20 13:23 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-15 18:24 [PATCH 0/3] OMAP3 ISP patches for v3.1 Laurent Pinchart
2011-07-15 18:24 ` [PATCH 1/3] OMAP3: ISP: Add regulator control for omap34xx Laurent Pinchart
2011-07-15 18:24 ` [PATCH 2/3] OMAP3: RX-51: define vdds_csib regulator supply Laurent Pinchart
2011-07-15 18:24 ` [PATCH 3/3] omap3isp: Support configurable HS/VS polarities Laurent Pinchart
2011-07-20 13:23 ` [PATCH 0/3] OMAP3 ISP patches for v3.1 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).