Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp1969819rdh; Sat, 25 Nov 2023 08:44:19 -0800 (PST) X-Google-Smtp-Source: AGHT+IFGfQqDBinCVc47+AcDIrcU/Atg70t4KS16GHZ9OCVN1mzhWPH6oNneCtDiHHQc6hV0qIRP X-Received: by 2002:a05:6808:1188:b0:3b8:4023:86e2 with SMTP id j8-20020a056808118800b003b8402386e2mr7885724oil.29.1700930658897; Sat, 25 Nov 2023 08:44:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700930658; cv=none; d=google.com; s=arc-20160816; b=ZpgvhymYhNzM1UZz6QI7nzoP/KCP8fKWl1DJj4zbBwbHbQT7i+LPuG8+Puc/gssLyn 42HbObCBdDdGT1uH8JwbkF2b3XM9RIhUcP9j7AE5evg8bJM6aSdZ4v/QHQNg1dozZjc4 QA+KIPaNeon0igtkMFFLWcIpm4pX8X83LsUxjO/Wk/pQ2OzK8k3EzzlGrR9mqdnkLozH YhhAkAldnAy94nYmsYCPAOpb+/hmSxXm7Nrzkrs7dJGZi4RFDlWo3AxGe1XVrLn2vW0q v0wSMrMwcXLT/yCTzWgcA9O8qLhIbyr/n6pLbCF76Ishn6RAg32vcndy+M+E1yHizbOL Ib7w== 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:subject:cc:to:from:date :dkim-signature; bh=kEZsBG9kWO+8dgnlFSYJiz1QSSZ1f+BLcRbPklFsElI=; fh=ESPtyGfxO2/njBQIL8vjsGAP9XGYUG/mWqSAPV+GTUY=; b=PVOYzXdmctSnZ+J4PXD6uBYONoSVRi9O6qn1ich2ghx+n2ieCcEAb7Pq439Y/op6Ah Ep4EG67AhhN8Umt6EfEN+gGaeYiiEwOB/nLgUNt21TKdaCCaTxeIGh1ZzNiua9Y+flGs ja1tELROGzErXgiDpc3IZ81fj1gVxjjDF4W/fdNdDdXZuJjosuLAKh/Xn4XdQAo4UwkE Z7wy6wSg6067ln1pni2yUKA0NOPD023vav6Jxj/d/VrzpIl1/Y3dZDdgeZIcRN6xKEN8 Qx/NwLzBGkHzBC6nN9ww7XYMIZJ2jhPQJIrXsRDTXdDpxG1+wVOV6aptesIfCjVJAgYj uUCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=d+65TYoK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id n123-20020a632781000000b005694a4640afsi6290282pgn.95.2023.11.25.08.44.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Nov 2023 08:44:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=d+65TYoK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 896ED806E5F9; Sat, 25 Nov 2023 08:44:17 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231736AbjKYQoI (ORCPT + 99 others); Sat, 25 Nov 2023 11:44:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44532 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229697AbjKYQoH (ORCPT ); Sat, 25 Nov 2023 11:44:07 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 00794FF for ; Sat, 25 Nov 2023 08:44:13 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 76B31C433C7; Sat, 25 Nov 2023 16:44:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1700930653; bh=x3bZImpG/T/VeEsQdG09Wf8mRYw2KVFi2C7qJH6OKWM=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=d+65TYoKqSuMmz8AsGRk/m6ZCRj2WTInxxXK4ztcZ+IhxSCXJQ9zatgP5WJ0EBvoO dbArQ18IyA7pzwIBnswZYZpnAURGC5wbdSFHzzRyS81sfzlQCxB17X7jsGDDShNyaY fEWSLwAi223pSz6E8eeBi/8Cx/PgxtE70Q2D7nw/IimUBC54183cL/c72ZQCuhHJnc gpPDwFEL9JfClCTQ0OaegJaN0xdCUq6Ydd5fxIPtVxAZtYB+IikUppEZcnyvxu9eKt myvnhUNtlHOcTzxxxhI/d4UPjJJm8IrotI13IbPywsjWZSvD7+4D2A7s1GlqF0HOjG 0NgkY3Lfkwq2Q== Date: Sat, 25 Nov 2023 16:44:04 +0000 From: Jonathan Cameron To: Marcelo Schmitt Cc: , , , , , , , , , Subject: Re: [PATCH v2 7/7] iio: adc: ad7091r-base: Add debugfs reg access Message-ID: <20231125164404.64072ffb@jic23-huawei> In-Reply-To: <271203e245d324f94678d212e4daf13386bee463.1700751907.git.marcelo.schmitt1@gmail.com> References: <271203e245d324f94678d212e4daf13386bee463.1700751907.git.marcelo.schmitt1@gmail.com> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, 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 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 (snail.vger.email [0.0.0.0]); Sat, 25 Nov 2023 08:44:17 -0800 (PST) On Thu, 23 Nov 2023 13:43:06 -0300 Marcelo Schmitt wrote: > Add direct register access support for AD7091R-2/-4/-5/-8 ADCs. > > Signed-off-by: Marcelo Schmitt regmap provides it's own version of this, so I'm not sure I'd bother adding the IIO one. See regmap-debugfs.c > --- > 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)