Commit 2ce6c0f5 authored by Linus Torvalds's avatar Linus Torvalds

Merge bk://kernel.bkbits.net/davem/sparc-2.6

into ppc970.osdl.org:/home/torvalds/v2.6/linux
parents af9037dd 804ca075
...@@ -50,6 +50,8 @@ o Cards based on the Phillips saa7146 multimedia PCI bridge chip: ...@@ -50,6 +50,8 @@ o Cards based on the Phillips saa7146 multimedia PCI bridge chip:
- Technotrend Budget / Hauppauge WinTV-Nova PCI Cards - Technotrend Budget / Hauppauge WinTV-Nova PCI Cards
- SATELCO Multimedia PCI - SATELCO Multimedia PCI
- KNC1 DVB-S - KNC1 DVB-S
- Typhoon DVB-S budget
- Fujitsu-Siemens Activy DVB-S budget card
o Cards based on the B2C2 Inc. FlexCopII/IIb/III: o Cards based on the B2C2 Inc. FlexCopII/IIb/III:
- Technisat SkyStar2 PCI DVB card revision 2.3, 2.6B, 2.6C - Technisat SkyStar2 PCI DVB card revision 2.3, 2.6B, 2.6C
......
...@@ -62,5 +62,13 @@ Hans-Frieder Vogt <hfvogt@arcor.de> ...@@ -62,5 +62,13 @@ Hans-Frieder Vogt <hfvogt@arcor.de>
for his work on calculating and checking the crc's for the for his work on calculating and checking the crc's for the
TechnoTrend/Hauppauge DEC driver firmware TechnoTrend/Hauppauge DEC driver firmware
Michael Dreher <michael@5dot1.de>
Andreas 'randy' Weinberger
for the support of the Fujitsu-Siemens Activy budget DVB-S
Kenneth Aafløy <ke-aa@frisurf.no>
for adding support for Typhoon DVB-S budget card
(If you think you should be in this list, but you are not, drop a (If you think you should be in this list, but you are not, drop a
line to the DVB mailing list) line to the DVB mailing list)
...@@ -94,6 +94,11 @@ Some very frequently asked questions about linuxtv-dvb ...@@ -94,6 +94,11 @@ Some very frequently asked questions about linuxtv-dvb
MythTV - analog TV PVR, but now with DVB support, too MythTV - analog TV PVR, but now with DVB support, too
(with software MPEG decode) (with software MPEG decode)
http://dvbsnoop.sourceforge.net/
DVB sniffer program to monitor, analyze, debug, dump
or view dvb/mpeg/dsm-cc/mhp stream information (TS,
PES, SECTION)
4. Can't get a signal tuned correctly 4. Can't get a signal tuned correctly
If you are using a Technotrend/Hauppauge DVB-C card *without* analog If you are using a Technotrend/Hauppauge DVB-C card *without* analog
......
...@@ -10,14 +10,14 @@ int saa7146_res_get(struct saa7146_fh *fh, unsigned int bit) ...@@ -10,14 +10,14 @@ int saa7146_res_get(struct saa7146_fh *fh, unsigned int bit)
struct saa7146_dev *dev = fh->dev; struct saa7146_dev *dev = fh->dev;
struct saa7146_vv *vv = dev->vv_data; struct saa7146_vv *vv = dev->vv_data;
if (fh->resources & bit) if (fh->resources & bit) {
DEB_D(("already allocated! want: 0x%02x, cur:0x%02x\n",bit,vv->resources));
/* have it already allocated */ /* have it already allocated */
return 1; return 1;
}
/* is it free? */ /* is it free? */
DEB_D(("getting lock...\n"));
down(&dev->lock); down(&dev->lock);
DEB_D(("got lock\n"));
if (vv->resources & bit) { if (vv->resources & bit) {
DEB_D(("locked! vv->resources:0x%02x, we want:0x%02x\n",vv->resources,bit)); DEB_D(("locked! vv->resources:0x%02x, we want:0x%02x\n",vv->resources,bit));
/* no, someone else uses it */ /* no, someone else uses it */
...@@ -27,7 +27,7 @@ int saa7146_res_get(struct saa7146_fh *fh, unsigned int bit) ...@@ -27,7 +27,7 @@ int saa7146_res_get(struct saa7146_fh *fh, unsigned int bit)
/* it's free, grab it */ /* it's free, grab it */
fh->resources |= bit; fh->resources |= bit;
vv->resources |= bit; vv->resources |= bit;
DEB_D(("res: get %d\n",bit)); DEB_D(("res: get 0x%02x, cur:0x%02x\n",bit,vv->resources));
up(&dev->lock); up(&dev->lock);
return 1; return 1;
} }
...@@ -51,12 +51,10 @@ void saa7146_res_free(struct saa7146_fh *fh, unsigned int bits) ...@@ -51,12 +51,10 @@ void saa7146_res_free(struct saa7146_fh *fh, unsigned int bits)
if ((fh->resources & bits) != bits) if ((fh->resources & bits) != bits)
BUG(); BUG();
DEB_D(("getting lock...\n"));
down(&dev->lock); down(&dev->lock);
DEB_D(("got lock\n"));
fh->resources &= ~bits; fh->resources &= ~bits;
vv->resources &= ~bits; vv->resources &= ~bits;
DEB_D(("res: put %d\n",bits)); DEB_D(("res: put 0x%02x, cur:0x%02x\n",bits,vv->resources));
up(&dev->lock); up(&dev->lock);
} }
......
...@@ -536,13 +536,13 @@ static void saa7146_set_window(struct saa7146_dev *dev, int width, int height, e ...@@ -536,13 +536,13 @@ static void saa7146_set_window(struct saa7146_dev *dev, int width, int height, e
/* set vertical scale */ /* set vertical scale */
hps_v_scale = 0; /* all bits get set by the function-call */ hps_v_scale = 0; /* all bits get set by the function-call */
hps_v_gain = 0; /* fixme: saa7146_read(dev, HPS_V_GAIN);*/ hps_v_gain = 0; /* fixme: saa7146_read(dev, HPS_V_GAIN);*/
calculate_v_scale_registers(dev, field, vv->standard->v_calc, height, &hps_v_scale, &hps_v_gain); calculate_v_scale_registers(dev, field, vv->standard->v_field*2, height, &hps_v_scale, &hps_v_gain);
/* set horizontal scale */ /* set horizontal scale */
hps_ctrl = 0; hps_ctrl = 0;
hps_h_prescale = 0; /* all bits get set in the function */ hps_h_prescale = 0; /* all bits get set in the function */
hps_h_scale = 0; hps_h_scale = 0;
calculate_h_scale_registers(dev, vv->standard->h_calc, width, vv->hflip, &hps_ctrl, &hps_v_gain, &hps_h_prescale, &hps_h_scale); calculate_h_scale_registers(dev, vv->standard->h_pixels, width, vv->hflip, &hps_ctrl, &hps_v_gain, &hps_h_prescale, &hps_h_scale);
/* set hyo and hxo */ /* set hyo and hxo */
calculate_hxo_and_hyo(vv, &hps_h_scale, &hps_ctrl); calculate_hxo_and_hyo(vv, &hps_h_scale, &hps_ctrl);
......
...@@ -400,7 +400,7 @@ static struct i2c_algorithm saa7146_algo = { ...@@ -400,7 +400,7 @@ static struct i2c_algorithm saa7146_algo = {
.functionality = saa7146_i2c_func, .functionality = saa7146_i2c_func,
}; };
int saa7146_i2c_adapter_prepare(struct saa7146_dev *dev, struct i2c_adapter *i2c_adapter, u32 bitrate) int saa7146_i2c_adapter_prepare(struct saa7146_dev *dev, struct i2c_adapter *i2c_adapter, unsigned int class, u32 bitrate)
{ {
DEB_EE(("bitrate: 0x%08x\n",bitrate)); DEB_EE(("bitrate: 0x%08x\n",bitrate));
...@@ -417,16 +417,13 @@ int saa7146_i2c_adapter_prepare(struct saa7146_dev *dev, struct i2c_adapter *i2c ...@@ -417,16 +417,13 @@ int saa7146_i2c_adapter_prepare(struct saa7146_dev *dev, struct i2c_adapter *i2c
i2c_adapter->data = dev; i2c_adapter->data = dev;
#else #else
i2c_set_adapdata(i2c_adapter,dev); i2c_set_adapdata(i2c_adapter,dev);
i2c_adapter->class = class;
#endif #endif
i2c_adapter->algo = &saa7146_algo; i2c_adapter->algo = &saa7146_algo;
i2c_adapter->algo_data = NULL; i2c_adapter->algo_data = NULL;
i2c_adapter->id = I2C_ALGO_SAA7146; i2c_adapter->id = I2C_ALGO_SAA7146;
i2c_adapter->timeout = SAA7146_I2C_TIMEOUT; i2c_adapter->timeout = SAA7146_I2C_TIMEOUT;
i2c_adapter->retries = SAA7146_I2C_RETRIES; i2c_adapter->retries = SAA7146_I2C_RETRIES;
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
#else
i2c_adapter->class = I2C_ADAP_CLASS_TV_ANALOG;
#endif
} }
return 0; return 0;
......
This diff is collapsed.
...@@ -18,12 +18,11 @@ config DVB ...@@ -18,12 +18,11 @@ config DVB
Please report problems regarding this driver to the LinuxDVB Please report problems regarding this driver to the LinuxDVB
mailing list. mailing list.
You might want add the following lines to your /etc/modprobe.conf: You might want add the following lines to your /etc/modules.conf:
alias char-major-250 dvb alias char-major-250 dvb
alias dvb dvb-ttpci alias dvb dvb-ttpci
install dvb-ttpci /sbin/modprobe --first-time -i dvb-ttpci && \ below dvb-ttpci alps_bsru6 alps_bsrv2 \
/sbin/modprobe -a alps_bsru6 alps_bsrv2 \
grundig_29504-401 grundig_29504-491 \ grundig_29504-401 grundig_29504-491 \
ves1820 ves1820
......
...@@ -2242,7 +2242,7 @@ static int skystar2_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -2242,7 +2242,7 @@ static int skystar2_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
if (driver_initialize(pdev) != 0) if (driver_initialize(pdev) != 0)
return -ENODEV; return -ENODEV;
dvb_register_adapter(&dvb_adapter, skystar2_pci_driver.name); dvb_register_adapter(&dvb_adapter, skystar2_pci_driver.name, THIS_MODULE);
if (dvb_adapter == NULL) { if (dvb_adapter == NULL) {
printk("%s: Error registering DVB adapter\n", __FUNCTION__); printk("%s: Error registering DVB adapter\n", __FUNCTION__);
...@@ -2342,6 +2342,8 @@ static struct pci_device_id skystar2_pci_tbl[] = { ...@@ -2342,6 +2342,8 @@ static struct pci_device_id skystar2_pci_tbl[] = {
{0,}, {0,},
}; };
MODULE_DEVICE_TABLE(pci, skystar2_pci_tbl);
static struct pci_driver skystar2_pci_driver = { static struct pci_driver skystar2_pci_driver = {
.name = "Technisat SkyStar2 driver", .name = "Technisat SkyStar2 driver",
.id_table = skystar2_pci_tbl, .id_table = skystar2_pci_tbl,
......
...@@ -286,7 +286,7 @@ static int __init dvb_bt8xx_load_card( struct dvb_bt8xx_card *card) ...@@ -286,7 +286,7 @@ static int __init dvb_bt8xx_load_card( struct dvb_bt8xx_card *card)
} }
if ((result = dvb_register_adapter(&card->dvb_adapter, card->card_name)) < 0) { if ((result = dvb_register_adapter(&card->dvb_adapter, card->card_name, THIS_MODULE)) < 0) {
printk("dvb_bt8xx: dvb_register_adapter failed (errno = %d)\n", result); printk("dvb_bt8xx: dvb_register_adapter failed (errno = %d)\n", result);
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
# #
dvb-core-objs = dvbdev.o dmxdev.o dvb_demux.o dvb_filter.o \ dvb-core-objs = dvbdev.o dmxdev.o dvb_demux.o dvb_filter.o \
dvb_functions.o dvb_frontend.o dvb_i2c.o dvb_net.o dvb_ksyms.o dvb_ringbuffer.o dvb_ca_en50221.o dvb_functions.o dvb_frontend.o \
dvb_i2c.o dvb_net.o dvb_ksyms.o dvb_ringbuffer.o
obj-$(CONFIG_DVB_CORE) += dvb-core.o obj-$(CONFIG_DVB_CORE) += dvb-core.o
This diff is collapsed.
/*
* dvb_ca.h: generic DVB functions for EN50221 CA interfaces
*
* Copyright (C) 2004 Andrew de Quincey
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2.1
* of the License, or (at your option) any later version.
*
* 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 Lesser General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef _DVB_CA_EN50221_H_
#define _DVB_CA_EN50221_H_
#include <linux/list.h>
#include <linux/dvb/ca.h>
#include "dvbdev.h"
#define DVB_CA_EN50221_POLL_CAM_PRESENT 1
#define DVB_CA_EN50221_POLL_CAM_CHANGED 2
#define DVB_CA_EN50221_POLL_CAM_READY 4
#define DVB_CA_EN50221_FLAG_IRQ_CAMCHANGE 1
#define DVB_CA_EN50221_FLAG_IRQ_FR 2
#define DVB_CA_EN50221_FLAG_IRQ_DA 4
#define DVB_CA_EN50221_CAMCHANGE_REMOVED 0
#define DVB_CA_EN50221_CAMCHANGE_INSERTED 1
/* Structure describing a CA interface */
struct dvb_ca_en50221 {
/* functions for accessing attribute memory on the CAM */
int (*read_attribute_mem)(struct dvb_ca_en50221* ca, int slot, int address);
int (*write_attribute_mem)(struct dvb_ca_en50221* ca, int slot, int address, u8 value);
/* functions for accessing the control interface on the CAM */
int (*read_cam_control)(struct dvb_ca_en50221* ca, int slot, u8 address);
int (*write_cam_control)(struct dvb_ca_en50221* ca, int slot, u8 address, u8 value);
/* Functions for controlling slots */
int (*slot_reset)(struct dvb_ca_en50221* ca, int slot);
int (*slot_shutdown)(struct dvb_ca_en50221* ca, int slot);
int (*slot_ts_enable)(struct dvb_ca_en50221* ca, int slot);
/*
* Poll slot status.
* Only necessary if DVB_CA_FLAG_EN50221_IRQ_CAMCHANGE is not set
*/
int (*poll_slot_status)(struct dvb_ca_en50221* ca, int slot);
/* private data, used by caller */
void* data;
/* Opaque data used by the dvb_ca core. Do not modify! */
void* private;
};
/* ******************************************************************************** */
/* Functions for reporting IRQ events */
/**
* A CAMCHANGE IRQ has occurred.
*
* @param ca CA instance.
* @param slot Slot concerned.
* @param change_type One of the DVB_CA_CAMCHANGE_* values
*/
void dvb_ca_en50221_camchange_irq(struct dvb_ca_en50221* pubca, int slot, int change_type);
/**
* A CAMREADY IRQ has occurred.
*
* @param ca CA instance.
* @param slot Slot concerned.
*/
void dvb_ca_en50221_camready_irq(struct dvb_ca_en50221* pubca, int slot);
/**
* An FR or a DA IRQ has occurred.
*
* @param ca CA instance.
* @param slot Slot concerned.
*/
void dvb_ca_en50221_frda_irq(struct dvb_ca_en50221* ca, int slot);
/* ******************************************************************************** */
/* Initialisation/shutdown functions */
/**
* Initialise a new DVB CA device.
*
* @param dvb_adapter DVB adapter to attach the new CA device to.
* @param ca The dvb_ca instance.
* @param flags Flags describing the CA device (DVB_CA_EN50221_FLAG_*).
* @param slot_count Number of slots supported.
*
* @return 0 on success, nonzero on failure
*/
extern int dvb_ca_en50221_init(struct dvb_adapter *dvb_adapter, struct dvb_ca_en50221* ca, int flags, int slot_count);
/**
* Release a DVB CA device.
*
* @param ca The associated dvb_ca instance.
*/
extern void dvb_ca_en50221_release(struct dvb_ca_en50221* ca);
#endif
...@@ -192,7 +192,6 @@ static inline int dvb_dmx_swfilter_section_feed (struct dvb_demux_feed *feed) ...@@ -192,7 +192,6 @@ static inline int dvb_dmx_swfilter_section_feed (struct dvb_demux_feed *feed)
struct dvb_demux *demux = feed->demux; struct dvb_demux *demux = feed->demux;
struct dvb_demux_filter *f = feed->filter; struct dvb_demux_filter *f = feed->filter;
struct dmx_section_feed *sec = &feed->feed.sec; struct dmx_section_feed *sec = &feed->feed.sec;
u8 *buf = sec->secbuf;
int section_syntax_indicator; int section_syntax_indicator;
if (!sec->is_filtering) if (!sec->is_filtering)
...@@ -215,8 +214,6 @@ static inline int dvb_dmx_swfilter_section_feed (struct dvb_demux_feed *feed) ...@@ -215,8 +214,6 @@ static inline int dvb_dmx_swfilter_section_feed (struct dvb_demux_feed *feed)
sec->seclen = 0; sec->seclen = 0;
memset(buf, 0, DVB_DEMUX_MASK_MAX);
return 0; return 0;
} }
......
This diff is collapsed.
...@@ -56,14 +56,25 @@ struct dvb_frontend { ...@@ -56,14 +56,25 @@ struct dvb_frontend {
void *data; /* can be used by hardware module... */ void *data; /* can be used by hardware module... */
}; };
struct dvb_frontend_tune_settings {
int min_delay_ms;
int step_size;
int max_drift;
struct dvb_frontend_parameters parameters;
};
/** /**
* private frontend command ioctl's. * private frontend command ioctl's.
* keep them in sync with the public ones defined in linux/dvb/frontend.h * keep them in sync with the public ones defined in linux/dvb/frontend.h
*
* FE_SLEEP. Ioctl used to put frontend into a low power mode.
* FE_INIT. Ioctl used to initialise the frontend.
* FE_GET_TUNE_SETTINGS. Get the frontend-specific tuning loop settings for the supplied set of parameters.
*/ */
#define FE_SLEEP _IO('v', 80) #define FE_SLEEP _IO('v', 80)
#define FE_INIT _IO('v', 81) #define FE_INIT _IO('v', 81)
#define FE_RESET _IO('v', 82) #define FE_GET_TUNE_SETTINGS _IOWR('v', 83, struct dvb_frontend_tune_settings)
extern int extern int
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
#include "dvb_frontend.h" #include "dvb_frontend.h"
#include "dvb_net.h" #include "dvb_net.h"
#include "dvb_filter.h" #include "dvb_filter.h"
#include "dvb_ca_en50221.h"
EXPORT_SYMBOL(dvb_dmxdev_init); EXPORT_SYMBOL(dvb_dmxdev_init);
EXPORT_SYMBOL(dvb_dmxdev_release); EXPORT_SYMBOL(dvb_dmxdev_release);
...@@ -49,3 +50,8 @@ EXPORT_SYMBOL(dvb_filter_pes2ts_init); ...@@ -49,3 +50,8 @@ EXPORT_SYMBOL(dvb_filter_pes2ts_init);
EXPORT_SYMBOL(dvb_filter_pes2ts); EXPORT_SYMBOL(dvb_filter_pes2ts);
EXPORT_SYMBOL(dvb_filter_get_ac3info); EXPORT_SYMBOL(dvb_filter_get_ac3info);
EXPORT_SYMBOL(dvb_ca_en50221_init);
EXPORT_SYMBOL(dvb_ca_en50221_release);
EXPORT_SYMBOL(dvb_ca_en50221_frda_irq);
EXPORT_SYMBOL(dvb_ca_en50221_camchange_irq);
EXPORT_SYMBOL(dvb_ca_en50221_camready_irq);
This diff is collapsed.
...@@ -3,9 +3,10 @@ ...@@ -3,9 +3,10 @@
* dvb_ringbuffer.c: ring buffer implementation for the dvb driver * dvb_ringbuffer.c: ring buffer implementation for the dvb driver
* *
* Copyright (C) 2003 Oliver Endriss * Copyright (C) 2003 Oliver Endriss
* Copyright (C) 2004 Andrew de Quincey
* *
* based on code originally found in av7110.c: * based on code originally found in av7110.c & dvb_ci.c:
* Copyright (C) 1999-2002 Ralph Metzler * Copyright (C) 1999-2003 Ralph Metzler
* & Marcus Metzler for convergence integrated media GmbH * & Marcus Metzler for convergence integrated media GmbH
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -24,6 +25,8 @@ ...@@ -24,6 +25,8 @@
*/ */
#define __KERNEL_SYSCALLS__
#include <linux/errno.h> #include <linux/errno.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/module.h> #include <linux/module.h>
...@@ -33,6 +36,8 @@ ...@@ -33,6 +36,8 @@
#include "dvb_ringbuffer.h" #include "dvb_ringbuffer.h"
#define PKT_READY 0
#define PKT_DISPOSED 1
void dvb_ringbuffer_init(struct dvb_ringbuffer *rbuf, void *data, size_t len) void dvb_ringbuffer_init(struct dvb_ringbuffer *rbuf, void *data, size_t len)
...@@ -158,6 +163,109 @@ ssize_t dvb_ringbuffer_write(struct dvb_ringbuffer *rbuf, const u8 *buf, ...@@ -158,6 +163,109 @@ ssize_t dvb_ringbuffer_write(struct dvb_ringbuffer *rbuf, const u8 *buf,
return len; return len;
} }
ssize_t dvb_ringbuffer_pkt_write(struct dvb_ringbuffer *rbuf, u8* buf, size_t len, int usermem)
{
int status;
ssize_t oldpwrite = rbuf->pwrite;
DVB_RINGBUFFER_WRITE_BYTE(rbuf, len >> 8);
DVB_RINGBUFFER_WRITE_BYTE(rbuf, len & 0xff);
DVB_RINGBUFFER_WRITE_BYTE(rbuf, PKT_READY);
status = dvb_ringbuffer_write(rbuf, buf, len, usermem);
if (status < 0) rbuf->pwrite = oldpwrite;
return status;
}
ssize_t dvb_ringbuffer_pkt_read(struct dvb_ringbuffer *rbuf, size_t idx,
int offset, u8* buf, size_t len, int usermem)
{
size_t todo;
size_t split;
size_t pktlen;
pktlen = rbuf->data[idx] << 8;
pktlen |= rbuf->data[(idx + 1) % rbuf->size];
if (offset > pktlen) return -EINVAL;
if ((offset + len) > pktlen) len = pktlen - offset;
idx = (idx + DVB_RINGBUFFER_PKTHDRSIZE + offset) % rbuf->size;
todo = len;
split = ((idx + len) > rbuf->size) ? rbuf->size - idx : 0;
if (split > 0) {
if (!usermem)
memcpy(buf, rbuf->data+idx, split);
else
if (copy_to_user(buf, rbuf->data+idx, split))
return -EFAULT;
buf += split;
todo -= split;
idx = 0;
}
if (!usermem)
memcpy(buf, rbuf->data+idx, todo);
else
if (copy_to_user(buf, rbuf->data+idx, todo))
return -EFAULT;
return len;
}
void dvb_ringbuffer_pkt_dispose(struct dvb_ringbuffer *rbuf, size_t idx)
{
size_t pktlen;
rbuf->data[(idx + 2) % rbuf->size] = PKT_DISPOSED;
// clean up disposed packets
while(dvb_ringbuffer_avail(rbuf) > DVB_RINGBUFFER_PKTHDRSIZE) {
if (DVB_RINGBUFFER_PEEK(rbuf, 2) == PKT_DISPOSED) {
pktlen = DVB_RINGBUFFER_PEEK(rbuf, 0) << 8;
pktlen |= DVB_RINGBUFFER_PEEK(rbuf, 1);
DVB_RINGBUFFER_SKIP(rbuf, pktlen + DVB_RINGBUFFER_PKTHDRSIZE);
} else {
// first packet is not disposed, so we stop cleaning now
break;
}
}
}
ssize_t dvb_ringbuffer_pkt_next(struct dvb_ringbuffer *rbuf, size_t idx, size_t* pktlen)
{
int consumed;
int curpktlen;
int curpktstatus;
if (idx == -1) {
idx = rbuf->pread;
} else {
curpktlen = rbuf->data[idx] << 8;
curpktlen |= rbuf->data[(idx + 1) % rbuf->size];
idx = (idx + curpktlen + DVB_RINGBUFFER_PKTHDRSIZE) % rbuf->size;
}
consumed = (idx - rbuf->pread) % rbuf->size;
while((dvb_ringbuffer_avail(rbuf) - consumed) > DVB_RINGBUFFER_PKTHDRSIZE) {
curpktlen = rbuf->data[idx] << 8;
curpktlen |= rbuf->data[(idx + 1) % rbuf->size];
curpktstatus = rbuf->data[(idx + 2) % rbuf->size];
if (curpktstatus == PKT_READY) {
*pktlen = curpktlen;
return idx;
}
consumed += curpktlen + DVB_RINGBUFFER_PKTHDRSIZE;
idx = (idx + curpktlen + DVB_RINGBUFFER_PKTHDRSIZE) % rbuf->size;
}
// no packets available
return -1;
}
EXPORT_SYMBOL(dvb_ringbuffer_init); EXPORT_SYMBOL(dvb_ringbuffer_init);
EXPORT_SYMBOL(dvb_ringbuffer_empty); EXPORT_SYMBOL(dvb_ringbuffer_empty);
...@@ -167,3 +275,7 @@ EXPORT_SYMBOL(dvb_ringbuffer_flush); ...@@ -167,3 +275,7 @@ EXPORT_SYMBOL(dvb_ringbuffer_flush);
EXPORT_SYMBOL(dvb_ringbuffer_flush_spinlock_wakeup); EXPORT_SYMBOL(dvb_ringbuffer_flush_spinlock_wakeup);
EXPORT_SYMBOL(dvb_ringbuffer_read); EXPORT_SYMBOL(dvb_ringbuffer_read);
EXPORT_SYMBOL(dvb_ringbuffer_write); EXPORT_SYMBOL(dvb_ringbuffer_write);
EXPORT_SYMBOL(dvb_ringbuffer_pkt_write);
EXPORT_SYMBOL(dvb_ringbuffer_pkt_read);
EXPORT_SYMBOL(dvb_ringbuffer_pkt_dispose);
EXPORT_SYMBOL(dvb_ringbuffer_pkt_next);
...@@ -3,9 +3,10 @@ ...@@ -3,9 +3,10 @@
* dvb_ringbuffer.h: ring buffer implementation for the dvb driver * dvb_ringbuffer.h: ring buffer implementation for the dvb driver
* *
* Copyright (C) 2003 Oliver Endriss * Copyright (C) 2003 Oliver Endriss
* Copyright (C) 2004 Andrew de Quincey
* *
* based on code originally found in av7110.c: * based on code originally found in av7110.c & dvb_ci.c:
* Copyright (C) 1999-2002 Ralph Metzler & Marcus Metzler * Copyright (C) 1999-2003 Ralph Metzler & Marcus Metzler
* for convergence integrated media GmbH * for convergence integrated media GmbH
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -39,6 +40,8 @@ struct dvb_ringbuffer { ...@@ -39,6 +40,8 @@ struct dvb_ringbuffer {
spinlock_t lock; spinlock_t lock;
}; };
#define DVB_RINGBUFFER_PKTHDRSIZE 3
/* /*
** Notes: ** Notes:
...@@ -120,4 +123,52 @@ extern ssize_t dvb_ringbuffer_read(struct dvb_ringbuffer *rbuf, u8 *buf, ...@@ -120,4 +123,52 @@ extern ssize_t dvb_ringbuffer_read(struct dvb_ringbuffer *rbuf, u8 *buf,
extern ssize_t dvb_ringbuffer_write(struct dvb_ringbuffer *rbuf, const u8 *buf, extern ssize_t dvb_ringbuffer_write(struct dvb_ringbuffer *rbuf, const u8 *buf,
size_t len, int usermem); size_t len, int usermem);
/**
* Write a packet into the ringbuffer.
*
* <rbuf> Ringbuffer to write to.
* <buf> Buffer to write.
* <len> Length of buffer (currently limited to 65535 bytes max).
* <usermem> Set to 1 if <buf> is in userspace.
* returns Number of bytes written, or -EFAULT, -ENOMEM, -EVINAL.
*/
extern ssize_t dvb_ringbuffer_pkt_write(struct dvb_ringbuffer *rbuf, u8* buf,
size_t len, int usermem);
/**
* Read from a packet in the ringbuffer. Note: unlike dvb_ringbuffer_read(), this
* does NOT update the read pointer in the ringbuffer. You must use
* dvb_ringbuffer_pkt_dispose() to mark a packet as no longer required.
*
* <rbuf> Ringbuffer concerned.
* <idx> Packet index as returned by dvb_ringbuffer_pkt_next().
* <offset> Offset into packet to read from.
* <buf> Destination buffer for data.
* <len> Size of destination buffer.
* <usermem> Set to 1 if <buf> is in userspace.
* returns Number of bytes read, or -EFAULT.
*/
extern ssize_t dvb_ringbuffer_pkt_read(struct dvb_ringbuffer *rbuf, size_t idx,
int offset, u8* buf, size_t len, int usermem);
/**
* Dispose of a packet in the ring buffer.
*
* <rbuf> Ring buffer concerned.
* <idx> Packet index as returned by dvb_ringbuffer_pkt_next().
*/
extern void dvb_ringbuffer_pkt_dispose(struct dvb_ringbuffer *rbuf, size_t idx);
/**
* Get the index of the next packet in a ringbuffer.
*
* <rbuf> Ringbuffer concerned.
* <idx> Previous packet index, or -1 to return the first packet index.
* <pktlen> On success, will be updated to contain the length of the packet in bytes.
* returns Packet index (if >=0), or -1 if no packets available.
*/
extern ssize_t dvb_ringbuffer_pkt_next(struct dvb_ringbuffer *rbuf, size_t idx, size_t* pktlen);
#endif /* _DVB_RINGBUFFER_H_ */ #endif /* _DVB_RINGBUFFER_H_ */
...@@ -211,6 +211,8 @@ int dvb_register_device(struct dvb_adapter *adap, struct dvb_device **pdvbdev, ...@@ -211,6 +211,8 @@ int dvb_register_device(struct dvb_adapter *adap, struct dvb_device **pdvbdev,
dvbdev->adapter = adap; dvbdev->adapter = adap;
dvbdev->priv = priv; dvbdev->priv = priv;
dvbdev->fops->owner = adap->module;
list_add_tail (&dvbdev->list_head, &adap->device_list); list_add_tail (&dvbdev->list_head, &adap->device_list);
devfs_mk_cdev(MKDEV(DVB_MAJOR, nums2minor(adap->num, type, id)), devfs_mk_cdev(MKDEV(DVB_MAJOR, nums2minor(adap->num, type, id)),
...@@ -227,13 +229,15 @@ int dvb_register_device(struct dvb_adapter *adap, struct dvb_device **pdvbdev, ...@@ -227,13 +229,15 @@ int dvb_register_device(struct dvb_adapter *adap, struct dvb_device **pdvbdev,
void dvb_unregister_device(struct dvb_device *dvbdev) void dvb_unregister_device(struct dvb_device *dvbdev)
{ {
if (dvbdev) { if (!dvbdev)
return;
devfs_remove("dvb/adapter%d/%s%d", dvbdev->adapter->num, devfs_remove("dvb/adapter%d/%s%d", dvbdev->adapter->num,
dnames[dvbdev->type], dvbdev->id); dnames[dvbdev->type], dvbdev->id);
list_del(&dvbdev->list_head); list_del(&dvbdev->list_head);
kfree(dvbdev); kfree(dvbdev);
} }
}
static int dvbdev_get_free_adapter_num (void) static int dvbdev_get_free_adapter_num (void)
...@@ -257,7 +261,7 @@ static int dvbdev_get_free_adapter_num (void) ...@@ -257,7 +261,7 @@ static int dvbdev_get_free_adapter_num (void)
} }
int dvb_register_adapter(struct dvb_adapter **padap, const char *name) int dvb_register_adapter(struct dvb_adapter **padap, const char *name, struct module *module)
{ {
struct dvb_adapter *adap; struct dvb_adapter *adap;
int num; int num;
...@@ -281,8 +285,10 @@ int dvb_register_adapter(struct dvb_adapter **padap, const char *name) ...@@ -281,8 +285,10 @@ int dvb_register_adapter(struct dvb_adapter **padap, const char *name)
printk ("DVB: registering new adapter (%s).\n", name); printk ("DVB: registering new adapter (%s).\n", name);
devfs_mk_dir("dvb/adapter%d", num); devfs_mk_dir("dvb/adapter%d", num);
adap->num = num; adap->num = num;
adap->name = name; adap->name = name;
adap->module = module;
list_add_tail (&adap->list_head, &dvb_adapter_list); list_add_tail (&adap->list_head, &dvb_adapter_list);
......
...@@ -48,6 +48,8 @@ struct dvb_adapter { ...@@ -48,6 +48,8 @@ struct dvb_adapter {
struct list_head device_list; struct list_head device_list;
const char *name; const char *name;
u8 proposed_mac [6]; u8 proposed_mac [6];
struct module *module;
}; };
...@@ -75,7 +77,7 @@ struct dvb_device { ...@@ -75,7 +77,7 @@ struct dvb_device {
}; };
extern int dvb_register_adapter (struct dvb_adapter **padap, const char *name); extern int dvb_register_adapter (struct dvb_adapter **padap, const char *name, struct module *module);
extern int dvb_unregister_adapter (struct dvb_adapter *adap); extern int dvb_unregister_adapter (struct dvb_adapter *adap);
extern int dvb_register_device (struct dvb_adapter *adap, extern int dvb_register_device (struct dvb_adapter *adap,
......
...@@ -29,11 +29,11 @@ ...@@ -29,11 +29,11 @@
*/ */
#define __KERNEL_SYSCALLS__
#include <linux/module.h> #include <linux/module.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/vmalloc.h> #include <linux/vmalloc.h>
#include <linux/fs.h> #include <linux/fs.h>
#include <linux/syscalls.h>
#include <linux/unistd.h> #include <linux/unistd.h>
#include <linux/delay.h> #include <linux/delay.h>
...@@ -56,6 +56,8 @@ static int debug = 0; ...@@ -56,6 +56,8 @@ static int debug = 0;
#define SP8870_FIRMWARE_OFFSET 0x0A #define SP8870_FIRMWARE_OFFSET 0x0A
static int errno;
static struct dvb_frontend_info tdlb7_info = { static struct dvb_frontend_info tdlb7_info = {
.name = "Alps TDLB7", .name = "Alps TDLB7",
.type = FE_OFDM, .type = FE_OFDM,
...@@ -74,12 +76,7 @@ static struct dvb_frontend_info tdlb7_info = { ...@@ -74,12 +76,7 @@ static struct dvb_frontend_info tdlb7_info = {
static int sp8870_writereg (struct dvb_i2c_bus *i2c, u16 reg, u16 data) static int sp8870_writereg (struct dvb_i2c_bus *i2c, u16 reg, u16 data)
{ {
u8 buf [] = { reg >> 8, reg & 0xff, data >> 8, data & 0xff }; u8 buf [] = { reg >> 8, reg & 0xff, data >> 8, data & 0xff };
struct i2c_msg msg = { struct i2c_msg msg = { .addr = 0x71, .flags = 0, .buf = buf, .len = 4 };
.addr = 0x71,
.flags = 0,
.buf = buf,
.len = 4
};
int err; int err;
if ((err = i2c->xfer (i2c, &msg, 1)) != 1) { if ((err = i2c->xfer (i2c, &msg, 1)) != 1) {
...@@ -96,20 +93,8 @@ static u16 sp8870_readreg (struct dvb_i2c_bus *i2c, u16 reg) ...@@ -96,20 +93,8 @@ static u16 sp8870_readreg (struct dvb_i2c_bus *i2c, u16 reg)
int ret; int ret;
u8 b0 [] = { reg >> 8 , reg & 0xff }; u8 b0 [] = { reg >> 8 , reg & 0xff };
u8 b1 [] = { 0, 0 }; u8 b1 [] = { 0, 0 };
struct i2c_msg msg [] = { struct i2c_msg msg [] = { { .addr = 0x71, .flags = 0, .buf = b0, .len = 2 },
{ { .addr = 0x71, .flags = I2C_M_RD, .buf = b1, .len = 2 } };
.addr = 0x71,
.flags = 0,
.buf = b0,
.len = 2
},
{
.addr = 0x71,
.flags = I2C_M_RD,
.buf = b1,
.len = 2
}
};
ret = i2c->xfer (i2c, msg, 2); ret = i2c->xfer (i2c, msg, 2);
...@@ -125,12 +110,7 @@ static u16 sp8870_readreg (struct dvb_i2c_bus *i2c, u16 reg) ...@@ -125,12 +110,7 @@ static u16 sp8870_readreg (struct dvb_i2c_bus *i2c, u16 reg)
static int sp5659_write (struct dvb_i2c_bus *i2c, u8 data [4]) static int sp5659_write (struct dvb_i2c_bus *i2c, u8 data [4])
{ {
int ret; int ret;
struct i2c_msg msg = { struct i2c_msg msg = { .addr = 0x60, .flags = 0, .buf = data, .len = 4 };
.addr = 0x60,
.flags = 0,
.buf = data,
.len =4
};
ret = i2c->xfer (i2c, &msg, 1); ret = i2c->xfer (i2c, &msg, 1);
...@@ -170,13 +150,13 @@ static int sp8870_read_firmware_file (const char *fn, char **fp) ...@@ -170,13 +150,13 @@ static int sp8870_read_firmware_file (const char *fn, char **fp)
loff_t filesize; loff_t filesize;
char *dp; char *dp;
fd = sys_open(fn, 0, 0); fd = open(fn, 0, 0);
if (fd == -1) { if (fd == -1) {
printk("%s: unable to open '%s'.\n", __FUNCTION__, fn); printk("%s: unable to open '%s'.\n", __FUNCTION__, fn);
return -EIO; return -EIO;
} }
filesize = sys_lseek(fd, 0L, 2); filesize = lseek(fd, 0L, 2);
if (filesize <= 0 || filesize < SP8870_FIRMWARE_OFFSET + SP8870_FIRMWARE_SIZE) { if (filesize <= 0 || filesize < SP8870_FIRMWARE_OFFSET + SP8870_FIRMWARE_SIZE) {
printk("%s: firmware filesize to small '%s'\n", __FUNCTION__, fn); printk("%s: firmware filesize to small '%s'\n", __FUNCTION__, fn);
sys_close(fd); sys_close(fd);
...@@ -190,8 +170,8 @@ static int sp8870_read_firmware_file (const char *fn, char **fp) ...@@ -190,8 +170,8 @@ static int sp8870_read_firmware_file (const char *fn, char **fp)
return -EIO; return -EIO;
} }
sys_lseek(fd, SP8870_FIRMWARE_OFFSET, 0); lseek(fd, SP8870_FIRMWARE_OFFSET, 0);
if (sys_read(fd, dp, SP8870_FIRMWARE_SIZE) != SP8870_FIRMWARE_SIZE) { if (read(fd, dp, SP8870_FIRMWARE_SIZE) != SP8870_FIRMWARE_SIZE) {
printk("%s: failed to read '%s'.\n",__FUNCTION__, fn); printk("%s: failed to read '%s'.\n",__FUNCTION__, fn);
vfree(dp); vfree(dp);
sys_close(fd); sys_close(fd);
...@@ -658,9 +638,6 @@ static int tdlb7_ioctl (struct dvb_frontend *fe, unsigned int cmd, void *arg) ...@@ -658,9 +638,6 @@ static int tdlb7_ioctl (struct dvb_frontend *fe, unsigned int cmd, void *arg)
case FE_SET_FRONTEND: case FE_SET_FRONTEND:
return sp8870_set_frontend(i2c, (struct dvb_frontend_parameters*) arg); return sp8870_set_frontend(i2c, (struct dvb_frontend_parameters*) arg);
case FE_RESET:
return -EOPNOTSUPP;
case FE_GET_FRONTEND: // FIXME: read known values back from Hardware... case FE_GET_FRONTEND: // FIXME: read known values back from Hardware...
return -EOPNOTSUPP; return -EOPNOTSUPP;
...@@ -675,6 +652,15 @@ static int tdlb7_ioctl (struct dvb_frontend *fe, unsigned int cmd, void *arg) ...@@ -675,6 +652,15 @@ static int tdlb7_ioctl (struct dvb_frontend *fe, unsigned int cmd, void *arg)
} }
break; break;
case FE_GET_TUNE_SETTINGS:
{
struct dvb_frontend_tune_settings* fesettings = (struct dvb_frontend_tune_settings*) arg;
fesettings->min_delay_ms = 150;
fesettings->step_size = 166667;
fesettings->max_drift = 166667*2;
return 0;
}
default: default:
return -EOPNOTSUPP; return -EOPNOTSUPP;
}; };
...@@ -687,21 +673,8 @@ static int tdlb7_attach (struct dvb_i2c_bus *i2c, void **data) ...@@ -687,21 +673,8 @@ static int tdlb7_attach (struct dvb_i2c_bus *i2c, void **data)
{ {
u8 b0 [] = { 0x02 , 0x00 }; u8 b0 [] = { 0x02 , 0x00 };
u8 b1 [] = { 0, 0 }; u8 b1 [] = { 0, 0 };
struct i2c_msg msg [] = struct i2c_msg msg [] = { { .addr = 0x71, .flags = 0, .buf = b0, .len = 2 },
{ { .addr = 0x71, .flags = I2C_M_RD, .buf = b1, .len = 2 } };
{
.addr = 0x71,
.flags = 0,
.buf = b0,
.len = 2
},
{
.addr = 0x71,
.flags = I2C_M_RD,
.buf = b1,
.len = 2
}
};
dprintk ("%s\n", __FUNCTION__); dprintk ("%s\n", __FUNCTION__);
......
...@@ -50,7 +50,7 @@ static struct dvb_frontend_info tdmb7_info = { ...@@ -50,7 +50,7 @@ static struct dvb_frontend_info tdmb7_info = {
.caps = FE_CAN_FEC_1_2 | FE_CAN_FEC_2_3 | FE_CAN_FEC_3_4 | .caps = FE_CAN_FEC_1_2 | FE_CAN_FEC_2_3 | FE_CAN_FEC_3_4 |
FE_CAN_FEC_5_6 | FE_CAN_FEC_7_8 | FE_CAN_FEC_AUTO | FE_CAN_FEC_5_6 | FE_CAN_FEC_7_8 | FE_CAN_FEC_AUTO |
FE_CAN_QPSK | FE_CAN_QAM_16 | FE_CAN_QAM_64 | FE_CAN_QPSK | FE_CAN_QAM_16 | FE_CAN_QAM_64 |
FE_CAN_CLEAN_SETUP | FE_CAN_RECOVER FE_CAN_RECOVER
}; };
...@@ -390,8 +390,14 @@ static int tdmb7_ioctl (struct dvb_frontend *fe, unsigned int cmd, void *arg) ...@@ -390,8 +390,14 @@ static int tdmb7_ioctl (struct dvb_frontend *fe, unsigned int cmd, void *arg)
case FE_INIT: case FE_INIT:
return cx22700_init (i2c); return cx22700_init (i2c);
case FE_RESET: case FE_GET_TUNE_SETTINGS:
break; {
struct dvb_frontend_tune_settings* fesettings = (struct dvb_frontend_tune_settings*) arg;
fesettings->min_delay_ms = 150;
fesettings->step_size = 166667;
fesettings->max_drift = 166667*2;
return 0;
}
default: default:
return -EOPNOTSUPP; return -EOPNOTSUPP;
......
...@@ -71,9 +71,7 @@ static struct dvb_frontend_info at76c651_info = { ...@@ -71,9 +71,7 @@ static struct dvb_frontend_info at76c651_info = {
FE_CAN_FEC_4_5 | FE_CAN_FEC_5_6 | FE_CAN_FEC_6_7 | FE_CAN_FEC_4_5 | FE_CAN_FEC_5_6 | FE_CAN_FEC_6_7 |
FE_CAN_FEC_7_8 | FE_CAN_FEC_8_9 | FE_CAN_FEC_AUTO | FE_CAN_FEC_7_8 | FE_CAN_FEC_8_9 | FE_CAN_FEC_AUTO |
FE_CAN_QAM_16 | FE_CAN_QAM_32 | FE_CAN_QAM_64 | FE_CAN_QAM_128 | FE_CAN_QAM_16 | FE_CAN_QAM_32 | FE_CAN_QAM_64 | FE_CAN_QAM_128 |
FE_CAN_QAM_256 /* | FE_CAN_QAM_512 | FE_CAN_QAM_1024 */ | FE_CAN_MUTE_TS | FE_CAN_QAM_256 | FE_CAN_RECOVER
FE_CAN_RECOVER | FE_CAN_CLEAN_SETUP | FE_CAN_MUTE_TS
}; };
#if ! defined(__powerpc__) #if ! defined(__powerpc__)
...@@ -361,6 +359,7 @@ static int at76c651_set_parameters(struct dvb_i2c_bus *i2c, ...@@ -361,6 +359,7 @@ static int at76c651_set_parameters(struct dvb_i2c_bus *i2c,
at76c651_set_symbolrate(i2c, p->u.qam.symbol_rate); at76c651_set_symbolrate(i2c, p->u.qam.symbol_rate);
at76c651_set_inversion(i2c, p->inversion); at76c651_set_inversion(i2c, p->inversion);
at76c651_set_auto_config(i2c); at76c651_set_auto_config(i2c);
at76c651_reset(i2c);
return 0; return 0;
...@@ -462,8 +461,14 @@ static int at76c651_ioctl(struct dvb_frontend *fe, unsigned int cmd, void *arg) ...@@ -462,8 +461,14 @@ static int at76c651_ioctl(struct dvb_frontend *fe, unsigned int cmd, void *arg)
case FE_INIT: case FE_INIT:
return at76c651_set_defaults(fe->i2c); return at76c651_set_defaults(fe->i2c);
case FE_RESET: case FE_GET_TUNE_SETTINGS:
return at76c651_reset(fe->i2c); {
struct dvb_frontend_tune_settings* fesettings = (struct dvb_frontend_tune_settings*) arg;
fesettings->min_delay_ms = 50;
fesettings->step_size = 0;
fesettings->max_drift = 0;
return 0;
}
default: default:
return -ENOIOCTLCMD; return -ENOIOCTLCMD;
......
...@@ -59,8 +59,7 @@ static struct dvb_frontend_info cx24110_info = { ...@@ -59,8 +59,7 @@ static struct dvb_frontend_info cx24110_info = {
.caps = FE_CAN_INVERSION_AUTO | .caps = FE_CAN_INVERSION_AUTO |
FE_CAN_FEC_1_2 | FE_CAN_FEC_2_3 | FE_CAN_FEC_3_4 | FE_CAN_FEC_1_2 | FE_CAN_FEC_2_3 | FE_CAN_FEC_3_4 |
FE_CAN_FEC_5_6 | FE_CAN_FEC_7_8 | FE_CAN_FEC_AUTO | FE_CAN_FEC_5_6 | FE_CAN_FEC_7_8 | FE_CAN_FEC_AUTO |
FE_CAN_QPSK | FE_CAN_QPSK | FE_CAN_RECOVER
FE_CAN_CLEAN_SETUP
}; };
/* fixme: are these values correct? especially ..._tolerance and caps */ /* fixme: are these values correct? especially ..._tolerance and caps */
...@@ -621,11 +620,6 @@ static int cx24110_ioctl (struct dvb_frontend *fe, unsigned int cmd, void *arg) ...@@ -621,11 +620,6 @@ static int cx24110_ioctl (struct dvb_frontend *fe, unsigned int cmd, void *arg)
case FE_INIT: case FE_INIT:
return cx24110_init (i2c); return cx24110_init (i2c);
case FE_RESET:
/* no idea what to do for this call */
/* fixme (medium): fill me in */
break;
case FE_SET_TONE: case FE_SET_TONE:
return cx24110_writereg(i2c,0x76,(cx24110_readreg(i2c,0x76)&~0x10)|((((fe_sec_tone_mode_t) arg)==SEC_TONE_ON)?0x10:0)); return cx24110_writereg(i2c,0x76,(cx24110_readreg(i2c,0x76)&~0x10)|((((fe_sec_tone_mode_t) arg)==SEC_TONE_ON)?0x10:0));
case FE_SET_VOLTAGE: case FE_SET_VOLTAGE:
......
...@@ -963,7 +963,6 @@ struct lkup { ...@@ -963,7 +963,6 @@ struct lkup {
{FE_GET_FRONTEND, "FE_GET_FRONTEND:" }, {FE_GET_FRONTEND, "FE_GET_FRONTEND:" },
{FE_SLEEP, "FE_SLEEP:" }, {FE_SLEEP, "FE_SLEEP:" },
{FE_INIT, "FE_INIT:" }, {FE_INIT, "FE_INIT:" },
{FE_RESET, "FE_RESET:" },
{FE_SET_TONE, "FE_SET_TONE:" }, {FE_SET_TONE, "FE_SET_TONE:" },
{FE_SET_VOLTAGE, "FE_SET_VOLTAGE:" }, {FE_SET_VOLTAGE, "FE_SET_VOLTAGE:" },
}; };
...@@ -1091,9 +1090,6 @@ static int dst_ioctl (struct dvb_frontend *fe, unsigned int cmd, void *arg) ...@@ -1091,9 +1090,6 @@ static int dst_ioctl (struct dvb_frontend *fe, unsigned int cmd, void *arg)
dst_init(dst); dst_init(dst);
break; break;
case FE_RESET:
break;
case FE_DISEQC_SEND_MASTER_CMD: case FE_DISEQC_SEND_MASTER_CMD:
{ {
struct dvb_diseqc_master_cmd *cmd = (struct dvb_diseqc_master_cmd *)arg; struct dvb_diseqc_master_cmd *cmd = (struct dvb_diseqc_master_cmd *)arg;
...@@ -1149,8 +1145,8 @@ static int dst_attach (struct dvb_i2c_bus *i2c, void **data) ...@@ -1149,8 +1145,8 @@ static int dst_attach (struct dvb_i2c_bus *i2c, void **data)
} }
dst_init (dst); dst_init (dst);
dprintk("%s: register dst %p bt %p i2c %p\n", __FUNCTION__, dprintk("%s: register dst %8.8x bt %8.8x i2c %8.8x\n", __FUNCTION__,
dst, dst->bt, dst->i2c); (u32)dst, (u32)(dst->bt), (u32)(dst->i2c));
info = &dst_info_sat; info = &dst_info_sat;
if (dst->dst_type == DST_TYPE_IS_TERR) if (dst->dst_type == DST_TYPE_IS_TERR)
...@@ -1166,7 +1162,7 @@ static int dst_attach (struct dvb_i2c_bus *i2c, void **data) ...@@ -1166,7 +1162,7 @@ static int dst_attach (struct dvb_i2c_bus *i2c, void **data)
static void dst_detach (struct dvb_i2c_bus *i2c, void *data) static void dst_detach (struct dvb_i2c_bus *i2c, void *data)
{ {
dvb_unregister_frontend (dst_ioctl, i2c); dvb_unregister_frontend (dst_ioctl, i2c);
dprintk("%s: unregister dst %p\n", __FUNCTION__, data); dprintk("%s: unregister dst %8.8x\n", __FUNCTION__, (u32)(data));
if (data) if (data)
kfree(data); kfree(data);
} }
......
...@@ -62,8 +62,7 @@ static struct dvb_frontend_info dvb_c_dummyfe_info = { ...@@ -62,8 +62,7 @@ static struct dvb_frontend_info dvb_c_dummyfe_info = {
#endif #endif
.caps = FE_CAN_QAM_16 | FE_CAN_QAM_32 | FE_CAN_QAM_64 | .caps = FE_CAN_QAM_16 | FE_CAN_QAM_32 | FE_CAN_QAM_64 |
FE_CAN_QAM_128 | FE_CAN_QAM_256 | FE_CAN_QAM_128 | FE_CAN_QAM_256 |
FE_CAN_FEC_AUTO | FE_CAN_INVERSION_AUTO | FE_CAN_FEC_AUTO | FE_CAN_INVERSION_AUTO
FE_CAN_CLEAN_SETUP
}; };
static struct dvb_frontend_info dvb_t_dummyfe_info = { static struct dvb_frontend_info dvb_t_dummyfe_info = {
...@@ -157,9 +156,6 @@ static int dvbdummyfe_ioctl (struct dvb_frontend *fe, unsigned int cmd, void *ar ...@@ -157,9 +156,6 @@ static int dvbdummyfe_ioctl (struct dvb_frontend *fe, unsigned int cmd, void *ar
case FE_INIT: case FE_INIT:
return 0; return 0;
case FE_RESET:
return 0;
case FE_SET_TONE: case FE_SET_TONE:
return -EOPNOTSUPP; return -EOPNOTSUPP;
......
...@@ -35,6 +35,9 @@ static int debug = 0; ...@@ -35,6 +35,9 @@ static int debug = 0;
#define dprintk if (debug) printk #define dprintk if (debug) printk
struct grundig_state {
int first:1;
};
struct dvb_frontend_info grundig_29504_401_info = { struct dvb_frontend_info grundig_29504_401_info = {
.name = "Grundig 29504-401", .name = "Grundig 29504-401",
...@@ -48,7 +51,7 @@ struct dvb_frontend_info grundig_29504_401_info = { ...@@ -48,7 +51,7 @@ struct dvb_frontend_info grundig_29504_401_info = {
.caps = FE_CAN_FEC_1_2 | FE_CAN_FEC_2_3 | FE_CAN_FEC_3_4 | .caps = FE_CAN_FEC_1_2 | FE_CAN_FEC_2_3 | FE_CAN_FEC_3_4 |
FE_CAN_FEC_5_6 | FE_CAN_FEC_7_8 | FE_CAN_FEC_5_6 | FE_CAN_FEC_7_8 |
FE_CAN_QPSK | FE_CAN_QAM_16 | FE_CAN_QAM_64 | FE_CAN_QPSK | FE_CAN_QAM_16 | FE_CAN_QAM_64 |
FE_CAN_MUTE_TS /*| FE_CAN_CLEAN_SETUP*/ FE_CAN_MUTE_TS
}; };
...@@ -102,6 +105,7 @@ static int tsa5060_write (struct dvb_i2c_bus *i2c, u8 data [4]) ...@@ -102,6 +105,7 @@ static int tsa5060_write (struct dvb_i2c_bus *i2c, u8 data [4])
*/ */
static int tsa5060_set_tv_freq (struct dvb_i2c_bus *i2c, u32 freq) static int tsa5060_set_tv_freq (struct dvb_i2c_bus *i2c, u32 freq)
{ {
#if 1
u32 div; u32 div;
u8 buf [4]; u8 buf [4];
u8 cfg, cpump, band_select; u8 cfg, cpump, band_select;
...@@ -118,6 +122,20 @@ static int tsa5060_set_tv_freq (struct dvb_i2c_bus *i2c, u32 freq) ...@@ -118,6 +122,20 @@ static int tsa5060_set_tv_freq (struct dvb_i2c_bus *i2c, u32 freq)
buf [1] = div & 0xff; buf [1] = div & 0xff;
buf [2] = ((div >> 10) & 0x60) | cfg; buf [2] = ((div >> 10) & 0x60) | cfg;
buf [3] = (cpump << 6) | band_select; buf [3] = (cpump << 6) | band_select;
#else
/* old code which seems to work better for at least one person */
u32 div;
u8 buf [4];
u8 cfg;
div = (36000000 + freq) / 166666;
cfg = 0x88;
buf [0] = (div >> 8) & 0x7f;
buf [1] = div & 0xff;
buf [2] = ((div >> 10) & 0x60) | cfg;
buf [3] = 0xc0;
#endif
return tsa5060_write (i2c, buf); return tsa5060_write (i2c, buf);
} }
...@@ -276,6 +294,123 @@ static int reset_and_configure (struct dvb_i2c_bus *i2c) ...@@ -276,6 +294,123 @@ static int reset_and_configure (struct dvb_i2c_bus *i2c)
} }
static int get_frontend(struct dvb_i2c_bus* i2c, struct dvb_frontend_parameters* param)
{
int tmp;
tmp = l64781_readreg(i2c, 0x04);
switch(tmp & 3) {
case 0:
param->u.ofdm.guard_interval = GUARD_INTERVAL_1_32;
break;
case 1:
param->u.ofdm.guard_interval = GUARD_INTERVAL_1_16;
break;
case 2:
param->u.ofdm.guard_interval = GUARD_INTERVAL_1_8;
break;
case 3:
param->u.ofdm.guard_interval = GUARD_INTERVAL_1_4;
break;
}
switch((tmp >> 2) & 3) {
case 0:
param->u.ofdm.transmission_mode = TRANSMISSION_MODE_2K;
break;
case 1:
param->u.ofdm.transmission_mode = TRANSMISSION_MODE_8K;
break;
default:
printk("Unexpected value for transmission_mode\n");
}
tmp = l64781_readreg(i2c, 0x05);
switch(tmp & 7) {
case 0:
param->u.ofdm.code_rate_HP = FEC_1_2;
break;
case 1:
param->u.ofdm.code_rate_HP = FEC_2_3;
break;
case 2:
param->u.ofdm.code_rate_HP = FEC_3_4;
break;
case 3:
param->u.ofdm.code_rate_HP = FEC_5_6;
break;
case 4:
param->u.ofdm.code_rate_HP = FEC_7_8;
break;
default:
printk("Unexpected value for code_rate_HP\n");
}
switch((tmp >> 3) & 7) {
case 0:
param->u.ofdm.code_rate_LP = FEC_1_2;
break;
case 1:
param->u.ofdm.code_rate_LP = FEC_2_3;
break;
case 2:
param->u.ofdm.code_rate_LP = FEC_3_4;
break;
case 3:
param->u.ofdm.code_rate_LP = FEC_5_6;
break;
case 4:
param->u.ofdm.code_rate_LP = FEC_7_8;
break;
default:
printk("Unexpected value for code_rate_LP\n");
}
tmp = l64781_readreg(i2c, 0x06);
switch(tmp & 3) {
case 0:
param->u.ofdm.constellation = QPSK;
break;
case 1:
param->u.ofdm.constellation = QAM_16;
break;
case 2:
param->u.ofdm.constellation = QAM_64;
break;
default:
printk("Unexpected value for constellation\n");
}
switch((tmp >> 2) & 7) {
case 0:
param->u.ofdm.hierarchy_information = HIERARCHY_NONE;
break;
case 1:
param->u.ofdm.hierarchy_information = HIERARCHY_1;
break;
case 2:
param->u.ofdm.hierarchy_information = HIERARCHY_2;
break;
case 3:
param->u.ofdm.hierarchy_information = HIERARCHY_4;
break;
default:
printk("Unexpected value for hierarchy\n");
}
tmp = l64781_readreg (i2c, 0x1d);
param->inversion = (tmp & 0x80) ? INVERSION_ON : INVERSION_OFF;
tmp = (int) (l64781_readreg (i2c, 0x08) |
(l64781_readreg (i2c, 0x09) << 8) |
(l64781_readreg (i2c, 0x0a) << 16));
param->frequency += tmp;
return 0;
}
static int init (struct dvb_i2c_bus *i2c) static int init (struct dvb_i2c_bus *i2c)
{ {
...@@ -318,6 +453,9 @@ int grundig_29504_401_ioctl (struct dvb_frontend *fe, ...@@ -318,6 +453,9 @@ int grundig_29504_401_ioctl (struct dvb_frontend *fe,
unsigned int cmd, void *arg) unsigned int cmd, void *arg)
{ {
struct dvb_i2c_bus *i2c = fe->i2c; struct dvb_i2c_bus *i2c = fe->i2c;
int res;
struct grundig_state* state = (struct grundig_state*) fe->data;
switch (cmd) { switch (cmd) {
case FE_GET_INFO: case FE_GET_INFO:
memcpy (arg, &grundig_29504_401_info, memcpy (arg, &grundig_29504_401_info,
...@@ -393,18 +531,33 @@ int grundig_29504_401_ioctl (struct dvb_frontend *fe, ...@@ -393,18 +531,33 @@ int grundig_29504_401_ioctl (struct dvb_frontend *fe,
tsa5060_set_tv_freq (i2c, p->frequency); tsa5060_set_tv_freq (i2c, p->frequency);
return apply_frontend_param (i2c, p); return apply_frontend_param (i2c, p);
} }
case FE_GET_FRONTEND: case FE_GET_FRONTEND:
/* we could correct the frequency here, but... {
* (...do you want to implement this?;) struct dvb_frontend_parameters *p = arg;
*/ return get_frontend(i2c, p);
return 0; }
case FE_SLEEP: case FE_SLEEP:
/* Power down */ /* Power down */
return l64781_writereg (i2c, 0x3e, 0x5a); return l64781_writereg (i2c, 0x3e, 0x5a);
case FE_INIT: case FE_INIT:
return init (i2c); res = init (i2c);
if ((res == 0) && (state->first)) {
state->first = 0;
dvb_delay(200);
}
return res;
case FE_GET_TUNE_SETTINGS:
{
struct dvb_frontend_tune_settings* fesettings = (struct dvb_frontend_tune_settings*) arg;
fesettings->min_delay_ms = 200;
fesettings->step_size = 166667;
fesettings->max_drift = 166667*2;
return 0;
}
default: default:
dprintk ("%s: unknown command !!!\n", __FUNCTION__); dprintk ("%s: unknown command !!!\n", __FUNCTION__);
...@@ -422,6 +575,7 @@ static int l64781_attach (struct dvb_i2c_bus *i2c, void **data) ...@@ -422,6 +575,7 @@ static int l64781_attach (struct dvb_i2c_bus *i2c, void **data)
u8 b1 [] = { 0x00 }; u8 b1 [] = { 0x00 };
struct i2c_msg msg [] = { { .addr = 0x55, .flags = 0, .buf = b0, .len = 1 }, struct i2c_msg msg [] = { { .addr = 0x55, .flags = 0, .buf = b0, .len = 1 },
{ .addr = 0x55, .flags = I2C_M_RD, .buf = b1, .len = 1 } }; { .addr = 0x55, .flags = I2C_M_RD, .buf = b1, .len = 1 } };
struct grundig_state* state;
/** /**
* the L64781 won't show up before we send the reset_and_configure() * the L64781 won't show up before we send the reset_and_configure()
...@@ -465,7 +619,12 @@ static int l64781_attach (struct dvb_i2c_bus *i2c, void **data) ...@@ -465,7 +619,12 @@ static int l64781_attach (struct dvb_i2c_bus *i2c, void **data)
goto bailout; goto bailout;
} }
return dvb_register_frontend (grundig_29504_401_ioctl, i2c, NULL, state = kmalloc(sizeof(struct grundig_state), GFP_KERNEL);
if (state == NULL) goto bailout;
*data = state;
state->first = 1;
return dvb_register_frontend (grundig_29504_401_ioctl, i2c, state,
&grundig_29504_401_info); &grundig_29504_401_info);
bailout: bailout:
...@@ -477,6 +636,7 @@ static int l64781_attach (struct dvb_i2c_bus *i2c, void **data) ...@@ -477,6 +636,7 @@ static int l64781_attach (struct dvb_i2c_bus *i2c, void **data)
static void l64781_detach (struct dvb_i2c_bus *i2c, void *data) static void l64781_detach (struct dvb_i2c_bus *i2c, void *data)
{ {
kfree(data);
dvb_unregister_frontend (grundig_29504_401_ioctl, i2c); dvb_unregister_frontend (grundig_29504_401_ioctl, i2c);
} }
......
...@@ -52,8 +52,7 @@ static struct dvb_frontend_info grundig_29504_491_info = { ...@@ -52,8 +52,7 @@ static struct dvb_frontend_info grundig_29504_491_info = {
FE_CAN_FEC_1_2 | FE_CAN_FEC_2_3 | FE_CAN_FEC_3_4 | FE_CAN_FEC_1_2 | FE_CAN_FEC_2_3 | FE_CAN_FEC_3_4 |
FE_CAN_FEC_4_5 | FE_CAN_FEC_5_6 | FE_CAN_FEC_6_7 | FE_CAN_FEC_4_5 | FE_CAN_FEC_5_6 | FE_CAN_FEC_6_7 |
FE_CAN_FEC_7_8 | FE_CAN_FEC_8_9 | FE_CAN_FEC_AUTO | FE_CAN_FEC_7_8 | FE_CAN_FEC_8_9 | FE_CAN_FEC_AUTO |
FE_CAN_QPSK | FE_CAN_QPSK | FE_CAN_MUTE_TS
FE_CAN_MUTE_TS | FE_CAN_CLEAN_SETUP
}; };
...@@ -398,11 +397,6 @@ static int grundig_29504_491_ioctl (struct dvb_frontend *fe, unsigned int cmd, ...@@ -398,11 +397,6 @@ static int grundig_29504_491_ioctl (struct dvb_frontend *fe, unsigned int cmd,
tda8083_writereg (i2c, 0x00, 0x04); tda8083_writereg (i2c, 0x00, 0x04);
break; break;
case FE_RESET:
tda8083_writereg (i2c, 0x00, 0x3c);
tda8083_writereg (i2c, 0x00, 0x04);
break;
case FE_DISEQC_SEND_MASTER_CMD: case FE_DISEQC_SEND_MASTER_CMD:
return tda8083_send_diseqc_msg (i2c, arg); return tda8083_send_diseqc_msg (i2c, arg);
......
...@@ -66,8 +66,8 @@ static struct dvb_frontend_info mt312_info = { ...@@ -66,8 +66,8 @@ static struct dvb_frontend_info mt312_info = {
.caps = .caps =
FE_CAN_INVERSION_AUTO | FE_CAN_FEC_1_2 | FE_CAN_FEC_2_3 | FE_CAN_INVERSION_AUTO | FE_CAN_FEC_1_2 | FE_CAN_FEC_2_3 |
FE_CAN_FEC_3_4 | FE_CAN_FEC_5_6 | FE_CAN_FEC_7_8 | FE_CAN_FEC_3_4 | FE_CAN_FEC_5_6 | FE_CAN_FEC_7_8 |
FE_CAN_FEC_AUTO | FE_CAN_QPSK | FE_CAN_RECOVER | FE_CAN_FEC_AUTO | FE_CAN_QPSK | FE_CAN_MUTE_TS |
FE_CAN_CLEAN_SETUP | FE_CAN_MUTE_TS FE_CAN_RECOVER
}; };
static int mt312_read(struct dvb_i2c_bus *i2c, static int mt312_read(struct dvb_i2c_bus *i2c,
...@@ -570,6 +570,8 @@ static int mt312_set_frontend(struct dvb_i2c_bus *i2c, ...@@ -570,6 +570,8 @@ static int mt312_set_frontend(struct dvb_i2c_bus *i2c,
if ((ret = mt312_write(i2c, SYM_RATE_H, buf, sizeof(buf))) < 0) if ((ret = mt312_write(i2c, SYM_RATE_H, buf, sizeof(buf))) < 0)
return ret; return ret;
mt312_reset(i2c, 0);
return 0; return 0;
} }
...@@ -756,8 +758,14 @@ static int mt312_ioctl(struct dvb_frontend *fe, unsigned int cmd, void *arg) ...@@ -756,8 +758,14 @@ static int mt312_ioctl(struct dvb_frontend *fe, unsigned int cmd, void *arg)
else else
return mt312_init(i2c, (long) fe->data, (u8) 60); return mt312_init(i2c, (long) fe->data, (u8) 60);
case FE_RESET: case FE_GET_TUNE_SETTINGS:
return mt312_reset(i2c, 0); {
struct dvb_frontend_tune_settings* fesettings = (struct dvb_frontend_tune_settings*) arg;
fesettings->min_delay_ms = 50;
fesettings->step_size = 0;
fesettings->max_drift = 0;
return 0;
}
default: default:
return -ENOIOCTLCMD; return -ENOIOCTLCMD;
......
...@@ -55,7 +55,12 @@ static struct dvb_frontend_info nxt6000_info = { ...@@ -55,7 +55,12 @@ static struct dvb_frontend_info nxt6000_info = {
.symbol_rate_max = 9360000, /* FIXME */ .symbol_rate_max = 9360000, /* FIXME */
.symbol_rate_tolerance = 4000, .symbol_rate_tolerance = 4000,
.notifier_delay = 0, .notifier_delay = 0,
.caps = FE_CAN_FEC_1_2 | FE_CAN_FEC_2_3 | FE_CAN_FEC_3_4 | FE_CAN_FEC_4_5 | FE_CAN_FEC_5_6 | FE_CAN_FEC_6_7 | FE_CAN_FEC_7_8 | FE_CAN_FEC_8_9 | FE_CAN_FEC_AUTO | FE_CAN_QAM_16 | FE_CAN_QAM_64 | FE_CAN_QAM_AUTO | FE_CAN_TRANSMISSION_MODE_AUTO | FE_CAN_GUARD_INTERVAL_AUTO | FE_CAN_HIERARCHY_AUTO, .caps = FE_CAN_FEC_1_2 | FE_CAN_FEC_2_3 | FE_CAN_FEC_3_4 |
FE_CAN_FEC_4_5 | FE_CAN_FEC_5_6 | FE_CAN_FEC_6_7 |
FE_CAN_FEC_7_8 | FE_CAN_FEC_8_9 | FE_CAN_FEC_AUTO |
FE_CAN_QAM_16 | FE_CAN_QAM_64 | FE_CAN_QAM_AUTO |
FE_CAN_TRANSMISSION_MODE_AUTO | FE_CAN_GUARD_INTERVAL_AUTO |
FE_CAN_HIERARCHY_AUTO,
}; };
struct nxt6000_config { struct nxt6000_config {
...@@ -762,9 +767,6 @@ static int nxt6000_ioctl(struct dvb_frontend *fe, unsigned int cmd, void *arg) ...@@ -762,9 +767,6 @@ static int nxt6000_ioctl(struct dvb_frontend *fe, unsigned int cmd, void *arg)
nxt6000_setup(fe); nxt6000_setup(fe);
break; break;
case FE_RESET:
break;
case FE_SET_FRONTEND: case FE_SET_FRONTEND:
{ {
struct nxt6000_config *nxt = FE2NXT(fe); struct nxt6000_config *nxt = FE2NXT(fe);
......
...@@ -12,13 +12,13 @@ ...@@ -12,13 +12,13 @@
next 0x4000 loaded. This may change in future versions. next 0x4000 loaded. This may change in future versions.
*/ */
#define __KERNEL_SYSCALLS__
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/vmalloc.h> #include <linux/vmalloc.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/string.h> #include <linux/string.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/syscalls.h>
#include <linux/fs.h> #include <linux/fs.h>
#include <linux/unistd.h> #include <linux/unistd.h>
#include <linux/fcntl.h> #include <linux/fcntl.h>
...@@ -64,19 +64,17 @@ struct dvb_frontend_info sp887x_info = { ...@@ -64,19 +64,17 @@ struct dvb_frontend_info sp887x_info = {
.frequency_stepsize = 166666, .frequency_stepsize = 166666,
.caps = FE_CAN_FEC_1_2 | FE_CAN_FEC_2_3 | FE_CAN_FEC_3_4 | .caps = FE_CAN_FEC_1_2 | FE_CAN_FEC_2_3 | FE_CAN_FEC_3_4 |
FE_CAN_FEC_5_6 | FE_CAN_FEC_7_8 | FE_CAN_FEC_AUTO | FE_CAN_FEC_5_6 | FE_CAN_FEC_7_8 | FE_CAN_FEC_AUTO |
FE_CAN_QPSK | FE_CAN_QAM_16 | FE_CAN_QAM_64 | FE_CAN_RECOVER FE_CAN_QPSK | FE_CAN_QAM_16 | FE_CAN_QAM_64 |
FE_CAN_RECOVER
}; };
static int errno;
static static
int i2c_writebytes (struct dvb_frontend *fe, u8 addr, u8 *buf, u8 len) int i2c_writebytes (struct dvb_frontend *fe, u8 addr, u8 *buf, u8 len)
{ {
struct dvb_i2c_bus *i2c = fe->i2c; struct dvb_i2c_bus *i2c = fe->i2c;
struct i2c_msg msg = { struct i2c_msg msg = { .addr = addr, .flags = 0, .buf = buf, .len = len };
.addr = addr,
.flags = 0,
.buf = buf,
.len = len
};
int err; int err;
LOG("i2c_writebytes", msg.addr, msg.buf, msg.len); LOG("i2c_writebytes", msg.addr, msg.buf, msg.len);
...@@ -213,13 +211,13 @@ int sp887x_initial_setup (struct dvb_frontend *fe) ...@@ -213,13 +211,13 @@ int sp887x_initial_setup (struct dvb_frontend *fe)
// Load the firmware // Load the firmware
set_fs(get_ds()); set_fs(get_ds());
fd = sys_open(sp887x_firmware, 0, 0); fd = open(sp887x_firmware, 0, 0);
if (fd < 0) { if (fd < 0) {
printk(KERN_WARNING "%s: Unable to open firmware %s\n", __FUNCTION__, printk(KERN_WARNING "%s: Unable to open firmware %s\n", __FUNCTION__,
sp887x_firmware); sp887x_firmware);
return -EIO; return -EIO;
} }
filesize = sys_lseek(fd, 0L, 2); filesize = lseek(fd, 0L, 2);
if (filesize <= 0) { if (filesize <= 0) {
printk(KERN_WARNING "%s: Firmware %s is empty\n", __FUNCTION__, printk(KERN_WARNING "%s: Firmware %s is empty\n", __FUNCTION__,
sp887x_firmware); sp887x_firmware);
...@@ -241,8 +239,8 @@ int sp887x_initial_setup (struct dvb_frontend *fe) ...@@ -241,8 +239,8 @@ int sp887x_initial_setup (struct dvb_frontend *fe)
// read it! // read it!
// read the first 16384 bytes from the file // read the first 16384 bytes from the file
// ignore the first 10 bytes // ignore the first 10 bytes
sys_lseek(fd, 10, 0); lseek(fd, 10, 0);
if (sys_read(fd, firmware, fw_size) != fw_size) { if (read(fd, firmware, fw_size) != fw_size) {
printk(KERN_WARNING "%s: Failed to read firmware\n", __FUNCTION__); printk(KERN_WARNING "%s: Failed to read firmware\n", __FUNCTION__);
vfree(firmware); vfree(firmware);
sys_close(fd); sys_close(fd);
...@@ -635,6 +633,15 @@ int sp887x_ioctl (struct dvb_frontend *fe, unsigned int cmd, void *arg) ...@@ -635,6 +633,15 @@ int sp887x_ioctl (struct dvb_frontend *fe, unsigned int cmd, void *arg)
sp887x_writereg(fe, 0xc18, 0x00d); sp887x_writereg(fe, 0xc18, 0x00d);
break; break;
case FE_GET_TUNE_SETTINGS:
{
struct dvb_frontend_tune_settings* fesettings = (struct dvb_frontend_tune_settings*) arg;
fesettings->min_delay_ms = 50;
fesettings->step_size = 0;
fesettings->max_drift = 0;
return 0;
}
default: default:
return -EOPNOTSUPP; return -EOPNOTSUPP;
}; };
...@@ -647,12 +654,7 @@ int sp887x_ioctl (struct dvb_frontend *fe, unsigned int cmd, void *arg) ...@@ -647,12 +654,7 @@ int sp887x_ioctl (struct dvb_frontend *fe, unsigned int cmd, void *arg)
static static
int sp887x_attach (struct dvb_i2c_bus *i2c, void **data) int sp887x_attach (struct dvb_i2c_bus *i2c, void **data)
{ {
struct i2c_msg msg = { struct i2c_msg msg = {.addr = 0x70, .flags = 0, .buf = NULL, .len = 0 };
.addr = 0x70,
.flags = 0,
.buf = NULL,
.len = 0
};
dprintk ("%s\n", __FUNCTION__); dprintk ("%s\n", __FUNCTION__);
......
This diff is collapsed.
This diff is collapsed.
...@@ -111,8 +111,7 @@ static struct dvb_frontend_info ves1820_info = { ...@@ -111,8 +111,7 @@ static struct dvb_frontend_info ves1820_info = {
#endif #endif
.caps = FE_CAN_QAM_16 | FE_CAN_QAM_32 | FE_CAN_QAM_64 | .caps = FE_CAN_QAM_16 | FE_CAN_QAM_32 | FE_CAN_QAM_64 |
FE_CAN_QAM_128 | FE_CAN_QAM_256 | FE_CAN_QAM_128 | FE_CAN_QAM_256 |
FE_CAN_FEC_AUTO | FE_CAN_INVERSION_AUTO | FE_CAN_FEC_AUTO | FE_CAN_INVERSION_AUTO,
FE_CAN_CLEAN_SETUP | FE_CAN_RECOVER
}; };
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -46,10 +46,15 @@ struct budget { ...@@ -46,10 +46,15 @@ struct budget {
int fe_synced; int fe_synced;
struct semaphore pid_mutex; struct semaphore pid_mutex;
int ci_present;
int video_port;
u8 tsf; u8 tsf;
u32 ttbp; u32 ttbp;
int feeding; int feeding;
spinlock_t feedlock;
struct dvb_adapter *dvb_adapter; struct dvb_adapter *dvb_adapter;
void *priv; void *priv;
}; };
...@@ -73,13 +78,17 @@ static struct saa7146_pci_extension_data x_var = { \ ...@@ -73,13 +78,17 @@ static struct saa7146_pci_extension_data x_var = { \
#define BUDGET_TT_HW_DISEQC 1 #define BUDGET_TT_HW_DISEQC 1
#define BUDGET_KNC1 2 #define BUDGET_KNC1 2
#define BUDGET_PATCH 3 #define BUDGET_PATCH 3
#define BUDGET_FS_ACTIVY 4
#define BUDGET_VIDEO_PORTA 0
#define BUDGET_VIDEO_PORTB 1
extern int ttpci_budget_init (struct budget *budget, extern int ttpci_budget_init (struct budget *budget,
struct saa7146_dev* dev, struct saa7146_dev* dev,
struct saa7146_pci_extension_data *info); struct saa7146_pci_extension_data *info);
extern int ttpci_budget_deinit (struct budget *budget); extern int ttpci_budget_deinit (struct budget *budget);
extern void ttpci_budget_irq10_handler (struct saa7146_dev* dev, u32 *isr); extern void ttpci_budget_irq10_handler (struct saa7146_dev* dev, u32 *isr);
extern void ttpci_budget_set_video_port(struct saa7146_dev* dev, int video_port);
#endif #endif
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment