From patchwork Tue May 14 09:23:53 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guy Martin X-Patchwork-Id: 2563781 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 18A613FD85 for ; Tue, 14 May 2013 09:38:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756950Ab3ENJiF (ORCPT ); Tue, 14 May 2013 05:38:05 -0400 Received: from venus.vo.lu ([80.90.45.96]:54260 "EHLO venus.vo.lu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756917Ab3ENJiE (ORCPT ); Tue, 14 May 2013 05:38:04 -0400 Received: from ibiza.bxl.tuxicoman.be (vodsl-9486.vo.lu [85.93.204.14]) by venus.vo.lu with SMTP (version=TLS\Tls cipher=Aes128 bits=128); Tue, 14 May 2013 11:37:49 +0200 Received: from lan226.bxl.tuxicoman.be ([172.19.1.226] helo=me) by ibiza.bxl.tuxicoman.be with smtp (Exim 4.80.1) (envelope-from ) id 1UcBg8-0002wA-MK for linux-media@vger.kernel.org; Tue, 14 May 2013 11:37:53 +0200 Received: (nullmailer pid 17204 invoked by uid 0); Tue, 14 May 2013 09:23:55 -0000 From: Guy Martin To: linux-media@vger.kernel.org Subject: [PATCH 3/5] libdvbv5: Export dvb_fe_is_satellite() Date: Tue, 14 May 2013 11:23:53 +0200 Message-Id: <9a8fd0c70a6506e507a253802e5973b0b4d80e40.1368522021.git.gmsoft@tuxicoman.be> X-Mailer: git-send-email 1.8.1.5 In-Reply-To: References: In-Reply-To: References: Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org This patch makes the function dvb_fe_is_satellite() availble from libdvbv5. This function is simple but yet very handful to have around. Signed-off-by: Guy Martin diff --git a/lib/include/dvb-fe.h b/lib/include/dvb-fe.h index d725a42..7352218 100644 --- a/lib/include/dvb-fe.h +++ b/lib/include/dvb-fe.h @@ -203,6 +203,7 @@ int dvb_fe_diseqc_cmd(struct dvb_v5_fe_parms *parms, const unsigned len, const unsigned char *buf); int dvb_fe_diseqc_reply(struct dvb_v5_fe_parms *parms, unsigned *len, char *buf, int timeout); +int dvb_fe_is_satellite(uint32_t delivery_system); #ifdef __cplusplus } diff --git a/lib/libdvbv5/dvb-fe.c b/lib/libdvbv5/dvb-fe.c index 550b6e2..b786a85 100644 --- a/lib/libdvbv5/dvb-fe.c +++ b/lib/libdvbv5/dvb-fe.c @@ -230,7 +230,7 @@ struct dvb_v5_fe_parms *dvb_fe_open2(int adapter, int frontend, unsigned verbose } -static int is_satellite(uint32_t delivery_system) +int dvb_fe_is_satellite(uint32_t delivery_system) { switch (delivery_system) { case SYS_DVBS: @@ -254,7 +254,7 @@ void dvb_fe_close(struct dvb_v5_fe_parms *parms) return; /* Disable LNBf power */ - if (is_satellite(parms->current_sys)) + if (dvb_fe_is_satellite(parms->current_sys)) dvb_fe_sec_voltage(parms, 0, 0); close(parms->fd); @@ -298,8 +298,8 @@ int dvb_set_sys(struct dvb_v5_fe_parms *parms, if (sys != parms->current_sys) { /* Disable LNBf power */ - if (is_satellite(parms->current_sys) && - !is_satellite(sys)) + if (dvb_fe_is_satellite(parms->current_sys) && + !dvb_fe_is_satellite(sys)) dvb_fe_sec_voltage(parms, 0, 0); /* Can't change standard with the legacy FE support */ @@ -594,7 +594,7 @@ int dvb_fe_get_parms(struct dvb_v5_fe_parms *parms) ret: /* For satellite, need to recover from LNBf IF frequency */ - if (is_satellite(parms->current_sys)) + if (dvb_fe_is_satellite(parms->current_sys)) return dvb_sat_get_parms(parms); return 0; @@ -609,7 +609,7 @@ int dvb_fe_set_parms(struct dvb_v5_fe_parms *parms) struct dtv_property fe_prop[DTV_MAX_COMMAND]; - if (is_satellite(parms->current_sys)) { + if (dvb_fe_is_satellite(parms->current_sys)) { dvb_fe_retrieve_parm(parms, DTV_FREQUENCY, &freq); dvb_sat_set_parms(parms); } @@ -673,7 +673,7 @@ int dvb_fe_set_parms(struct dvb_v5_fe_parms *parms) } ret: /* For satellite, need to recover from LNBf IF frequency */ - if (is_satellite(parms->current_sys)) + if (dvb_fe_is_satellite(parms->current_sys)) dvb_fe_store_parm(parms, DTV_FREQUENCY, freq); return 0;