Received: by 2002:a05:7412:40d:b0:e2:908c:2ebd with SMTP id 13csp687218rdf; Tue, 21 Nov 2023 13:37:35 -0800 (PST) X-Google-Smtp-Source: AGHT+IGAlSGttf+bZUNZvX+P0lEAkJ+KiBHRiAd0NaLrFeLHX/a2C9kdo9g0uZ2praNLwSOzGYad X-Received: by 2002:a17:902:e844:b0:1ca:a07b:36d with SMTP id t4-20020a170902e84400b001caa07b036dmr495619plg.48.1700602655538; Tue, 21 Nov 2023 13:37:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700602655; cv=none; d=google.com; s=arc-20160816; b=F4apkZbYOcXTXjpil2X304rzEPacY3fgifs9VBHGGzCd6bcIWfGqzCw4yEuyA6bT6B ngcT+LdQzl5FVjLZjHdAE5tP1IuPaQzuPtv5Zov3swr6U9SiMShdfHyRZcNpe66UoOqI mSPex/zz2eFgn+O8n2v9X3VeyIjKn/B88e7lprGd5Z11JpTh3K+kUTTXYSdHCenoJKgO 4aTKVBGmSxEKs2RhUD6VTm1Ph5BIDoYpyzJZWhD/OiCDCXZOPK2P43FHHlzgbrueTDqq Pu9cz4LmcooCP/OticQD6UZKeI8IQ0kUk9ab0R1I0tHIPS1SHkMlosY9mjlPZ1RNwPN3 ofXQ== 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=fki7CU7caIaHnsSukmPSQVvJoFZ7vy2wy/QVa/qr2Uo=; fh=J+BJeGmCs/QI29EfE94qnO1PQPf7qAtMFxMYQgDcFXk=; b=TbJzVWUleMyAZO2e7/K8wYHlyWfpzQoxpGoG2eECdCwphqHYjbhKEeZ7Py/7uz7qD0 a0IAYIRY1xUm1tt1rJmW45UHRkoaI3Bu1PHLUf1fViM7D+3i4TMm2LDlDQeZvHcYVYzS 1ieKlhLewaFci4PYvS8rluISG5ArRESSlourIpOJGx3uuIK0wXbo2VIBX9zvlSC7JRgE JgmT7oKyU6FcPngk4rqQivc4Vl8bNUpMgrgvwJLTfUAK8gEPylIS+2S8HOUEGfGN7sma bk9WZ3Zm5esVAJC+IHOwaIgHyDRdxzJmGdwt44+T5ljZ4f5+WKnc6Fh+0I/0+0mvyeJC YnAg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id x9-20020a170902ec8900b001cf6a75e972si3301204plg.136.2023.11.21.13.37.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Nov 2023 13:37:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 agentk.vger.email (Postfix) with ESMTP id 350B18022F73; Tue, 21 Nov 2023 13:37:33 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234552AbjKUVhY (ORCPT + 99 others); Tue, 21 Nov 2023 16:37:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52236 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234562AbjKUVhW (ORCPT ); Tue, 21 Nov 2023 16:37:22 -0500 Received: from mx0a-00128a01.pphosted.com (mx0a-00128a01.pphosted.com [148.163.135.77]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3AAADD56; Tue, 21 Nov 2023 13:37:19 -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 3ALJCwNP027036; Tue, 21 Nov 2023 16:37:06 -0500 Received: from nwd2mta3.analog.com ([137.71.173.56]) by mx0a-00128a01.pphosted.com (PPS) with ESMTPS id 3uer08e1sq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 21 Nov 2023 16:37:06 -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 3ALLb50d057183 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 21 Nov 2023 16:37:05 -0500 Received: from ASHBMBX9.ad.analog.com (10.64.17.10) 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, 21 Nov 2023 16:37:04 -0500 Received: from zeus.spd.analog.com (10.66.68.11) by ashbmbx9.ad.analog.com (10.64.17.10) with Microsoft SMTP Server id 15.2.986.14 via Frontend Transport; Tue, 21 Nov 2023 16:37:04 -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 3ALLaqiC020026; Tue, 21 Nov 2023 16:36:55 -0500 From: To: , , , , , CC: Marcelo Schmitt , , Subject: [PATCH 7/7] iio: adc: ad7091r-base: Add debugfs reg access Date: Tue, 21 Nov 2023 18:36:52 -0300 Message-ID: <3fdf3d1815b5181dc01490e2500b4eb4fe3fe579.1700595310.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-ORIG-GUID: SJ1pnIOPXoI6aswxSRZj1tMCS0ZsKlAS X-Proofpoint-GUID: SJ1pnIOPXoI6aswxSRZj1tMCS0ZsKlAS 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-21_11,2023-11-21_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 lowpriorityscore=0 adultscore=0 mlxscore=0 priorityscore=1501 mlxlogscore=999 spamscore=0 bulkscore=0 suspectscore=0 phishscore=0 clxscore=1015 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2311060001 definitions=main-2311210169 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 agentk.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 (agentk.vger.email [0.0.0.0]); Tue, 21 Nov 2023 13:37:33 -0800 (PST) From: Marcelo Schmitt 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 f9b4f91d1c4f..798f7b3cc7e1 100644 --- a/drivers/iio/adc/ad7091r-base.c +++ b/drivers/iio/adc/ad7091r-base.c @@ -157,8 +157,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