+#include <linux/kernel.h>
#include <media/saa7146_vv.h>
-#define my_min(type,x,y) \
- ({ type __x = (x), __y = (y); __x < __y ? __x: __y; })
-#define my_max(type,x,y) \
- ({ type __x = (x), __y = (y); __x > __y ? __x: __y; })
-
static void calculate_output_format_register(struct saa7146_dev* saa, u32 palette, u32* clip_format)
{
/* clear out the necessary bits */
b = y[i]+h[i];
/* insert left/right coordinates */
- pixel_list[ 2*i ] = my_min(int, l, width);
- pixel_list[(2*i)+1] = my_min(int, r, width);
+ pixel_list[ 2*i ] = min_t(int, l, width);
+ pixel_list[(2*i)+1] = min_t(int, r, width);
/* insert top/bottom coordinates */
- line_list[ 2*i ] = my_min(int, t, height);
- line_list[(2*i)+1] = my_min(int, b, height);
+ line_list[ 2*i ] = min_t(int, t, height);
+ line_list[(2*i)+1] = min_t(int, b, height);
}
/* sort and eliminate lists */
sort_and_eliminate( &line_list[0], &cnt_line );
/* calculate the number of used u32s */
- numdwords = my_max(int, (cnt_line+1), (cnt_pixel+1))*2;
- numdwords = my_max(int, 4, numdwords);
- numdwords = my_min(int, 64, numdwords);
+ numdwords = max_t(int, (cnt_line+1), (cnt_pixel+1))*2;
+ numdwords = max_t(int, 4, numdwords);
+ numdwords = min_t(int, 64, numdwords);
/* fill up cliptable */
for(i = 0; i < cnt_pixel; i++) {
saa7146_set_window(dev, buf->fmt->width, buf->fmt->height, buf->fmt->field);
saa7146_set_output_format(dev, sfmt->trans);
+ saa7146_disable_clipping(dev);
if ( vv->last_field == V4L2_FIELD_INTERLACED ) {
} else if ( vv->last_field == V4L2_FIELD_TOP ) {
dmas = MASK_22 | MASK_21 | MASK_20;
} else {
resource = RESOURCE_DMA1_HPS;
- dmas = MASK_20;
+ dmas = MASK_22;
}
saa7146_res_free(fh, resource);
DEB_D(("overlay is active, but in another open\n"));
return -EAGAIN;
}
+ } else {
+ DEB_D(("overlay is not active\n"));
+ return 0;
}
spin_lock_irqsave(&dev->slock,flags);
err = saa7146_stop_preview(fh);
pid_t thread_pid;
unsigned long release_jiffies;
unsigned long lost_sync_jiffies;
- int aquire_signal;
+ int acquire_signal;
int bending;
int lnb_drift;
int timeout_count;
fe->lost_sync_count = 0;
fe->lost_sync_jiffies = jiffies;
fe->lnb_drift = 0;
- fe->aquire_signal = 1;
+ fe->acquire_signal = 1;
if (fe->status & ~FE_TIMEDOUT)
dvb_frontend_add_event (fe, 0);
memcpy (&fe->parameters, param,
if (s & FE_HAS_LOCK) {
fe->timeout_count = 0;
fe->lost_sync_count = 0;
- fe->aquire_signal = 0;
+ fe->acquire_signal = 0;
} else {
fe->lost_sync_count++;
if (!(fe->info->caps & FE_CAN_RECOVER)) {
if (!(fe->info->caps & FE_CAN_CLEAN_SETUP)) {
if (fe->lost_sync_count < 10) {
- if (fe->aquire_signal)
+ if (fe->acquire_signal)
dvb_frontend_internal_ioctl(
&fe->frontend,
FE_RESET, NULL);
cx22700_set_inversion (i2c, p->inversion);
cx22700_set_tps (i2c, &p->u.ofdm);
cx22700_writereg (i2c, 0x37, 0x01); /* PAL loop filter off */
- cx22700_writereg (i2c, 0x00, 0x01); /* restart aquire */
+ cx22700_writereg (i2c, 0x00, 0x01); /* restart acquire */
break;
}
struct nxt6000_config *nxt = FE2NXT(fe);
return nxt6000_read(fe->i2c, nxt->demod_addr, reg);
+}
+
+static int pll_test(struct dvb_i2c_bus *i2c, u8 demod_addr, u8 tuner_addr)
+{
+ u8 buf [1];
+ struct i2c_msg msg = {.addr = tuner_addr >> 1,.flags = I2C_M_RD,.buf = buf,.len = 1 };
+ int ret;
+ nxt6000_write(i2c, demod_addr, ENABLE_TUNER_IIC, 0x01); /* open i2c bus switch */
+ ret = i2c->xfer(i2c, &msg, 1);
+ nxt6000_write(i2c, demod_addr, ENABLE_TUNER_IIC, 0x00); /* close i2c bus switch */
+
+ return (ret != 1) ? -EFAULT : 0;
}
static int pll_write(struct dvb_i2c_bus *i2c, u8 demod_addr, u8 tuner_addr, u8 *buf, u8 len)
if (nxt6000_read(i2c, demod_addr_tbl[addr_nr], OFDM_MSC_REV) != NXT6000ASICDEVICE)
continue;
- if (pll_write(i2c, demod_addr_tbl[addr_nr], 0xC0, NULL, 0) == 0) {
+ if (pll_test(i2c, demod_addr_tbl[addr_nr], 0xC0) == 0) {
nxt->tuner_addr = 0xC0;
nxt->tuner_type = TUNER_TYPE_ALP510;
nxt->clock_inversion = 1;
dprintk("nxt6000: detected TI ALP510 tuner at 0x%02X\n", nxt->tuner_addr);
- } else if (pll_write(i2c, demod_addr_tbl[addr_nr], 0xC2, NULL, 0) == 0) {
+ } else if (pll_test(i2c, demod_addr_tbl[addr_nr], 0xC2) == 0) {
nxt->tuner_addr = 0xC2;
nxt->tuner_type = TUNER_TYPE_SP5659;
nxt->clock_inversion = 0;
dprintk("nxt6000: detected MITEL SP5659 tuner at 0x%02X\n", nxt->tuner_addr);
- } else if (pll_write(i2c, demod_addr_tbl[addr_nr], 0xC0, NULL, 0) == 0) {
+ } else if (pll_test(i2c, demod_addr_tbl[addr_nr], 0xC0) == 0) {
nxt->tuner_addr = 0xC0;
nxt->tuner_type = TUNER_TYPE_SP5730;
nxt->clock_inversion = 0;
(so called Budget- or Nova-PCI cards) without onboard
MPEG2 decoder, but with onboard Common Interface connector.
+ Note: The Common Interface is not yet supported by this driver
+ due to lack of information from the vendor.
+
Say Y if you own such a card and want to use it.
To compile this driver as a module, choose M here: the
tristate "Technotrend/Hauppauge USB DEC devices"
depends on DVB_CORE && USB
select FW_LOADER
+ select CRC32
help
Support for external USB adapters designed by Technotrend and
produced by Hauppauge, shipped under the brand name 'DEC2000-t'
break;
case 3:
- if (*b++ == 0x00) {
+ if (*b == 0x00) {
dec->packet_state++;
dec->packet_length = 0;
- } else {
+ } else if (*b != 0xaa) {
dec->packet_state = 0;
}
+ b++;
length--;
break;