From patchwork Sun Jan 11 18:16:32 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guennadi Liakhovetski X-Patchwork-Id: 1790 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n0BID6Zd004118 for ; Sun, 11 Jan 2009 10:13:06 -0800 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752947AbZAKSQb (ORCPT ); Sun, 11 Jan 2009 13:16:31 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752888AbZAKSQb (ORCPT ); Sun, 11 Jan 2009 13:16:31 -0500 Received: from mail.gmx.net ([213.165.64.20]:46353 "HELO mail.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1752675AbZAKSQ3 (ORCPT ); Sun, 11 Jan 2009 13:16:29 -0500 Received: (qmail invoked by alias); 11 Jan 2009 18:16:21 -0000 Received: from p57BD34EA.dip0.t-ipconnect.de (EHLO axis700.grange) [87.189.52.234] by mail.gmx.net (mp004) with SMTP; 11 Jan 2009 19:16:21 +0100 X-Authenticated: #20450766 X-Provags-ID: V01U2FsdGVkX1/4T98JmEn4IwsiViAKYxeHYxb+YEDK1D50RbJD0L 5J68WBxBgKdmME Received: from lyakh (helo=localhost) by axis700.grange with local-esmtp (Exim 4.63) (envelope-from ) id 1LM4rQ-0004Uh-RE; Sun, 11 Jan 2009 19:16:32 +0100 Date: Sun, 11 Jan 2009 19:16:32 +0100 (CET) From: Guennadi Liakhovetski To: Linux Media Mailing List cc: Robert Jarzmik , Magnus Damm Subject: [PATCH 2/2] soc-camera: extend soc_camera_bus_param_compatible with more tests Message-ID: MIME-Version: 1.0 X-Y-GMX-Trusted: 0 X-FuHaFi: 0.48 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Add data signal polarity and bus-width tests to soc_camera_bus_param_compatible(). Signed-off-by: Guennadi Liakhovetski --- Tested on pxa270 with mt9m001. Please review / test further platforms and configurations. -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/include/media/soc_camera.h b/include/media/soc_camera.h index 7440d92..b39e093 100644 --- a/include/media/soc_camera.h +++ b/include/media/soc_camera.h @@ -239,15 +239,17 @@ static inline struct v4l2_queryctrl const *soc_camera_find_qctrl( static inline unsigned long soc_camera_bus_param_compatible( unsigned long camera_flags, unsigned long bus_flags) { - unsigned long common_flags, hsync, vsync, pclk; + unsigned long common_flags, hsync, vsync, pclk, data, buswidth; common_flags = camera_flags & bus_flags; hsync = common_flags & (SOCAM_HSYNC_ACTIVE_HIGH | SOCAM_HSYNC_ACTIVE_LOW); vsync = common_flags & (SOCAM_VSYNC_ACTIVE_HIGH | SOCAM_VSYNC_ACTIVE_LOW); pclk = common_flags & (SOCAM_PCLK_SAMPLE_RISING | SOCAM_PCLK_SAMPLE_FALLING); + data = common_flags & (SOCAM_DATA_ACTIVE_HIGH | SOCAM_DATA_ACTIVE_LOW); + buswidth = common_flags & SOCAM_DATAWIDTH_MASK; - return (!hsync || !vsync || !pclk) ? 0 : common_flags; + return (!hsync || !vsync || !pclk || !data || !buswidth) ? 0 : common_flags; } extern unsigned long soc_camera_apply_sensor_flags(struct soc_camera_link *icl,