From patchwork Wed Jul 25 16:24:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Ceresoli X-Patchwork-Id: 10544309 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5D41417FD for ; Wed, 25 Jul 2018 16:25:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4CEF52A694 for ; Wed, 25 Jul 2018 16:25:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 40EE92A6B2; Wed, 25 Jul 2018 16:25:20 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 34D802A694 for ; Wed, 25 Jul 2018 16:25:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729241AbeGYRhk (ORCPT ); Wed, 25 Jul 2018 13:37:40 -0400 Received: from srv-hp10-72.netsons.net ([94.141.22.72]:35769 "EHLO srv-hp10-72.netsons.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729112AbeGYRhk (ORCPT ); Wed, 25 Jul 2018 13:37:40 -0400 Received: from [109.168.11.45] (port=49130 helo=pc-ceresoli.dev.aim) by srv-hp10.netsons.net with esmtpa (Exim 4.91) (envelope-from ) id 1fiMbB-00A9qR-8j; Wed, 25 Jul 2018 18:25:13 +0200 From: Luca Ceresoli To: linux-media@vger.kernel.org Cc: Luca Ceresoli , Sakari Ailus , Leon Luo , Mauro Carvalho Chehab , linux-kernel@vger.kernel.org Subject: [PATCH v6 0/2] media: imx274: cleanups, improvements and SELECTION API support Date: Wed, 25 Jul 2018 18:24:53 +0200 Message-Id: <20180725162455.31381-1-luca@lucaceresoli.net> X-Mailer: git-send-email 2.17.1 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - srv-hp10.netsons.net X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lucaceresoli.net X-Get-Message-Sender-Via: srv-hp10.netsons.net: authenticated_id: luca+lucaceresoli.net/only user confirmed/virtual account not confirmed X-Authenticated-Sender: srv-hp10.netsons.net: luca@lucaceresoli.net X-Source: X-Source-Args: X-Source-Dir: Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hi, this patchset introduces cropping support for the Sony IMX274 sensor using the SELECTION API. Changes since v5 are only minor fixes and cleanups. Patch 1 introduces a helper to greatly simplify the code to write a multibyte register. Patch 2 implements the set_selection pad operation for cropping (V4L2_SEL_TGT_CROP) and binning (V4L2_SEL_TGT_COMPOSE). Usage examples: * Capture the entire 4K area, downscaled to 1080p with 2:1 binning: media-ctl -V '"IMX274":0[crop:(0,0)/3840x2160]' media-ctl -V '"IMX274":0[compose:(0,0)/1920x1080]' * Capture the central 1080p area (no binning): media-ctl -V '"IMX274":0[crop:(960,540)/1920x1080]' (this also sets the compose and fmt rects to 1920x1080) Regards, Luca Luca Ceresoli (2): media: imx274: use regmap_bulk_write to write multybyte registers media: imx274: add cropping support via SELECTION API drivers/media/i2c/imx274.c | 566 +++++++++++++++++++++++++++---------- 1 file changed, 412 insertions(+), 154 deletions(-)