From patchwork Thu Apr 3 23:33:12 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?RGF2aWQgSMODwqRyZGVtYW4=?= X-Patchwork-Id: 3934881 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id A3A329F369 for ; Thu, 3 Apr 2014 23:33:18 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D005620306 for ; Thu, 3 Apr 2014 23:33:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1307520303 for ; Thu, 3 Apr 2014 23:33:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754018AbaDCXdO (ORCPT ); Thu, 3 Apr 2014 19:33:14 -0400 Received: from hardeman.nu ([95.142.160.32]:40308 "EHLO hardeman.nu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753803AbaDCXdN (ORCPT ); Thu, 3 Apr 2014 19:33:13 -0400 Received: from zeus.hardeman.nu (unknown [IPv6:2001:a60:16f7:7000:b8ab:ce09:22ee:d164]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by vader.hardeman.nu (Postfix) with ESMTPSA id 80ECE253; Fri, 4 Apr 2014 01:33:12 +0200 (CEST) Received: by zeus.hardeman.nu (Postfix, from userid 1000) id 26F3AC600FA; Fri, 4 Apr 2014 01:33:12 +0200 (CEST) Subject: [PATCH 23/49] rc-loopback: add RCIOCGIRRX ioctl support From: David =?utf-8?b?SMOkcmRlbWFu?= To: linux-media@vger.kernel.org Cc: m.chehab@samsung.com Date: Fri, 04 Apr 2014 01:33:12 +0200 Message-ID: <20140403233312.27099.75567.stgit@zeus.muc.hardeman.nu> In-Reply-To: <20140403232420.27099.94872.stgit@zeus.muc.hardeman.nu> References: <20140403232420.27099.94872.stgit@zeus.muc.hardeman.nu> User-Agent: StGit/0.17.1-dirty 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.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, 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 As an example, this patch adds support for the new RCIOCGIRRX ioctl to rc-loopback. Signed-off-by: David Härdeman --- drivers/media/rc/rc-loopback.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/media/rc/rc-loopback.c b/drivers/media/rc/rc-loopback.c index bc67d2f..565318c 100644 --- a/drivers/media/rc/rc-loopback.c +++ b/drivers/media/rc/rc-loopback.c @@ -181,6 +181,27 @@ static int loop_set_carrier_report(struct rc_dev *dev, int enable) return 0; } +/** + * loop_get_ir_rx() - returns the current RX settings + * @dev: the &struct rc_dev to get the settings for + * @rx: the &struct rc_ir_rx to fill in with the current settings + * + * This function is used to return the current RX settings. + */ +static void loop_get_ir_rx(struct rc_dev *dev, struct rc_ir_rx *rx) +{ + struct loopback_dev *lodev = dev->priv; + + rx->rx_supported = RXMASK_REGULAR | RXMASK_LEARNING; + rx->rx_connected = RXMASK_REGULAR | RXMASK_LEARNING; + rx->rx_enabled = lodev->learning ? RXMASK_LEARNING : RXMASK_REGULAR; + rx->rx_learning = RXMASK_LEARNING; + rx->freq_min = lodev->rxcarriermin; + rx->freq_max = lodev->rxcarriermax; + rx->duty_min = 1; + rx->duty_max = 99; +} + static int __init loop_init(void) { struct rc_dev *rc; @@ -214,6 +235,7 @@ static int __init loop_init(void) rc->s_idle = loop_set_idle; rc->s_learning_mode = loop_set_learning_mode; rc->s_carrier_report = loop_set_carrier_report; + rc->get_ir_rx = loop_get_ir_rx; loopdev.txmask = RXMASK_REGULAR; loopdev.txcarrier = 36000;