From patchwork Tue Aug 24 11:54:31 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eugen Hristev X-Patchwork-Id: 12454857 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 564CCC4338F for ; Tue, 24 Aug 2021 11:58:41 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1E13A60EE0 for ; Tue, 24 Aug 2021 11:58:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 1E13A60EE0 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=microchip.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:CC :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=slyuqyAsI67kp6WYPK5Rf0mMHtaW2S+kueSRYmsxiY8=; b=WVNChW9QEfaoqr 2JQErQcVplbb8UsGWqK42i0/Wn2u54xaKSGLwmjrwbEnxFyiyeVX4zLinxQNWAxwwiV98Y3Tr/2os 1GX1HGIFdrKzWVHGnASt+n3w5XnP/CPMvxM0TadCxI86ESW3GMhurl5h+5898RUcDvpKTu2TKDLFR KOQhxSqSnAa0EZnaT/pXQJObOPPvfm03os08UzSj0cPwoEb3EWFdaRphoDMFPm/v+qPCP/cKkz/+c dUSZEpiSyDg/qzcykQdVn7+i6OwUqLLdD6mU07ap8pFTiRBSMRw2DNrtjzRUeTyWT9iTRK9OetNrS EV8ALr9v29nzrLDtZ77g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mIV1X-002rPW-Or; Tue, 24 Aug 2021 11:55:23 +0000 Received: from esa.microchip.iphmx.com ([68.232.153.233]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mIV1Q-002rNv-MV for linux-arm-kernel@lists.infradead.org; Tue, 24 Aug 2021 11:55:20 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1629806117; x=1661342117; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=bs1skQnHmiQI8BMFOJLtlVnI7XmB1cbsizHEwNDRUNw=; b=KiXi4ycl6aMVnE7vJIUj5N+xriPHlzLw595+lLm28P0QWvHrzBIxEjTK kpt2QxGnAEsmYQjFxWfJL2JISTwMoomltpUfKwdnmRVRK7cc6hxX4lFIm YURHgVKwGZapCXdcI+qR1ZA5eR/s5P5qqz1TAxYLc6VJ3J1N80O/44q4B N9MtZL6soVkFe127W5yLk5rh1CbsPZ1OQ4sqvkBoYZlYoVF6fAcgmj8sM em7yeLEYWa6CWZe4C83O1NrhfjC6tsiq6TZjQK+gnjiA1CtgRq7wwUdxW dU5kDmD56ewbjmbsLrZW0Rsx/zQ4W6vzs/xBdI3S8bmrd+aw13jOJZrSr w==; IronPort-SDR: KbfgXBwu1+LzQzdDQQrbVirDkBWwdKZa1ZWI7V98ywI126Jfvsk75dB2Vdu32sKmLBXI2J54AY F6D1DB1z2q2gppcXZ3U2K8jokPTVwLJr8kaBo0AlDH1huvBpDL9FFp6ngSpkUwSDfZ/BaJxYqu QO1EgIZ3I+iVEgpEF+vVOIPmpluq7mqrA+zCaElTbvXZbN+mugCHPK6BJKNLof48YCxflEuTKZ VWh7R3vBoUT8lJF2FZdlgcX8ADdm5OIOZcXTjX6QhOVSgk0jG6wv/W9B+8n/WTjCRAJSypOmls 6XHNzjsMCQyQ2Z5hJGH6ET8e X-IronPort-AV: E=Sophos;i="5.84,347,1620716400"; d="scan'208";a="133407941" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa5.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 24 Aug 2021 04:55:13 -0700 Received: from chn-vm-ex03.mchp-main.com (10.10.85.151) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.14; Tue, 24 Aug 2021 04:55:11 -0700 Received: from ROB-ULT-M18282.microchip.com (10.10.115.15) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server id 15.1.2176.14 via Frontend Transport; Tue, 24 Aug 2021 04:55:06 -0700 From: Eugen Hristev To: , , , CC: , , , , Eugen Hristev Subject: [PATCH v2 00/10] iio: adc: at91-sama5d2_adc: add support for sama7g5 Date: Tue, 24 Aug 2021 14:54:31 +0300 Message-ID: <20210824115441.681253-1-eugen.hristev@microchip.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210824_045516_790831_B633F07C X-CRM114-Status: GOOD ( 14.88 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi, This series adds support for sama7g5. The sama7g5 is slightly different from sama5d2, but has the same basic operations. The register map is a bit different, so, I added some primitives to differentiate between the two classes of hardware blocks (sama5d2-sam9x60 and sama7g5). Sama7g5 has 16 channels ADC, no resistive touch, and extra features (FIFOs, better oversampling , not implemented yet). It is a rework of the series initially sent here: https://marc.info/?l=linux-iio&m=161461656807826&w=2 I reworked this according to review by Jonathan, meaning that first I created a no-op patch that will convert the driver to a more platform specific data dedicated type of driver. This adds various structures that hold things like register layout and channel information. After this I created few patches that implement the main differences between sama7g5 and older products: the end-of-conversion new register. I added helper functions to make code more easy to read and more simple. One the last patches adds the layout and channels for sama7g5. At this moment in linux-next, the DT for sama7g5 and sama7g5ek is present, and the last patches add and enable this node in DT for this board. Eugen Eugen Hristev (10): dt-bindings: iio: adc: at91-sama5d2: add compatible for sama7g5-adc iio: adc: at91-sama5d2_adc: initialize hardware after clock is started iio: adc: at91-sama5d2_adc: remove unused definition iio: adc: at91-sama5d2_adc: convert to platform specific data structures iio: adc: at91-sama5d2-adc: add support for separate end of conversion registers iio: adc: at91-sama5d2_adc: add helper for COR register iio: adc: at91-sama5d2_adc: add support for sama7g5 device iio: adc: at91-sama5d2_adc: update copyright and authors information ARM: dts: at91: sama7g5: add node for the ADC ARM: dts: at91: sama7g5ek: enable ADC on the board .../bindings/iio/adc/atmel,sama5d2-adc.yaml | 1 + arch/arm/boot/dts/at91-sama7g5ek.dts | 8 + arch/arm/boot/dts/sama7g5.dtsi | 16 + drivers/iio/adc/at91-sama5d2_adc.c | 586 ++++++++++++------ 4 files changed, 425 insertions(+), 186 deletions(-)