Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp2677777pxb; Tue, 13 Apr 2021 07:39:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwEAvxkdahNrerDrfVUxOihFnDQNRufP3Ezrjn9A/UwAhbvCcVFbNi9N/MyemclG9CF80Z3 X-Received: by 2002:a17:90a:f3d1:: with SMTP id ha17mr351045pjb.123.1618324779521; Tue, 13 Apr 2021 07:39:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618324779; cv=none; d=google.com; s=arc-20160816; b=qGeo7E94iJfmlAh1Y64gdvb1tX26mtl/XG1E2z0M/9u++z81cjJUHWIGahiV9Rv8n6 KvuIC2Ro1FkdMUSWVBSNjpR12CwvTJmZfVU0s1AnuW7S+2rcZQBHzW/0tw2u6ibRBpGl gJAFKEyJ2pBgg8DuKUtbsx6aUXYtcDAxTZgrVoV9LiQrJhvzvj4kSKECdAzl+nNw6aLF sl4pQC7dgOOk6fzY0/cGG/Io/C9EWLKQDY+CQinljE3A8pR64nWutB0QuNilVT/RrBtK az7IvjFtRDk6K2CgEKuPKoaWJsDUniwkXckqn4AeoQlpq4yL1iv0yNQaP1EKoX9oW5LD 19Iw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :ironport-sdr:dkim-signature; bh=MMaXJnVmgbsy0kh3IrB6HD5YBrKjwhr4vJrvG2RONkw=; b=H3RBqRYT2XpbIoguKqSUBImrro2EgFWmPy75eMY/ZktwKdCplKJPucp8Ww+v6MV4/q Y7F1bJvGOvQf+5VPfiuEcXZw6lo+awQ61/aO8z8L1bTXQoO/i5TamL+vNq1v1n0rD9m7 EPIScJwsPiV9f+5wSCzFnCj8D3r9j2AKlyWkxM0xGyYhkrSaTc00SiV5C2jN5SNSL/o4 NLRdn/Nfko01Q2B3Ih7lHZc9ljs+wI5oKTpomGMjothayBLMu8DJe3EWh2IOuUhcU1r/ Dx9iTnSlfbSt9GNle6vKSR9xvyac2tqFTfE6Zi+dUzyYUEi7K2gXZH/p5mhGRAgO3y1d kBsw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@microchip.com header.s=mchp header.b=JxUQeEZz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id il4si2972009pjb.110.2021.04.13.07.39.23; Tue, 13 Apr 2021 07:39:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@microchip.com header.s=mchp header.b=JxUQeEZz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344984AbhDMLDZ (ORCPT + 99 others); Tue, 13 Apr 2021 07:03:25 -0400 Received: from esa.microchip.iphmx.com ([68.232.154.123]:62163 "EHLO esa.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344922AbhDMLDQ (ORCPT ); Tue, 13 Apr 2021 07:03:16 -0400 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 Content-Transfer-Encoding: 8bit Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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; -- 2.25.1