From patchwork Thu Jul 24 16:02:14 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shuah Khan X-Patchwork-Id: 4618681 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 B993A9F375 for ; Thu, 24 Jul 2014 16:02:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CEAE9201D5 for ; Thu, 24 Jul 2014 16:02:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5021F20160 for ; Thu, 24 Jul 2014 16:02:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933732AbaGXQCV (ORCPT ); Thu, 24 Jul 2014 12:02:21 -0400 Received: from qmta06.emeryville.ca.mail.comcast.net ([76.96.30.56]:38683 "EHLO qmta06.emeryville.ca.mail.comcast.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932207AbaGXQCU (ORCPT ); Thu, 24 Jul 2014 12:02:20 -0400 Received: from omta11.emeryville.ca.mail.comcast.net ([76.96.30.36]) by qmta06.emeryville.ca.mail.comcast.net with comcast id WDU81o0050mlR8UA6G2LbY; Thu, 24 Jul 2014 16:02:20 +0000 Received: from mail.gonehiking.org ([50.134.149.16]) by omta11.emeryville.ca.mail.comcast.net with comcast id WG2J1o00A0MU7Qa8XG2J7C; Thu, 24 Jul 2014 16:02:19 +0000 Received: from lorien.sisa.samsung.com (lorien-wl.internal [192.168.1.40]) by mail.gonehiking.org (Postfix) with ESMTP id 120A7444A3; Thu, 24 Jul 2014 10:02:18 -0600 (MDT) From: Shuah Khan To: m.chehab@samsung.com, olebowle@gmx.com, dheitmueller@kernellabs.com Cc: Shuah Khan , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] media: dvb-core add new flag exit flag value for resume Date: Thu, 24 Jul 2014 10:02:14 -0600 Message-Id: X-Mailer: git-send-email 1.9.1 In-Reply-To: References: In-Reply-To: References: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=q20140121; t=1406217740; bh=kD5Rj/OucJr538sV6hG2KEKl3wANqeKLfnYSAp29XDA=; h=Received:Received:Received:From:To:Subject:Date:Message-Id; b=t8Q6ZKJaU9Mdh//AydK2W7NJTTtpW3FMCgheN6Yjpx2LHL5owvjb6XknbATLgvqXT +V+u++vRmhQRa3f7MfyG/0GVRBZF5AeAb8nLbsoCQrIUMrntN0pEOA55/TNN+/9a/7 4jnOdo0Zx1XvypN/XmHCjn2TMdwv+jYn4bS9Wsz2I18Nt9RYISD/Tqd1T1rSz9bz5s xz1YG36H8MJT0u1meOPNSdBymw3vpAIjPZjCiMITTlG0u3t8JVDXUL1mq7oukSPXRz vr1/KzSvS2JluI+sU6xQew5Vi9/lt8lQuL/rw/AvIXrN2CpVv30xtfKdpFnxnIdQcB 1R0iUiKXprj9w== Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-6.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 Some fe drivers will have to do additional initialization in their fe ops.init interfaces when called during resume. Without the additional initialization, fe and tuner driver resume fails. A new fe exit flag value DVB_FE_DEVICE_RESUME is necessary to detect resume case. This patch adds a new define and changes dvb_frontend_resume() to set it prior to calling fe init and tuner init calls and resets it back to DVB_FE_NO_EXIT once fe and tuner init is done. Signed-off-by: Shuah Khan --- drivers/media/dvb-core/dvb_frontend.c | 2 ++ drivers/media/dvb-core/dvb_frontend.h | 1 + 2 files changed, 3 insertions(+) diff --git a/drivers/media/dvb-core/dvb_frontend.c b/drivers/media/dvb-core/dvb_frontend.c index c833220..7c7f35c 100644 --- a/drivers/media/dvb-core/dvb_frontend.c +++ b/drivers/media/dvb-core/dvb_frontend.c @@ -2568,12 +2568,14 @@ int dvb_frontend_resume(struct dvb_frontend *fe) dev_dbg(fe->dvb->device, "%s: adap=%d fe=%d\n", __func__, fe->dvb->num, fe->id); + fe->exit = DVB_FE_DEVICE_RESUME; if (fe->ops.init) ret = fe->ops.init(fe); if (fe->ops.tuner_ops.init) ret = fe->ops.tuner_ops.init(fe); + fe->exit = DVB_FE_NO_EXIT; fepriv->state = FESTATE_RETUNE; dvb_frontend_wakeup(fe); diff --git a/drivers/media/dvb-core/dvb_frontend.h b/drivers/media/dvb-core/dvb_frontend.h index 625a340..d398de4 100644 --- a/drivers/media/dvb-core/dvb_frontend.h +++ b/drivers/media/dvb-core/dvb_frontend.h @@ -408,6 +408,7 @@ struct dtv_frontend_properties { #define DVB_FE_NO_EXIT 0 #define DVB_FE_NORMAL_EXIT 1 #define DVB_FE_DEVICE_REMOVED 2 +#define DVB_FE_DEVICE_RESUME 3 struct dvb_frontend { struct dvb_frontend_ops ops;