From patchwork Fri Mar 24 20:38:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Fainelli X-Patchwork-Id: 666779 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 AAD74C6FD1C for ; Fri, 24 Mar 2023 20:38:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232149AbjCXUim (ORCPT ); Fri, 24 Mar 2023 16:38:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54258 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232139AbjCXUik (ORCPT ); Fri, 24 Mar 2023 16:38:40 -0400 Received: from mail-pl1-x62c.google.com (mail-pl1-x62c.google.com [IPv6:2607:f8b0:4864:20::62c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8EE1E1E291; Fri, 24 Mar 2023 13:38:39 -0700 (PDT) Received: by mail-pl1-x62c.google.com with SMTP id bc12so2977747plb.0; Fri, 24 Mar 2023 13:38:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1679690318; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=L17oQFBwh960wPlLJy74rPkpUlCRFoXdnkcNVNHA6eI=; b=gQpaDzq1CFFUBBp90qms3uD/42u984iIFwH72tEbcEq6/kKgT0l3q/SXCTsISKXEil OXFmQsMl77VA7tOetyHiKgOwLFewnFXrtrAFbymcQoN1dFSjvpzUbscIULh31bZAB2vz LaEUyGc5E6Zq4pGT7cU2NFkUYbuQbOdmQln9uJUQn80Gu8Lt5h3YjXI9FC/13d6bst69 cm6Q97eFWZ6sGwgviLFyS59bNtriUvdDxYBm4+zZVkSyJ/LCMLiLxvkvWz1Pb/xVh0+I 4N9bBcHdIAykN8oIvbH/K7Q1EjzN8QHx8zbedqDKVbrZT+AKl+UiterEBXy67FLcmNol Uvbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679690318; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=L17oQFBwh960wPlLJy74rPkpUlCRFoXdnkcNVNHA6eI=; b=hL1uUqhQc+93R+uvnhh76l1jyiQcsunyx7XaLkHyCxz2N+2rohWQ0HLM2GKrBTYXaY HTCw0AOgfWKK/OFcWwLmzluXqSPMg0C7iKaYrotbLgYJY0J6nE+mHbT5f2DTO0kLMq7U oh4AdJgNrWnJve54Iw5FXqU/3FBZdFHiFs8DMaruihpSiC15lyWb6w7gsWGoQdweus2b rbW/w7xs6lw3nTPdUEaMJD04WVzaQTOxos1JgzVjOdYWYpIHDwxMIKg81zD4NoaMdC9M SUtpTUfT8xVuEzLCwADRWJEAeMjdDt/D7pXkVyL7d+/4tu5KopB5NGFqK+DHrFMgvjlB OcYg== X-Gm-Message-State: AAQBX9cem5wAkSJ0IRDS6eGqHmmkJw0mEQ89mEzOrslQ8fJU75/KjVVq NdZwfoLktllPTCj+q8DzAHh45AfIF7w= X-Google-Smtp-Source: AKy350ZLs+tUkVMrVQO98521NjftswQW+dxjR/12EQrJsxqezKyUVNmiz/ZJVfNBzmHRxcjs7qR4oA== X-Received: by 2002:a17:902:dac2:b0:1a1:cef2:acd1 with SMTP id q2-20020a170902dac200b001a1cef2acd1mr4641819plx.17.1679690318572; Fri, 24 Mar 2023 13:38:38 -0700 (PDT) Received: from fainelli-desktop.igp.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id f17-20020a170902ab9100b001966d94cb2esm14503431plr.288.2023.03.24.13.38.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Mar 2023 13:38:38 -0700 (PDT) From: Florian Fainelli To: linux-kernel@vger.kernel.org Cc: Florian Fainelli , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Sean Young , Sebastian Hesselbarth , Ravi Kumar V , linux-media@vger.kernel.org (open list:MEDIA INPUT INFRASTRUCTURE (V4L/DVB)), devicetree@vger.kernel.org (open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS), Matthew Lear Subject: [PATCH v2 1/2] dt-bindings: media: gpio-ir-receiver: Document wakeup-souce property Date: Fri, 24 Mar 2023 13:38:32 -0700 Message-Id: <20230324203833.3540187-2-f.fainelli@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230324203833.3540187-1-f.fainelli@gmail.com> References: <20230324203833.3540187-1-f.fainelli@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org The GPIO IR receiver can be used as a wake-up source for the system, document that. Signed-off-by: Florian Fainelli Acked-by: Krzysztof Kozlowski --- Documentation/devicetree/bindings/media/gpio-ir-receiver.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Documentation/devicetree/bindings/media/gpio-ir-receiver.yaml b/Documentation/devicetree/bindings/media/gpio-ir-receiver.yaml index 61072745b983..008c007ed702 100644 --- a/Documentation/devicetree/bindings/media/gpio-ir-receiver.yaml +++ b/Documentation/devicetree/bindings/media/gpio-ir-receiver.yaml @@ -23,6 +23,9 @@ properties: description: autosuspend delay time in milliseconds $ref: /schemas/types.yaml#/definitions/uint32 + wakeup-source: + description: IR receiver can wake-up the system. + required: - compatible - gpios From patchwork Fri Mar 24 20:38:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Fainelli X-Patchwork-Id: 667122 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 B372DC76195 for ; Fri, 24 Mar 2023 20:38:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232171AbjCXUio (ORCPT ); Fri, 24 Mar 2023 16:38:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54330 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232141AbjCXUil (ORCPT ); Fri, 24 Mar 2023 16:38:41 -0400 Received: from mail-pj1-x102f.google.com (mail-pj1-x102f.google.com [IPv6:2607:f8b0:4864:20::102f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 15CD31E1D5; Fri, 24 Mar 2023 13:38:41 -0700 (PDT) Received: by mail-pj1-x102f.google.com with SMTP id h12-20020a17090aea8c00b0023d1311fab3so2781327pjz.1; Fri, 24 Mar 2023 13:38:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1679690320; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=N5G/syVam4SknjFsEw80vzFCuD6BG5cs1b0YrLZ+gNk=; b=Qszr7DLVXSvWv7inbHD/oLNYm+jkkEndHv5jZjZ1JN2QZtmnnYUMaN7SIit905jKth /BY1QWiJtMJQoKUekclBnpaxN2Xaogq4ZhxUCS4g3M1TsjvkjTxR6CGheH5nCIdpTSI8 4aBMEACUlkyn3IVVgCADf9JiPEQd2G4JNbs7tRSJrLQ3TgVlG0Nso9zPQAAfaR7XLJTN kbqiWuVPaEyBZYFi8ItKvBr+hg9POkkTrChKWNFM20EVn245JbJMhk/zM0utkwROuCEP Xu8SUw2TVZZjV2hOEEVaHhTA48dWf+vlBGCSYZjDgI2CORx6M2xjDLlC16HhHzcYwWmD 4PfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679690320; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=N5G/syVam4SknjFsEw80vzFCuD6BG5cs1b0YrLZ+gNk=; b=Fkca0FAQ4AtqliZw8qJB2+60JK/w17QHF9IcJd/9UVm5d+HBd0WbUjx+/XZNZUxvcO VFr39C2ZAHJRnaRzjDrsJP/McaQnzqzbkROGOeVr2jhpOuy5kV8bmfQr8lc3HGuDoC1q GxsZtuEpeeZEnz7W3Zh/4wrBcjtiMD3UYiYEK8gVKG+TM0v1NzybT6E54G5aIVN11PN3 9OFB0nuAJQMfovuGV5JIy0kGW1v9/fUj7WvZlAQV21yonaU/7JEC8E8Hab8V+O4GmN4o KATn8+3PCT5SkMeRajUkzIJ0ww9pIaHTLCSasfv1RBSksdUeF6GdmzKGKSpKmkH2pK3q 74uA== X-Gm-Message-State: AAQBX9fXXhqeNOc0iJ5ruNOmYQ1ZGhP8JXBhcba5L3cyGN0/Ty3sHHAw 5ZXYpKzQITk398TxVhv+/pXUNKIM/bg= X-Google-Smtp-Source: AKy350abHWZOnX82gVzMiOfTyAKmvgrVNRXbgit78I2H0sTGJQu3A7O6RzW1hgRIEMIzxXixOSoN6g== X-Received: by 2002:a17:902:c949:b0:1a1:adb0:ed72 with SMTP id i9-20020a170902c94900b001a1adb0ed72mr4729285pla.4.1679690320097; Fri, 24 Mar 2023 13:38:40 -0700 (PDT) Received: from fainelli-desktop.igp.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id f17-20020a170902ab9100b001966d94cb2esm14503431plr.288.2023.03.24.13.38.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Mar 2023 13:38:39 -0700 (PDT) From: Florian Fainelli To: linux-kernel@vger.kernel.org Cc: Florian Fainelli , Matthew Lear , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Sean Young , Sebastian Hesselbarth , Ravi Kumar V , linux-media@vger.kernel.org (open list:MEDIA INPUT INFRASTRUCTURE (V4L/DVB)), devicetree@vger.kernel.org (open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS) Subject: [PATCH v2 2/2] media: rc: gpio-ir-recv: Fix support for wake-up Date: Fri, 24 Mar 2023 13:38:33 -0700 Message-Id: <20230324203833.3540187-3-f.fainelli@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230324203833.3540187-1-f.fainelli@gmail.com> References: <20230324203833.3540187-1-f.fainelli@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org The driver was intended from the start to be a wake-up source for the system, however due to the absence of a suitable call to device_set_wakeup_capable(), the device_may_wakeup() call used to decide whether to enable the GPIO interrupt as a wake-up source would never happen. Lookup the DT standard "wakeup-source" property and call device_init_wakeup() to ensure the device is flagged as being wakeup capable. Reported-by: Matthew Lear Fixes: fd0f6851eb46 ("[media] rc: Add support for GPIO based IR Receiver driver") Signed-off-by: Florian Fainelli --- drivers/media/rc/gpio-ir-recv.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/media/rc/gpio-ir-recv.c b/drivers/media/rc/gpio-ir-recv.c index 8dbe780dae4e..41ef8cdba28c 100644 --- a/drivers/media/rc/gpio-ir-recv.c +++ b/drivers/media/rc/gpio-ir-recv.c @@ -103,6 +103,8 @@ static int gpio_ir_recv_probe(struct platform_device *pdev) rcdev->map_name = RC_MAP_EMPTY; gpio_dev->rcdev = rcdev; + if (of_property_read_bool(np, "wakeup-source")) + device_init_wakeup(dev, true); rc = devm_rc_register_device(dev, rcdev); if (rc < 0) {