Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp1470044rwl; Wed, 12 Apr 2023 13:25:31 -0700 (PDT) X-Google-Smtp-Source: AKy350YCQah+IFdVPLdhC7TT6ljaf03t8/UJmJ0NX63cTt9Ej1kTSgIohTo2CO/Uj6fJj7KifoUy X-Received: by 2002:a17:902:ced2:b0:1a1:e364:3452 with SMTP id d18-20020a170902ced200b001a1e3643452mr156853plg.29.1681331131451; Wed, 12 Apr 2023 13:25:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681331131; cv=none; d=google.com; s=arc-20160816; b=trecTxiamPUCYJ4bOJSCQdYbuCcOIO2JJjry7FSKeOAqYRoRlKzWEfRNO6uZC1qomL +r/Eb85qr1Yz19+1vY77IjUq9YYs3QcXHWm3ssE9pWAAKCg+ZatvlUt6X08FpqieIXwu PjFRuWZnWaiUjXPH2HQ/QyO4wyFQYlBr4mVpQwSm8Wtsh0nQpDyp6NyQIFNv9RLd7TCx fp5zMtpW9eW+qIyleSO9g1Xq6xW1ygkcLinGhUlnTDDmNL1ePly4Bxn90DOGeZjjZ3vV Uw2bfHhINIrOwA3htjuyyR7KagDCK5DlsU+h8qanzYEUvFVpdZWA6bScvOLg4m6pu8Rq gSKg== 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=N+9abvz9znvoLglqS4hUaXrsk7/O0dKIvP9M+M6A9yE=; b=HjFl/vkgi8NdkuPhdkuAbnhBBUCq2xvpLihUFf0fDMeO9EcKm96DnbwUL39neOHD5O Tc+3wNGILC8n7CT7ZBuzAUs4TkJ2Ezlqmj39lZWkWR029c2ePWhrROr+qmT4ntVktany icqDSDr41RVwQWcLfOuYWKi+1wBjPOOIOMAX1vZYhBjTwdDgg6KQAEjJ8rT/tOiGwi5C +Xe6u0SZo959inBJ5wdJGahqMyIIvLV/Lxw/HWl5r0uXUfWOVP6arJqKl8/bke845kiW 9bLrCG1gNP/O18K7gwrkjAei+zKPOsZX+MWvnrSPoxau8KdMsyBqnhHBZX0+f1DfIHZ1 Gu0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=n4Et6VbZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d12-20020a170902aa8c00b0019b7766afdfsi8121525plr.626.2023.04.12.13.25.19; Wed, 12 Apr 2023 13:25:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=n4Et6VbZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229950AbjDLUWU (ORCPT + 99 others); Wed, 12 Apr 2023 16:22:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35706 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229520AbjDLUWT (ORCPT ); Wed, 12 Apr 2023 16:22:19 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BC0CB5586; Wed, 12 Apr 2023 13:22:17 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 605E1633C2; Wed, 12 Apr 2023 20:22:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 03CBDC433D2; Wed, 12 Apr 2023 20:22:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1681330936; bh=A8Ztthf5vpIeWzvIFyeemrhpgL0mny/z5Tc424nFPW8=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=n4Et6VbZkBD7rIBP4456XXnbgLf123tNC4vbd/ZaVbIiStGchi+gfwbWFQsQx6RzJ aKrL5OHYknG4E1+3B4ldpNBFYkZnRlDp2i58AkHxYCEAfNyqQKqnEai7FdvsMJOpwK dTFy8WNOhidzyvT10Tntb4d+FiwcHR4ozNHDZzvAwCJ2kdPuCG62Gzu4TkBbojRVND Vu551a29x2dT+JEk2guShMcYm+xCECfSni860X5Pax6mzEff/GEMODswLHMXCRZwgT tMUNv4+Ls35wYGRdDWtRH94p8Pr22j1h8+ZCZQ/9xyZJPDf39BJmem8YLkWPI84yfZ /W5iHLP9pvxHg== Date: Wed, 12 Apr 2023 21:22:13 +0100 From: Jonathan Cameron To: Patrik =?UTF-8?B?RGFobHN0csO2bQ==?= Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, letux-kernel@openphoenux.org, kernel@pyra-handheld.com, pgoudagunta@nvidia.com, hns@goldelico.com, lars@metafoo.de, linux-omap@vger.kernel.org Subject: Re: [PATCH v4 0/9] iio: adc: palmas_gpadc: add iio events Message-ID: <20230412212213.614c9683@jic23-huawei> In-Reply-To: <20230408114825.824505-1-risca@dalakolonin.se> References: <20230408114825.824505-1-risca@dalakolonin.se> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.37; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 On Sat, 8 Apr 2023 13:48:16 +0200 Patrik Dahlstr=C3=B6m wrote: Hi Patrik, Patches 3-9 applied from this posting to the togreg branch of iio.git which will initially be pushed out as testing so 0-day can poke at it tomorrow. Thanks, Jonathan > This series is based on iio/togreg [1] and includes one patch ("fix NULL > dereference on rmmod") which is already in linux-next and another patch > from Jonathan Cameron ("Take probe fully device managed") to make the > rest of the patches apply cleanly to iio/togreg. >=20 > The palmas gpadc block has support for monitoring up to 2 ADC channels > and issue an interrupt if they reach past a set threshold. This can be > configured statically with device tree today, but it only gets enabled > when reaching sleep mode. Also, it doesn't look like anyone is using it. >=20 > Instead of this one special case, change the code so userspace can > configure the ADC channels to their own needs through the iio events > subsystem. The high and low threshold values can be set for every > channel, but only 2 thresholds can be enabled at a time. Trying to > enable more than 2 thresholds will result in an error. >=20 > The configured thresholds will wake up the system from sleep mode if > wakeup is enabled in /sys/devices/.../power/wakeup. >=20 > The old platform data was removed. >=20 > Thresholds, events, and wakeup were tested on omap5-uevm board. It wakes > up from sleep mode when wakeup is enabled and a threshold is passed. A > userspace tool for monitoring events and adjusting thresholds can be > found at [2]. >=20 > For more background and the use case for these patches, see [3]. >=20 > V3 -> V4: > * Reabased to iio/togreg and included required patches. > * Avoid initializing variables unnecessarily. > * Minor cosmetic fixes to comments. > V2 -> V3: > * Rebased to linux-next. > * Avoid reconfiguring events on error and when old =3D=3D new value. > V1 -> V2: > * Begin by removing adc_wakeupX_data instead of doing it last. > * Split changes in smaller patches >=20 > [1] git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git > [2] https://github.com/Risca/pyra_vol_mon > [3] https://pyra-handheld.com/boards/threads/improve-volume-wheel-daemon-= bounty.99430/post-1711410 >=20 > Jonathan Cameron (1): > iio: adc: palmas: Take probe fully device managed. >=20 > Patrik Dahlstr=C3=B6m (8): > iio: adc: palmas_gpadc: fix NULL dereference on rmmod > iio: adc: palmas: remove adc_wakeupX_data > iio: adc: palmas: replace "wakeup" with "event" > iio: adc: palmas: use iio_event_direction for threshold polarity > iio: adc: palmas: move eventX_enable into palmas_adc_event > iio: adc: palmas: always reset events on unload > iio: adc: palmas: add support for iio threshold events > iio: adc: palmas: don't alter event config on suspend/resume >=20 > drivers/iio/adc/palmas_gpadc.c | 616 +++++++++++++++++++++++++-------- > include/linux/mfd/palmas.h | 8 - > 2 files changed, 478 insertions(+), 146 deletions(-) >=20 >=20 > base-commit: f73df43e957a6fc705a9bd6d143585bdf1b13365