From patchwork Tue Apr 13 10:57:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eugen Hristev X-Patchwork-Id: 12200197 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 ACA65C433B4 for ; Tue, 13 Apr 2021 11:18:00 +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 2C90261019 for ; Tue, 13 Apr 2021 11:18:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2C90261019 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=dlgezvF2PhksUR3V3CbWdZ6wwEMKjqco3C0eTqXWZjI=; b=POAI9Vtsy4Uv6asQpBmEpTlQM QDjQDvlWiDOsoJYMyBm2eQI3xxtDJi8tpeYFe94C8K2QOfeY2fRC3H8jBi7tzOFCv0rWTgLiTkBOk 3R8UJQyV1BO9uEFObbr80sNwkyWSs4OyP/Y68XoXsTIvYno7rctOmagN8eXvUzNbIJwwo6pg7NlIO qOI5ygi3+jkNWgAbxLGvZX3ZC446DEAKGnEZwz0zJ7Wuyc6reQ3UI2s/69Mxz4F/xAQvmCtqUdktf PuA2UqCy7YPOjpiB2hVQMT33ULHCOUd7CE493eELRu9Z8sor8VJDPthhU9eAH/BX7tgGqwrMTI9jX GYlsC/axQ==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lWH0v-008zbo-LI; Tue, 13 Apr 2021 11:15:25 +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 1lWGou-008wrS-9r for linux-arm-kernel@desiato.infradead.org; Tue, 13 Apr 2021 11:03:00 +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=MMaXJnVmgbsy0kh3IrB6HD5YBrKjwhr4vJrvG2RONkw=; b=L3NOacdXGSu3i/py8etzLrv8ae ONvTq7oq1jI1/X3/gGjnkfaJGNWxR9Hq2AF13MjKP4CgUn7kpq/rI6YLOencpjdaIXazsSZk50EbD JWGzKcwEbRtOqcguzanz5WGH1M+y9eW7SsQeVvivlKnxXTR6TZ5qeg6BG3T922ByWr5uWGtVAkLOl EddKszmgXlyjw8d+i1u97FvHwP+eVnPTlQPD8S3riKcHGMftAjTyHjFyDbrWqLvUmefXzjFr0jn8F baIlZy5aH2qbdjdQ8TjYgDD2L5v8q7m8NCcN0U5PWdFBrGiEIxiilTFr/16/ktaGowiGRw8FYsab6 MTFwZyjw==; Received: from esa.microchip.iphmx.com ([68.232.154.123]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lWGor-006wuR-Kc for linux-arm-kernel@lists.infradead.org; Tue, 13 Apr 2021 11:02:59 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1618311777; x=1649847777; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=IEwPQEbzjaae7NeHjXIAlTuXJus6yY8SKxZBqN/Rb9s=; b=JxUQeEZzMTMYHmKsuyW1RhjkypeIzaNqtOfinJ9nknjYwgz+oL4Rf8/3 2CmS5zsgENofSkkScXJIzkXD8jkaF3yrA4DNULzPV8kJKwof3NZpfQARa +BHFou+h9sbfORXY9Kg/Wd9+hzplE9ByKKbVXTGBIVcftwb5GIU85FPSN QcEGJUOqc/aPh6KTfVuMhfsZfpjfPN/RZlzb532zwpN2Nv2NqrtW7aHog aEhZzm8mERqAjGHLaf44S9HggiE3w72QMkvUgdLc9zdQH3DMp0rSVUgFH OTkp3v88W1RkTliG4cNkA0680DyOAjp4qHdNxvYDJjJ7OtxmBexFbEPjM w==; IronPort-SDR: 6PI4NuZubVXmgHxyfFqh99v8IUb+LvsE/+udR+i1TERyB7nY9dkUnK2F0q9seOgxfb/bxWFJg9 futoIMSW/aGlk43TkCWXgjrVeJ6pw9BSMutYHM3Avqxc3ZYbyw7YiM4vS6hEy/QFXZPTV1tRD+ 31WC7njS1q2wyV+/lB7QyHhMpcuGjjcA+cRF4P9wcdR/fCqPpAzm3EwmXKhzq/nwiB9CUmwEgv JhJiH2kT01IANjVDRKWwuPnWEC19Ypm8WIQBExW7UtWY8udkKezuepBfKbRKE5O5RXuqkdB2ty 2W8= X-IronPort-AV: E=Sophos;i="5.82,219,1613458800"; d="scan'208";a="113386305" 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:02:57 -0700 Received: from chn-vm-ex04.mchp-main.com (10.10.85.152) by chn-vm-ex01.mchp-main.com (10.10.85.143) 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:02:56 -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:02:51 -0700 From: Eugen Hristev To: , , , CC: , , Eugen Hristev Subject: [PATCH v3 21/33] media: atmel: atmel-isc: create callback for DPC submodule product specific Date: Tue, 13 Apr 2021 13:57:19 +0300 Message-ID: <20210413105731.610028-22-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_040257_760502_7085C80A X-CRM114-Status: GOOD ( 11.36 ) 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 DPC submodule is a part of the atmel-isc pipeline, and stands for Defective Pixel Correction. Its purpose is to detect defective pixels and correct them if possible with the help of adjacent pixels. Create a product specific callback for initializing the DPC submodule of the pipeline. For sama5d2 product, this module does not exist, thus this function is a noop. 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 | 1 + drivers/media/platform/atmel/atmel-isc.h | 3 +++ drivers/media/platform/atmel/atmel-sama5d2-isc.c | 7 +++++++ 3 files changed, 11 insertions(+) diff --git a/drivers/media/platform/atmel/atmel-isc-base.c b/drivers/media/platform/atmel/atmel-isc-base.c index 69952b6ac401..1f7116abc61a 100644 --- a/drivers/media/platform/atmel/atmel-isc-base.c +++ b/drivers/media/platform/atmel/atmel-isc-base.c @@ -651,6 +651,7 @@ static void isc_set_pipeline(struct isc_device *isc, u32 pipeline) regmap_bulk_write(regmap, ISC_GAM_GENTRY, gamma, GAMMA_ENTRIES); regmap_bulk_write(regmap, ISC_GAM_RENTRY, gamma, GAMMA_ENTRIES); + isc->config_dpc(isc); isc->config_csc(isc); isc->config_cbc(isc); isc->config_cc(isc); diff --git a/drivers/media/platform/atmel/atmel-isc.h b/drivers/media/platform/atmel/atmel-isc.h index eb549fadb1a8..d6cd85a4c3e9 100644 --- a/drivers/media/platform/atmel/atmel-isc.h +++ b/drivers/media/platform/atmel/atmel-isc.h @@ -221,6 +221,8 @@ struct isc_reg_offsets { * @max_width: maximum frame width, dependent on the internal RAM * @max_height: maximum frame height, dependent on the internal RAM * + * @config_dpc: pointer to a function that initializes product + * specific DPC module * @config_csc: pointer to a function that initializes product * specific CSC module * @config_cbc: pointer to a function that initializes product @@ -300,6 +302,7 @@ struct isc_device { u32 max_height; struct { + void (*config_dpc)(struct isc_device *isc); void (*config_csc)(struct isc_device *isc); void (*config_cbc)(struct isc_device *isc); void (*config_cc)(struct isc_device *isc); diff --git a/drivers/media/platform/atmel/atmel-sama5d2-isc.c b/drivers/media/platform/atmel/atmel-sama5d2-isc.c index 7ff8b362568d..2b53e9427353 100644 --- a/drivers/media/platform/atmel/atmel-sama5d2-isc.c +++ b/drivers/media/platform/atmel/atmel-sama5d2-isc.c @@ -57,6 +57,7 @@ void isc_sama5d2_config_csc(struct isc_device *isc); 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_ctrls(struct isc_device *isc, const struct v4l2_ctrl_ops *ops); @@ -114,6 +115,11 @@ void isc_sama5d2_config_ctrls(struct isc_device *isc, v4l2_ctrl_new_std(hdl, ops, V4L2_CID_CONTRAST, -2048, 2047, 1, 256); } +void isc_sama5d2_config_dpc(struct isc_device *isc) +{ + /* This module is not present on sama5d2 pipeline */ +} + /* Gamma table with gamma 1/2.2 */ const u32 isc_sama5d2_gamma_table[][GAMMA_ENTRIES] = { /* 0 --> gamma 1/1.8 */ @@ -259,6 +265,7 @@ static int atmel_isc_probe(struct platform_device *pdev) isc->max_width = ISC_SAMA5D2_MAX_SUPPORT_WIDTH; isc->max_height = ISC_SAMA5D2_MAX_SUPPORT_HEIGHT; + isc->config_dpc = isc_sama5d2_config_dpc; isc->config_csc = isc_sama5d2_config_csc; isc->config_cbc = isc_sama5d2_config_cbc; isc->config_cc = isc_sama5d2_config_cc;