From patchwork Tue Oct 30 14:29:00 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Javier Martin X-Patchwork-Id: 1670461 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id B68C9DF264 for ; Tue, 30 Oct 2012 14:29:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932213Ab2J3O3R (ORCPT ); Tue, 30 Oct 2012 10:29:17 -0400 Received: from mail-wg0-f44.google.com ([74.125.82.44]:38880 "EHLO mail-wg0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759357Ab2J3O3P (ORCPT ); Tue, 30 Oct 2012 10:29:15 -0400 Received: by mail-wg0-f44.google.com with SMTP id dr13so229544wgb.1 for ; Tue, 30 Oct 2012 07:29:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=M0jwaJp7jJd1iD2y3P9Ss17Txiq2uk0W15kw7a0Mk98=; b=CbggXFucgJnOc9n1gUIaqaD7zZnaYJEzKHoORzW2G+aQxV7NOkYYlBTAmsGlZEMJJW pVFl9Ikz5JLUdx5WfD32eYg25eCgcf0IGBu1mD6BUFsxEaZoyChZo8P61wLPp5vUzXvf r9VlUpF72FSW+6qCztqIlZvphV9g550fxd7S4+hgZseN96CcHL89bpY90qMOacu5t3o1 CAqDSHn0yH8TNhJy3E5i38G/a9Ra3ORXyMBDWpBT1k2oCr36xh7SVpkKArFJgX5z32Ep 4GGNEdI4dKFh+myiGkjbD09jBjLqBsqXuKl4C2Bb960qFkD9kezpMjTJBiQIJjWIElwR btGw== Received: by 10.216.131.218 with SMTP id m68mr17612080wei.195.1351607354132; Tue, 30 Oct 2012 07:29:14 -0700 (PDT) Received: from piscis.vsilicon.net (149.93.18.95.dynamic.jazztel.es. [95.18.93.149]) by mx.google.com with ESMTPS id v3sm1455206wiy.5.2012.10.30.07.29.13 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 30 Oct 2012 07:29:13 -0700 (PDT) From: Javier Martin To: linux-media@vger.kernel.org Cc: g.liakhovetski@gmx.de, fabio.estevam@freescale.com, Javier Martin Subject: [PATCH v2 2/4] media: mx2_camera: Add image size HW limits. Date: Tue, 30 Oct 2012 15:29:00 +0100 Message-Id: <1351607342-18030-3-git-send-email-javier.martin@vista-silicon.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1351607342-18030-1-git-send-email-javier.martin@vista-silicon.com> References: <1351607342-18030-1-git-send-email-javier.martin@vista-silicon.com> X-Gm-Message-State: ALoCoQkOa+kkij6g3KbdItQEZVpWoFTwX5tPJTWO9ohlnUIzC1MXhjwhFWzD0a0u3adf4njZF67O Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org The CSI has some constraints regarding image with. This patch makes sure those requirements are met in try_fmt(). Signed-off-by: Javier Martin --- drivers/media/platform/soc_camera/mx2_camera.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/media/platform/soc_camera/mx2_camera.c b/drivers/media/platform/soc_camera/mx2_camera.c index e1b44b1..bf1178c 100644 --- a/drivers/media/platform/soc_camera/mx2_camera.c +++ b/drivers/media/platform/soc_camera/mx2_camera.c @@ -1234,7 +1234,11 @@ static int mx2_camera_try_fmt(struct soc_camera_device *icd, return -EINVAL; } - /* FIXME: implement MX27 limits */ + /* + * With must be multiple of 8 as requested by the CSI. + * (Table 39-2 in the i.MX27 Reference Manual). + */ + pix->width &= ~0x7; /* limit to sensor capabilities */ mf.width = pix->width;