From patchwork Fri Mar 24 17:02:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Fainelli X-Patchwork-Id: 666781 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 3B692C6FD1C for ; Fri, 24 Mar 2023 17:03:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231908AbjCXRDD (ORCPT ); Fri, 24 Mar 2023 13:03:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50942 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231901AbjCXRDB (ORCPT ); Fri, 24 Mar 2023 13:03:01 -0400 Received: from mail-pf1-x42b.google.com (mail-pf1-x42b.google.com [IPv6:2607:f8b0:4864:20::42b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1BE5B30F0; Fri, 24 Mar 2023 10:02:59 -0700 (PDT) Received: by mail-pf1-x42b.google.com with SMTP id z11so1682352pfh.4; Fri, 24 Mar 2023 10:02:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1679677378; 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=ygxBF71VOkM+KeTylKWK/Z0RCTPhhMfAZKU7dH6P7Hg=; b=OIEUXRh+v9HvcGnDSS5Aq05048LRCODXCmO/sixBVKIa2xfhzdcSmf8LxZfSe3x4mV vmOxAXKnX6rXI+Ox2iwdL0E5grJpHKmG4f+kzCuuj8bpVatkaXEi40WDKa8HeOjk3JaD UuCVSqAqznxYu5rskkKlchoJOB4jvvLBJkqkgpbRftz/cdkRge8Z5f5vEvPaj9glcT9k lu2uShqWGlq1Y3Q6GPytJXSfNbCDETst6V9+7HttPUGDON9m2V99Y8GxNmlCRayqtkJb CjcXDM5HGEFciOkTePuoPQvyIjkJdHm61F2n/G/1Qu9Z89sEJPlDPYfi9xbQksUbXV7S BLYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679677378; 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=ygxBF71VOkM+KeTylKWK/Z0RCTPhhMfAZKU7dH6P7Hg=; b=Z98Zat84DZcX8y8wuyrMf12ZEeauXapEaeTMwV8zIZqCgy5S4t6UQBBKn1mWuQ07Rf MvfzvvmagwUF7tkL7HnF5t2XL4DyvwkQKLuONwG6nKRh0sl583ZnALvnTeDAvILj4TTf tnBSJ5zF59deXNgPD7GpKpzu1yiwQK95QgRjrjnbtjxRQGwz3dm3suQQoXL2NiLysCFi A7X62KZsbEiGQ8xl3bMa51NsjpG9WUWHu1C+pf26KRDTwsig24knGOr+CxHaoIlfG2P8 4puG8ms3RllRsZtxby/DoS76Z+sxJnP67/6uNtfFa+vTavJ6JfRJ6FN2Y4btcYbgBYMI dgjg== X-Gm-Message-State: AAQBX9db0pNHEx37NxEP1hO2L8FNARkEwD2YYz9biDXvePQJiwz6tVw/ iurW8chPZtB92OejThush/r5wXXo5ao= X-Google-Smtp-Source: AKy350bqR4UWk0q6amyqYrEhXv1TQkS5KayocmKIbksYrCm4ba7kc5di+dFSprJTaQbsheg4bMx9vA== X-Received: by 2002:aa7:8bc2:0:b0:623:2bba:dd9 with SMTP id s2-20020aa78bc2000000b006232bba0dd9mr3545736pfd.14.1679677377917; Fri, 24 Mar 2023 10:02:57 -0700 (PDT) Received: from fainelli-desktop.igp.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id h4-20020a62b404000000b005a8bfe3b241sm14019591pfn.167.2023.03.24.10.02.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Mar 2023 10:02:57 -0700 (PDT) From: Florian Fainelli To: linux-kernel@vger.kernel.org Cc: bcm-kernel-feedback-list@broadcom.com, 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 1/2] dt-bindings: media: gpio-ir-receiver: Document wakeup-souce property Date: Fri, 24 Mar 2023 10:02:13 -0700 Message-Id: <20230324170214.3470675-2-f.fainelli@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230324170214.3470675-1-f.fainelli@gmail.com> References: <20230324170214.3470675-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 --- 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..7e76838388cd 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 17:02:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Fainelli X-Patchwork-Id: 667124 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 506DFC76196 for ; Fri, 24 Mar 2023 17:03:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231929AbjCXRDG (ORCPT ); Fri, 24 Mar 2023 13:03:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50782 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231899AbjCXRDC (ORCPT ); Fri, 24 Mar 2023 13:03:02 -0400 Received: from mail-pg1-x529.google.com (mail-pg1-x529.google.com [IPv6:2607:f8b0:4864:20::529]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BFF4FC158; Fri, 24 Mar 2023 10:03:00 -0700 (PDT) Received: by mail-pg1-x529.google.com with SMTP id z10so1455912pgr.8; Fri, 24 Mar 2023 10:03:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1679677379; 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=Cas8Gt9ektgQ2rcRR2JeaOYXS/1ps49r5/wx0KyMKgbqMR5bH0afftcvn5CtT8bPhf kPJ7JKJp8BIUceMpo9qfNqNAczsIXboLCUDqXQVJRE92ZqfwIAJQnnlhtYBilTjuwhrb Nko2PwaB6nHe2J6B4KqeRL1Iq42JQQaf3lRdM2f9GOSXvgG1pYn4LtsAeds/J6nmblls qpEdNyGRmYp8g1pMAv5cH8SnDwLBtyVQ0D7FNm+cK1LmhuMyWJory5Noczg2pKJNL61+ 38SGoEaFXnk+LzGn5Ec5B2k6X9Q0/DImArSzyKnVkNm3+Tq1RLhKOimwRylMmclspZQp 0TKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679677379; 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=3/JN8wot07q3RFUpuI2Q+5z5lzDXOaJhkMqeXUfXq8sfq6ABJIYypAj6fIs2VyVOtl fI4/vAYe1BhlwLPwsDApxqgbtxQGsM08KphJ1YFSd+v2W045OlsGW1XXYq0Nq5mDzZkw YxUvhRa/2YgV6kK69/wm53HFNw/GRVK3u4f2hLedSgFpQhDSCmNWWBM7icJCKzRf7OWe mDfLyeZiZ4ZOJ8AOCoCjzHrx+qQhBIAd5WfO/QNfVOrGvVd32Vbop/7v/aEWQlE46Ift mA5i5asHWHKGtKGDLimIjRv8DC95iADJ+PmBMHJbiasbR9q6hSjKaVIyQY6ObBWZgtyX vKuA== X-Gm-Message-State: AAQBX9eltAABKR5xGq6J7xatzG9SDvOzgNK/2/bGD/wMrMhcj1BXQelL J/B2UROAxVADJk+i9D0saCCOWqEcLvc= X-Google-Smtp-Source: AKy350b3wyhVDacuWzIEl+/UsWhf4h3NsPr2BPhwZPpPDsN8HToPQbiu8WNu78rM3EYfQa6ulfOTsQ== X-Received: by 2002:a62:5b04:0:b0:623:6131:66ca with SMTP id p4-20020a625b04000000b00623613166camr3283138pfb.32.1679677379543; Fri, 24 Mar 2023 10:02:59 -0700 (PDT) Received: from fainelli-desktop.igp.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id h4-20020a62b404000000b005a8bfe3b241sm14019591pfn.167.2023.03.24.10.02.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Mar 2023 10:02:58 -0700 (PDT) From: Florian Fainelli To: linux-kernel@vger.kernel.org Cc: bcm-kernel-feedback-list@broadcom.com, 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 2/2] media: rc: gpio-ir-recv: Fix support for wake-up Date: Fri, 24 Mar 2023 10:02:14 -0700 Message-Id: <20230324170214.3470675-3-f.fainelli@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230324170214.3470675-1-f.fainelli@gmail.com> References: <20230324170214.3470675-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) {