Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 50BE8C433F5 for ; Mon, 7 Mar 2022 10:33:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Content-ID:In-Reply-To: References:Message-ID:Date:Subject:To:From:Reply-To:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=umbLJNEDoXFlWS1ZutJ4oxxYKuZja29bX1R6kQvtJAw=; b=HiUQXm6jaUtN81 O/5em0aYK8PSoStLfDdGtf2fiPNUrfVsYWkqw3AyLV0Y0O5TAn7TwRli7P7D8ULEzF9McDTYWhEPl JRGFFHo7ecdWQsuFQ/Hqvlz7R7vTbM/lReAOAPT6SK/yvJrfFsDumMTLvfuwZ7rPsLy0x713fymvd jXrrdWpcoJeZaaEVOQAPz/A8Dwu3CRByX8RGEqeBCRqVf7n4ge9gyBH/vDUB/mk9H3VVFjSU2IdS+ vfPaM7tqBEGfkdgKj0eoXPLg8DjCpO14elGoHTPVskhbfuX1ICTEqnOKhM+oPYLeFS2WK4uwKg3nC KRSkzDlxJa8FFyb1hwQQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nRAez-00H8XP-W3; Mon, 07 Mar 2022 10:32:14 +0000 Received: from esa.microchip.iphmx.com ([68.232.154.123]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nRAes-00H8VT-5J for linux-arm-kernel@lists.infradead.org; Mon, 07 Mar 2022 10:32:11 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1646649127; x=1678185127; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-id:content-transfer-encoding: mime-version; bh=HwbRppKur/XKndup8VsjhWmnMHZBB9VjquQsdF2H0sI=; b=zGsvTfghaY+eqZP+RqgPsQ1xKL/w9NmOiLKzPa0VhoeRdcrN4aVGhxEV Txq0kzVxBO4+FZRniuo7X+T4aQ3zBms8KknOOf3n8I0LqCK9Xing1yMU0 xP44rHmD4a8ADZhakrIbLZN6aza45ql8U19Y3jKWHmQJgNie8+Yl1DP2k 0MJYSV0Xj5A53VBrmQhIftiDQl97OXaCy0iECJFis52kSqljxWzSA+huD EyK8xH7e4K5VVXFNiptLT2I/qOxd/yckV8RsBzCcGadRN9A05XBGQQLFt vue3QtNln86hlUgJlT2JLYxWSzW9eGx7VpAeDkRhRCuOqXpuLrQWNPEnx Q==; X-IronPort-AV: E=Sophos;i="5.90,161,1643698800"; d="scan'208";a="148312684" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa4.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 07 Mar 2022 03:32:05 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.85.144) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.17; Mon, 7 Mar 2022 03:32:03 -0700 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (10.10.215.89) by email.microchip.com (10.10.87.72) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.17 via Frontend Transport; Mon, 7 Mar 2022 03:32:03 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=D/XURHTNjHqW7B64R1/6SM684aXO0kge7UqflirNK+jfUmdtX+BCfDCFCqKkol19NOYk62RkyMYq7xo1Vr1TX3wB/Q3pPmmGIKLRZnC2Xsxe9Q5ia3CcLTuzYGKauCtShb2pCSzXJiDPvLmhTdmvzBcG0bs6R2GHw5b6qdlgTWZw3xukzkD5EUw5bOVi7Zq3r7hA38LzgGk34BMNGVgL62AdYvygc4HNQNuyIx5ZMij0dlocH1RbiQSGcweYMeIIkBsdESpe6RSQXvx40tZGakgjMf5OXsqigGUNguwRppNL/kvu0Z+UAXj19bwhBzcT9RtK2UlLylM9vmit68XYBw== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=HwbRppKur/XKndup8VsjhWmnMHZBB9VjquQsdF2H0sI=; b=CEsZX3f8yk7FIIFEPoWvbF1Jffa9GiouPOugl4E0YYbVWiFWeyA/RISN72BfjR+wrbtRvt5GV1vBM6mJI3uqPKzT3puZLqq03yHx5L9d4fb/Sl/DwHU0LZTCOQKXrvWtm/f4KCNLnTVI3/g59wx3owlR5Xm2itMjnv+GXMWrjW6eIcCkqF3Y7mDiFXwpixzJsSnrZ3MRB0/GPDIdpE8PzdaxNbhpUPRsS2JRllVVsA4MYmMcUA8g1WN8JvDEGE1o28x1hDxlDuq9NNV2OFbeOh1AOy3H0Mx6Em7UJNPiW5zTUKsU1cdYpeMBzFXyVitMEx1blUvDULCLNlaSWC1yVQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microchip.com; dmarc=pass action=none header.from=microchip.com; dkim=pass header.d=microchip.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microchiptechnology.onmicrosoft.com; s=selector2-microchiptechnology-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=HwbRppKur/XKndup8VsjhWmnMHZBB9VjquQsdF2H0sI=; b=nAwLA7bH01f+thZVT9AEC/4/2hoBi6dyR53+AFO89ofeZ6mlfiVMLKTtUPcpvMCKFRZJGDa//O3oY44Xu4ojygHnXUONJXzVhvX9a7xhNPt/AKY7UzXb0NwlvmURqIZKJXJcvHPHSS82kgyBATG1W7WfQEHe+iQqcPQaxrO7Gac= Received: from BL1PR11MB5384.namprd11.prod.outlook.com (2603:10b6:208:311::14) by BYAPR11MB2936.namprd11.prod.outlook.com (2603:10b6:a03:8c::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5038.19; Mon, 7 Mar 2022 10:31:47 +0000 Received: from BL1PR11MB5384.namprd11.prod.outlook.com ([fe80::11a5:42e0:3f3d:fcdc]) by BL1PR11MB5384.namprd11.prod.outlook.com ([fe80::11a5:42e0:3f3d:fcdc%9]) with mapi id 15.20.5038.027; Mon, 7 Mar 2022 10:31:47 +0000 From: To: Subject: Re: [PATCH v6 04/13] media: atmel: atmel-isc: implement media controller Thread-Topic: [PATCH v6 04/13] media: atmel: atmel-isc: implement media controller Thread-Index: AQHYLxSOyw0+bLUC9UC5+p6WOroqq6yzoXyAgAAdcIA= Date: Mon, 7 Mar 2022 10:31:47 +0000 Message-ID: References: <20220303153618.2084156-1-eugen.hristev@microchip.com> <20220303153618.2084156-5-eugen.hristev@microchip.com> <20220307084623.njcncfp3sozsob26@uno.localdomain> In-Reply-To: <20220307084623.njcncfp3sozsob26@uno.localdomain> Accept-Language: en-US, ro-RO Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: user-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=microchip.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 51a4f495-44bd-49d9-bcec-08da0025af05 x-ms-traffictypediagnostic: BYAPR11MB2936:EE_ x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: JqgXkDYPeA+SCgFeuVuflONFDnY0Cfqrc6zlN6nx3C9NMEOgcyy3fQBovCLAKbszeBZS8ifs7yKcw12F5awwLySztJNyDrzeWVX7Deqahd56bLJ9G8D01EIMvJ4NsVHII/ePX8tMy31+HKqn+XjGkyeooqd+WavFHfCxdWa2d0gD6gKAU0dPBgPYOCaNrbYDVxAJfrUn12SumbNRZLK5nNBa3QdQF0xdGjSoMgeKkp10S4BqGA+B1CudY/V+2xOYBntVCFK1pt1CYwtZgJJn9g686k4hNaNfo349EI01kDP98qrzt36u0BQPyHWjY4q73/2zJN+JkYtKivoirv19yOL3ig21WGOyqPpDfz/Ogc69LEN43PWkJ25mW2zAkFXbD2QPFIvdNB2aKfKpPzwMOE6kiB4DtRXedrWOKS3kXS+xm2UeXJAVvBjQQyB/oGjzM2YeiaPkxFBThiIrqrA6oVkNyVne/Uo4PV2+F0M/ly4uT3TAUUIuTa0UqdjlDeXGZy+QpjUysA1g/EbjZi6M6QVyqPOmJDbCIuVbhjUa5/OqyP/3CAnlB+OnSrgbqOG59bQuNJiCEseHfnyrA6/DQiLpLBXJtU6aRqQ5OhqFOlFVyPDK43dLrONL7vr3KVbbHl5c3r4dxMquWgISoAhod0g0GqmAGS3zCzsiDK/E6TZAI2S2nxzhVhB2SayRs7Ckgp+Dk8LwU0hC7LeJNJ+CXSKSMmvwUvNuT27isgQPzSubntv+f7srQOuCSwEG003kuGRTXNxubXGQimR13XIM8w== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BL1PR11MB5384.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(366004)(2906002)(26005)(5660300002)(2616005)(186003)(83380400001)(508600001)(31696002)(36756003)(86362001)(66446008)(6916009)(66946007)(30864003)(107886003)(6486002)(66556008)(6512007)(66476007)(76116006)(54906003)(316002)(8936002)(122000001)(64756008)(8676002)(31686004)(38100700002)(91956017)(38070700005)(6506007)(71200400001)(53546011)(4326008)(43740500002)(45980500001)(579004)(559001); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?B?c2c1ak12TnV6TXpZaTVaQU5GQnB6YXhoN0MrTDc3Nkw4dHBKUE1wWk11Wk93?= =?utf-8?B?R3p5ZHlpUGpkZkJWRytINWxyc3RranZWMjJ4NVZ5WEd3RHNVU0lwQ3A2Q3FW?= =?utf-8?B?SW1QZW9ZRjdtUjJma29sSUN0YUJNSlFNQ3pmY3VuSWFPK3RJbHQrTzk1UGZT?= =?utf-8?B?NzBTTThNL1V1MExnQTdsdGhXNzVCRVlhU0t5NURzY2d4OTNmMWRCcUdrblow?= =?utf-8?B?ZVVxWDZ4Rmd6ODVmalVPQkQyZU5Jam43YVRiTkFTTWZ4cERJT1YrZGlud3hR?= =?utf-8?B?RU5QazRtVFJudHdUZEdSMmJVOWcxQjNHanB5YmlTNHZJSDIreFlCOGNzbm9U?= =?utf-8?B?bXJWd2hXNlZ4VUlGTmpqeHNjcFVIVkRzL1cxcTNUT1E3bCtDNXRpOHVITUVY?= =?utf-8?B?cm5ocSttV1ZZOGkzaHVzZk5LenVLNjFJRjNEV041SlF0VkpPRnRuaUJxdmh3?= =?utf-8?B?QUlLRWdHTkpneUczdisvRjNnaEJnMGQzZ1IzU0JaSFpsSDFrVnJCTXZMK1hp?= =?utf-8?B?eGpXeTlwSUgxYVJwanF0VHNHdDd1Tm1kL1R3dTFVSXRKTVJSN0NNRHltUmFL?= =?utf-8?B?SHJnazRXY01EL2RMc3ZOTk1JODRNc01KRGEwbFg3RzV6c1JUZDh0SUUzbTNh?= =?utf-8?B?WkJjbi9ib1d6ZWp2WE0vVzlWdEhaQTlzQ3JYRndlazZmcFBCeDF1ZFlpdjhM?= =?utf-8?B?c0pUbzFlZDVKWGJobXlrZ1ZYNGNlcUZUMkZGMUt6YkVsb3V6bEpSb25DNExp?= =?utf-8?B?b2VhUlNXamxxdUZrWEI5aWdLTVF3TDhYeFFJbEtpeGtXL25kVFhVSXpVTnVx?= =?utf-8?B?a1JzU3RUTEg4NjdwaTNFTG1QK3NOUURHNXNCVmZ5U21Wa1ovM0RON1RPSmNk?= =?utf-8?B?cXkrSytLcHA0NkFJTk4zZHUwd2VrU0FlejhCTDlhOU9SemJFM0NXbTM3Y3Bm?= =?utf-8?B?Q3NNWGpZSFVIUmNNd0NXeGRGMkgvUm1YNlU1NlRJV3dHeVhYbkxMY2tDK2lF?= =?utf-8?B?WHlwNFh3cDdiU2xjZXlqK2grNTRrZEtjQXVRalZwOWgrUThTYlBKWEMrVFBE?= =?utf-8?B?TTFxcGUrSm5wOUFDck1Kak5rWkI3Sk1yVlBCaHU5VDZVYUN0Q0laRjB2Qksx?= =?utf-8?B?SHBXcGNHOVVvSTlVTmdMck8vRllJSVVWc25teFFDYmI5OEFONStOY3BqdFEv?= =?utf-8?B?TEZYZ1gza3dRT1h0eDkxaFJYbkRoNWFkRFlzcUFJR1p0VWMrdXhWSEw0Wll2?= =?utf-8?B?T1F5Z1Y0QTNwZlUwc3hHa2ZzTm55Ym5MZmxPNTIreTQ0ZmFPeWg2R3BKTGFD?= =?utf-8?B?b1JTVGNrWW5sWXNXd1ROUFFLSmgxZ2pUMGtUMkF4ekhwUVUyNkhkQ0NHajJx?= =?utf-8?B?SFRTeGE1ek1xcVB0aWZXVFc0cU9nK1Zsd09PRlpmOElpMlFxN3g1UGtpdWlX?= =?utf-8?B?NWxsUVBQeVRyNUFySXBDMkNNR2J3TTZneVFPQXkzZlN3aWtuQjl5NEhmSUVw?= =?utf-8?B?ekYxRlExMXhSaVB4U3c2T2U5dW9XYkliaXlHRldXaTBTeGRhMy9YeHJtS1d1?= =?utf-8?B?eEdGQ1VUV1RPQ0l0a2F1cU13Z1ZEemF5ZEZQVlFpS1JwRE9wcUFzTXp2RGx0?= =?utf-8?B?dTNTVFN3NzFhSm80czFjcDBLZHRMd0ZGUks3RFhYSVpsRVhqREtDdTdMTnQ4?= =?utf-8?B?NzY4UjVyWTZteFFaMlRKMk9Cd3NQaVg3b0MvTXM2dUpGUzlFZWZlWkthaVlB?= =?utf-8?B?ZWxDUGsvUHpGanV3dHhjbVlYVTVyQnBYY3VuY05KNFNaVDFXN1l6MXN4QkJm?= =?utf-8?B?c2FKVFc0R0MrVlhOWDB2M0NJcVdTMmltTnhSbFRKVWM1ZzZHNFR3L3hiWitm?= =?utf-8?B?YlRNQ1pYVFYySjFqVWpzQkxONU5jU2VYSHY2K1QybXJLUVNKV21UQXIrYjFa?= =?utf-8?B?UHVGZ2pJWGJZeXc0MTcwL1JKZXJhUVR2cHBpQkMwQ3JtQUgrRFZUYVhFQ010?= =?utf-8?B?Q3lmWkM0YlBCSUgxdE9jSGlvcW9KRUMvN3BMd25pTVpBdENBVDFrUzIxNGln?= =?utf-8?B?K2VvM0ExTzgrakQyazI5VmoyVHdtM05CRGVKWjM0aTVYTXBVc25wY2hrUzJH?= =?utf-8?B?N0dCdU9lRk9kaHYza1JyZ1NBSjVLT0lKWXVlOEVqUXRleHBYbjhYR0o4TEFo?= =?utf-8?B?WDRBekxHMFZWdHpqaEZIYnhKc0Z2RjF1bnQzRmlmVk9rbUZuM1NNbWVyT0Vy?= =?utf-8?B?NGNldTZlc084RXVvUkFrS3ZnUEJ3PT0=?= Content-ID: MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BL1PR11MB5384.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 51a4f495-44bd-49d9-bcec-08da0025af05 X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Mar 2022 10:31:47.4963 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3f4057f3-b418-4d4e-ba84-d55b4e897d88 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 5eEr/7GkBLYUUt/ltvMOK4TqGewFJIth5cdpDBhqfFP3xce/irLLULIEYJo66hYsFkc7YjH7MgNr/jxjyzl01B04xUJpAFACOWSl3cVPVsg= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR11MB2936 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220307_023206_457856_9C5E7EE7 X-CRM114-Status: GOOD ( 24.18 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, robh+dt@kernel.org, Claudiu.Beznea@microchip.com, linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 3/7/22 10:46 AM, Jacopo Mondi wrote: > Hi Eugen > > On Thu, Mar 03, 2022 at 05:36:09PM +0200, Eugen Hristev wrote: >> Implement the support for media-controller. >> This means that the capabilities of the driver have changed and now >> it also advertises the IO_MC . >> The driver will register its media device, and add the video entity to this >> media device. The subdevices are registered to the same media device. >> The ISC will have a base entity which is auto-detected as atmel_isc_base. >> It will also register a subdevice that allows cropping of the incoming frame >> to the maximum frame size supported by the ISC. >> The ISC will create a link between the subdevice that is asynchronously >> registered and the atmel_isc_scaler entity. >> Then, the atmel_isc_scaler and atmel_isc_base are connected through another >> link. >> >> Signed-off-by: Eugen Hristev >> --- >> Changes in v6: >> - reworked a bit as suggested by Jacopo >> - add try crops >> >> Changes in v5: >> - reworked s_fmt to pass the same format from sink to source >> - simplified enum_mbus_code >> - separated tgt and bounds to report correctly in g_sel >> >> Changes in v4: >> As suggested by Jacopo: >> - renamed atmel_isc_mc to atmel_isc_scaler.c >> - moved init_mc/clean_mc to isc_base file >> >> Changes in v2: >> - implement try formats >> >> drivers/media/platform/atmel/Makefile | 2 +- >> drivers/media/platform/atmel/atmel-isc-base.c | 75 ++++- >> .../media/platform/atmel/atmel-isc-scaler.c | 271 ++++++++++++++++++ >> drivers/media/platform/atmel/atmel-isc.h | 37 +++ >> .../media/platform/atmel/atmel-sama5d2-isc.c | 14 +- >> .../media/platform/atmel/atmel-sama7g5-isc.c | 12 +- >> 6 files changed, 403 insertions(+), 8 deletions(-) >> create mode 100644 drivers/media/platform/atmel/atmel-isc-scaler.c >> >> diff --git a/drivers/media/platform/atmel/Makefile b/drivers/media/platform/atmel/Makefile >> index 794e8f739287..f02d03df89d6 100644 >> --- a/drivers/media/platform/atmel/Makefile >> +++ b/drivers/media/platform/atmel/Makefile >> @@ -1,7 +1,7 @@ >> # SPDX-License-Identifier: GPL-2.0-only >> atmel-isc-objs = atmel-sama5d2-isc.o >> atmel-xisc-objs = atmel-sama7g5-isc.o >> -atmel-isc-common-objs = atmel-isc-base.o atmel-isc-clk.o >> +atmel-isc-common-objs = atmel-isc-base.o atmel-isc-clk.o atmel-isc-scaler.o >> >> obj-$(CONFIG_VIDEO_ATMEL_ISI) += atmel-isi.o >> obj-$(CONFIG_VIDEO_ATMEL_ISC_BASE) += atmel-isc-common.o >> diff --git a/drivers/media/platform/atmel/atmel-isc-base.c b/drivers/media/platform/atmel/atmel-isc-base.c >> index 67b4a2323fed..448bf281c61a 100644 >> --- a/drivers/media/platform/atmel/atmel-isc-base.c >> +++ b/drivers/media/platform/atmel/atmel-isc-base.c >> @@ -1712,6 +1712,7 @@ static int isc_async_bound(struct v4l2_async_notifier *notifier, >> struct isc_device, v4l2_dev); >> struct isc_subdev_entity *subdev_entity = >> container_of(notifier, struct isc_subdev_entity, notifier); >> + int pad; >> >> if (video_is_registered(&isc->video_dev)) { >> v4l2_err(&isc->v4l2_dev, "only supports one sub-device.\n"); >> @@ -1720,6 +1721,16 @@ static int isc_async_bound(struct v4l2_async_notifier *notifier, >> >> subdev_entity->sd = subdev; >> >> + pad = media_entity_get_fwnode_pad(&subdev->entity, asd->match.fwnode, >> + MEDIA_PAD_FL_SOURCE); >> + if (pad < 0) { >> + v4l2_err(&isc->v4l2_dev, "failed to find pad for %s\n", >> + subdev->name); >> + return pad; >> + } >> + >> + isc->remote_pad = pad; >> + >> return 0; >> } >> >> @@ -1734,8 +1745,8 @@ static void isc_async_unbind(struct v4l2_async_notifier *notifier, >> v4l2_ctrl_handler_free(&isc->ctrls.handler); >> } >> >> -static struct isc_format *find_format_by_code(struct isc_device *isc, >> - unsigned int code, int *index) >> +struct isc_format *isc_find_format_by_code(struct isc_device *isc, >> + unsigned int code, int *index) >> { >> struct isc_format *fmt = &isc->formats_list[0]; >> unsigned int i; >> @@ -1751,6 +1762,7 @@ static struct isc_format *find_format_by_code(struct isc_device *isc, >> >> return NULL; >> } >> +EXPORT_SYMBOL_GPL(isc_find_format_by_code); >> >> static int isc_formats_init(struct isc_device *isc) >> { >> @@ -1767,7 +1779,7 @@ static int isc_formats_init(struct isc_device *isc) >> NULL, &mbus_code)) { >> mbus_code.index++; >> >> - fmt = find_format_by_code(isc, mbus_code.code, &i); >> + fmt = isc_find_format_by_code(isc, mbus_code.code, &i); >> if (!fmt) { >> v4l2_warn(&isc->v4l2_dev, "Mbus code %x not supported\n", >> mbus_code.code); >> @@ -1893,7 +1905,8 @@ static int isc_async_complete(struct v4l2_async_notifier *notifier) >> vdev->queue = q; >> vdev->lock = &isc->lock; >> vdev->ctrl_handler = &isc->ctrls.handler; >> - vdev->device_caps = V4L2_CAP_STREAMING | V4L2_CAP_VIDEO_CAPTURE; >> + vdev->device_caps = V4L2_CAP_STREAMING | V4L2_CAP_VIDEO_CAPTURE | >> + V4L2_CAP_IO_MC; >> video_set_drvdata(vdev, isc); >> >> ret = video_register_device(vdev, VFL_TYPE_VIDEO, -1); >> @@ -1903,8 +1916,19 @@ static int isc_async_complete(struct v4l2_async_notifier *notifier) >> goto isc_async_complete_err; >> } >> >> + ret = isc_scaler_link(isc); >> + if (ret < 0) >> + goto isc_async_complete_unregister_device; >> + >> + ret = media_device_register(&isc->mdev); >> + if (ret < 0) >> + goto isc_async_complete_unregister_device; >> + >> return 0; >> >> +isc_async_complete_unregister_device: >> + video_unregister_device(vdev); >> + >> isc_async_complete_err: >> mutex_destroy(&isc->lock); >> return ret; >> @@ -1971,6 +1995,49 @@ int isc_pipeline_init(struct isc_device *isc) >> } >> EXPORT_SYMBOL_GPL(isc_pipeline_init); >> >> +int isc_mc_init(struct isc_device *isc, u32 ver) >> +{ >> + const struct of_device_id *match; >> + int ret; >> + >> + isc->video_dev.entity.function = MEDIA_ENT_F_IO_V4L; >> + isc->video_dev.entity.flags = MEDIA_ENT_FL_DEFAULT; >> + isc->pads[ISC_PAD_SINK].flags = MEDIA_PAD_FL_SINK; >> + >> + ret = media_entity_pads_init(&isc->video_dev.entity, ISC_PADS_NUM, >> + isc->pads); >> + if (ret < 0) { >> + dev_err(isc->dev, "media entity init failed\n"); >> + return ret; >> + } >> + >> + isc->mdev.dev = isc->dev; >> + >> + match = of_match_node(isc->dev->driver->of_match_table, >> + isc->dev->of_node); >> + >> + strscpy(isc->mdev.driver_name, KBUILD_MODNAME, >> + sizeof(isc->mdev.driver_name)); >> + strscpy(isc->mdev.model, match->compatible, sizeof(isc->mdev.model)); >> + snprintf(isc->mdev.bus_info, sizeof(isc->mdev.bus_info), "platform:%s", >> + isc->v4l2_dev.name); >> + isc->mdev.hw_revision = ver; >> + >> + media_device_init(&isc->mdev); >> + >> + isc->v4l2_dev.mdev = &isc->mdev; >> + >> + return isc_scaler_init(isc); >> +} >> +EXPORT_SYMBOL_GPL(isc_mc_init); >> + >> +void isc_mc_cleanup(struct isc_device *isc) >> +{ >> + media_entity_cleanup(&isc->video_dev.entity); >> + media_device_cleanup(&isc->mdev); >> +} >> +EXPORT_SYMBOL_GPL(isc_mc_cleanup); >> + >> /* regmap configuration */ >> #define ATMEL_ISC_REG_MAX 0xd5c >> const struct regmap_config isc_regmap_config = { >> diff --git a/drivers/media/platform/atmel/atmel-isc-scaler.c b/drivers/media/platform/atmel/atmel-isc-scaler.c >> new file mode 100644 >> index 000000000000..305524c1123e >> --- /dev/null >> +++ b/drivers/media/platform/atmel/atmel-isc-scaler.c >> @@ -0,0 +1,271 @@ >> +// SPDX-License-Identifier: GPL-2.0-only >> +/* >> + * Microchip Image Sensor Controller (ISC) Scaler entity support >> + * >> + * Copyright (C) 2022 Microchip Technology, Inc. >> + * >> + * Author: Eugen Hristev >> + * >> + */ >> + >> +#include >> +#include >> +#include >> +#include >> + >> +#include "atmel-isc-regs.h" >> +#include "atmel-isc.h" >> + >> +static void isc_scaler_prepare_fmt(struct v4l2_mbus_framefmt *framefmt) >> +{ >> + framefmt->colorspace = V4L2_COLORSPACE_SRGB; >> + framefmt->field = V4L2_FIELD_NONE; >> + framefmt->ycbcr_enc = V4L2_YCBCR_ENC_DEFAULT; >> + framefmt->quantization = V4L2_QUANTIZATION_DEFAULT; >> + framefmt->xfer_func = V4L2_XFER_FUNC_DEFAULT; >> +}; >> + >> +static int isc_scaler_get_fmt(struct v4l2_subdev *sd, >> + struct v4l2_subdev_state *sd_state, >> + struct v4l2_subdev_format *format) >> +{ >> + struct isc_device *isc = container_of(sd, struct isc_device, scaler_sd); >> + struct v4l2_mbus_framefmt *v4l2_try_fmt; >> + >> + if (format->which == V4L2_SUBDEV_FORMAT_TRY) { >> + v4l2_try_fmt = v4l2_subdev_get_try_format(sd, sd_state, >> + format->pad); >> + format->format = *v4l2_try_fmt; >> + >> + return 0; >> + } >> + >> + format->format = isc->scaler_format[format->pad]; >> + >> + return 0; >> +} >> + >> +static int isc_scaler_set_fmt(struct v4l2_subdev *sd, >> + struct v4l2_subdev_state *sd_state, >> + struct v4l2_subdev_format *req_fmt) >> +{ >> + struct isc_device *isc = container_of(sd, struct isc_device, scaler_sd); >> + struct v4l2_mbus_framefmt *v4l2_try_fmt; >> + struct isc_format *fmt; >> + unsigned int i; >> + >> + /* Source format is fixed, we cannot change it */ >> + if (req_fmt->pad == ISC_SCALER_PAD_SOURCE) { >> + req_fmt->format = isc->scaler_format[ISC_SCALER_PAD_SOURCE]; >> + return 0; >> + } >> + >> + /* There is no limit on the frame size on the sink pad */ >> + v4l_bound_align_image(&req_fmt->format.width, 16, UINT_MAX, 0, >> + &req_fmt->format.height, 16, UINT_MAX, 0, 0); >> + >> + isc_scaler_prepare_fmt(&req_fmt->format); >> + >> + fmt = isc_find_format_by_code(isc, req_fmt->format.code, &i); >> + >> + if (!fmt) >> + fmt = &isc->formats_list[0]; >> + >> + req_fmt->format.code = fmt->mbus_code; >> + >> + if (req_fmt->which == V4L2_SUBDEV_FORMAT_TRY) { >> + v4l2_try_fmt = v4l2_subdev_get_try_format(sd, sd_state, >> + req_fmt->pad); >> + *v4l2_try_fmt = req_fmt->format; >> + /* Trying on the sink pad makes the source pad change too */ >> + v4l2_try_fmt = v4l2_subdev_get_try_format(sd, sd_state, >> + ISC_SCALER_PAD_SOURCE); >> + *v4l2_try_fmt = req_fmt->format; >> + >> + v4l_bound_align_image(&v4l2_try_fmt->width, >> + 16, isc->max_width, 0, >> + &v4l2_try_fmt->height, >> + 16, isc->max_height, 0, 0); >> + /* if we are just trying, we are done */ >> + return 0; >> + } >> + >> + isc->scaler_format[ISC_SCALER_PAD_SINK] = req_fmt->format; >> + >> + /* The source pad is the same as the sink, but we have to crop it */ >> + isc->scaler_format[ISC_SCALER_PAD_SOURCE] = >> + isc->scaler_format[ISC_SCALER_PAD_SINK]; >> + v4l_bound_align_image >> + (&isc->scaler_format[ISC_SCALER_PAD_SOURCE].width, 16, >> + isc->max_width, 0, >> + &isc->scaler_format[ISC_SCALER_PAD_SOURCE].height, 16, >> + isc->max_height, 0, 0); >> + >> + return 0; >> +} >> + >> +static int isc_scaler_enum_mbus_code(struct v4l2_subdev *sd, >> + struct v4l2_subdev_state *sd_state, >> + struct v4l2_subdev_mbus_code_enum *code) >> +{ >> + struct isc_device *isc = container_of(sd, struct isc_device, scaler_sd); >> + >> + /* >> + * All formats supported by the ISC are supported by the scaler. >> + * Advertise the formats which the ISC can take as input, as the scaler >> + * entity cropping is part of the PFE module (parallel front end) >> + */ >> + if (code->index < isc->formats_list_size) { >> + code->code = isc->formats_list[code->index].mbus_code; >> + return 0; >> + } >> + >> + return -EINVAL; >> +} >> + >> +static int isc_scaler_g_sel(struct v4l2_subdev *sd, >> + struct v4l2_subdev_state *sd_state, >> + struct v4l2_subdev_selection *sel) >> +{ >> + struct isc_device *isc = container_of(sd, struct isc_device, scaler_sd); >> + >> + if (sel->pad == ISC_SCALER_PAD_SOURCE) >> + return -EINVAL; >> + >> + if (sel->target == V4L2_SEL_TGT_CROP_BOUNDS) { >> + /* bounds are the input format received */ >> + sel->r.height = isc->scaler_format[ISC_SCALER_PAD_SINK].height; >> + sel->r.width = isc->scaler_format[ISC_SCALER_PAD_SINK].width; > > I'll re-paste our discussion on v4 to make sure we're on the same page > > ------------------------------------------------------------------------------- >>>> + if (sel->pad == ISC_SCALER_PAD_SOURCE) >>>> + return -EINVAL; >>>> + >>>> + if (sel->target != V4L2_SEL_TGT_CROP_BOUNDS && >>>> + sel->target != V4L2_SEL_TGT_CROP) >>>> + return -EINVAL; >>>> + >>>> + sel->r.height = isc->max_height; >>>> + sel->r.width = isc->max_width; >>> >>> The CROP_BOUNDS should be set to the same size as the sink pad image format, >>> as it represents the maximum valid crop rectangle. >>> >>> TGT_CROP should report the configured crop rectangle which can be >>> intiialized to the same size as CROP_BOUNDS, if my understanding of >>> the spec is correct >> >> So you would like to have this differentiated, and report the >> CROP_BOUNDS to whatever is on the sink pad, and the TGT_CROP to what is >> reported now, the maximum size of the ISC frame . >> My understanding is correct ? >> > > I didn't know you have an HW limitation, so your _BOUNDS is not the > input image size but rather 3264x2464 ( == max_width x max_height). > > What I meant is that _BOUNDS should report the maximum rectangle size > that can be applied to the _CROP target. In you case you have an HW > limitation 3264x2464 and that's the largest rectangle you can apply. > TGT_CROP can be initialized to the same as _BOUND, but if you > implement s_selection it should report what has been there applied. > But as you don't implement s_selection yet, I think this is fine for > now. Maybe a little comment ? > ------------------------------------------------------------------------------- > > I think then that _BOUNDS should be fixed to 3264x2464 and CROP to > src_fmt. > > The rest looks good! Thanks for pushing up to this version and thanks > for addressings comments! > > Reviewed-by: Jacopo Mondi > > Thanks > j Hello Jacopo, So BOUNDS goes to isc max H / max V, and CROP goes to format of the source pad. Got it. I will update with a v7 as soon as you give me your feedback on the patch 8/13 which still required some changes from v6. Thanks again for reviewing this ! Eugen > >> + sel->r.left = 0; >> + sel->r.top = 0; >> + } else if (sel->target == V4L2_SEL_TGT_CROP) { >> + /* >> + * crop is done to the output format, >> + * limited by ISC maximum size >> + */ >> + sel->r.height = isc->scaler_format[ISC_SCALER_PAD_SOURCE].height; >> + sel->r.width = isc->scaler_format[ISC_SCALER_PAD_SOURCE].width; >> + sel->r.left = 0; >> + sel->r.top = 0; >> + } else { >> + return -EINVAL; >> + } >> + >> + return 0; >> +} >> + >> +static int isc_scaler_init_cfg(struct v4l2_subdev *sd, >> + struct v4l2_subdev_state *sd_state) >> +{ >> + struct v4l2_mbus_framefmt *v4l2_try_fmt = >> + v4l2_subdev_get_try_format(sd, sd_state, 0); >> + struct v4l2_rect *try_crop; >> + struct isc_device *isc = container_of(sd, struct isc_device, scaler_sd); >> + >> + *v4l2_try_fmt = isc->scaler_format[ISC_SCALER_PAD_SOURCE]; >> + >> + try_crop = v4l2_subdev_get_try_crop(sd, sd_state, 0); >> + >> + try_crop->top = 0; >> + try_crop->left = 0; >> + try_crop->width = v4l2_try_fmt->width; >> + try_crop->height = v4l2_try_fmt->height; >> + >> + return 0; >> +} >> + >> +static const struct v4l2_subdev_pad_ops isc_scaler_pad_ops = { >> + .enum_mbus_code = isc_scaler_enum_mbus_code, >> + .set_fmt = isc_scaler_set_fmt, >> + .get_fmt = isc_scaler_get_fmt, >> + .get_selection = isc_scaler_g_sel, >> + .init_cfg = isc_scaler_init_cfg, >> +}; >> + >> +static const struct v4l2_subdev_ops xisc_scaler_subdev_ops = { >> + .pad = &isc_scaler_pad_ops, >> +}; >> + >> +int isc_scaler_init(struct isc_device *isc) >> +{ >> + int ret; >> + >> + v4l2_subdev_init(&isc->scaler_sd, &xisc_scaler_subdev_ops); >> + >> + isc->scaler_sd.owner = THIS_MODULE; >> + isc->scaler_sd.dev = isc->dev; >> + snprintf(isc->scaler_sd.name, sizeof(isc->scaler_sd.name), >> + "atmel_isc_scaler"); >> + >> + isc->scaler_sd.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE; >> + isc->scaler_sd.entity.function = MEDIA_ENT_F_PROC_VIDEO_SCALER; >> + isc->scaler_pads[ISC_SCALER_PAD_SINK].flags = MEDIA_PAD_FL_SINK; >> + isc->scaler_pads[ISC_SCALER_PAD_SOURCE].flags = MEDIA_PAD_FL_SOURCE; >> + >> + isc_scaler_prepare_fmt(&isc->scaler_format[ISC_SCALER_PAD_SOURCE]); >> + isc->scaler_format[ISC_SCALER_PAD_SOURCE].height = isc->max_height; >> + isc->scaler_format[ISC_SCALER_PAD_SOURCE].width = isc->max_width; >> + isc->scaler_format[ISC_SCALER_PAD_SOURCE].code = >> + isc->formats_list[0].mbus_code; >> + >> + isc->scaler_format[ISC_SCALER_PAD_SINK] = >> + isc->scaler_format[ISC_SCALER_PAD_SOURCE]; >> + >> + ret = media_entity_pads_init(&isc->scaler_sd.entity, >> + ISC_SCALER_PADS_NUM, >> + isc->scaler_pads); >> + if (ret < 0) { >> + dev_err(isc->dev, "scaler sd media entity init failed\n"); >> + return ret; >> + } >> + >> + ret = v4l2_device_register_subdev(&isc->v4l2_dev, &isc->scaler_sd); >> + if (ret < 0) { >> + dev_err(isc->dev, "scaler sd failed to register subdev\n"); >> + return ret; >> + } >> + >> + return ret; >> +} >> +EXPORT_SYMBOL_GPL(isc_scaler_init); >> + >> +int isc_scaler_link(struct isc_device *isc) >> +{ >> + int ret; >> + >> + ret = media_create_pad_link(&isc->current_subdev->sd->entity, >> + isc->remote_pad, &isc->scaler_sd.entity, >> + ISC_SCALER_PAD_SINK, >> + MEDIA_LNK_FL_ENABLED | >> + MEDIA_LNK_FL_IMMUTABLE); >> + >> + if (ret < 0) { >> + dev_err(isc->dev, "Failed to create pad link: %s to %s\n", >> + isc->current_subdev->sd->entity.name, >> + isc->scaler_sd.entity.name); >> + return ret; >> + } >> + >> + dev_dbg(isc->dev, "link with %s pad: %d\n", >> + isc->current_subdev->sd->name, isc->remote_pad); >> + >> + ret = media_create_pad_link(&isc->scaler_sd.entity, >> + ISC_SCALER_PAD_SOURCE, >> + &isc->video_dev.entity, ISC_PAD_SINK, >> + MEDIA_LNK_FL_ENABLED | >> + MEDIA_LNK_FL_IMMUTABLE); >> + >> + if (ret < 0) { >> + dev_err(isc->dev, "Failed to create pad link: %s to %s\n", >> + isc->scaler_sd.entity.name, >> + isc->video_dev.entity.name); >> + return ret; >> + } >> + >> + dev_dbg(isc->dev, "link with %s pad: %d\n", isc->scaler_sd.name, >> + ISC_SCALER_PAD_SOURCE); >> + >> + return ret; >> +} >> +EXPORT_SYMBOL_GPL(isc_scaler_link); >> + >> diff --git a/drivers/media/platform/atmel/atmel-isc.h b/drivers/media/platform/atmel/atmel-isc.h >> index f9ad7ec6bd13..9cc69c3ae26d 100644 >> --- a/drivers/media/platform/atmel/atmel-isc.h >> +++ b/drivers/media/platform/atmel/atmel-isc.h >> @@ -183,6 +183,17 @@ struct isc_reg_offsets { >> u32 his_entry; >> }; >> >> +enum isc_mc_pads { >> + ISC_PAD_SINK = 0, >> + ISC_PADS_NUM = 1, >> +}; >> + >> +enum isc_scaler_pads { >> + ISC_SCALER_PAD_SINK = 0, >> + ISC_SCALER_PAD_SOURCE = 1, >> + ISC_SCALER_PADS_NUM = 2, >> +}; >> + >> /* >> * struct isc_device - ISC device driver data/config struct >> * @regmap: Register map >> @@ -258,6 +269,12 @@ struct isc_reg_offsets { >> * be used as an input to the controller >> * @controller_formats_size: size of controller_formats array >> * @formats_list_size: size of formats_list array >> + * @pads: media controller pads for isc video entity >> + * @mdev: media device that is registered by the isc >> + * @remote_pad: remote pad on the connected subdevice >> + * @scaler_sd: subdevice for the scaler that isc registers >> + * @scaler_pads: media controller pads for the scaler subdevice >> + * @scaler_format: current format for the scaler subdevice >> */ >> struct isc_device { >> struct regmap *regmap; >> @@ -346,6 +363,19 @@ struct isc_device { >> struct isc_format *formats_list; >> u32 controller_formats_size; >> u32 formats_list_size; >> + >> + struct { >> + struct media_pad pads[ISC_PADS_NUM]; >> + struct media_device mdev; >> + >> + u32 remote_pad; >> + }; >> + >> + struct { >> + struct v4l2_subdev scaler_sd; >> + struct media_pad scaler_pads[ISC_SCALER_PADS_NUM]; >> + struct v4l2_mbus_framefmt scaler_format[ISC_SCALER_PADS_NUM]; >> + }; >> }; >> >> extern const struct regmap_config isc_regmap_config; >> @@ -357,4 +387,11 @@ int isc_clk_init(struct isc_device *isc); >> void isc_subdev_cleanup(struct isc_device *isc); >> void isc_clk_cleanup(struct isc_device *isc); >> >> +int isc_scaler_link(struct isc_device *isc); >> +int isc_scaler_init(struct isc_device *isc); >> +int isc_mc_init(struct isc_device *isc, u32 ver); >> +void isc_mc_cleanup(struct isc_device *isc); >> + >> +struct isc_format *isc_find_format_by_code(struct isc_device *isc, >> + unsigned int code, int *index); >> #endif >> diff --git a/drivers/media/platform/atmel/atmel-sama5d2-isc.c b/drivers/media/platform/atmel/atmel-sama5d2-isc.c >> index c5b9563e36cb..c244682ea22f 100644 >> --- a/drivers/media/platform/atmel/atmel-sama5d2-isc.c >> +++ b/drivers/media/platform/atmel/atmel-sama5d2-isc.c >> @@ -553,6 +553,12 @@ static int atmel_isc_probe(struct platform_device *pdev) >> break; >> } >> >> + regmap_read(isc->regmap, ISC_VERSION + isc->offsets.version, &ver); >> + >> + ret = isc_mc_init(isc, ver); >> + if (ret < 0) >> + goto isc_probe_mc_init_err; >> + >> pm_runtime_set_active(dev); >> pm_runtime_enable(dev); >> pm_request_idle(dev); >> @@ -562,7 +568,7 @@ static int atmel_isc_probe(struct platform_device *pdev) >> ret = clk_prepare_enable(isc->ispck); >> if (ret) { >> dev_err(dev, "failed to enable ispck: %d\n", ret); >> - goto cleanup_subdev; >> + goto isc_probe_mc_init_err; >> } >> >> /* ispck should be greater or equal to hclock */ >> @@ -572,7 +578,6 @@ static int atmel_isc_probe(struct platform_device *pdev) >> goto unprepare_clk; >> } >> >> - regmap_read(isc->regmap, ISC_VERSION + isc->offsets.version, &ver); >> dev_info(dev, "Microchip ISC version %x\n", ver); >> >> return 0; >> @@ -580,6 +585,9 @@ static int atmel_isc_probe(struct platform_device *pdev) >> unprepare_clk: >> clk_disable_unprepare(isc->ispck); >> >> +isc_probe_mc_init_err: >> + isc_mc_cleanup(isc); >> + >> cleanup_subdev: >> isc_subdev_cleanup(isc); >> >> @@ -600,6 +608,8 @@ static int atmel_isc_remove(struct platform_device *pdev) >> >> pm_runtime_disable(&pdev->dev); >> >> + isc_mc_cleanup(isc); >> + >> isc_subdev_cleanup(isc); >> >> v4l2_device_unregister(&isc->v4l2_dev); >> diff --git a/drivers/media/platform/atmel/atmel-sama7g5-isc.c b/drivers/media/platform/atmel/atmel-sama7g5-isc.c >> index 07a80b08bc54..9dc75eed0098 100644 >> --- a/drivers/media/platform/atmel/atmel-sama7g5-isc.c >> +++ b/drivers/media/platform/atmel/atmel-sama7g5-isc.c >> @@ -547,15 +547,23 @@ static int microchip_xisc_probe(struct platform_device *pdev) >> break; >> } >> >> + regmap_read(isc->regmap, ISC_VERSION + isc->offsets.version, &ver); >> + >> + ret = isc_mc_init(isc, ver); >> + if (ret < 0) >> + goto isc_probe_mc_init_err; >> + >> pm_runtime_set_active(dev); >> pm_runtime_enable(dev); >> pm_request_idle(dev); >> >> - regmap_read(isc->regmap, ISC_VERSION + isc->offsets.version, &ver); >> dev_info(dev, "Microchip XISC version %x\n", ver); >> >> return 0; >> >> +isc_probe_mc_init_err: >> + isc_mc_cleanup(isc); >> + >> cleanup_subdev: >> isc_subdev_cleanup(isc); >> >> @@ -576,6 +584,8 @@ static int microchip_xisc_remove(struct platform_device *pdev) >> >> pm_runtime_disable(&pdev->dev); >> >> + isc_mc_cleanup(isc); >> + >> isc_subdev_cleanup(isc); >> >> v4l2_device_unregister(&isc->v4l2_dev); >> -- >> 2.25.1 >> _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel