From patchwork Mon Feb 14 21:03:16 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 556991 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 p1EL9fr4018883 for ; Mon, 14 Feb 2011 21:09:41 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752705Ab1BNVJj (ORCPT ); Mon, 14 Feb 2011 16:09:39 -0500 Received: from mx1.redhat.com ([209.132.183.28]:19580 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752333Ab1BNVJi (ORCPT ); Mon, 14 Feb 2011 16:09:38 -0500 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p1EL9cBD013594 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 14 Feb 2011 16:09:38 -0500 Received: from pedra (vpn-239-121.phx2.redhat.com [10.3.239.121]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p1EL3TG9012908 for ; Mon, 14 Feb 2011 16:09:37 -0500 Date: Mon, 14 Feb 2011 19:03:16 -0200 From: Mauro Carvalho Chehab Cc: Linux Media Mailing List Subject: [PATCH 09/14] [media] tuner-core: do the right thing for suspend/resume Message-ID: <20110214190316.1afc0d8d@pedra> In-Reply-To: References: Mime-Version: 1.0 X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 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-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Mon, 14 Feb 2011 21:09:41 +0000 (UTC) diff --git a/drivers/media/video/tuner-core.c b/drivers/media/video/tuner-core.c index e6855a4..e6b63e9 100644 --- a/drivers/media/video/tuner-core.c +++ b/drivers/media/video/tuner-core.c @@ -1121,9 +1121,13 @@ static int tuner_log_status(struct v4l2_subdev *sd) static int tuner_suspend(struct i2c_client *c, pm_message_t state) { struct tuner *t = to_tuner(i2c_get_clientdata(c)); + struct analog_demod_ops *analog_ops = &t->fe.ops.analog_ops; tuner_dbg("suspend\n"); - /* FIXME: power down ??? */ + + if (!t->standby && analog_ops->standby) + analog_ops->standby(&t->fe); + return 0; } @@ -1132,10 +1136,10 @@ static int tuner_resume(struct i2c_client *c) struct tuner *t = to_tuner(i2c_get_clientdata(c)); tuner_dbg("resume\n"); - if (V4L2_TUNER_RADIO == t->mode) - set_freq(c, t->radio_freq); - else - set_freq(c, t->tv_freq); + + if (!t->standby) + set_mode_freq(c, t, t->type, 0); + return 0; }