From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mx3.redhat.com (mx3.redhat.com [172.16.48.32]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n0U0rnJB032157 for ; Thu, 29 Jan 2009 19:53:49 -0500 Received: from devils.ext.ti.com (devils.ext.ti.com [198.47.26.153]) by mx3.redhat.com (8.13.8/8.13.8) with ESMTP id n0U0rWFC014623 for ; Thu, 29 Jan 2009 19:53:32 -0500 From: Dominic Curran To: "linux-omap" , video4linux-list@redhat.com Date: Thu, 29 Jan 2009 18:53:26 -0600 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200901291853.26533.dcurran@ti.com> Cc: greg.hofer@hp.com Subject: [OMAPZOOM][PATCH 1/6] CSI2: Add function to change number of data lanes used. List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: video4linux-list-bounces@redhat.com Errors-To: video4linux-list-bounces@redhat.com List-ID: From: Dominic Curran Subject: [OMAPZOOM][PATCH 1/6] CSI2: Add function to change number of data lanes used. Add new CSI2 function. New function is isp_csi2_complexio_lanes_count(). Sets the number of CSI2 data lanes that should be used. Signed-off-by: Dominic Curran Signed-off-by: Greg Hofer --- drivers/media/video/isp/ispcsi2.c | 33 +++++++++++++++++++++++++++++++-- drivers/media/video/isp/ispcsi2.h | 5 +++++ 2 files changed, 36 insertions(+), 2 deletions(-) mode change 100644 => 100755 drivers/media/video/isp/ispcsi2.c mode change 100644 => 100755 drivers/media/video/isp/ispcsi2.h Index: omapzoom04/drivers/media/video/isp/ispcsi2.c =================================================================== --- omapzoom04.orig/drivers/media/video/isp/ispcsi2.c +++ omapzoom04/drivers/media/video/isp/ispcsi2.c @@ -112,6 +112,11 @@ int isp_csi2_complexio_lanes_config(stru currlanes_u->data[i] = true; update_complexio_cfg1 = true; } + /* If the lane position is non zero then we can assume that + * the initial lane state is on. + */ + if (currlanes->data[i].pos) + currlanes->data[i].state = ISP_CSI2_LANE_ON; } if (currlanes->clk.pos != reqcfg->clk.pos) { @@ -158,9 +163,10 @@ int isp_csi2_complexio_lanes_update(bool 1)); reg |= (currlanes->data[i].pol << ISPCSI2_COMPLEXIO_CFG1_DATA_POL_SHIFT(i + 1)); - reg |= (currlanes->data[i].pos << + if (currlanes->data[i].state == ISP_CSI2_LANE_ON) + reg |= (currlanes->data[i].pos << ISPCSI2_COMPLEXIO_CFG1_DATA_POSITION_SHIFT(i + - 1)); + 1)); currlanes_u->data[i] = false; } } @@ -181,6 +187,29 @@ int isp_csi2_complexio_lanes_update(bool } /** + * isp_csi2_complexio_lanes_count - Turn data lanes on/off dynamically. + * @ cnt: Number of data lanes to enable. + * + * Always returns 0. + **/ +int isp_csi2_complexio_lanes_count(int cnt) +{ + struct isp_csi2_lanes_cfg *currlanes = ¤t_csi2_cfg.lanes; + int i; + + for (i = 0; i < 4; i++) { + if (i < cnt) + currlanes->data[i].state = ISP_CSI2_LANE_ON; + else + currlanes->data[i].state = ISP_CSI2_LANE_OFF; + } + + isp_csi2_complexio_lanes_update(true); + return 0; +} +EXPORT_SYMBOL(isp_csi2_complexio_lanes_count); + +/** * isp_csi2_complexio_lanes_get - Gets CSI2 ComplexIO lanes configuration. * * Gets settings from HW registers and fills in the internal driver memory Index: omapzoom04/drivers/media/video/isp/ispcsi2.h =================================================================== --- omapzoom04.orig/drivers/media/video/isp/ispcsi2.h +++ omapzoom04/drivers/media/video/isp/ispcsi2.h @@ -20,6 +20,9 @@ #define OMAP_ISP_CSI2_API_H #include +#define ISP_CSI2_LANE_OFF 0 +#define ISP_CSI2_LANE_ON 1 + enum isp_csi2_irqevents { OCP_ERR_IRQ = 0x4000, SHORT_PACKET_IRQ = 0x2000, @@ -63,6 +66,7 @@ enum isp_csi2_frame_mode { struct csi2_lanecfg { u8 pos; u8 pol; + u8 state; /*Current state - 1-Used 0-Unused */ }; struct isp_csi2_lanes_cfg { @@ -175,6 +179,7 @@ struct isp_csi2_cfg_update { int isp_csi2_complexio_lanes_config(struct isp_csi2_lanes_cfg *reqcfg); int isp_csi2_complexio_lanes_update(bool force_update); +int isp_csi2_complexio_lanes_count(int cnt); int isp_csi2_complexio_lanes_get(void); int isp_csi2_complexio_power_autoswitch(bool enable); int isp_csi2_complexio_power(enum isp_csi2_power_cmds power_cmd); -- video4linux-list mailing list Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe https://www.redhat.com/mailman/listinfo/video4linux-list