Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp2138481ybp; Thu, 10 Oct 2019 02:52:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqwNqeGLFmpT+HG+DDRJNYVjKUSsfmu89VWRV8qG+L+TaoIHXZFl6cezc3poOeQdTAg6USpL X-Received: by 2002:a05:6402:7d2:: with SMTP id u18mr7427770edy.23.1570701137321; Thu, 10 Oct 2019 02:52:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570701137; cv=none; d=google.com; s=arc-20160816; b=tamUuRhaVxII7u06kgWHvlTsg5qJqIX6VUv2PChvszqhks6povOaTyscb+VHLPSvGi ZHKsLYw1hpr1iFLQcVtR12AUZysbz9b0IIOYbIN5Rs1ocuXg2zfmO7ExZ7drM/jEp7BG UR75bPHT/awsFWUWE8F0NUcc/qgkyX5iciBClm/hPKrdCidzXjIl0j0uQ2zWcnxN+Gjn 3klrgIu8BM/IdzzL+hElGM8Y3RzJLKGCMdkKRYzpy4QBSp1RmTDgNmdqp2nfaUIDU0L2 6QUbfd3oe208J0t+OYIrX8lsXkYHn8hFTYkNV9s1pA30I+1ujF9ObxXSDjCORTjfUbnM wxew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=jC8sod3IK3MEfPEVtwNiX6u+A/D3kZVyjuptbX8nh2k=; b=rwR/CnvXcE/a3wba9V+E8IeyS531QrxYMww1HYC9bd3bVjbjRNEksYSi98CtbqaM0T B2cri5QtZxninCH9ui4KWBJQUhvUnVv6T73GByP6sXr5FN0LMDZxJrAobEKEJCpnuggk rPbjbm/0EYuTzProebiZltxKJqVFobvIrCICrzmqy0YG8x0LYAiIsLZZTmUnMA/HYTE+ bOrUcS5gN72V9PcLjiWZtDsAfeHtraV0s0XnDKqGJvnoXYtooaNzwgazftcBpENV9Y3n EHpcdLIs96qiXFaEJn/j4Bwq6WCdr92WRhoYg0Re6bi+SFrF4ofs+NsJ1QFsmWMD0Oh0 TYSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=nmdsPV5M; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x8si2899782ejs.414.2019.10.10.02.51.54; Thu, 10 Oct 2019 02:52:17 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=nmdsPV5M; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387899AbfJJJvi (ORCPT + 99 others); Thu, 10 Oct 2019 05:51:38 -0400 Received: from mail-wm1-f65.google.com ([209.85.128.65]:51220 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387791AbfJJJvh (ORCPT ); Thu, 10 Oct 2019 05:51:37 -0400 Received: by mail-wm1-f65.google.com with SMTP id 7so6218517wme.1; Thu, 10 Oct 2019 02:51:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=jC8sod3IK3MEfPEVtwNiX6u+A/D3kZVyjuptbX8nh2k=; b=nmdsPV5Mjr9w0p/bozHVlWvJgjufvIdwfAXEVF6YGmdOa8XI1UEfG3jG6G7l+2GUJ7 /XdgxIdG6jFbZZvHulVeJOumDkrzEfV8tmPOe1FN9YP8jcvflZpRgfJGRVz24fImYUuq LK85SgKS5I0ruMbfXizbcE0Y/PhPnpOOpwUhhyHgYLFppVmwjl0eW28ZBIK0y/KZmJNP wYeWi2e38bnFnTDZU9PkcwMtXPlQi3+caxjBz5zzB6AsP3LTYGcaTYcZif4OojcTpmGO /nZO2DGIVZZ95vYzfU2hEuJ61mQy2dROZcp0+7Soq6QAOx611R8Lh5TqKliZXG7SkmU0 tXNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=jC8sod3IK3MEfPEVtwNiX6u+A/D3kZVyjuptbX8nh2k=; b=oQr0UDvFGYV2fkvzlkLNMgVpEOIaSjr8ushg6TN9zHy4ybHXLIi3RK50hvCQGOjRdZ n6IEi+6pnfU2tSvq7AYgy+Xg77F4kYW3MeVmAQ5/2sSdYn+VaQWqSHUHWxLwPPBOXLhc vdicwblp15b1dMGk6HA3Fl9MC6cFG5O5EcU1NrvO1k1yXgzcVxjOwn7Qt8nc3LHpkAaJ CBXq6p0pxZMwfzL6pqoO1kQ+IC/oru8SeeSWu7/S7p8TKlSg4IuxPmBs1x6bFXHAYwS/ gRkVLbIO8v5eQNKrUwyHu9tMdKh3yrVbbZ2MsmJp2OckAx3xTOoOJDHSCqnJqz1W6wNV XwtA== X-Gm-Message-State: APjAAAVmlO0CqgjeHkclUnCfjoNj5AJT/SG4YvKlaoijXWIYu2DyBCA0 Aj+P7fCmd3o+sSedk+MIpEXJBJeo X-Received: by 2002:a05:600c:2185:: with SMTP id e5mr7096154wme.78.1570701094206; Thu, 10 Oct 2019 02:51:34 -0700 (PDT) Received: from localhost.localdomain ([46.114.37.24]) by smtp.googlemail.com with ESMTPSA id o4sm11678251wre.91.2019.10.10.02.51.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Oct 2019 02:51:33 -0700 (PDT) From: Gon Solo To: mchehab+samsung@kernel.org Cc: linux-media@vger.kernel.org, mchehab@infradead.org, jp@jpvw.nl, crope@iki.fi, sean@mess.org, linux-kernel@vger.kernel.org, Gon Solo Subject: [PATCH 2/4] si2157: Add option for not downloading firmware. Date: Thu, 10 Oct 2019 11:51:01 +0200 Message-Id: <20191010095103.3803-3-gonsolo@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191010091848.GA2898@Limone> References: <20191010091848.GA2898@Limone> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org While at it, convert to kernel-doc format and use bits instead of bools. Signed-off-by: Gon Solo --- drivers/media/tuners/si2157.c | 6 ++++++ drivers/media/tuners/si2157.h | 33 +++++++++++++++++------------- drivers/media/tuners/si2157_priv.h | 5 +++-- 3 files changed, 28 insertions(+), 16 deletions(-) diff --git a/drivers/media/tuners/si2157.c b/drivers/media/tuners/si2157.c index e87040d6eca7..898e0f9f8b70 100644 --- a/drivers/media/tuners/si2157.c +++ b/drivers/media/tuners/si2157.c @@ -118,6 +118,11 @@ static int si2157_init(struct dvb_frontend *fe) goto err; } + if (dev->dont_load_firmware) { + dev_info(&client->dev, "device is buggy, skipping firmware download\n"); + goto skip_fw_download; + } + /* query chip revision */ memcpy(cmd.args, "\x02", 1); cmd.wlen = 1; @@ -440,6 +445,7 @@ static int si2157_probe(struct i2c_client *client, i2c_set_clientdata(client, dev); dev->fe = cfg->fe; dev->inversion = cfg->inversion; + dev->dont_load_firmware = cfg->dont_load_firmware; dev->if_port = cfg->if_port; dev->chiptype = (u8)id->driver_data; dev->if_frequency = 5000000; /* default value of property 0x0706 */ diff --git a/drivers/media/tuners/si2157.h b/drivers/media/tuners/si2157.h index c22ca784f43f..ffdece3c2eaa 100644 --- a/drivers/media/tuners/si2157.h +++ b/drivers/media/tuners/si2157.h @@ -11,29 +11,34 @@ #include #include -/* - * I2C address - * 0x60 +/** + * struct si2157_config - configuration parameters for si2157 + * + * @fe: + * frontend returned by driver + * @mdev: + * media device returned by driver + * @inversion: + * spectral inversion + * @dont_load_firmware: + * Instead of uploading a new firmware, use the existing one + * @if_port: + * Port selection + * Select the RF interface to use (pins 9+11 or 12+13) + * + * Note: + * The I2C address of this demod is 0x60. */ struct si2157_config { - /* - * frontend - */ struct dvb_frontend *fe; #if defined(CONFIG_MEDIA_CONTROLLER) struct media_device *mdev; #endif - /* - * Spectral Inversion - */ - bool inversion; + unsigned int inversion:1; + unsigned int dont_load_firmware:1; - /* - * Port selection - * Select the RF interface to use (pins 9+11 or 12+13) - */ u8 if_port; }; diff --git a/drivers/media/tuners/si2157_priv.h b/drivers/media/tuners/si2157_priv.h index 2bda903358da..778f81b39996 100644 --- a/drivers/media/tuners/si2157_priv.h +++ b/drivers/media/tuners/si2157_priv.h @@ -23,8 +23,9 @@ enum si2157_pads { struct si2157_dev { struct mutex i2c_mutex; struct dvb_frontend *fe; - bool active; - bool inversion; + unsigned int active:1; + unsigned int inversion:1; + unsigned int dont_load_firmware:1; u8 chiptype; u8 if_port; u32 if_frequency; -- 2.20.1