From patchwork Sun Apr 2 16:42:47 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: 78269 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1828875vqo; Sun, 2 Apr 2023 09:49:49 -0700 (PDT) X-Google-Smtp-Source: AKy350bRHODjSHSz8VYm3/HN7WKoIBOVqmgqArUtiapAzCqP2+uvvpHszZPyZU9WpyTJCav64e0d X-Received: by 2002:a17:906:2b8e:b0:946:c022:8979 with SMTP id m14-20020a1709062b8e00b00946c0228979mr21799211ejg.21.1680454189036; Sun, 02 Apr 2023 09:49:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680454189; cv=none; d=google.com; s=arc-20160816; b=LR2I0egke76BTMxwpmKtSeyjLKluFpym7PrfCdnxEz6qBnSD80xPeC5va6tbCFX/II muhWxNnSifiqb4hzNBUruclhLX/jt+ww5oQ/QuIxbOOyjt8mABiPadDLr2kbY8PbHJUf fiuPxgev3nkgNsikBjd5+kraTtqGEKXe5vywJxynkZoZbHK7b0dUSLDCORdKM/hhmuyd 0h7OwzNVQBzbezZWR7B1l7asygsLdiOVMyMRsm+IUBnZ8LbPr5sDh7FxdhDbCmUYL7a6 lvhmBlrG+bq9JuIupvQVA8DUIpnNL6bEVvojnwkMctnAvzJ9wVjedBPaFY+vh0OeBp3B kVcg== 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:date:subject:cc:to:from :dkim-signature:dkim-filter; bh=sSdmlIjoRWn1yhuvWO68xTpxveh96xI8zNrDWx1+g80=; b=rGw+lRnZb8np3icKdPRb35p0pAkE+1McvZsak5cvIu/iakV6d91modrKHzDvtEhBqH yN4maI65hDI7+4SNvi1ORhK68PmT4YZqrtz60D4hXdg8XMDARgeL+I3rOSm2AhiASaYz 9wgE1zZm4bKSOjw09v0WcZ76gIWsTj1X4mecZITu11ONcvJKOBx/j+rerjL74KKptSFQ 6Ea/QkMW9GW/WPJ+8FQ0lNI1ITxS0A0t9/7xoDFadTrGKdrX5OwVTaCb8m7Tzo7h7PRF F9SSuy5d9c7Sq44MxIuh8EJSF96GbpjnbLnhxQy8p1ATPDnQzQnvoKUwGYzoY5oXqiTj HocA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@dalakolonin.se header.s=D374B428-D0A7-11ED-A657-75977B426508 header.b=QN37+ZQl; 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=dalakolonin.se Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l21-20020a170906231500b009329cbca97esi211150eja.438.2023.04.02.09.49.25; Sun, 02 Apr 2023 09:49:49 -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=@dalakolonin.se header.s=D374B428-D0A7-11ED-A657-75977B426508 header.b=QN37+ZQl; 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=dalakolonin.se Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231282AbjDBQnv (ORCPT + 99 others); Sun, 2 Apr 2023 12:43:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55466 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231187AbjDBQnf (ORCPT ); Sun, 2 Apr 2023 12:43:35 -0400 Received: from ste-pvt-msa1.bahnhof.se (ste-pvt-msa1.bahnhof.se [213.80.101.70]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2129D18FAA; Sun, 2 Apr 2023 09:43:34 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by ste-pvt-msa1.bahnhof.se (Postfix) with ESMTP id CA8F43FB38; Sun, 2 Apr 2023 18:43:32 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at bahnhof.se X-Spam-Score: -2.1 X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 Authentication-Results: ste-pvt-msa1.bahnhof.se (amavisd-new); dkim=pass (2048-bit key) header.d=dalakolonin.se Received: from ste-pvt-msa1.bahnhof.se ([127.0.0.1]) by localhost (ste-pvt-msa1.bahnhof.se [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id hRrvXlEvjyb2; Sun, 2 Apr 2023 18:43:32 +0200 (CEST) Received: by ste-pvt-msa1.bahnhof.se (Postfix) with ESMTPA id 0A8193FA8F; Sun, 2 Apr 2023 18:43:32 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by zimbra.dalakolonin.se (Postfix) with ESMTP id 8F7B0937C0; Sun, 2 Apr 2023 16:43:31 +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 JKD4FSV4JqrC; Sun, 2 Apr 2023 16:43:22 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by zimbra.dalakolonin.se (Postfix) with ESMTP id E6B38937B0; Sun, 2 Apr 2023 16:43:21 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.10.3 zimbra.dalakolonin.se E6B38937B0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dalakolonin.se; s=D374B428-D0A7-11ED-A657-75977B426508; t=1680453801; bh=sSdmlIjoRWn1yhuvWO68xTpxveh96xI8zNrDWx1+g80=; h=From:To:Date:Message-Id:MIME-Version; b=QN37+ZQlGkNnqNukzY2lOZdWzQIlxyBP7dIa83CocW7N78+4cYRz76YT17Y9E2dlG pFuIGkAM+ck2lpRT4KHurFg/uHeCUqD6ri0mwQMhdWH5IWWGUC3ebcpYzS4mnZuLmh EfcEjGFRqx+1d4jLwjrVd1wG9OOdAXYPLRhn8B0YdKglGdbbDhAes5xNBg8mcsphml HvZXEyESMDF9/ZvNM1wRKSfRw61WAZ/bk3vzj9Fw7Hq0xmKEP15GqasrSUUzHeMgdp O3gnaK9DpwMMyHgmKN6HcTg60NOMzdNcALkDXxdSFOdgHqXg/LW/Ym40XP17g3VDXb yiCSSiZA+v/TA== 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 5a8U8w8BseHi; Sun, 2 Apr 2023 16:43:21 +0000 (UTC) Received: from rack-server-1.dalakolonin.se (unknown [172.17.0.1]) by zimbra.dalakolonin.se (Postfix) with ESMTPSA id 65C38937A7; Sun, 2 Apr 2023 16:43:20 +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 v2 7/7] iio: adc: palmas: don't alter event config on suspend/resume Date: Sun, 2 Apr 2023 18:42:47 +0200 Message-Id: <20230402164247.3089146-8-risca@dalakolonin.se> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230402164247.3089146-1-risca@dalakolonin.se> References: <20230402164247.3089146-1-risca@dalakolonin.se> MIME-Version: 1.0 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-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1762083931220998184?= X-GMAIL-MSGID: =?utf-8?q?1762083931220998184?= 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 f693d69a10a8..d4e1e80296d0 100644 --- a/drivers/iio/adc/palmas_gpadc.c +++ b/drivers/iio/adc/palmas_gpadc.c @@ -1127,16 +1127,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); @@ -1150,16 +1144,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);