From patchwork Wed Apr 5 21:22:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Patrik_Dahlstr=C3=B6m?= X-Patchwork-Id: 13202558 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 54744C77B6C for ; Wed, 5 Apr 2023 21:24:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233497AbjDEVYC (ORCPT ); Wed, 5 Apr 2023 17:24:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41748 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232680AbjDEVXs (ORCPT ); Wed, 5 Apr 2023 17:23:48 -0400 Received: from ste-pvt-msa2.bahnhof.se (ste-pvt-msa2.bahnhof.se [213.80.101.71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 50930729F; Wed, 5 Apr 2023 14:23:33 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by ste-pvt-msa2.bahnhof.se (Postfix) with ESMTP id 5359E4111E; Wed, 5 Apr 2023 23:23:31 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at bahnhof.se Authentication-Results: ste-ftg-msa2.bahnhof.se (amavisd-new); dkim=pass (2048-bit key) header.d=dalakolonin.se Received: from ste-pvt-msa2.bahnhof.se ([127.0.0.1]) by localhost (ste-ftg-msa2.bahnhof.se [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id cLEjAgfxlFdL; Wed, 5 Apr 2023 23:23:30 +0200 (CEST) Received: by ste-pvt-msa2.bahnhof.se (Postfix) with ESMTPA id 90C05410A1; Wed, 5 Apr 2023 23:23:30 +0200 (CEST) Authentication-Results: ste-pvt-msa2.bahnhof.se; dkim=pass (2048-bit key; unprotected) header.d=dalakolonin.se header.i=@dalakolonin.se header.b="BKU6KxXw"; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by zimbra.dalakolonin.se (Postfix) with ESMTP id 5413094E54; Wed, 5 Apr 2023 21:23:29 +0000 (UTC) Received: from zimbra.dalakolonin.se ([127.0.0.1]) by localhost (zimbra.dalakolonin.se [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id Eo1i7dPfeaZD; Wed, 5 Apr 2023 21:23:13 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by zimbra.dalakolonin.se (Postfix) with ESMTP id 7942C94E10; Wed, 5 Apr 2023 21:23:12 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.10.3 zimbra.dalakolonin.se 7942C94E10 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dalakolonin.se; s=D374B428-D0A7-11ED-A657-75977B426508; t=1680729792; bh=tdhqZ0SVQrHBM7Ty7175uvKzDgdZmch0EnHFXXlVQ9Y=; h=From:To:Date:Message-Id:MIME-Version; b=BKU6KxXw0q3BYRECa/VLJ1Qmqwt+nhDQzLXW90g1ooUpPlyzmn0clAgEe770Mlo93 jtbmHgxFdwsJZBAUqhyNZFNulp0hcadwwWh/2gbMzN44iQU3PbWz6H8r+p0D7MOmbY KEIe0LrEfxrxWclWuGfoSSviQHRc37P1Qv0eb08yakFgRpQnVYVMA9cNjl3u0PGnhh phuGOkooSxFHzkOeBH9MOg/Zi8J5++wGFgy1ywboxJiXP6iIzCXQtZCyKVJyJlQsAI LiW1+yYriH7avPLH6c1MTmZBEb/7toDlZwOWAj3kPjRgqXxJNxChg3iae0w6a8P0TY 5w1Vw6ko3+fyw== X-Virus-Scanned: amavisd-new at dalakolonin.se Received: from zimbra.dalakolonin.se ([127.0.0.1]) by localhost (zimbra.dalakolonin.se [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 9C4YbUzBMhgc; Wed, 5 Apr 2023 21:23:12 +0000 (UTC) Received: from rack-server-1.dalakolonin.se (unknown [172.17.0.1]) by zimbra.dalakolonin.se (Postfix) with ESMTPSA id F225094E00; Wed, 5 Apr 2023 21:23:08 +0000 (UTC) From: =?utf-8?q?Patrik_Dahlstr=C3=B6m?= To: linux-iio@vger.kernel.org Cc: linux-kernel@vger.kernel.org, letux-kernel@openphoenux.org, kernel@pyra-handheld.com, pgoudagunta@nvidia.com, hns@goldelico.com, jic23@kernel.org, lars@metafoo.de, linux-omap@vger.kernel.org, =?utf-8?q?Pa?= =?utf-8?q?trik_Dahlstr=C3=B6m?= Subject: [PATCH v3 7/7] iio: adc: palmas: don't alter event config on suspend/resume Date: Wed, 5 Apr 2023 23:22:33 +0200 Message-Id: <20230405212233.4167986-8-risca@dalakolonin.se> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230405212233.4167986-1-risca@dalakolonin.se> References: <20230405212233.4167986-1-risca@dalakolonin.se> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org The event config is controlled through the IIO events subsystem and device wakeup is controlled by /sys/devices/.../power/wakeup. Let's keep those two knobs independent. Signed-off-by: Patrik Dahlström --- drivers/iio/adc/palmas_gpadc.c | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/drivers/iio/adc/palmas_gpadc.c b/drivers/iio/adc/palmas_gpadc.c index 2e0755e9e3a4..ba3cc0e68197 100644 --- a/drivers/iio/adc/palmas_gpadc.c +++ b/drivers/iio/adc/palmas_gpadc.c @@ -1137,16 +1137,10 @@ static int palmas_gpadc_suspend(struct device *dev) { struct iio_dev *indio_dev = dev_get_drvdata(dev); struct palmas_gpadc *adc = iio_priv(indio_dev); - int wakeup = adc->event0.enabled || adc->event1.enabled; - int ret; - if (!device_may_wakeup(dev) || !wakeup) + if (!device_may_wakeup(dev)) return 0; - ret = palmas_adc_configure_events(adc); - if (ret < 0) - return ret; - if (adc->event0.enabled) enable_irq_wake(adc->irq_auto_0); @@ -1160,16 +1154,10 @@ static int palmas_gpadc_resume(struct device *dev) { struct iio_dev *indio_dev = dev_get_drvdata(dev); struct palmas_gpadc *adc = iio_priv(indio_dev); - int wakeup = adc->event0.enabled || adc->event1.enabled; - int ret; - if (!device_may_wakeup(dev) || !wakeup) + if (!device_may_wakeup(dev)) return 0; - ret = palmas_adc_reset_events(adc); - if (ret < 0) - return ret; - if (adc->event0.enabled) disable_irq_wake(adc->irq_auto_0);