From patchwork Tue Apr 13 10:57:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eugen Hristev X-Patchwork-Id: 12200203 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AA23DC433B4 for ; Tue, 13 Apr 2021 11:20:02 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 344A161042 for ; Tue, 13 Apr 2021 11:20:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 344A161042 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=microchip.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-ID:Date: Subject:CC:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=CCvk3OZ5ixBQ+QQ3wNvtIhfy6OLo0YaXctLytm55MC4=; b=pVlgd3RHrEynwsGPjDQFIQ51/ i+WeVl9V9GaTlcdGYK7cXBDmQsoM/UkEtnMIG28pAVERL9EOJ6zfdqTSUZMARpy5EhTfSOUuaK7zI QQ+BF8C750RbAi5oZoY/uedaIusmfE1i23hsgNv/oZyPeg+VvQo2NGkQz0byDRMPWbykespgQljBg QJBhX/sr2Z2DZR16P2ndLH/491ALVwCR4FG7t3cdCdrI5wReSPjRfA7nOh2arINqb6syqolXqKe55 VJACmHTGQgO5/yDkaixGQ9YQfF5v+vKNj5RTw9l4J8NmLvek8PwkMfvIJXQk277wZjWqWGDgf7z7h w2o5xkPbA==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lWH3E-0090LA-Pl; Tue, 13 Apr 2021 11:17:51 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lWGpB-008wxc-Ie for linux-arm-kernel@desiato.infradead.org; Tue, 13 Apr 2021 11:03:18 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Type: Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date :Subject:CC:To:From:Sender:Reply-To:Content-ID:Content-Description; bh=QVo8VK5BvhO2sUqp/6H2Hf4qMimOb+4KsCtTCUFyMVA=; b=vTpt5HYUrRe1NDyVcHU6By6CcK wINE+agsb6hj8HN+6d2BXGpu/sK1KBvC6judVoCXsfiUP5duuMVnQPwQvIfkZLQUWqjgXLmYcFY1k U3tCa4C8vuFAb2nEXbEvDUeVnYTfKPLs/MbCfLFf0CKiJVG1FrRzrKzZD5NYSXgQJyNyiQ7mF3xcI j8uRAj+VYdyNljVEbWJrpxjXl2sV+fwJV0M/FWj/EWBDKy/D+n9BG2FhKeBw8Pb6vqU+E3+CrlFeb hwtuKvHBUIEkeDZo0KfD/qIoJK3vhzojZjLqwnyMogtwBYc8gsuFEcizJRlD3M/e1nqzaswnrL9a3 wduuU4sg==; Received: from esa.microchip.iphmx.com ([68.232.154.123]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lWGp7-006wvr-R0 for linux-arm-kernel@lists.infradead.org; Tue, 13 Apr 2021 11:03:16 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1618311794; x=1649847794; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=S/0vz3mGicfYvuOuMvfCW2wMt7bft/DcBJ9lakhWmfk=; b=E4dCawYH7W0PwXODI55Vwe7+i3/nMIcSZOoTNwCBaXR6oOQS+oHEUCJ3 foNNzvb17X4RKopdGY1jUb6TN6DGYwVXB3lwRqhKQ7D2aR5Ar2i7zh67i JQeXnwfcvf+mMB4C7a8N8VyTmHwneOW7WFO6rgN9GH6ibu4wp/kQJAWRE kYME0nz4HpDw4yL/ug0frI5K/cbTEy/3K6imo3XBkLtafpPrQEoNn93KN mrr2Y3sbZQNOO2P75xGe5DdsTjMiy6hV3d2mE58XdeQX5P1GE67zlJamy l++zNkQOswW25Dwvqy0+7i/cC+OeQNRmxQrvaUYMEoWOx6NmVOTG1r8fJ w==; IronPort-SDR: tOUsfNrL8nur/PWdsruQbQrV+6fVa0OgXwzhZQKj2zMXXhBY+NG6OYxJVuyglyEkpvs4U5zn8H 58LzKTk1XYEYobIIJzu77GD17K4snoSyrhTMqO9otkK02zt5ci/Ftamt/iFbIqFxoKSJluFzs5 fVWtY2hKwT3GZ7SxvhiSu6oRq6od0ToNVOdsK0mLYWzs5NXw7M841PAm2JXpgfXp4lN6D2G1Na 5owpf9khQln08lIkaCxCg+JylEaD35lLthwyzsVb0ZXj+nvNOL8dpm4TyemLEuaioYAllj8Ipd R9E= X-IronPort-AV: E=Sophos;i="5.82,219,1613458800"; d="scan'208";a="113386328" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa2.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 13 Apr 2021 04:03:12 -0700 Received: from chn-vm-ex04.mchp-main.com (10.10.85.152) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Tue, 13 Apr 2021 04:03:11 -0700 Received: from ROB-ULT-M18282.microchip.com (10.10.115.15) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server id 15.1.2176.2 via Frontend Transport; Tue, 13 Apr 2021 04:03:06 -0700 From: Eugen Hristev To: , , , CC: , , Eugen Hristev Subject: [PATCH v3 23/33] media: atmel: atmel-isc: create callback for RLP submodule product specific Date: Tue, 13 Apr 2021 13:57:21 +0300 Message-ID: <20210413105731.610028-24-eugen.hristev@microchip.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210413105731.610028-1-eugen.hristev@microchip.com> References: <20210413105731.610028-1-eugen.hristev@microchip.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210413_040313_963411_37A149A5 X-CRM114-Status: GOOD ( 12.54 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The RLP submodule is a part of the atmel-isc pipeline, and stands for Rounding,Limiting and Packaging. It used to extract specific data from the ISC pipeline. For example if we want to output greyscale 8 bit, we would use limiting to 8 bits, and packaging to Luma component only. Create a product specific callback for initializing the RLP submodule of the pipeline Signed-off-by: Eugen Hristev --- Changes in v3: - added module description in commit message Changes in v2: - addded function prototype to avoid warning with W=1 drivers/media/platform/atmel/atmel-isc-base.c | 6 ++---- drivers/media/platform/atmel/atmel-isc.h | 3 +++ drivers/media/platform/atmel/atmel-sama5d2-isc.c | 11 +++++++++++ 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/atmel/atmel-isc-base.c b/drivers/media/platform/atmel/atmel-isc-base.c index bd24e0c99613..8422df41f083 100644 --- a/drivers/media/platform/atmel/atmel-isc-base.c +++ b/drivers/media/platform/atmel/atmel-isc-base.c @@ -711,11 +711,10 @@ static void isc_set_histogram(struct isc_device *isc, bool enable) static int isc_configure(struct isc_device *isc) { struct regmap *regmap = isc->regmap; - u32 pfe_cfg0, rlp_mode, dcfg, mask, pipeline; + u32 pfe_cfg0, dcfg, mask, pipeline; struct isc_subdev_entity *subdev = isc->current_subdev; pfe_cfg0 = isc->config.sd_format->pfe_cfg0_bps; - rlp_mode = isc->config.rlp_cfg_mode; pipeline = isc->config.bits_pipeline; dcfg = isc->config.dcfg_imode | isc->dcfg; @@ -728,8 +727,7 @@ static int isc_configure(struct isc_device *isc) regmap_update_bits(regmap, ISC_PFE_CFG0, mask, pfe_cfg0); - regmap_update_bits(regmap, ISC_RLP_CFG + isc->offsets.rlp, - ISC_RLP_CFG_MODE_MASK, rlp_mode); + isc->config_rlp(isc); regmap_write(regmap, ISC_DCFG + isc->offsets.dma, dcfg); diff --git a/drivers/media/platform/atmel/atmel-isc.h b/drivers/media/platform/atmel/atmel-isc.h index 1e6988f1876e..abeef7b2ab27 100644 --- a/drivers/media/platform/atmel/atmel-isc.h +++ b/drivers/media/platform/atmel/atmel-isc.h @@ -231,6 +231,8 @@ struct isc_reg_offsets { * specific CC module * @config_gam: pointer to a function that initializes product * specific GAMMA module + * @config_rlp: pointer to a function that initializes product + * specific RLP module * @config_ctrls: pointer to a functoin that initializes product * specific v4l2 controls. * @@ -309,6 +311,7 @@ struct isc_device { void (*config_cbc)(struct isc_device *isc); void (*config_cc)(struct isc_device *isc); void (*config_gam)(struct isc_device *isc); + void (*config_rlp)(struct isc_device *isc); void (*config_ctrls)(struct isc_device *isc, const struct v4l2_ctrl_ops *ops); diff --git a/drivers/media/platform/atmel/atmel-sama5d2-isc.c b/drivers/media/platform/atmel/atmel-sama5d2-isc.c index df26941af64b..855027821fba 100644 --- a/drivers/media/platform/atmel/atmel-sama5d2-isc.c +++ b/drivers/media/platform/atmel/atmel-sama5d2-isc.c @@ -59,6 +59,7 @@ void isc_sama5d2_config_cbc(struct isc_device *isc); void isc_sama5d2_config_cc(struct isc_device *isc); void isc_sama5d2_config_dpc(struct isc_device *isc); void isc_sama5d2_config_gam(struct isc_device *isc); +void isc_sama5d2_config_rlp(struct isc_device *isc); void isc_sama5d2_config_ctrls(struct isc_device *isc, const struct v4l2_ctrl_ops *ops); @@ -126,6 +127,15 @@ void isc_sama5d2_config_gam(struct isc_device *isc) /* No specific gamma configuration */ } +void isc_sama5d2_config_rlp(struct isc_device *isc) +{ + struct regmap *regmap = isc->regmap; + u32 rlp_mode = isc->config.rlp_cfg_mode; + + regmap_update_bits(regmap, ISC_RLP_CFG + isc->offsets.rlp, + ISC_RLP_CFG_MODE_MASK, rlp_mode); +} + /* Gamma table with gamma 1/2.2 */ const u32 isc_sama5d2_gamma_table[][GAMMA_ENTRIES] = { /* 0 --> gamma 1/1.8 */ @@ -276,6 +286,7 @@ static int atmel_isc_probe(struct platform_device *pdev) isc->config_cbc = isc_sama5d2_config_cbc; isc->config_cc = isc_sama5d2_config_cc; isc->config_gam = isc_sama5d2_config_gam; + isc->config_rlp = isc_sama5d2_config_rlp; isc->config_ctrls = isc_sama5d2_config_ctrls; isc->offsets.csc = ISC_SAMA5D2_CSC_OFFSET;