Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp4298681pxb; Sat, 6 Nov 2021 10:55:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwNpDTJDwlMBB4TJpQr82XB92scyWoAs+uCsSjvZJZkU4Vo/NKleMI+Nh6NHr4+wsHoHZ6f X-Received: by 2002:a02:6064:: with SMTP id d36mr15542360jaf.80.1636221332369; Sat, 06 Nov 2021 10:55:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1636221332; cv=none; d=google.com; s=arc-20160816; b=fuDAus1KZsQcmvbIcV+oqQs/dqgO/Jq3M9zmbpt08IXbnWmpiAkdHNamnAG4yZSH6L qFtgiEPyQFjL7kVHwS2+zs+wCikvs41IhrtHkLHyqKHSGEiCoxl4qP3Ghucxy2QzuEdC pMN3EBPHrOc7S1CLcwiA1BDrmW/iDc1wDywrz353Tt6uKnfnDqgTWFExOn3J+se4pLI8 P6CoMq0W4SeVR6YaM8VyrF8HvAXu9eax+BLNzLwohasGqwDhGnj3jjcxeBtzN68rA6wf 6LJbmZkBMpbXu2eCB0K9v1Kwl0TOvaY7r94XET1qRbQSVBJ1iydBLJyG1R4eoxFSUyyL jfEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:from:dkim-signature; bh=fST9KDuU7HzP5sJonN36V+hLX//siGlRWXBZsyHkFn0=; b=wiLmCLkIRHMYhkUEV25qgggF3QY+4s95+N9Y7PQfPWCeg+skjD7916dtbml8NcsvNo omRZ+0RTqO1rcs1tWZY2jcn/XeAocKwio6Pufqqe028pyk2WjdQ0CT/1HCTRTr9MF74j 71ns/97ifI+QNC8Ec5uo2+e7K+LzLZrNI5Osa8Oi6ihSKojpD6Ojv4a0kvJtubFCgPK/ JvadcUsXjCDERxsENU29B17GxRz202VIa74EINQOOBZl2hjAUrMLfRB4g1RQv5UQcTP8 6HwUMHbKxTeuE6Van4VExB+wvKH0rM8J+13eFWWJj4o9q9AisTYvOTYm9UxNLHX35AtD +9aA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@kernel.org header.s=k20201202 header.b=sEmiSkXc; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m7si3604409iow.93.2021.11.06.10.55.19; Sat, 06 Nov 2021 10:55:32 -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=@kernel.org header.s=k20201202 header.b=sEmiSkXc; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234150AbhKFMJD (ORCPT + 99 others); Sat, 6 Nov 2021 08:09:03 -0400 Received: from mail.kernel.org ([198.145.29.99]:39322 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232950AbhKFMJC (ORCPT ); Sat, 6 Nov 2021 08:09:02 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 4F95561266; Sat, 6 Nov 2021 12:06:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1636200381; bh=Mg0z1ibHmm42Iu1qcKyelNXmwwXddybaIqthcUrSF+M=; h=From:To:Cc:Subject:Date:From; b=sEmiSkXcQ/82VFDUGE2cteb5H7VSVesqpljFR1JdhRuAGKI25uHyIsY9A10yHiil0 WKCxEU9qrCoW4HBMjszB1VPgaYuOg/LLCzyLu8RZvIgj17VZHI8owyQcIeG5Y06yJQ y3lq2pmeJV6SrdUc8Eesn0pshHlGJncpdRa38E0r+1j6OxbrgqferFyiV70Umhxlrs pSGoXNXrxIwRgdrUP/MEh/x3m76LoUp+zxkL5sUczhCnOf3LnWIPQw8pCGG7V+Wgr5 2LDjcm4L5gXX5JviUxK4MEnwEsqJNFTdjcpAHry2zrblCxeu7l/8LWtUDV43n+KaxA 5Cj2hiu5Z++AQ== Received: by mail.kernel.org with local (Exim 4.94.2) (envelope-from ) id 1mjKSg-0006rF-7M; Sat, 06 Nov 2021 12:06:18 +0000 From: Mauro Carvalho Chehab Cc: linuxarm@huawei.com, mauro.chehab@huawei.com, Mauro Carvalho Chehab , Aditya Srivastava , Alan , Alex Dewar , Aline Santana Cordeiro , Andy Shevchenko , Arnd Bergmann , Baokun Li , Dinghao Liu , Greg Kroah-Hartman , Hans Verkuil , Kaixu Xia , Laurent Pinchart , Mauro Carvalho Chehab , Sakari Ailus , Tomi Valkeinen , Tsuchiya Yuto , Yang Yingliang , linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-staging@lists.linux.dev Subject: [PATCH] media: atomisp: get rid of ISP2401_NEW_INPUT_SYSTEM Date: Sat, 6 Nov 2021 12:06:17 +0000 Message-Id: <1885b71956770c4fab463fd338165ae3670da0c1.1636200371.git.mchehab+huawei@kernel.org> X-Mailer: git-send-email 2.33.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: Mauro Carvalho Chehab To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org All ISP2401 devices use the new input system. So, get rid of the remaining definitions, replacing them by runtime checks for BYT/CHT when applicable. Signed-off-by: Mauro Carvalho Chehab --- drivers/staging/media/atomisp/Makefile | 2 +- .../staging/media/atomisp/pci/atomisp_cmd.c | 19 +++++++++++-------- .../media/atomisp/pci/atomisp_compat_css20.c | 4 ++-- .../staging/media/atomisp/pci/atomisp_fops.c | 4 +--- .../staging/media/atomisp/pci/atomisp_v4l2.c | 14 ++------------ 5 files changed, 17 insertions(+), 26 deletions(-) diff --git a/drivers/staging/media/atomisp/Makefile b/drivers/staging/media/atomisp/Makefile index a23c04cf7f34..a98204e9b20f 100644 --- a/drivers/staging/media/atomisp/Makefile +++ b/drivers/staging/media/atomisp/Makefile @@ -319,7 +319,7 @@ ifeq ($(CONFIG_VIDEO_ATOMISP_ISP2401),y) atomisp-objs += \ $(obj-cht) \ pci/runtime/isys/src/ibuf_ctrl_rmgr.o -DEFINES += -DISP2401 -DISP2401_NEW_INPUT_SYSTEM +DEFINES += -DISP2401 endif ccflags-y += $(INCLUDES) $(DEFINES) -fno-common diff --git a/drivers/staging/media/atomisp/pci/atomisp_cmd.c b/drivers/staging/media/atomisp/pci/atomisp_cmd.c index 0ddee36cdcd7..4ef5d728cd2f 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_cmd.c +++ b/drivers/staging/media/atomisp/pci/atomisp_cmd.c @@ -5156,11 +5156,11 @@ static int css_input_resolution_changed(struct atomisp_sub_device *asd, dev_dbg(asd->isp->dev, "css_input_resolution_changed to %ux%u\n", ffmt->width, ffmt->height); -#if defined(ISP2401_NEW_INPUT_SYSTEM) - atomisp_css_input_set_two_pixels_per_clock(asd, false); -#else - atomisp_css_input_set_two_pixels_per_clock(asd, true); -#endif + if (IS_ISP2401) + atomisp_css_input_set_two_pixels_per_clock(asd, false); + else + atomisp_css_input_set_two_pixels_per_clock(asd, true); + if (asd->continuous_mode->val) { /* Note for all checks: ffmt includes pad_w+pad_h */ if (asd->run_mode->val == ATOMISP_RUN_MODE_VIDEO || @@ -5494,9 +5494,14 @@ static void atomisp_get_dis_envelop(struct atomisp_sub_device *asd, static void atomisp_check_copy_mode(struct atomisp_sub_device *asd, int source_pad, struct v4l2_pix_format *f) { -#if defined(ISP2401_NEW_INPUT_SYSTEM) struct v4l2_mbus_framefmt *sink, *src; + if (!IS_ISP2401) { + /* Only used for the new input system */ + asd->copy_mode = false; + return; + } + sink = atomisp_subdev_get_ffmt(&asd->subdev, NULL, V4L2_SUBDEV_FORMAT_ACTIVE, ATOMISP_SUBDEV_PAD_SINK); src = atomisp_subdev_get_ffmt(&asd->subdev, NULL, @@ -5510,8 +5515,6 @@ static void atomisp_check_copy_mode(struct atomisp_sub_device *asd, sensor[asd->sensor_curr].stream_num > 1))) asd->copy_mode = true; else -#endif - /* Only used for the new input system */ asd->copy_mode = false; dev_dbg(asd->isp->dev, "copy_mode: %d\n", asd->copy_mode); diff --git a/drivers/staging/media/atomisp/pci/atomisp_compat_css20.c b/drivers/staging/media/atomisp/pci/atomisp_compat_css20.c index a8972b231e06..da177a8e78e3 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_compat_css20.c +++ b/drivers/staging/media/atomisp/pci/atomisp_compat_css20.c @@ -972,7 +972,7 @@ int atomisp_css_irq_translate(struct atomisp_device *isp, void atomisp_css_rx_get_irq_info(enum mipi_port_id port, unsigned int *infos) { -#ifndef ISP2401_NEW_INPUT_SYSTEM +#ifndef IS_ISP2401 ia_css_isys_rx_get_irq_info(port, infos); #else *infos = 0; @@ -982,7 +982,7 @@ void atomisp_css_rx_get_irq_info(enum mipi_port_id port, void atomisp_css_rx_clear_irq_info(enum mipi_port_id port, unsigned int infos) { -#ifndef ISP2401_NEW_INPUT_SYSTEM +#ifndef IS_ISP2401 ia_css_isys_rx_clear_irq_info(port, infos); #endif } diff --git a/drivers/staging/media/atomisp/pci/atomisp_fops.c b/drivers/staging/media/atomisp/pci/atomisp_fops.c index 4a7e5f2fe436..036a265502fe 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_fops.c +++ b/drivers/staging/media/atomisp/pci/atomisp_fops.c @@ -464,13 +464,11 @@ int atomisp_qbuffers_to_css(struct atomisp_sub_device *asd) css_capture_pipe_id = IA_CSS_PIPE_ID_CAPTURE; } -#ifdef ISP2401_NEW_INPUT_SYSTEM - if (asd->copy_mode) { + if (IS_ISP2401 && asd->copy_mode) { css_capture_pipe_id = IA_CSS_PIPE_ID_COPY; css_preview_pipe_id = IA_CSS_PIPE_ID_COPY; css_video_pipe_id = IA_CSS_PIPE_ID_COPY; } -#endif if (asd->yuvpp_mode) { capture_pipe = &asd->video_out_capture; diff --git a/drivers/staging/media/atomisp/pci/atomisp_v4l2.c b/drivers/staging/media/atomisp/pci/atomisp_v4l2.c index bbef485ee15c..0223e3dd95a6 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_v4l2.c +++ b/drivers/staging/media/atomisp/pci/atomisp_v4l2.c @@ -1635,12 +1635,7 @@ static int atomisp_pci_probe(struct pci_dev *pdev, const struct pci_device_id *i pdev->d3cold_delay = 0; break; case ATOMISP_PCI_DEVICE_SOC_ANN: - isp->media_dev.hw_revision = ( -#ifdef ISP2401_NEW_INPUT_SYSTEM - ATOMISP_HW_REVISION_ISP2401 -#else - ATOMISP_HW_REVISION_ISP2401_LEGACY -#endif + isp->media_dev.hw_revision = ( ATOMISP_HW_REVISION_ISP2401 << ATOMISP_HW_REVISION_SHIFT); isp->media_dev.hw_revision |= pdev->revision < 2 ? ATOMISP_HW_STEPPING_A0 : ATOMISP_HW_STEPPING_B0; @@ -1648,12 +1643,7 @@ static int atomisp_pci_probe(struct pci_dev *pdev, const struct pci_device_id *i isp->hpll_freq = HPLL_FREQ_1600MHZ; break; case ATOMISP_PCI_DEVICE_SOC_CHT: - isp->media_dev.hw_revision = ( -#ifdef ISP2401_NEW_INPUT_SYSTEM - ATOMISP_HW_REVISION_ISP2401 -#else - ATOMISP_HW_REVISION_ISP2401_LEGACY -#endif + isp->media_dev.hw_revision = ( ATOMISP_HW_REVISION_ISP2401 << ATOMISP_HW_REVISION_SHIFT); isp->media_dev.hw_revision |= pdev->revision < 2 ? ATOMISP_HW_STEPPING_A0 : ATOMISP_HW_STEPPING_B0; -- 2.33.1