From patchwork Thu Jul 9 04:06:22 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antti Palosaari X-Patchwork-Id: 6752961 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 DDADB9F38C for ; Thu, 9 Jul 2015 04:07:03 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EEDB020670 for ; Thu, 9 Jul 2015 04:07:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E90F02060D for ; Thu, 9 Jul 2015 04:07:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750774AbbGIEG7 (ORCPT ); Thu, 9 Jul 2015 00:06:59 -0400 Received: from mail.kapsi.fi ([217.30.184.167]:36327 "EHLO mail.kapsi.fi" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750741AbbGIEGz (ORCPT ); Thu, 9 Jul 2015 00:06:55 -0400 Received: from 85-23-164-218.bb.dnainternet.fi ([85.23.164.218] helo=localhost.localdomain.localdomain) by mail.kapsi.fi with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1ZD36s-0002AB-5Y; Thu, 09 Jul 2015 07:06:54 +0300 From: Antti Palosaari To: linux-media@vger.kernel.org Cc: Antti Palosaari Subject: [PATCH 02/12] a8293: remove legacy media attach Date: Thu, 9 Jul 2015 07:06:22 +0300 Message-Id: <1436414792-9716-2-git-send-email-crope@iki.fi> X-Mailer: git-send-email 2.4.3 In-Reply-To: <1436414792-9716-1-git-send-email-crope@iki.fi> References: <1436414792-9716-1-git-send-email-crope@iki.fi> X-SA-Exim-Connect-IP: 85.23.164.218 X-SA-Exim-Mail-From: crope@iki.fi X-SA-Exim-Scanned: No (on mail.kapsi.fi); SAEximRunCond expanded to false Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 Remove legacy media attach as all users are on I2C bindings now. Signed-off-by: Antti Palosaari --- drivers/media/dvb-frontends/a8293.c | 63 +------------------------------------ drivers/media/dvb-frontends/a8293.h | 18 ----------- 2 files changed, 1 insertion(+), 80 deletions(-) diff --git a/drivers/media/dvb-frontends/a8293.c b/drivers/media/dvb-frontends/a8293.c index 97ecbe0..522b0d1 100644 --- a/drivers/media/dvb-frontends/a8293.c +++ b/drivers/media/dvb-frontends/a8293.c @@ -18,7 +18,6 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#include "dvb_frontend.h" #include "a8293.h" struct a8293_priv { @@ -105,68 +104,8 @@ err: return ret; } -static void a8293_release_sec(struct dvb_frontend *fe) -{ - a8293_set_voltage(fe, SEC_VOLTAGE_OFF); - - kfree(fe->sec_priv); - fe->sec_priv = NULL; -} - -struct dvb_frontend *a8293_attach(struct dvb_frontend *fe, - struct i2c_adapter *i2c, const struct a8293_config *cfg) -{ - int ret; - struct a8293_priv *priv = NULL; - u8 buf[2]; - - /* allocate memory for the internal priv */ - priv = kzalloc(sizeof(struct a8293_priv), GFP_KERNEL); - if (priv == NULL) { - ret = -ENOMEM; - goto err; - } - - /* setup the priv */ - priv->i2c = i2c; - priv->i2c_addr = cfg->i2c_addr; - fe->sec_priv = priv; - - /* check if the SEC is there */ - ret = a8293_rd(priv, buf, 2); - if (ret) - goto err; - - /* ENB=0 */ - priv->reg[0] = 0x10; - ret = a8293_wr(priv, &priv->reg[0], 1); - if (ret) - goto err; - - /* TMODE=0, TGATE=1 */ - priv->reg[1] = 0x82; - ret = a8293_wr(priv, &priv->reg[1], 1); - if (ret) - goto err; - - fe->ops.release_sec = a8293_release_sec; - - /* override frontend ops */ - fe->ops.set_voltage = a8293_set_voltage; - - dev_info(&priv->i2c->dev, "%s: Allegro A8293 SEC attached\n", - KBUILD_MODNAME); - - return fe; -err: - dev_dbg(&i2c->dev, "%s: failed=%d\n", __func__, ret); - kfree(priv); - return NULL; -} -EXPORT_SYMBOL(a8293_attach); - static int a8293_probe(struct i2c_client *client, - const struct i2c_device_id *id) + const struct i2c_device_id *id) { struct a8293_priv *dev; struct a8293_platform_data *pdata = client->dev.platform_data; diff --git a/drivers/media/dvb-frontends/a8293.h b/drivers/media/dvb-frontends/a8293.h index aff3653..aa07b68 100644 --- a/drivers/media/dvb-frontends/a8293.h +++ b/drivers/media/dvb-frontends/a8293.h @@ -22,7 +22,6 @@ #define A8293_H #include "dvb_frontend.h" -#include /* * I2C address @@ -37,21 +36,4 @@ struct a8293_platform_data { struct dvb_frontend *dvb_frontend; }; - -struct a8293_config { - u8 i2c_addr; -}; - -#if IS_REACHABLE(CONFIG_DVB_A8293) -extern struct dvb_frontend *a8293_attach(struct dvb_frontend *fe, - struct i2c_adapter *i2c, const struct a8293_config *cfg); -#else -static inline struct dvb_frontend *a8293_attach(struct dvb_frontend *fe, - struct i2c_adapter *i2c, const struct a8293_config *cfg) -{ - printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__); - return NULL; -} -#endif - #endif /* A8293_H */