Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp468930rdh; Thu, 23 Nov 2023 08:43:50 -0800 (PST) X-Google-Smtp-Source: AGHT+IFdGzMPBBb5m+6zQTgUjkZBQCTwQ0qX4Zi9rmRZ99bs4VSH4jc8kOZ4i1dEmRYz+piyDy0Y X-Received: by 2002:a05:6a21:18c:b0:187:27d3:1592 with SMTP id le12-20020a056a21018c00b0018727d31592mr212907pzb.37.1700757829923; Thu, 23 Nov 2023 08:43:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700757829; cv=none; d=google.com; s=arc-20160816; b=lPbwkhNuzYS3Zgl4FXmluNvSx/aSFCtgxe+yY9byosL3oFhTDT4NEFWi9qXUyhxR3w YeMh+tuWYyw2VyBf3vyq+2nGMHq9i/e2CZmLM9EoPV3Eh2nSrlFmktD9pSZmwkGK8QpT XuDmnQhB13r3d6k8qaiWPWUJCXn1STZsqbJfE5zvOPv45sbfMb0qiuHGcWBcLZof1Pt5 zmspgVWr9XlM0O5TJM9MVqpnf4nPOEV3r8G9FTm72PZO3Rtrn4lV1st/78cshrIy8aOw FXbr0fynWstJMt8K+lS9OMqhLPvFOGb+IPlXdA/Z2zsWoAozZYTuyUp/d2qlrZ3q4mKQ PmQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=zV1djqBUo68EavasPuJqPhn3yBooSpfs6f6A01O0bb0=; fh=C1mm7Zdw5E3tpJwxAr0qRdS6+NMDWRETCLn3M7OkZ9E=; b=Ee28ZpJD8TRpq37LAnyqAG22D8/+hmR+kTyiyTGatX9WVtUpxZWse97EDcRN2QItPI 79xP7ZV0JJQsb755jc2gT46bJabuY9cXQLboYB0LphlA7OVcQUJndAdiefhG++B/SwI7 U5inBkLkRfs1bbcF58z75tPgKsGxTE4zr2omDhwY9R2v8wX0OjaGPaD/aLRmpaCoPZSv yXE6RyuA5AxZz+4fvmw8IbPsFylZXkOCws6RNgLsixepkZhPtafldV4o6hTV62mzCexR eBHNwJu2z8mwIuQEPCRjwP+OHQn9Xf3N1ZaaVeJrhpySYIO01DteQ9lbPC+DDO6oiigI dM5w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id b21-20020a056a000cd500b006cbb1347e6dsi1608053pfv.57.2023.11.23.08.43.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Nov 2023 08:43:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=analog.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 7724A8329A2B; Thu, 23 Nov 2023 08:43:47 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345085AbjKWQnd (ORCPT + 99 others); Thu, 23 Nov 2023 11:43:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56314 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229939AbjKWQnc (ORCPT ); Thu, 23 Nov 2023 11:43:32 -0500 Received: from mx0a-00128a01.pphosted.com (mx0a-00128a01.pphosted.com [148.163.135.77]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A6CA19E; Thu, 23 Nov 2023 08:43:38 -0800 (PST) Received: from pps.filterd (m0167088.ppops.net [127.0.0.1]) by mx0a-00128a01.pphosted.com (8.17.1.22/8.17.1.22) with ESMTP id 3ANFk7bq030777; Thu, 23 Nov 2023 11:43:25 -0500 Received: from nwd2mta3.analog.com ([137.71.173.56]) by mx0a-00128a01.pphosted.com (PPS) with ESMTPS id 3uhxk5thbh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 23 Nov 2023 11:43:24 -0500 (EST) Received: from ASHBMBX8.ad.analog.com (ASHBMBX8.ad.analog.com [10.64.17.5]) by nwd2mta3.analog.com (8.14.7/8.14.7) with ESMTP id 3ANGhN5c054371 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 23 Nov 2023 11:43:23 -0500 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, 23 Nov 2023 11:43:22 -0500 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, 23 Nov 2023 11:43:22 -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; Thu, 23 Nov 2023 11:43:22 -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 3ANGh7Fl019854; Thu, 23 Nov 2023 11:43:10 -0500 From: Marcelo Schmitt To: , , , , , , , CC: Marcelo Schmitt , , , Subject: [PATCH v2 7/7] iio: adc: ad7091r-base: Add debugfs reg access Date: Thu, 23 Nov 2023 13:43:06 -0300 Message-ID: <271203e245d324f94678d212e4daf13386bee463.1700751907.git.marcelo.schmitt1@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-ADIRuleOP-NewSCL: Rule Triggered X-Proofpoint-GUID: OQCKt7W2B-OVfZ353XB2MY1EGmA9gPOl X-Proofpoint-ORIG-GUID: OQCKt7W2B-OVfZ353XB2MY1EGmA9gPOl X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.987,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-11-23_12,2023-11-22_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 impostorscore=0 priorityscore=1501 malwarescore=0 spamscore=0 phishscore=0 mlxlogscore=999 mlxscore=0 adultscore=0 lowpriorityscore=0 suspectscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2311060001 definitions=main-2311230122 X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Thu, 23 Nov 2023 08:43:47 -0800 (PST) Add direct register access support for AD7091R-2/-4/-5/-8 ADCs. Signed-off-by: Marcelo Schmitt --- drivers/iio/adc/ad7091r-base.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/iio/adc/ad7091r-base.c b/drivers/iio/adc/ad7091r-base.c index dbc60ea1bafc..4d5051316428 100644 --- a/drivers/iio/adc/ad7091r-base.c +++ b/drivers/iio/adc/ad7091r-base.c @@ -177,8 +177,20 @@ static int ad7091r_read_raw(struct iio_dev *iio_dev, return ret; } +static int ad7091r_reg_access(struct iio_dev *indio_dev, unsigned int reg, + unsigned int writeval, unsigned int *readval) +{ + struct ad7091r_state *st = iio_priv(indio_dev); + + if (readval) + return regmap_read(st->map, reg, readval); + + return regmap_write(st->map, reg, writeval); +} + static const struct iio_info ad7091r_info = { .read_raw = ad7091r_read_raw, + .debugfs_reg_access = &ad7091r_reg_access, }; static irqreturn_t ad7091r_event_handler(int irq, void *private) -- 2.42.0