From patchwork Sat Feb 22 00:50:17 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shuah Khan X-Patchwork-Id: 3700771 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 043FEBF13A for ; Sat, 22 Feb 2014 00:51:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 35EFB2018B for ; Sat, 22 Feb 2014 00:51:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 590862017D for ; Sat, 22 Feb 2014 00:51:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932104AbaBVAuv (ORCPT ); Fri, 21 Feb 2014 19:50:51 -0500 Received: from qmta12.emeryville.ca.mail.comcast.net ([76.96.27.227]:46800 "EHLO qmta12.emeryville.ca.mail.comcast.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754517AbaBVAut (ORCPT ); Fri, 21 Feb 2014 19:50:49 -0500 Received: from omta01.emeryville.ca.mail.comcast.net ([76.96.30.11]) by qmta12.emeryville.ca.mail.comcast.net with comcast id VAUJ1n0020EPcho01CqoPS; Sat, 22 Feb 2014 00:50:48 +0000 Received: from mail.gonehiking.org ([50.134.149.16]) by omta01.emeryville.ca.mail.comcast.net with comcast id VCqn1n00N0MU7Qa8MCqnK1; Sat, 22 Feb 2014 00:50:48 +0000 Received: from lorien.sisa.samsung.com (lorien-wl.internal [192.168.1.40]) by mail.gonehiking.org (Postfix) with ESMTP id 15AF046F26; Fri, 21 Feb 2014 17:50:47 -0700 (MST) From: Shuah Khan To: m.chehab@samsung.com Cc: Shuah Khan , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, shuahkhan@gmail.com Subject: [RFC] [PATCH 5/6] media: em28xx-video - implement em28xx_ops: suspend/resume hooks Date: Fri, 21 Feb 2014 17:50:17 -0700 Message-Id: <428b784414ab17562ee30396bdd999885b3916ad.1393027856.git.shuah.kh@samsung.com> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: References: In-Reply-To: References: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=q20121106; t=1393030248; bh=QNxDi4vK6Er+NASRcJVS+WX6kjXJbqu5YLtPudcS9kA=; h=Received:Received:Received:From:To:Subject:Date:Message-Id; b=STlFuyHYi392YHoK4DBOSMarhUWBuMo+W1XCqNk/v9S08BRgSVZI26KHxKs0/irEy +i7zENHJjBTJuinR1YeMpjSva1IW0BiCkaPmNKAOGrbESNRa/aXxk7li3BnppckG6N S0Gs6im+gFo1gPgjckIOIDe2OMjW3felSh01p1v6rTzT4qNJfBw7b4Q3xaHvEcDmt3 ZJmlg47Vxcl3sQlnCSQE9UH3d86eN5EFolehNGDdYH+/BGTeyDB4Ia3vXuwgwFDyvM UZcCiFBv2RgmknzTfT5Y+eXdAdIhw5uLhKp8gOCZF80HISm5hwVLZiG3KuwWezx57H vbU4J1cwhGiCA== 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.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, 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 Implement em28xx_ops: suspend/resume hooks. em28xx usb driver will invoke em28xx_ops: suspend and resume hooks for all its extensions from its suspend() and resume() interfaces. Signed-off-by: Shuah Khan --- drivers/media/usb/em28xx/em28xx-video.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/drivers/media/usb/em28xx/em28xx-video.c b/drivers/media/usb/em28xx/em28xx-video.c index c3c9289..1df6750 100644 --- a/drivers/media/usb/em28xx/em28xx-video.c +++ b/drivers/media/usb/em28xx/em28xx-video.c @@ -1933,6 +1933,32 @@ static int em28xx_v4l2_fini(struct em28xx *dev) return 0; } +static int em28xx_v4l2_suspend(struct em28xx *dev) +{ + if (dev->is_audio_only) + return 0; + + if (!dev->has_video) + return 0; + + em28xx_info("Suspending video extension"); + em28xx_stop_urbs(dev); + return 0; +} + +static int em28xx_v4l2_resume(struct em28xx *dev) +{ + if (dev->is_audio_only) + return 0; + + if (!dev->has_video) + return 0; + + em28xx_info("Resuming video extension"); + /* what do we do here */ + return 0; +} + /* * em28xx_v4l2_close() * stops streaming and deallocates all resources allocated by the v4l2 @@ -2504,6 +2530,8 @@ static struct em28xx_ops v4l2_ops = { .name = "Em28xx v4l2 Extension", .init = em28xx_v4l2_init, .fini = em28xx_v4l2_fini, + .suspend = em28xx_v4l2_suspend, + .resume = em28xx_v4l2_resume, }; static int __init em28xx_video_register(void)