From patchwork Mon Jan 29 16:34:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Niklas_S=C3=B6derlund?= X-Patchwork-Id: 10190047 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 79D5860375 for ; Mon, 29 Jan 2018 16:35:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 58067204BA for ; Mon, 29 Jan 2018 16:35:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4CBC2223A6; Mon, 29 Jan 2018 16:35:58 +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=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable 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 06684204BA for ; Mon, 29 Jan 2018 16:35:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751742AbeA2Qfw (ORCPT ); Mon, 29 Jan 2018 11:35:52 -0500 Received: from bin-mail-out-05.binero.net ([195.74.38.228]:43132 "EHLO bin-vsp-out-03.atm.binero.net" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751737AbeA2Qft (ORCPT ); Mon, 29 Jan 2018 11:35:49 -0500 X-Halon-ID: 74d70796-0512-11e8-9564-0050569116f7 Authorized-sender: niklas@soderlund.pp.se Received: from bismarck.berto.se (unknown [89.233.230.99]) by bin-vsp-out-03.atm.binero.net (Halon) with ESMTPA id 74d70796-0512-11e8-9564-0050569116f7; Mon, 29 Jan 2018 17:35:46 +0100 (CET) From: =?UTF-8?q?Niklas=20S=C3=B6derlund?= To: Laurent Pinchart , Hans Verkuil , linux-media@vger.kernel.org Cc: linux-renesas-soc@vger.kernel.org, tomoharu.fukawa.eb@renesas.com, Kieran Bingham , =?UTF-8?q?Niklas=20S=C3=B6derlund?= Subject: [PATCH v10 24/30] rcar-vin: add chsel information to rvin_info Date: Mon, 29 Jan 2018 17:34:29 +0100 Message-Id: <20180129163435.24936-25-niklas.soderlund+renesas@ragnatech.se> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180129163435.24936-1-niklas.soderlund+renesas@ragnatech.se> References: <20180129163435.24936-1-niklas.soderlund+renesas@ragnatech.se> MIME-Version: 1.0 Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Each Gen3 SoC has a limited set of predefined routing possibilities for which CSI-2 device and virtual channel can be routed to which VIN instance. Prepare to store this information in the struct rvin_info. Signed-off-by: Niklas Söderlund --- drivers/media/platform/rcar-vin/rcar-vin.h | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/drivers/media/platform/rcar-vin/rcar-vin.h b/drivers/media/platform/rcar-vin/rcar-vin.h index 903d8fb8426a7860..ca2c2a23cef8506c 100644 --- a/drivers/media/platform/rcar-vin/rcar-vin.h +++ b/drivers/media/platform/rcar-vin/rcar-vin.h @@ -43,6 +43,14 @@ enum model_id { RCAR_GEN3, }; +enum rvin_csi_id { + RVIN_CSI20, + RVIN_CSI21, + RVIN_CSI40, + RVIN_CSI41, + RVIN_CSI_MAX, +}; + /** * STOPPED - No operation in progress * RUNNING - Operation in progress have buffers @@ -81,12 +89,33 @@ struct rvin_graph_entity { unsigned int sink_pad; }; +/** struct rvin_group_route - Map a CSI-2 receiver and channel to a CHSEL + * @vin: Which VIN the CSI-2 and VC describes + * @csi: VIN internal number for CSI-2 device + * @chan: Output channel of the CSI-2 receiver. Each R-Car CSI-2 + * receiver has four output channels facing the VIN + * devices, each channel can carry one CSI-2 Virtual + * Channel (VC) and there are no correlation between + * output channel number and CSI-2 VC. It's up to the + * CSI-2 receiver driver to configure which VC is + * outputted on which channel, the VIN devices only + * cares about output channels. + * @mask: Bitmask of chsel values which accommodates route + */ +struct rvin_group_route { + unsigned int vin; + enum rvin_csi_id csi; + unsigned char chan; + unsigned int mask; +}; + /** * struct rvin_info - Information about the particular VIN implementation * @model: VIN model * @use_mc: use media controller instead of controlling subdevice * @max_width: max input width the VIN supports * @max_height: max input height the VIN supports + * @routes: routing table VIN <-> CSI-2 for the chsel values */ struct rvin_info { enum model_id model; @@ -94,6 +123,7 @@ struct rvin_info { unsigned int max_width; unsigned int max_height; + const struct rvin_group_route *routes; }; /**