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: 213434 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.5 required=3.0 tests=FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 84577C55185 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 6731920706 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: 213430 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.5 required=3.0 tests=FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CFD07C55196 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 B95012072B 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: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: 213431 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.5 required=3.0 tests=FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 30E70C55186 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 1A6E12072B for ; Sun, 26 Apr 2020 02:28:05 +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: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: 213433 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.5 required=3.0 tests=FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 88372C55185 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 6D7EA2098B 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 --- 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: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: 213432 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.5 required=3.0 tests=FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 39959C55185 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 2455920706 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) /*