From patchwork Sun Mar 15 22:57:53 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Larsson X-Patchwork-Id: 6014231 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.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id BEB9B9F39E for ; Sun, 15 Mar 2015 22:58:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C895A202F8 for ; Sun, 15 Mar 2015 22:58:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AC1E520304 for ; Sun, 15 Mar 2015 22:58:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752415AbbCOW6R (ORCPT ); Sun, 15 Mar 2015 18:58:17 -0400 Received: from smtp.bredband2.com ([83.219.192.166]:56493 "EHLO smtp.bredband2.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752166AbbCOW6G (ORCPT ); Sun, 15 Mar 2015 18:58:06 -0400 Received: from localhost.localdomain (92-244-23-216.customers.ownit.se [92.244.23.216]) (Authenticated sender: ed8153) by smtp.bredband2.com (Postfix) with ESMTPA id 4B03611F638; Sun, 15 Mar 2015 23:57:57 +0100 (CET) From: Benjamin Larsson To: crope@iki.fi, mchehab@osg.samsung.com Cc: Linux Media Mailing List Subject: [PATCH 08/10] mn88473: check if firmware is already running before loading it Date: Sun, 15 Mar 2015 23:57:53 +0100 Message-Id: <1426460275-3766-8-git-send-email-benjamin@southpole.se> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1426460275-3766-1-git-send-email-benjamin@southpole.se> References: <1426460275-3766-1-git-send-email-benjamin@southpole.se> 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.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_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 Signed-off-by: Benjamin Larsson --- drivers/staging/media/mn88473/mn88473.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/staging/media/mn88473/mn88473.c b/drivers/staging/media/mn88473/mn88473.c index 607ce4d..a23e59e 100644 --- a/drivers/staging/media/mn88473/mn88473.c +++ b/drivers/staging/media/mn88473/mn88473.c @@ -196,8 +196,19 @@ static int mn88473_init(struct dvb_frontend *fe) dev_dbg(&client->dev, "\n"); - if (dev->warm) + /* set cold state by default */ + dev->warm = false; + + /* check if firmware is already running */ + ret = regmap_read(dev->regmap[0], 0xf5, &tmp); + if (ret) + goto err; + + if (!(tmp & 0x1)) { + dev_info(&client->dev, "firmware already running\n"); + dev->warm = true; return 0; + } /* request the firmware, this will block and timeout */ ret = request_firmware(&fw, fw_file, &client->dev);