From patchwork Mon Jul 21 16:28:13 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 4597371 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 86F45C0514 for ; Mon, 21 Jul 2014 16:28:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B588920109 for ; Mon, 21 Jul 2014 16:28:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D2DCE20114 for ; Mon, 21 Jul 2014 16:28:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755304AbaGUQ2Z (ORCPT ); Mon, 21 Jul 2014 12:28:25 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:55249 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755296AbaGUQ2X (ORCPT ); Mon, 21 Jul 2014 12:28:23 -0400 Received: from 189-69-52-47.dsl.telesp.net.br ([189.69.52.47] helo=smtp.w2.samsung.com) by bombadil.infradead.org with esmtpsa (Exim 4.80.1 #2 (Red Hat Linux)) id 1X9GRp-00085E-HN; Mon, 21 Jul 2014 16:28:21 +0000 Received: from mchehab by smtp.w2.samsung.com with local (Exim 4.80.1) (envelope-from ) id 1X9GRk-0007k4-Fc; Mon, 21 Jul 2014 13:28:16 -0300 From: Mauro Carvalho Chehab Cc: Mauro Carvalho Chehab , Linux Media Mailing List , Mauro Carvalho Chehab Subject: [PATCH 1/3] xc4000: Update firmware name Date: Mon, 21 Jul 2014 13:28:13 -0300 Message-Id: <1405960095-29408-2-git-send-email-m.chehab@samsung.com> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1405960095-29408-1-git-send-email-m.chehab@samsung.com> References: <1405960095-29408-1-git-send-email-m.chehab@samsung.com> 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-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 The firmware name at: http://www.kernellabs.com/firmware/xc4000/ Is different from the one at the Kernel. Update it try first the new name, falling back to the previous one if the new name can't be found. Signed-off-by: Mauro Carvalho Chehab --- drivers/media/tuners/xc4000.c | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/drivers/media/tuners/xc4000.c b/drivers/media/tuners/xc4000.c index 2018befabb5a..44df271a78f8 100644 --- a/drivers/media/tuners/xc4000.c +++ b/drivers/media/tuners/xc4000.c @@ -116,6 +116,7 @@ struct xc4000_priv { #define XC4000_AUDIO_STD_MONO 32 #define XC4000_DEFAULT_FIRMWARE "dvb-fe-xc4000-1.4.fw" +#define XC4000_DEFAULT_FIRMWARE_NEW "dvb-fe-xc4000-1.4.1.fw" /* Misc Defines */ #define MAX_TV_STANDARD 24 @@ -730,13 +731,25 @@ static int xc4000_fwupload(struct dvb_frontend *fe) char name[33]; const char *fname; - if (firmware_name[0] != '\0') + if (firmware_name[0] != '\0') { fname = firmware_name; - else - fname = XC4000_DEFAULT_FIRMWARE; - dprintk(1, "Reading firmware %s\n", fname); - rc = request_firmware(&fw, fname, priv->i2c_props.adap->dev.parent); + dprintk(1, "Reading custom firmware %s\n", fname); + rc = request_firmware(&fw, fname, + priv->i2c_props.adap->dev.parent); + } else { + fname = XC4000_DEFAULT_FIRMWARE_NEW; + dprintk(1, "Trying to read firmware %s\n", fname); + rc = request_firmware(&fw, fname, + priv->i2c_props.adap->dev.parent); + if (rc == -ENOENT) { + fname = XC4000_DEFAULT_FIRMWARE; + dprintk(1, "Trying to read firmware %s\n", fname); + rc = request_firmware(&fw, fname, + priv->i2c_props.adap->dev.parent); + } + } + if (rc < 0) { if (rc == -ENOENT) printk(KERN_ERR "Error: firmware %s not found.\n", fname); @@ -746,6 +759,8 @@ static int xc4000_fwupload(struct dvb_frontend *fe) return rc; } + dprintk(1, "Loading Firmware: %s\n", fname); + p = fw->data; endp = p + fw->size;