Commit 205fbfe0 authored by Alan Cox's avatar Alan Cox Committed by Linus Torvalds

[PATCH] DVB drivers AV7110 (Fujitsu, Nova etc)

parent f910e6f2
CONFIG_DVB_AV7110
Support for SAA7146 and AV7110 based DVB cards as produced
by Fujitsu-Siemens, Technotrend, Hauppauge and others.
Simple cards like so called Budget- or Nova-PCI cards are
supported as well as fullfeatured cards with onboard MPEG2
decoder.
Say Y if you own such a card and want to use it.
CONFIG_DVB_AV7110_OSD
The AV7110 firmware provides some code to generate an OnScreenDisplay
on the video output. This is kind of nonstandard and not guaranteed to
be maintained.
Anyway, some popular DVB software like VDR uses this OSD to render
its menus, so say Y if you want to use this software.
All other people say N.
dep_tristate ' SAA7146 based AV7110 and Nova/budget cards' CONFIG_DVB_AV7110 $CONFIG_VIDEO_DEV $CONFIG_DVB_CORE
if [ "$CONFIG_DVB_AV7110" != "n" ]; then
bool ' AV7110 OSD support' CONFIG_DVB_AV7110_OSD
fi
#
# Makefile for the kernel AV7110 DVB device driver
#
dvb-ttpci-objs := saa7146_core.o saa7146_v4l.o av7110.o av7110_ir.o
obj-$(CONFIG_DVB_AV7110) += dvb-ttpci.o
include $(TOPDIR)/Rules.make
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This diff is collapsed.
#include <asm/types.h>
#include <asm/bitops.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/input.h>
#include <linux/proc_fs.h>
#include "av7110.h"
#define UP_TIMEOUT (HZ/2)
static int av7110_ir_debug = 0;
#define dprintk(x...) do { if (av7110_ir_debug) printk (x); } while (0)
static struct input_dev input_dev;
static
u16 key_map [256] = {
KEY_0, KEY_1, KEY_2, KEY_3, KEY_4, KEY_5, KEY_6, KEY_7,
KEY_8, KEY_9, KEY_LAST, 0, KEY_POWER, KEY_MUTE, 0, KEY_INFO,
KEY_VOLUMEUP, KEY_VOLUMEDOWN, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
KEY_CHANNELUP, KEY_CHANNELDOWN, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, KEY_TEXT, 0, 0, KEY_TV, 0, 0, 0, 0, 0, KEY_SETUP, 0, 0,
0, 0, 0, KEY_SUBTITLE, 0, 0, KEY_LANGUAGE, 0,
KEY_RADIO, 0, 0, 0, 0, KEY_EXIT, 0, 0,
KEY_UP, KEY_DOWN, KEY_LEFT, KEY_RIGHT, KEY_OK, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, KEY_RED, KEY_GREEN, KEY_YELLOW,
KEY_BLUE, 0, 0, 0, 0, 0, 0, 0, KEY_MENU, KEY_LIST, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, KEY_UP, KEY_UP, KEY_DOWN, KEY_DOWN,
0, 0, 0, 0, KEY_EPG, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, KEY_MHP
};
static
void av7110_emit_keyup (unsigned long data)
{
if (!data || !test_bit (data, input_dev.key))
return;
input_event (&input_dev, EV_KEY, data, !!0);
}
static
struct timer_list keyup_timer = { function: av7110_emit_keyup };
static
void av7110_emit_key (u32 ircom)
{
int down = ircom & (0x80000000);
u16 keycode = key_map[ircom & 0xff];
dprintk ("#########%08x######### key %02x %s (keycode %i)\n",
ircom, ircom & 0xff, down ? "pressed" : "released", keycode);
if (!keycode) {
printk ("%s: unknown key 0x%02x!!\n",
__FUNCTION__, ircom & 0xff);
return;
}
if (timer_pending (&keyup_timer)) {
del_timer (&keyup_timer);
if (keyup_timer.data != keycode)
input_event (&input_dev, EV_KEY, keyup_timer.data, !!0);
}
clear_bit (keycode, input_dev.key);
input_event (&input_dev, EV_KEY, keycode, !0);
keyup_timer.expires = jiffies + UP_TIMEOUT;
keyup_timer.data = keycode;
add_timer (&keyup_timer);
}
static
void input_register_keys (void)
{
int i;
memset (input_dev.keybit, 0, sizeof(input_dev.keybit));
for (i=0; i<sizeof(key_map)/sizeof(key_map[0]); i++) {
if (key_map[i] > KEY_MAX)
key_map[i] = 0;
else if (key_map[i] > KEY_RESERVED)
set_bit (key_map[i], input_dev.keybit);
}
}
static
int av7110_ir_write_proc (struct file *file, const char *buffer,
unsigned long count, void *data)
{
u32 ir_config;
if (count < 4 + 256 * sizeof(u16))
return -EINVAL;
memcpy (&ir_config, buffer, 4);
memcpy (&key_map, buffer + 4, 256 * sizeof(u16));
av7110_setup_irc_config (NULL, ir_config);
input_register_keys ();
return count;
}
int __init av7110_ir_init (void)
{
static struct proc_dir_entry *e;
init_timer (&keyup_timer);
keyup_timer.data = 0;
input_dev.name = "DVB on-card IR receiver";
/**
* enable keys
*/
set_bit (EV_KEY, input_dev.evbit);
input_register_keys ();
input_register_device(&input_dev);
av7110_setup_irc_config (NULL, 0x0001);
av7110_register_irc_handler (av7110_emit_key);
e = create_proc_entry ("av7110_ir", S_IFREG | S_IRUGO | S_IWUSR, NULL);
if (e) {
e->write_proc = av7110_ir_write_proc;
e->size = 4 + 256 * sizeof(u16);
}
return 0;
}
void __exit av7110_ir_exit (void)
{
remove_proc_entry ("av7110_ir", NULL);
av7110_unregister_irc_handler (av7110_emit_key);
input_unregister_device(&input_dev);
}
//MODULE_AUTHOR("Holger Waechtler <holger@convergence.de>");
//MODULE_LICENSE("GPL");
MODULE_PARM(av7110_ir_debug,"i");
MODULE_PARM_DESC(av7110_ir_debug, "enable AV7110 IR receiver debug messages");
This diff is collapsed.
This diff is collapsed.
#ifndef __SAA7146_CORE__
#define __SAA7146_CORE__
#include <asm/io.h> /* definitions of u32 etc. */
#include "../dvb-core/dvbdev.h"
#if LINUX_VERSION_CODE < 0x020300
#define DECLARE_MUTEX(foo) struct semaphore foo = MUTEX
#define DECLARE_MUTEX_LOCKED(foo) struct semaphore foo = MUTEX_LOCKED
#define WAIT_QUEUE struct wait_queue*
#define init_waitqueue_head(wq) *(wq) = NULL;
#else
#define WAIT_QUEUE wait_queue_head_t
#endif
/* maximum number of capture frames we support */
#define SAA7146_MAX_BUF 5
/* maximum number of extensions we support */
#define SAA7146_MAX_EXTENSIONS 4
/* stuff for writing to saa7146 */
#define saa7146_write(mem,adr,dat) writel((dat),(mem+(adr)))
#define saa7146_read(mem,adr) readl(mem+(adr))
#define DVB_CARD_TT_SIEMENS 0
#define DVB_CARD_TT_BUDGET 1
#define DVB_CARD_TT_BUDGET_CI 2
#define DVB_CARD_KNC1 3
/* this struct contains some constants needed for horizontal and vertical scaling.
currently we only support PAL (mode=0)and NTSC (mode=1). */
struct saa7146 {
char name[32]; /* give it a nice name */
struct list_head list_head;
dvb_adapter_t *dvb_adapter;
struct dvb_i2c_bus *i2c_bus;
struct pci_dev *device;
int card_type;
void* data[SAA7146_MAX_EXTENSIONS]; /* data hooks for extensions */
int (*command) (struct dvb_i2c_bus *i, unsigned int cmd, void *arg);
unsigned char* mem; /* pointer to mapped IO memory */
int revision; /* chip revision; needed for bug-workarounds*/
int interlace;
int mode;
u32* i2c; /* i2c memory */
u32* grabbing; /* grabbing memory */
u32* clipping; /* clipping memory for mask or rectangle clipping*/
u32* rps0; /* memory for rps0-program */
u32* rps1; /* memory for rps1-program */
u32* debi; /* memory for debi-transfers */
int buffers; /* number of grabbing-buffers */
u32* page_table[SAA7146_MAX_BUF]; /* page_tables for buffers*/
int frame_stat[SAA7146_MAX_BUF]; /* status of grabbing buffers */
int grab_width[SAA7146_MAX_BUF]; /* pixel width of grabs */
int grab_height[SAA7146_MAX_BUF]; /* pixel height of grabs */
int grab_format[SAA7146_MAX_BUF]; /* video format of grabs */
int grab_port[SAA7146_MAX_BUF]; /* video port for grab */
WAIT_QUEUE rps0_wq; /* rps0 interrupt queue (=> capture) */
WAIT_QUEUE rps1_wq; /* rps1 interrupt queue (=> i2c, ...) */
};
#define SAA7146_IRQ_RPS0
#define SAA7146_IRQ_RPS1
struct saa7146_extension {
char name[32];
u32 handles_irqs;
void (*irq_handler)(struct saa7146*, u32, void*);
int (*command)(struct saa7146*, void*, unsigned int cmd, void *arg);
int (*attach)(struct saa7146*, void**);
int (*detach)(struct saa7146*, void**);
void (*inc_use)(struct saa7146*);
void (*dec_use)(struct saa7146*);
};
extern int saa7146_add_extension(struct saa7146_extension* ext);
extern int saa7146_del_extension(struct saa7146_extension* ext);
/* external grabbing states */
#define GBUFFER_UNUSED 0x000
#define GBUFFER_GRABBING 0x001
#define GBUFFER_DONE 0x002
#define SAA7146_CORE_BASE 200
#define SAA7146_DO_MMAP _IOW('d', (SAA7146_CORE_BASE+11), struct vm_area_struct *)
#define SAA7146_SET_DD1 _IOW('d', (SAA7146_CORE_BASE+12), u32)
#define SAA7146_DUMP_REGISTERS _IOW('d', (SAA7146_CORE_BASE+13), u32)
#define SAA7146_DEBI_TRANSFER _IOW('d', (SAA7146_CORE_BASE+14), struct saa7146_debi_transfer)
#define SAA7146_SUSPEND _IOW('d', (SAA7146_CORE_BASE+32), u32)
#define SAA7146_RESUME _IOW('d', (SAA7146_CORE_BASE+33), u32)
#endif
This diff is collapsed.
This diff is collapsed.
#ifndef __INCLUDED_SAA7146_V4L_V4L__
#define __INCLUDED_SAA7146_V4L_V4L__
/************************************************************************/
/* ADDRESSING */
/************************************************************************/
#define SAA7146_V4L_BASE 100
#define SAA7146_V4L_GPICT _IOW('d', (SAA7146_V4L_BASE+ 1), struct video_picture)
#define SAA7146_V4L_SPICT _IOW('d', (SAA7146_V4L_BASE+ 2), struct video_picture)
#define SAA7146_V4L_GFBUF _IOW('d', (SAA7146_V4L_BASE+ 3), struct video_buffer)
#define SAA7146_V4L_SFBUF _IOW('d', (SAA7146_V4L_BASE+ 4), struct video_buffer)
#define SAA7146_V4L_GMBUF _IOW('d', (SAA7146_V4L_BASE+ 5), struct video_mbuf)
#define SAA7146_V4L_SWIN _IOW('d', (SAA7146_V4L_BASE+ 6), struct video_window)
#define SAA7146_V4L_CCAPTURE _IOW('d', (SAA7146_V4L_BASE+ 7), int)
#define SAA7146_V4L_CMCAPTURE _IOW('d', (SAA7146_V4L_BASE+ 8), struct video_mmap)
#define SAA7146_V4L_CSYNC _IOW('d', (SAA7146_V4L_BASE+ 9), int)
#define SAA7146_V4L_CGSTATUS _IOW('d', (SAA7146_V4L_BASE+10), int)
#define SAA7146_V4L_TSCAPTURE _IOW('d', (SAA7146_V4L_BASE+11), int)
extern int saa7146_v4l_init (void);
extern void saa7146_v4l_exit (void);
#endif
CONFIG_DVB_ALPS_BSRU6
A DVB-S tuner module.
Say Y when you want to support this frontend.
If you don't know what tuner module is soldered on your
DVB adapter simply enable all supported frontends, the
right one will get autodetected.
CONFIG_DVB_ALPS_BSRV2
A DVB-S tuner module. Say Y when you want to support this frontend.
If you don't know what tuner module is soldered on your
DVB adapter simply enable all supported frontends, the
right one will get autodetected.
CONFIG_DVB_GRUNDIG_29504_491
A DVB-S tuner module. Say Y when you want to support this frontend.
If you don't know what tuner module is soldered on your
DVB adapter simply enable all supported frontends, the
right one will get autodetected.
CONFIG_DVB_GRUNDIG_29504_401
A DVB-T tuner module. Say Y when you want to support this frontend.
If you don't know what tuner module is soldered on your
DVB adapter simply enable all supported frontends, the
right one will get autodetected.
CONFIG_DVB_VES1820
The VES1820 Demodulator is used on many DVB-C PCI cards and in some
DVB-C SetTopBoxes. Say Y when you see this demodulator chip near your
tuner module.
If you don't know what tuner module is soldered on your
DVB adapter simply enable all supported frontends, the
right one will get autodetected.
comment 'Supported Frontend Modules'
dep_tristate ' Alps BSRU6 (QPSK)' CONFIG_DVB_ALPS_BSRU6 $CONFIG_DVB_CORE
dep_tristate ' Alps BSRV2 (QPSK)' CONFIG_DVB_ALPS_BSRV2 $CONFIG_DVB_CORE
dep_tristate ' Grundig 29504-491 (QPSK)' CONFIG_DVB_GRUNDIG_29504_491 $CONFIG_DVB_CORE
dep_tristate ' Grundig 29504-401 (OFDM)' CONFIG_DVB_GRUNDIG_29504_401 $CONFIG_DVB_CORE
dep_tristate ' Frontends with external VES1820 demodulator (QAM)' CONFIG_DVB_VES1820 $CONFIG_DVB_CORE
#
# Makefile for the kernel DVB frontend device drivers.
#
EXTRA_CFLAGS = -Idrivers/media/dvb/dvb-core/
obj-$(CONFIG_DVB_ALPS_BSRU6) += alps_bsru6.o
obj-$(CONFIG_DVB_ALPS_BSRV2) += alps_bsrv2.o
obj-$(CONFIG_DVB_GRUNDIG_29504_491) += grundig_29504-491.o
obj-$(CONFIG_DVB_GRUNDIG_29504_401) += grundig_29504-401.o
obj-$(CONFIG_DVB_VES1820) += ves1820.o
include $(TOPDIR)/Rules.make
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