From patchwork Mon Jul 28 18:07:20 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 4636001 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 35FD89F32F for ; Mon, 28 Jul 2014 18:07:34 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 596232020E for ; Mon, 28 Jul 2014 18:07:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id F0BFA20200 for ; Mon, 28 Jul 2014 18:07:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751293AbaG1SH3 (ORCPT ); Mon, 28 Jul 2014 14:07:29 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:36338 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750825AbaG1SH2 (ORCPT ); Mon, 28 Jul 2014 14:07:28 -0400 Received: from [191.255.125.116] (helo=smtp.w2.samsung.com) by bombadil.infradead.org with esmtpsa (Exim 4.80.1 #2 (Red Hat Linux)) id 1XBpKY-0005Gc-80; Mon, 28 Jul 2014 18:07:26 +0000 Received: from mchehab by smtp.w2.samsung.com with local (Exim 4.80.1) (envelope-from ) id 1XBpKV-0006rj-Ed; Mon, 28 Jul 2014 15:07:23 -0300 From: Mauro Carvalho Chehab Cc: Mauro Carvalho Chehab , Linux Media Mailing List , Mauro Carvalho Chehab Subject: [PATCH 2/4] rc-main: allow raw protocol drivers to restrict the allowed protos Date: Mon, 28 Jul 2014 15:07:20 -0300 Message-Id: <1406570842-26316-3-git-send-email-m.chehab@samsung.com> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1406570842-26316-1-git-send-email-m.chehab@samsung.com> References: <1406570842-26316-1-git-send-email-m.chehab@samsung.com> To: unlisted-recipients:; (no To-header on input) 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.6 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 On some hardware (au0828/au8522), the hardware is broken with regards to the initial pulse detection. So, the driver needs to produce a fake start pulse. That limits the acceptable protocols, as it is not possible to produce a fake pulse that would cover all supported protocols. So, allow the driver to explicitly set the allowed protocols. If the driver doesn't specify, keep the old behavior. Signed-off-by: Mauro Carvalho Chehab --- drivers/media/rc/rc-main.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/media/rc/rc-main.c b/drivers/media/rc/rc-main.c index dfceeb4e34a8..a7991c7d010a 100644 --- a/drivers/media/rc/rc-main.c +++ b/drivers/media/rc/rc-main.c @@ -859,10 +859,9 @@ static ssize_t show_protocols(struct device *device, if (fattr->type == RC_FILTER_NORMAL) { enabled = dev->enabled_protocols; - if (dev->raw) + allowed = dev->allowed_protocols; + if (dev->raw && !allowed) allowed = ir_raw_get_allowed_protocols(); - else - allowed = dev->allowed_protocols; } else { enabled = dev->enabled_wakeup_protocols; allowed = dev->allowed_wakeup_protocols;