From patchwork Thu Jul 21 13:56:25 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abylai Ospan X-Patchwork-Id: 9241727 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0531A60574 for ; Thu, 21 Jul 2016 13:56:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EB3B227D85 for ; Thu, 21 Jul 2016 13:56:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DF9B927EED; Thu, 21 Jul 2016 13:56:35 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DF8A727D85 for ; Thu, 21 Jul 2016 13:56:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750944AbcGUN4d (ORCPT ); Thu, 21 Jul 2016 09:56:33 -0400 Received: from 108-197-250-228.lightspeed.miamfl.sbcglobal.net ([108.197.250.228]:38230 "EHLO usa.attlocal.net" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750827AbcGUN4c (ORCPT ); Thu, 21 Jul 2016 09:56:32 -0400 Received: by usa.attlocal.net (Postfix, from userid 1000) id 4C867105276; Thu, 21 Jul 2016 09:56:30 -0400 (EDT) From: Abylay Ospan To: Mauro Carvalho Chehab , linux-media@vger.kernel.org Cc: Abylay Ospan Subject: [PATCH] [media] cxd2841er: force 8MHz bandwidth for DVB-C if specified bw not supported Date: Thu, 21 Jul 2016 09:56:25 -0400 Message-Id: <1469109385-3881-1-git-send-email-aospan@netup.ru> X-Mailer: git-send-email 2.7.4 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP if specified DVB-C bandwidth not supported then force 8MHz. Should work for most cases. Signed-off-by: Abylay Ospan --- drivers/media/dvb-frontends/cxd2841er.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/media/dvb-frontends/cxd2841er.c b/drivers/media/dvb-frontends/cxd2841er.c index 3df0604..10608a9 100644 --- a/drivers/media/dvb-frontends/cxd2841er.c +++ b/drivers/media/dvb-frontends/cxd2841er.c @@ -2763,6 +2763,14 @@ static int cxd2841er_sleep_tc_to_active_c_band(struct cxd2841er_priv *priv, u8 b10_b6[3]; u32 iffreq; + if (bandwidth != 6000000 && + bandwidth != 7000000 && + bandwidth != 8000000) { + dev_info(&priv->i2c->dev, "%s(): unsupported bandwidth %d. Forcing 8Mhz!\n", + __func__, bandwidth); + bandwidth = 8000000; + } + dev_dbg(&priv->i2c->dev, "%s() bw=%d\n", __func__, bandwidth); cxd2841er_write_reg(priv, I2C_SLVT, 0x00, 0x10); switch (bandwidth) {