From patchwork Sun Mar 6 16:00:38 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vadim Solomin X-Patchwork-Id: 613741 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p26G0pDR019018 for ; Sun, 6 Mar 2011 16:00:54 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751091Ab1CFQAt (ORCPT ); Sun, 6 Mar 2011 11:00:49 -0500 Received: from mail-bw0-f46.google.com ([209.85.214.46]:64064 "EHLO mail-bw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751064Ab1CFQAt (ORCPT ); Sun, 6 Mar 2011 11:00:49 -0500 Received: by bwz15 with SMTP id 15so3276220bwz.19 for ; Sun, 06 Mar 2011 08:00:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:subject:date:user-agent:mime-version :content-type:content-transfer-encoding:message-id; bh=/wkEuQ0NwiT2np0/5qfL04Po5xwLyp0XG2aItXSw7oo=; b=M3iVuWA1rTl+Xe4LNjAmkYhRZQNJt6JZfrUjTp/IxvISgCP0aiFEWhMVTSxLKHA6f7 hRvQcW6WOSGw/wG1+VqbRwz999sK9i9ZWhlmJUlodTJEIr3GFyQ81pAIlOBT9He8H2BB 8qLzwM3DHh+2BnrPWeOiKL0by47gIr/DX0iIc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:subject:date:user-agent:mime-version:content-type :content-transfer-encoding:message-id; b=hRQsoI7wz0pFsXAGmsK8YuI+PwKqRs6xwzCCTmoPacLs0LGWToXi4WPsfkEp4dU2vC bDBPSvJ0XKifvMzs2+Xue1mg/DA+4JW6Eh8XqOBIR08EXLzpDaGiVE0/jFqFZBQrnSzJ tqlaiIEAR3U/R0H4if5FDgSwJDfAVV19oIHxA= Received: by 10.204.74.7 with SMTP id s7mr2463805bkj.57.1299427247606; Sun, 06 Mar 2011 08:00:47 -0800 (PST) Received: from coruscant.localnet ([88.81.53.254]) by mx.google.com with ESMTPS id a15sm415243faw.3.2011.03.06.08.00.46 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 06 Mar 2011 08:00:47 -0800 (PST) From: Vadim Solomin To: linux-media@vger.kernel.org Subject: [PATCH] saa7134-input: key up events not sent after suspend/resume Date: Sun, 6 Mar 2011 19:00:38 +0300 User-Agent: KMail/1.13.5 (Linux/2.6.37.2-crscnt-irfix; KDE/4.4.5; x86_64; ; ) MIME-Version: 1.0 Message-Id: <201103061900.38144.vadic052@gmail.com> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Sun, 06 Mar 2011 16:00:54 +0000 (UTC) diff -r abd3aac6644e linux/drivers/media/video/saa7134/saa7134-input.c --- a/linux/drivers/media/video/saa7134/saa7134-input.c Fri Jul 02 00:38:54 2010 -0300 +++ b/linux/drivers/media/video/saa7134/saa7134-input.c Sun Mar 06 02:57:43 2011 +0300 @@ -511,6 +511,41 @@ if (ir->running) return 0; + /* Moved here from saa7134_input_init1() because the latter + * is not called on device resume */ + switch (dev->board) { + case SAA7134_BOARD_MD2819: + case SAA7134_BOARD_KWORLD_VSTREAM_XPERT: + case SAA7134_BOARD_AVERMEDIA_305: + case SAA7134_BOARD_AVERMEDIA_307: + case SAA7134_BOARD_AVERMEDIA_STUDIO_305: + case SAA7134_BOARD_AVERMEDIA_STUDIO_505: + case SAA7134_BOARD_AVERMEDIA_STUDIO_307: + case SAA7134_BOARD_AVERMEDIA_STUDIO_507: + case SAA7134_BOARD_AVERMEDIA_STUDIO_507UA: + case SAA7134_BOARD_AVERMEDIA_GO_007_FM: + case SAA7134_BOARD_AVERMEDIA_M102: + case SAA7134_BOARD_AVERMEDIA_GO_007_FM_PLUS: + /* Without this we won't receive key up events */ + saa_setb(SAA7134_GPIO_GPMODE0, 0x4); + saa_setb(SAA7134_GPIO_GPSTATUS0, 0x4); + break; + case SAA7134_BOARD_AVERMEDIA_777: + case SAA7134_BOARD_AVERMEDIA_A16AR: + /* Without this we won't receive key up events */ + saa_setb(SAA7134_GPIO_GPMODE1, 0x1); + saa_setb(SAA7134_GPIO_GPSTATUS1, 0x1); + break; + case SAA7134_BOARD_AVERMEDIA_A16D: + /* Without this we won't receive key up events */ + saa_setb(SAA7134_GPIO_GPMODE1, 0x1); + saa_setb(SAA7134_GPIO_GPSTATUS1, 0x1); + break; + case SAA7134_BOARD_GOTVIEW_7135: + saa_setb(SAA7134_GPIO_GPMODE1, 0x80); + break; + } + ir->running = 1; if (ir->polling) { setup_timer(&ir->timer, saa7134_input_timer, @@ -709,9 +744,7 @@ mask_keycode = 0x0007C8; mask_keydown = 0x000010; polling = 50; // ms - /* Set GPIO pin2 to high to enable the IR controller */ - saa_setb(SAA7134_GPIO_GPMODE0, 0x4); - saa_setb(SAA7134_GPIO_GPSTATUS0, 0x4); + /* GPIO stuff moved to __saa7134_ir_start() */ break; case SAA7134_BOARD_AVERMEDIA_M135A: ir_codes = RC_MAP_AVERMEDIA_M135A; @@ -733,18 +766,14 @@ mask_keycode = 0x02F200; mask_keydown = 0x000400; polling = 50; // ms - /* Without this we won't receive key up events */ - saa_setb(SAA7134_GPIO_GPMODE1, 0x1); - saa_setb(SAA7134_GPIO_GPSTATUS1, 0x1); + /* GPIO stuff moved to __saa7134_ir_start() */ break; case SAA7134_BOARD_AVERMEDIA_A16D: ir_codes = RC_MAP_AVERMEDIA_A16D; mask_keycode = 0x02F200; mask_keydown = 0x000400; polling = 50; /* ms */ - /* Without this we won't receive key up events */ - saa_setb(SAA7134_GPIO_GPMODE1, 0x1); - saa_setb(SAA7134_GPIO_GPSTATUS1, 0x1); + /* GPIO stuff moved to __saa7134_ir_start() */ break; case SAA7134_BOARD_KWORLD_TERMINATOR: ir_codes = RC_MAP_PIXELVIEW; @@ -796,7 +825,7 @@ mask_keycode = 0x0003CC; mask_keydown = 0x000010; polling = 5; /* ms */ - saa_setb(SAA7134_GPIO_GPMODE1, 0x80); + /* GPIO stuff moved to __saa7134_ir_start() */ break; case SAA7134_BOARD_VIDEOMATE_TV_PVR: case SAA7134_BOARD_VIDEOMATE_GOLD_PLUS: