From nobody Sat Sep 26 22:58:21 2026 Received: from TYVP286CU001.outbound.protection.outlook.com (mail-japaneastazon11011016.outbound.protection.outlook.com [52.101.125.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 80F33472F74; Fri, 28 Aug 2026 15:00:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.125.16 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787929260; cv=fail; b=A8OMHyLNtN8ls9PwQg9TBBuFSAKdFeQG+H2K3A0FYpTgESh+vXRXTpJMmPqcN2ocT0LBPX7Zg0koyJLBIoNzK6s+rOm1t1Zs6s7RQqGoFGJzFrFR+sKZKVyqn7xRJH2k3rr1K1EoKOqv4h3UYudZqnZibDKPuFUOjmmQGHjYFPc= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787929260; c=relaxed/simple; bh=MErkyTnIzYWU9SgA9ipf/xkh7U3aJqtowmsVaZGboUo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=aT/mSv2/RhBp4yHvtpo+wJW9zLcL04o0xoByOEDGUrYIx6TQ2T41DTfet9BIWIvY2KZcRJ8N8l6xpjbvassRKXXZG2xvHNtasFj7C6yvNEgqoRyRg26icsu7a2UNLKa1HZm4YUiEd3PuPWeUS1HGW/PisHAnEcvxUXar1r63EYM= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com; spf=pass smtp.mailfrom=renesas.com; dkim=pass (1024-bit key) header.d=renesas.com header.i=@renesas.com header.b=LhzxJTiR; arc=fail smtp.client-ip=52.101.125.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=renesas.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=renesas.com header.i=@renesas.com header.b="LhzxJTiR" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=TnWqAnDfuR7+FOAsncMwYcVqFld8PgI1WFsZr3BqWogiOzJaGhWOL13sdCA2E7LNnxmK+RkSNtIO4b2bQBdjc/650ekxlNd32VJefRqW3phJrvGmNxhSU7Pa2oevkFFg2yaiohtyNh4WzM9XvKXFBHb558dIVuadXuW4rcMMteSsbAyxIooEGRfL+d1PlslOmFX3gLdNdBpwh1lwCsJtKmD5KvuF4IHqz1ugQwD091amOfb2MLPv4NB8zphAHCIXbUrA3gXRIsRgqnfGUowGoMjsdsd97xDlXVZZFR7eRDlwhneZaXaeAEiLcXzVtvf+4AJewGE4yZr2PKokeyyNcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=6gCgh4PvXk9vEZ1Ti0bsDCmkY/XwfKsXX+xiYhMkwGA=; b=Psa343/tXPNN5HXvesz+ZBiV5/aQxqOarXcUW8Mo3bkkX1d2KUZA0n3lzcTWZvae6nBJTtJGNoL4RgzcUXBbA7seO7+Mh7D+xa8AlDGauUajBp20TIw0s7OdUabEC9JtpEuHli9PKRGDg5xwJNtviJublN8CpCBhgiXv/p+9Q4U3UghnspCFftajjueaPOPM2Og0RXiK9AR9Lo9LGGiZyQnm/Z7JoPNs69WJ2nKJhlzv7FMoih93/L3hrMfJGGehJaRaVyqHievPeeVat9obMO7vgBhSAylish57erp24GIk7OTqg1L9JKaMwpMHFLN1AxJdX9c2GrEeEbkPIPil+Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 8.62.32.50) smtp.rcpttodomain=analog.com smtp.mailfrom=renesas.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=renesas.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesas.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=6gCgh4PvXk9vEZ1Ti0bsDCmkY/XwfKsXX+xiYhMkwGA=; b=LhzxJTiRAGPWWdf72j7fWCmvN5xkDGJuEFEWSIOhllaoUl6f+WixBJBKOMCf54uvnnzsZibsDRqgaNxWwGCll1wEW45DWbqo+GwdDPgIp80IyCEM0EiKnnWU4C3QRiBa3ML6DnAvmLiwYvkg28qHnl7W5LefhhC2uQ5xeZBPwuQ= Received: from TYCP286CA0299.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:3c8::19) by OS7PR01MB18245.jpnprd01.prod.outlook.com (2603:1096:604:4bf::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.360.11; Fri, 28 Aug 2026 15:00:54 +0000 Received: from TYO1EPF00005025.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:3c8:cafe::5c) by TYCP286CA0299.outlook.office365.com (2603:1096:400:3c8::19) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.360.11 via Frontend Transport; Fri, 28 Aug 2026 15:00:54 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 8.62.32.50) smtp.mailfrom=renesas.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=renesas.com; Received-SPF: Pass (protection.outlook.com: domain of renesas.com designates 8.62.32.50 as permitted sender) receiver=protection.outlook.com; client-ip=8.62.32.50; helo=ejcrelay004p.adwin.renesas.com; pr=E Received: from ejcrelay004p.adwin.renesas.com (8.62.32.50) by TYO1EPF00005025.mail.protection.outlook.com (10.167.240.22) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.382.8 via Frontend Transport; Fri, 28 Aug 2026 15:00:53 +0000 Received: from demon-pc (REE-0055761.adwin.renesas.com [10.226.92.7]) by ejcrelay004p.adwin.renesas.com (Postfix) with ESMTP id D1D4C30001E6; Sat, 29 Aug 2026 00:00:48 +0900 (JST) From: Cosmin Tanislav To: Jonathan Cameron , David Lechner , =?UTF-8?q?Nuno=20S=C3=A1?= , Andy Shevchenko , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Geert Uytterhoeven , Magnus Damm Cc: linux-iio@vger.kernel.org, linux-renesas-soc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Cosmin Tanislav Subject: [PATCH 1/9] iio: adc: rzt2h: remove unused struct rzt2h_adc::max_channels Date: Fri, 28 Aug 2026 17:59:34 +0300 Message-ID: <20260828145943.2077589-2-cosmin-gabriel.tanislav.xa@renesas.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260828145943.2077589-1-cosmin-gabriel.tanislav.xa@renesas.com> References: <20260828145943.2077589-1-cosmin-gabriel.tanislav.xa@renesas.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYO1EPF00005025:EE_|OS7PR01MB18245:EE_ X-MS-Office365-Filtering-Correlation-Id: 276a8730-787d-4e92-e376-08df05152800 X-LD-Processed: 53d82571-da19-47e4-9cb4-625a166a4a2a,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|36860700016|1800799024|23010399003|7416014|376014|18002099003|22082099003|56012099006|11063799006|10067099003; X-Microsoft-Antispam-Message-Info: Q24bqvjN57AsBNlM5YQOLoGQTkQkSKAVnHgAkji5oXqbvdtBPKcCxXKunRnGuk46IGVbsMz31d5600ZNO8MDW7+XkMZbKRTEDRnUe5oszxsJPh6qcluik4O/4nHJql+l++69R4ektr/WO+2FQHYqSPWKyflwJ3ug/c7+AiNxgedgpfMPxce6vhPYz1HErrPUA7D0vJnEEiLoOvVlhRmdRLkxlQKUVvVX/pkp9caw9E3KZPMDwccg6IFeXaKrutWjTmF07bFEB1JZLcg4pgzJ4OWjapJgfcDhc5iLa0w3Nvz+/avINUMyArLcY6mlxBkrpKEIPWLE764OGJILd5qW6UKciB8BMTK2czrVFhuuAuZQ0SJysjIV/BXzknefHlsfsvZyYruA6n0BSEHhGT9pmT2h5M1BXWRX+VGX+a2zYhsYeV1UpNW4B1UQv8acbMX10XJCJC5saRGGBtj/d2AJrCnNuYTtEQSOfHb9lDOx8+EcUnekt/T6RUJETLcguRadpkt8xDTUj48k+BHgTUmX8EPt8VqXDdo/LMXKPUBcht7CYazEqLYjo1fAcBGDYl6UKqFDCvD26e2q1NWH2bcMhucrGXnjLtGAOVMlTmwoSvbksinzIFKlPNUW43CN7XiB8A89lqOQjYscP29WEx4KW/abn1HWHHTpX/U8xZjcgIYApICHex21e3IqPLLlVnDUKu7x3Pae7FViR/LohN3lqQ== X-Forefront-Antispam-Report: CIP:8.62.32.50;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:ejcrelay004p.adwin.renesas.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(82310400026)(36860700016)(1800799024)(23010399003)(7416014)(376014)(18002099003)(22082099003)(56012099006)(11063799006)(10067099003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: BGaZxT0aGubvN/0fTJ19ni1J18djyXZzDr6SnDyFGyMulQ+T4Daf7siLTbObvzEPfh8yW5c9CNbMqUW6F9uRvq1uwRNXb7OwGsuphlE098b1ekF6p7/HKVb5WIWNCbNT9rJyqtN5VAW9s3Vb9VeVryge4QDikN1ruxVDpBqPjK7F6lr/wvK2NSptKYnIoslyiPrKSJ1YtIhpSN3GK+Xq7bbG1/2CwQ61gI8y4YkuhP1riQz/TTlJAYSXgvqp6k2oaatKThcBjZgvJzG8u5tHf1WVFZuzEaF7Ax1Ekjtp569uN3ZbA/CcPeggC101Ixmjyz3Bt90trMTLOkhx9y65YMfJVjeLuHsMXfjw1qp19IBIdwoYdOLCXSd2RhB5JAA3sv081bKJnKx7wbv0OUpGtZgyD0LpRSVLFU9yE2+fXkyiVCmmN7cJ7wqhKuAZQsPd X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Aug 2026 15:00:53.2993 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 276a8730-787d-4e92-e376-08df05152800 X-MS-Exchange-CrossTenant-Id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=53d82571-da19-47e4-9cb4-625a166a4a2a;Ip=[8.62.32.50];Helo=[ejcrelay004p.adwin.renesas.com] X-MS-Exchange-CrossTenant-AuthSource: TYO1EPF00005025.JPNP286.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: OS7PR01MB18245 Content-Type: text/plain; charset="utf-8" struct rzt2h_adc::max_channels is unused, and is probably a leftover of the devm_iio_adc_device_alloc_chaninfo_se() conversion done after the initial submission. Remove it and the logic used to set it. Signed-off-by: Cosmin Tanislav --- drivers/iio/adc/rzt2h_adc.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/drivers/iio/adc/rzt2h_adc.c b/drivers/iio/adc/rzt2h_adc.c index 4e0eb02d3d14..42ff6bf2ab08 100644 --- a/drivers/iio/adc/rzt2h_adc.c +++ b/drivers/iio/adc/rzt2h_adc.c @@ -42,7 +42,6 @@ struct rzt2h_adc { =20 const struct iio_chan_spec *channels; unsigned int num_channels; - unsigned int max_channels; }; =20 static void rzt2h_adc_start(struct rzt2h_adc *adc, unsigned int conversion= _type) @@ -190,7 +189,6 @@ static const struct iio_chan_spec rzt2h_adc_chan_templa= te =3D { static int rzt2h_adc_parse_properties(struct rzt2h_adc *adc) { struct iio_chan_spec *chan_array; - unsigned int i; int ret; =20 ret =3D devm_iio_adc_device_alloc_chaninfo_se(adc->dev, @@ -203,10 +201,6 @@ static int rzt2h_adc_parse_properties(struct rzt2h_adc= *adc) adc->num_channels =3D ret; adc->channels =3D chan_array; =20 - for (i =3D 0; i < adc->num_channels; i++) - if (chan_array[i].channel + 1 > adc->max_channels) - adc->max_channels =3D chan_array[i].channel + 1; - return 0; } =20 --=20 2.55.0 From nobody Sat Sep 26 22:58:21 2026 Received: from TY3P286CU002.outbound.protection.outlook.com (mail-japaneastazon11010052.outbound.protection.outlook.com [52.101.229.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8DD384734F4; Fri, 28 Aug 2026 15:01:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.229.52 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787929264; cv=fail; b=kU3EVqtf17KS5t4JPazFVapIS4VAPcUqp5+MHT8c56cFm4RDM7iJM/ddudbEO5iOxughXPuQI3E9ZwD8W+UrZbw1EH3bJ0DV/iGQNqF9DM3oyX4AhmI1gCbx3M4ugK+GA3LrqTFt8TPgZlNzhg4onx0cowG9X323ZcFuBAmGvxM= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787929264; c=relaxed/simple; bh=jkN9v3klM6JFfxqlNgPJMRKu08WqfJmVEpymwGib1ks=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=VnI3LVIyHlFAHa4W0rEL86tcBfBFt2dE675pxzGPmzZlDifhu8JCmqhHCDh8D5UZ3S7ThwJNsap+K4WcOpN7BBoOFhHFyUzvYwkyGFuQQjShyWuyzKF3/Aemowo2ZY7rskL4NCz5YIFmEB6oD5FybeKSprPh9WOM9a3JY1QIV+w= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com; spf=pass smtp.mailfrom=renesas.com; dkim=pass (1024-bit key) header.d=renesas.com header.i=@renesas.com header.b=XhLRW+Gc; arc=fail smtp.client-ip=52.101.229.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=renesas.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=renesas.com header.i=@renesas.com header.b="XhLRW+Gc" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=S1snEjPpUityFDZ2ybsqsXhojryGJyztSVq/A3WhWoDB9aE7JJmrTbkLmz7VfErfhbMLESTmzvLnTR141kwXDyO6ud0AsyDWyqgxT/wV+BtzCrI8rEilkPTsa6ZvJQY6CJGdkpSb8iSE3JwF4qJ7yTD8yzCqKbYvZsnmZ6SXcZkFrSHhyWbG2duOCUVYAlLzvHL7uJDVBXbppjDWrm2Xko5vvAdJb+yvQSQk5Oem0zbJBgKur2TjlHGFJ5zFn2Z/FUFp7HcFO5Y3n0g3BOtnFS2DCjgRsOvOwraYM/C20cTi7Z7dCJxXW7XQd/UyqpEqwCEztTDvcoodjQ0fzqEINA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=1Dm7idpmBVsOS4VM/AiRvNw5s0zxrZcLBTZWq+iJzuw=; b=R4hSA0exMiJfheUYcee9JjTr7ZdYx68H860t47mZFtZ6Yra2GGaB+jgPieGRpHZ+HRMDSZVeeIx4x903md476ki+TR3ANXkPpvewVSBQBarlGPHPenEn/OWDr/kSI8sxLoU4nyjLvsvZtkWe8GQSYQMBkoJyRkCTmGLRDKeHdc3hNlA4LA5BFpb893/++bN0n22Dkd+k+ks3ZcC8y8KRixLf3tlRC/BXY1sfsJA+XwCjMUOg+1Z1hRaIxBZRoBHuofUV+L4za0se2jNuzklczCIIXiC64TojU/NZoZW/wVF0HoZdjKVN1Rc6vxlubkPeipHwvIZiNGNg02ULwoFzCw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 8.62.32.50) smtp.rcpttodomain=analog.com smtp.mailfrom=renesas.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=renesas.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesas.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=1Dm7idpmBVsOS4VM/AiRvNw5s0zxrZcLBTZWq+iJzuw=; b=XhLRW+GcJ9wXuoRf11ttEEyLD0ds0JwpvMOJ24MQ7JAJ5kQAtkQmoj+Bke89yWXxQty9RFbncQlUxnbieXYBpYau70OCSQnPT7WZssEfb+fHE0kSrpA3x2Aq4wBZ6AF5c+N+sYG47vVHGsgXYNtKRb7GoFKvSlcML2LVo8SWGDk= Received: from TYCP286CA0328.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:3b7::17) by OSCPR01MB12550.jpnprd01.prod.outlook.com (2603:1096:604:326::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.360.11; Fri, 28 Aug 2026 15:00:58 +0000 Received: from TYO1EPF00005023.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:3b7:cafe::5) by TYCP286CA0328.outlook.office365.com (2603:1096:400:3b7::17) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.360.11 via Frontend Transport; Fri, 28 Aug 2026 15:00:58 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 8.62.32.50) smtp.mailfrom=renesas.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=renesas.com; Received-SPF: Pass (protection.outlook.com: domain of renesas.com designates 8.62.32.50 as permitted sender) receiver=protection.outlook.com; client-ip=8.62.32.50; helo=ejcrelay004p.adwin.renesas.com; pr=E Received: from ejcrelay004p.adwin.renesas.com (8.62.32.50) by TYO1EPF00005023.mail.protection.outlook.com (10.167.240.20) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.382.8 via Frontend Transport; Fri, 28 Aug 2026 15:00:58 +0000 Received: from demon-pc (REE-0055761.adwin.renesas.com [10.226.92.7]) by ejcrelay004p.adwin.renesas.com (Postfix) with ESMTP id 593BF30001E6; Sat, 29 Aug 2026 00:00:54 +0900 (JST) From: Cosmin Tanislav To: Jonathan Cameron , David Lechner , =?UTF-8?q?Nuno=20S=C3=A1?= , Andy Shevchenko , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Geert Uytterhoeven , Magnus Damm Cc: linux-iio@vger.kernel.org, linux-renesas-soc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Cosmin Tanislav Subject: [PATCH 2/9] iio: adc: rzt2h: store IRQ in private state Date: Fri, 28 Aug 2026 17:59:35 +0300 Message-ID: <20260828145943.2077589-3-cosmin-gabriel.tanislav.xa@renesas.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260828145943.2077589-1-cosmin-gabriel.tanislav.xa@renesas.com> References: <20260828145943.2077589-1-cosmin-gabriel.tanislav.xa@renesas.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYO1EPF00005023:EE_|OSCPR01MB12550:EE_ X-MS-Office365-Filtering-Correlation-Id: 10a69cb6-bbda-4f5c-d2a3-08df05152b4a X-LD-Processed: 53d82571-da19-47e4-9cb4-625a166a4a2a,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|23010399003|7416014|376014|36860700016|82310400026|1800799024|10067099003|56012099006|11063799006|22082099003|18002099003; X-Microsoft-Antispam-Message-Info: jzQ+SnOjKlGavplMvNMNTyjJhb7+Lg/hgQsyTdY3lXRu0PLd6zRyTYW90Fj3qmmANHplJlNJQtHvmz90PMnFminvvCkduyou3moIj7mNuJI98XgiPR9gQpoDi9zGDHMERYphoYD8ZiHawO1ibnFrGZ5pBq77d/9Oiw2zHQizQZhN4N4nAGajnjf1xpU7Eyu+yoYptGODsqd2pYGh7QNiGgNckVxawjrQAKp8F35D+uRYzcjskEWYNIjdVRbMbNYxV+pUa3AK4L9oE1F9poe/4vHnDst+/tGovagXxWzFlhwkdJUl/yreXsqloVEs/5NhzcrYYdNZgrdGqDjr4xBYH6ZkRt1sqe2WtqaKuC1UarC5P7YqJaamwnw8IXYGZoPkbW1QUlmWuNvziYowtX/RMTi0hHu0cO8P2nXP3z8WLzjQSvK6fuCjn2u6Kfd1FfvXaCHYPCq3ucQ2or5j2ZOVOPdltG+wovDuh9p3OnPNu2eaKfrDZ/SY2+JpX98BijL9pI3Qt8Agmzi+unOsEtZbKnXJOUlcl4D5ot0qMUIGZ5dGrFyqvJyll1BR+EpdDWvsSTFTz1ZneSIcQUO2v9S08JVjiPZh3nrepRvyjciVkLk27pN1hCGRb3i7KdSRYS8WmlUhjJngk3iw4QLTgHY9aUFgNz2VqJMS9QnDPhcB5Tu9CsU00aoKZBIN69m2kGZ1V/7Bq27H7DCg9MSHxtpLdw== X-Forefront-Antispam-Report: CIP:8.62.32.50;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:ejcrelay004p.adwin.renesas.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(23010399003)(7416014)(376014)(36860700016)(82310400026)(1800799024)(10067099003)(56012099006)(11063799006)(22082099003)(18002099003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Cv3h73gDukslAT5IshKJK2/o0z1c40BEhmLDGGu7S750zA0bcd1vbrszLKSRTJmRByemCXaFNVaGonvJVWOv9lL0S+kbByK8vuRZxHOaYC2IicTPS+QcQ7HbczR2jLRZ61ZOCZhZTN7u+LpxKn/mOKoLYmv/1E2yAWNF1mTw7fdzoF/pRn79sGBHqC8VLD2FvliucZJOYvEASqXN61dpYiBdOa/P1FEDLOESeVu8cfxRq/OliKRMZfKS+CgdCko5aHw05iZE5zB9/1XF94dfVppOEG+ogo+AKLLlIPww+MC5ht9g6qUPHx4t78ftvjLwW0PqTXOcqkr0Skirpnidu7RNth/Zvm0/rhMIwGe823ULritvMfo3W4IsCiuXVyBdMT+aUnv4h4L6yZuKXjHfNw37iWSxy8Zf3z5XBLtNGMWiv+cPYuMGvpdnruCJ4Ij+ X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Aug 2026 15:00:58.8170 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 10a69cb6-bbda-4f5c-d2a3-08df05152b4a X-MS-Exchange-CrossTenant-Id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=53d82571-da19-47e4-9cb4-625a166a4a2a;Ip=[8.62.32.50];Helo=[ejcrelay004p.adwin.renesas.com] X-MS-Exchange-CrossTenant-AuthSource: TYO1EPF00005023.JPNP286.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: OSCPR01MB12550 Content-Type: text/plain; charset="utf-8" To prepare for adding support for DMA transfers, store the IRQ in private state to disable it while DMA is in progress. The RZ/T2H ICU does not mask the interrupts itself when they are being used for DMA transfers. Signed-off-by: Cosmin Tanislav --- drivers/iio/adc/rzt2h_adc.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/iio/adc/rzt2h_adc.c b/drivers/iio/adc/rzt2h_adc.c index 42ff6bf2ab08..470b16b5b9c8 100644 --- a/drivers/iio/adc/rzt2h_adc.c +++ b/drivers/iio/adc/rzt2h_adc.c @@ -42,6 +42,8 @@ struct rzt2h_adc { =20 const struct iio_chan_spec *channels; unsigned int num_channels; + + int irq; }; =20 static void rzt2h_adc_start(struct rzt2h_adc *adc, unsigned int conversion= _type) @@ -209,7 +211,7 @@ static int rzt2h_adc_probe(struct platform_device *pdev) struct device *dev =3D &pdev->dev; struct iio_dev *indio_dev; struct rzt2h_adc *adc; - int ret, irq; + int ret; =20 indio_dev =3D devm_iio_device_alloc(dev, sizeof(*adc)); if (!indio_dev) @@ -239,11 +241,11 @@ static int rzt2h_adc_probe(struct platform_device *pd= ev) if (ret) return ret; =20 - irq =3D platform_get_irq_byname(pdev, "adi"); - if (irq < 0) - return irq; + adc->irq =3D platform_get_irq_byname(pdev, "adi"); + if (adc->irq < 0) + return adc->irq; =20 - ret =3D devm_request_irq(dev, irq, rzt2h_adc_isr, 0, dev_name(dev), adc); + ret =3D devm_request_irq(dev, adc->irq, rzt2h_adc_isr, 0, dev_name(dev), = adc); if (ret) return ret; =20 --=20 2.55.0 From nobody Sat Sep 26 22:58:21 2026 Received: from OS0P286CU010.outbound.protection.outlook.com (mail-japanwestazon11011060.outbound.protection.outlook.com [40.107.74.60]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A211647252F; Fri, 28 Aug 2026 15:01:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.74.60 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787929271; cv=fail; b=i76tpbW7gdB/8EkwiHB8eYGsrgPLEI/+UZaFZ955WJeSIcx+sQ42jOhSuUvspmGfLPbVsqZpsFwoWwMxq4/RJnr+9WLbNHIavtWZOzgSjLvQc8g80CpNi4KkDRcYQtz98ravbqKptMTWUyz7YPdha0FRbkvj1RhSqeIFwBVySsE= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787929271; c=relaxed/simple; bh=CRtrCH8/KzHZqlOh8/Wi1MOrO+eu4I4mWjQgTN0Upgw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=YgQnbcunuxXGrq/AuuvaFElNOI/ST1dmL2qNo1Ytl2+b51ms2I3//KCh1x7CyE8v6MmKogsBiKYTi2WCAkUydt4kf04RSerFVBUYALdrRu/FU/DDnxdp/4RKKGBYQlKxf0lw6D6cPN6jcDMgvyH10ShbQ0/Ff016CanVKR3Wz5s= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com; spf=pass smtp.mailfrom=renesas.com; dkim=pass (1024-bit key) header.d=renesas.com header.i=@renesas.com header.b=UBP62Qv3; arc=fail smtp.client-ip=40.107.74.60 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=renesas.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=renesas.com header.i=@renesas.com header.b="UBP62Qv3" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=dNwdJnZV+lnlDftCDsxo/T9zTvEmY/u4owY+/h3XBPzVgCbUyOTaLEN884xZ0tN9U0ED8Kc8B6534r+QS8DSnTn9orgpOqe1PCoDRpHp6olqEE/vbAyu4VysgSm3B1S+HPtD8aDRMwWnge+GQ8b5hZfVM+v7KmL5P17d1fUIRNrOGG8RBm3MmCbRx8VCmK8Wda5iYWnY2vSlwvRHniHLipmxgOLZ2UdMTfra6hYlV2AC65YmIwJrUHLr9DysEZSaFiSDuf6CtiW2h4a8Q6CYnzQE6QIZ/pON9x7Rdioxwl2SbdFUHJeVaRC07JfezifAc09gxAlJKNkBu61XAaISrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=Qo5+TSPCX5J9uylX5afTSriyfUVASIF8TaHshMLnM6M=; b=xaD28j8mp9VrDrNgPYPnzpDGADEfX9MmEpGgTveOd4+T0KLwDLQNEU1MCVP99yuOKrLI5d6S5E73IStEeAsfIGEuxTaF23azTSasS+SavEqUW70mqpwGzbcX8SRpTMiejnC4+OVWna4MvjMRQqL5CCPqjHFRyajtqM/ceVMdHZSsY5/NoElI8UKXSL+9LGzDdhVi0aEsOCEzotRQaiSDjcQG+/GSUFXMsVKfakg+fahJ9zDjDIAQ7YNiMMnHOliucku8BwgcmTScvhXKxe25/r3UTmmKRVqIe3S8g2plPXVsc7Nf4QfdgdbccdlHWmXzvyGkfiCJPHVsu7g0dOAOwQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 8.62.32.50) smtp.rcpttodomain=analog.com smtp.mailfrom=renesas.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=renesas.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesas.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Qo5+TSPCX5J9uylX5afTSriyfUVASIF8TaHshMLnM6M=; b=UBP62Qv3NXXoAApw+IACyc/jso7CMqKSTZKtru72Z4I4E0YNwjUOLHRvPgaZPSgqnaADmOg3VQF99BSXyohwilTywbNUcAdi28bPOIx0i44QdRKGZyCKWgyBI8KqRJkoLn1lA8fqvHS7CHE4jeMmuT0UJN2ZTCzTJ0sBM+47Mlk= Received: from OS7PR01CA0060.jpnprd01.prod.outlook.com (2603:1096:604:254::19) by TYYPR01MB7145.jpnprd01.prod.outlook.com (2603:1096:400:cd::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.360.11; Fri, 28 Aug 2026 15:01:05 +0000 Received: from OS1PEPF0000D20D.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:254:cafe::14) by OS7PR01CA0060.outlook.office365.com (2603:1096:604:254::19) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.360.11 via Frontend Transport; Fri, 28 Aug 2026 15:01:05 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 8.62.32.50) smtp.mailfrom=renesas.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=renesas.com; Received-SPF: Pass (protection.outlook.com: domain of renesas.com designates 8.62.32.50 as permitted sender) receiver=protection.outlook.com; client-ip=8.62.32.50; helo=ejcrelay004p.adwin.renesas.com; pr=E Received: from ejcrelay004p.adwin.renesas.com (8.62.32.50) by OS1PEPF0000D20D.mail.protection.outlook.com (10.167.240.36) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.382.8 via Frontend Transport; Fri, 28 Aug 2026 15:01:04 +0000 Received: from demon-pc (REE-0055761.adwin.renesas.com [10.226.92.7]) by ejcrelay004p.adwin.renesas.com (Postfix) with ESMTP id D40C430001E6; Sat, 29 Aug 2026 00:00:59 +0900 (JST) From: Cosmin Tanislav To: Jonathan Cameron , David Lechner , =?UTF-8?q?Nuno=20S=C3=A1?= , Andy Shevchenko , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Geert Uytterhoeven , Magnus Damm Cc: linux-iio@vger.kernel.org, linux-renesas-soc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Cosmin Tanislav Subject: [PATCH 3/9] iio: adc: rzt2h: store the physical address in private state Date: Fri, 28 Aug 2026 17:59:36 +0300 Message-ID: <20260828145943.2077589-4-cosmin-gabriel.tanislav.xa@renesas.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260828145943.2077589-1-cosmin-gabriel.tanislav.xa@renesas.com> References: <20260828145943.2077589-1-cosmin-gabriel.tanislav.xa@renesas.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: OS1PEPF0000D20D:EE_|TYYPR01MB7145:EE_ X-MS-Office365-Filtering-Correlation-Id: 6b58d22a-6523-408c-5966-08df05152ea1 X-LD-Processed: 53d82571-da19-47e4-9cb4-625a166a4a2a,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|1800799024|23010399003|376014|7416014|36860700016|18002099003|22082099003|56012099006|11063799006|10067099003; X-Microsoft-Antispam-Message-Info: gRvXgZIjc55o2dqnsCqc8xcuSRKksEFymw+uM42csHFXLejbU8d9w0QX+wxLnQ0Qqu2UVN32aR7vbCS/ONpDiiinHKNbIYTJa40MDVt9x5os18DM7KO4hLRt5js0uI3i1rN1McXLAMI9EpaYlKXfs/nptZZ39i7hqyW0xdvPg+sHi3PJx5WfU5C++oLlFaQDOg0673G30SKl749x47B6GYku9rmavfBKgp1pd76gBBVdHXneTGflLW7lGWgjRaXs+m3JCXyR3Kl97xFBaeYHDIkM2IeqfTn/VgMsJtOmtaIxFV3z/bIlbt/BsI2WKaosG5mdogGQVNavt56n7trit8a9zg1c1I2hssM7JAdl0kxYrD9k27GjxtafbmInkd/TzfftX2mHov+Ry3PCIS10JFyacojJbW6izkOkbGshTKSzC6LeQa0s8CFxsOBtfdRWJda8h6zXbty1lCSja7tmflIq0+juOIni51tkhrihvxGwXEERvOUIhUmHeYnZ0iGkONufd0JPAKOEI0PQsdFFRysdH/Q56TmIOZPMoHPJIfsO34dyKungSlvGdGylROtZcOzJhiNhpaVr5hZpL8Mk09EteFFKL8W/Odzi1fQPaSkxvOfKL4MQ+qk0Dfe9TNloobMlUAJgmM7lWGle6tnsGgmDm20Id7/BJe5xHi4VcanhNAIylEeEHNvonWh4ZYvA+QRgHPKVXjoxatTfF/+Uuw== X-Forefront-Antispam-Report: CIP:8.62.32.50;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:ejcrelay004p.adwin.renesas.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(82310400026)(1800799024)(23010399003)(376014)(7416014)(36860700016)(18002099003)(22082099003)(56012099006)(11063799006)(10067099003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: uGDChDDj1Taesk8AzEehbngO/uSeQGM+kR3kwaaWv+6nqg7s7yJ8Ys7OhCrAKI50tkmoLjyze/p/pLZyiqdDdo0EUJHDHAw132iPdtm+dl8bdafSoSqckZAIIeDTRgqgb+y2QGFQKljiZzoHl+5SWL6cMlfjeFclrMbXYPVta2gyN66aqw3fRO6/cmjAPI6BwmX4nRBiTshgd5MGMKIJUbEFVNMiLbF1BOQ6ehaYN33WfiJCimEDDSpSupDiyjbkc0F/GCYdJiGfcuewsS05RXpuljIr6iEFeAz4wlI4n/Ks8a1smEgDkKyg+TmK5fe2memfxWfEyt9pIZeo5MNCCIpClSx0UeDoWc4dCXXYJZ2wa6cilbEznljYCECVEDJ6xXx7y4aVhBRPmIRD+LGQIzDXPKa45krnSjzrdppwNWL2iMFX60/xsf+7RHpJqPA1 X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Aug 2026 15:01:04.4051 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6b58d22a-6523-408c-5966-08df05152ea1 X-MS-Exchange-CrossTenant-Id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=53d82571-da19-47e4-9cb4-625a166a4a2a;Ip=[8.62.32.50];Helo=[ejcrelay004p.adwin.renesas.com] X-MS-Exchange-CrossTenant-AuthSource: OS1PEPF0000D20D.JPNP286.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYYPR01MB7145 Content-Type: text/plain; charset="utf-8" To prepare for adding support for DMA-based transfers, store the physical address of the device in struct rzt2h_adc::phys_base. Signed-off-by: Cosmin Tanislav --- drivers/iio/adc/rzt2h_adc.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/iio/adc/rzt2h_adc.c b/drivers/iio/adc/rzt2h_adc.c index 470b16b5b9c8..995308a419f1 100644 --- a/drivers/iio/adc/rzt2h_adc.c +++ b/drivers/iio/adc/rzt2h_adc.c @@ -36,6 +36,7 @@ struct rzt2h_adc { void __iomem *base; struct device *dev; =20 + phys_addr_t phys_base; struct completion completion; /* lock to protect against multiple access to the device */ struct mutex lock; @@ -211,6 +212,7 @@ static int rzt2h_adc_probe(struct platform_device *pdev) struct device *dev =3D &pdev->dev; struct iio_dev *indio_dev; struct rzt2h_adc *adc; + struct resource *res; int ret; =20 indio_dev =3D devm_iio_device_alloc(dev, sizeof(*adc)); @@ -231,10 +233,12 @@ static int rzt2h_adc_probe(struct platform_device *pd= ev) if (ret) return ret; =20 - adc->base =3D devm_platform_ioremap_resource(pdev, 0); + adc->base =3D devm_platform_get_and_ioremap_resource(pdev, 0, &res); if (IS_ERR(adc->base)) return PTR_ERR(adc->base); =20 + adc->phys_base =3D res->start; + pm_runtime_set_autosuspend_delay(dev, 300); pm_runtime_use_autosuspend(dev); ret =3D devm_pm_runtime_enable(dev); --=20 2.55.0 From nobody Sat Sep 26 22:58:21 2026 Received: from TYVP286CU001.outbound.protection.outlook.com (mail-japaneastazon11011043.outbound.protection.outlook.com [52.101.125.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C25504570E4; Fri, 28 Aug 2026 15:01:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.125.43 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787929279; cv=fail; b=LfsIRkSNDOeLl9F5k6FG3KAzRsDQmrz3sOprTJj22KB5DVC8RQV2PcMZRCG2u2IgFz4sxJGBeZ0qmE7xtspyzhiR37oEC95PgdjsOf0kTPN4zIYWsKanIc39sbvTskZFaR09REMhdMkrpdLzbzcy3KHctrPqrZgQnloD2fTmicA= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787929279; c=relaxed/simple; bh=pbqJiRHltT1oEl3dL0JMnbmr4Y++3AxAmjiUlJsQhws=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=CNkaqvjm/lqAGnZmO9UxIqwYpkblNK7JeldsZgCrlHSztw7MdytW1obfTCTIO4c/uqFAd0UwMGwGiaIaegFJyo4Yxc3spzhg66PRas/qsVPiScYRWSeRr5cFNZAnmY9NrCz3NoOrAoAiPBs34bRarRgqhxKZwNalJItx+iqcZJ4= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com; spf=pass smtp.mailfrom=renesas.com; dkim=pass (1024-bit key) header.d=renesas.com header.i=@renesas.com header.b=iVPI+hSC; arc=fail smtp.client-ip=52.101.125.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=renesas.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=renesas.com header.i=@renesas.com header.b="iVPI+hSC" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=pJ4Qf61Fg0nSpHlJgc8XyRKzoTWOSiGRf/VoR0lYGd+qi72jFj+YyKpLNtHA1J1lRLIVKIAOQH313RyOIO068IRQGbYaUCoodNZNMtvZLGh+J942hdM3/P1VPndX8z2d2U/OzzcacibnhZ1NC7FJa9xjlpNRnAL/sdOMU8LLMjliOZYvoU2KaJl6JWqEcOO94TI3BMD6ekf5Peml99EqNVn12YtaWuVmzN/OJ7mnINYNXJ7+z3bHF8aKh2p9TqzdNBv9YeIowCUDkyVT2z5uF4KDVGmExhP5RQtGNr2joE89z6FCgN71ZDdwHYfMX9nTUcukwy1p71vFBt6wdVWxUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=dJAYDORM2ee+5qrwEzOgor+VhfZLVKvS+zg9kUfopQM=; b=esA3swFhLYNGibZpkTGG342xduw941Qo3bEuiEoVnpJ8jnk+WMIkUhmQXUibC2Hr6p8eA2q6QI6DidZkwVF1QgAhvXlUdO1WSO5MljEYh3qYXYT1kcv7oT30R9P8vsY6ByM7pk/C4yAc2pzW3b2k//4WWujBktG5R51YY6LCCFFDgC4pmU0+KVlNTo4k4MJp7ZVkYa4aE25LaoVI3YV6cx6JP3LScmSfLF6O+KETdPWQ4SQcwn8GcWkKPcK/fvI3cBIR3hCt2m8KTAcbgdY4iaUcV2wznXID6MF3MaApKWRtV61pDbew/qlqFFlRqe8rsAj1znRfqzsFTswwb3KBHw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 8.62.32.50) smtp.rcpttodomain=analog.com smtp.mailfrom=renesas.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=renesas.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesas.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=dJAYDORM2ee+5qrwEzOgor+VhfZLVKvS+zg9kUfopQM=; b=iVPI+hSC4nb92M3IE+bKA73RBup1vHuWmeY92CUB4PS6Rrb5eTjEqJzTYNyoveGmFnyudERb0SauLZtJsyQbzD+POBZZPwn6C6GZZQuumDqaRT4IlSeGBQZO7oh+XLcwC5iXnZri6wWf4QdeIug+wDXemLb0U+HpwLUcHUwr0Ck= Received: from TY6P286CA0012.JPNP286.PROD.OUTLOOK.COM (2603:1096:405:3b8::19) by OSZPR01MB8848.jpnprd01.prod.outlook.com (2603:1096:604:15d::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.360.11; Fri, 28 Aug 2026 15:01:12 +0000 Received: from TYO1EPF00005021.JPNP286.PROD.OUTLOOK.COM (2603:1096:405:3b8:cafe::7e) by TY6P286CA0012.outlook.office365.com (2603:1096:405:3b8::19) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.360.11 via Frontend Transport; Fri, 28 Aug 2026 15:01:12 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 8.62.32.50) smtp.mailfrom=renesas.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=renesas.com; Received-SPF: Pass (protection.outlook.com: domain of renesas.com designates 8.62.32.50 as permitted sender) receiver=protection.outlook.com; client-ip=8.62.32.50; helo=ejcrelay004p.adwin.renesas.com; pr=E Received: from ejcrelay004p.adwin.renesas.com (8.62.32.50) by TYO1EPF00005021.mail.protection.outlook.com (10.167.240.6) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.382.8 via Frontend Transport; Fri, 28 Aug 2026 15:01:11 +0000 Received: from demon-pc (REE-0055761.adwin.renesas.com [10.226.92.7]) by ejcrelay004p.adwin.renesas.com (Postfix) with ESMTP id A7C09300036C; Sat, 29 Aug 2026 00:01:05 +0900 (JST) From: Cosmin Tanislav To: Jonathan Cameron , David Lechner , =?UTF-8?q?Nuno=20S=C3=A1?= , Andy Shevchenko , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Geert Uytterhoeven , Magnus Damm Cc: linux-iio@vger.kernel.org, linux-renesas-soc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Cosmin Tanislav Subject: [PATCH 4/9] iio: adc: rzt2h: claim direct mode on single reads Date: Fri, 28 Aug 2026 17:59:37 +0300 Message-ID: <20260828145943.2077589-5-cosmin-gabriel.tanislav.xa@renesas.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260828145943.2077589-1-cosmin-gabriel.tanislav.xa@renesas.com> References: <20260828145943.2077589-1-cosmin-gabriel.tanislav.xa@renesas.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYO1EPF00005021:EE_|OSZPR01MB8848:EE_ X-MS-Office365-Filtering-Correlation-Id: 70ae3ebc-b0bf-4be8-31b7-08df051532b1 X-LD-Processed: 53d82571-da19-47e4-9cb4-625a166a4a2a,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|1800799024|23010399003|376014|7416014|36860700016|18002099003|22082099003|56012099006|11063799006|10067099003; X-Microsoft-Antispam-Message-Info: SPEQ9BPnLbbMkVqxvSxWnNWiBDT+Y2tMzx+eXCYR1TNwW3JyaTEZOD7+gkbe6qkYWziUkuOyMWc8PTBzgo2Dlb4ybTePZITPek9jdAcgYB0skOJpCvJeZZSOzWbnYKawJpZxKZoNJNLP4kzeTGPhxXjv59+bIL1BhDJFruhorzOlnFC/S5ZPMxVhX2pMaQ8GN80bPW82yX+Wh2i1i+5mqQUXlAtIsd+1iu+BUkRhhwNyO3iaa/OZdBNmdAYIoQA68B+cPgZu3P5rWWucaKcTnIzj40w/iFboOL4qfSv/nsiSL36BQXJz/+qenZOVtlTg7LmsMLc9cG8ZrrhqHjCbEoC2CalJJsm5a/FJfuMVym4sB9WDubuaawWAOLD361uBx/fbLDdtGj0GDo0vIDCNyQeyPQ388yjpADHDomxq0BWBpnqcBYPBcrjACBERX6+OkD6BmXTnVQeKWLJe6ulcanwoJEF/E+UHrxz9RkombBTEt3XoHGoMbEwEFzKtc07NTBLLutlZEA8sXEIR5vHPse5E+KIwYdI2X46qXJMZQQ6T9GKu1QSz6aH2vzygnHKDEE1Um77BB8DxC0bjqxPsaegHUL7CZEAHuFxV6KsOuBv12qW2Bv553PHfPzVDz+cPle+kYnXDL7M17dEwCmvo2kDwn6JqMBb7y5qqgoORSNB5XfmMQBDj3dXAVyS8r9I8pI4V6XCJUzpk5mV5Lfdf8A== X-Forefront-Antispam-Report: CIP:8.62.32.50;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:ejcrelay004p.adwin.renesas.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(82310400026)(1800799024)(23010399003)(376014)(7416014)(36860700016)(18002099003)(22082099003)(56012099006)(11063799006)(10067099003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Myb/ZY5n2GYNe6ZwIcm/baUtp76oKJ+5VUvJccWAMFJIebw6KbFSjjYkXZBxbmcBngExhfZbfJ8P7gt1I0by1XOAjsSV1XF/algobz755OfMobOYl3Ta3RCtA8im4ChrIZQC4tEcX/5gFwcCgazApR9GL9qaaj9dKfPN2w5phr9hXuE+7DjTtB2VbvfiPH4N3JNyTHkYXGosugnNK+3F8mcyNHjRsey3VN9+h1CrZYWSmJ+KY1xKHYHVJRtoSnddbCV96hUA3iGvAs8ANg/rXJKYpYGqNWfojk1H/m3Z1yTyM7ELXReUmuGvsWWIXhTcEjea/dVGL9Ir4rAQeyCbMP/un6AamUb+Kef8i1ib0Bb+DK7KINlrJUyj2NEGjJ2uSd0YubCrOFZyTpYrjbxAgZoFeBTSg8+wuNMmYfgtLj6NoXf0rw+ScDsK1Zcc1+Bw X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Aug 2026 15:01:11.2325 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 70ae3ebc-b0bf-4be8-31b7-08df051532b1 X-MS-Exchange-CrossTenant-Id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=53d82571-da19-47e4-9cb4-625a166a4a2a;Ip=[8.62.32.50];Helo=[ejcrelay004p.adwin.renesas.com] X-MS-Exchange-CrossTenant-AuthSource: TYO1EPF00005021.JPNP286.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: OSZPR01MB8848 Content-Type: text/plain; charset="utf-8" Claim direct mode around the single read to prevent it from conflicting with an ongoing buffered read. Signed-off-by: Cosmin Tanislav --- drivers/iio/adc/rzt2h_adc.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/iio/adc/rzt2h_adc.c b/drivers/iio/adc/rzt2h_adc.c index 995308a419f1..95bcebdc02cb 100644 --- a/drivers/iio/adc/rzt2h_adc.c +++ b/drivers/iio/adc/rzt2h_adc.c @@ -158,8 +158,13 @@ static int rzt2h_adc_read_raw(struct iio_dev *indio_de= v, struct rzt2h_adc *adc =3D iio_priv(indio_dev); =20 switch (mask) { - case IIO_CHAN_INFO_RAW: + case IIO_CHAN_INFO_RAW: { + IIO_DEV_ACQUIRE_DIRECT_MODE(indio_dev, claim); + if (IIO_DEV_ACQUIRE_FAILED(claim)) + return -EBUSY; + return rzt2h_adc_read_single(adc, chan->channel, val); + } case IIO_CHAN_INFO_SCALE: *val =3D 1800; *val2 =3D 12; --=20 2.55.0 From nobody Sat Sep 26 22:58:21 2026 Received: from TYVP286CU001.outbound.protection.outlook.com (mail-japaneastazon11011063.outbound.protection.outlook.com [52.101.125.63]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B28534746B3; Fri, 28 Aug 2026 15:01:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.125.63 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787929287; cv=fail; b=IV8wZpEwwaM5/CJGfy2Yy3/lEdDqSx/QN/gCM6SBrqYruj/4onHk4fbaEUWSwNrkwPDUNgwBxhfwwYv7WzKkp74tmljj0bftWxzot4U1MyXQ1o/A/tjPLLHkV7LQvUzdmepkSLnFRiSV4YjwU2kpdHJJ6QurNICv2WUz8BQRFVc= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787929287; c=relaxed/simple; bh=atvDQwHlcC3IKXJn82VKjgfQQLYERC0j9BsS5+IT9oQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=sa+KTnB4MaRe9YcPwFCDmv4r4zF91g3KX8r3ne6rFYNOzS2YqfSt+mNJKJhvxRgU99L65hnkS5tka28IoRV3iDSV8GVVe6LQVir+wtp1Rtt/C8DDIUY+Xue4xLAJMJa1AJqHsgXFbapfue0MyizFUKwnfvfMUVuRr7ghTKmbx/8= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com; spf=pass smtp.mailfrom=renesas.com; dkim=pass (1024-bit key) header.d=renesas.com header.i=@renesas.com header.b=QG9Ca5XE; arc=fail smtp.client-ip=52.101.125.63 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=renesas.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=renesas.com header.i=@renesas.com header.b="QG9Ca5XE" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=YX/pvm5Rf2nybE8HhkjApFxRAmVmrSVVquhWHQtNWnEVm2R6e6l27Id0voBjNZeLFU/WInxTko1nFRZhGlVT2MmFbNax/dDaQx3yjWq61tHB7LZ3M94r76DTlqcuBw4vS8b7tG3NVTQ+ZsMUnp+JwoE8db7hGKuVnVu9f++xKfrYf27OuVbouB5MGUm1Ok0jDViFRpn2q6JMKA5oaE3KuP03f/ty1JkNgjxRUnBb627XLFXMGXhe94YcJMP2QINw7oqBeGoYqfFm/LXc7Bwayw5HBdA+rvzFH7GRUGmL8v8fnzGW0uzeOMyiGedd/Qmh21ywZPDbLPwyskbdHkpdww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=oITNkf9ls0OapWqIlqpzrYLcG2WXSTYcKeYl1YsLksc=; b=Mqj4ZXiTX41mIYTUqSfcg4uALUW1wa/nzmjMfUfK2R/3BWkmNzy4rA0u2HaPcTIiAgqW2VWcCsZGNZ3iZn0W7F5mT0LDKHqi9DxnFhUInRhNIOo2vZ1DDdZlYsc4T6tuOKdoPjRMbkiAh4BmcC9b2Mz/0/rbvs7Dy5kCJ15bTxjW0byTNqbvn3+crEe4NX0EZzmTu/+4R12adTM/6C/nOicdE45b3aYKDeUGTJkdvOZsJdm3kwDChFUoe9iDXg1siK+I5q3l07UV1rkEBgKHw8zfPN6bV/DC4AmrGosQAKC3+bIyXEI9mnEJ25ZDRC32SgQD3cMz7KOcfzHN7clzjg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 8.62.32.50) smtp.rcpttodomain=analog.com smtp.mailfrom=renesas.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=renesas.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesas.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=oITNkf9ls0OapWqIlqpzrYLcG2WXSTYcKeYl1YsLksc=; b=QG9Ca5XEoReLHkd0TmG9Qaj+zrUjO8ClK+yIRrkYKSRxOvahbKePx4k4+1b1aswgVBgHNMhyBc4xPedPK3MJodE3RzgTgHg4y0Zamh6n37rYmjfjZanxv0fw5VP+7aLjQRiUCLOHAtYz0xL+j+lB452D1FYboqJ1KktQqUEuWJI= Received: from TYCP286CA0143.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:31b::19) by TYCPR01MB8326.jpnprd01.prod.outlook.com (2603:1096:400:15b::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.360.11; Fri, 28 Aug 2026 15:01:18 +0000 Received: from TY1PEPF0000BAD9.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:31b:cafe::4d) by TYCP286CA0143.outlook.office365.com (2603:1096:400:31b::19) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.360.11 via Frontend Transport; Fri, 28 Aug 2026 15:01:18 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 8.62.32.50) smtp.mailfrom=renesas.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=renesas.com; Received-SPF: Pass (protection.outlook.com: domain of renesas.com designates 8.62.32.50 as permitted sender) receiver=protection.outlook.com; client-ip=8.62.32.50; helo=ejcrelay004p.adwin.renesas.com; pr=E Received: from ejcrelay004p.adwin.renesas.com (8.62.32.50) by TY1PEPF0000BAD9.mail.protection.outlook.com (10.167.240.38) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.382.8 via Frontend Transport; Fri, 28 Aug 2026 15:01:17 +0000 Received: from demon-pc (REE-0055761.adwin.renesas.com [10.226.92.7]) by ejcrelay004p.adwin.renesas.com (Postfix) with ESMTP id 5486A3000349; Sat, 29 Aug 2026 00:01:12 +0900 (JST) From: Cosmin Tanislav To: Jonathan Cameron , David Lechner , =?UTF-8?q?Nuno=20S=C3=A1?= , Andy Shevchenko , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Geert Uytterhoeven , Magnus Damm Cc: linux-iio@vger.kernel.org, linux-renesas-soc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Cosmin Tanislav Subject: [PATCH 5/9] iio: adc: rzt2h: implement DMA buffer support Date: Fri, 28 Aug 2026 17:59:38 +0300 Message-ID: <20260828145943.2077589-6-cosmin-gabriel.tanislav.xa@renesas.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260828145943.2077589-1-cosmin-gabriel.tanislav.xa@renesas.com> References: <20260828145943.2077589-1-cosmin-gabriel.tanislav.xa@renesas.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TY1PEPF0000BAD9:EE_|TYCPR01MB8326:EE_ X-MS-Office365-Filtering-Correlation-Id: 1a7f750d-25b3-4d9e-852b-08df0515367c X-LD-Processed: 53d82571-da19-47e4-9cb4-625a166a4a2a,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700016|376014|7416014|1800799024|23010399003|82310400026|10067099003|11063799006|56012099006|22082099003|18002099003; X-Microsoft-Antispam-Message-Info: itRVB+HY3qJ/CrKRxudLnGlsR37I0/SVm/i5f9SxtYmvUCfsQsWkVkQwpX0dcguAXMDCh835IN/2AMeSPgoegdjsoiuOUfUWNf+RcGoo0v3JtLfqDoG93DU0TAUd9zNsRjCAjnoNijxMzv0m/VH57lpNbSruV98AQCr6Wh8EGB5rrpmczVLZpwL64OGo3mbXQdnjHTcth9fQA7JGQQNli+T44hzNe11Za47r95/MF9z5hcXlHe2RxdmP8F2bnJM8opIi8QQGo3VbOSP+Zgz+OIYYPZsW83FVl29w7UJ60pWuV9oUDGCivHwfRNtr8OrfRjXq7eFoG4aIcxVwfEE0fyq/AVq4czFGDkW8jyB78th7qq/giBMX445jypnsePWM9dr4/5dLPYiy37VuVOU4FhdzOnhWZ2Z9xNVCBOw8dKXKkHgdLeTM0deVKmpwu8RN2ZV6TsvqU4KEXRQFnsCjEm7CQz7c3eG6/m0JWTpeQtLKDOCaGjwTh620XE9g34s7uVoTiIkmJ0272eXnXhx+2PFQ1Vm+IxL9Er6/U0tiJy7Iy9wId+kx6j2NDhxo4Ap1O1qrQ+oSKmud57XoPztnWc23o94uYSwZlNy/BKXTSnLrpmAnvw7KG210r/vX6fHmHCYgBsvemB3GKAxEG33u3/4FVfJc2s+5Bwugd/Dr3N6Drjg4PPzCZLJSgyGOyjViOyaLfZdgz1EyVoafUNQR8Q== X-Forefront-Antispam-Report: CIP:8.62.32.50;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:ejcrelay004p.adwin.renesas.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(36860700016)(376014)(7416014)(1800799024)(23010399003)(82310400026)(10067099003)(11063799006)(56012099006)(22082099003)(18002099003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: AeFKJ58CIqMHwECR+MyO9QTJUhdTIAInYzttUssTYSLtQ5BawbH9MeEKirNRxnObymSwRqQRFCX92/CnFoxYLZBqPtcHP3DTKClFHcg8MJmOiPmcdi3L6QgDRgSlrhNJ0QibjlJdSZYl0J2tYCrS2jo5KxPqMOW7brqLNAKpluAsBnHomP+jDnAlB0ypAtjdngciNlTSroZEX0lOqX7DE2xXJ/64jYCAKqLNDoGsr2Q79PLQJedZGWLibfXJ6Pkcl3AlTdGV/eFlnZ3k1mgaodokEGLiniKKqJ/ZkX5iYIlI2sCnOxfhU/vKgdwgn0tzDzxkx/NjS8vhPaHmJESKInXzDpj3YFieC0hb/Ny7aVpiIKemXkcDIafyHKNSkSThWI7qMHZkozEwkN289qd6iAqtVwGjORebhQGJM/oe5+GE0d/gr82IENNwEE5Quf6X X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Aug 2026 15:01:17.5960 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1a7f750d-25b3-4d9e-852b-08df0515367c X-MS-Exchange-CrossTenant-Id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=53d82571-da19-47e4-9cb4-625a166a4a2a;Ip=[8.62.32.50];Helo=[ejcrelay004p.adwin.renesas.com] X-MS-Exchange-CrossTenant-AuthSource: TY1PEPF0000BAD9.JPNP286.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCPR01MB8326 Content-Type: text/plain; charset="utf-8" Implement buffered capture using a cyclic DMA transfer into a kfifo buffer to support continuous high-rate sampling. On buffer enable, switch the ADC to continuous conversion mode and start a cyclic DMA transfer over the active channels. Because the DMA controller does not support native scatter-gather, and because of the cyclic DMA setup, transfers must be done in widths covering all the enabled channels. Since DMA transfer width must be a power of two and aligned to its size, cover the smallest power-of-two-aligned group of channel registers spanning the enabled channels. Split the cyclic buffer into fixed-size periods. On each period completion, bump a pending counter and wake a consumer kthread from the DMA callback. For every completed period, gather the enabled channels out of the DMA layout into the scan layout the IIO core expects and push each scan with iio_push_to_buffers(). If the consumer kthread falls behind by a full buffer, drop the oldest periods. Because the DMA transfer must cover all channels between the first and last enabled ones, skip disabled channels while compacting. Also, the DMA controller transfers data in 32-bit words, but the ADC's data registers are 16-bit wide, causing adjacent channel data to be swapped. Swap consecutive channels while compacting to account for this. Allocate the DMA buffer via dma_alloc_noncoherent() and synchronise it per period to allow it to be cached by the CPU while compacting. Disable the completion IRQ for the duration of the DMA transfer, as the ICU does not mask this event from reaching the GIC even if it is being used to drive the DMA capture. Signed-off-by: Cosmin Tanislav --- drivers/iio/adc/Kconfig | 2 + drivers/iio/adc/rzt2h_adc.c | 339 ++++++++++++++++++++++++++++++++++++ 2 files changed, 341 insertions(+) diff --git a/drivers/iio/adc/Kconfig b/drivers/iio/adc/Kconfig index 415e519ad4eb..6c7b30d2b6e7 100644 --- a/drivers/iio/adc/Kconfig +++ b/drivers/iio/adc/Kconfig @@ -1551,6 +1551,8 @@ config RZT2H_ADC tristate "Renesas RZ/T2H / RZ/N2H ADC driver" depends on ARCH_RENESAS || COMPILE_TEST select IIO_ADC_HELPER + select IIO_BUFFER + select IIO_KFIFO_BUF help Say yes here to build support for the ADC found in Renesas RZ/T2H / RZ/N2H SoCs. diff --git a/drivers/iio/adc/rzt2h_adc.c b/drivers/iio/adc/rzt2h_adc.c index 95bcebdc02cb..d76226375f22 100644 --- a/drivers/iio/adc/rzt2h_adc.c +++ b/drivers/iio/adc/rzt2h_adc.c @@ -4,11 +4,16 @@ #include #include #include +#include +#include #include +#include #include +#include #include #include #include +#include #include #include #include @@ -18,6 +23,7 @@ #define RZT2H_ADCSR_ADIE_MASK BIT(12) #define RZT2H_ADCSR_ADCS_MASK GENMASK(14, 13) #define RZT2H_ADCSR_ADCS_SINGLE 0b00 +#define RZT2H_ADCSR_ADCS_CONTINUOUS 0b10 #define RZT2H_ADCSR_ADST_MASK BIT(15) =20 #define RZT2H_ADANSA0_REG 0x04 @@ -31,18 +37,47 @@ #define RZT2H_ADCALCTL_CAL_ERR_MASK BIT(2) =20 #define RZT2H_ADC_MAX_CHANNELS 16 +#define RZT2H_ADC_CHANNEL_BYTES sizeof(u16) +#define RZT2H_ADC_DMA_PERIOD_SAMPLES 128 +#define RZT2H_ADC_DMA_PERIODS 64 +#define RZT2H_ADC_DMA_BUFFER_SAMPLES (RZT2H_ADC_DMA_PERIODS * \ + RZT2H_ADC_DMA_PERIOD_SAMPLES) +#define RZT2H_ADC_DMA_BUFFER_SIZE (RZT2H_ADC_DMA_BUFFER_SAMPLES * \ + RZT2H_ADC_MAX_CHANNELS * \ + RZT2H_ADC_CHANNEL_BYTES) + +struct rzt2h_adc_dma { + struct dma_chan *chan; + u16 *buf; + dma_addr_t addr; + + unsigned int period_index; + unsigned int period_bytes; + unsigned int first_chan; + unsigned int sample_chans; + + u8 gather[RZT2H_ADC_MAX_CHANNELS]; + unsigned int gather_len; + + atomic_t pending_periods; + + wait_queue_head_t wq; + struct task_struct *thread; +}; =20 struct rzt2h_adc { void __iomem *base; struct device *dev; =20 phys_addr_t phys_base; + struct rzt2h_adc_dma dma; struct completion completion; /* lock to protect against multiple access to the device */ struct mutex lock; =20 const struct iio_chan_spec *channels; unsigned int num_channels; + u16 buf[RZT2H_ADC_MAX_CHANNELS]; =20 int irq; }; @@ -151,6 +186,253 @@ static int rzt2h_adc_calibrate(struct rzt2h_adc *adc) return 0; } =20 +static void rzt2h_adc_push_period(struct iio_dev *indio_dev, u16 *period, + dma_addr_t addr) +{ + struct rzt2h_adc *adc =3D iio_priv(indio_dev); + u16 *dst =3D adc->buf; + u16 *src =3D period; + + dma_sync_single_for_cpu(adc->dev, addr, adc->dma.period_bytes, + DMA_FROM_DEVICE); + + for (unsigned int sample =3D 0; sample < RZT2H_ADC_DMA_PERIOD_SAMPLES; sa= mple++) { + for (unsigned int i =3D 0; i < adc->dma.gather_len; i++) + dst[i] =3D src[adc->dma.gather[i]]; + + src +=3D adc->dma.sample_chans; + + iio_push_to_buffers(indio_dev, adc->buf); + } +} + +static void rzt2h_adc_advance_period_index(struct rzt2h_adc *adc, unsigned= int i) +{ + adc->dma.period_index +=3D i; + adc->dma.period_index %=3D RZT2H_ADC_DMA_PERIODS; +} + +static void rzt2h_adc_dma_thread_loop(struct iio_dev *indio_dev) +{ + struct rzt2h_adc *adc =3D iio_priv(indio_dev); + int pending, drop; + dma_addr_t addr; + u16 *period; + + pending =3D atomic_xchg(&adc->dma.pending_periods, 0); + + if (pending >=3D RZT2H_ADC_DMA_PERIODS) { + drop =3D pending - RZT2H_ADC_DMA_PERIODS + 1; + + rzt2h_adc_advance_period_index(adc, drop); + pending -=3D drop; + } + + for (unsigned int i =3D 0; i < pending; i++) { + unsigned int backlog =3D atomic_read(&adc->dma.pending_periods) + + pending - i; + + /* + * Bail if enough new periods have completed since reading the + * pending_periods that the next period about to be read is at + * risk of being overwritten. + */ + if (backlog >=3D RZT2H_ADC_DMA_PERIODS) + break; + + period =3D adc->dma.buf + adc->dma.period_index * + RZT2H_ADC_DMA_PERIOD_SAMPLES * adc->dma.sample_chans; + addr =3D adc->dma.addr + adc->dma.period_index * + adc->dma.period_bytes; + + rzt2h_adc_push_period(indio_dev, period, addr); + rzt2h_adc_advance_period_index(adc, 1); + } +} + +static int rzt2h_adc_dma_thread(void *data) +{ + struct iio_dev *indio_dev =3D data; + struct rzt2h_adc *adc =3D iio_priv(indio_dev); + + while (!kthread_should_stop()) { + wait_event_interruptible(adc->dma.wq, + atomic_read(&adc->dma.pending_periods) || + kthread_should_stop()); + + if (kthread_should_stop()) + break; + + rzt2h_adc_dma_thread_loop(indio_dev); + } + + return 0; +} + +static void rzt2h_adc_dma_callback(void *data) +{ + struct iio_dev *indio_dev =3D data; + struct rzt2h_adc *adc =3D iio_priv(indio_dev); + + atomic_inc(&adc->dma.pending_periods); + wake_up(&adc->dma.wq); +} + +static void rzt2h_adc_dma_calc_layout(struct iio_dev *indio_dev) +{ + struct rzt2h_adc *adc =3D iio_priv(indio_dev); + unsigned int hi =3D 0, lo =3D RZT2H_ADC_MAX_CHANNELS - 1; + const struct iio_chan_spec *chan; + unsigned int sample_chans; + unsigned int first_chan; + unsigned int scan_index; + unsigned int swap; + unsigned int idx; + + /* Find the lowest and highest enabled channel. */ + iio_for_each_active_channel(indio_dev, scan_index) { + chan =3D &indio_dev->channels[scan_index]; + + lo =3D min_t(unsigned int, lo, chan->channel); + hi =3D max_t(unsigned int, hi, chan->channel); + } + + /* + * The DMA has no scatter-gather and transfers must have a power-of-two + * width, so pick the smallest power-of-two-aligned block of channels + * that covers all enabled channels. + */ + for (sample_chans =3D 1; sample_chans < RZT2H_ADC_MAX_CHANNELS; sample_ch= ans <<=3D 1) { + first_chan =3D round_down(lo, sample_chans); + + if (first_chan + sample_chans > hi) + break; + } + + /* + * Build a table to map each enabled channel to its position in the + * transferred block, it will be used later to extract only the enabled + * channels out of it. + * The DMA moves data in 32-bit words, which swaps each pair of adjacent + * 16-bit channels. Undo it. + */ + adc->dma.gather_len =3D 0; + swap =3D sample_chans > 1; + iio_for_each_active_channel(indio_dev, scan_index) { + chan =3D &indio_dev->channels[scan_index]; + idx =3D chan->channel - first_chan; + + adc->dma.gather[adc->dma.gather_len++] =3D idx ^ swap; + } + + adc->dma.first_chan =3D first_chan; + adc->dma.sample_chans =3D sample_chans; + adc->dma.period_bytes =3D RZT2H_ADC_DMA_PERIOD_SAMPLES * sample_chans * + RZT2H_ADC_CHANNEL_BYTES; +} + +static int rzt2h_adc_start_dma(struct iio_dev *indio_dev) +{ + struct rzt2h_adc *adc =3D iio_priv(indio_dev); + struct dma_async_tx_descriptor *desc; + struct dma_slave_config config =3D {}; + unsigned int buffer_bytes; + dma_cookie_t cookie; + int ret; + + rzt2h_adc_dma_calc_layout(indio_dev); + + config.src_addr =3D adc->phys_base + RZT2H_ADDR_REG(adc->dma.first_chan); + config.src_addr_width =3D adc->dma.sample_chans * RZT2H_ADC_CHANNEL_BYTES; + + buffer_bytes =3D RZT2H_ADC_DMA_PERIODS * adc->dma.period_bytes; + + ret =3D dmaengine_slave_config(adc->dma.chan, &config); + if (ret) + return ret; + + desc =3D dmaengine_prep_dma_cyclic(adc->dma.chan, adc->dma.addr, + buffer_bytes, adc->dma.period_bytes, + DMA_DEV_TO_MEM, DMA_PREP_INTERRUPT); + if (!desc) + return -EBUSY; + + desc->callback =3D rzt2h_adc_dma_callback; + desc->callback_param =3D indio_dev; + + cookie =3D dmaengine_submit(desc); + ret =3D dma_submit_error(cookie); + if (ret) { + dmaengine_terminate_sync(adc->dma.chan); + return ret; + } + + adc->dma.thread =3D kthread_run(rzt2h_adc_dma_thread, indio_dev, + "rzt2h-adc-dma"); + if (IS_ERR(adc->dma.thread)) { + dmaengine_terminate_sync(adc->dma.chan); + return PTR_ERR(adc->dma.thread); + } + + disable_irq(adc->irq); + + dma_async_issue_pending(adc->dma.chan); + + return 0; +} + +static int rzt2h_adc_buffer_postenable(struct iio_dev *indio_dev) +{ + struct rzt2h_adc *adc =3D iio_priv(indio_dev); + const struct iio_chan_spec *chan; + struct device *dev =3D adc->dev; + unsigned int scan_index; + u16 val =3D 0; + int ret; + + ret =3D pm_runtime_resume_and_get(dev); + if (ret) + return ret; + + iio_for_each_active_channel(indio_dev, scan_index) { + chan =3D &indio_dev->channels[scan_index]; + val |=3D RZT2H_ADANSA0_CH_MASK(chan->channel); + } + + writew(val, adc->base + RZT2H_ADANSA0_REG); + + adc->dma.period_index =3D 0; + atomic_set(&adc->dma.pending_periods, 0); + + ret =3D rzt2h_adc_start_dma(indio_dev); + if (ret) { + pm_runtime_put_autosuspend(dev); + return ret; + } + + rzt2h_adc_start(adc, RZT2H_ADCSR_ADCS_CONTINUOUS); + + return 0; +} + +static int rzt2h_adc_buffer_predisable(struct iio_dev *indio_dev) +{ + struct rzt2h_adc *adc =3D iio_priv(indio_dev); + struct device *dev =3D adc->dev; + + rzt2h_adc_stop(adc); + + dmaengine_terminate_sync(adc->dma.chan); + + kthread_stop(adc->dma.thread); + + enable_irq(adc->irq); + + pm_runtime_put_autosuspend(dev); + + return 0; +} + static int rzt2h_adc_read_raw(struct iio_dev *indio_dev, struct iio_chan_spec const *chan, int *val, int *val2, long mask) @@ -174,6 +456,11 @@ static int rzt2h_adc_read_raw(struct iio_dev *indio_de= v, } } =20 +static const struct iio_buffer_setup_ops rzt2h_adc_buffer_setup_ops =3D { + .postenable =3D rzt2h_adc_buffer_postenable, + .predisable =3D rzt2h_adc_buffer_predisable, +}; + static const struct iio_info rzt2h_adc_iio_info =3D { .read_raw =3D rzt2h_adc_read_raw, }; @@ -192,6 +479,12 @@ static const struct iio_chan_spec rzt2h_adc_chan_templ= ate =3D { .info_mask_separate =3D BIT(IIO_CHAN_INFO_RAW) | BIT(IIO_CHAN_INFO_SCALE), .type =3D IIO_VOLTAGE, + .scan_type =3D { + .sign =3D 'u', + .realbits =3D 12, + .storagebits =3D 16, + .endianness =3D IIO_CPU, + }, }; =20 static int rzt2h_adc_parse_properties(struct rzt2h_adc *adc) @@ -209,9 +502,50 @@ static int rzt2h_adc_parse_properties(struct rzt2h_adc= *adc) adc->num_channels =3D ret; adc->channels =3D chan_array; =20 + for (unsigned int i =3D 0; i < adc->num_channels; i++) + chan_array[i].scan_index =3D i; + return 0; } =20 +static void rzt2h_adc_free_dma_buf(void *p) +{ + struct rzt2h_adc *adc =3D p; + + dma_free_noncoherent(adc->dev, RZT2H_ADC_DMA_BUFFER_SIZE, + adc->dma.buf, adc->dma.addr, DMA_FROM_DEVICE); +} + +static int rzt2h_adc_setup_dma(struct iio_dev *indio_dev) +{ + struct rzt2h_adc *adc =3D iio_priv(indio_dev); + struct device *dev =3D adc->dev; + int ret; + + adc->dma.chan =3D devm_dma_request_chan(adc->dev, "rx"); + if (IS_ERR(adc->dma.chan)) { + ret =3D PTR_ERR(adc->dma.chan); + if (ret !=3D -ENODEV) + return dev_err_probe(adc->dev, ret, "DMA channel request failed\n"); + + adc->dma.chan =3D NULL; + return 0; + } + + adc->dma.buf =3D dma_alloc_noncoherent(adc->dev, RZT2H_ADC_DMA_BUFFER_SIZ= E, + &adc->dma.addr, DMA_FROM_DEVICE, + GFP_KERNEL); + if (!adc->dma.buf) + return -ENOMEM; + + ret =3D devm_add_action_or_reset(adc->dev, rzt2h_adc_free_dma_buf, adc); + if (ret) + return ret; + + return devm_iio_kfifo_buffer_setup_ext(dev, indio_dev, + &rzt2h_adc_buffer_setup_ops, NULL); +} + static int rzt2h_adc_probe(struct platform_device *pdev) { struct device *dev =3D &pdev->dev; @@ -227,6 +561,7 @@ static int rzt2h_adc_probe(struct platform_device *pdev) adc =3D iio_priv(indio_dev); adc->dev =3D dev; init_completion(&adc->completion); + init_waitqueue_head(&adc->dma.wq); =20 ret =3D devm_mutex_init(dev, &adc->lock); if (ret) @@ -264,6 +599,10 @@ static int rzt2h_adc_probe(struct platform_device *pde= v) indio_dev->channels =3D adc->channels; indio_dev->num_channels =3D adc->num_channels; =20 + ret =3D rzt2h_adc_setup_dma(indio_dev); + if (ret) + return ret; + return devm_iio_device_register(dev, indio_dev); } =20 --=20 2.55.0 From nobody Sat Sep 26 22:58:21 2026 Received: from TY3P286CU002.outbound.protection.outlook.com (mail-japaneastazon11010017.outbound.protection.outlook.com [52.101.229.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CCB3E4746BA; Fri, 28 Aug 2026 15:01:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.229.17 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787929292; cv=fail; b=aVZ/cxczmEFxedT4bsZ5RJ65f5mc/T7YFyrJyELudIz03Z8qrol6TeEXyneap/8Dbmw3+0unsO8kuF/r3YywJVQ++/gzsJ7OzU3JN5/OEElst75Ydg7IiMc6kcdhTM0SCnMEyEHYvE6mHrHOTPQXMxSmz5yNF4Xk/nGQocTLjzM= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787929292; c=relaxed/simple; bh=c4hLos7XUF1ogAnLG82DrbmWK9GlnSq1SUE5kS9Ayl4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=cizLtSFGuUpIIGiXDLQ0RYEvALToaobzYKhDKFX2FSncY+T2iXDsaxv6QHmRsHmHuG34QJqru75eo5twyfVgXjnXIOvr9PP9n+TGqH03uBNYUqyK3GJIWO6sJS7vQGpW80oLpywKpsPch/Xkdn0O8MBOHCCGv/gE/BN+QFH+3Mw= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com; spf=pass smtp.mailfrom=renesas.com; dkim=pass (1024-bit key) header.d=renesas.com header.i=@renesas.com header.b=LJHU3GR4; arc=fail smtp.client-ip=52.101.229.17 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=renesas.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=renesas.com header.i=@renesas.com header.b="LJHU3GR4" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=JLM8kHMVaRsiVxcooNvc5wmLYrzywvpPrKALlwrTWMVqA3vTr9XjBuRjK41IgRdSdLiqrUQdHaC3PIteZFLj1BAl5a9KGV1/qzReK5nNaUGchsO1Eh6DeSwsw9xW0U6WfFbbJIINxOtTySC4mPuUBnfM+3tHSUcc1quxAWIPfS3PhFMMFz2dpikihfy4Pv9p6vR3oif84VDt62JqFVA8vUZ3WWz22UpcTg2gPYDtwDOjhUXXQrvQZXQcbl7fVzlYtCiT236e+chsZV7JBhbwomHXPjauW5nRWITUq4Fxa/A3B9aTiT6KMZI1z+Ll6UWtRjtOleBL78uYhN/pgT6qCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=Ph4qVJGbYA2CKAapsQj6lrcZIAPn3Cwri48KFw9W2+s=; b=RklZ+lInb4eoDcEJ3op+sHCG9X34R2plsYLvG7eoAHzCWaj9yg4/6W4Z9zBaBpq+hyiifsTAeJV3BrVOfGNz+5ljHlN22B5+/m69+7Nmwf/jRxkAFxZbKuSUz/0qnliajstcC6Kmym7B/t7S6ijC4PK16wH8UjwB+SoaTG4i6dnym+NzlR+gSx2dOvv1orIZ9fJS3dir/gtpfj3uO/T/hyE3GIiJuzMAy8AOdxr6STjIHHDdodtvfucdPyinLpMUT9fVLtp0foo7mU/eBiyj4tOUYb9Fsy6URg9xSHK3THYpJw4nElLZx42F7XpdoFojTqhdTWUef5BGJQSPFRh1tw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 8.62.32.50) smtp.rcpttodomain=analog.com smtp.mailfrom=renesas.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=renesas.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesas.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Ph4qVJGbYA2CKAapsQj6lrcZIAPn3Cwri48KFw9W2+s=; b=LJHU3GR4t9C7qFCRzN5pYv0mjqoCku6Ha7HhQnQduNXjvw49RNs5IddPzMogvqvIy3+KtXH/Ktad+Y9/nUmPSp9A1uL2d1FGdmjNQjSwKY3JpdGTl6o8ANpYd53TopWv89KApT7bL1higFb6sHJn2DQarsOT5juwqVz/h5SFdMk= Received: from OS3PR01CA0039.jpnprd01.prod.outlook.com (2603:1096:604:dd::8) by TYYPR01MB8094.jpnprd01.prod.outlook.com (2603:1096:400:fb::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.360.11; Fri, 28 Aug 2026 15:01:24 +0000 Received: from OS1PEPF0000D214.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:dd:cafe::41) by OS3PR01CA0039.outlook.office365.com (2603:1096:604:dd::8) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.360.11 via Frontend Transport; Fri, 28 Aug 2026 15:01:24 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 8.62.32.50) smtp.mailfrom=renesas.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=renesas.com; Received-SPF: Pass (protection.outlook.com: domain of renesas.com designates 8.62.32.50 as permitted sender) receiver=protection.outlook.com; client-ip=8.62.32.50; helo=ejcrelay004p.adwin.renesas.com; pr=E Received: from ejcrelay004p.adwin.renesas.com (8.62.32.50) by OS1PEPF0000D214.mail.protection.outlook.com (10.167.240.21) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.382.8 via Frontend Transport; Fri, 28 Aug 2026 15:01:23 +0000 Received: from demon-pc (REE-0055761.adwin.renesas.com [10.226.92.7]) by ejcrelay004p.adwin.renesas.com (Postfix) with ESMTP id 9AF13300036C; Sat, 29 Aug 2026 00:01:18 +0900 (JST) From: Cosmin Tanislav To: Jonathan Cameron , David Lechner , =?UTF-8?q?Nuno=20S=C3=A1?= , Andy Shevchenko , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Geert Uytterhoeven , Magnus Damm Cc: linux-iio@vger.kernel.org, linux-renesas-soc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Cosmin Tanislav Subject: [PATCH 6/9] iio: adc: rzt2h: expose sampling frequency Date: Fri, 28 Aug 2026 17:59:39 +0300 Message-ID: <20260828145943.2077589-7-cosmin-gabriel.tanislav.xa@renesas.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260828145943.2077589-1-cosmin-gabriel.tanislav.xa@renesas.com> References: <20260828145943.2077589-1-cosmin-gabriel.tanislav.xa@renesas.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: OS1PEPF0000D214:EE_|TYYPR01MB8094:EE_ X-MS-Office365-Filtering-Correlation-Id: b0095ca7-ef9f-48b9-22db-08df051539d1 X-LD-Processed: 53d82571-da19-47e4-9cb4-625a166a4a2a,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700016|82310400026|7416014|376014|1800799024|23010399003|10067099003|56012099006|11063799006|6133799003|22082099003|18002099003; X-Microsoft-Antispam-Message-Info: jJiy5NYQZyPR8wq7oK6xJV9IOPdambjxYVXhhtHKSxQby/Vd7S7kqVJOX5Mk89M30PITaUD3t12F74jrlc7DeaQO4EBwm9mmjDDUA58/FUEGEMm7vc5NvhFumru/mZWy+WTcplRp9l79ArfqDKZ2Z3Z4JAlw0gV5tgXI4T7qVhjF6BQw/ZEL7d85boYGwWxA3lMLhqNAkmEhkpm3tQYkRntB+fdhueosgB2HGdb/t2V4zc6iVL45s5RKo5fKWSUMLO+kNml8xxAuGb++Bg6IjVah7WoU8DZQNJxQ2pMhCXan6xj7Cpbfwm+xo3mxvfj2s5zm9cc5CFWo6/GLlqkvkX6ycgVLeIkGTzoU2SHrw3gpyvbldeTAHgFTwoysTgoMUMUM46N5r7qme4P7N30z+BjCDqcy0Y4q0h4f+h0NKawWSfCUZEJTC6O35oAVaH/FVoBCodpktv9/h8LBZorK1EhZeoHDPpyZLJeWD+2Bliiv4Ibxq2ZSqjJmrUKCfEK/e2aDnrHtP7z/zgpNdMD5k0leqzf4s/3FC9ngUce2v1Xn7n1xg4q75kAFrCkncPXA1e5uQ05wBeZ1/kE/En00ovRfrl+WM7ZnuOvLTWDbYyYZNy52KaSLu+YF8gD0NTR+fj4WnNByi7SiKV3iBCkp4/asJYbI7Qj87fNBEw9GzU6HR7euYgiSSG6RuB3x5k6RQVZNCbLXQvKRZKVGK/X6nQ== X-Forefront-Antispam-Report: CIP:8.62.32.50;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:ejcrelay004p.adwin.renesas.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(36860700016)(82310400026)(7416014)(376014)(1800799024)(23010399003)(10067099003)(56012099006)(11063799006)(6133799003)(22082099003)(18002099003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: tHaO6OqBvsB3I9AJqWvgOpSPyZTS5mg06idJ2VykPtS5+efaPpcLLFTGarI+vvhD9GjoxMWXWQS5/nsVhWtblxniGCfaopW1WCc7LgR7BxJZ0HYJEMDa2454xHMxC6lfA+jHuzNFYR+Drqie5PEH4mOJJUiKwmpBscZRWkPx3m8pA49tUoCF3PaMlMXhKjDmd3Wx73WL4KZ5OqDy4ItEPckEsouzQiqtjn4iJz52eOVzawOu9obS1Znv7Z3YBdTOMp7aymCCcGbnxoXadhM4cStyAE7N1vvdk2ufM/yI7EyrklWEsg5MExRBlVqm/FrW+YAptuuKAkgk7YyJdJg7lOaPT0HkUlt8D/Dxd+sh9qLkkKTrwdiB8MhlzJNgWR1r2QNZ2lxIvxOoMzamTy2f8l2fVjBAxxbw0a1NS8H0r31lP5BiisJS8JiYjCoAwjcW X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Aug 2026 15:01:23.1623 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b0095ca7-ef9f-48b9-22db-08df051539d1 X-MS-Exchange-CrossTenant-Id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=53d82571-da19-47e4-9cb4-625a166a4a2a;Ip=[8.62.32.50];Helo=[ejcrelay004p.adwin.renesas.com] X-MS-Exchange-CrossTenant-AuthSource: OS1PEPF0000D214.JPNP286.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYYPR01MB8094 Content-Type: text/plain; charset="utf-8" Expose the sampling frequency as a per-channel IIO_CHAN_INFO_SAMP_FREQ to let userspace control conversion time. Each channel conversion takes a fixed 13 ADCLK cycles plus the sample time programmed in ADSSTRn, giving a rate of ADCLK / (13 + ADSSTRn). Read the ADCLK rate from the "adclk" clock to derive the frequency. Claim direct mode while writing so the rate cannot change during a capture. Program the sample time into ADSSTRn for each enabled channel on single reads and on buffer enable. Signed-off-by: Cosmin Tanislav --- drivers/iio/adc/rzt2h_adc.c | 111 +++++++++++++++++++++++++++++++++++- 1 file changed, 109 insertions(+), 2 deletions(-) diff --git a/drivers/iio/adc/rzt2h_adc.c b/drivers/iio/adc/rzt2h_adc.c index d76226375f22..2e13f931a2e9 100644 --- a/drivers/iio/adc/rzt2h_adc.c +++ b/drivers/iio/adc/rzt2h_adc.c @@ -2,6 +2,7 @@ =20 #include #include +#include #include #include #include @@ -31,6 +32,18 @@ =20 #define RZT2H_ADDR_REG(x) (0x20 + 0x2 * (x)) =20 +#define RZT2H_ADSSTRn(n) (0xe0 + 0x1 * (n)) + +/* + * Each A/D channel conversion takes a fixed base of 13 ADCLK cycles plus = the + * sample time programmed in ADSSTRn, giving a conversion rate of + * ADCLK / (13 + ADSSTRn). + */ +#define RZT2H_ADC_CONV_CYCLES_BASE 13 +#define RZT2H_ADC_SST_MIN 0x7 +#define RZT2H_ADC_SST_MAX 0xff +#define RZT2H_ADC_SST_DEFAULT 0xb + #define RZT2H_ADCALCTL_REG 0x1f0 #define RZT2H_ADCALCTL_CAL_MASK BIT(0) #define RZT2H_ADCALCTL_CAL_RDY_MASK BIT(1) @@ -79,6 +92,10 @@ struct rzt2h_adc { unsigned int num_channels; u16 buf[RZT2H_ADC_MAX_CHANNELS]; =20 + unsigned long adclk_rate; + int samp_freq_avail[3]; + u8 sst[RZT2H_ADC_MAX_CHANNELS]; + int irq; }; =20 @@ -109,6 +126,11 @@ static void rzt2h_adc_stop(struct rzt2h_adc *adc) writew(reg, adc->base + RZT2H_ADCSR_REG); } =20 +static void rzt2h_adc_set_sst(struct rzt2h_adc *adc, unsigned int ch, u8 s= st) +{ + writeb(sst, adc->base + RZT2H_ADSSTRn(ch)); +} + static int rzt2h_adc_read_single(struct rzt2h_adc *adc, unsigned int ch, i= nt *val) { int ret; @@ -124,6 +146,8 @@ static int rzt2h_adc_read_single(struct rzt2h_adc *adc,= unsigned int ch, int *va /* Enable a single channel */ writew(RZT2H_ADANSA0_CH_MASK(ch), adc->base + RZT2H_ADANSA0_REG); =20 + rzt2h_adc_set_sst(adc, ch, adc->sst[ch]); + rzt2h_adc_start(adc, RZT2H_ADCSR_ADCS_SINGLE); =20 /* @@ -397,6 +421,7 @@ static int rzt2h_adc_buffer_postenable(struct iio_dev *= indio_dev) iio_for_each_active_channel(indio_dev, scan_index) { chan =3D &indio_dev->channels[scan_index]; val |=3D RZT2H_ADANSA0_CH_MASK(chan->channel); + rzt2h_adc_set_sst(adc, chan->channel, adc->sst[chan->channel]); } =20 writew(val, adc->base + RZT2H_ADANSA0_REG); @@ -433,6 +458,23 @@ static int rzt2h_adc_buffer_predisable(struct iio_dev = *indio_dev) return 0; } =20 +static int rzt2h_adc_sst_to_freq(struct rzt2h_adc *adc, u8 sst) +{ + return adc->adclk_rate / (RZT2H_ADC_CONV_CYCLES_BASE + sst); +} + +static u8 rzt2h_adc_freq_to_sst(struct rzt2h_adc *adc, int freq) +{ + unsigned int cycles; + + cycles =3D DIV_ROUND_CLOSEST(adc->adclk_rate, freq); + cycles =3D clamp_val(cycles, + RZT2H_ADC_CONV_CYCLES_BASE + RZT2H_ADC_SST_MIN, + RZT2H_ADC_CONV_CYCLES_BASE + RZT2H_ADC_SST_MAX); + + return cycles - RZT2H_ADC_CONV_CYCLES_BASE; +} + static int rzt2h_adc_read_raw(struct iio_dev *indio_dev, struct iio_chan_spec const *chan, int *val, int *val2, long mask) @@ -451,6 +493,51 @@ static int rzt2h_adc_read_raw(struct iio_dev *indio_de= v, *val =3D 1800; *val2 =3D 12; return IIO_VAL_FRACTIONAL_LOG2; + case IIO_CHAN_INFO_SAMP_FREQ: + *val =3D rzt2h_adc_sst_to_freq(adc, adc->sst[chan->channel]); + return IIO_VAL_INT; + default: + return -EINVAL; + } +} + +static int rzt2h_adc_write_raw(struct iio_dev *indio_dev, + struct iio_chan_spec const *chan, + int val, int val2, long mask) +{ + struct rzt2h_adc *adc =3D iio_priv(indio_dev); + + switch (mask) { + case IIO_CHAN_INFO_SAMP_FREQ: { + if (val <=3D 0) + return -EINVAL; + + IIO_DEV_ACQUIRE_DIRECT_MODE(indio_dev, claim); + if (IIO_DEV_ACQUIRE_FAILED(claim)) + return -EBUSY; + + adc->sst[chan->channel] =3D rzt2h_adc_freq_to_sst(adc, val); + + return 0; + } + default: + return -EINVAL; + } +} + +static int rzt2h_adc_read_avail(struct iio_dev *indio_dev, + struct iio_chan_spec const *chan, + const int **vals, int *type, int *length, + long mask) +{ + struct rzt2h_adc *adc =3D iio_priv(indio_dev); + + switch (mask) { + case IIO_CHAN_INFO_SAMP_FREQ: + *vals =3D adc->samp_freq_avail; + *type =3D IIO_VAL_INT; + *length =3D ARRAY_SIZE(adc->samp_freq_avail); + return IIO_AVAIL_RANGE; default: return -EINVAL; } @@ -463,6 +550,8 @@ static const struct iio_buffer_setup_ops rzt2h_adc_buff= er_setup_ops =3D { =20 static const struct iio_info rzt2h_adc_iio_info =3D { .read_raw =3D rzt2h_adc_read_raw, + .write_raw =3D rzt2h_adc_write_raw, + .read_avail =3D rzt2h_adc_read_avail, }; =20 static irqreturn_t rzt2h_adc_isr(int irq, void *private) @@ -477,7 +566,9 @@ static irqreturn_t rzt2h_adc_isr(int irq, void *private) static const struct iio_chan_spec rzt2h_adc_chan_template =3D { .indexed =3D 1, .info_mask_separate =3D BIT(IIO_CHAN_INFO_RAW) | - BIT(IIO_CHAN_INFO_SCALE), + BIT(IIO_CHAN_INFO_SCALE) | + BIT(IIO_CHAN_INFO_SAMP_FREQ), + .info_mask_separate_available =3D BIT(IIO_CHAN_INFO_SAMP_FREQ), .type =3D IIO_VOLTAGE, .scan_type =3D { .sign =3D 'u', @@ -502,8 +593,11 @@ static int rzt2h_adc_parse_properties(struct rzt2h_adc= *adc) adc->num_channels =3D ret; adc->channels =3D chan_array; =20 - for (unsigned int i =3D 0; i < adc->num_channels; i++) + for (unsigned int i =3D 0; i < adc->num_channels; i++) { + adc->sst[chan_array[i].channel] =3D RZT2H_ADC_SST_DEFAULT; + chan_array[i].scan_index =3D i; + } =20 return 0; } @@ -552,6 +646,7 @@ static int rzt2h_adc_probe(struct platform_device *pdev) struct iio_dev *indio_dev; struct rzt2h_adc *adc; struct resource *res; + struct clk *adclk; int ret; =20 indio_dev =3D devm_iio_device_alloc(dev, sizeof(*adc)); @@ -579,6 +674,18 @@ static int rzt2h_adc_probe(struct platform_device *pde= v) =20 adc->phys_base =3D res->start; =20 + adclk =3D devm_clk_get(dev, "adclk"); + if (IS_ERR(adclk)) + return dev_err_probe(dev, PTR_ERR(adclk), "failed to get adclk\n"); + + adc->adclk_rate =3D clk_get_rate(adclk); + if (!adc->adclk_rate) + return dev_err_probe(dev, -EINVAL, "invalid adclk rate\n"); + + adc->samp_freq_avail[0] =3D rzt2h_adc_sst_to_freq(adc, RZT2H_ADC_SST_MAX); + adc->samp_freq_avail[1] =3D 1; + adc->samp_freq_avail[2] =3D rzt2h_adc_sst_to_freq(adc, RZT2H_ADC_SST_MIN); + pm_runtime_set_autosuspend_delay(dev, 300); pm_runtime_use_autosuspend(dev); ret =3D devm_pm_runtime_enable(dev); --=20 2.55.0 From nobody Sat Sep 26 22:58:21 2026 Received: from TYVP286CU001.outbound.protection.outlook.com (mail-japaneastazon11011041.outbound.protection.outlook.com [52.101.125.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 261B8472F60; Fri, 28 Aug 2026 15:01:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.125.41 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787929294; cv=fail; b=EGgGDc8CMN4xzcLACCtyFbBvkXTbHT8ezsnpsoPmfbA0hrb11dwZb+AJWP0CO47PwjIB0q1O0K9anxC1vlfMKlp+MzbzS8QLofRdNVvOEACj2M6mRub2XyNphGt73JOBs5znwZhvU4oeUxSbhGf68Z+JeZ4hEkwQ94BhBOVP9tI= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787929294; c=relaxed/simple; bh=2fU37cj3up0wpUZc1ItOqEouwnw0erYsArmj8iIHkYk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=gl2VWuNJuT7tXFNq6zv+C41/KIdfDhOElETprxw29wZSb1M8bXI33VnNRzHyKggHqHZo3CITvK56tS1FBE0TNGSLuPbSzS0YwPzj5sNZJe1tCfYWmFgjM2i7/7gIP3rcXofvrEykMBdlohwOZUMKqSNt418jsM/TD670cho6lgs= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com; spf=pass smtp.mailfrom=renesas.com; dkim=pass (1024-bit key) header.d=renesas.com header.i=@renesas.com header.b=eBY3L4qx; arc=fail smtp.client-ip=52.101.125.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=renesas.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=renesas.com header.i=@renesas.com header.b="eBY3L4qx" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=nRu9VnkxtjTChzY1w5s40AQ5dGjMAK4mYBqz5cyt1RYhokNvXMEp/A9LJ+SiE7VWcno4XDA6+sPUpJ/EcivYV3K0rtgBGs/herUadqYbwtls4weexSDjl0JdRN/cH2cs7+8IpEke+pa1mTxuLZV8X6o/2GiLKDj+U4f7RUnjv03LSUdRR1IzPoqovpnXtyi/Ooek7i5kx7wluViR+MTukojtskrmfyeif/GRcd6AWX+4x3j95bQYhtORdkzBxaVQwpc9nuVnkJke1uDFS988Q0IMXOM5+/9aEO3vuCcCv98O6EAsnGMxPYVg7F7maPdKK3J9RFROyhrvbFbzD4ia2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=PEHveKNNDaRvvOvWDi+LiKS2Pewg4yAr7Pwv+UeNomA=; b=r8SRAYb2Af7nSmb5aNwh53xq1b1BmpFJHYo7ZDVUFRPjN/DECTNVzPR3ufjTsSL2KUNnxd8nOkKB4ZTVanbTK3Gp9kzho/23juwqw/pvI1VSkhU4LHkCBmFwZTJHeR+4rMNNFBw/Wf8eQCZThJofC+Dy/nce8PQ8BuaPIQ50PBc/oC9ZrfaSApbsZ5sqFTJoY3Vu5uVWueW9FgbyMMq0d/yVkPQjZ/APS+PAZ60i5bpu0E1wVeKsNH1VgnxhZrTjcjryeF+MFuasOT6Yt3hfuTy/j0/lpjZGeeJMTO2YY/5grCAfJ8kbiMAYZ/aBPTmcuss7ULsiIANBA57TWIynCA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 8.62.32.50) smtp.rcpttodomain=analog.com smtp.mailfrom=renesas.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=renesas.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesas.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=PEHveKNNDaRvvOvWDi+LiKS2Pewg4yAr7Pwv+UeNomA=; b=eBY3L4qxAouiBdIdg7SUtK5BHFESSTqUKC9NR3kMpdFcL+ZJBPTRsLrOEjKgbgQyKHhsEzBJ47nzNhdu8CnvC8wjgW35FsUqNdTLOqjWHNmmLkN9v3t+XFz6a7qpwaK00iD9hfsaehRV8AFPssJ4BV+eBmF/6jzRCu9jpt6DUvM= Received: from OS3PR01CA0040.jpnprd01.prod.outlook.com (2603:1096:604:dd::9) by TY4PR01MB13855.jpnprd01.prod.outlook.com (2603:1096:405:1f8::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.360.11; Fri, 28 Aug 2026 15:01:29 +0000 Received: from OS1PEPF0000D214.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:dd:cafe::a8) by OS3PR01CA0040.outlook.office365.com (2603:1096:604:dd::9) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.360.11 via Frontend Transport; Fri, 28 Aug 2026 15:01:29 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 8.62.32.50) smtp.mailfrom=renesas.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=renesas.com; Received-SPF: Pass (protection.outlook.com: domain of renesas.com designates 8.62.32.50 as permitted sender) receiver=protection.outlook.com; client-ip=8.62.32.50; helo=ejcrelay004p.adwin.renesas.com; pr=E Received: from ejcrelay004p.adwin.renesas.com (8.62.32.50) by OS1PEPF0000D214.mail.protection.outlook.com (10.167.240.21) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.382.8 via Frontend Transport; Fri, 28 Aug 2026 15:01:28 +0000 Received: from demon-pc (REE-0055761.adwin.renesas.com [10.226.92.7]) by ejcrelay004p.adwin.renesas.com (Postfix) with ESMTP id 36B7B300009E; Sat, 29 Aug 2026 00:01:23 +0900 (JST) From: Cosmin Tanislav To: Jonathan Cameron , David Lechner , =?UTF-8?q?Nuno=20S=C3=A1?= , Andy Shevchenko , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Geert Uytterhoeven , Magnus Damm Cc: linux-iio@vger.kernel.org, linux-renesas-soc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Cosmin Tanislav Subject: [PATCH 7/9] dt-bindings: iio: adc: renesas,r9a09g077-adc: document DMA support Date: Fri, 28 Aug 2026 17:59:40 +0300 Message-ID: <20260828145943.2077589-8-cosmin-gabriel.tanislav.xa@renesas.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260828145943.2077589-1-cosmin-gabriel.tanislav.xa@renesas.com> References: <20260828145943.2077589-1-cosmin-gabriel.tanislav.xa@renesas.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: OS1PEPF0000D214:EE_|TY4PR01MB13855:EE_ X-MS-Office365-Filtering-Correlation-Id: ef8ad174-65c7-4171-92fc-08df05153d2f X-LD-Processed: 53d82571-da19-47e4-9cb4-625a166a4a2a,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|36860700016|1800799024|23010399003|376014|7416014|18002099003|22082099003|56012099006|11063799006|10067099003; X-Microsoft-Antispam-Message-Info: VXXz3wypehFZkmsc1cgN/UuqSLXiq/qcIgjwBJ4dUyUNsvYfNC477D3y985R9emK/iwjV9PTthsWXsYb7bUBWWT7mujDuBc+D1D2oAQw6A+FOkl9wSj3QvdNerpu8GkQVrt67XIOw4pgLLWiZxdK/oWP972QaCergUk3BMVvC/gpkCASuUb0gpFmoA8PGtrcU3c1D7za16dqzHf0cW3H6K2bL2eSP4V5Ad6mG/sMCMoBu0t7MSYEeRp6/h1Lr57PZ2dxBi6QihIMNYdc+zihdTV79NLT/IKlcc+8M7Fepik7LVSgTK1o3H5g9hmZL0auHTx5jgxFuUeIUoZreSwg61Dsd3X/aqMxVnC7Fqbwi7O1YlVpZW/BS2qEB2E5exFLgyPWHjnCehIcj4slJ2/3FOSMZFZF0c4U7u2MVURWHuKVjIH+xmQZlouZwduc4g3BvXu+XhfrFN9q4KYX/4trz0YfeuyzYLqxLY6XvGIS/VYt4lb5V47tZqWlSc2WHNz7I4Uys0JGnoYPNHvSA8fcJpojbsjKZ0jIWW9asszKB/C020+26rbW1xirGYsjBUvvhYgujC4oM76Io1MnBO3vdQpStZTHN7Nxj1zVe6sPgVKxb3OgmVqt94HmeOTFqxmwhk+mzAf1KH3XWdCKkX+XNJwzF7gALAe4j7nfErKtoDrX3gX0rjLbwHi0u5Kv+lBoj4uWrRrw2roRk+25XxDQZg== X-Forefront-Antispam-Report: CIP:8.62.32.50;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:ejcrelay004p.adwin.renesas.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(82310400026)(36860700016)(1800799024)(23010399003)(376014)(7416014)(18002099003)(22082099003)(56012099006)(11063799006)(10067099003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: SVSQ3B8G+iuHsWrV31E/ptBHsT7zsOwr4mBHFJyiPqcSGC0UYJu6BUfaYXvIzLchXAU3JfmpPlky+b1PuTOM1gX0rTOxC17txmJT4S7zDh2irvIT1qmoK+kTFDdMKEXovwlO6xMWbwpdtmd2pQPGOjgEgJA/LlgoD547x/TN9SOSXyBLIIUgL3SVzySmS6pTCtgU+05HmRoZpACg9z49KCmigBVlGZwO9s0fliCQJxHS/5ZwGP8CxEBQ/VLo+BAi55lUUnDAcCw5LJ3LiocLvUopZgBl2ryYJZQvf/kHOClMQRkVyF0rb8hvcJLazXtl0CDUef7C8+ptLEJO1OPZLSAPPgSORW5xjYplCQMCmU/mioYoxkN0NT1Gq9OT2Lz152NbyaaoZvYMPCBU4AsIMU6aZQb31R018genY/1VhIwK0EbHMDcSzFCE+9O0shmQ X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Aug 2026 15:01:28.8258 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ef8ad174-65c7-4171-92fc-08df05153d2f X-MS-Exchange-CrossTenant-Id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=53d82571-da19-47e4-9cb4-625a166a4a2a;Ip=[8.62.32.50];Helo=[ejcrelay004p.adwin.renesas.com] X-MS-Exchange-CrossTenant-AuthSource: OS1PEPF0000D214.JPNP286.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: TY4PR01MB13855 Content-Type: text/plain; charset="utf-8" The ADC can transfer conversion results to memory over DMA. Allow up to three DMA specifiers, as the ADC conversion DMA request can be routed to any of the SoC's three DMA controllers. Signed-off-by: Cosmin Tanislav Acked-by: Conor Dooley --- .../bindings/iio/adc/renesas,r9a09g077-adc.yaml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Documentation/devicetree/bindings/iio/adc/renesas,r9a09g077-ad= c.yaml b/Documentation/devicetree/bindings/iio/adc/renesas,r9a09g077-adc.ya= ml index dc0206b28231..4b5934ac296b 100644 --- a/Documentation/devicetree/bindings/iio/adc/renesas,r9a09g077-adc.yaml +++ b/Documentation/devicetree/bindings/iio/adc/renesas,r9a09g077-adc.yaml @@ -57,6 +57,18 @@ properties: - const: adclk - const: pclk =20 + dmas: + minItems: 1 + maxItems: 3 + description: + Must contain a list of references to DMA RX specifiers. + + dma-names: + minItems: 1 + maxItems: 3 + items: + const: rx + power-domains: maxItems: 1 =20 --=20 2.55.0 From nobody Sat Sep 26 22:58:21 2026 Received: from OS0P286CU011.outbound.protection.outlook.com (mail-japanwestazon11010035.outbound.protection.outlook.com [52.101.228.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 841F94734CF; Fri, 28 Aug 2026 15:01:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.228.35 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787929301; cv=fail; b=U7t2l/4XAMl12E3cGWodeuBmR3SaK6aR1CMwtV+lqwscnb5EiWdUZ8PpPW3Q6lZKU44T6MW3HPXCNV90O6wGUDvhPxQUOlzhs1bzy4k1gz6ttp/c08y3ysgjYMJkcymBTGG+H0YJMXPFL7Kz3ZGqQcRqYRBuS1SFyvP09WqNDys= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787929301; c=relaxed/simple; bh=XYHRbzfH/8+3wI5VJPVifzfNxPjn8ItsMbJd8Da6qPE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=QmjhnhKliGnWDL8uP52EvgKB3nlQDisFiaqM9jcpYMec2Yi32kOzqMIY6eN2GlbhjAAejyGZvUhXc/znIXvgulwctAZZxHDDL8kK2st6wY9HfCukbyrTCvugS4upW5EpVnPvQxUda/OF3lE6qH86ZQdK4MGWPExcC2frlpXALQc= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com; spf=pass smtp.mailfrom=renesas.com; dkim=pass (1024-bit key) header.d=renesas.com header.i=@renesas.com header.b=BYJSWPvh; arc=fail smtp.client-ip=52.101.228.35 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=renesas.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=renesas.com header.i=@renesas.com header.b="BYJSWPvh" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=iVLLdPpbRMGjSvf+qMff8SVroCQq0+tp6yVlIYId2AQT2+XeW1HS+ZEWmHTROYozUv4yLckutTq6Tl07IFdmiYGIbxvpD1HEZCGojjO83fx/lc6x5qhq1bPSzJerPL06+eHtyCjeLXZax4okZMp+lWQL1MGZYIJZT69fLqcNoKyQVG0AzQ5b1IklHy2PerFPQyueoNsvCuU+VLhmdDbMuxvadcU0WxGA0kl+W28BScs6vux6MZ2lSL5FSVY1KXd+tNzWf5KqYqx57uzaTG0lE3zB6ceVT0Qb1jZgVE7NOiWFQz2xapLZ9URRr/uS+OQg7mAaek1vK1KdvpM3t9rMww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=/c8CKzMYFJ3y4sWEJj+nTFdkCYeFIADt5pC7ovGsTbY=; b=pu71bD49rtSsOQCFaDXjWMusDRCY7x01mQbikgnWIcKrZ2SA/1vfNT6MhNW+fA+OuSCFq9OCR+b9TxlojFQNXi+8F45hnYxHhuu0r4JLZ+4x9LvXshXwT2fIMU7M4+hFW7OBwRujTdfLVp/TulhuuWyTm95w/FbotHNou7ucOk9dUIWEQ/6qpUMBh8DXnH/FC/TEd/69mSJLn0YNlvFxfxg5nXjc/7nzTIrwFd6jLo5bD2pJIY5KhlwrXZuDvr5f1687X6snycKesraEwHcsQC93mbdhLyNQjotumdaZSjH7vH2ngz6NOxacn5osgJdX4DxZNEFCR4g2i8wX0jl4Cw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 8.62.32.50) smtp.rcpttodomain=analog.com smtp.mailfrom=renesas.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=renesas.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesas.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/c8CKzMYFJ3y4sWEJj+nTFdkCYeFIADt5pC7ovGsTbY=; b=BYJSWPvhO7zMDchKt8YNddKRK14p3TTwWODXyXXM8WjyiRVjnzPjMLzbGW1avqsc9aVgqHOJzpehBkRCQLo3wUtg+EaETekAZlnDB0Uu4pR8asOeVhqoog7cEfOzalN3959Rh993eBvdC24jFOj/shgmvYpc1pKwwSKQk+DGikI= Received: from OS7P286CA0016.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:26d::14) by OSZPR01MB8155.jpnprd01.prod.outlook.com (2603:1096:604:1a6::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.360.11; Fri, 28 Aug 2026 15:01:35 +0000 Received: from OS1PEPF0000D20F.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:26d:cafe::6b) by OS7P286CA0016.outlook.office365.com (2603:1096:604:26d::14) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.360.11 via Frontend Transport; Fri, 28 Aug 2026 15:01:35 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 8.62.32.50) smtp.mailfrom=renesas.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=renesas.com; Received-SPF: Pass (protection.outlook.com: domain of renesas.com designates 8.62.32.50 as permitted sender) receiver=protection.outlook.com; client-ip=8.62.32.50; helo=ejcrelay004p.adwin.renesas.com; pr=E Received: from ejcrelay004p.adwin.renesas.com (8.62.32.50) by OS1PEPF0000D20F.mail.protection.outlook.com (10.167.240.38) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.382.8 via Frontend Transport; Fri, 28 Aug 2026 15:01:34 +0000 Received: from demon-pc (REE-0055761.adwin.renesas.com [10.226.92.7]) by ejcrelay004p.adwin.renesas.com (Postfix) with ESMTP id EE3CF3000349; Sat, 29 Aug 2026 00:01:29 +0900 (JST) From: Cosmin Tanislav To: Jonathan Cameron , David Lechner , =?UTF-8?q?Nuno=20S=C3=A1?= , Andy Shevchenko , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Geert Uytterhoeven , Magnus Damm Cc: linux-iio@vger.kernel.org, linux-renesas-soc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Cosmin Tanislav Subject: [PATCH 8/9] arm64: dts: renesas: r9a09g077: Wire up DMA support for ADC Date: Fri, 28 Aug 2026 17:59:41 +0300 Message-ID: <20260828145943.2077589-9-cosmin-gabriel.tanislav.xa@renesas.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260828145943.2077589-1-cosmin-gabriel.tanislav.xa@renesas.com> References: <20260828145943.2077589-1-cosmin-gabriel.tanislav.xa@renesas.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: OS1PEPF0000D20F:EE_|OSZPR01MB8155:EE_ X-MS-Office365-Filtering-Correlation-Id: bc1c4b2c-e593-4674-4690-08df05154091 X-LD-Processed: 53d82571-da19-47e4-9cb4-625a166a4a2a,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|23010399003|7416014|376014|82310400026|36860700016|10067099003|11063799006|56012099006|18002099003|22082099003; X-Microsoft-Antispam-Message-Info: n79XUHJLmXXyOBHASOJp3SZkU1au6P531dIjItdJW90t5nbMcGSegOQLDGJQqOwyL8v5ZVqimPfQbTZpFHrcauRPReiBsObBC4NPNdQp0m/VJQ0wcwOUg4fdoo9hDgZiDiz66ujhMEgcCvSeuZrjAJiCgIHwnhlWTFXRkC5UjnPy15AOpqETdFp1kN1MAgiDWbyrI1lGDWMg4H2D22raPpKVHA7lrBHM8/BYX8/LWyIWPrU7Fv89Z8DJ6CJp5AV0L9D7tydBGErrwqKg1OywA0AaRPxcsZCCIxvTCUOrw0FqUrOSha7yDUKieM8WGYclayfULQJ936LrFYfYX1WP3mDCFJS2+TGMI4ikYx3gOq+JW5VXyqh2vTlkJfjK/EFPtiqG15H/SZ7QZGvuOJhsFQfb+nFKyr59YqXFglb2uKtFlFTOmT2TeNVdEoray2N7tAPq5atOwmYUOGaojwibgX2DK2nOxgOu35dCqliefFZav0R0GCzIm5muwR2mEi7fqx/MhTFI4JqfnIEOS3n2FytYqw2yV7TJ3y/muJIvkk+VijWTkDlxsytwYXkUx/p6RqBoAuXBjA6Ett3jtT3QLSFtvj9oi93Dk1Vplfyhg74WAPzL48peF6X1rQtVzary4OmFsxUmSjy0YtSdTZkg55VdSBP3XCLUPGnYLieg+7Ah9JvoaeW9/y3CWkdJMK6v1TstpxZ9UOfoSIHUW8IKKw== X-Forefront-Antispam-Report: CIP:8.62.32.50;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:ejcrelay004p.adwin.renesas.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(1800799024)(23010399003)(7416014)(376014)(82310400026)(36860700016)(10067099003)(11063799006)(56012099006)(18002099003)(22082099003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: DPuNSF/N5UAejeD1zo6uHZW39Q8zRMmbFsI2Jcw7CyPDMRCp0MvlkYHigDOKEN407II9MBhOE1OMmQDbk0E6l5E0XNesu6qRwoKdxy8BE/H9hjmsuJKOCGnhspeLlolYE0FJkHgSIhtp2tpkdq5m+3qIQ6QYNM0CgYUvayE1QyJ4sow51XSVgrgFDkrYIgWchVimG3LFxdZsi431JmB++PmLkrJPwD/hRjlZgY+H2hqUt1813CMnizAC7NMK+4NnGy9wPrBAw5N3hkS22Vlrt/V9Xi7CqbNjeAnmtYKwRn6fGCmKaYAGe2kYazZGvSRhuvRk1d5bzcg79W+od5pWyRqAdzd8rbgUSw9oVZW3ZMyK/UfMBEVsFR1PCBXuMgO6wk9VXG49ctC6Yrli1iCf7asfW9HuB/BrUoSqAKPuWafCDxPM1zMRonTn+gP756r6 X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Aug 2026 15:01:34.4989 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: bc1c4b2c-e593-4674-4690-08df05154091 X-MS-Exchange-CrossTenant-Id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=53d82571-da19-47e4-9cb4-625a166a4a2a;Ip=[8.62.32.50];Helo=[ejcrelay004p.adwin.renesas.com] X-MS-Exchange-CrossTenant-AuthSource: OS1PEPF0000D20F.JPNP286.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: OSZPR01MB8155 Content-Type: text/plain; charset="utf-8" RZ/T2H (R9A09G077) has three DMA controllers that can be used by peripherals like the ADC to offload data transfers from the CPU. Wire up the DMA channels for the ADC peripherals. Signed-off-by: Cosmin Tanislav --- arch/arm64/boot/dts/renesas/r9a09g077.dtsi | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/arch/arm64/boot/dts/renesas/r9a09g077.dtsi b/arch/arm64/boot/d= ts/renesas/r9a09g077.dtsi index cd34df024769..f54f8d640f02 100644 --- a/arch/arm64/boot/dts/renesas/r9a09g077.dtsi +++ b/arch/arm64/boot/dts/renesas/r9a09g077.dtsi @@ -1235,6 +1235,8 @@ adc0: adc@90014000 { clocks =3D <&cpg CPG_CORE R9A09G077_CLK_PCLKL>, <&cpg CPG_MOD 206>; clock-names =3D "adclk", "pclk"; + dmas =3D <&dmac0 0x26ba>, <&dmac1 0x26ba>, <&dmac2 0x26ba>; + dma-names =3D "rx", "rx", "rx"; power-domains =3D <&cpg>; #address-cells =3D <1>; #size-cells =3D <0>; @@ -1257,6 +1259,8 @@ adc1: adc@90014400 { clocks =3D <&cpg CPG_CORE R9A09G077_CLK_PCLKL>, <&cpg CPG_MOD 207>; clock-names =3D "adclk", "pclk"; + dmas =3D <&dmac0 0x26bf>, <&dmac1 0x26bf>, <&dmac2 0x26bf>; + dma-names =3D "rx", "rx", "rx"; power-domains =3D <&cpg>; #address-cells =3D <1>; #size-cells =3D <0>; @@ -1279,6 +1283,8 @@ adc2: adc@80008000 { clocks =3D <&cpg CPG_CORE R9A09G077_CLK_PCLKL>, <&cpg CPG_MOD 225>; clock-names =3D "adclk", "pclk"; + dmas =3D <&dmac0 0x26c4>, <&dmac1 0x26c4>, <&dmac2 0x26c4>; + dma-names =3D "rx", "rx", "rx"; power-domains =3D <&cpg>; #address-cells =3D <1>; #size-cells =3D <0>; --=20 2.55.0 From nobody Sat Sep 26 22:58:21 2026 Received: from TYVP286CU001.outbound.protection.outlook.com (mail-japaneastazon11011062.outbound.protection.outlook.com [52.101.125.62]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CE60C4746B7; Fri, 28 Aug 2026 15:01:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.125.62 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787929310; cv=fail; b=BTe64jzvycF3fs2kSxnQC1l3nO+LzfcSfPAqARj2RY9ranMwwHUdroKlHgd7htacFyoHcu2Pf6TY1eVesMn5O5OdEjGp/AjdjQRaU9i26bs+GM+dGMMWs4AveH0tyjpPiNc4ZT4i5eo6Oi1hx2sH7e+A/9018Nd0HticoId6tFo= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787929310; c=relaxed/simple; bh=qhJfL9ywqUS2u1L+mgZ1PbO801mkFH82tI/av3svtyU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=P/KTZsG1FIY3xFor4uf2Ri1Rx6xvFyAhTpX2aI8i4HGZfLSWfKsbhwQ0F8YIKV9/4pJA0xnf+e2+57lCDekWGx6HUH1/tavob9KNPPJ3pHnyT5B0BfVbOBJHRDoffCE6Ey03u0R31Dx0VyaT77vFhdFr1fToqeVq/kNhw0dqiwo= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com; spf=pass smtp.mailfrom=renesas.com; dkim=pass (1024-bit key) header.d=renesas.com header.i=@renesas.com header.b=izHiofc3; arc=fail smtp.client-ip=52.101.125.62 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=renesas.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=renesas.com header.i=@renesas.com header.b="izHiofc3" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=h6guTz2XdECwipyjDsIOVpHMvBodFGnf4Bi7DtkzawS9/bAo7PDEggyUQU4254eCTZ2xiHrIP5p0zl9812KIb3VaJpOsL8HP73u5rjCQ9ba4K9ELaBVJ6zGtyaqP4eh9LeyKfqSbtcWfnW9C/N2yGMLYWzXD9alK2tHA50IIqsvrUJZ6OC+xMTiKNmkjYUNSqlkYXxvClrKZYB2LtnGweY4EkqMqt3qAmKerk4Naq2uF9C4RicFbqoZBu16fGCuRMROfY2IFJ0kKyxOlGvxHkriR3yWPsNlgvlcpxhWX/LSRGJfc5mZ1HUki5yi7L4423q0RZdf+VIFMn/rLppwAfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=UpRk999ug27BIfB19CrWOgpoiw5g4tvs5euo+DO8+Qk=; b=lZTR4HW1FSJlC3aQwY5f56EWuqQxnjbyaEG6kHqXjB3rCHpHIMJi5JZwZMfnx4NnNy6huwlGI2jp3pEJwwanoB/zXQmll9WouyJG9qDJHzs6hN8O41gCgRIZ88eRuUW+anA77YvgvMslUaBDUPsQTKtzTGzSedqS3kkAlK4lLooUtruB7M+Oztn+Gq0y7OrEfRLmQIEMY3veFFV+639dsoO3oJWGGRVSef2PbrO6j6NHVblhACbaz6rJQ5fIgOtJBEgFTVmg07vUHM56ns17C3lUSPRtXEnflUtem7xjTCegYBVX6Mt6jJF6KjCFFk5z6x+2fwk+aANcu3v36KEhtQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 8.62.32.50) smtp.rcpttodomain=analog.com smtp.mailfrom=renesas.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=renesas.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesas.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=UpRk999ug27BIfB19CrWOgpoiw5g4tvs5euo+DO8+Qk=; b=izHiofc3mKpPKRgZoCFIWI+bHaqLEZNlkZFlQ5Q2ByUg74uXS0vNGPx0L3bP7bTAt9d75Yto/oE5VLuOcTVwQOshzE+mciBotcpQTKkSsoin/PKBZv1e0/MFV2qd5d1C0lsjl1j+awspTwaBJmE58RsG7SzzzkDY9w0/WouBL3M= Received: from OSTP286CA0001.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:223::9) by TY4PR01MB17211.jpnprd01.prod.outlook.com (2603:1096:405:333::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.360.11; Fri, 28 Aug 2026 15:01:40 +0000 Received: from OS1PEPF0000D20E.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:223:cafe::42) by OSTP286CA0001.outlook.office365.com (2603:1096:604:223::9) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.360.11 via Frontend Transport; Fri, 28 Aug 2026 15:01:40 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 8.62.32.50) smtp.mailfrom=renesas.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=renesas.com; Received-SPF: Pass (protection.outlook.com: domain of renesas.com designates 8.62.32.50 as permitted sender) receiver=protection.outlook.com; client-ip=8.62.32.50; helo=ejcrelay004p.adwin.renesas.com; pr=E Received: from ejcrelay004p.adwin.renesas.com (8.62.32.50) by OS1PEPF0000D20E.mail.protection.outlook.com (10.167.240.37) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.382.8 via Frontend Transport; Fri, 28 Aug 2026 15:01:40 +0000 Received: from demon-pc (REE-0055761.adwin.renesas.com [10.226.92.7]) by ejcrelay004p.adwin.renesas.com (Postfix) with ESMTP id AE13030001E6; Sat, 29 Aug 2026 00:01:35 +0900 (JST) From: Cosmin Tanislav To: Jonathan Cameron , David Lechner , =?UTF-8?q?Nuno=20S=C3=A1?= , Andy Shevchenko , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Geert Uytterhoeven , Magnus Damm Cc: linux-iio@vger.kernel.org, linux-renesas-soc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Cosmin Tanislav Subject: [PATCH 9/9] arm64: dts: renesas: r9a09g087: Wire up DMA support for ADC Date: Fri, 28 Aug 2026 17:59:42 +0300 Message-ID: <20260828145943.2077589-10-cosmin-gabriel.tanislav.xa@renesas.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260828145943.2077589-1-cosmin-gabriel.tanislav.xa@renesas.com> References: <20260828145943.2077589-1-cosmin-gabriel.tanislav.xa@renesas.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: OS1PEPF0000D20E:EE_|TY4PR01MB17211:EE_ X-MS-Office365-Filtering-Correlation-Id: 01691fe5-0ff5-4caa-a832-08df051543fa X-LD-Processed: 53d82571-da19-47e4-9cb4-625a166a4a2a,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|23010399003|82310400026|36860700016|7416014|1800799024|376014|10067099003|56012099006|11063799006|18002099003|22082099003; X-Microsoft-Antispam-Message-Info: 3FmBCBzPDS9tNrs8IUtdxI6eDxjFCZAfHq6BCha8gr2FQMcGbZ1y8TyXjnu8mOrxXkK3RJIo4he+1w5XsKEoXmcooi3X+YE4JB90gqx/kLswEDkgnk/Oe+OM2hA8gagv0VgX8yVeMnAqNiMcorFaUCBvhE/2FMSHKV4ZmMMKjB99VjWW5O7W+Y7GBxzgdP0CwMQrffWc7CUDJRIkWt7SnOTZKlVXRFueCbh88Bvf+cC4txpoEu2P2uOn+q0MHWYQevVBB1mgzRefFr3ABRKL04ir39BFNLT74lW1fyta9wd+KvBk7EawmgXBfZTJnEgVv5zCq/UD+P3/3YRsFgnTpUIppBLyVEAKNyBf+ClKRhzqH8sSarJdMmmfosF5b1FCJaqrr2JIvG0HnpROFjL6TeFHXVlSSNSlwpQuKfkZ2zxUzLr1ahZ0yh9prkx6Hhby3iquqmM1OZGqe1dxVMRq5oAuyQaiComp/JxwcEaERp6yAJEcW5ZLeSy8jZE0KTVR6q+uo6wM8b3uHKcDHNtLqEluoegL6y9DDSaicXbDJi2BTPlfYcujGTPlk9k/ZNawb7qAeObnkcFkt9Cb7Y1F1ZEwWfkI817bNW9jTlJjPEB93SjDsgchx2pRtmm357mPs2Jf3RKgozIK7tXFZS3ZRa3A5Kg9QIRMwyCuT6EASpmGNOfmGEl7DBQNXcxeRjodm8q+YTEkLPxRltnNSCB9MQ== X-Forefront-Antispam-Report: CIP:8.62.32.50;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:ejcrelay004p.adwin.renesas.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(23010399003)(82310400026)(36860700016)(7416014)(1800799024)(376014)(10067099003)(56012099006)(11063799006)(18002099003)(22082099003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: N3pVX4S/Px/1KUttcXct3+Qd5+6xlGPbDJtAVzDFzJNAAieVDbCRhK6/4weoV8poibZmWmCx6nRK2PFZ/nuxgS6+hrmkJtc3VGe1eNyeNgoVlxZ6ladjutbmhlCwM1hNeuWgkadDWwfcHwQpLacu+dym7D2px6FFtUI0zXL047xzwqaz7Q7WrqajRtAtmi4hd+TFfCOaJ58aMPrn9TTbLYV3XPbik/0SZIGGDsVs2JddNT9qNhu8wFGHBCPW+fJ9tIjDf8w7/1sQaXE6J9GsBNfCKovaobWp+6tQGGjJi0xHz+jalvFZbmBb6jLSv0GgQyu6gR8vmAJ/ROT3ZO0x6fdv5JFGHD7WhdIjN7InvL4PaQ6OiETu93F/h2GNwoACu08syzgdmc7NothFBsRILkPzy+JAVHUVzHvVSXoo9u6TmAk7dGkdOC9LE/IqzmXE X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Aug 2026 15:01:40.2219 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 01691fe5-0ff5-4caa-a832-08df051543fa X-MS-Exchange-CrossTenant-Id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=53d82571-da19-47e4-9cb4-625a166a4a2a;Ip=[8.62.32.50];Helo=[ejcrelay004p.adwin.renesas.com] X-MS-Exchange-CrossTenant-AuthSource: OS1PEPF0000D20E.JPNP286.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: TY4PR01MB17211 Content-Type: text/plain; charset="utf-8" RZ/N2H (R9A09G087) has three DMA controllers that can be used by peripherals like the ADC to offload data transfers from the CPU. Wire up the DMA channels for the ADC peripherals. Signed-off-by: Cosmin Tanislav --- arch/arm64/boot/dts/renesas/r9a09g087.dtsi | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/arch/arm64/boot/dts/renesas/r9a09g087.dtsi b/arch/arm64/boot/d= ts/renesas/r9a09g087.dtsi index 57ac38df3e51..9e8c6610f0da 100644 --- a/arch/arm64/boot/dts/renesas/r9a09g087.dtsi +++ b/arch/arm64/boot/dts/renesas/r9a09g087.dtsi @@ -1238,6 +1238,8 @@ adc0: adc@90014000 { clocks =3D <&cpg CPG_CORE R9A09G087_CLK_PCLKL>, <&cpg CPG_MOD 206>; clock-names =3D "adclk", "pclk"; + dmas =3D <&dmac0 0x26ba>, <&dmac1 0x26ba>, <&dmac2 0x26ba>; + dma-names =3D "rx", "rx", "rx"; power-domains =3D <&cpg>; #address-cells =3D <1>; #size-cells =3D <0>; @@ -1260,6 +1262,8 @@ adc1: adc@90014400 { clocks =3D <&cpg CPG_CORE R9A09G087_CLK_PCLKL>, <&cpg CPG_MOD 207>; clock-names =3D "adclk", "pclk"; + dmas =3D <&dmac0 0x26bf>, <&dmac1 0x26bf>, <&dmac2 0x26bf>; + dma-names =3D "rx", "rx", "rx"; power-domains =3D <&cpg>; #address-cells =3D <1>; #size-cells =3D <0>; @@ -1282,6 +1286,8 @@ adc2: adc@80008000 { clocks =3D <&cpg CPG_CORE R9A09G087_CLK_PCLKL>, <&cpg CPG_MOD 225>; clock-names =3D "adclk", "pclk"; + dmas =3D <&dmac0 0x26c4>, <&dmac1 0x26c4>, <&dmac2 0x26c4>; + dma-names =3D "rx", "rx", "rx"; power-domains =3D <&cpg>; #address-cells =3D <1>; #size-cells =3D <0>; --=20 2.55.0