Commit 5cb39380 authored by Linus Torvalds's avatar Linus Torvalds

Import 2.3.99pre7

parent 0f0078de
......@@ -13,12 +13,11 @@ The via82cxxx audio driver found in the drivers/sound directory
of the kernel source tree is a PCI audio driver for audio chips
found on Via-based motherboards, such as the MVP4.
Currently the driver provides audio via SoundBlaster Pro compatibility,
and MIDI via MPU-401 compatibility. An AC97 mixing device is also
supported, and is generally preferred over the SoundBlaster mixer.
Currently the driver exports the following features:
IMPORTANT NOTE: Some users report that the SoundBlaster mixer does
not work at all -- use the AC97 mixer if possible.
* /dev/dsp and /dev/audio support
* 16-bit stereo PCM output channel
* AC97 mixer
Please send bug reports to the mailing list linux-via@gtf.org.
To subscribe, e-mail majordomo@gtf.org with "subscribe linux-via" in the
......@@ -27,7 +26,7 @@ body of the message.
Thanks
------------------------------------------------------------------------
Via for providing e-mail support, specs, and NDA's source code.
Via for providing e-mail support, specs, and NDA'd source code.
MandrakeSoft for providing hacking time.
......@@ -40,15 +39,10 @@ Installation
If the driver is being statically compiled into the kernel, no
configuration should be necessary.
If the driver is being compiled as a module, generally two lines must
If the driver is being compiled as a module, generally one line must
be added to your /etc/conf.modules (or /etc/modules.conf) file:
alias sound via82cxxx
options sb support=1
The second line is very important: it tells the required 'sb' module
not to load SoundBlaster support, but to instead let the Via driver
do so at a later time.
alias sound via82cxxx_audio
......@@ -63,8 +57,8 @@ Some architecture remains for multiple cards, feel free to submit
a patch to clean some of that up. Ideally,
No consideration for SMP, this chipset is not known to be found on
any SMP motherboards. However, this will change when we start handling
our own interrupts in "native mode."
any SMP motherboards. However, spin_locks must be used anyway in order
to handle interrupts correctly.
GNU indent formatting options: -kr -i8 -pcs
......@@ -76,29 +70,17 @@ The following is an _incomplete_ list of motherboards supported by this
audio driver. If your motherboard (or notebook) is not listed here,
please e-mail the maintainer with details.
AOpen MX59 Pro (Apollo MVP4)
AOpen MX59 Pro
Compaq Presario 1247
The Future
Random Developer Notes / Comments
------------------------------------------------------------------------
Via has graciously donated e-mail support and source code to help further
the development of this driver. Their assistance has been invaluable
in the design and coding of the next major version of this driver.
This audio chip supports a DirectSound(tm)-style hardware interface,
with a single 16-bit stereo input channel, and a single 16-bit stereo
output channel. Data is transferred to/from the hardware using
table-driven scatter-gather DMA buffers.
Work is currently underway to support this "native mode" of the chip.
When complete, SoundBlaster legacy mode will be completely removed.
After a round of testing, this code will become version 2.0.0.
Following the 2.0.0 release, the last major task to complete is
MIDI support. MPU-401 legacy support is available currently, but
not well tested at all.
The Via audio chip apparently provides a second PCM scatter-gather
DMA channel just for FM data, but does not have a full hardware MIDI
processor. I haven't put much thought towards a solution here, but it
......@@ -109,11 +91,15 @@ support altogether and using the FM PCM channel as a second (input? output?)
General To-do List (patches/suggestions welcome)
------------------------------------------------------------------------
Better docs
Recording support
Code review by sound guru(s)
mmap support
Native DSP audio driver using scatter-gather DMA, as described above
Other advanced ioctls
Better docs
Code review
Native MIDI driver, as described above
......@@ -121,8 +107,35 @@ Native MIDI driver, as described above
Known bugs (patches/suggestions welcome)
------------------------------------------------------------------------
1) Two MIDI devices are loaded by the sound driver. Eliminate one of them.
1) Volume too low on many systems. Workaround: use mixer program
such as xmixer to increase volume.
2) RealPlayer output very scratchy.
3) Applications which attempt to open the sound device in read/write
mode (O_RDWR) will fail. This is incorrect OSS behavior, but since
this driver will eventually support recording as well as playback,
we will be able to (in the future) support even broken programs which
unconditionally use O_RDWR.
Submitting a bug report
------------------------------------------------------------------------
Describe the application you were using to play/record sound, and how
to reproduce the problem.
Obtain the via-audio-diag diagnostics program from
http://gtf.org/garzik/drivers/via82cxxx/ and provide a dump of the
audio chip's registers while the problem is occurring. Sample command line:
./via-audio-diag -aps > diag-output.txt
Define "VIA_DEBUG" at the beginning of the driver, then capture and email
the kernel log output. This can be viewed in the system kernel log (if
enabled), or via the 'dmesg' program.
If you wish to increase the size of the buffer displayed by 'dmesg', then
change the LOG_BUF_LEN macro at the top of linux/kernel/printk.c, recompile
your kernel, and pass the "-s <size>" option to 'dmesg'.
2) Two mixer devices are loaded by the sound driver. Eliminate one of
them. At least one bug report says that SB mixer does not work at all,
only AC97 mixer.
......@@ -6,8 +6,11 @@ Author: Mark McClelland
Homepage: http://alpha.dyndns.org/ov511
NEW IN THIS VERSION:
o Support for OV511+
o Support for OV7620
o Improvements to sensor detection code
o Added "i2c_detect_tries" and "aperture" parameters
o proc filesystem status support
o read() fixed partially
o code cleanups and minor fixes
INTRODUCTION:
......@@ -151,11 +154,13 @@ WORKING FEATURES:
o Monochrome
o Setting/getting of saturation, contrast and brightness (no hue yet; only
works with OV7610, not the OV7620 or OV7620AE)
o proc status reporting
EXPERIMENTAL FEATURES:
o fix_rgb_offset: Sometimes works, but other times causes errors with xawtv and
corrupted frames.
o Snapshot mode (only works with some read() based apps; see below for more)
o read() support
TODO:
o Fix the noise / grainy image problem.
......@@ -180,6 +185,8 @@ TODO:
o Get rid of the memory management functions (put them in videodev.c??)
o Setting of contrast and brightness not working with 7620
o Driver/camera state save/restore for when USB supports suspend/resume
o Multiple cameras reportedly do not work simultaneously
o Problems with OHCI
HOW TO CONTACT ME:
......
......@@ -199,11 +199,22 @@
home now.
-- Clear header length in mode_select unconditionally.
-- Removed the register_disk() that was added, not needed here.
3.08 May 1, 2000 - Jens Axboe <axboe@suse.de>
-- Fix direction flag in setup_send_key and setup_report_key. This
gave some SCSI adapters problems.
-- Always return -EROFS for write opens
-- Convert to module_init/module_exit style init and remove some
of the #ifdef MODULE stuff
-- Fix several dvd errors - DVD_LU_SEND_ASF should pass agid,
DVD_HOST_SEND_RPC_STATE did not set buffer size in cdb, and
dvd_do_auth passed uninitialized data to drive because init_cdrom_command
did not clear a 0 sized buffer.
-------------------------------------------------------------------------*/
#define REVISION "Revision: 3.07"
#define VERSION "Id: cdrom.c 3.07 2000/02/02"
#define REVISION "Revision: 3.08"
#define VERSION "Id: cdrom.c 3.08 2000/05/01"
/* I use an error-log mask to give fine grain control over the type of
messages dumped to the system logs. The available masks include: */
......@@ -432,17 +443,6 @@ struct cdrom_device_info *cdrom_find_device(kdev_t dev)
while (cdi != NULL && cdi->dev != dev)
cdi = cdi->next;
/* we need to find the device this way when IDE devices such
* as /dev/hdc2 are opened. SCSI drives will be found above and
* so will /dev/hdc, for instance.
*/
if (cdi == NULL) {
kdev_t cd_dev = MKDEV(MAJOR(dev), MINOR(dev) | CD_PART_MASK);
cdi = topCdromPtr;
while (cdi != NULL && cdi->dev != cd_dev)
cdi = cdi->next;
}
return cdi;
}
......@@ -834,7 +834,7 @@ static int cdrom_media_changed(kdev_t dev)
/* This talks to the VFS, which doesn't like errors - just 1 or 0.
* Returning "0" is always safe (media hasn't been changed). Do that
* if the low-level cdrom driver dosn't support media changed. */
if (cdi->ops->media_changed == NULL)
if (cdi == NULL || cdi->ops->media_changed == NULL)
return 0;
if (!CDROM_CAN(CDC_MEDIA_CHANGED))
return 0;
......@@ -994,6 +994,7 @@ static int dvd_do_auth(struct cdrom_device_info *cdi, dvd_authinfo *ai)
struct cdrom_generic_command cgc;
struct cdrom_device_ops *cdo = cdi->ops;
memset(buf, 0, sizeof(buf));
init_cdrom_command(&cgc, buf, 0, CGC_DATA_READ);
switch (ai->type) {
......@@ -1052,7 +1053,7 @@ static int dvd_do_auth(struct cdrom_device_info *cdi, dvd_authinfo *ai)
case DVD_LU_SEND_ASF:
cdinfo(CD_DVD, "entering DVD_LU_SEND_ASF\n");
setup_report_key(&cgc, ai->lsasf.asf, 5);
setup_report_key(&cgc, ai->lsasf.agid, 5);
if ((ret = cdo->generic_packet(cdi, &cgc)))
return ret;
......@@ -1113,6 +1114,7 @@ static int dvd_do_auth(struct cdrom_device_info *cdi, dvd_authinfo *ai)
case DVD_HOST_SEND_RPC_STATE:
cdinfo(CD_DVD, "entering DVD_HOST_SEND_RPC_STATE\n");
setup_send_key(&cgc, 0, 6);
buf[1] = 6;
buf[4] = ai->hrpcs.pdrc;
if ((ret = cdo->generic_packet(cdi, &cgc)))
......
......@@ -282,9 +282,12 @@
* - cdrom_read_capacity returns one frame too little.
* - Fix real capacity reporting.
*
* 4.58 May 1, 2000 - Clean up ACER50 stuff.
* - Fix small problem with ide_cdrom_capacity
*
*************************************************************************/
#define IDECD_VERSION "4.57"
#define IDECD_VERSION "4.58"
#include <linux/config.h>
#include <linux/module.h>
......@@ -1521,7 +1524,7 @@ cdrom_lockdoor(ide_drive_t *drive, int lockflag, struct request_sense *sense)
memset(&pc, 0, sizeof(pc));
pc.sense = sense;
pc.c[0] = GPCMD_PREVENT_ALLOW_MEDIUM_REMOVAL;
pc.c[4] = (lockflag != 0);
pc.c[4] = lockflag ? 3 : 0;
stat = cdrom_queue_packet_command (drive, &pc);
}
......@@ -1857,6 +1860,10 @@ static int ide_cdrom_packet(struct cdrom_device_info *cdi,
pc.buffer = cgc->buffer;
pc.buflen = cgc->buflen;
cgc->stat = cdrom_queue_packet_command(drive, &pc);
/*
* FIXME: copy sense, don't just assign pointer!!
*/
cgc->sense = pc.sense;
return cgc->stat;
......@@ -2159,9 +2166,9 @@ static int ide_cdrom_register (ide_drive_t *drive, int nslots)
{
struct cdrom_info *info = drive->driver_data;
struct cdrom_device_info *devinfo = &info->devinfo;
int minor = (drive->select.b.unit)<<PARTN_BITS;
int minor = (drive->select.b.unit) << PARTN_BITS;
devinfo->dev = MKDEV (HWIF(drive)->major, minor | CD_PART_MASK);
devinfo->dev = MKDEV (HWIF(drive)->major, minor);
devinfo->ops = &ide_cdrom_dops;
devinfo->mask = 0;
*(int *)&devinfo->speed = CDROM_STATE_FLAGS (drive)->current_speed;
......@@ -2195,22 +2202,23 @@ static int ide_cdrom_register (ide_drive_t *drive, int nslots)
return register_cdrom(devinfo);
}
/*
* the buffer struct used by ide_cdrom_get_capabilities()
*/
struct get_capabilities_buf {
char pad[8];
struct atapi_capabilities_page cap;
char extra_cap[4];
};
static
int ide_cdrom_get_capabilities(ide_drive_t *drive, struct atapi_capabilities_page *cap)
{
struct cdrom_info *info = drive->driver_data;
struct cdrom_device_info *cdi = &info->devinfo;
struct cdrom_generic_command cgc;
int stat, attempts = 3;
int stat, attempts = 3, size = sizeof(*cap);
/*
* ACER50 (and others?) require the full spec length mode sense
* page capabilities size, but older drives break.
*/
if (drive->id) {
if (!(!strcmp(drive->id->model, "ATAPI CD ROM DRIVE 50X MAX") ||
!strcmp(drive->id->model, "WPI CDS-32X")))
size -= sizeof(cap->pad);
}
/* we have to cheat a little here. the packet will eventually
* be queued with ide_cdrom_packet(), which extracts the
......@@ -2220,7 +2228,7 @@ int ide_cdrom_get_capabilities(ide_drive_t *drive, struct atapi_capabilities_pag
*/
cdi->handle = (ide_drive_t *) drive;
cdi->ops = &ide_cdrom_dops;
init_cdrom_command(&cgc, cap, sizeof(*cap), CGC_DATA_UNKNOWN);
init_cdrom_command(&cgc, cap, size, CGC_DATA_UNKNOWN);
do { /* we seem to get stat=0x01,err=0x00 the first time (??) */
stat = cdrom_mode_sense(cdi, &cgc, GPMODE_CAPABILITIES_PAGE, 0);
if (!stat)
......@@ -2513,9 +2521,8 @@ void ide_cdrom_release (struct inode *inode, struct file *file,
static
int ide_cdrom_check_media_change (ide_drive_t *drive)
{
return cdrom_fops.check_media_change
(MKDEV (HWIF (drive)->major,
(drive->select.b.unit)<<PARTN_BITS));
return cdrom_fops.check_media_change(MKDEV (HWIF (drive)->major,
(drive->select.b.unit) << PARTN_BITS));
}
static
......@@ -2545,8 +2552,7 @@ unsigned long ide_cdrom_capacity (ide_drive_t *drive)
{
unsigned capacity;
capacity = cdrom_read_capacity(drive, &capacity, NULL);
return capacity ? 0 : capacity * SECTORS_PER_FRAME;
return cdrom_read_capacity(drive, &capacity, NULL) ? 0 : capacity * SECTORS_PER_FRAME;
}
static
......
......@@ -10,15 +10,6 @@
#include <linux/cdrom.h>
#include <asm/byteorder.h>
/*
* Apparently older drives have problems with filling out the entire
* mode_sense capability structure. Define this to 1 if your drive isn't
* probed correctly.
*/
#ifndef BROKEN_CAP_PAGE
#define BROKEN_CAP_PAGE 0
#endif
/* Turn this on to have the driver print out the meanings of the
ATAPI error codes. This will use up additional kernel-space
memory, though. */
......@@ -114,6 +105,7 @@ struct packet_command {
char *buffer;
int buflen;
int stat;
int quiet;
struct request_sense *sense;
unsigned char c[12];
};
......@@ -410,9 +402,7 @@ struct atapi_capabilities_page {
unsigned short buffer_size;
/* Current speed (in kB/s). */
unsigned short curspeed;
#if !BROKEN_CAP_PAGE
char pad[4];
#endif
};
......
......@@ -102,7 +102,7 @@ static int full_duplex[MAX_UNITS] = {-1, -1, -1, -1, -1, -1, -1, -1};
static char version1[] __devinitdata =
"starfire.c:v0.15+LK1.1.2 4/28/2000 Written by Donald Becker <becker@scyld.com>\n";
static char version2[] __devinitdata =
" Undates and info at http://www.scyld.com/network/starfire.html\n";
" Updates and info at http://www.scyld.com/network/starfire.html\n";
MODULE_AUTHOR("Donald Becker <becker@scyld.com>");
MODULE_DESCRIPTION("Adaptec Starfire Ethernet driver");
......
......@@ -79,6 +79,8 @@ if [ "$CONFIG_SOUND_MSNDPIN" = "y" -o "$CONFIG_SOUND_MSNDCLAS" = "y" ]; then
int 'MSND buffer size (kB)' CONFIG_MSND_FIFOSIZE 128
fi
tristate ' VIA 82C686 Audio Codec' CONFIG_SOUND_VIA82CXXX
dep_tristate ' OSS sound modules' CONFIG_SOUND_OSS $CONFIG_SOUND
if [ "$CONFIG_SOUND_OSS" = "y" -o "$CONFIG_SOUND_OSS" = "m" ]; then
......@@ -144,7 +146,6 @@ if [ "$CONFIG_SOUND_OSS" = "y" -o "$CONFIG_SOUND_OSS" = "m" ]; then
fi
fi
dep_tristate ' VIA 82C686 Audio Codec' CONFIG_SOUND_VIA82CXXX $CONFIG_SOUND_OSS
dep_tristate ' Yamaha FM synthesizer (YM3812/OPL-3) support' CONFIG_SOUND_YM3812 $CONFIG_SOUND_OSS
dep_tristate ' Yamaha OPL3-SA1 audio controller' CONFIG_SOUND_OPL3SA1 $CONFIG_SOUND_OSS
dep_tristate ' Yamaha OPL3-SA2, SA3, and SAx based PnP cards' CONFIG_SOUND_OPL3SA2 $CONFIG_SOUND_OSS
......
......@@ -66,7 +66,7 @@ obj-$(CONFIG_SOUND_AD1816) += ad1816.o
obj-$(CONFIG_SOUND_ACI_MIXER) += aci.o
obj-$(CONFIG_SOUND_AWE32_SYNTH) += awe_wave.o
obj-$(CONFIG_SOUND_VIA82CXXX) += via82cxxx_audio.o sb_lib.o uart401.o ac97.o
obj-$(CONFIG_SOUND_VIA82CXXX) += via82cxxx_audio.o ac97_codec.o
obj-$(CONFIG_SOUND_MSNDCLAS) += msnd.o msnd_classic.o
obj-$(CONFIG_SOUND_MSNDPIN) += msnd.o msnd_pinnacle.o
obj-$(CONFIG_SOUND_VWSND) += vwsnd.o
......
......@@ -80,7 +80,7 @@ static char *card_names[] __devinitdata = {
"EMU10K1",
};
static struct pci_device_id emu10k1_pci_tbl[] __initdata = {
static struct pci_device_id emu10k1_pci_tbl[] = {
{PCI_VENDOR_ID_CREATIVE, PCI_DEVICE_ID_CREATIVE_EMU10K1,
PCI_ANY_ID, PCI_ANY_ID, 0, 0, EMU10K1},
{0,}
......@@ -763,7 +763,7 @@ static void __devexit emu10k1_remove(struct pci_dev *pci_dev)
MODULE_AUTHOR("Bertrand Lee, Cai Ying. (Email to: emu10k1-devel@opensource.creative.com)");
MODULE_DESCRIPTION("Creative EMU10K1 PCI Audio Driver v" DRIVER_VERSION "\nCopyright (C) 1999 Creative Technology Ltd.");
static struct pci_driver emu10k1_pci_driver __initdata = {
static struct pci_driver emu10k1_pci_driver = {
name:"emu10k1",
id_table:emu10k1_pci_tbl,
probe:emu10k1_probe,
......
......@@ -26,4 +26,4 @@ static struct notifier_block sound_notifier=
0
};
#endif
#endif /* _SOUNDMODULE_H */
This diff is collapsed.
This diff is collapsed.
#ifndef __LINUX_OV511_H
#define __LINUX_OV511_H
#include <asm/uaccess.h>
#include <linux/videodev.h>
#include <linux/smp_lock.h>
#define OV511_DEBUG /* Turn on debug messages */
#ifdef OV511_DEBUG
# define PDEBUG(level, fmt, args...) \
if (debug >= level) printk("ov511: " fmt "\n" , ## args)
if (debug >= level) printk("ov511: [" __PRETTY_FUNCTION__ ":%d] " fmt "\n", __LINE__ , ## args)
#else
# define PDEBUG(level, fmt, args...) do {} while(0)
#endif
/* Camera interface register numbers */
#define OV511_REG_CAMERA_DELAY_MODE 0x10
#define OV511_REG_CAMERA_EDGE_MODE 0x11
#define OV511_REG_CAMERA_DELAY_MODE 0x10
#define OV511_REG_CAMERA_EDGE_MODE 0x11
#define OV511_REG_CAMERA_CLAMPED_PIXEL_NUM 0x12
#define OV511_REG_CAMERA_CLAMPED_LINE_NUM 0x13
#define OV511_REG_CAMERA_PIXEL_DIVISOR 0x14
#define OV511_REG_CAMERA_LINE_DIVISOR 0x15
#define OV511_REG_CAMERA_DATA_INPUT_SELECT 0x16
#define OV511_REG_CAMERA_RESERVED_LINE_MODE 0x17
#define OV511_REG_CAMERA_BITMASK 0x18
#define OV511_REG_CAMERA_BITMASK 0x18
/* Snapshot mode camera interface register numbers */
#define OV511_REG_SNAP_CAPTURED_FRAME 0x19
#define OV511_REG_SNAP_CLAMPED_PIXEL_NUM 0x1A
#define OV511_REG_SNAP_CLAMPED_LINE_NUM 0x1B
#define OV511_REG_SNAP_PIXEL_DIVISOR 0x1C
#define OV511_REG_SNAP_LINE_DIVISOR 0x1D
#define OV511_REG_SNAP_LINE_DIVISOR 0x1D
#define OV511_REG_SNAP_DATA_INPUT_SELECT 0x1E
#define OV511_REG_SNAP_BITMASK 0x1F
#define OV511_REG_SNAP_BITMASK 0x1F
/* DRAM register numbers */
#define OV511_REG_DRAM_ENABLE_FLOW_CONTROL 0x20
......@@ -37,21 +41,21 @@ if (debug >= level) printk("ov511: " fmt "\n" , ## args)
#define OV511_REG_DRAM_REFRESH_COUNTER 0x23
/* ISO FIFO register numbers */
#define OV511_REG_FIFO_PACKET_SIZE 0x30
#define OV511_REG_FIFO_BITMASK 0x31
#define OV511_REG_FIFO_PACKET_SIZE 0x30
#define OV511_REG_FIFO_BITMASK 0x31
/* PIO register numbers */
#define OV511_REG_PIO_BITMASK 0x38
#define OV511_REG_PIO_DATA_PORT 0x39
#define OV511_REG_PIO_BIST 0x3E
#define OV511_REG_PIO_BITMASK 0x38
#define OV511_REG_PIO_DATA_PORT 0x39
#define OV511_REG_PIO_BIST 0x3E
/* I2C register numbers */
#define OV511_REG_I2C_CONTROL 0x40
#define OV511_REG_I2C_CONTROL 0x40
#define OV511_REG_I2C_SLAVE_ID_WRITE 0x41
#define OV511_REG_I2C_SUB_ADDRESS_3_BYTE 0x42
#define OV511_REG_I2C_SUB_ADDRESS_2_BYTE 0x43
#define OV511_REG_I2C_SLAVE_ID_READ 0x44
#define OV511_REG_I2C_DATA_PORT 0x45
#define OV511_REG_I2C_SLAVE_ID_READ 0x44
#define OV511_REG_I2C_DATA_PORT 0x45
#define OV511_REG_I2C_CLOCK_PRESCALER 0x46
#define OV511_REG_I2C_TIME_OUT_COUNTER 0x47
......@@ -60,39 +64,39 @@ if (debug >= level) printk("ov511: " fmt "\n" , ## args)
#define OV511_REG_I2C_SNAP_DATA_PORT 0x49
/* System control register numbers */
#define OV511_REG_SYSTEM_RESET 0x50
#define OV511_RESET_UDC 0x01
#define OV511_RESET_I2C 0x02
#define OV511_RESET_FIFO 0x04
#define OV511_RESET_OMNICE 0x08
#define OV511_REG_SYSTEM_RESET 0x50
#define OV511_RESET_UDC 0x01
#define OV511_RESET_I2C 0x02
#define OV511_RESET_FIFO 0x04
#define OV511_RESET_OMNICE 0x08
#define OV511_RESET_DRAM_INTF 0x10
#define OV511_RESET_CAMERA_INTF 0x20
#define OV511_RESET_OV511 0x40
#define OV511_RESET_NOREGS 0x3F /* All but OV511 & regs */
#define OV511_RESET_ALL 0x7F
#define OV511_RESET_OV511 0x40
#define OV511_RESET_NOREGS 0x3F /* All but OV511 & regs */
#define OV511_RESET_ALL 0x7F
#define OV511_REG_SYSTEM_CLOCK_DIVISOR 0x51
#define OV511_REG_SYSTEM_SNAPSHOT 0x52
#define OV511_REG_SYSTEM_SNAPSHOT 0x52
#define OV511_REG_SYSTEM_INIT 0x53
#define OV511_REG_SYSTEM_PWR_CLK 0x54 /* OV511+ only */
#define OV511_REG_SYSTEM_LED_CTL 0x55 /* OV511+ only */
#define OV511_REG_SYSTEM_PWR_CLK 0x54 /* OV511+ only */
#define OV511_REG_SYSTEM_LED_CTL 0x55 /* OV511+ only */
#define OV511_REG_SYSTEM_USER_DEFINED 0x5E
#define OV511_REG_SYSTEM_CUSTOM_ID 0x5F
#define OV511_REG_SYSTEM_CUSTOM_ID 0x5F
/* OmniCE register numbers */
#define OV511_OMNICE_PREDICTION_HORIZ_Y 0x70
#define OV511_OMNICE_PREDICTION_HORIZ_Y 0x70
#define OV511_OMNICE_PREDICTION_HORIZ_UV 0x71
#define OV511_OMNICE_PREDICTION_VERT_Y 0x72
#define OV511_OMNICE_PREDICTION_VERT_UV 0x73
#define OV511_OMNICE_PREDICTION_VERT_UV 0x73
#define OV511_OMNICE_QUANTIZATION_HORIZ_Y 0x74
#define OV511_OMNICE_QUANTIZATION_HORIZ_UV 0x75
#define OV511_OMNICE_QUANTIZATION_VERT_Y 0x76
#define OV511_OMNICE_QUANTIZATION_VERT_UV 0x77
#define OV511_OMNICE_ENABLE 0x78
#define OV511_OMNICE_LUT_ENABLE 0x79
#define OV511_OMNICE_Y_LUT_BEGIN 0x80
#define OV511_OMNICE_Y_LUT_END 0x9F
#define OV511_OMNICE_UV_LUT_BEGIN 0xA0
#define OV511_OMNICE_UV_LUT_END 0xBF
#define OV511_OMNICE_ENABLE 0x78
#define OV511_OMNICE_LUT_ENABLE 0x79
#define OV511_OMNICE_Y_LUT_BEGIN 0x80
#define OV511_OMNICE_Y_LUT_END 0x9F
#define OV511_OMNICE_UV_LUT_BEGIN 0xA0
#define OV511_OMNICE_UV_LUT_END 0xBF
/* Alternate numbers for various max packet sizes (OV511 only) */
#define OV511_ALT_SIZE_992 0
......@@ -114,7 +118,7 @@ if (debug >= level) printk("ov511: " fmt "\n" , ## args)
#define OV511PLUS_ALT_SIZE_769 6
#define OV511PLUS_ALT_SIZE_961 7
/* ov7610 registers */
/* OV7610 registers */
#define OV7610_REG_GAIN 0x00
#define OV7610_REG_BLUE 0x01
#define OV7610_REG_RED 0x02
......@@ -163,12 +167,12 @@ if (debug >= level) printk("ov511: " fmt "\n" , ## args)
#define SCRATCH_BUF_SIZE 384
#define FRAMES_PER_DESC 10 /* FIXME - What should this be? */
#define FRAMES_PER_DESC 10 /* FIXME - What should this be? */
#define FRAME_SIZE_PER_DESC 993 /* FIXME - Deprecated */
#define MAX_FRAME_SIZE_PER_DESC 993 /* For statically allocated stuff */
#define MAX_FRAME_SIZE_PER_DESC 993 /* For statically allocated stuff */
// FIXME - should this be 0x81 (endpoint address) or 0x01 (endpoint number)?
#define OV511_ENDPOINT_ADDRESS 0x81 /* Address of isoc endpoint */
#define OV511_ENDPOINT_ADDRESS 0x81 /* Address of isoc endpoint */
// CAMERA SPECIFIC
// FIXME - these can vary between specific models
......@@ -213,7 +217,7 @@ enum {
FRAME_UNUSED, /* Unused (no MCAPTURE) */
FRAME_READY, /* Ready to start grabbing */
FRAME_GRABBING, /* In the process of being grabbed into */
FRAME_DONE, /* Finished grabbing, but not been synced yet */
FRAME_DONE, /* Finished grabbing, but not been synced yet */
FRAME_ERROR, /* Something bad happened while processing */
};
......@@ -238,7 +242,7 @@ struct ov511_frame {
int hdrheight; /* Height */
int sub_flag; /* Sub-capture mode for this frame? */
int format; /* Format for this frame */
int format; /* Format for this frame */
int segsize; /* How big is each segment from the camera? */
volatile int grabstate; /* State of grabbing */
......@@ -253,7 +257,7 @@ struct ov511_frame {
wait_queue_head_t wq; /* Processes waiting */
int snapshot; /* True if frame was a snapshot */
int snapshot; /* True if frame was a snapshot */
};
#define OV511_NUMFRAMES 2
......@@ -261,23 +265,28 @@ struct ov511_frame {
struct usb_ov511 {
struct video_device vdev;
/* Device structure */
struct usb_device *dev;
#if 0
unsigned char customid; /* Type of camera */
#else
int customid;
int desc;
#endif
unsigned char iface;
struct semaphore lock;
int user; /* user count for exclusive use */
int user; /* user count for exclusive use */
int streaming; /* Are we streaming Isochronous? */
int grabbing; /* Are we grabbing? */
int compress; /* Should the next frame be compressed? */
char *fbuf; /* Videodev buffer area */
char *fbuf; /* Videodev buffer area */
int sub_flag; /* Pix Array subcapture on flag */
int subx; /* Pix Array subcapture x offset */
......@@ -297,12 +306,22 @@ struct usb_ov511 {
wait_queue_head_t wq; /* Processes waiting */
int snap_enabled; /* Snapshot mode enabled */
int snap_enabled; /* Snapshot mode enabled */
int bridge; /* Type of bridge (OV511 or OV511+) */
int sensor; /* Type of image sensor chip */
int bridge; /* Type of bridge (OV511 or OV511+) */
int sensor; /* Type of image sensor chip */
int packet_size; /* Frame size per isoc desc */
/* proc interface */
struct semaphore param_lock; /* params lock for this camera */
struct proc_dir_entry *proc_entry; /* /proc/ov511/videoX */
};
int packet_size; /* Frame size per isoc desc */
struct cam_list {
int id;
char *description;
};
#endif
......
......@@ -31,9 +31,10 @@
*
*/
#define CLGEN_VERSION "1.9.5"
#define CLGEN_VERSION "1.9.6"
#include <linux/config.h>
#include <linux/version.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/errno.h>
......@@ -2652,14 +2653,14 @@ static int __init clgen_pci_setup (struct clgenfb_info *info,
if (!request_mem_region(board_addr, board_size, "clgenfb")) {
pci_write_config_word (pdev, PCI_COMMAND, tmp16);
printk(KERN_ERR "clgen: cannot reserve region 0x%lu, abort\n",
printk(KERN_ERR "clgen: cannot reserve region 0x%lx, abort\n",
board_addr);
return -1;
}
#if 0 /* if the system didn't claim this region, we would... */
if (!request_mem_region(0xA0000, 65535, "clgenfb")) {
pci_write_config_word (pdev, PCI_COMMAND, tmp16);
printk(KERN_ERR "clgen: cannot reserve region 0x%lu, abort\n",
printk(KERN_ERR "clgen: cannot reserve region 0x%lx, abort\n",
0xA0000L);
release_mem_region(board_addr, board_size);
return -1;
......@@ -2760,7 +2761,7 @@ static int __init clgen_zorro_setup (struct clgenfb_info *info,
info->board_size = board_size = z->resource.end-z->resource.start+1;
if (!request_mem_region(board_addr, board_size, "clgenfb")) {
printk(KERN_ERR "clgen: cannot reserve region 0x%lu, abort\n",
printk(KERN_ERR "clgen: cannot reserve region 0x%lx, abort\n",
board_addr);
return -1;
}
......
......@@ -543,12 +543,19 @@ int __init vesafb_init(void)
if (!request_mem_region(video_base, video_size, "vesafb")) {
printk(KERN_ERR
"vesafb: abort, cannot reserve video memory at 0x%lu\n",
"vesafb: abort, cannot reserve video memory at 0x%lx\n",
video_base);
return -1;
return -EBUSY;
}
video_vbase = ioremap(video_base, video_size);
if (!video_vbase) {
release_mem_region(video_base, video_size);
printk(KERN_ERR
"vesafb: abort, cannot ioremap video memory 0x%lx @ 0x%lx\n",
video_size, video_base);
return -EIO;
}
printk(KERN_INFO "vesafb: framebuffer at 0x%lx, mapped to 0x%p, size %dk\n",
video_base, video_vbase, video_size/1024);
......
......@@ -2129,9 +2129,7 @@ static void sync_page_buffers(struct buffer_head *bh)
do {
struct buffer_head *p = tmp;
tmp = tmp->b_this_page;
if (buffer_locked(p))
__wait_on_buffer(p);
else if (buffer_dirty(p))
if (buffer_dirty(p) && !buffer_locked(p))
ll_rw_block(WRITE, 1, &p);
} while (tmp != bh);
}
......
......@@ -171,13 +171,18 @@ do { \
spin_unlock(&pagemap_lru_lock); \
} while (0)
#define __lru_cache_del(page) \
do { \
list_del(&(page)->lru); \
nr_lru_pages--; \
} while (0)
#define lru_cache_del(page) \
do { \
if (!PageLocked(page)) \
BUG(); \
spin_lock(&pagemap_lru_lock); \
list_del(&(page)->lru); \
nr_lru_pages--; \
__lru_cache_del(page); \
spin_unlock(&pagemap_lru_lock); \
} while (0)
......
......@@ -67,7 +67,7 @@ void __add_page_to_hash_queue(struct page * page, struct page **p)
PAGE_BUG(page);
}
static void remove_page_from_hash_queue(struct page * page)
static inline void remove_page_from_hash_queue(struct page * page)
{
if(page->pprev_hash) {
if(page->next_hash)
......@@ -92,44 +92,71 @@ static inline int sync_page(struct page *page)
* sure the page is locked and that nobody else uses it - or that usage
* is safe.
*/
static inline void __remove_inode_page(struct page *page)
{
remove_page_from_inode_queue(page);
remove_page_from_hash_queue(page);
page->mapping = NULL;
}
void remove_inode_page(struct page *page)
{
if (!PageLocked(page))
PAGE_BUG(page);
spin_lock(&pagecache_lock);
remove_page_from_inode_queue(page);
remove_page_from_hash_queue(page);
page->mapping = NULL;
__remove_inode_page(page);
spin_unlock(&pagecache_lock);
}
#define ITERATIONS 100
void invalidate_inode_pages(struct inode * inode)
{
struct list_head *head, *curr;
struct page * page;
int count;
repeat:
head = &inode->i_mapping->pages;
spin_lock(&pagecache_lock);
curr = head->next;
while (curr != head) {
page = list_entry(curr, struct page, list);
curr = curr->next;
while (head != head->next) {
spin_lock(&pagecache_lock);
spin_lock(&pagemap_lru_lock);
head = &inode->i_mapping->pages;
curr = head->next;
count = 0;
/* We cannot invalidate a locked page */
if (TryLockPage(page))
continue;
spin_unlock(&pagecache_lock);
while ((curr != head) && (count++ < ITERATIONS)) {
page = list_entry(curr, struct page, list);
curr = curr->next;
lru_cache_del(page);
remove_inode_page(page);
UnlockPage(page);
page_cache_release(page);
goto repeat;
/* We cannot invalidate a locked page */
if (TryLockPage(page))
continue;
__lru_cache_del(page);
__remove_inode_page(page);
UnlockPage(page);
page_cache_release(page);
}
/* At this stage we have passed through the list
* once, and there may still be locked pages. */
if (head->next!=head) {
page = list_entry(head->next, struct page, list);
get_page(page);
spin_unlock(&pagemap_lru_lock);
spin_unlock(&pagecache_lock);
/* We need to block */
lock_page(page);
UnlockPage(page);
page_cache_release(page);
} else {
spin_unlock(&pagemap_lru_lock);
spin_unlock(&pagecache_lock);
}
}
spin_unlock(&pagecache_lock);
}
/*
......@@ -160,10 +187,10 @@ void truncate_inode_pages(struct address_space * mapping, loff_t lstart)
/* page wholly truncated - free it */
if (offset >= start) {
if (TryLockPage(page)) {
spin_unlock(&pagecache_lock);
get_page(page);
spin_unlock(&pagecache_lock);
wait_on_page(page);
put_page(page);
page_cache_release(page);
goto repeat;
}
get_page(page);
......@@ -253,7 +280,19 @@ int shrink_mmap(int priority, int gfp_mask)
goto dispose_continue;
count--;
/*
* I'm ambivalent on this one.. Should we try to
* maintain LRU on the LRU list, and put pages that
* are old at the end of the queue, even if that
* means that we'll re-scan then again soon and
* often waste CPU time? Or should be just let any
* pages we do not want to touch now for one reason
* or another percolate to be "young"?
*
dispose = &old;
*
*/
/*
* Avoid unscalable SMP locking for pages we can
......@@ -323,9 +362,7 @@ int shrink_mmap(int priority, int gfp_mask)
/* is it a page-cache page? */
if (page->mapping) {
if (!PageDirty(page) && !pgcache_under_min()) {
remove_page_from_inode_queue(page);
remove_page_from_hash_queue(page);
page->mapping = NULL;
__remove_inode_page(page);
spin_unlock(&pagecache_lock);
goto made_inode_progress;
}
......
......@@ -347,7 +347,6 @@ static int swap_out(unsigned int priority, int gfp_mask)
struct task_struct * p;
int counter;
int __ret = 0;
int assign = 0;
lock_kernel();
/*
......@@ -364,7 +363,7 @@ static int swap_out(unsigned int priority, int gfp_mask)
* Think of swap_cnt as a "shadow rss" - it tells us which process
* we want to page out (always try largest first).
*/
counter = nr_threads / (priority+1);
counter = (nr_threads << 1) >> (priority >> 1);
if (counter < 1)
counter = 1;
......@@ -372,6 +371,7 @@ static int swap_out(unsigned int priority, int gfp_mask)
unsigned long max_cnt = 0;
struct mm_struct *best = NULL;
int pid = 0;
int assign = 0;
select:
read_lock(&tasklist_lock);
p = init_task.next_task;
......@@ -391,8 +391,6 @@ static int swap_out(unsigned int priority, int gfp_mask)
}
}
read_unlock(&tasklist_lock);
if (assign == 1)
assign = 2;
if (!best) {
if (!assign) {
assign = 1;
......
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