Received: by 2002:a05:7412:98c1:b0:fa:551:50a7 with SMTP id kc1csp1358954rdb; Sun, 7 Jan 2024 16:30:44 -0800 (PST) X-Google-Smtp-Source: AGHT+IF2wF9QGEfTirsDXjHn5DZMlffu9bq5AXGXAaLp9nUIbfdL1HM9INquXPspMzmDev2RB1BD X-Received: by 2002:a05:6358:9391:b0:174:e47a:f4b3 with SMTP id h17-20020a056358939100b00174e47af4b3mr2738981rwb.13.1704673843975; Sun, 07 Jan 2024 16:30:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704673843; cv=none; d=google.com; s=arc-20160816; b=nZxFhRklP/8fj8UEVfzs2OO4GiMjn1OrIxuctkAhZN6fc+1oqq88nqQ4dMhcrhH+hi GoMszImUVRbS/p4nGWYO8O9tY3hmwMp8y0HMqbzDUgJfUUVi/be6GHzW7CI0xPCA+WjL cOiZuovRkssOAIzxMxIJs8LeA53OBnGUaSbaS/S9ol8y5bvzGF7NVS9xNVJ6fCi2jzS/ 2BFgiuRj+pP6WldPHo4+XqO3Hhtohxs9oxnwENr28mGiFApYHTyi5Fznbh7vCui9pSjC TfjoiZrIlwqqwW1TYDYedTWi/tJkgD6VHGPAhRb1Jh9Tt1xTRNBOyLANzxoYwZ0nugey IsRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=qVtt9Z51WVizmklSojDBStset8GLJ3cHfn2WBgUbF8s=; fh=//sNr2h0DsItKXoOjThmkRviLS89ji0BittNmy8tjaY=; b=uUxzCYZKg+JNzyfSM+7J0XEb9B5pKr1ycaeSnHEiIYGVyroM+KF29rqu7J46p5eXaT 7PNT82Yq94a7c2UrTrzkQOA/hpdz5s1WkEJDtZfEaqSw1SQxgGZl/WO36vCrn+EJhF0F WUWafSnRHcBp9b/N43TJZfWHA5/gPdVODBT1xJvMHYCJA67yfBvqxwtnrGhh1BHgEUAV wWRyBOaigIyupxK8BFXiFAQgTjSS3Vt+IeS/5qKyzrstx4gx7MbCXBHkEriqa8mVDrrt bmGmYustFicwxVaZtlwTW+5ktAjuKpo0j9QfwyDq+xPjnHEaGm7tuKXHCBO8oc/g89DJ qKUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=K2Qf2H++; spf=pass (google.com: domain of linux-kernel+bounces-19024-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-19024-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id m17-20020a17090aab1100b0028c25f30c9csi4791448pjq.141.2024.01.07.16.30.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Jan 2024 16:30:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-19024-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=K2Qf2H++; spf=pass (google.com: domain of linux-kernel+bounces-19024-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-19024-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 262C0B2110F for ; Mon, 8 Jan 2024 00:30:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 53F0F15AE; Mon, 8 Jan 2024 00:30:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="K2Qf2H++" X-Original-To: linux-kernel@vger.kernel.org Received: from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net [217.70.183.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 47061800; Mon, 8 Jan 2024 00:30:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Received: by mail.gandi.net (Postfix) with ESMTPSA id D2C8040002; Mon, 8 Jan 2024 00:30:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1704673818; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=qVtt9Z51WVizmklSojDBStset8GLJ3cHfn2WBgUbF8s=; b=K2Qf2H++p5e83SaS3+FtQPUoZ2T7TSgu9CIIsD5JfT6IOctItW64LHO2lKuSaVbsG3AXdZ 63fig7MPtuG6uXeWWlas64brwCg6zynYGuEGI4ud54iRVPmecnBn9pvo0oSa7lHGdv/JHI ENgaltFHKzAkGt+C3m4h4tJ6u3PYrxIqcjFzz3lvxHElFvHY+6b2zCbV3MFhiRnwGGPT1T vpi+xT6rFrhEeRpQCnvj611vsrfIiwCYnG5Fwf+kcXxt/27qSQBqFeP58bUgmWB3HE8Y1y ohML5OE79Zu3KvLrz7xjtL8ciBuAqasIyG8QzNtWmISD2BLfVAmPN30MP/H2fQ== From: alexandre.belloni@bootlin.com To: Alessandro Zummo , Alexandre Belloni Cc: linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] rtc: rv8803: add wakeup-source support Date: Mon, 8 Jan 2024 01:30:10 +0100 Message-ID: <20240108003010.599456-1-alexandre.belloni@bootlin.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-GND-Sasl: alexandre.belloni@bootlin.com From: Alexandre Belloni The RV8803 can be wired directly to a PMIC that can wake up an SoC without the CPU getting interrupts. Signed-off-by: Alexandre Belloni --- drivers/rtc/rtc-rv8803.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/rtc/rtc-rv8803.c b/drivers/rtc/rtc-rv8803.c index 11e6b0d31f5d..1327251e527c 100644 --- a/drivers/rtc/rtc-rv8803.c +++ b/drivers/rtc/rtc-rv8803.c @@ -712,9 +712,12 @@ static int rv8803_probe(struct i2c_client *client) if (err) dev_err(&client->dev, "failed to set wake IRQ\n"); } + } else { + if (device_property_read_bool(&client->dev, "wakeup-source")) + device_init_wakeup(&client->dev, true); + else + clear_bit(RTC_FEATURE_ALARM, rv8803->rtc->features); } - if (!client->irq) - clear_bit(RTC_FEATURE_ALARM, rv8803->rtc->features); if (of_property_read_bool(client->dev.of_node, "epson,vdet-disable")) rv8803->backup |= RX8900_FLAG_VDETOFF; -- 2.43.0