Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp712578imm; Wed, 13 Jun 2018 07:12:15 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJP9DhPeCouo12MO/Z3g4cqIN63a3O3cS7yZT2PM7sGUJvYhdZUYkQlD3pcQ104qrys9Xh+ X-Received: by 2002:a17:902:8347:: with SMTP id z7-v6mr5511753pln.290.1528899135537; Wed, 13 Jun 2018 07:12:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528899135; cv=none; d=google.com; s=arc-20160816; b=YrAoE1ppf9x5neMvuvk6YJOGxJhlOjfLBFonBSBO9rjnFtcuFKukPnna42s7LHQmKC jt5tZdJ4rfPxhQLu0LOVyK95DF2A7x3FSs+QKWawKPIjW6dmY4d3uMDW7lVawJTRpSpG U10zUxDDBrSQJiuM33fAqh07sRrs9qxxlEyCyqtlK/aZDwouAQDP5ktwep1bdamZjulD qRnV5EtAvfioFOi5XJZiadGTsfurPVhGguvtrWCyrln74hJAfxTIGopFEmpjqd5vY1GR aaDqjj6gSPtoJmQdMM2Lu1Bot7NbKK7srkB1ix5QbYaR5UL9gPbmF1xY1yySg4ZcVoW4 OTyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=aCJIkENsdN5a9OeCPFwDUl+8nfX+BO1xPPNoOsWiWgQ=; b=S4mzkXCsehmgIT4//LhFQhTegvz9eOLklwyHyuDAJogfAqEWYJsb8w9Yq099sovvH4 7b6bZnjQsKQeunycPy/jGEQ3SXr0p94xy2k7fBVJ93sP0jxKT4nQm9Y9H/eFNsZ8g7Mb ScRTxYuo7BQWEuXFTvOlPG45b5Bte+vkJ5TU51Yzy3wRqH7jlTuRAV7xW3+MUldgBNeU oFZ4VWLUTRhM9RbEknhGapsEvucRJkfLr6ZOhVtxzRjB/tm+FbdCrpXzx/J5FTgu6oN0 FIyKfnXipTOiYwomULf36ixy6XR9Xr3i944hRcabnim1LOJzObbB7QUmdtb7YEyCzvgB 8KcQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e8-v6si3055009pls.28.2018.06.13.07.12.01; Wed, 13 Jun 2018 07:12:15 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935835AbeFMOJp (ORCPT + 99 others); Wed, 13 Jun 2018 10:09:45 -0400 Received: from mail.bootlin.com ([62.4.15.54]:52354 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935778AbeFMOHT (ORCPT ); Wed, 13 Jun 2018 10:07:19 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id 2F2D320A20; Wed, 13 Jun 2018 16:07:18 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.bootlin.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0 Received: from localhost (AAubervilliers-681-1-37-30.w90-88.abo.wanadoo.fr [90.88.156.30]) by mail.bootlin.com (Postfix) with ESMTPSA id F3024203B4; Wed, 13 Jun 2018 16:07:17 +0200 (CEST) From: Maxime Ripard To: hans.verkuil@cisco.com, acourbot@chromium.org, sakari.ailus@linux.intel.com, Laurent Pinchart Cc: tfiga@chromium.org, posciak@chromium.org, Paul Kocialkowski , Chen-Yu Tsai , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org, nicolas.dufresne@collabora.com, jenskuske@gmail.com, linux-sunxi@googlegroups.com, Thomas Petazzoni , Maxime Ripard Subject: [PATCH 4/9] media: cedrus: make engine type more generic Date: Wed, 13 Jun 2018 16:07:09 +0200 Message-Id: <20180613140714.1686-5-maxime.ripard@bootlin.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180613140714.1686-1-maxime.ripard@bootlin.com> References: <20180613140714.1686-1-maxime.ripard@bootlin.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The sunxi_cedrus_engine enum actually enumerates pretty much the codecs to use (or we can easily infer the codec engine from the codec). Since we will need the codec type as well in some later refactoring, make that structure more useful by just enumerating the codec, and converting the existing users. Signed-off-by: Maxime Ripard --- drivers/media/platform/sunxi/cedrus/sunxi_cedrus_common.h | 6 ++++++ drivers/media/platform/sunxi/cedrus/sunxi_cedrus_hw.c | 6 +++--- drivers/media/platform/sunxi/cedrus/sunxi_cedrus_hw.h | 6 +----- drivers/media/platform/sunxi/cedrus/sunxi_cedrus_mpeg2.c | 2 +- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/drivers/media/platform/sunxi/cedrus/sunxi_cedrus_common.h b/drivers/media/platform/sunxi/cedrus/sunxi_cedrus_common.h index b1ed1c8cb130..a5f83c452006 100644 --- a/drivers/media/platform/sunxi/cedrus/sunxi_cedrus_common.h +++ b/drivers/media/platform/sunxi/cedrus/sunxi_cedrus_common.h @@ -61,6 +61,12 @@ struct sunxi_cedrus_run { }; }; +enum sunxi_cedrus_codec { + SUNXI_CEDRUS_CODEC_MPEG2, + + SUNXI_CEDRUS_CODEC_LAST, +}; + struct sunxi_cedrus_ctx { struct v4l2_fh fh; struct sunxi_cedrus_dev *dev; diff --git a/drivers/media/platform/sunxi/cedrus/sunxi_cedrus_hw.c b/drivers/media/platform/sunxi/cedrus/sunxi_cedrus_hw.c index fc688a5c1ea3..bb46a01214e0 100644 --- a/drivers/media/platform/sunxi/cedrus/sunxi_cedrus_hw.c +++ b/drivers/media/platform/sunxi/cedrus/sunxi_cedrus_hw.c @@ -41,7 +41,7 @@ #define SYSCON_SRAM_C1_MAP_VE 0x7fffffff int sunxi_cedrus_engine_enable(struct sunxi_cedrus_dev *dev, - enum sunxi_cedrus_engine engine) + enum sunxi_cedrus_codec codec) { u32 reg = 0; @@ -53,8 +53,8 @@ int sunxi_cedrus_engine_enable(struct sunxi_cedrus_dev *dev, reg |= VE_CTRL_CACHE_BUS_BW_128; - switch (engine) { - case SUNXI_CEDRUS_ENGINE_MPEG: + switch (codec) { + case SUNXI_CEDRUS_CODEC_MPEG2: reg |= VE_CTRL_DEC_MODE_MPEG; break; diff --git a/drivers/media/platform/sunxi/cedrus/sunxi_cedrus_hw.h b/drivers/media/platform/sunxi/cedrus/sunxi_cedrus_hw.h index 34f3fae462a8..3236c80bfcf4 100644 --- a/drivers/media/platform/sunxi/cedrus/sunxi_cedrus_hw.h +++ b/drivers/media/platform/sunxi/cedrus/sunxi_cedrus_hw.h @@ -23,12 +23,8 @@ #ifndef _SUNXI_CEDRUS_HW_H_ #define _SUNXI_CEDRUS_HW_H_ -enum sunxi_cedrus_engine { - SUNXI_CEDRUS_ENGINE_MPEG, -}; - int sunxi_cedrus_engine_enable(struct sunxi_cedrus_dev *dev, - enum sunxi_cedrus_engine engine); + enum sunxi_cedrus_codec codec); void sunxi_cedrus_engine_disable(struct sunxi_cedrus_dev *dev); int sunxi_cedrus_hw_probe(struct sunxi_cedrus_dev *dev); diff --git a/drivers/media/platform/sunxi/cedrus/sunxi_cedrus_mpeg2.c b/drivers/media/platform/sunxi/cedrus/sunxi_cedrus_mpeg2.c index 5be3e3b9ceef..85e6fc2fbdb2 100644 --- a/drivers/media/platform/sunxi/cedrus/sunxi_cedrus_mpeg2.c +++ b/drivers/media/platform/sunxi/cedrus/sunxi_cedrus_mpeg2.c @@ -83,7 +83,7 @@ void sunxi_cedrus_mpeg2_setup(struct sunxi_cedrus_ctx *ctx, } /* Activate MPEG engine. */ - sunxi_cedrus_engine_enable(dev, SUNXI_CEDRUS_ENGINE_MPEG); + sunxi_cedrus_engine_enable(dev, SUNXI_CEDRUS_CODEC_MPEG2); /* Set quantization matrices. */ for (i = 0; i < 64; i++) { -- 2.17.0