Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp2349851rdb; Fri, 8 Dec 2023 05:52:16 -0800 (PST) X-Google-Smtp-Source: AGHT+IEBbSdsf3i68mA9hvru+atPblzAQUrK0EXN5GZhegyPm3Z7gjOZlN9D5NHfW1ukq3O4os9j X-Received: by 2002:a17:903:268d:b0:1d0:752e:c420 with SMTP id jf13-20020a170903268d00b001d0752ec420mr48372plb.34.1702043536337; Fri, 08 Dec 2023 05:52:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702043536; cv=none; d=google.com; s=arc-20160816; b=UtoczHaVARVSYRtFWZCUJdWLDht1L7ljRIz7MhBj5MGRiPJzC0Mytuo7rWYFAVJI7Y egMpAdDv2nQ+/IT4BD3L4YnExPbCgoIWgsKrY4U3+8mXCw+yx2xijtGiFz/m1K5Q4SMd 07qkKKE/xlsxdvFSHgUYZFpiSMfGTl840Y3NcV8u39Q/PcrVNxGdb6WitKBzcjryjWKP EpwuyitxN8MtNng4pxUuOwcVzDBPWmlFSTJlokYLoaIKadcA+28D0vnQpGv+iZNLfdws /69KyNL0OsNfgqKrvW/GFp4wS9Fn4BlALGXyTd58MjcpQ9bm5LuEXXr9EqyOk3PR2xxa l6rg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=w05jcvJbftuz+V4PIwlumxl68ycFODGUFJ//SIJMXoc=; fh=sFr9N9/Q+207osPW92a1CFfyHiaoQ53KwbtQcVc+N/E=; b=TAyMXfjbQhLiP07hODLnvU1JVjsJj+2LKlK1rufbzDyX+4UsO8NHOxWQQmKt5sP5RO zgI1Nv1TmMX02jNrwG5/0OYEm8WljPODog9eVHoISlVPOF/w0yfcNjDQgQqWUUZ9H9rY OfQwjmeCpB609mDEv5bQcxq8lSxKV/cN3PZmve3aajealNZYcobkHATQZQzTY1Zj/qNj /XN96xuAZk62TcQnTnLnk6vvAqgiqM9vVeZUjFvHGtx8/++2Yeeh/M7s3swZGRnvhLj8 7j6obh2efr4aAA0k2lkv68OPGRNI0aiESvlfH1gkXawkXz+WiRRxbjfZCq4kF5d2qGw2 7xEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=akAduOxG; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id iz22-20020a170902ef9600b001d0050e2452si1609864plb.45.2023.12.08.05.52.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Dec 2023 05:52:16 -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; dkim=pass header.i=@gmail.com header.s=20230601 header.b=akAduOxG; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 4691C8076172; Fri, 8 Dec 2023 05:50:55 -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 S1573864AbjLHNuY (ORCPT + 99 others); Fri, 8 Dec 2023 08:50:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33634 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1573849AbjLHNuX (ORCPT ); Fri, 8 Dec 2023 08:50:23 -0500 Received: from mail-pf1-x433.google.com (mail-pf1-x433.google.com [IPv6:2607:f8b0:4864:20::433]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C953F198C; Fri, 8 Dec 2023 05:50:29 -0800 (PST) Received: by mail-pf1-x433.google.com with SMTP id d2e1a72fcca58-6cec976b197so887986b3a.0; Fri, 08 Dec 2023 05:50:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702043429; x=1702648229; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=w05jcvJbftuz+V4PIwlumxl68ycFODGUFJ//SIJMXoc=; b=akAduOxGieGm14GFaa/A4ucqm7QvDyaQULiMFmh4yFOPUP3brtqVBuz27VcCSYXDF8 bI6ZGC6czjXfWCjnpGLgwqpqoJX3noUrkQLLHM8zq3yFbA2WJVADm06I40WDiXHEqWfl S8eU/HGZePZSlgim66gvHu9cyIdViVB5JSEnCSXTSxC1rv4PYMc0PdyAAaLucmuzocUt 1ct4fp3HDh9WyxyIlXb4GpKkFerXZAVx2KbGLfAU6mCiGbeezPxU2Zz28CCNkh9BNbrE Uj5s/JeNz8z0cmwm8p6btRYz5FaIAVKg2BL8MZoEU0Vz6tMKXK0LlwONvZPmUtRAgUoJ 7m6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702043429; x=1702648229; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=w05jcvJbftuz+V4PIwlumxl68ycFODGUFJ//SIJMXoc=; b=p2ZFSbBggPI9uAafEWJpBOEuNgzGCP8dZHwvwZyeE8dTFVJTWM7fWUZpj6mk8axlTz tE3IR7TJ0Rgvooqj3LTLNv1MIIa85tfJkj+Cm2bHuB8qRJKW6SqJD3bYIBZMDP4nW7Fq ECq1cQqvCpYDYX64hOBJ3OziqzU06fm3JoEBVi6yz+FM1NkgsUs8NagggFvn+zwdBroe VECMWSABK/Vx/xo7sfTrZiSAm/JOHw8Rf4a5wIaOjd6FvUnFpytALOf+4YPJyM63EX44 g7EFVAM53jrHmlC1uHekAzTiyhphN9U3s2rUNlceXpZ0M0AHWzT4N4UPZ39v3bVY7nGf EXoQ== X-Gm-Message-State: AOJu0YxJBw7Z92CQjIhGe90H3zOfFFy/bR9SO+UsF2nWQJWEXbwO0EDq 2kX7RLGaD/d7ZzcvSB6uVas= X-Received: by 2002:a05:6a20:3ca1:b0:190:55ed:c42 with SMTP id b33-20020a056a203ca100b0019055ed0c42mr39843pzj.63.1702043429043; Fri, 08 Dec 2023 05:50:29 -0800 (PST) Received: from localhost ([2804:30c:95c:8600:5b2d:e35b:5f45:dc84]) by smtp.gmail.com with ESMTPSA id d3-20020a056a0010c300b006c0316485f9sm1583704pfu.64.2023.12.08.05.50.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Dec 2023 05:50:28 -0800 (PST) Date: Fri, 8 Dec 2023 10:50:15 -0300 From: Marcelo Schmitt To: David Lechner Cc: Marcelo Schmitt , apw@canonical.com, joe@perches.com, dwaipayanray1@gmail.com, lukas.bulwahn@gmail.com, paul.cercueil@analog.com, Michael.Hennerich@analog.com, lars@metafoo.de, jic23@kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, dan.carpenter@linaro.org, linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 00/13] Add support for AD7091R-2/-4/-8 Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, 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]); Fri, 08 Dec 2023 05:50:55 -0800 (PST) On 12/07, David Lechner wrote: > On Thu, Dec 7, 2023 at 12:36 PM Marcelo Schmitt > wrote: > > > > From: Marcelo Schmitt > > [...] > > > > I see regmap's interface for reading device registers under /sys/kernel/debug/regmap/. > > I can read all registers but can't write to any of them unless I force define > > REGMAP_ALLOW_WRITE_DEBUGFS. > > > > When testing events for this driver I often write to device registers > > to set different rising/falling thresholds. I do something like this: > > # echo 0x17 0x100 > /sys/kernel/debug/iio/iio:device0/direct_reg_access > > > > I tried read/writing to files under iio:device events directory but always > > get segmentation fault. I must be forgetting to implement something. > > What am I missing? > > > > It looks like event callbacks (.read_event_value and friends) are > missing from `static const struct iio_info ad7091r_info = { ... }`. > These callbacks aren't checked for NULL, e.g. in iio_ev_value_show(), > so that is likely where the segfault is happening. Hi David, thank you for pointing that out. Will implement those calls in v4.