From patchwork Sun Apr 26 02:26:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Bakker X-Patchwork-Id: 11510081 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 410D21667 for ; Sun, 26 Apr 2020 02:27:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 324602078E for ; Sun, 26 Apr 2020 02:27:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726139AbgDZC1T (ORCPT ); Sat, 25 Apr 2020 22:27:19 -0400 Received: from mail-dm6nam11olkn2064.outbound.protection.outlook.com ([40.92.19.64]:4275 "EHLO NAM11-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726087AbgDZC1T (ORCPT ); Sat, 25 Apr 2020 22:27:19 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KEpwuAZ7q1gwCfi3MC7HhXD6v1iG8QjK4R64W6IarBvwZ+MmPqzcq+vS1n+W+Oaqw1QMk4yCkLDL1GPepi+cL4v7rBw2Q24IMCY5alck8Clh3+P+n/xWzIlZwYgpOiWAsqCMpmre1TZGb6tgVKPQ92Xxm+nOHwZ2eBfKo4QXOPHNwibbDGPGocIrCk/q1Lg0z5vSYmCpt1aWC/HvgcbC6lcV7sValwAs3Yo0suMQMg4z5raxZvjkX4J6qcQVg4m7B8OGAT+p4KJ0+xeZs3WVo3ebfeeZuyKp+vSQmsb4+KN6NgyEv7i/25BCCRNsw1pBDihU0XYocU660clTIReyJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=XeOJmF/n0c886MvuR/LRlCCUs8cOIpWLJMuZGS9ZSr8=; b=faUuYeYN5O/jHC9e0Fx2zy0eMly88eNlow7DTt55a4wWNzn04Nmo/TFmw4kfQrziCvyWV5NHFU59/QXwFRtAq8KgwaNEXIT7N1lI4l9LjdELSfJky7D08SwDgXY2CEW/5rT1HHB04OEayb6c0RGa0wlEyqU/tT3ga88jV2YJMbCXmv0Z9fi7CiWgnRcqqqluKcXuRlaMhT8OYMezhPKRF06AUWyr5/hThOGLdRVMYAypR+Q3KSJDwxccPT/b+ntfrMJ0P7Osrhi721wZWJVW/WGgej4nNRqpoGqB2aQYJGRjw3kcTqpagvsEUZYvA2EL1YTDz6M+gmX8ChKhuYyOUw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=live.ca; dmarc=pass action=none header.from=live.ca; dkim=pass header.d=live.ca; arc=none Received: from DM6NAM11FT041.eop-nam11.prod.protection.outlook.com (2a01:111:e400:fc4d::51) by DM6NAM11HT151.eop-nam11.prod.protection.outlook.com (2a01:111:e400:fc4d::256) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.15; Sun, 26 Apr 2020 02:27:17 +0000 Received: from BN6PR04MB0660.namprd04.prod.outlook.com (2a01:111:e400:fc4d::4a) by DM6NAM11FT041.mail.protection.outlook.com (2a01:111:e400:fc4d::98) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.15 via Frontend Transport; Sun, 26 Apr 2020 02:27:17 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:90CBB64AEECE8E1305D1A943A2B9CF8161B11E79E131C91FBC70C33FC1754462;UpperCasedChecksum:5913E6A23E4CF9E8E78EEACA767C2A0E1FF79F96F3AA7EAF798A1ADDA001D690;SizeAsReceived:7890;Count:50 Received: from BN6PR04MB0660.namprd04.prod.outlook.com ([fe80::ad10:4127:4bc8:76fc]) by BN6PR04MB0660.namprd04.prod.outlook.com ([fe80::ad10:4127:4bc8:76fc%6]) with mapi id 15.20.2937.020; Sun, 26 Apr 2020 02:27:17 +0000 From: Jonathan Bakker To: kyungmin.park@samsung.com, s.nawrocki@samsung.com, mchehab@kernel.org, kgene@kernel.org, krzk@kernel.org, linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Jonathan Bakker Subject: [PATCH 01/11] media: exynos4-is: Remove static driver data for S5PV210 FIMC variants Date: Sat, 25 Apr 2020 19:26:40 -0700 Message-ID: X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200426022650.10355-1-xc-racer2@live.ca> References: <20200426022650.10355-1-xc-racer2@live.ca> X-ClientProxiedBy: MWHPR17CA0086.namprd17.prod.outlook.com (2603:10b6:300:c2::24) To BN6PR04MB0660.namprd04.prod.outlook.com (2603:10b6:404:d9::21) X-Microsoft-Original-Message-ID: <20200426022650.10355-2-xc-racer2@live.ca> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from jon-hp-6570b.telus (2001:569:fb67:7300:9f89:4b96:de0b:cd14) by MWHPR17CA0086.namprd17.prod.outlook.com (2603:10b6:300:c2::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.13 via Frontend Transport; Sun, 26 Apr 2020 02:27:15 +0000 X-Mailer: git-send-email 2.20.1 X-Microsoft-Original-Message-ID: <20200426022650.10355-2-xc-racer2@live.ca> X-TMN: [JcSDRGh/6rwZxxa73J0KCNpDQXJted/ZX0yPeOwEcc+uL5vVAUC7bGlC3JahgGVn] X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 50 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: cd9484ea-c853-4113-c3ca-08d7e98956aa X-MS-TrafficTypeDiagnostic: DM6NAM11HT151: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 7oV0MHdTa3UjRIzR4HSTkrHsl8oZU/7uUicrdb8nLbnmluVa34eD2bQ1PQjaMWC55eLpgTRBckYV4xWLbqeetrK4xlSTkyQq+CLIHivRbII08oCNCHfdIiICTo1IAAtmSUXdI5m2vmh/IcT65BjMvwtcwHKf4y6qY/6doRvhGKIs7O172XgXWvEs2UpKrwGRVvY7ss7zhplj1BewmhC4og== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:0;SRV:;IPV:NLI;SFV:NSPM;H:BN6PR04MB0660.namprd04.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:;DIR:OUT;SFP:1901; X-MS-Exchange-AntiSpam-MessageData: KJR8RcucXN7IPeoouH6S6CMs3CVSA+wD9k3/eaO0oHfavFqlYMyP0rueglEtTva5yFeMfJfA2dhn99mx0w1lUZNA+eVw29cvmzXaF+DmpKd45xOqOFeSuWCaGgncqHOkXiknr/U/gFS1iN8EA66HGYjCF7CLiyaa7cy+8ASuYpOaF5dicaxXw/q5VQloHL5NzbQpNt9zOBzsU+w7iAdVlA== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: cd9484ea-c853-4113-c3ca-08d7e98956aa X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Apr 2020 02:27:17.3626 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6NAM11HT151 Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org The S5PV210 platform only supports device tree based booting where the FIMC variant data is parsed directly from the device tree, hence the now unused static data can be removed. Signed-off-by: Jonathan Bakker Reviewed-by: Tomasz Figa Reviewed-by: Sylwester Nawrocki --- drivers/media/platform/exynos4-is/fimc-core.c | 59 ------------------- 1 file changed, 59 deletions(-) diff --git a/drivers/media/platform/exynos4-is/fimc-core.c b/drivers/media/platform/exynos4-is/fimc-core.c index cde60fbb23a8..2258f3bfc929 100644 --- a/drivers/media/platform/exynos4-is/fimc-core.c +++ b/drivers/media/platform/exynos4-is/fimc-core.c @@ -1110,67 +1110,8 @@ static int fimc_remove(struct platform_device *pdev) return 0; } -/* Image pixel limits, similar across several FIMC HW revisions. */ -static const struct fimc_pix_limit s5p_pix_limit[4] = { - [0] = { - .scaler_en_w = 3264, - .scaler_dis_w = 8192, - .out_rot_en_w = 1920, - .out_rot_dis_w = 4224, - }, - [1] = { - .scaler_en_w = 4224, - .scaler_dis_w = 8192, - .out_rot_en_w = 1920, - .out_rot_dis_w = 4224, - }, - [2] = { - .scaler_en_w = 1920, - .scaler_dis_w = 8192, - .out_rot_en_w = 1280, - .out_rot_dis_w = 1920, - }, -}; - -static const struct fimc_variant fimc0_variant_s5pv210 = { - .has_inp_rot = 1, - .has_out_rot = 1, - .has_cam_if = 1, - .min_inp_pixsize = 16, - .min_out_pixsize = 16, - .hor_offs_align = 8, - .min_vsize_align = 16, - .pix_limit = &s5p_pix_limit[1], -}; - -static const struct fimc_variant fimc1_variant_s5pv210 = { - .has_inp_rot = 1, - .has_out_rot = 1, - .has_cam_if = 1, - .has_mainscaler_ext = 1, - .min_inp_pixsize = 16, - .min_out_pixsize = 16, - .hor_offs_align = 1, - .min_vsize_align = 1, - .pix_limit = &s5p_pix_limit[2], -}; - -static const struct fimc_variant fimc2_variant_s5pv210 = { - .has_cam_if = 1, - .min_inp_pixsize = 16, - .min_out_pixsize = 16, - .hor_offs_align = 8, - .min_vsize_align = 16, - .pix_limit = &s5p_pix_limit[2], -}; - /* S5PV210, S5PC110 */ static const struct fimc_drvdata fimc_drvdata_s5pv210 = { - .variant = { - [0] = &fimc0_variant_s5pv210, - [1] = &fimc1_variant_s5pv210, - [2] = &fimc2_variant_s5pv210, - }, .num_entities = 3, .lclk_frequency = 166000000UL, .out_buf_count = 4, From patchwork Sun Apr 26 02:26:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Bakker X-Patchwork-Id: 11510087 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8B33C92A for ; Sun, 26 Apr 2020 02:27:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7E2A920767 for ; Sun, 26 Apr 2020 02:27:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726142AbgDZC1Z (ORCPT ); Sat, 25 Apr 2020 22:27:25 -0400 Received: from mail-co1nam11olkn2044.outbound.protection.outlook.com ([40.92.18.44]:27936 "EHLO NAM11-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726087AbgDZC1Z (ORCPT ); Sat, 25 Apr 2020 22:27:25 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OWnsiCdyUzytcX4GrNtUcJGoqKvBfpgtEk2pnqi7BaoNP3nmS3fkEX5MDuBIjbuaVPHMEAyvhl/Uth4a/KstFh64/rPmv15mthsieqv3B1dpuTDG4pAUiPNvNgTnYj5yvkMs9/uK2Me54jAzg9b4j9zE4+z+jYdCNagsNLjVCnigEoWQ9xp2CdiTOJoaUusZhME96onu1P9cwJNgvSltan8E61rTzbDX1NPsCbLSDYC3Oj1podH9xuCSQCQNMKrKqltRT03d2qV5Q5cNZdd2dL1WqB1Zp+AWF796Sc1E3wkksYkub1jQysT8EUblZqHRVhdBe7bdKfUk9doC0ADmJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=nSs294RsueSv8t3XwPH3w3458B4RooPL11xssljNUYU=; b=n4lcOn3kuCv6iSvKC/VR9tTWBwqv7wzNb3sf8Hlb4qFyCk36RWC5zFp/LPwgE8YU7nr6/V3RA+jbSKuNREuKw0YxJe5aejOeNvpb3Co/FBq9Qbr3wGyQSvZbIDoWzV/pK3nWjfmM4hbc2ghYlF5m/hAen23U2s/l5GBiQhqFB3ZCo/jnWKHYng0Rufxl6Fd+c+DZn0f6BbuiERuNebEtj7JWSB7mFO0WDwIBH9NBky302gtOm8VG/9EwlcEXI/Et5XoXmBobQgW8kPC5V85rLeqmBOj+kxqjHRF4fuMS2zSOUgzKAceGNaqvLyK1bBDgevUEFMZVsx3NSt6xS07qPw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=live.ca; dmarc=pass action=none header.from=live.ca; dkim=pass header.d=live.ca; arc=none Received: from DM6NAM11FT041.eop-nam11.prod.protection.outlook.com (2a01:111:e400:fc4d::51) by DM6NAM11HT254.eop-nam11.prod.protection.outlook.com (2a01:111:e400:fc4d::152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.15; Sun, 26 Apr 2020 02:27:23 +0000 Received: from BN6PR04MB0660.namprd04.prod.outlook.com (2a01:111:e400:fc4d::4a) by DM6NAM11FT041.mail.protection.outlook.com (2a01:111:e400:fc4d::98) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.15 via Frontend Transport; Sun, 26 Apr 2020 02:27:23 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:531B31765C167240FADAD33C2444280293575C44E3AA2CD8BEB47D2BFD6B721D;UpperCasedChecksum:382035105F016C51E8D78BD7EC922D9068D323520BD471630FCE1EAC17CCE74A;SizeAsReceived:7956;Count:50 Received: from BN6PR04MB0660.namprd04.prod.outlook.com ([fe80::ad10:4127:4bc8:76fc]) by BN6PR04MB0660.namprd04.prod.outlook.com ([fe80::ad10:4127:4bc8:76fc%6]) with mapi id 15.20.2937.020; Sun, 26 Apr 2020 02:27:23 +0000 From: Jonathan Bakker To: kyungmin.park@samsung.com, s.nawrocki@samsung.com, mchehab@kernel.org, kgene@kernel.org, krzk@kernel.org, linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Tomasz Figa , Jonathan Bakker Subject: [PATCH 02/11] media: exynos4-is: Request syscon only if ISP writeback is present Date: Sat, 25 Apr 2020 19:26:41 -0700 Message-ID: X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200426022650.10355-1-xc-racer2@live.ca> References: <20200426022650.10355-1-xc-racer2@live.ca> X-ClientProxiedBy: MWHPR17CA0086.namprd17.prod.outlook.com (2603:10b6:300:c2::24) To BN6PR04MB0660.namprd04.prod.outlook.com (2603:10b6:404:d9::21) X-Microsoft-Original-Message-ID: <20200426022650.10355-3-xc-racer2@live.ca> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from jon-hp-6570b.telus (2001:569:fb67:7300:9f89:4b96:de0b:cd14) by MWHPR17CA0086.namprd17.prod.outlook.com (2603:10b6:300:c2::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.13 via Frontend Transport; Sun, 26 Apr 2020 02:27:21 +0000 X-Mailer: git-send-email 2.20.1 X-Microsoft-Original-Message-ID: <20200426022650.10355-3-xc-racer2@live.ca> X-TMN: [G7Cs4MM2yrwsmarBCCekGBrr73zkLHuucpIt+RpKrepKcQy9fHU6tvmtkdp/Egxy] X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 50 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: 420a6fac-6952-46ad-b221-08d7e9895a36 X-MS-TrafficTypeDiagnostic: DM6NAM11HT254: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 62/GSOfmLqQflkz9FXkbq35CipkjOYlc3CZH+XRgYPrm6oww5IzK4mosSsg0CXttynvgXLNjU8P0z4wVXEhK8YsfSG2f9VNg/yGFQl35G4CLLIxyTi403shc8/c0YGej4BBpUGwmK/gq5XzNOdv20RJrFByllTk3xVsaY//DH0k/Rz0jV5qHY9OUQzQgSZRI9V5a9aokLNXb/t5phKv26g== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:0;SRV:;IPV:NLI;SFV:NSPM;H:BN6PR04MB0660.namprd04.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:;DIR:OUT;SFP:1901; X-MS-Exchange-AntiSpam-MessageData: wG+zfM+P8LZZQwjk07Bk/6RaKDXdAHoL2zfQl5j13+CT1itEhCarHPg6NjoB9/7qLoIKZS0eTeEhnEr2lrSoQF1M1UMTasjHkcsBWfCMlhA0Ehpfmol4TkJYOG/RTaVNmRRZz4PpptP4WuMWiFosJZJc9quo+r3Ly/pNm3GsRuYJrmEbNAD3gOKyGl9CdCyHbNuFLziLBu1PO7DAkIUzGA== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 420a6fac-6952-46ad-b221-08d7e9895a36 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Apr 2020 02:27:23.3808 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6NAM11HT254 Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org From: Tomasz Figa On FIMC variants which don't have writeback channel, there is no need to access system registers. This patch makes the driver request sysreg regmap conditionally depending on whether writeback is supported. Signed-off-by: Tomasz Figa Signed-off-by: Jonathan Bakker Reviewed-by: Tomasz Figa Reviewed-by: Sylwester Nawrocki --- drivers/media/platform/exynos4-is/fimc-core.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/media/platform/exynos4-is/fimc-core.c b/drivers/media/platform/exynos4-is/fimc-core.c index 2258f3bfc929..08d1f39a914c 100644 --- a/drivers/media/platform/exynos4-is/fimc-core.c +++ b/drivers/media/platform/exynos4-is/fimc-core.c @@ -954,9 +954,11 @@ static int fimc_probe(struct platform_device *pdev) spin_lock_init(&fimc->slock); mutex_init(&fimc->lock); - fimc->sysreg = fimc_get_sysreg_regmap(dev->of_node); - if (IS_ERR(fimc->sysreg)) - return PTR_ERR(fimc->sysreg); + if (fimc->variant->has_isp_wb) { + fimc->sysreg = fimc_get_sysreg_regmap(dev->of_node); + if (IS_ERR(fimc->sysreg)) + return PTR_ERR(fimc->sysreg); + } res = platform_get_resource(pdev, IORESOURCE_MEM, 0); fimc->regs = devm_ioremap_resource(dev, res); From patchwork Sun Apr 26 02:26:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Bakker X-Patchwork-Id: 11510127 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C75B292A for ; Sun, 26 Apr 2020 02:28:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B92C420724 for ; Sun, 26 Apr 2020 02:28:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726189AbgDZC12 (ORCPT ); Sat, 25 Apr 2020 22:27:28 -0400 Received: from mail-bn8nam11olkn2077.outbound.protection.outlook.com ([40.92.20.77]:34981 "EHLO NAM11-BN8-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726177AbgDZC11 (ORCPT ); Sat, 25 Apr 2020 22:27:27 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mmJ/UlxEin9jdYPHq8Jjya8ZkO5zAaYIpu11W2wUZzaH65tv2Enn/vwAiQNDloKSgNbVQaNAZaYeFLRsYsdIK6Dtz4vjOwtnsZTvDfsry3O1YsPkYTG81ohyj2tC2XQVbcWlbNv2rgmqu62WiaWUvG1Ps1f4fKFTNhirhO2rQEYl+OnoRoV41FgV8Wrtw2viswY0LMQg8KVvsaoXsNzw4nUBgyiTubWlWd4WpG+q/Ozj50nm/v3ZLHKjaIZntqEcK+3s/9upuqlH432DkDyFO4joZioF0hN+SUq0q4vV8F6ZW4CPJTC39ysByYvC2q7rhGH9HQL0zY2aBnyB3M7KVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=u4wkmj/wxZ2i5UZxxrWILZNeF0xG4EpXxRTegd2E8yo=; b=WZdH9vebkNGbFDYDktOP0HlUPbY4+G6eKbr9RxWTlqP6A+X02e4N6aZxTJD2tDf58TOvIDo2a/0nNMS5MTIjYItMJZQmh7eRtDRXwLaqzzvIeYJXWOHzG6rj9nkjF5SzfWklZpXeV0YEYDGMh6kceDcGIGyNqrZSUF7rOe3PD46+zTNz+teJz9/rFyHuoO0Xs2MhaLGmYrCuv1r7Sk+RwtQHuLfSEimLu9GOdrwfbuEKpm4ngBbOxhHcB0p9WTFKY6tl1qY8KvMBHjs4Lq3oKmz06GlJ++4SwBo7xcxUxO68a3rK0GaaTidDyD3+ccoatOkqIaM7rYEXmBFSoDACYw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=live.ca; dmarc=pass action=none header.from=live.ca; dkim=pass header.d=live.ca; arc=none Received: from DM6NAM11FT041.eop-nam11.prod.protection.outlook.com (2a01:111:e400:fc4d::41) by DM6NAM11HT170.eop-nam11.prod.protection.outlook.com (2a01:111:e400:fc4d::453) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.15; Sun, 26 Apr 2020 02:27:26 +0000 Received: from BN6PR04MB0660.namprd04.prod.outlook.com (2a01:111:e400:fc4d::4a) by DM6NAM11FT041.mail.protection.outlook.com (2a01:111:e400:fc4d::98) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.15 via Frontend Transport; Sun, 26 Apr 2020 02:27:26 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:AB033B3932857C383595B38E01CDE9F697CFB4BE730BA8C25BF9953349945493;UpperCasedChecksum:251F5DF023DF429DA512DA425D0E88BDE9F11A13FB4C6F152C139EA712CDA143;SizeAsReceived:7879;Count:50 Received: from BN6PR04MB0660.namprd04.prod.outlook.com ([fe80::ad10:4127:4bc8:76fc]) by BN6PR04MB0660.namprd04.prod.outlook.com ([fe80::ad10:4127:4bc8:76fc%6]) with mapi id 15.20.2937.020; Sun, 26 Apr 2020 02:27:25 +0000 From: Jonathan Bakker To: kyungmin.park@samsung.com, s.nawrocki@samsung.com, mchehab@kernel.org, kgene@kernel.org, krzk@kernel.org, linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Jonathan Bakker Subject: [PATCH 03/11] media: exynos4-is: Fix nullptr when no CSIS device present Date: Sat, 25 Apr 2020 19:26:42 -0700 Message-ID: X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200426022650.10355-1-xc-racer2@live.ca> References: <20200426022650.10355-1-xc-racer2@live.ca> X-ClientProxiedBy: MWHPR17CA0086.namprd17.prod.outlook.com (2603:10b6:300:c2::24) To BN6PR04MB0660.namprd04.prod.outlook.com (2603:10b6:404:d9::21) X-Microsoft-Original-Message-ID: <20200426022650.10355-4-xc-racer2@live.ca> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from jon-hp-6570b.telus (2001:569:fb67:7300:9f89:4b96:de0b:cd14) by MWHPR17CA0086.namprd17.prod.outlook.com (2603:10b6:300:c2::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.13 via Frontend Transport; Sun, 26 Apr 2020 02:27:24 +0000 X-Mailer: git-send-email 2.20.1 X-Microsoft-Original-Message-ID: <20200426022650.10355-4-xc-racer2@live.ca> X-TMN: [1oJ+afvzna9c2PI4V+qf3tzhsALYZJsPTuQYln4YeTnVm2ibph30mZ41AhFs9ds6] X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 50 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: 745d7e3a-e422-41f6-26d8-08d7e9895bc3 X-MS-TrafficTypeDiagnostic: DM6NAM11HT170: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: BD5GIXgC5fTuSlXRgvFnes52XLEgoIvphnju8820MXBY4FiCwh0/nr6GjAepqhZ39cU52mLVUrWw3+55dETSquwwooNFSEe5SvdQQwO/Dt6Kb+aQBUKPo9JCCyc2skLnSChTiCrsIEKBmbIqvhIlK4XzpABWScELsAyd0KN7yF1xc2tB2pLibriXZ3E3S8JebVR/FQEqlXLD9iUz0VtiEw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:0;SRV:;IPV:NLI;SFV:NSPM;H:BN6PR04MB0660.namprd04.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:;DIR:OUT;SFP:1901; X-MS-Exchange-AntiSpam-MessageData: AD/vDXyJDCs6KsRNR4vhP4S5ZexxX/KeC42Mu0jnMvckXKPkUxfZuq2kuFhSl9gCT41KQ0EiIDnbh0H0UaH1kwy/L8nQNBd7phcDgv8IbJSSWtsPfivJlih0ldYQ1P5bOs/b+jIb+BoUbEwJT0yo/AUZ67ENcXL1bC2yl+hjsceXa9cvQepfoiUlk1NlA3U4HytWdrlqldrupZtpaJAy2Q== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 745d7e3a-e422-41f6-26d8-08d7e9895bc3 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Apr 2020 02:27:25.8751 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6NAM11HT170 Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org Not all devices use the CSIS device, some may use the FIMC directly in which case the CSIS device isn't registered. This leads to a nullptr exception when starting the stream as the CSIS device is always referenced. Instead, if getting the CSIS device fails, try getting the FIMC directly to check if we are using the subdev API Signed-off-by: Jonathan Bakker Reviewed-by: Sylwester Nawrocki --- drivers/media/platform/exynos4-is/media-dev.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/drivers/media/platform/exynos4-is/media-dev.c b/drivers/media/platform/exynos4-is/media-dev.c index 9aaf3b8060d5..5c32abc7251b 100644 --- a/drivers/media/platform/exynos4-is/media-dev.c +++ b/drivers/media/platform/exynos4-is/media-dev.c @@ -289,11 +289,26 @@ static int __fimc_pipeline_s_stream(struct exynos_media_pipeline *ep, bool on) { IDX_CSIS, IDX_FLITE, IDX_FIMC, IDX_SENSOR, IDX_IS_ISP }, }; struct fimc_pipeline *p = to_fimc_pipeline(ep); - struct fimc_md *fmd = entity_to_fimc_mdev(&p->subdevs[IDX_CSIS]->entity); enum fimc_subdev_index sd_id; int i, ret = 0; if (p->subdevs[IDX_SENSOR] == NULL) { + struct fimc_md *fmd; + struct v4l2_subdev *sd = p->subdevs[IDX_CSIS]; + + if (!sd) + sd = p->subdevs[IDX_FIMC]; + + if (!sd) { + /* + * If neither CSIS nor FIMC was set up, + * it's impossible to have any sensors + */ + return -ENODEV; + } + + fmd = entity_to_fimc_mdev(&sd->entity); + if (!fmd->user_subdev_api) { /* * Sensor must be already discovered if we From patchwork Sun Apr 26 02:26:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Bakker X-Patchwork-Id: 11510089 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3146592A for ; Sun, 26 Apr 2020 02:27:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1E6FD20724 for ; Sun, 26 Apr 2020 02:27:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726303AbgDZC1c (ORCPT ); Sat, 25 Apr 2020 22:27:32 -0400 Received: from mail-bn8nam11olkn2093.outbound.protection.outlook.com ([40.92.20.93]:20992 "EHLO NAM11-BN8-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726238AbgDZC1a (ORCPT ); Sat, 25 Apr 2020 22:27:30 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=j1ALIYNR+r8L3zoBeHOsIpIWiMnGgf+a+JL/JsXfViXEJ+iuVCeKRB1SwljqfGWn4YgC3mDZ4wxjA7qBlCpy8eaHKRJNMkylg5lDSaI58ZbOqF1drMFdTMaHXJjB23DRuEqoSe+YndM4/ofIJz4LUHwwUv3HYKyrj0snEGJdBLtXeLoGHkVmQvDLu3U40pP3tm0Uj4wuY8V9yggGC+eGq6fQSwOJphMbvSSwz4TjX8cMoM7Q0Tp5TZMz2c5FxuST58wDseHy/Zhe5sG1OlDWYZtJfVjgrzgIcRBU3kCfgp2vfwm1wId/QtRd8cvWe59XcuyHQ7bDHb0C7jlfBQeNmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=FYG5JsFEnKGMhf5ZzJYDTjU+1+CCTZQpGobakOJ7jmo=; b=GLIK7LabzbH7wZ7xO80fW2ofB/iNzq3f96Gq9tBWqZ4rfjZ1bwbsOWW5i5+yldZDoZjc4kdkZkJjmqVrHS/JRwvFvFk5mTrKcxOtkHWpAHlJOmP5/8GlY//rQKWa8B4Yqf0ImfKdBVvYyjIsKsKQvaHxvYsAsuWOQEkIfxgkctrZTWux+1DiXR5WSfCyqDtT/SpT4yz5iYBdFJv2T6S9Drq7iSIq/71Vj8x24/h5E8JqYMLjwBGguNePt82b+7IIMJn76F66iXrGsjYHmMqeU6vknuJka8pceOPLL1Opgn3v6uWczdXFjHjIdC+NkN8LV8kpXeAPAVMXzlDL1M1R8g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=live.ca; dmarc=pass action=none header.from=live.ca; dkim=pass header.d=live.ca; arc=none Received: from DM6NAM11FT041.eop-nam11.prod.protection.outlook.com (2a01:111:e400:fc4d::4c) by DM6NAM11HT126.eop-nam11.prod.protection.outlook.com (2a01:111:e400:fc4d::118) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.15; Sun, 26 Apr 2020 02:27:28 +0000 Received: from BN6PR04MB0660.namprd04.prod.outlook.com (2a01:111:e400:fc4d::4a) by DM6NAM11FT041.mail.protection.outlook.com (2a01:111:e400:fc4d::98) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.15 via Frontend Transport; Sun, 26 Apr 2020 02:27:28 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:AC5484BF1987E13A74F66DD3E8908075B8B61AB457AB9B28C727C2D99AA19FC5;UpperCasedChecksum:83C8C5955D66DF4B1DC3C6FC8278CD46458A2C85D4AA7DA9BDD2226F39D46E35;SizeAsReceived:7885;Count:50 Received: from BN6PR04MB0660.namprd04.prod.outlook.com ([fe80::ad10:4127:4bc8:76fc]) by BN6PR04MB0660.namprd04.prod.outlook.com ([fe80::ad10:4127:4bc8:76fc%6]) with mapi id 15.20.2937.020; Sun, 26 Apr 2020 02:27:28 +0000 From: Jonathan Bakker To: kyungmin.park@samsung.com, s.nawrocki@samsung.com, mchehab@kernel.org, kgene@kernel.org, krzk@kernel.org, linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Jonathan Bakker Subject: [PATCH 04/11] media: exynos4-is: Correct missing entity function initialization Date: Sat, 25 Apr 2020 19:26:43 -0700 Message-ID: X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200426022650.10355-1-xc-racer2@live.ca> References: <20200426022650.10355-1-xc-racer2@live.ca> X-ClientProxiedBy: MWHPR17CA0086.namprd17.prod.outlook.com (2603:10b6:300:c2::24) To BN6PR04MB0660.namprd04.prod.outlook.com (2603:10b6:404:d9::21) X-Microsoft-Original-Message-ID: <20200426022650.10355-5-xc-racer2@live.ca> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from jon-hp-6570b.telus (2001:569:fb67:7300:9f89:4b96:de0b:cd14) by MWHPR17CA0086.namprd17.prod.outlook.com (2603:10b6:300:c2::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.13 via Frontend Transport; Sun, 26 Apr 2020 02:27:26 +0000 X-Mailer: git-send-email 2.20.1 X-Microsoft-Original-Message-ID: <20200426022650.10355-5-xc-racer2@live.ca> X-TMN: [hRAG4lJvWdX2ftofBKqA5ojw10PlQXUww80CuFNlK02D21XLeKC5mo/gnIL4TrCE] X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 50 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: b3c4ea0f-a617-4209-7d31-08d7e9895d1e X-MS-TrafficTypeDiagnostic: DM6NAM11HT126: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 28Xpl/YAbCbNsTBrMreqyfWwZCbZHrVopMs1nhOBcTmtfya01JWVLPAK6jHO448V9O3/klxZBV4d5qzBXhrJ0IzOXPnRf54bwF7C9wSpFRngwQnx5I1HBqmxENYkVcM7kK/pkRbciTWoyaqPQH1UQGYvOYv3X77zdbKK2PMXdI3xZBnKmYS25DrGLfEenVNn3n/2cx79eXnNTQfJWUfMdQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:0;SRV:;IPV:NLI;SFV:NSPM;H:BN6PR04MB0660.namprd04.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:;DIR:OUT;SFP:1901; X-MS-Exchange-AntiSpam-MessageData: L+8NB0yY7Pao1UE57PQFZOZpcVI1AuBBqK6/1e2BIPNbbWXa+v2T74w7CreMppbgR/kpe6RoV2FZHw/XpPFhR7RAur9GCVKF4F2m0cbfVxoZG5aCMX+rH9VXjviXURQqZfuJ3ECFpXAx9BPihvNCv9GubyU4C7gk3G9qyTUjEns+atuqjU7GUd0PSfuXEZjhu3f1NE2mMxhzF/lrH6GWtw== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: b3c4ea0f-a617-4209-7d31-08d7e9895d1e X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Apr 2020 02:27:28.1894 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6NAM11HT126 Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org Commit bae4500399c4 ("[media] exynos4-is: Add missing entity function initialization") tried to suppress the warnings such as s5p-fimc-md camera: Entity type for entity FIMC.0 was not initialized! However, this didn't work in all cases. Correct this by calling the set function earlier. Fixes: bae4500399c4 ("exynos4-is: Add missing entity function initialization") Signed-off-by: Jonathan Bakker --- drivers/media/platform/exynos4-is/fimc-capture.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/exynos4-is/fimc-capture.c b/drivers/media/platform/exynos4-is/fimc-capture.c index 705f182330ca..86c233e2f2c9 100644 --- a/drivers/media/platform/exynos4-is/fimc-capture.c +++ b/drivers/media/platform/exynos4-is/fimc-capture.c @@ -1799,7 +1799,6 @@ static int fimc_register_capture_device(struct fimc_dev *fimc, vid_cap->wb_fmt.code = fmt->mbus_code; vid_cap->vd_pad.flags = MEDIA_PAD_FL_SINK; - vfd->entity.function = MEDIA_ENT_F_PROC_VIDEO_SCALER; ret = media_entity_pads_init(&vfd->entity, 1, &vid_cap->vd_pad); if (ret) goto err_free_ctx; @@ -1898,6 +1897,7 @@ int fimc_initialize_capture_subdev(struct fimc_dev *fimc) return ret; sd->entity.ops = &fimc_sd_media_ops; + sd->entity.function = MEDIA_ENT_F_PROC_VIDEO_SCALER; sd->internal_ops = &fimc_capture_sd_internal_ops; v4l2_set_subdevdata(sd, fimc); return 0; From patchwork Sun Apr 26 02:26:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Bakker X-Patchwork-Id: 11510119 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3C3EF17EA for ; Sun, 26 Apr 2020 02:28:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2E63B21556 for ; Sun, 26 Apr 2020 02:28:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726348AbgDZC1i (ORCPT ); Sat, 25 Apr 2020 22:27:38 -0400 Received: from mail-dm6nam11olkn2068.outbound.protection.outlook.com ([40.92.19.68]:31489 "EHLO NAM11-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726177AbgDZC1d (ORCPT ); Sat, 25 Apr 2020 22:27:33 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ibZZ8xyalC4Bc9j4o/PO3tC8SlyudgwOQpfJiRfigiyrK+M47AZL5DTAW4dABug9ZCau/1LUU4TA5CGmxBaeCxLhQWLPNZ/ntH6iFcWHyc2BqLjB2YT1+Bl1h+tkv2h+pGUo7BHP5dwgjCxLSvjq9bTR3dnbfsHEgDpTY+OCjNE363RGjptUG0MGg59gg3K0ggG2PRKdVHceBQPTxvzJVR4HSOJDTXbatE/+m+afDp5SVA1+GNNAPpka2IztWppSrrTr8rcq3X05DBOiK56jw4R9JeuhUuQBG99dVKwC7Y0ZxaYuSoMGjXEk6i4zBi4+PZeIZlzBmltEavBOPcHRXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=S7HPWS9yVfZrECj3MbRzVdpu2IcW9X8FLw2eD2WHE40=; b=drgVEY8lhzPwtKDaCZvtSbc5J4Pspt+hqErx8yhjObFBVOZMVaNo5Gc01vms6npotjm5n7vAN2+otkwuUdZyYQ+5Fb+YbzOhnAY3VQG/lgOUWdYbZLv2Mh9Vj3ZWgXz03OvYE17ulrAnhFRuv0+xAy0cdWWHhxe7jckF4HI0eE+mCSGUFQCCdhbeaaQLc5dFUqjiGRFgYvTG1X67J9CWIFo5McQVXdH/L0gPjEkTFWsD+XNrmyJbC2Z9p5wK5MDkex16QV6nVYjKy2aEkzZjA0n5zt1hqK+CxQw4RH4S/nCZJ2FsqEjQ8LGxipLbPfyJio/2jj8sZZ9WmST+8HQLtg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=live.ca; dmarc=pass action=none header.from=live.ca; dkim=pass header.d=live.ca; arc=none Received: from DM6NAM11FT041.eop-nam11.prod.protection.outlook.com (2a01:111:e400:fc4d::4b) by DM6NAM11HT199.eop-nam11.prod.protection.outlook.com (2a01:111:e400:fc4d::127) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.15; Sun, 26 Apr 2020 02:27:32 +0000 Received: from BN6PR04MB0660.namprd04.prod.outlook.com (2a01:111:e400:fc4d::4a) by DM6NAM11FT041.mail.protection.outlook.com (2a01:111:e400:fc4d::98) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.15 via Frontend Transport; Sun, 26 Apr 2020 02:27:32 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:C76ACA014B7920A7393CA55B97D57A09B78F9CB0C784F082A0B00C645A33C6A0;UpperCasedChecksum:B9AFA0369D6928ACC76F972A634E107E46C0F7B2FB88533137F045E091DE5447;SizeAsReceived:7885;Count:50 Received: from BN6PR04MB0660.namprd04.prod.outlook.com ([fe80::ad10:4127:4bc8:76fc]) by BN6PR04MB0660.namprd04.prod.outlook.com ([fe80::ad10:4127:4bc8:76fc%6]) with mapi id 15.20.2937.020; Sun, 26 Apr 2020 02:27:31 +0000 From: Jonathan Bakker To: kyungmin.park@samsung.com, s.nawrocki@samsung.com, mchehab@kernel.org, kgene@kernel.org, krzk@kernel.org, linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Jonathan Bakker Subject: [PATCH 05/11] media: exynos4-is: Improve support for sensors with multiple pads Date: Sat, 25 Apr 2020 19:26:44 -0700 Message-ID: X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200426022650.10355-1-xc-racer2@live.ca> References: <20200426022650.10355-1-xc-racer2@live.ca> X-ClientProxiedBy: MWHPR17CA0086.namprd17.prod.outlook.com (2603:10b6:300:c2::24) To BN6PR04MB0660.namprd04.prod.outlook.com (2603:10b6:404:d9::21) X-Microsoft-Original-Message-ID: <20200426022650.10355-6-xc-racer2@live.ca> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from jon-hp-6570b.telus (2001:569:fb67:7300:9f89:4b96:de0b:cd14) by MWHPR17CA0086.namprd17.prod.outlook.com (2603:10b6:300:c2::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.13 via Frontend Transport; Sun, 26 Apr 2020 02:27:30 +0000 X-Mailer: git-send-email 2.20.1 X-Microsoft-Original-Message-ID: <20200426022650.10355-6-xc-racer2@live.ca> X-TMN: [Rd0fLBUNqMrJxRoYi4/YUKVkOV912BbEjWmwcE+m4k03pO6ppF2jXFieZQ7FE/xG] X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 50 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: cbdf9b99-f034-4e64-9646-08d7e9895f40 X-MS-TrafficTypeDiagnostic: DM6NAM11HT199: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: o6EI7IFTyhCl/gXh+msQTEJr6g6tpj4qUvYF03zmhkbsyf9JvdREpz908ETSla2qJzPN0QC3AT6SfGokT9mfeEH0zIcIehlXmGvMvMHS+RfC08V7Au+/G3uuZTors1Nyx+SQpavmZUKiseYX+x6IddET6ATSb3Z8vniwcFu1MXxzCqn+xAIfF2+3q+8FeQl6krBHH+EGAKLIqzUSRfpNDQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:0;SRV:;IPV:NLI;SFV:NSPM;H:BN6PR04MB0660.namprd04.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:;DIR:OUT;SFP:1901; X-MS-Exchange-AntiSpam-MessageData: ECfh7hbTvQzef7wqRFnOk3wzCyEsRZWrW8wqVROoH36F3l8u8phjYF0MPd8nPrxsQfKLo2rchQTVRwQkAjvXT4KKbhsOiS/pispiZY9TwsTUpvzJVjvTZLS693PDqtWcCGuiczWRfB/mUOno1SFg3YbgT/BwFB1QS9RjGOPprmSecDfvrjg+VKA7novQcaZDgJfilziKqXVyT8zarGqI6Q== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: cbdf9b99-f034-4e64-9646-08d7e9895f40 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Apr 2020 02:27:31.8502 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6NAM11HT199 Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org Commit 1c9f5bd7cb8a ("[media] s5p-fimc: Add support for sensors with multiple pads") caught the case where a sensor with multiple pads was connected via CSIS, but missed the case where the sensor was directly connected to the FIMC. This still assumes that the last pad of a sensor is the source. Signed-off-by: Jonathan Bakker --- drivers/media/platform/exynos4-is/media-dev.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/media/platform/exynos4-is/media-dev.c b/drivers/media/platform/exynos4-is/media-dev.c index 5c32abc7251b..b38445219c72 100644 --- a/drivers/media/platform/exynos4-is/media-dev.c +++ b/drivers/media/platform/exynos4-is/media-dev.c @@ -991,7 +991,8 @@ static int fimc_md_create_links(struct fimc_md *fmd) case FIMC_BUS_TYPE_ITU_601...FIMC_BUS_TYPE_ITU_656: source = &sensor->entity; - pad = 0; + /* Assume the last pad is the source */ + pad = sensor->entity.num_pads - 1; break; default: From patchwork Sun Apr 26 02:26:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Bakker X-Patchwork-Id: 11510117 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 107551667 for ; Sun, 26 Apr 2020 02:28:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F23A620767 for ; Sun, 26 Apr 2020 02:28:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726360AbgDZC1i (ORCPT ); Sat, 25 Apr 2020 22:27:38 -0400 Received: from mail-bn8nam11olkn2045.outbound.protection.outlook.com ([40.92.20.45]:43072 "EHLO NAM11-BN8-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726343AbgDZC1g (ORCPT ); Sat, 25 Apr 2020 22:27:36 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KSHIo/jH9y2S/VxnqmJnzwPnblcK0Ub3bx37En+HHgV8dFfI4lOmM0g6pbp+Mr71xP1L0ZvAbMja5StPX33NIHvPIBUqIZYyo9k4n6uIpEq+iJlcsIz3reWHbVikULwk2wA3+ExItaBnGcHMs1NdkkRZ0UVi31NLBtgdNnKlpjcbw4tr7lkIYC/2Qsrl299/RivkEW0h6SM96pPaS+2zFWfiL77NznllDyiu4KBPvJSOF0Dz3xjnQVxMCximtF55tt3cCv1/pQodLIPeJHYa5f8zU8q9sMZFbnrbGlf1iCM8hE33PdnUEj1y8bIzHEofUcBNoHLPBein2f9+XO38NQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=gyhMmAuLLKz3Txu/D7fRrp8L5HG/2Hcsxc3Ddx0+cyU=; b=HeDI9fYpz7QYITnvPzEFc7NSIaSVJ8z/vhkAM5JU16r6vmkj84aqDwEnvVoDormNfZDxBzGkbY0tHjE8gVRzou+mVNX6PzGEhBDMMUzxLbDJJ8+aSWvDJF39vsRs/Pyt3JdDOefsfQDsYgCtNqCwB0hjpHnl0dByEoXH6+dXVY/mKwbKvzjQtaYWSjnoU2Sr6ULXnST0bIvoIAucu8ZAVuBbwvQuV7nV8VW18YwLPKZbViKcuFTZ8Ti3JlNWwMoOXtSCLMwRVkBKQnin6DB+iz433BaXNYtMdeDjR62GgXKymxZZJpWOGpi9f7CSNINsCYjTBQQE1OJJ6siP/GB/1Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=live.ca; dmarc=pass action=none header.from=live.ca; dkim=pass header.d=live.ca; arc=none Received: from DM6NAM11FT041.eop-nam11.prod.protection.outlook.com (2a01:111:e400:fc4d::46) by DM6NAM11HT124.eop-nam11.prod.protection.outlook.com (2a01:111:e400:fc4d::163) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.15; Sun, 26 Apr 2020 02:27:34 +0000 Received: from BN6PR04MB0660.namprd04.prod.outlook.com (2a01:111:e400:fc4d::4a) by DM6NAM11FT041.mail.protection.outlook.com (2a01:111:e400:fc4d::98) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.15 via Frontend Transport; Sun, 26 Apr 2020 02:27:34 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:05EA9E6AB9C491620B9E8440C0337F428FBBFF41D5E8FD18B75C421E32E09B6D;UpperCasedChecksum:BF3F6747AA1159EE60BBBE289AF474DCF082DB893E89179191E39FD0215DE8B5;SizeAsReceived:7885;Count:50 Received: from BN6PR04MB0660.namprd04.prod.outlook.com ([fe80::ad10:4127:4bc8:76fc]) by BN6PR04MB0660.namprd04.prod.outlook.com ([fe80::ad10:4127:4bc8:76fc%6]) with mapi id 15.20.2937.020; Sun, 26 Apr 2020 02:27:34 +0000 From: Jonathan Bakker To: kyungmin.park@samsung.com, s.nawrocki@samsung.com, mchehab@kernel.org, kgene@kernel.org, krzk@kernel.org, linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Jonathan Bakker Subject: [PATCH 06/11] media: exynos4-is: Properly set JPEG options when not using CSIS Date: Sat, 25 Apr 2020 19:26:45 -0700 Message-ID: X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200426022650.10355-1-xc-racer2@live.ca> References: <20200426022650.10355-1-xc-racer2@live.ca> X-ClientProxiedBy: MWHPR17CA0086.namprd17.prod.outlook.com (2603:10b6:300:c2::24) To BN6PR04MB0660.namprd04.prod.outlook.com (2603:10b6:404:d9::21) X-Microsoft-Original-Message-ID: <20200426022650.10355-7-xc-racer2@live.ca> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from jon-hp-6570b.telus (2001:569:fb67:7300:9f89:4b96:de0b:cd14) by MWHPR17CA0086.namprd17.prod.outlook.com (2603:10b6:300:c2::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.13 via Frontend Transport; Sun, 26 Apr 2020 02:27:32 +0000 X-Mailer: git-send-email 2.20.1 X-Microsoft-Original-Message-ID: <20200426022650.10355-7-xc-racer2@live.ca> X-TMN: [P/je1eLt+p1HKCaiMUepc/soCEinAVv6a8+4tZTQTLViEbXGVfMnPX5sd3d8/mfE] X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 50 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: 4b54d78b-a75b-4b14-cde1-08d7e98960b2 X-MS-TrafficTypeDiagnostic: DM6NAM11HT124: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: rPJyK6oYs6gdQIo5y4it0w4/+286hequcDxCOdFnFv/ccdKmDuhVwnkpTxPatWouEaMo/Orm4wzr/Y32+U4NwLQC34FEv7TEKwRszaHaZ3+mJW2OPjw23Ys3m/I+MoKWOIvK75jfSRqiUehDnHAOCHxfijC9lj8il2g+xN5ZliEx38bOqxRx7JOvi6TdSf42fOuoPItXuzVspIMO3cha2Q== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:0;SRV:;IPV:NLI;SFV:NSPM;H:BN6PR04MB0660.namprd04.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:;DIR:OUT;SFP:1901; X-MS-Exchange-AntiSpam-MessageData: LVOqoE7YPwnT7loVg6+q3OeLhrSPA0dizyuDbQ9OTRNQxzTnQtVARg9curgpXdg6wXfTlc3Ols5sEuK3mqsyrifPV8wS4pHM4BdYUXTPWUSS+b92Z0nRRxrNnbKJnmHuM1FkCTMR3/eATWOQwyCL4J7lssa3FDNwa5bmegzYKPmERSz9OkR3jnyVb5qxFw3ZfoGQ2ubZ163kdSt0ErPNsA== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4b54d78b-a75b-4b14-cde1-08d7e98960b2 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Apr 2020 02:27:34.1615 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6NAM11HT124 Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org Commit ee7160e57c98 ("[media] s5p-fimc: Add support for JPEG capture") added support for JPEG capture, but missed setting a register when the CSIS device wasn't in use. Signed-off-by: Jonathan Bakker Reviewed-by: Sylwester Nawrocki --- drivers/media/platform/exynos4-is/fimc-reg.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/media/platform/exynos4-is/fimc-reg.c b/drivers/media/platform/exynos4-is/fimc-reg.c index 5ce2bdebd424..269a98fca1e8 100644 --- a/drivers/media/platform/exynos4-is/fimc-reg.c +++ b/drivers/media/platform/exynos4-is/fimc-reg.c @@ -606,6 +606,11 @@ int fimc_hw_set_camera_source(struct fimc_dev *fimc, switch (source->fimc_bus_type) { case FIMC_BUS_TYPE_ITU_601: case FIMC_BUS_TYPE_ITU_656: + if (fimc_fmt_is_user_defined(f->fmt->color)) { + cfg |= FIMC_REG_CISRCFMT_ITU601_8BIT; + break; + } + for (i = 0; i < ARRAY_SIZE(pix_desc); i++) { if (vc->ci_fmt.code == pix_desc[i].pixelcode) { cfg = pix_desc[i].cisrcfmt; @@ -707,6 +712,8 @@ int fimc_hw_set_camera_type(struct fimc_dev *fimc, case FIMC_BUS_TYPE_ITU_601...FIMC_BUS_TYPE_ITU_656: if (source->mux_id == 0) /* ITU-A, ITU-B: 0, 1 */ cfg |= FIMC_REG_CIGCTRL_SELCAM_ITU_A; + if (vid_cap->ci_fmt.code == MEDIA_BUS_FMT_JPEG_1X8) + cfg |= FIMC_REG_CIGCTRL_CAM_JPEG; break; case FIMC_BUS_TYPE_LCD_WRITEBACK_A: cfg |= FIMC_REG_CIGCTRL_CAMIF_SELWB; From patchwork Sun Apr 26 02:26:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Bakker X-Patchwork-Id: 11510125 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4396017EA for ; Sun, 26 Apr 2020 02:28:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 362F120724 for ; Sun, 26 Apr 2020 02:28:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726139AbgDZC2F (ORCPT ); Sat, 25 Apr 2020 22:28:05 -0400 Received: from mail-dm6nam11olkn2067.outbound.protection.outlook.com ([40.92.19.67]:15680 "EHLO NAM11-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726186AbgDZC1h (ORCPT ); Sat, 25 Apr 2020 22:27:37 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=axeoXTnJqCBEo4TmUfkEhwKdgec5U1MRwAlFt21Oh6u5Hns5T6W6cV2/xQ2ik2Z9o7L1RO7WDmMzeavta+lCZ/ikmIWpAU6rGqEcIYhJ69WRCLxvtAk37ilCVrxtYQADuap/UyYRocMYvGaJ+L/B4SbwGBEXaLgswefJ+qwcA1O0K36C0WYBwy+koiUVjkCWdsBqUi86sYP8zOwMErzJW0cwb5HWbtmtxm/dUX9gTsPnv28thOxg01b+XwQ2QwMFvpSwhYuHImxJrUGgMu7rp7IQvYcqU9rwr7p8trkCFKyUHxVjYh+tJl9pCnJ6hK/rgOvOVSvvIuKZS0YkUKtFPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=OWrUgCZ/HEFpv6SpAV0Wh+fxnUYTb8+u4Kdk3p6nBbs=; b=D6EdOYrY7Asscp3pcCwk7AQCoEQW94pWCM1L1zQxwJ7NcqDunDk3Aw5VN51z2fgKy2fcOi9TnVWO73zgj2GYjefpAcXSyj/qOhQ9gBabSjyUtISPoqYkv5+EEGCguckmeh00HvsEfjG2A259Ieiae2wWgfxPUwFxS+G5XKAtvccxWFh59h7VtbihJKjz9DstY0DEAWmB2KTvP9RFc6SqjiR2ekNq9FyPMuOHkstrNij1oheg0dIGW2xUjmYxH5pBo5Re4I6MTceO9uFl7esGh2R24b9My9MNGHv4xh/S4EzP/WRcsYuM6FC0EmWEopKeP01NjqSEIi+6uy0gCY02RQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=live.ca; dmarc=pass action=none header.from=live.ca; dkim=pass header.d=live.ca; arc=none Received: from DM6NAM11FT041.eop-nam11.prod.protection.outlook.com (2a01:111:e400:fc4d::51) by DM6NAM11HT151.eop-nam11.prod.protection.outlook.com (2a01:111:e400:fc4d::256) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.15; Sun, 26 Apr 2020 02:27:36 +0000 Received: from BN6PR04MB0660.namprd04.prod.outlook.com (2a01:111:e400:fc4d::4a) by DM6NAM11FT041.mail.protection.outlook.com (2a01:111:e400:fc4d::98) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.15 via Frontend Transport; Sun, 26 Apr 2020 02:27:36 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:77AAC2A11B984BCCA2B45863852769CF87DBC6623CDA8F98340850970B9ECFF2;UpperCasedChecksum:184ACF76DD85EF8AF484AABF6F748EB1BDB5080FAEEBF62DD1D087B8891CE458;SizeAsReceived:7875;Count:50 Received: from BN6PR04MB0660.namprd04.prod.outlook.com ([fe80::ad10:4127:4bc8:76fc]) by BN6PR04MB0660.namprd04.prod.outlook.com ([fe80::ad10:4127:4bc8:76fc%6]) with mapi id 15.20.2937.020; Sun, 26 Apr 2020 02:27:36 +0000 From: Jonathan Bakker To: kyungmin.park@samsung.com, s.nawrocki@samsung.com, mchehab@kernel.org, kgene@kernel.org, krzk@kernel.org, linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Jonathan Bakker Subject: [PATCH 07/11] media: exynos4-is: Add support for multiple sensors on one port Date: Sat, 25 Apr 2020 19:26:46 -0700 Message-ID: X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200426022650.10355-1-xc-racer2@live.ca> References: <20200426022650.10355-1-xc-racer2@live.ca> X-ClientProxiedBy: MWHPR17CA0086.namprd17.prod.outlook.com (2603:10b6:300:c2::24) To BN6PR04MB0660.namprd04.prod.outlook.com (2603:10b6:404:d9::21) X-Microsoft-Original-Message-ID: <20200426022650.10355-8-xc-racer2@live.ca> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from jon-hp-6570b.telus (2001:569:fb67:7300:9f89:4b96:de0b:cd14) by MWHPR17CA0086.namprd17.prod.outlook.com (2603:10b6:300:c2::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.13 via Frontend Transport; Sun, 26 Apr 2020 02:27:35 +0000 X-Mailer: git-send-email 2.20.1 X-Microsoft-Original-Message-ID: <20200426022650.10355-8-xc-racer2@live.ca> X-TMN: [miH5yeqLlI+WRBIESIzFByZYcL/hSNyoM+wsqWc+8Y8rCl0PKUKgO8x4d5gvMT04] X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 50 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: 32777673-8530-483d-f3f9-08d7e9896235 X-MS-TrafficTypeDiagnostic: DM6NAM11HT151: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: hTo1zXR/VH/vy1QJK9RAJT1ERdrFXDFNHzIyigAhdWSePF74W8BlfOHUhx94Xm4evv27jHI8HQ7pMXqB9jNVJ8ILpiuKpG+pUcb0Aj6I22EHGukJpA14Bh1BNYB76txAaKqTcUupG9d8lHHaPfCpeaU7hYFGV9TBWgeYfWAZfp/c3z2tZ/3ye7Ti1s+cHJYz7NhB14UhF6CaRDjMUdIPqg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:0;SRV:;IPV:NLI;SFV:NSPM;H:BN6PR04MB0660.namprd04.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:;DIR:OUT;SFP:1901; X-MS-Exchange-AntiSpam-MessageData: dG2g2LIxKVZa8/STSh2QO7LCoZfdwgASngEsAczxLbGnW9IIidMvxCTJY/ZqLtFTu5Y/15+JrDCiWn33DafTpnpSDDoREmydNtmTIxs947a2kYh004rdtJKSm0dgjnOz9MM2h4zGA3cO26ayRx85OZCW9dDeWZMByNuslOINeLsUFaTGZepSbzeN2yunZ3tGrlfr7g+o/SZ3zW9R7kwcpA== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 32777673-8530-483d-f3f9-08d7e9896235 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Apr 2020 02:27:36.7067 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6NAM11HT151 Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org On some devices, there may be multiple camera sensors attached to the same port. Make sure we probe all of them, not just the first one. Signed-off-by: Jonathan Bakker --- drivers/media/platform/exynos4-is/media-dev.c | 32 ++++++++++++------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/drivers/media/platform/exynos4-is/media-dev.c b/drivers/media/platform/exynos4-is/media-dev.c index b38445219c72..a87ebd7913be 100644 --- a/drivers/media/platform/exynos4-is/media-dev.c +++ b/drivers/media/platform/exynos4-is/media-dev.c @@ -397,25 +397,28 @@ static void fimc_md_pipelines_free(struct fimc_md *fmd) /* Parse port node and register as a sub-device any sensor specified there. */ static int fimc_md_parse_port_node(struct fimc_md *fmd, struct device_node *port, - unsigned int index) + unsigned int *index) { - struct fimc_source_info *pd = &fmd->sensor[index].pdata; + struct fimc_source_info *pd; struct device_node *rem, *ep, *np; - struct v4l2_fwnode_endpoint endpoint = { .bus_type = 0 }; + struct v4l2_fwnode_endpoint endpoint; int ret; - /* Assume here a port node can have only one endpoint node. */ ep = of_get_next_child(port, NULL); if (!ep) return 0; +parse_sensor: + pd = &fmd->sensor[*index].pdata; + endpoint.bus_type = 0; + ret = v4l2_fwnode_endpoint_parse(of_fwnode_handle(ep), &endpoint); if (ret) { of_node_put(ep); return ret; } - if (WARN_ON(endpoint.base.port == 0) || index >= FIMC_MAX_SENSORS) { + if (WARN_ON(endpoint.base.port == 0) || *index >= FIMC_MAX_SENSORS) { of_node_put(ep); return -EINVAL; } @@ -462,16 +465,16 @@ static int fimc_md_parse_port_node(struct fimc_md *fmd, pd->fimc_bus_type = pd->sensor_bus_type; of_node_put(np); - if (WARN_ON(index >= ARRAY_SIZE(fmd->sensor))) { + if (WARN_ON(*index >= ARRAY_SIZE(fmd->sensor))) { of_node_put(rem); return -EINVAL; } - fmd->sensor[index].asd.match_type = V4L2_ASYNC_MATCH_FWNODE; - fmd->sensor[index].asd.match.fwnode = of_fwnode_handle(rem); + fmd->sensor[*index].asd.match_type = V4L2_ASYNC_MATCH_FWNODE; + fmd->sensor[*index].asd.match.fwnode = of_fwnode_handle(rem); ret = v4l2_async_notifier_add_subdev(&fmd->subdev_notifier, - &fmd->sensor[index].asd); + &fmd->sensor[*index].asd); if (ret) { of_node_put(rem); return ret; @@ -479,6 +482,13 @@ static int fimc_md_parse_port_node(struct fimc_md *fmd, fmd->num_sensors++; + /* Check for additional sensors on same port */ + ep = of_get_next_child(port, ep); + if (ep) { + (*index)++; + goto parse_sensor; + } + return 0; } @@ -515,7 +525,7 @@ static int fimc_md_register_sensor_entities(struct fimc_md *fmd) if (!port) continue; - ret = fimc_md_parse_port_node(fmd, port, index); + ret = fimc_md_parse_port_node(fmd, port, &index); of_node_put(port); if (ret < 0) { of_node_put(node); @@ -530,7 +540,7 @@ static int fimc_md_register_sensor_entities(struct fimc_md *fmd) goto rpm_put; for_each_child_of_node(ports, node) { - ret = fimc_md_parse_port_node(fmd, node, index); + ret = fimc_md_parse_port_node(fmd, node, &index); if (ret < 0) { of_node_put(node); goto cleanup; From patchwork Sun Apr 26 02:26:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Bakker X-Patchwork-Id: 11510101 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 832311667 for ; Sun, 26 Apr 2020 02:27:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6E4F421707 for ; Sun, 26 Apr 2020 02:27:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726390AbgDZC1m (ORCPT ); Sat, 25 Apr 2020 22:27:42 -0400 Received: from mail-dm6nam11olkn2045.outbound.protection.outlook.com ([40.92.19.45]:14496 "EHLO NAM11-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726374AbgDZC1k (ORCPT ); Sat, 25 Apr 2020 22:27:40 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RGk0v/MSdl+ay/dJntrpSPMryP/VNJG5/5mydAhLwrei9d6q0G+bUFBaABjAXoeEhYyWNNKanv0alviPtvSv2sB1Kyft0L4uecTfHU+hICTlGTnUBOGy7CGfq11OsYYsDtMCyX45K2Vn1QTd2sOyu5FQQ88i8oq0wlzGZMxSPtb5VxWOl08QJRiASfL9deey+0jKlffO6Rcx0MPISgXQMLwQSfafG2z+Hehr82bshS0cr+6E5p7u7nkOct8cCaQETxNTdVNvq1Boa93UXhqVZBFjUyDy3UyIWhgS6KORYPoAjONbk1ocNspUHf72e5el1abwzVNrmYyHJqlD3QaEdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=STt9G9aXx2m0k28msa6mYVM4b3mtzWZVd+uMZo07GW0=; b=U2K0/7ItzMucNEm1sXZNlZ1S1TEIwixGsNgF2Oufotpyhvr/8mKvb/abQ6MkAY7dNtLgpwUj30jXO5rVcbXyUF8w6+0gmEImnVcCTfrrV1nGVe/zPWlb62Fzmym3ZzGmtQYYj6rAi5WOpjDFewnN3Tuko+Wl1odcZQndxw3pfDi8PEDnjQCzzStHzTg12z7vo5pyI7Yqz2rfCmMbd3FAEJmPHfyV7bJxlg/qMpIEGidP2HO3U6EZpTsdFRvpl1xjeK2SNlFNRS1B8f6F/IQ/9tXKcvJh4j+CadhqR4KDB4UCOZoCtykdaO7Up/O+sic9Gs865F43XqzYNVRlYy2YVQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=live.ca; dmarc=pass action=none header.from=live.ca; dkim=pass header.d=live.ca; arc=none Received: from DM6NAM11FT041.eop-nam11.prod.protection.outlook.com (2a01:111:e400:fc4d::51) by DM6NAM11HT151.eop-nam11.prod.protection.outlook.com (2a01:111:e400:fc4d::256) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.15; Sun, 26 Apr 2020 02:27:39 +0000 Received: from BN6PR04MB0660.namprd04.prod.outlook.com (2a01:111:e400:fc4d::4a) by DM6NAM11FT041.mail.protection.outlook.com (2a01:111:e400:fc4d::98) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.15 via Frontend Transport; Sun, 26 Apr 2020 02:27:39 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:4FD81664749873874A955408E98F71844CD3138907C587078C21BC0CFAC8A793;UpperCasedChecksum:C7C7C8FC91D6C4604FFEE68296F27E0B9564CADC161B338CD800998F240F5B67;SizeAsReceived:7854;Count:50 Received: from BN6PR04MB0660.namprd04.prod.outlook.com ([fe80::ad10:4127:4bc8:76fc]) by BN6PR04MB0660.namprd04.prod.outlook.com ([fe80::ad10:4127:4bc8:76fc%6]) with mapi id 15.20.2937.020; Sun, 26 Apr 2020 02:27:38 +0000 From: Jonathan Bakker To: kyungmin.park@samsung.com, s.nawrocki@samsung.com, mchehab@kernel.org, kgene@kernel.org, krzk@kernel.org, linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Jonathan Bakker Subject: [PATCH 08/11] media: exynos4-is: Remove inh_sensor_ctrls Date: Sat, 25 Apr 2020 19:26:47 -0700 Message-ID: X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200426022650.10355-1-xc-racer2@live.ca> References: <20200426022650.10355-1-xc-racer2@live.ca> X-ClientProxiedBy: MWHPR17CA0086.namprd17.prod.outlook.com (2603:10b6:300:c2::24) To BN6PR04MB0660.namprd04.prod.outlook.com (2603:10b6:404:d9::21) X-Microsoft-Original-Message-ID: <20200426022650.10355-9-xc-racer2@live.ca> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from jon-hp-6570b.telus (2001:569:fb67:7300:9f89:4b96:de0b:cd14) by MWHPR17CA0086.namprd17.prod.outlook.com (2603:10b6:300:c2::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.13 via Frontend Transport; Sun, 26 Apr 2020 02:27:37 +0000 X-Mailer: git-send-email 2.20.1 X-Microsoft-Original-Message-ID: <20200426022650.10355-9-xc-racer2@live.ca> X-TMN: [afuhOH3yom0Mw3XhZEdhfLxKcXpi3s3HXLbveEKm2HRI/3tsD1YeFIPqARqgmx+5] X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 50 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: d4528481-3f05-4eea-e604-08d7e9896388 X-MS-TrafficTypeDiagnostic: DM6NAM11HT151: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 3QCJFZUQmBIndamlQZaN2HTn/K/NXESa4qSMm1qKSXUXQ6X2eBIrg6BMc+Q6JP1HI4bMeacNy7LbbJaKiLRIMS8K/SQTeRhoj9GhJcfNRP7UgAtQUXuoXDqKdYHR8i+paUW3I31gsvoDUOEulaK7+/Dwoum783/m0s6YE8uDsIE0TRfSq3o8/FPp3UUTz/pQgfdl9tLSY3ZFfd2Ebf/vgg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:0;SRV:;IPV:NLI;SFV:NSPM;H:BN6PR04MB0660.namprd04.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:;DIR:OUT;SFP:1901; X-MS-Exchange-AntiSpam-MessageData: +x/jkFwOmjSGlPmyxqc0XF981y4iZMwTv/xzZunV/CB+9i6xothNsLsbOTVObFQNUFK23G9Yd0AR18fWSpNIb0w6vhSHQLIdyv9YAVOkeDlhp4ph7iFvQY8PGKS5TywcaE8KlnKKQaYTGME9qbUdgaPOQY7FCDDVXezhRdibnYIsBjDk9nP5LaRosLcS91dpSAszSclGLOfKexZlmJo0rg== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: d4528481-3f05-4eea-e604-08d7e9896388 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Apr 2020 02:27:38.9111 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6NAM11HT151 Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org This is a no-op as it is never set and is a remnant from non-DT days that can be safely removed. Signed-off-by: Jonathan Bakker Reviewed-by: Tomasz Figa Reviewed-by: Sylwester Nawrocki --- drivers/media/platform/exynos4-is/fimc-capture.c | 13 +------------ drivers/media/platform/exynos4-is/fimc-core.h | 3 --- 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/drivers/media/platform/exynos4-is/fimc-capture.c b/drivers/media/platform/exynos4-is/fimc-capture.c index 86c233e2f2c9..95d4a667bffb 100644 --- a/drivers/media/platform/exynos4-is/fimc-capture.c +++ b/drivers/media/platform/exynos4-is/fimc-capture.c @@ -492,17 +492,6 @@ static int fimc_capture_open(struct file *file) ret = fimc_pipeline_call(ve, open, &ve->vdev.entity, true); - if (ret == 0 && vc->user_subdev_api && vc->inh_sensor_ctrls) { - /* - * Recreate controls of the the video node to drop - * any controls inherited from the sensor subdev. - */ - fimc_ctrls_delete(vc->ctx); - - ret = fimc_ctrls_create(vc->ctx); - if (ret == 0) - vc->inh_sensor_ctrls = false; - } if (ret == 0) ve->vdev.entity.use_count++; @@ -1408,7 +1397,7 @@ static int fimc_link_setup(struct media_entity *entity, vc->input = sd->grp_id; - if (vc->user_subdev_api || vc->inh_sensor_ctrls) + if (vc->user_subdev_api) return 0; /* Inherit V4L2 controls from the image sensor subdev. */ diff --git a/drivers/media/platform/exynos4-is/fimc-core.h b/drivers/media/platform/exynos4-is/fimc-core.h index d130f664a60b..31f81bcb8483 100644 --- a/drivers/media/platform/exynos4-is/fimc-core.h +++ b/drivers/media/platform/exynos4-is/fimc-core.h @@ -299,8 +299,6 @@ struct fimc_m2m_device { * @input_index: input (camera sensor) index * @input: capture input type, grp_id of the attached subdev * @user_subdev_api: true if subdevs are not configured by the host driver - * @inh_sensor_ctrls: a flag indicating v4l2 controls are inherited from - * an image sensor subdev */ struct fimc_vid_cap { struct fimc_ctx *ctx; @@ -322,7 +320,6 @@ struct fimc_vid_cap { int input_index; u32 input; bool user_subdev_api; - bool inh_sensor_ctrls; }; /** From patchwork Sun Apr 26 02:26:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Bakker X-Patchwork-Id: 11510113 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 764A917EA for ; Sun, 26 Apr 2020 02:27:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 68C8F2078E for ; Sun, 26 Apr 2020 02:27:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726445AbgDZC16 (ORCPT ); Sat, 25 Apr 2020 22:27:58 -0400 Received: from mail-dm6nam11olkn2060.outbound.protection.outlook.com ([40.92.19.60]:61408 "EHLO NAM11-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726384AbgDZC1n (ORCPT ); Sat, 25 Apr 2020 22:27:43 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DnyE5OEa2o2IsX3caMVKGKHx8Q35P9pdZtocUlsce85/0o6RxHMNXfWypSqWMR3joc+Wwlcl0FOx8dCgmooNwEYqxAljCkvwmpRtiQnlVApR44xM/ZIZBVGjeVbn4IPYMVRVXB1TUiHFyGyBj7jhkmwP7CgGJqbSMSA6VGG67rDm7D+7LdswiWX1HgZueplLIyoOr/lff2RAVkAmEEmPl8b/5uWY8dgcQSjMEZj18lELkAN2icROlFLDTsN5qEbiltgSk8dyaaFTwQoKdXBSAVio/27aCSdPdPyjYR+Unkbe/viF2D3I1VHXNXWvYRfzwo9j+/nT245beWtCdQbx1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=iprQQdz+psQamFkQQrl+dOwSlPAsEpGAalGcxR2NGF0=; b=RnFvdwLt+nNcLhZSDHgKh1j/yCg35qd9YyoOMjfdKak641KqJy8hlTaTv62PsKKx/AM/QCcNDwwtpYZaygiy5XMgUsQRLdH3JwaN+nd9Qx5cR6NFJVr0GTUlXjoDWwYE/+traY87qjcu6UC/CcRQMBk1/JyE8fSMAvZYc0T/EGzbrG3uC9ywfM3tu0msHWDbx5RTeIzVeHqYBEXoIOkljxhk3LDTnfTUQUJ4aGLc1l5e/IxeYNfhUdLSlOp4QTmUK6ClqsgncghuM2jKruJNBQohMUh6JrBsn1B/fu1FMSwrnmfhtM2MCWwizUJ0Y83Lk5hwCCOg0zytXxLYBle6NQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=live.ca; dmarc=pass action=none header.from=live.ca; dkim=pass header.d=live.ca; arc=none Received: from DM6NAM11FT041.eop-nam11.prod.protection.outlook.com (2a01:111:e400:fc4d::47) by DM6NAM11HT190.eop-nam11.prod.protection.outlook.com (2a01:111:e400:fc4d::182) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.15; Sun, 26 Apr 2020 02:27:41 +0000 Received: from BN6PR04MB0660.namprd04.prod.outlook.com (2a01:111:e400:fc4d::4a) by DM6NAM11FT041.mail.protection.outlook.com (2a01:111:e400:fc4d::98) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.15 via Frontend Transport; Sun, 26 Apr 2020 02:27:41 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:57D8C8884E97E8FE8297DBF0D73B69E6002A00C14852BA063C16024718656113;UpperCasedChecksum:51447C4D015754B58BDAB4BEEEE3AB8D9383D5D7B8B42C43C02529953DAB7A07;SizeAsReceived:7872;Count:50 Received: from BN6PR04MB0660.namprd04.prod.outlook.com ([fe80::ad10:4127:4bc8:76fc]) by BN6PR04MB0660.namprd04.prod.outlook.com ([fe80::ad10:4127:4bc8:76fc%6]) with mapi id 15.20.2937.020; Sun, 26 Apr 2020 02:27:41 +0000 From: Jonathan Bakker To: kyungmin.park@samsung.com, s.nawrocki@samsung.com, mchehab@kernel.org, kgene@kernel.org, krzk@kernel.org, linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Jonathan Bakker Subject: [PATCH 09/11] media: exynos4-is: Remove unused struct member input_index Date: Sat, 25 Apr 2020 19:26:48 -0700 Message-ID: X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200426022650.10355-1-xc-racer2@live.ca> References: <20200426022650.10355-1-xc-racer2@live.ca> X-ClientProxiedBy: MWHPR17CA0086.namprd17.prod.outlook.com (2603:10b6:300:c2::24) To BN6PR04MB0660.namprd04.prod.outlook.com (2603:10b6:404:d9::21) X-Microsoft-Original-Message-ID: <20200426022650.10355-10-xc-racer2@live.ca> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from jon-hp-6570b.telus (2001:569:fb67:7300:9f89:4b96:de0b:cd14) by MWHPR17CA0086.namprd17.prod.outlook.com (2603:10b6:300:c2::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.13 via Frontend Transport; Sun, 26 Apr 2020 02:27:39 +0000 X-Mailer: git-send-email 2.20.1 X-Microsoft-Original-Message-ID: <20200426022650.10355-10-xc-racer2@live.ca> X-TMN: [Yb/+40pJkmK9k6MFb5LIWqyQPzAiG99ExrCIB5cRWplWefTrxcoOl01aliaXnh1/] X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 50 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: 421b692f-a82c-481b-5a17-08d7e98964df X-MS-TrafficTypeDiagnostic: DM6NAM11HT190: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: fmUhbSNWniBEZd5Ie92EGI9/1wtpHUGlaIN83wEq8XzxhGp8N/CRP2FqNV5/tGyPjbrzLQKCjuE9iLlxotSO/4iW9ds4rY10VJ0l4paW19DBFXvuOwz3OXPLd0qs5TqnYWv4alM8lAKYLbKBLkY6/pcyEj+g+OO+sLzMJVGUHGIfqViTmGuoiqnWwygXG6h16poyFsC/+z/i18sCrt2JEw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:0;SRV:;IPV:NLI;SFV:NSPM;H:BN6PR04MB0660.namprd04.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:;DIR:OUT;SFP:1901; X-MS-Exchange-AntiSpam-MessageData: pIezLZspUIKRD0NMKnN1MrQhJk52JnKPKBOlMCkNpwcWm4XHdxfI+FlPBIeOBmKeuzooIgJXbAE9nxP/6EvA6S8YIurXKL4h/v3jgmG0y3Q1/A9MG7YbKTO3RZGdfXDPNBefR/KHnc2j5lQMJBCPf/kunKlxS/eGLsCbJ2tXK/iJTE0e+gX6IkLQMcYG4J2h4PDwMlJJTVIT4XC4okMmag== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 421b692f-a82c-481b-5a17-08d7e98964df X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Apr 2020 02:27:41.2563 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6NAM11HT190 Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org This is no longer used since the conversion to DT Signed-off-by: Jonathan Bakker Reviewed-by: Tomasz Figa Reviewed-by: Sylwester Nawrocki --- drivers/media/platform/exynos4-is/fimc-core.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/media/platform/exynos4-is/fimc-core.h b/drivers/media/platform/exynos4-is/fimc-core.h index 31f81bcb8483..e4a56232907a 100644 --- a/drivers/media/platform/exynos4-is/fimc-core.h +++ b/drivers/media/platform/exynos4-is/fimc-core.h @@ -296,7 +296,6 @@ struct fimc_m2m_device { * @buf_index: index for managing the output DMA buffers * @frame_count: the frame counter for statistics * @reqbufs_count: the number of buffers requested in REQBUFS ioctl - * @input_index: input (camera sensor) index * @input: capture input type, grp_id of the attached subdev * @user_subdev_api: true if subdevs are not configured by the host driver */ @@ -317,7 +316,6 @@ struct fimc_vid_cap { unsigned int frame_count; unsigned int reqbufs_count; bool streaming; - int input_index; u32 input; bool user_subdev_api; }; From patchwork Sun Apr 26 02:26:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Bakker X-Patchwork-Id: 11510103 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 04FC692A for ; Sun, 26 Apr 2020 02:27:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E7C3620706 for ; Sun, 26 Apr 2020 02:27:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726418AbgDZC1s (ORCPT ); Sat, 25 Apr 2020 22:27:48 -0400 Received: from mail-dm6nam11olkn2103.outbound.protection.outlook.com ([40.92.19.103]:15351 "EHLO NAM11-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726404AbgDZC1p (ORCPT ); Sat, 25 Apr 2020 22:27:45 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hhk40PPRxwCRpRKLTEsCQYI3fS8JwDTJ0ratvEBK35GyKzWzBPhSvqwT6i8iA+jxAhQeLSJpvuTA4knbbnMDUhatYteggh6KZ/G1ra8/2h/b3EMdI5wSrzu3mZTVyCwuniIfZ8Nr6Ar6Fu1nfcKNB79pFP/sCiytWSN/g9tUogfr3CQRJuCVnKvoBpThYobnGzl49Kliy+HzCOGQ6lUOFkrBLHnIZ34U/d8wGPltcLxBah0TptIRzMDunHcRtIoasy3TVJr5o5bVVcyr800IKJ3aBKFJuV2S15HQCLhBJGpj6NCxgFUgV3USMLQqD0mod/lTrg2R+bwaYB6TAT8YKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=9nr0yCJ5s8PKdUrtGRarxzpQ0RBEjeAqGUYmeuB6X6g=; b=gXeiiOlPr5JN4nM6cQnZ9rWDUsiLM9emLbMW7cAgZEK4I5qEvMP5tVs+7lei8h10WzdeHSvrlLg3dgcMtk4BjzgMbzvnnW7K0nBPAkCIK856FuXVNBB91pms8r9mfzEAlnPxT77bih7JYA9TN6XHcz40MMrRCPj757zZev5Yps4Z+s+Nasf63GjyPajZvhOs2EzgdKutPH+Y/ZZSCb5cDq9SGsCLV0rLqu5mw7zqMFN0VR12v2xRDY71c64PUShUfOQ3dIMhtMPH5Z9rVB6F8UplCMFyqiZu2X5aPGFav9Itr8prPCgaHzygaYHEnUCYNxuUT/rON26zwrCAGbtUAw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=live.ca; dmarc=pass action=none header.from=live.ca; dkim=pass header.d=live.ca; arc=none Received: from DM6NAM11FT041.eop-nam11.prod.protection.outlook.com (2a01:111:e400:fc4d::4e) by DM6NAM11HT143.eop-nam11.prod.protection.outlook.com (2a01:111:e400:fc4d::231) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.15; Sun, 26 Apr 2020 02:27:43 +0000 Received: from BN6PR04MB0660.namprd04.prod.outlook.com (2a01:111:e400:fc4d::4a) by DM6NAM11FT041.mail.protection.outlook.com (2a01:111:e400:fc4d::98) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.15 via Frontend Transport; Sun, 26 Apr 2020 02:27:43 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:F4926194AC0F5140EA3AF986850745AF19401D6ECC73722FE9F5D8CEC73031A3;UpperCasedChecksum:12D7E4F828CE42369D993E499FF97492A61B2061C92B5F7EFA13F74EBC781750;SizeAsReceived:7891;Count:50 Received: from BN6PR04MB0660.namprd04.prod.outlook.com ([fe80::ad10:4127:4bc8:76fc]) by BN6PR04MB0660.namprd04.prod.outlook.com ([fe80::ad10:4127:4bc8:76fc%6]) with mapi id 15.20.2937.020; Sun, 26 Apr 2020 02:27:43 +0000 From: Jonathan Bakker To: kyungmin.park@samsung.com, s.nawrocki@samsung.com, mchehab@kernel.org, kgene@kernel.org, krzk@kernel.org, linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Jonathan Bakker Subject: [PATCH 10/11] media: exynos4-is: Prevent duplicate call to media_pipeline_stop Date: Sat, 25 Apr 2020 19:26:49 -0700 Message-ID: X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200426022650.10355-1-xc-racer2@live.ca> References: <20200426022650.10355-1-xc-racer2@live.ca> X-ClientProxiedBy: MWHPR17CA0086.namprd17.prod.outlook.com (2603:10b6:300:c2::24) To BN6PR04MB0660.namprd04.prod.outlook.com (2603:10b6:404:d9::21) X-Microsoft-Original-Message-ID: <20200426022650.10355-11-xc-racer2@live.ca> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from jon-hp-6570b.telus (2001:569:fb67:7300:9f89:4b96:de0b:cd14) by MWHPR17CA0086.namprd17.prod.outlook.com (2603:10b6:300:c2::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.13 via Frontend Transport; Sun, 26 Apr 2020 02:27:42 +0000 X-Mailer: git-send-email 2.20.1 X-Microsoft-Original-Message-ID: <20200426022650.10355-11-xc-racer2@live.ca> X-TMN: [s+Hv9NB/YytGgC0xxJLCrVAuLRAM6TYQPUGQoDmwjx0kBS1VbMVwJxCAjn8aHqP0] X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 50 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: 4e3c2e7b-9acf-4154-95a1-08d7e9896646 X-MS-TrafficTypeDiagnostic: DM6NAM11HT143: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: iPf9Qg6TqPRtfkhYpIK/IYWhVwDXrxtl0qRj6bTtSMslDHBYZxfHx9z0g8JtOAjm9B/vwSMweWkH7TK8RX3KZep4Qur3fvgd+EQ7JEgM7LnfTnPsme/L6Lrdd3isueyFCqyfFqGJ3RpJJWJlKJlF8BGMvIu0pTYy9Nhr1jfjaXBbBoGcwoFRe5veB5KSapteiI5rsAlM0TMvTwAfMcMP7w== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:0;SRV:;IPV:NLI;SFV:NSPM;H:BN6PR04MB0660.namprd04.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:;DIR:OUT;SFP:1901; X-MS-Exchange-AntiSpam-MessageData: 3xvJxb/5qiUJCaOrkBXeuQVxfs7yoocYiQpF+lyW2JFan4UAS02cO3hdr5d523OXYq85mOTJGrliCKOTV88vIHYZm79M4vg8Q4AEMMWZXz1FLv41zna0Fh4w60TWWRr3USruJeiQjPEm/veyJ6nNO65D4WemS+GMDOGW0fCfr9ZfbmUrJMK2h3sRaOFaFrEpxFvSHXlDYKUCLOLdM7R95g== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4e3c2e7b-9acf-4154-95a1-08d7e9896646 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Apr 2020 02:27:43.6076 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6NAM11HT143 Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org media_pipeline_stop can be called from both release and streamoff, so make sure they're both protected under the streaming flag and not just one of them. This probably became noticeable after commit 2a2599c66368 ("[media] media: entity: Catch unbalanced media_pipeline_stop calls") was merged as it added a WARN. Signed-off-by: Jonathan Bakker --- drivers/media/platform/exynos4-is/fimc-capture.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/exynos4-is/fimc-capture.c b/drivers/media/platform/exynos4-is/fimc-capture.c index 95d4a667bffb..d3ef1268da07 100644 --- a/drivers/media/platform/exynos4-is/fimc-capture.c +++ b/drivers/media/platform/exynos4-is/fimc-capture.c @@ -1232,8 +1232,11 @@ static int fimc_cap_streamoff(struct file *file, void *priv, if (ret < 0) return ret; - media_pipeline_stop(&vc->ve.vdev.entity); - vc->streaming = false; + if (vc->streaming) { + media_pipeline_stop(&vc->ve.vdev.entity); + vc->streaming = false; + } + return 0; } From patchwork Sun Apr 26 02:26:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Bakker X-Patchwork-Id: 11510107 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 324B21667 for ; Sun, 26 Apr 2020 02:27:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 24B8B20724 for ; Sun, 26 Apr 2020 02:27:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726425AbgDZC1u (ORCPT ); Sat, 25 Apr 2020 22:27:50 -0400 Received: from mail-bn8nam11olkn2065.outbound.protection.outlook.com ([40.92.20.65]:18845 "EHLO NAM11-BN8-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726414AbgDZC1s (ORCPT ); Sat, 25 Apr 2020 22:27:48 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ccp7Y2n/+SP9GIHpxnufbyN5KVUfXAd/Woo71dfp6oFOmGuU2YP7EIFc16agF2Le3IGpJWaAI8pY8xx6JbEecsxUCEQ/pKL/H9SrTzQ+LsrycFHNWBHmiea6VcgpjE5QJcYcyszxN+7d1V5XevWYQXoh/5r1KJ5npnAMQX5vBW3sNs5EAQVTOwqSNbRJm3JJPvdN9MCo+lU9wknkBY1ofJHEokFdmoK9PZ7ykNluXtoXox7MP4ycD4uqX83+ZaLmNp65wPjseR3s8whpnv6k356RSyg1DJLTuyhQNgoJI55POfLrCZSOyIjh756mKc25Q9iN+zF7R125c4/x96k/1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=cqQmCHp8k6z6Z5zFHbV69ZkLYMboQr1394DjLen2RrA=; b=epCcOwYBE2QLeyrjXuugNjCfuXFgOPxgpmAR6hvNjQLnIy8msyiAVHczZEYr8tU710heKWgjTKb2xeU3qCYTiWuZRHgiNp1sRrgK3sUjLEn5A5qwiTuFtm0v6BFmwEo/z6Y/zCtDh6ti6ZXKJ4TFXU5+jtZ3pspEuKye1xkLyX9m1Sje4INXbSHFRmuUY1J3O1U1kxa9jtMcp2J+ah/edR7+2JFU1uHHOkVekW2r8+Wcx7ado0TQx4b9wi2bgrIPijg3NqCF+kPu+oDTV9Dz1f+G2pJnsicsVl6PnAZMvLwIvDR8qNOH0jzp7BU9crRdn6E2/6t7o5k7OOoQnE+Aow== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=live.ca; dmarc=pass action=none header.from=live.ca; dkim=pass header.d=live.ca; arc=none Received: from DM6NAM11FT041.eop-nam11.prod.protection.outlook.com (2a01:111:e400:fc4d::46) by DM6NAM11HT124.eop-nam11.prod.protection.outlook.com (2a01:111:e400:fc4d::163) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.15; Sun, 26 Apr 2020 02:27:46 +0000 Received: from BN6PR04MB0660.namprd04.prod.outlook.com (2a01:111:e400:fc4d::4a) by DM6NAM11FT041.mail.protection.outlook.com (2a01:111:e400:fc4d::98) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.15 via Frontend Transport; Sun, 26 Apr 2020 02:27:46 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:9F16B53EB530B8F4AA21623F91F5805BC2154B56769B8FB9CC1E1BF60C9317A7;UpperCasedChecksum:C456189A47C3FF523D42548E67DD9EB00660FD6F0ADABC04B777C32F03677050;SizeAsReceived:7871;Count:50 Received: from BN6PR04MB0660.namprd04.prod.outlook.com ([fe80::ad10:4127:4bc8:76fc]) by BN6PR04MB0660.namprd04.prod.outlook.com ([fe80::ad10:4127:4bc8:76fc%6]) with mapi id 15.20.2937.020; Sun, 26 Apr 2020 02:27:46 +0000 From: Jonathan Bakker To: kyungmin.park@samsung.com, s.nawrocki@samsung.com, mchehab@kernel.org, kgene@kernel.org, krzk@kernel.org, linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Jonathan Bakker Subject: [PATCH 11/11] media: exynos4-is: Correct parallel port probing Date: Sat, 25 Apr 2020 19:26:50 -0700 Message-ID: X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200426022650.10355-1-xc-racer2@live.ca> References: <20200426022650.10355-1-xc-racer2@live.ca> X-ClientProxiedBy: MWHPR17CA0086.namprd17.prod.outlook.com (2603:10b6:300:c2::24) To BN6PR04MB0660.namprd04.prod.outlook.com (2603:10b6:404:d9::21) X-Microsoft-Original-Message-ID: <20200426022650.10355-12-xc-racer2@live.ca> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from jon-hp-6570b.telus (2001:569:fb67:7300:9f89:4b96:de0b:cd14) by MWHPR17CA0086.namprd17.prod.outlook.com (2603:10b6:300:c2::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.13 via Frontend Transport; Sun, 26 Apr 2020 02:27:44 +0000 X-Mailer: git-send-email 2.20.1 X-Microsoft-Original-Message-ID: <20200426022650.10355-12-xc-racer2@live.ca> X-TMN: [d1pbhGcOX0gErHKuF4yTox57by75oumk2nYR0eEHvuS91abl/QNQEoAZxJTXWQ/5] X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 50 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: 8f027384-48d8-411e-38ce-08d7e989680e X-MS-TrafficTypeDiagnostic: DM6NAM11HT124: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Ke1eKLhxxd7nN15m+8rV5oTdyjVLgTmJuKevL/xvPO7La8WycAijYJCZpMXTKAkY6abicD7bQeXVKypLtZAZwhI1g0hy0KEIzPq08PR7c3gyJGvimZjeOKv8Axz9tpwmZj3Pd9AmR8qoKWL9gsnAYgn2i2V7AdCb+I6xaFuWQHZaHNaB5FlO/66oUaclnDzRxNJHxJzpZmAns4LtFq/Kyg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:0;SRV:;IPV:NLI;SFV:NSPM;H:BN6PR04MB0660.namprd04.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:;DIR:OUT;SFP:1901; X-MS-Exchange-AntiSpam-MessageData: KLssGpEm1qIWktO2zFfir+nGfT9NBXzoVOoyjMKwP3PjKnpNO5juZoh1Ax7GNaFE7IR2H+tqND61/S+8nWMs4pLMwwWJFDK7JWa/gyn/pnjZ05sdfJENOaIpTJdpKwRm9/J2fVZ2UetjSHhZfsI+0/uqHg1paeR0ar9AgBQUX33rUexwfm6uf6pyYr/AhcBXlzk9L7fX3ppdrr53b+xC9w== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8f027384-48d8-411e-38ce-08d7e989680e X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Apr 2020 02:27:46.5207 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6NAM11HT124 Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org According to the binding doc[1], port A should be reg = 0 and port B reg = 1. Unfortunately, the driver was treating 0 as invalid and 1 as camera port A. Match the binding doc and make 0=A and 1=B. [1] Documentation/devicetree/bindings/media/samsung-fimc.txt Signed-off-by: Jonathan Bakker --- drivers/media/platform/exynos4-is/media-dev.c | 18 +++++++++++++----- drivers/media/platform/exynos4-is/media-dev.h | 1 + include/media/drv-intf/exynos-fimc.h | 2 +- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/drivers/media/platform/exynos4-is/media-dev.c b/drivers/media/platform/exynos4-is/media-dev.c index a87ebd7913be..9c4fdf726b92 100644 --- a/drivers/media/platform/exynos4-is/media-dev.c +++ b/drivers/media/platform/exynos4-is/media-dev.c @@ -418,13 +418,21 @@ static int fimc_md_parse_port_node(struct fimc_md *fmd, return ret; } - if (WARN_ON(endpoint.base.port == 0) || *index >= FIMC_MAX_SENSORS) { - of_node_put(ep); - return -EINVAL; + if (fimc_input_is_parallel(endpoint.base.port)) { + if (WARN_ON(*index >= FIMC_MAX_PARALLEL)) { + of_node_put(ep); + return -EINVAL; + } + pd->mux_id = endpoint.base.port; + } else { + if (WARN_ON(endpoint.base.port == 0 || + *index >= FIMC_MAX_SENSORS)) { + of_node_put(ep); + return -EINVAL; + } + pd->mux_id = (endpoint.base.port - 1) & 0x1; } - pd->mux_id = (endpoint.base.port - 1) & 0x1; - rem = of_graph_get_remote_port_parent(ep); of_node_put(ep); if (rem == NULL) { diff --git a/drivers/media/platform/exynos4-is/media-dev.h b/drivers/media/platform/exynos4-is/media-dev.h index 4b8f9ac52ebc..7bd93fd11b33 100644 --- a/drivers/media/platform/exynos4-is/media-dev.h +++ b/drivers/media/platform/exynos4-is/media-dev.h @@ -29,6 +29,7 @@ #define PINCTRL_STATE_IDLE "idle" +#define FIMC_MAX_PARALLEL 2 #define FIMC_MAX_SENSORS 4 #define FIMC_MAX_CAMCLKS 2 #define DEFAULT_SENSOR_CLK_FREQ 24000000U diff --git a/include/media/drv-intf/exynos-fimc.h b/include/media/drv-intf/exynos-fimc.h index 6b9ef631d6bb..5a07576c378b 100644 --- a/include/media/drv-intf/exynos-fimc.h +++ b/include/media/drv-intf/exynos-fimc.h @@ -44,7 +44,7 @@ enum fimc_bus_type { FIMC_BUS_TYPE_ISP_WRITEBACK = FIMC_BUS_TYPE_LCD_WRITEBACK_B, }; -#define fimc_input_is_parallel(x) ((x) == 1 || (x) == 2) +#define fimc_input_is_parallel(x) ((x) == 0 || (x) == 1) #define fimc_input_is_mipi_csi(x) ((x) == 3 || (x) == 4) /*