From patchwork Fri Dec 11 16:04:52 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulrich Hecht X-Patchwork-Id: 7830901 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 760D79F1C2 for ; Fri, 11 Dec 2015 16:05:06 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9B8A5205B1 for ; Fri, 11 Dec 2015 16:05:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CEA68205C2 for ; Fri, 11 Dec 2015 16:05:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755250AbbLKQFE (ORCPT ); Fri, 11 Dec 2015 11:05:04 -0500 Received: from mail-wm0-f41.google.com ([74.125.82.41]:33702 "EHLO mail-wm0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755275AbbLKQFB (ORCPT ); Fri, 11 Dec 2015 11:05:01 -0500 Received: by mail-wm0-f41.google.com with SMTP id c201so80667221wme.0; Fri, 11 Dec 2015 08:05:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=SvJ/2mWBG/p8lY/nyMAAAGyhl0r4FFcLfFoJd6eL4fc=; b=DCfAfG0k73AMXiSecZff8IN2d4zRFt0FOp9CT4V6DxL3F5b2oFtwgFuHwoQTcOqHmo TFN4QCM5NEH84iHN0wGMtAJUphnIVMCA8VGjKsXgyy6AS/Xm7WfOxXpyeOB0V4WuiMPL YNSPeRiCVb/fIOT6I49v2ItHG6d/ZVbKfIgIt/qnngH3rDjYM3ukilh6Vi3Z6FYb1L+i Y0SB6NVfFbSXaGedGTJ0q26F0uWN7iBwlPGwdtmghl96/NsbbW3CE2iZ/YLawy/oY6GV Tdbsh/YCJ7rXw/1p+Lkxn1V/SMkbsIc2go26Z5X+7QSA5Fc4GKP6EfOZD3fzD+09M1ed J+tg== X-Received: by 10.194.20.164 with SMTP id o4mr20949394wje.105.1449849900476; Fri, 11 Dec 2015 08:05:00 -0800 (PST) Received: from groucho.site (ip9234e209.dynamic.kabel-deutschland.de. [146.52.226.9]) by smtp.gmail.com with ESMTPSA id 186sm3984028wmv.9.2015.12.11.08.04.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 11 Dec 2015 08:04:59 -0800 (PST) From: Ulrich Hecht To: linux-media@vger.kernel.org, linux-sh@vger.kernel.org Cc: magnus.damm@gmail.com, laurent.pinchart@ideasonboard.com, hans.verkuil@cisco.com, ian.molton@codethink.co.uk, lars@metafoo.de, william.towle@codethink.co.uk, Ulrich Hecht Subject: [PATCH 2/3] media: adv7604: implement cropcap Date: Fri, 11 Dec 2015 17:04:52 +0100 Message-Id: <1449849893-14865-3-git-send-email-ulrich.hecht+renesas@gmail.com> X-Mailer: git-send-email 2.6.3 In-Reply-To: <1449849893-14865-1-git-send-email-ulrich.hecht+renesas@gmail.com> References: <1449849893-14865-1-git-send-email-ulrich.hecht+renesas@gmail.com> Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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 Used by the rcar_vin driver. Signed-off-by: Ulrich Hecht --- drivers/media/i2c/adv7604.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/drivers/media/i2c/adv7604.c b/drivers/media/i2c/adv7604.c index d30e7cc..1bfa9f3 100644 --- a/drivers/media/i2c/adv7604.c +++ b/drivers/media/i2c/adv7604.c @@ -1896,6 +1896,22 @@ static int adv76xx_g_crop(struct v4l2_subdev *sd, struct v4l2_crop *a) return 0; } +static int adv76xx_cropcap(struct v4l2_subdev *sd, struct v4l2_cropcap *a) +{ + struct adv76xx_state *state = to_state(sd); + + a->bounds.left = 0; + a->bounds.top = 0; + a->bounds.width = state->timings.bt.width; + a->bounds.height = state->timings.bt.height; + a->defrect = a->bounds; + a->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; + a->pixelaspect.numerator = 1; + a->pixelaspect.denominator = 1; + + return 0; +} + static int adv76xx_set_format(struct v4l2_subdev *sd, struct v4l2_subdev_pad_config *cfg, struct v4l2_subdev_format *format) @@ -2419,6 +2435,7 @@ static const struct v4l2_subdev_core_ops adv76xx_core_ops = { static const struct v4l2_subdev_video_ops adv76xx_video_ops = { .s_routing = adv76xx_s_routing, .g_crop = adv76xx_g_crop, + .cropcap = adv76xx_cropcap, .g_input_status = adv76xx_g_input_status, .s_dv_timings = adv76xx_s_dv_timings, .g_dv_timings = adv76xx_g_dv_timings,