From patchwork Tue Dec 20 20:28:06 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sakari Ailus X-Patchwork-Id: 8919 Received: from mail.tu-berlin.de ([130.149.7.33]) by www.linuxtv.org with esmtp (Exim 4.72) (envelope-from ) id 1Rd6Ii-00035H-OX; Tue, 20 Dec 2011 21:28:41 +0100 X-tubIT-Incoming-IP: 209.132.180.67 Received: from vger.kernel.org ([209.132.180.67]) by mail.tu-berlin.de (exim-4.75/mailfrontend-3) with esmtp id 1Rd6Ii-0003pa-DX; Tue, 20 Dec 2011 21:28:40 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752979Ab1LTU2h (ORCPT + 3 others); Tue, 20 Dec 2011 15:28:37 -0500 Received: from smtp.nokia.com ([147.243.128.24]:53514 "EHLO mgw-da01.nokia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752904Ab1LTU2S (ORCPT ); Tue, 20 Dec 2011 15:28:18 -0500 Received: from maxwell.research.nokia.com (maxwell.research.nokia.com [172.21.50.162]) by mgw-da01.nokia.com (Switch-3.4.4/Switch-3.4.4) with ESMTP id pBKKSEhD005206 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 20 Dec 2011 22:28:15 +0200 Received: from lanttu (unknown [192.168.239.74]) by maxwell.research.nokia.com (Postfix) with ESMTPS id 491EC37FCDA; Tue, 20 Dec 2011 22:28:14 +0200 (EET) Received: from sakke by lanttu with local (Exim 4.72) (envelope-from ) id 1Rd6IK-0004jS-1E; Tue, 20 Dec 2011 22:28:16 +0200 From: Sakari Ailus To: linux-media@vger.kernel.org Cc: laurent.pinchart@ideasonboard.com, dacohen@gmail.com, snjw23@gmail.com Subject: [RFC 14/17] omap3isp: Use pixelrate from sensor media bus frameformat Date: Tue, 20 Dec 2011 22:28:06 +0200 Message-Id: <1324412889-17961-14-git-send-email-sakari.ailus@maxwell.research.nokia.com> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <4EF0EFC9.6080501@maxwell.research.nokia.com> References: <4EF0EFC9.6080501@maxwell.research.nokia.com> X-Nokia-AV: Clean Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-PMX-Version: 5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2011.12.20.201815 X-PMX-Spam: Gauge=IIIIIIII, Probability=8%, Report=' MULTIPLE_RCPTS 0.1, BODYTEXTP_SIZE_3000_LESS 0, BODY_SIZE_2000_2999 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, __ANY_URI 0, __CP_MEDIA_BODY 0, __CP_POSSIBLE_EXPLOIT_SUBJ 0, __CP_URI_IN_BODY 0, __HAS_MSGID 0, __HAS_X_MAILER 0, __HAS_X_MAILING_LIST 0, __MIME_TEXT_ONLY 0, __MULTIPLE_RCPTS_CC_X2 0, __SANE_MSGID 0, __TO_MALFORMED_2 0, __TO_NO_NAME 0, __URI_NO_WWW 0, __URI_NS ' X-LSpam-Score: -1.9 (-) X-LSpam-Report: No, score=-1.9 required=5.0 tests=BAYES_00=-1.9 autolearn=ham From: Sakari Ailus Configure the ISP based on the pixelrate in media bus frame format. Previously the same was configured from the board code. Signed-off-by: Sakari Ailus --- drivers/media/video/omap3isp/isp.c | 24 +++++++++++++++++++++--- drivers/media/video/omap3isp/isp.h | 1 - 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/drivers/media/video/omap3isp/isp.c b/drivers/media/video/omap3isp/isp.c index 6020fd7..92f9716 100644 --- a/drivers/media/video/omap3isp/isp.c +++ b/drivers/media/video/omap3isp/isp.c @@ -749,10 +749,14 @@ static int isp_pipeline_enable(struct isp_pipeline *pipe, entity = &pipe->output->video.entity; while (1) { - pad = &entity->pads[0]; - if (!(pad->flags & MEDIA_PAD_FL_SINK)) + /* + * Is this an external subdev connected to us? If so, + * we're done. + */ + if (subdev && subdev->host_priv) break; + pad = &entity->pads[0]; pad = media_entity_remote_source(pad); if (pad == NULL || media_entity_type(pad->entity) != MEDIA_ENT_T_V4L2_SUBDEV) @@ -762,6 +766,21 @@ static int isp_pipeline_enable(struct isp_pipeline *pipe, prev_subdev = subdev; subdev = media_entity_to_v4l2_subdev(entity); + /* Configure CCDC pixel clock */ + if (subdev->host_priv) { + struct v4l2_subdev_format fmt; + + fmt.pad = pad->index; + fmt.which = V4L2_SUBDEV_FORMAT_ACTIVE; + ret = v4l2_subdev_call(subdev, pad, get_fmt, + NULL, &fmt); + if (ret < 0) + return -EINVAL; + + isp_set_pixel_clock(isp, + fmt.format.pixelrate * 1000); + } + /* Configure CSI-2 receiver based on sensor format. */ if (prev_subdev == &isp->isp_csi2a.subdev || prev_subdev == &isp->isp_csi2c.subdev) { @@ -2102,7 +2121,6 @@ static int isp_probe(struct platform_device *pdev) isp->autoidle = autoidle; isp->platform_cb.set_xclk = isp_set_xclk; - isp->platform_cb.set_pixel_clock = isp_set_pixel_clock; mutex_init(&isp->isp_mutex); spin_lock_init(&isp->stat_lock); diff --git a/drivers/media/video/omap3isp/isp.h b/drivers/media/video/omap3isp/isp.h index c5935ae..7d73a39 100644 --- a/drivers/media/video/omap3isp/isp.h +++ b/drivers/media/video/omap3isp/isp.h @@ -126,7 +126,6 @@ struct isp_reg { struct isp_platform_callback { u32 (*set_xclk)(struct isp_device *isp, u32 xclk, u8 xclksel); - void (*set_pixel_clock)(struct isp_device *isp, unsigned int pixelclk); }; /*