From patchwork Thu Aug 16 17:48:34 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: CrazyCat X-Patchwork-Id: 1334681 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id C3855DFB34 for ; Thu, 16 Aug 2012 17:54:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932850Ab2HPRyP (ORCPT ); Thu, 16 Aug 2012 13:54:15 -0400 Received: from forward2h.mail.yandex.net ([84.201.187.147]:33172 "EHLO forward2h.mail.yandex.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933104Ab2HPRyK (ORCPT ); Thu, 16 Aug 2012 13:54:10 -0400 X-Greylist: delayed 333 seconds by postgrey-1.27 at vger.kernel.org; Thu, 16 Aug 2012 13:54:10 EDT Received: from web25h.yandex.ru (web25h.yandex.ru [84.201.187.159]) by forward2h.mail.yandex.net (Yandex) with ESMTP id A740870235C; Thu, 16 Aug 2012 21:48:35 +0400 (MSK) Received: from 127.0.0.1 (localhost.localdomain [127.0.0.1]) by web25h.yandex.ru (Yandex) with ESMTP id 18FED17F8320; Thu, 16 Aug 2012 21:48:35 +0400 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1345139315; bh=KY0f8FUIMr3nYH2FDZVBpyJBd1DxrlFpM5FJAOl2ldU=; h=From:To:Cc:Subject:MIME-Version:Message-Id:Date: Content-Transfer-Encoding:Content-Type; b=j6Qnj9Ze8PWWEp7W/edz/0IUkTZB5RMN7jG51DHLOnUkSnyzxW9z+onwn9GSrwaVe O8TfgBkLa7Imr4bi+jmDx9BXDJ46EG26YgkUzKlThCzKJReVQa7w424HtIt+D5BxiA a/ZP14AWI2nzVKo5HQyVDFSHCkwsgWd4KqM+qp7U= Received: from usa.globax.biz (usa.globax.biz [75.126.74.185]) by web25h.yandex.ru with HTTP; Thu, 16 Aug 2012 21:48:34 +0400 From: CrazyCat To: linux-media@vger.kernel.org Cc: Mauro Carvalho Chehab , Manu Abraham Subject: [PATCH] stv090x: Multistream support MIME-Version: 1.0 Message-Id: <60211345139314@web25h.yandex.ru> Date: Thu, 16 Aug 2012 20:48:34 +0300 X-Mailer: Yamail [ http://yandex.ru ] 5.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org DVB-S2 Multistream support for stv090x Signed-off-by: Evgeny Plehov --- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/media/dvb/frontends/stv090x.c b/drivers/media/dvb/frontends/stv090x.c index ea86a56..13caec0 100644 --- a/drivers/media/dvb/frontends/stv090x.c +++ b/drivers/media/dvb/frontends/stv090x.c @@ -3425,6 +3425,33 @@ err: return -1; } +static int stv090x_set_mis(struct stv090x_state *state, int mis) +{ + u32 reg; + + if (mis < 0 || mis > 255) { + dprintk(FE_DEBUG, 1, "Disable MIS filtering"); + reg = STV090x_READ_DEMOD(state, PDELCTRL1); + STV090x_SETFIELD_Px(reg, FILTER_EN_FIELD, 0x00); + if (STV090x_WRITE_DEMOD(state, PDELCTRL1, reg) < 0) + goto err; + } else { + dprintk(FE_DEBUG, 1, "Enable MIS filtering - %d", mis); + reg = STV090x_READ_DEMOD(state, PDELCTRL1); + STV090x_SETFIELD_Px(reg, FILTER_EN_FIELD, 0x01); + if (STV090x_WRITE_DEMOD(state, PDELCTRL1, reg) < 0) + goto err; + if (STV090x_WRITE_DEMOD(state, ISIENTRY, mis) < 0) + goto err; + if (STV090x_WRITE_DEMOD(state, ISIBITENA, 0xff) < 0) + goto err; + } + return 0; +err: + dprintk(FE_ERROR, 1, "I/O error"); + return -1; +} + static enum dvbfe_search stv090x_search(struct dvb_frontend *fe) { struct stv090x_state *state = fe->demodulator_priv; @@ -3447,6 +3474,8 @@ static enum dvbfe_search stv090x_search(struct dvb_frontend *fe) state->search_range = 5000000; } + stv090x_set_mis(state, props->stream_id); + if (stv090x_algo(state) == STV090x_RANGEOK) { dprintk(FE_DEBUG, 1, "Search success!"); return DVBFE_ALGO_SEARCH_SUCCESS; @@ -4798,6 +4827,9 @@ struct dvb_frontend *stv090x_attach(const struct stv090x_config *config, } } + if (state->internal->dev_ver >= 0x30) + state->frontend.ops.info.caps |= FE_CAN_MULTISTREAM; + /* workaround for stuck DiSEqC output */ if (config->diseqc_envelope_mode) stv090x_send_diseqc_burst(&state->frontend, SEC_MINI_A);