From patchwork Sat Sep 15 21:43:28 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sakari Ailus X-Patchwork-Id: 1462481 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id E6AB4402E1 for ; Sat, 15 Sep 2012 21:42:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753698Ab2IOVmN (ORCPT ); Sat, 15 Sep 2012 17:42:13 -0400 Received: from nblzone-211-213.nblnetworks.fi ([83.145.211.213]:43527 "EHLO hillosipuli.retiisi.org.uk" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753744Ab2IOVmI (ORCPT ); Sat, 15 Sep 2012 17:42:08 -0400 Received: from localhost.localdomain (salottisipuli.retiisi.org.uk [IPv6:2001:1bc8:102:6d9a::83:2]) by hillosipuli.retiisi.org.uk (Postfix) with ESMTP id BB88E60099 for ; Sun, 16 Sep 2012 00:42:05 +0300 (EEST) From: Sakari Ailus To: linux-media@vger.kernel.org Subject: [PATCH 1/2] smiapp: Use highest bits-per-pixel for sensor internal format Date: Sun, 16 Sep 2012 00:43:28 +0300 Message-Id: <1347745409-21003-1-git-send-email-sakari.ailus@iki.fi> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <5054F66C.1050400@iki.fi> References: <5054F66C.1050400@iki.fi> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org The format shown on the links internal to the sensor was the first one enumerated from the sensor, not the highest bit depth data that can be produced by the sensor. Correct this. Signed-off-by: Sakari Ailus --- drivers/media/i2c/smiapp/smiapp-core.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/drivers/media/i2c/smiapp/smiapp-core.c b/drivers/media/i2c/smiapp/smiapp-core.c index 4f1c8d6..02bfa44 100644 --- a/drivers/media/i2c/smiapp/smiapp-core.c +++ b/drivers/media/i2c/smiapp/smiapp-core.c @@ -777,7 +777,11 @@ static int smiapp_get_mbus_formats(struct smiapp_sensor *sensor) dev_dbg(&client->dev, "jolly good! %d\n", j); sensor->default_mbus_frame_fmts |= 1 << j; - if (!sensor->csi_format) { + if (!sensor->csi_format + || f->width > sensor->csi_format->width + || (f->width == sensor->csi_format->width + && f->compressed + > sensor->csi_format->compressed)) { sensor->csi_format = f; sensor->internal_csi_format = f; }