Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1053002rwd; Thu, 8 Jun 2023 11:18:43 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7KEkuJkyEVhHDZerrpli9nC1zTun+jg84xxSXHDLraCvVXroOAn7gQl5GH3VEKgomoIVx8 X-Received: by 2002:a17:902:dacb:b0:1b2:5870:3384 with SMTP id q11-20020a170902dacb00b001b258703384mr5749527plx.7.1686248322577; Thu, 08 Jun 2023 11:18:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686248322; cv=none; d=google.com; s=arc-20160816; b=ethWR2wMTa9faf5Pi5OtPNxKg92L2HT434rCwRGCU4Z07Vgv50TI/Jkd9tD1XZJbBi 84/RVZOI7WfE4uqtgJp3bYfPG4lvUuLpAObOW4MniiB2Kl6YDKdEDdhmxSjJEJTgU8MW Uf+PTmCnGOcOH0cVDyYP0blBH2G2hPSxS6bRkHUG6QcgGMs5erLn/wD1hoAktI7QD57j hJscEQ6Dp3v0EdWEzxa+hsF/GQER6K2tCoxyQSoDKjGMSSTl0S7TpF0aUZbim9o9xv7t cH0kYFO/JotWGo5pUWzoHpejLH39+QOmZsKGNqf1/n8brq21Y9MSH/CASlzzfGq2g+pw 1kcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:content-transfer-encoding:mime-version :message-id:date:subject:cc:from; bh=rKtlb6PcstluxGoaQFL3qE86dTqXCcRyFoQ5s1nuocA=; b=YsRXN7KdM2pADdJsnpn8FTI3qFx2GtXz7CBSzDbl9QDEFyj60Dz9Z3gU7w2kcooL41 cTGd+pR7h8kekcsM+0sscoTECrPIgrlxZLkXFJRixG1IZY2nCaMRmT+IFCeYgMFEmppF ZfBd10oZ/BpyKxtnfPi3oA42DTpEMc0A1hMLQlCTQOl9zDO+yG2XvxCIRPBkqg4HO2xl ffeIqHFdygL3Nai7BhMucyHUwlxReNiX4lw4cGQLJWd1396BqFCBwCtsp1BfEmuh7Z68 0Ozz3IMzK0IOlKOWSQg2onPWnfPJ812Mvt+ImYfhGphJMeUNbgkmy9k+HHlFJkPHFFi/ Dgsg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=analog.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l12-20020a170903120c00b001b04741042csi1467970plh.93.2023.06.08.11.18.29; Thu, 08 Jun 2023 11:18:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=analog.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232369AbjFHR4b (ORCPT + 99 others); Thu, 8 Jun 2023 13:56:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33918 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231336AbjFHR4a (ORCPT ); Thu, 8 Jun 2023 13:56:30 -0400 Received: from mx0a-00128a01.pphosted.com (mx0a-00128a01.pphosted.com [148.163.135.77]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BFC181FDC; Thu, 8 Jun 2023 10:56:28 -0700 (PDT) Received: from pps.filterd (m0167088.ppops.net [127.0.0.1]) by mx0a-00128a01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 358GmvNa008710; Thu, 8 Jun 2023 13:56:08 -0400 Received: from nwd2mta4.analog.com ([137.71.173.58]) by mx0a-00128a01.pphosted.com (PPS) with ESMTPS id 3r2a9dy8yk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 08 Jun 2023 13:56:08 -0400 Received: from ASHBMBX8.ad.analog.com (ASHBMBX8.ad.analog.com [10.64.17.5]) by nwd2mta4.analog.com (8.14.7/8.14.7) with ESMTP id 358Hu7RG064309 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 8 Jun 2023 13:56:07 -0400 Received: from ASHBCASHYB5.ad.analog.com (10.64.17.133) by ASHBMBX8.ad.analog.com (10.64.17.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.14; Thu, 8 Jun 2023 13:56:06 -0400 Received: from ASHBMBX8.ad.analog.com (10.64.17.5) by ASHBCASHYB5.ad.analog.com (10.64.17.133) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.14; Thu, 8 Jun 2023 13:56:05 -0400 Received: from zeus.spd.analog.com (10.66.68.11) by ashbmbx8.ad.analog.com (10.64.17.5) with Microsoft SMTP Server id 15.2.986.14 via Frontend Transport; Thu, 8 Jun 2023 13:56:05 -0400 Received: from kimedia-VirtualBox.ad.analog.com (KPALLER2-L02.ad.analog.com [10.116.242.24]) by zeus.spd.analog.com (8.15.1/8.15.1) with ESMTP id 358HtlOv003718; Thu, 8 Jun 2023 13:55:50 -0400 From: Kim Seer Paller CC: , , , , , , , , , , , Subject: [PATCH v3 0/2] Add max14001 support Date: Fri, 9 Jun 2023 01:55:15 +0800 Message-ID: <20230608175517.40217-1-kimseer.paller@analog.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-ADIRuleOP-NewSCL: Rule Triggered X-Proofpoint-GUID: bxT6LeuPbOsZ-uftTHLjHMIxmKe_2Bbi X-Proofpoint-ORIG-GUID: bxT6LeuPbOsZ-uftTHLjHMIxmKe_2Bbi X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.176.26 definitions=2023-06-08_13,2023-06-08_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 malwarescore=0 priorityscore=1501 clxscore=1011 mlxscore=0 spamscore=0 lowpriorityscore=0 phishscore=0 bulkscore=0 adultscore=0 impostorscore=0 mlxlogscore=997 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2305260000 definitions=main-2306080157 X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi all, Attached link is the app note I used as reference for programming the max14001, which I found to provide a much easier approach. You can find it here: https://www.analog.com/media/en/technical-documentation/user-guides/guide-to-programming-the-max14001max14002-isolated-adcs--maxim-integrated.pdf The code has been tested and is working fine with the max14001pmb and max14001evsys boards on the Raspberry Pi 4. Changes in v3: max14001: * Replaced __cacheline_aligned with __aligned(IIO_DMA_MINALIGN). * Removed redundant assignment of the tx variable in the max14001_write() and max14001_read() functions. * Assigned struct device *dev with &spi->dev to improve code readability. * Utilized a non-regmap approach and ensure a consistent use of interface throughout the driver code. I attempted to use the regmap API but faced difficulties in implementing it due to the timing diagram requirements. Specifically, the need to change the chip select between transfers, which, as far as I know, is not applicable with regmap. While I am open to thorough guidance and suggestions on utilizing the regmap API, for now, I have chosen to stick with the non-regmap approach. bindings: * Utilized the default register values, which led to the omission of some properties in v2. I plan to include and switch to generic values the excluded properties in v1 in future support. * Dropped the status property. * Moved the allOf property after the required property for better alignment. Best Regards, Kim Seer Paller Kim Seer Paller (2): dt-bindings:iio:adc: add max14001 iio: adc: max14001: New driver .../bindings/iio/adc/adi,max14001.yaml | 54 +++ MAINTAINERS | 8 + drivers/iio/adc/Kconfig | 10 + drivers/iio/adc/Makefile | 1 + drivers/iio/adc/max14001.c | 337 ++++++++++++++++++ 5 files changed, 410 insertions(+) create mode 100644 Documentation/devicetree/bindings/iio/adc/adi,max14001.yaml create mode 100644 drivers/iio/adc/max14001.c base-commit: 9561de3a55bed6bdd44a12820ba81ec416e705a7 -- 2.34.1