Received: by 2002:a05:7412:d008:b0:f9:6acb:47ec with SMTP id bd8csp162616rdb; Tue, 19 Dec 2023 12:26:17 -0800 (PST) X-Google-Smtp-Source: AGHT+IEa9yzJcVzmeFL+08rN+SqCywMUReKt1vIioGrBCG0I/5+xY8I1S5sFmrKefjLP4RD/P15t X-Received: by 2002:ac8:5f0f:0:b0:423:76aa:b919 with SMTP id x15-20020ac85f0f000000b0042376aab919mr2844651qta.16.1703017576803; Tue, 19 Dec 2023 12:26:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703017576; cv=none; d=google.com; s=arc-20160816; b=OS39kc/Agtd2qN27Vdll+I6h5AoFP57ZH9cd4Eovv3IFzRCTh568feUHTf7Sw5Gymw 5baUkt6XMzqmJHQyt/F7+Qp/kLuoeZnjsPL/YDYKwpBzVYTmo3QU0kauztgOAXsJ63EA TpX2EGk2tRVg01poS1dNkSXD8iz8zr6xalJeiNS3GFth8/64JE93w0M+5d6Bns5nWAZh TVseUfIuxg/fU073IFnHsaQg/d7x1ZT9qCLPCaeoPC62JBVFqHArsi/zh9q5xxV5DWDj CJZ8w6+apqU/IpZjSugD4+F4hzDQbS8PjNTp94SRpiXwSK3lHNVNmjBsKfz8Mkz1nnbe 1BYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from; bh=VvUfZ7FVQXYZS386AiY4JDL+rc7RqKM9g90LsA7ph4Y=; fh=QwEOK/MZnBUTBQAzGwecl0DPfALWXdlHbxPQlQn9VIw=; b=jI4aY1fUhpMQ8K9n2q6PG1/HpGTOJX3GkmcjjKsVZjrMhHzfPSZ9xuumtiAes9YCH3 hsRpXLkOajLvwxZVAfntQk6PjsRCaugHV0AQKI2RXLYyxzXRm4fdWtyy0bZBWIiG+ktL YN1JFNXLAiKzebiFnmhNoc2snGqhll3otq3UPmwd7zPF2jMGVxUHBYDrmqH5TM2lv7Uk vrKjbZWb5jID+sloEZBIhjCNTKtWqSKNTwdr+1FZJDtFXIaPBQe0uoaI8BSp8uMYK9M1 nC+rBneljhCcZtzYEaDpltkqvTEJsmBmU7OB9nP/ADzXqo57fcNJImVg7F6WWCW0DcmC ++7g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-5903-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5903-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=analog.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id ew5-20020a05622a514500b004239cba1ce8si28758942qtb.571.2023.12.19.12.26.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 12:26:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-5903-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-5903-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5903-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=analog.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 8FBE11C23FF9 for ; Tue, 19 Dec 2023 20:26:16 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C4D0139AD7; Tue, 19 Dec 2023 20:26:07 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org Received: from mx0b-00128a01.pphosted.com (mx0a-00128a01.pphosted.com [148.163.135.77]) (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 050E839AC5; Tue, 19 Dec 2023 20:26:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=analog.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=analog.com Received: from pps.filterd (m0375855.ppops.net [127.0.0.1]) by mx0b-00128a01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 3BJI4OGc024805; Tue, 19 Dec 2023 15:25:28 -0500 Received: from nwd2mta4.analog.com ([137.71.173.58]) by mx0b-00128a01.pphosted.com (PPS) with ESMTPS id 3v3g4s8efk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 19 Dec 2023 15:25:28 -0500 (EST) 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 3BJKPQsO034660 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 19 Dec 2023 15:25:26 -0500 Received: from ASHBCASHYB4.ad.analog.com (10.64.17.132) 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; Tue, 19 Dec 2023 15:25:25 -0500 Received: from ASHBMBX8.ad.analog.com (10.64.17.5) by ASHBCASHYB4.ad.analog.com (10.64.17.132) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.14; Tue, 19 Dec 2023 15:25:25 -0500 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; Tue, 19 Dec 2023 15:25:25 -0500 Received: from work.ad.analog.com (HYB-hERzalRezfV.ad.analog.com [10.65.205.129]) by zeus.spd.analog.com (8.15.1/8.15.1) with ESMTP id 3BJKP5B9029964; Tue, 19 Dec 2023 15:25:07 -0500 From: Marcelo Schmitt To: , , , , , , , , , , , , , CC: , , Subject: [PATCH v5 00/11] Add support for AD7091R-2/-4/-8 Date: Tue, 19 Dec 2023 17:25:04 -0300 Message-ID: X-Mailer: git-send-email 2.30.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ADIRuleOP-NewSCL: Rule Triggered X-Proofpoint-ORIG-GUID: O66u9oDmtLDVDQzxRqI-DTKy0UwNU27a X-Proofpoint-GUID: O66u9oDmtLDVDQzxRqI-DTKy0UwNU27a X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.997,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-12-02_01,2023-11-30_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 impostorscore=0 mlxscore=0 malwarescore=0 adultscore=0 lowpriorityscore=0 clxscore=1015 mlxlogscore=999 priorityscore=1501 bulkscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2311290000 definitions=main-2312190151 From: Marcelo Schmitt ----------------- Updates ----------------- Applied all suggestions. Only submitting patches not applied on v4: Patches after ("Align arguments to function call parenthesis"). Change log v4 -> v5: - Patch 1: Event callbacks * Moved to begin of the series to easy backport; * Reverted to original event attributes; * Reworked event configuration to do per direction per channel enable/disable; * Improved commit message; * Added fixes tag; * Added Suggested-by tag. - Patch 2: Enable internal vref * Added fixes tag and improved commit message; * Now earlier in the series to easy backport; * Used regmap_set_bits() to make code more neat. - Patch 3: Move generic AD7091R code * event specs moved earlier in patch 1. - Patch 4: Move chip init data * Renamed field to make initialization clearer: irq_info -> info_irq. * Fixed ad7091r_init_info initialization by passing pointers to info structs; - Patch 10: Add ad7091r8 support * Moved bitfield.h include to patch event callbacks patch; * Dropped GPIO consumer include on ad7091r-base.h and added gpio_desc; * Removed extra space before devm_gpiod_get_optional(). So, since we are already fixing a few things here, maybe it's a good time to comment about the event ABI. I see the event config files under events directory appearing as in_voltage0_thresh_falling_value in_voltage0_thresh_rising_value in_voltage1_thresh_falling_value and so on. They don't have the `_raw` part of the name as documented in the IIO ABI [1]. Not sure if that is how it's intended to be, the driver is still missing something, or maybe ABI is somehow outdated. Anyway, if that is also something to be fixed then let me know I'll have a look at it. [1]: https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git/tree/Documentation/ABI/testing/sysfs-bus-iio#n887 Thanks, Marcelo ----------------- Context ----------------- This series adds support for AD7091R-2/-4/-8 ADCs which can do single shot or sequenced readings. Threshold events are also supported. Overall, AD7091R-2/-4/-8 are very similar to AD7091R-5 except they use SPI interface. Changes have been tested with raspberrypi and eval board on raspberrypi kernel 6.7-rc3 from raspberrypi fork. Link: https://wiki.analog.com/resources/tools-software/linux-drivers/iio-adc/ad7091r8 Marcelo Schmitt (11): iio: adc: ad7091r: Allow users to configure device events iio: adc: ad7091r: Enable internal vref if external vref is not supplied iio: adc: ad7091r: Move generic AD7091R code to base driver and header file iio: adc: ad7091r: Move chip init data to container struct iio: adc: ad7091r: Remove unneeded probe parameters iio: adc: ad7091r: Set device mode through chip_info callback iio: adc: ad7091r: Add chip_info callback to get conversion result channel iio: adc: Split AD7091R-5 config symbol dt-bindings: iio: Add AD7091R-8 iio: adc: Add support for AD7091R-8 MAINTAINERS: Add MAINTAINERS entry for AD7091R .../bindings/iio/adc/adi,ad7091r5.yaml | 82 +++++- MAINTAINERS | 8 + drivers/iio/adc/Kconfig | 16 ++ drivers/iio/adc/Makefile | 4 +- drivers/iio/adc/ad7091r-base.c | 269 +++++++++++------ drivers/iio/adc/ad7091r-base.h | 83 +++++- drivers/iio/adc/ad7091r5.c | 120 ++++---- drivers/iio/adc/ad7091r8.c | 272 ++++++++++++++++++ 8 files changed, 714 insertions(+), 140 deletions(-) create mode 100644 drivers/iio/adc/ad7091r8.c -- 2.42.0