From patchwork Sat Apr 16 08:12:20 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivaylo Dimitrov X-Patchwork-Id: 8861331 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 5A63ABF29F for ; Sat, 16 Apr 2016 08:13:07 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6F57420222 for ; Sat, 16 Apr 2016 08:13:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 85370201CE for ; Sat, 16 Apr 2016 08:13:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751316AbcDPIMl (ORCPT ); Sat, 16 Apr 2016 04:12:41 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:34933 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751100AbcDPIMi (ORCPT ); Sat, 16 Apr 2016 04:12:38 -0400 Received: by mail-wm0-f66.google.com with SMTP id a140so11329240wma.2; Sat, 16 Apr 2016 01:12:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=IQlbAsWIdgnRzHlP1pG9xWwKdhyZdUkCDTuuG+0hh0M=; b=jRlVArDE1qwUeaac/Dg5/uypz3UxOVKtf4RdetPAdKQowUY76qe5GWMQfrJmY6czk7 nxm6yOWIZ5Vs3uyaj/5vbHBe+EWIYLCRDUUyRqeHdwlOqSZf9vMrwJsp6VCBPz+5Bgjc aGQw0VuX2GbBPWjoWIZTDfveAaokYS6wIE74K8cxdxBzD2GPvZ/7zRUZ7v1OFVokhDrO 0XPCLHTo5nfRpCUkaCDzS817VIC+Tmwt4cgGNSKHWYTbYhNWtW6GDqwIUKN7Hk8oSoLV lH31REcVHPLBnTeF12J+CIQJhdoyfrBKDcde++rVw/xtm5tO+qDOMVxccIQa9yFpcDXZ kpuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=IQlbAsWIdgnRzHlP1pG9xWwKdhyZdUkCDTuuG+0hh0M=; b=SeviU/IKFlh1DQZcoCS1CTTxjXrXPb+XMiBupx6s9F0qznbEwFOySFSjOnLzUYaIh4 pXhgVUlZxbIJ7aagtLk70n06a5D6zFO99u/muEGoC4XCn1euz1JYA7vNDgkd2CW2ayY6 bmznsZkA97KudmYZhDV4C3DpN7jzy5CpAMnAp4CetWL+rAT7bdDDvojd4ZaGwVSUkBVO 7y5OZBmUDuniAmEEahXylnWTSmkfgU+PKt3+URKlG14gBTx1DI4Gy014v3MkRJFBvFNh qlHuFA6QwKBvLCqlrUp50jR6Y9tWBj2N6fSKRRTY18KOXOwvd3CbHFf87WYJRXQJncfO yJJQ== X-Gm-Message-State: AOPr4FUY89AXr0lZ8peQtaltoVXFo2csiTkEHrpORMU6srFuTY1ZcFgxBvdtB2zt4gPXcw== X-Received: by 10.194.123.65 with SMTP id ly1mr25982914wjb.125.1460794356486; Sat, 16 Apr 2016 01:12:36 -0700 (PDT) Received: from localhost.localdomain ([46.249.74.23]) by smtp.gmail.com with ESMTPSA id e140sm26446801wma.13.2016.04.16.01.12.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 16 Apr 2016 01:12:35 -0700 (PDT) From: Ivaylo Dimitrov To: sakari.ailus@iki.fi, mchehab@osg.samsung.com Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Ivaylo Dimitrov Subject: [PATCH] [media] smiapp: provide g_skip_top_lines method in sensor ops Date: Sat, 16 Apr 2016 11:12:20 +0300 Message-Id: <1460794340-490-1-git-send-email-ivo.g.dimitrov.75@gmail.com> X-Mailer: git-send-email 1.9.1 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Some sensors (like the one in Nokia N900) provide metadata in the first couple of lines. Make that information information available to the pipeline. Signed-off-by: Ivaylo Dimitrov --- drivers/media/i2c/smiapp/smiapp-core.c | 12 ++++++++++++ drivers/media/i2c/smiapp/smiapp.h | 1 + 2 files changed, 13 insertions(+) diff --git a/drivers/media/i2c/smiapp/smiapp-core.c b/drivers/media/i2c/smiapp/smiapp-core.c index a215efe..3dfe387 100644 --- a/drivers/media/i2c/smiapp/smiapp-core.c +++ b/drivers/media/i2c/smiapp/smiapp-core.c @@ -188,6 +188,8 @@ static int smiapp_read_frame_fmt(struct smiapp_sensor *sensor) embedded_end = 0; } + sensor->image_start = image_start; + dev_dbg(&client->dev, "embedded data from lines %d to %d\n", embedded_start, embedded_end); dev_dbg(&client->dev, "image data starts at line %d\n", image_start); @@ -2280,6 +2282,15 @@ static int smiapp_get_skip_frames(struct v4l2_subdev *subdev, u32 *frames) return 0; } +static int smiapp_get_skip_top_lines(struct v4l2_subdev *subdev, u32 *lines) +{ + struct smiapp_sensor *sensor = to_smiapp_sensor(subdev); + + *lines = sensor->image_start; + + return 0; +} + /* ----------------------------------------------------------------------------- * sysfs attributes */ @@ -2890,6 +2901,7 @@ static const struct v4l2_subdev_pad_ops smiapp_pad_ops = { static const struct v4l2_subdev_sensor_ops smiapp_sensor_ops = { .g_skip_frames = smiapp_get_skip_frames, + .g_skip_top_lines = smiapp_get_skip_top_lines, }; static const struct v4l2_subdev_ops smiapp_ops = { diff --git a/drivers/media/i2c/smiapp/smiapp.h b/drivers/media/i2c/smiapp/smiapp.h index f6af0cc..c8b4ca0 100644 --- a/drivers/media/i2c/smiapp/smiapp.h +++ b/drivers/media/i2c/smiapp/smiapp.h @@ -217,6 +217,7 @@ struct smiapp_sensor { u8 hvflip_inv_mask; /* H/VFLIP inversion due to sensor orientation */ u8 frame_skip; + u32 image_start; /* Offset to first line after metadata lines */ int power_count;