From patchwork Tue Dec 22 14:22:01 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulrich Hecht X-Patchwork-Id: 7904861 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: X-Original-To: patchwork-linux-sh@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 B5344BEEE5 for ; Tue, 22 Dec 2015 14:22:17 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D7C06204D1 for ; Tue, 22 Dec 2015 14:22:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EAC1F2052A for ; Tue, 22 Dec 2015 14:22:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754612AbbLVOWK (ORCPT ); Tue, 22 Dec 2015 09:22:10 -0500 Received: from mail-wm0-f53.google.com ([74.125.82.53]:37254 "EHLO mail-wm0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752864AbbLVOWI (ORCPT ); Tue, 22 Dec 2015 09:22:08 -0500 Received: by mail-wm0-f53.google.com with SMTP id p187so112566425wmp.0; Tue, 22 Dec 2015 06:22:07 -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=sjClybBTCDKvyHe84YsYAcGGsbC/yybA7bIVKdhaMnY=; b=gFXZm2WBDqtTNw3KyQrXs04qD2xVF2CuIHIr6sZqQNTPsmsh7ep5ziLnTx5nZWvUhu y16WeVJJ7S/OwuCPDgCksZn8izHOiLh/p5CggLWp7zEkiOZ66gEG3a8ZCM8N9cEr5DcH L62aoLmM/Yb0VicPCE8GWFPFAGasZoe1D1GWewoZUTIQpizNt+A2oRj2MI27bMUvfsTc 9zdLwKsUbNW7rr/hCtNp+Ny78xFTbAu0Tetjsf2FdBWz3y3Pc/O9E8n4PZPUhTOPbbQj ipXztdrRyXjAKDAcEQSxmNVTiDnbKVY+4z8SpJdlxv7zs0j0fNsuSc57LDWDzSQ5kAQj EgKg== X-Received: by 10.28.113.220 with SMTP id d89mr28977961wmi.56.1450794127031; Tue, 22 Dec 2015 06:22:07 -0800 (PST) Received: from groucho.site (ip9234e209.dynamic.kabel-deutschland.de. [146.52.226.9]) by smtp.gmail.com with ESMTPSA id qm9sm33231850wjc.39.2015.12.22.06.22.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 22 Dec 2015 06:22:05 -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 v2 1/2] media: adv7604: implement get_selection Date: Tue, 22 Dec 2015 15:22:01 +0100 Message-Id: <1450794122-31293-2-git-send-email-ulrich.hecht+renesas@gmail.com> X-Mailer: git-send-email 2.6.3 In-Reply-To: <1450794122-31293-1-git-send-email-ulrich.hecht+renesas@gmail.com> References: <1450794122-31293-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, RP_MATCHES_RCVD, T_DKIM_INVALID, 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 The rcar_vin driver relies on this. Signed-off-by: Ulrich Hecht Acked-by: Laurent Pinchart --- drivers/media/i2c/adv7604.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/drivers/media/i2c/adv7604.c b/drivers/media/i2c/adv7604.c index be5980c..8ad5c28 100644 --- a/drivers/media/i2c/adv7604.c +++ b/drivers/media/i2c/adv7604.c @@ -1885,6 +1885,26 @@ static int adv76xx_get_format(struct v4l2_subdev *sd, return 0; } +static int adv76xx_get_selection(struct v4l2_subdev *sd, + struct v4l2_subdev_pad_config *cfg, + struct v4l2_subdev_selection *sel) +{ + struct adv76xx_state *state = to_state(sd); + + if (sel->which != V4L2_SUBDEV_FORMAT_ACTIVE) + return -EINVAL; + /* Only CROP, CROP_DEFAULT and CROP_BOUNDS are supported */ + if (sel->target > V4L2_SEL_TGT_CROP_BOUNDS) + return -EINVAL; + + sel->r.left = 0; + sel->r.top = 0; + sel->r.width = state->timings.bt.width; + sel->r.height = state->timings.bt.height; + + return 0; +} + static int adv76xx_set_format(struct v4l2_subdev *sd, struct v4l2_subdev_pad_config *cfg, struct v4l2_subdev_format *format) @@ -2415,6 +2435,7 @@ static const struct v4l2_subdev_video_ops adv76xx_video_ops = { static const struct v4l2_subdev_pad_ops adv76xx_pad_ops = { .enum_mbus_code = adv76xx_enum_mbus_code, + .get_selection = adv76xx_get_selection, .get_fmt = adv76xx_get_format, .set_fmt = adv76xx_set_format, .get_edid = adv76xx_get_edid,