Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp376144rdb; Sat, 30 Sep 2023 07:53:00 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGFFyGK6DYdGk911vgUqgN/QE0ZBzkpFFVRCgO86eUoloAfai6YVQXjk5qbKyyeOcNwGfgC X-Received: by 2002:a17:902:7445:b0:1c5:ce3c:c399 with SMTP id e5-20020a170902744500b001c5ce3cc399mr7773440plt.39.1696085579923; Sat, 30 Sep 2023 07:52:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696085579; cv=none; d=google.com; s=arc-20160816; b=r8MtlJO5sVTqqtWtNuRboKYK8QTY1KiYrtmyUHLXEv+rjuYUpwuWfcNh9keaUbdCFS tETFWoDDSn5T7BV7c5NSJ8btyJyqZLdzYoPZXM6JT8HICIt+vj4C8IkJlAnIrgTaPEbo XM6wsYiGrRl37iH9xnTaQvp97/VId0Wp2Cgde7ylNp9GB20ehwmkuN9UV6e7xsQX4Ibu GUrBAslFPFvyCe8tM9vh96QgBzn/76XbJC8rBrxAqHyzm/G98xVr0HBshVPknl2GTALg j3H3cHAK4xYIr4DoHBfZ7KiOeRzkcWii96dS1sV06gzTd+ePidIxj8Hdce9XWumSk0aF 8kMg== 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=8uK9ware1BKHuuxi+Lod+UNXpcMAdrFwLgxeeXmFQbo=; fh=e9lXfbAZmLMG/YSSxlbXRgGopMc52ojan+iACBc5a/Y=; b=NicaXiVAz1ySvG+erkGKQfEMAlvu9T43T6Ro3rvLlKB5t4x3mCV4kF6pDxcn+RjGE4 k8yQm/85G0aY4cpPICv9KYOrpqeQkeOHY5L5gmyGaMaFe5BaJP2h4hPKkpD6MeD2bbNH WRxfZOQAAJgnj/LpB6WEJq8dI2jOfkHz9HDynfJPenA4ZEbyLM8VIseC+dV4LKs3cffU 74RtkSdf3xsw93/dx/KehXqk7DFnYI4CsuvPNBSYOYKbvncf9A7KmJUP82EvmnRlbs35 ixx0OBnrX70Nd0slFr2vH8p2ieV8YZcbIAtVJ6K+xIx4Wg9sODS8piru0BQn4fzbDKPc SQQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=PsY2NRb3; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id h5-20020a170902680500b001ab29e00303si11931159plk.426.2023.09.30.07.52.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 30 Sep 2023 07:52:59 -0700 (PDT) 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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=PsY2NRb3; 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=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 groat.vger.email (Postfix) with ESMTP id 9AF648058A0B; Sat, 30 Sep 2023 07:52:57 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234336AbjI3Owr (ORCPT + 99 others); Sat, 30 Sep 2023 10:52:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35976 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234320AbjI3Owq (ORCPT ); Sat, 30 Sep 2023 10:52:46 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BDAEBBA; Sat, 30 Sep 2023 07:52:44 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 345ADC433C7; Sat, 30 Sep 2023 14:52:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696085564; bh=THPze5AUjQwvb2AK0QGXQIyXlQBsto61AATNgwXhGU4=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=PsY2NRb32noFVYu5LmNxffRjMbM3KQx5dx3WJfPsCr6k8QUI7rRK4jc8mTvXhbH1v ORGyxj6zu8aFa21wGJoaUCxfgm4r6ttCHr0AaD1BnrjYqG5wu3LOi0U97lBsJSB6SU jYxzYXnnvHTItWIXEzAeBuV+FyvFwjzleQYbjNPg6ttNwCqDTaWceVGhhvPOtkhu+x uofotm4lDN2A+sZ4wH7Mn69Lou0Y2OPwnesmtzz/YAeUrT6F7JqT16NACR6Rat5SkX ZVWfx5/EWkEeI7yVtrTtrdmmbm7/Mno9rx9D9JGqYhYtmRpJ6xeVt2Bb5kmg8+m9Mx QC5o0Paotqwlg== Date: Sat, 30 Sep 2023 15:52:42 +0100 From: Jonathan Cameron To: David Lechner Cc: linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-staging@lists.linux.dev, David Lechner , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Michael Hennerich , Nuno =?UTF-8?B?U8Oh?= , Axel Haslam , Philip Molloy , linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 11/27] staging: iio: resolver: ad2s1210: add debugfs reg access Message-ID: <20230930155242.6490bcab@jic23-huawei> In-Reply-To: <20230929-ad2s1210-mainline-v3-11-fa4364281745@baylibre.com> References: <20230929-ad2s1210-mainline-v3-0-fa4364281745@baylibre.com> <20230929-ad2s1210-mainline-v3-11-fa4364281745@baylibre.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=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS 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]); Sat, 30 Sep 2023 07:52:57 -0700 (PDT) On Fri, 29 Sep 2023 12:23:16 -0500 David Lechner wrote: > From: David Lechner > > From: David Lechner > > This add an implementation of debugfs_reg_access for the AD2S1210 > driver. > > Signed-off-by: David Lechner I never really care if a driver implements this or not. However, if you find it useful that's fine, so applied. Thanks, Jonathan > --- > > v3 changes: None > > drivers/staging/iio/resolver/ad2s1210.c | 20 ++++++++++++++++++++ > 1 file changed, 20 insertions(+) > > diff --git a/drivers/staging/iio/resolver/ad2s1210.c b/drivers/staging/iio/resolver/ad2s1210.c > index 0663a51d04ad..31415fbb6384 100644 > --- a/drivers/staging/iio/resolver/ad2s1210.c > +++ b/drivers/staging/iio/resolver/ad2s1210.c > @@ -614,9 +614,29 @@ static int ad2s1210_initial(struct ad2s1210_state *st) > return ret; > } > > +static int ad2s1210_debugfs_reg_access(struct iio_dev *indio_dev, > + unsigned int reg, unsigned int writeval, > + unsigned int *readval) > +{ > + struct ad2s1210_state *st = iio_priv(indio_dev); > + int ret; > + > + mutex_lock(&st->lock); > + > + if (readval) > + ret = regmap_read(st->regmap, reg, readval); > + else > + ret = regmap_write(st->regmap, reg, writeval); > + > + mutex_unlock(&st->lock); > + > + return ret; > +} > + > static const struct iio_info ad2s1210_info = { > .read_raw = ad2s1210_read_raw, > .attrs = &ad2s1210_attribute_group, > + .debugfs_reg_access = &ad2s1210_debugfs_reg_access, > }; > > static int ad2s1210_setup_clocks(struct ad2s1210_state *st) >