From patchwork Sun Jan 26 21:50:22 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?QW50dGkgU2VwcMOkbMOk?= X-Patchwork-Id: 3540121 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 6DD71C02DC for ; Sun, 26 Jan 2014 21:51:11 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BBF3520117 for ; Sun, 26 Jan 2014 21:51:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E200820121 for ; Sun, 26 Jan 2014 21:51:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753329AbaAZVvD (ORCPT ); Sun, 26 Jan 2014 16:51:03 -0500 Received: from mail-la0-f47.google.com ([209.85.215.47]:59958 "EHLO mail-la0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753125AbaAZVvB (ORCPT ); Sun, 26 Jan 2014 16:51:01 -0500 Received: by mail-la0-f47.google.com with SMTP id hr17so3971091lab.34 for ; Sun, 26 Jan 2014 13:51:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=AwLhpkRvQ2higJssXDIJBhKYMDRaVE1Xvf/Vrk5gbHg=; b=g/viOM7IjeTyzEpPBgj0oWSHdFpvW5s3v3YnapRtma91w10R//ypCDmKnVJoxL2d15 Vv00eMwnzIjusWHw2V0bpDKsW9BVuqBghZIvI2RLMU1JBk6w3LP9nRi6M6Krl9ZrY/go pXckgxs8vDjuMCek1otLo6QYc2tleloPwSEGbVdGa7SA0a3u+Ux4uyx2RAQ2QPMQialu eaRK06ZsFCKAOX2bX6ReknDmQ4yHfs6pdvrvfU0aBfBoPZlz+PTfVN/+m6B6ozwjYp10 k4okE8GlkHHtvXpCCIdloMd0bkvIZjcqkCxTidZK+fnz0LMLGMUykMp5u36hkjbzvs3Q 7kJQ== X-Received: by 10.152.45.8 with SMTP id i8mr15925776lam.12.1390773060668; Sun, 26 Jan 2014 13:51:00 -0800 (PST) Received: from pixie.elisa-laajakaista.fi (a88-114-92-24.elisa-laajakaista.fi. [88.114.92.24]) by mx.google.com with ESMTPSA id h7sm9767468lbj.1.2014.01.26.13.50.58 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 26 Jan 2014 13:50:59 -0800 (PST) From: =?UTF-8?q?Antti=20Sepp=C3=A4l=C3=A4?= To: linux-media@vger.kernel.org Cc: Mauro Carvalho Chehab , Sean Young , =?UTF-8?q?Antti=20Sepp=C3=A4l=C3=A4?= Subject: [RFCv2 PATCH 1/5] rc-core: Add defintions needed for sysfs callback Date: Sun, 26 Jan 2014 23:50:22 +0200 Message-Id: <1390773026-567-2-git-send-email-a.seppala@gmail.com> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1390773026-567-1-git-send-email-a.seppala@gmail.com> References: <1390773026-567-1-git-send-email-a.seppala@gmail.com> MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Introduce a list for wake code values and add callback for reading / writing it via sysfs. Also introduce bitfields for setting which protocols are allowed and enabled for wakeup. Signed-off-by: Antti Seppälä --- include/media/rc-core.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/include/media/rc-core.h b/include/media/rc-core.h index 2f6f1f7..e0e5699 100644 --- a/include/media/rc-core.h +++ b/include/media/rc-core.h @@ -20,6 +20,7 @@ #include #include #include +#include #include extern int rc_core_debug; @@ -35,6 +36,16 @@ enum rc_driver_type { }; /** + * struct rc_wakeup_code - represents a single IR scancode or pulse/space + * @value: scan code value or pulse (+) / space (-) length + * @list: linked list pointer + */ +struct rc_wakeup_code { + s32 value; + struct list_head list_item; +}; + +/** * struct rc_dev - represents a remote control device * @dev: driver model's view of this device * @input_name: name of the input child device @@ -52,6 +63,8 @@ enum rc_driver_type { * @idle: used to keep track of RX state * @allowed_protos: bitmask with the supported RC_BIT_* protocols * @enabled_protocols: bitmask with the enabled RC_BIT_* protocols + * @allowed_wake_protos: bitmask with the supported RC_BIT_* protocols for wakeup + * @enabled_wake_protos: bitmask with the enabled RC_BIT_* protocols for wakeup * @scanmask: some hardware decoders are not capable of providing the full * scancode to the application. As this is a hardware limit, we can't do * anything with it. Yet, as the same keycode table can be used with other @@ -84,6 +97,7 @@ enum rc_driver_type { * device doesn't interrupt host until it sees IR pulses * @s_learning_mode: enable wide band receiver used for learning * @s_carrier_report: enable carrier reports + * @s_wakeup_codes: set/get IR scancode to wake hardware from sleep states */ struct rc_dev { struct device dev; @@ -101,6 +115,8 @@ struct rc_dev { bool idle; u64 allowed_protos; u64 enabled_protocols; + u64 allowed_wake_protos; + u64 enabled_wake_protos; u32 users; u32 scanmask; void *priv; @@ -127,6 +143,7 @@ struct rc_dev { void (*s_idle)(struct rc_dev *dev, bool enable); int (*s_learning_mode)(struct rc_dev *dev, int enable); int (*s_carrier_report) (struct rc_dev *dev, int enable); + int (*s_wakeup_codes) (struct rc_dev *dev, struct list_head *wakeup_code_list, int write); }; #define to_rc_dev(d) container_of(d, struct rc_dev, dev)