diff --git a/ddbridge/ddbridge-core.c b/ddbridge/ddbridge-core.c index 9809c1e..60d629e 100644 --- a/ddbridge/ddbridge-core.c +++ b/ddbridge/ddbridge-core.c @@ -25,6 +25,7 @@ #include "ddbridge-i2c.h" #include "ddbridge-io.h" #include "ddbridge-ioctl.h" +#include "ddbridge-core.h" #include struct workqueue_struct *ddb_wq; @@ -105,6 +106,7 @@ DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr); /* copied from dvb-core/dvbdev.c because kernel version does not export it */ + int ddb_dvb_usercopy(struct file *file, unsigned int cmd, unsigned long arg, int (*func)(struct file *file, @@ -4070,7 +4072,7 @@ static struct class ddb_class = { .devnode = ddb_devnode, }; -int ddb_class_create(void) +static int ddb_class_create(void) { ddb_major = register_chrdev(0, DDB_NAME, &ddb_fops); if (ddb_major < 0) @@ -4080,7 +4082,7 @@ int ddb_class_create(void) return 0; } -void ddb_class_destroy(void) +static void ddb_class_destroy(void) { class_unregister(&ddb_class); unregister_chrdev(ddb_major, DDB_NAME); diff --git a/ddbridge/ddbridge-core.h b/ddbridge/ddbridge-core.h new file mode 100644 index 0000000..cfebe5d --- /dev/null +++ b/ddbridge/ddbridge-core.h @@ -0,0 +1,31 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * ddbridge-core.c: Digital Devices bridge core functions + * + * Copyright (C) 2010-2017 Digital Devices GmbH + * Marcus Metzler + * Ralph Metzler + * + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * version 2 only, as published by the Free Software Foundation. + * + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef _DDBRIDGE_SX8_H_ +#define _DDBRIDGE_SX8_H_ + +int ddb_dvb_usercopy(struct file *file, + unsigned int cmd, unsigned long arg, + int (*func)(struct file *file, + unsigned int cmd, void *arg)); +#endif diff --git a/ddbridge/ddbridge-m4.c b/ddbridge/ddbridge-m4.c index 02f8b10..94b62e0 100644 --- a/ddbridge/ddbridge-m4.c +++ b/ddbridge/ddbridge-m4.c @@ -25,6 +25,7 @@ #include "ddbridge.h" #include "ddbridge-io.h" #include "ddbridge-mci.h" +#include "ddbridge-m4.h" struct m4_base { struct mci_base mci_base; diff --git a/ddbridge/ddbridge-m4.h b/ddbridge/ddbridge-m4.h new file mode 100644 index 0000000..71cccc3 --- /dev/null +++ b/ddbridge/ddbridge-m4.h @@ -0,0 +1,30 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * ddbridge-m4.c: Digital Devices MAX M4 driver + * + * Copyright (C) 2018 Digital Devices GmbH + * Marcus Metzler + * Ralph Metzler + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * version 2 only, as published by the Free Software Foundation. + * + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, point your browser to + * http://www.gnu.org/copyleft/gpl.html + */ + +#ifndef _DDBRIDGE_M4_H_ +#define _DDBRIDGE_M4_H_ + +struct dvb_frontend *ddb_mx_attach(struct ddb_input *input, int nr, int tuner, int type); + +#endif diff --git a/ddbridge/ddbridge-max.c b/ddbridge/ddbridge-max.c index 963dc29..265e627 100644 --- a/ddbridge/ddbridge-max.c +++ b/ddbridge/ddbridge-max.c @@ -25,6 +25,8 @@ #include "ddbridge.h" #include "ddbridge-io.h" #include "ddbridge-i2c.h" +#include "ddbridge-sx8.h" +#include "ddbridge-m4.h" /* MAX LNB interface related module parameters */ @@ -482,8 +484,9 @@ int ddb_fe_attach_mxl5xx(struct ddb_input *input) cfg = mxl5xx; cfg.fw_priv = link; - if (dev->link[0].info->type == DDB_OCTONET) + if (dev->link[0].info->type == DDB_OCTONET) { ;/*cfg.ts_clk = 69;*/ + } demod = input->nr; tuner = demod & 3; @@ -519,11 +522,6 @@ int ddb_fe_attach_mxl5xx(struct ddb_input *input) return 0; } -/* MAX MCI related functions */ -struct dvb_frontend *ddb_sx8_attach(struct ddb_input *input, int nr, int tuner, - int (**fn_set_input)(struct dvb_frontend *fe, int input)); -struct dvb_frontend *ddb_mx_attach(struct ddb_input *input, int nr, int tuner, int type); - int ddb_fe_attach_mci(struct ddb_input *input, u32 type) { diff --git a/ddbridge/ddbridge-mci.c b/ddbridge/ddbridge-mci.c index 9726857..d29df74 100644 --- a/ddbridge/ddbridge-mci.c +++ b/ddbridge/ddbridge-mci.c @@ -210,7 +210,7 @@ int ddb_mci_cmd(struct mci *state, } -int ddb_mci_cmd_raw(struct mci *state, +static int ddb_mci_cmd_raw(struct mci *state, struct mci_command *command, u32 command_len, struct mci_result *result, u32 result_len) { diff --git a/ddbridge/ddbridge-sx8.c b/ddbridge/ddbridge-sx8.c index af84452..240b963 100644 --- a/ddbridge/ddbridge-sx8.c +++ b/ddbridge/ddbridge-sx8.c @@ -24,6 +24,7 @@ #include "ddbridge.h" #include "ddbridge-io.h" #include "ddbridge-mci.h" +#include "ddbridge-sx8.h" static int default_mod = 3; module_param(default_mod, int, 0444); diff --git a/ddbridge/ddbridge-sx8.h b/ddbridge/ddbridge-sx8.h new file mode 100644 index 0000000..1e53fc0 --- /dev/null +++ b/ddbridge/ddbridge-sx8.h @@ -0,0 +1,29 @@ +/* + * ddbridge-sx8.c: Digital Devices MAX SX8 driver + * + * Copyright (C) 2018 Digital Devices GmbH + * Marcus Metzler + * Ralph Metzler + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * version 2 only, as published by the Free Software Foundation. + * + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, point your browser to + * http://www.gnu.org/copyleft/gpl.html + */ + +#ifndef _DDBRIDGE_SX8_H_ +#define _DDBRIDGE_SX8_H_ + +struct dvb_frontend *ddb_sx8_attach(struct ddb_input *input, int nr, int tuner, + int (**fn_set_input)(struct dvb_frontend *fe, int input)); +#endif diff --git a/ddbridge/dvb_netstream.c b/ddbridge/dvb_netstream.c index ee1188b..4a6a480 100644 --- a/ddbridge/dvb_netstream.c +++ b/ddbridge/dvb_netstream.c @@ -25,9 +25,8 @@ #include #include "dvb_netstream.h" +#include "ddbridge-core.h" -int ddb_dvb_usercopy(struct file *file, unsigned int cmd, unsigned long arg, - int (*func)(struct file *file, unsigned int cmd, void *arg)); static ssize_t ns_write(struct file *file, const char *buf, size_t count, loff_t *ppos) diff --git a/frontends/drxk_hard.c b/frontends/drxk_hard.c index 640f3a2..987e2aa 100644 --- a/frontends/drxk_hard.c +++ b/frontends/drxk_hard.c @@ -62,16 +62,6 @@ static bool IsQAM(struct drxk_state *state) state->m_OperationMode == OM_QAM_ITU_C; } -bool IsA1WithPatchCode(struct drxk_state *state) -{ - return state->m_DRXK_A1_PATCH_CODE; -} - -bool IsA1WithRomCode(struct drxk_state *state) -{ - return state->m_DRXK_A1_ROM_CODE; -} - #define NOA1ROM 0 #ifndef CHK_ERROR @@ -492,7 +482,7 @@ static int WriteBlock(struct drxk_state *state, u32 Address, #define DRXK_MAX_RETRIES_POWERUP 20 #endif -int PowerUpDevice(struct drxk_state *state) +static int PowerUpDevice(struct drxk_state *state) { int status; u8 data = 0; diff --git a/frontends/stv0367dd.c b/frontends/stv0367dd.c index d97e59e..2ed2109 100644 --- a/frontends/stv0367dd.c +++ b/frontends/stv0367dd.c @@ -1609,8 +1609,9 @@ static int ofdm_lock(struct stv_state *state) writereg(state, R367_TSGENERAL,tmp2 & ~0x01); } msleep(FECTimeOut); - if( (OFDM_Status & 0x98) != 0x98 ) + if( (OFDM_Status & 0x98) != 0x98 ) { ;//return -1; + } //printk("lock 2\n"); { diff --git a/frontends/stv6111.c b/frontends/stv6111.c index 3d10d8a..bc25a25 100644 --- a/frontends/stv6111.c +++ b/frontends/stv6111.c @@ -33,6 +33,8 @@ #include +#include "stv6111.h" + static inline u32 MulDiv32(u32 a, u32 b, u32 c) { u64 tmp64; diff --git a/frontends/tda18212dd.c b/frontends/tda18212dd.c index 1235437..5c8c74f 100644 --- a/frontends/tda18212dd.c +++ b/frontends/tda18212dd.c @@ -34,6 +34,8 @@ #include +#include "tda18212dd.h" + #ifndef CHK_ERROR #define CHK_ERROR(s) if ((status = s) < 0) break #endif diff --git a/frontends/tda18271c2dd.c b/frontends/tda18271c2dd.c index 39fd090..aba7f62 100644 --- a/frontends/tda18271c2dd.c +++ b/frontends/tda18271c2dd.c @@ -1307,6 +1307,8 @@ static struct dvb_tuner_ops tuner_ops = { .get_bandwidth = get_bandwidth, }; +struct dvb_frontend *tda18271c2dd_attach(struct dvb_frontend *fe, + struct i2c_adapter *i2c, u8 adr); struct dvb_frontend *tda18271c2dd_attach(struct dvb_frontend *fe, struct i2c_adapter *i2c, u8 adr) {