From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=68.232.153.233 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796195152; b=JEMFn4zJNyYtNHOYBowzImVQh6Q1vaDnPt3rzwW6/F7TR8ei0upSzLMNGJPbEeAR7LDE tAWF8N59TJ1iyBrCk/gZwhUz1tvy48ibj9IKOydpxq7oe6K47xci1s9WgSQ4wTpuwrB5Z bHAmRgYoSgCU/pSyvkJXY5dTpZGZjcsvdvrCEMw89s4PBQTla6ct9Vabsr8LtVuVXFlOh BPv12MbRhIEWujKqR0fiCzEt85Z19Mn6svD3MG+BV4DrqsRa3C+CO+1MEgzPNR2H0gpoZ aOAfnUvFHiJrN0ylyMnEitRYdDGU4i+pnVMmHJrB/innUAWVHh/xihDnSDkgqvBWj3g== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796195152; h=DMARC-Filter:DKIM-Signature:X-CSE-ConnectionGUID:X-CSE-MsgGUID: X-IronPort-AV:X-Amp-Result:Received:Received:Received:From:To:CC: Subject:Date:Message-ID:X-Mailer:In-Reply-To:References:MIME-Version: Content-Transfer-Encoding:Content-Type; bh=1dLy+Wp+hIT5qzXYd0nT1MSQAvVVCkCXkvpUvHw1vHU=; b=agOJXmLqX/cBKpm6LBZTZv8PmhRvqKvguhfZQ+tGwq6lkND6Lp1zrFWslRw64aZaHGFH 0TwD4wQWZc+L02r5A7KNTwsY3MMO9kPjIhqvy/HM6wWEk/5cBTfg2M/vSCL4wrS3MPLt+ /JgFQ1GRWug4di76vGCQOniQQSbj6BUsGH2FjHKkVmGh9tP+M6UT/B0hCv7O08yNwl+Pv IBoff/NkRau1k7tB7meucDWOvIz64hJg6yTr60uIzuZyVzNeuQ3syTYOFGZVHgfQ4B03I eMQZzs92U56IbZrliOhcPPZapKR1ec+tY+OUpMwotnuYsXDzxoxIiiDNt07qehvktxg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=microchip.com; spf=pass smtp.mailfrom=microchip.com; dkim=pass header.d=microchip.com header.i=@microchip.com header.a=rsa-sha256 header.s=mchp header.b=MqtfYJPi; arc=none smtp.remote-ip=68.232.153.233 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.153.233]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1043C606A31A; Wed, 2 Dec 2026 07:05:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 1043C606A31A Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=microchip.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=microchip.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=microchip.com header.i=@microchip.com header.a=rsa-sha256 header.s=mchp header.b=MqtfYJPi DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1796195152; x=1827731152; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=DWyf/3XQtZH966+1Y9/vSfcEDfZscMwsEZHW32sCIJE=; b=MqtfYJPiMSB2fK415qYPxdKLllGKfde1rLoHdjWavzrgiGzl+XOQUjkv 7CwZyK6aHqRZSl3orXJ9tWlXXClujgCC14o4j3s/MD0OMMaeNlHVuXyPm H8sZaKIapvR7gC1U7EaxJ3RhyN4x19b9xcDpGdu8lRVMqZ+DF+7qd5V3C bfwQqzpCZxWI+JEkcQ3kXg2k1ifO07o9jQqMaWg6EJM/Bdui2yZNaeruD 1IaYV/5c91hYP1Hqv/d+FXiujuLWv8FfKiGfP7ZXC/h35P8dQvabiJb9d nGHCsidZRyo2QkNIZbt7C7nKQePTfLKJFMu/176j4S622OV7ENSE87OaB g==; X-CSE-ConnectionGUID: t2vGO9VCSY6nXVoinj1Zig== X-CSE-MsgGUID: ctJr/x/rTYePHHrVlH7fRA== X-IronPort-AV: E=Sophos;i="6.27,246,1787036400"; d="scan'208";a="78212728" X-Amp-Result: SKIPPED(no attachment in message) Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa1.microchip.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Dec 2026 00:05:51 -0700 Received: from chn-vm-ex04.mchp-main.com (10.10.87.151) by chn-vm-ex1.mchp-main.com (10.10.87.30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.2.2562.57; Wed, 2 Dec 2026 00:05:50 -0700 Received: from che-ll-i67070a.microchip.com (10.10.85.11) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server id 15.1.2507.58 via Frontend Transport; Wed, 2 Dec 2026 00:05:45 -0700 From: Varshini Rajendran To: Jonathan Cameron , Srinivas Kandagatla , Claudiu Beznea CC: Eugen Hristev , David Lechner , =?UTF-8?q?Nuno=20S=C3=A1?= , Andy Shevchenko , Rob Herring , "Krzysztof Kozlowski" , Conor Dooley , "Nicolas Ferre" , Alexandre Belloni , , , , , Subject: [PATCH v7 08/18] iio: adc: at91-sama5d2_adc: adapt the driver for sama7d65 Date: Wed, 2 Dec 2026 12:34:46 +0530 Message-ID: <20261202070458.87970-9-varshini.rajendran@microchip.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20261202070458.87970-1-varshini.rajendran@microchip.com> References: <20261202070458.87970-1-varshini.rajendran@microchip.com> X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain Add support for sama7d65 ADC. The differences are highlighted with the compatible. The calibration data layout is the main difference. Update Kconfig help text to mention SAMA7 SoC family support. Signed-off-by: Varshini Rajendran --- drivers/iio/adc/Kconfig | 2 +- drivers/iio/adc/at91-sama5d2_adc.c | 29 +++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/drivers/iio/adc/Kconfig b/drivers/iio/adc/Kconfig index a802d8ee4dd9..10e726b2b68f 100644 --- a/drivers/iio/adc/Kconfig +++ b/drivers/iio/adc/Kconfig @@ -665,7 +665,7 @@ config AT91_SAMA5D2_ADC select IIO_TRIGGERED_BUFFER help Say yes here to build support for Atmel SAMA5D2 ADC which is - available on SAMA5D2 SoC family. + available on SAMA5D2 and SAMA7 SoC families. To compile this driver as a module, choose M here: the module will be called at91-sama5d2_adc. diff --git a/drivers/iio/adc/at91-sama5d2_adc.c b/drivers/iio/adc/at91-sama5d2_adc.c index 604434fec2ba..7403d62e8120 100644 --- a/drivers/iio/adc/at91-sama5d2_adc.c +++ b/drivers/iio/adc/at91-sama5d2_adc.c @@ -528,6 +528,15 @@ static const struct at91_adc_temp_calib_layout sama7g5_temp_calib = { .p1_scale = { .numerator = 1000, .denominator = 1 }, }; +static const struct at91_adc_temp_calib_layout sama7d65_temp_calib = { + .tag_idx = 1, + .p1_idx = 3, + .p4_idx = 2, + .p6_idx = 5, + .min_len = 11, + .p1_scale = { .numerator = 1, .denominator = 1000 }, +}; + /* Temperature sensor calibration - Vtemp voltage sensitivity to temperature. */ #define AT91_ADC_TS_VTEMP_DT (2080U) @@ -766,6 +775,23 @@ static const struct at91_adc_platform sama7g5_platform = { .temp_calib_layout = &sama7g5_temp_calib, }; +static const struct at91_adc_platform sama7d65_platform = { + .layout = &sama7g5_layout, + .adc_channels = &at91_sama7g5_adc_channels, + .nr_channels = AT91_SAMA7G5_SINGLE_CHAN_CNT + + AT91_SAMA7G5_DIFF_CHAN_CNT + + AT91_SAMA7G5_TEMP_CHAN_CNT, + .max_channels = ARRAY_SIZE(at91_sama7g5_adc_channels), + .max_index = AT91_SAMA7G5_MAX_CHAN_IDX, + .hw_trig_cnt = AT91_SAMA7G5_HW_TRIG_CNT, + .osr_mask = GENMASK(18, 16), + .oversampling_avail = { 1, 4, 16, 64, 256 }, + .oversampling_avail_no = 5, + .chan_realbits = 16, + .temp_sensor = true, + .temp_calib_layout = &sama7d65_temp_calib, +}; + static int at91_adc_chan_xlate(struct iio_dev *indio_dev, int chan) { int i; @@ -2636,6 +2662,9 @@ static const struct of_device_id at91_adc_dt_match[] = { }, { .compatible = "microchip,sama7g5-adc", .data = &sama7g5_platform, + }, { + .compatible = "microchip,sama7d65-adc", + .data = &sama7d65_platform, }, { /* sentinel */ } -- 2.43.0