From 4362408ac2131f2668e8520fa58a1bdb05032907 Mon Sep 17 00:00:00 2001 From: WANG Cong Date: Thu, 24 Jul 2008 15:41:48 +0100 Subject: [PATCH] --- yaml --- r: 106792 b: refs/heads/master c: 15bba37d62351749c3915add81f673b256952ee1 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/Documentation/SubmittingPatches | 26 - trunk/Documentation/arm/Interrupts | 10 +- .../feature-removal-schedule.txt | 24 - trunk/Documentation/i2c/upgrading-clients | 281 -- .../Documentation/video4linux/CARDLIST.au0828 | 1 - .../Documentation/video4linux/CARDLIST.em28xx | 45 +- trunk/Documentation/video4linux/gspca.txt | 2 +- trunk/MAINTAINERS | 6 - trunk/Makefile | 6 +- trunk/arch/arm/Kconfig | 6 +- trunk/arch/arm/Makefile | 2 +- trunk/arch/arm/common/locomo.c | 10 +- trunk/arch/arm/common/sa1111.c | 14 +- trunk/arch/arm/configs/eseries_pxa_defconfig | 1073 ++++---- trunk/arch/arm/mach-at91/board-cap9adk.c | 6 +- trunk/arch/arm/mach-at91/board-yl-9200.c | 0 trunk/arch/arm/mach-at91/irq.c | 8 +- trunk/arch/arm/mach-ep93xx/core.c | 14 +- trunk/arch/arm/mach-imx/irq.c | 12 +- trunk/arch/arm/mach-ixp2000/core.c | 8 +- trunk/arch/arm/mach-ixp23xx/core.c | 10 +- trunk/arch/arm/mach-ixp23xx/roadrunner.c | 4 +- trunk/arch/arm/mach-ixp4xx/avila-pci.c | 8 +- trunk/arch/arm/mach-ixp4xx/common.c | 10 +- trunk/arch/arm/mach-ixp4xx/coyote-pci.c | 4 +- trunk/arch/arm/mach-ixp4xx/dsmg600-pci.c | 12 +- trunk/arch/arm/mach-ixp4xx/fsg-pci.c | 6 +- trunk/arch/arm/mach-ixp4xx/gateway7001-pci.c | 4 +- trunk/arch/arm/mach-ixp4xx/gtwx5715-pci.c | 8 +- trunk/arch/arm/mach-ixp4xx/ixdp425-pci.c | 8 +- trunk/arch/arm/mach-ixp4xx/ixdpg425-pci.c | 4 +- trunk/arch/arm/mach-ixp4xx/nas100d-pci.c | 10 +- trunk/arch/arm/mach-ixp4xx/nslu2-pci.c | 6 +- trunk/arch/arm/mach-ixp4xx/wg302v2-pci.c | 4 +- trunk/arch/arm/mach-ks8695/irq.c | 10 +- trunk/arch/arm/mach-netx/generic.c | 8 +- trunk/arch/arm/mach-omap1/board-osk.c | 6 +- trunk/arch/arm/mach-omap1/board-palmz71.c | 4 +- trunk/arch/arm/mach-omap1/board-voiceblue.c | 8 +- trunk/arch/arm/mach-omap1/fpga.c | 2 +- trunk/arch/arm/mach-omap2/board-apollon.c | 6 +- trunk/arch/arm/mach-orion5x/db88f5281-setup.c | 4 +- trunk/arch/arm/mach-orion5x/irq.c | 12 +- trunk/arch/arm/mach-orion5x/rd88f5182-setup.c | 4 +- trunk/arch/arm/mach-orion5x/ts209-setup.c | 4 +- trunk/arch/arm/mach-pnx4008/irq.c | 10 +- trunk/arch/arm/mach-pxa/cm-x270-pci.c | 2 +- trunk/arch/arm/mach-pxa/lpd270.c | 2 +- trunk/arch/arm/mach-pxa/lubbock.c | 2 +- trunk/arch/arm/mach-pxa/mainstone.c | 2 +- trunk/arch/arm/mach-pxa/sharpsl_pm.c | 8 +- trunk/arch/arm/mach-pxa/trizeps4.c | 2 +- trunk/arch/arm/mach-sa1100/cerf.c | 2 +- trunk/arch/arm/mach-sa1100/h3600.c | 2 +- trunk/arch/arm/mach-sa1100/irq.c | 8 +- trunk/arch/arm/mach-sa1100/neponset.c | 2 +- trunk/arch/arm/mach-sa1100/pleb.c | 2 +- trunk/arch/arm/mm/fault-armv.c | 10 +- trunk/arch/arm/plat-mxc/gpio.c | 10 +- trunk/arch/arm/plat-omap/gpio.c | 28 +- trunk/arch/arm/plat-s3c24xx/Kconfig | 2 +- trunk/arch/arm/plat-s3c24xx/irq.c | 12 +- trunk/arch/sparc/Kconfig | 1 - trunk/arch/sparc/include/asm/Kbuild | 45 - trunk/arch/sparc/include/asm/syscall.h | 120 - trunk/arch/sparc/kernel/entry.S | 12 +- trunk/arch/sparc/kernel/ptrace.c | 26 +- trunk/arch/sparc/kernel/rtrap.S | 5 +- trunk/arch/sparc/kernel/signal.c | 16 +- trunk/arch/sparc64/Kconfig | 1 - trunk/arch/sparc64/kernel/compat_audit.c | 2 +- trunk/arch/sparc64/kernel/entry.h | 3 +- trunk/arch/sparc64/kernel/ptrace.c | 32 +- trunk/arch/sparc64/kernel/rtrap.S | 6 +- trunk/arch/sparc64/kernel/signal.c | 8 - trunk/arch/sparc64/kernel/signal32.c | 3 - trunk/arch/sparc64/kernel/syscalls.S | 4 - trunk/arch/x86/kernel/head_32.S | 8 +- trunk/drivers/acpi/processor_idle.c | 15 +- trunk/drivers/ata/pata_ixp4xx_cf.c | 2 +- trunk/drivers/base/memory.c | 3 +- trunk/drivers/char/nwflash.c | 6 +- .../drivers/char/pcmcia/ipwireless/hardware.c | 275 +- .../drivers/char/pcmcia/ipwireless/hardware.h | 4 +- trunk/drivers/char/pcmcia/ipwireless/main.c | 86 +- trunk/drivers/char/pcmcia/ipwireless/main.h | 5 - .../drivers/char/pcmcia/ipwireless/network.c | 58 +- .../drivers/char/pcmcia/ipwireless/network.h | 1 - trunk/drivers/char/pcmcia/ipwireless/tty.c | 2 +- trunk/drivers/cpuidle/cpuidle.c | 2 +- trunk/drivers/i2c/busses/i2c-bfin-twi.c | 35 +- trunk/drivers/i2c/busses/i2c-gpio.c | 9 +- trunk/drivers/i2c/busses/i2c-s3c2410.c | 129 +- trunk/drivers/input/touchscreen/corgi_ts.c | 8 +- .../input/touchscreen/mainstone-wm97xx.c | 2 +- trunk/drivers/media/common/saa7146_fops.c | 2 +- trunk/drivers/media/common/saa7146_video.c | 19 +- trunk/drivers/media/common/tuners/Kconfig | 16 +- trunk/drivers/media/common/tuners/Makefile | 1 - trunk/drivers/media/common/tuners/mt20xx.c | 3 +- trunk/drivers/media/common/tuners/mxl5007t.c | 1030 -------- trunk/drivers/media/common/tuners/mxl5007t.h | 104 - trunk/drivers/media/common/tuners/tda9887.c | 2 +- .../media/common/tuners/tuner-simple.c | 2 +- trunk/drivers/media/dvb/bt8xx/Kconfig | 2 + trunk/drivers/media/dvb/dvb-usb/Kconfig | 10 +- trunk/drivers/media/dvb/dvb-usb/Makefile | 3 - trunk/drivers/media/dvb/dvb-usb/anysee.c | 2 +- trunk/drivers/media/dvb/dvb-usb/dvb-usb-ids.h | 1 - trunk/drivers/media/dvb/dvb-usb/dw2102.c | 425 --- trunk/drivers/media/dvb/dvb-usb/dw2102.h | 9 - trunk/drivers/media/dvb/frontends/Kconfig | 38 +- trunk/drivers/media/dvb/frontends/Makefile | 1 - trunk/drivers/media/dvb/frontends/drx397xD.c | 1504 ----------- trunk/drivers/media/dvb/frontends/drx397xD.h | 130 - .../drivers/media/dvb/frontends/drx397xD_fw.h | 40 - trunk/drivers/media/dvb/frontends/z0194a.h | 97 - trunk/drivers/media/dvb/siano/smscoreapi.c | 14 +- trunk/drivers/media/dvb/siano/smsdvb.c | 4 +- trunk/drivers/media/dvb/ttpci/Kconfig | 4 + trunk/drivers/media/dvb/ttusb-dec/Kconfig | 2 + trunk/drivers/media/radio/dsbr100.c | 18 +- trunk/drivers/media/radio/miropcm20-radio.c | 3 +- trunk/drivers/media/radio/radio-aimslab.c | 14 +- trunk/drivers/media/radio/radio-aztech.c | 14 +- trunk/drivers/media/radio/radio-cadet.c | 14 +- trunk/drivers/media/radio/radio-gemtek-pci.c | 13 +- trunk/drivers/media/radio/radio-gemtek.c | 13 +- trunk/drivers/media/radio/radio-maestro.c | 12 +- trunk/drivers/media/radio/radio-maxiradio.c | 15 +- trunk/drivers/media/radio/radio-rtrack2.c | 14 +- trunk/drivers/media/radio/radio-sf16fmi.c | 14 +- trunk/drivers/media/radio/radio-sf16fmr2.c | 14 +- trunk/drivers/media/radio/radio-si470x.c | 22 +- trunk/drivers/media/radio/radio-terratec.c | 14 +- trunk/drivers/media/radio/radio-trust.c | 14 +- trunk/drivers/media/radio/radio-typhoon.c | 14 +- trunk/drivers/media/radio/radio-zoltrix.c | 14 +- trunk/drivers/media/video/Kconfig | 19 +- trunk/drivers/media/video/Makefile | 3 +- trunk/drivers/media/video/arv.c | 1 + trunk/drivers/media/video/au0828/Kconfig | 1 - .../drivers/media/video/au0828/au0828-cards.c | 12 - .../drivers/media/video/au0828/au0828-cards.h | 1 - trunk/drivers/media/video/au0828/au0828-dvb.c | 15 - trunk/drivers/media/video/bt8xx/Kconfig | 2 + trunk/drivers/media/video/bt8xx/bttv-driver.c | 58 +- trunk/drivers/media/video/bt8xx/bttv-risc.c | 1 - trunk/drivers/media/video/bt8xx/bttv-vbi.c | 1 - trunk/drivers/media/video/bw-qcam.c | 3 +- trunk/drivers/media/video/c-qcam.c | 3 +- trunk/drivers/media/video/cafe_ccic.c | 26 +- trunk/drivers/media/video/compat_ioctl32.c | 2 +- trunk/drivers/media/video/cpia.c | 2 + trunk/drivers/media/video/cpia.h | 1 - trunk/drivers/media/video/cpia2/cpia2_core.c | 1 - trunk/drivers/media/video/cpia2/cpia2_v4l.c | 5 +- trunk/drivers/media/video/cs5345.c | 2 +- trunk/drivers/media/video/cs53l32a.c | 2 +- trunk/drivers/media/video/cx18/Kconfig | 2 + .../drivers/media/video/cx18/cx18-av-audio.c | 111 +- trunk/drivers/media/video/cx18/cx18-driver.h | 1 - .../drivers/media/video/cx18/cx18-firmware.c | 54 +- trunk/drivers/media/video/cx18/cx18-ioctl.c | 92 +- trunk/drivers/media/video/cx18/cx18-streams.c | 5 +- trunk/drivers/media/video/cx23885/Kconfig | 2 + .../drivers/media/video/cx23885/cx23885-417.c | 19 +- .../media/video/cx23885/cx23885-cards.c | 54 +- .../media/video/cx23885/cx23885-core.c | 147 +- .../media/video/cx23885/cx23885-video.c | 19 +- trunk/drivers/media/video/cx25840/Kconfig | 2 + .../media/video/cx25840/cx25840-core.c | 2 +- .../media/video/cx25840/cx25840-core.h | 2 + trunk/drivers/media/video/cx88/Kconfig | 3 +- .../drivers/media/video/cx88/cx88-blackbird.c | 15 +- trunk/drivers/media/video/cx88/cx88-cards.c | 2 +- trunk/drivers/media/video/cx88/cx88-core.c | 3 +- trunk/drivers/media/video/cx88/cx88-video.c | 37 +- trunk/drivers/media/video/cx88/cx88.h | 4 +- .../drivers/media/video/em28xx/em28xx-cards.c | 1201 +-------- trunk/drivers/media/video/em28xx/em28xx-dvb.c | 13 +- .../drivers/media/video/em28xx/em28xx-video.c | 61 +- trunk/drivers/media/video/em28xx/em28xx.h | 49 +- .../media/video/et61x251/et61x251_core.c | 5 +- trunk/drivers/media/video/gspca/conex.c | 9 +- trunk/drivers/media/video/gspca/etoms.c | 30 +- trunk/drivers/media/video/gspca/gspca.c | 43 +- trunk/drivers/media/video/gspca/mars.c | 9 +- trunk/drivers/media/video/gspca/ov519.c | 33 +- trunk/drivers/media/video/gspca/pac207.c | 29 +- trunk/drivers/media/video/gspca/pac7311.c | 22 +- trunk/drivers/media/video/gspca/sonixb.c | 484 +++- trunk/drivers/media/video/gspca/sonixj.c | 492 ++-- trunk/drivers/media/video/gspca/spca500.c | 139 +- trunk/drivers/media/video/gspca/spca501.c | 75 +- trunk/drivers/media/video/gspca/spca505.c | 140 +- trunk/drivers/media/video/gspca/spca506.c | 121 +- trunk/drivers/media/video/gspca/spca508.c | 164 +- trunk/drivers/media/video/gspca/spca561.c | 62 +- trunk/drivers/media/video/gspca/stk014.c | 9 +- trunk/drivers/media/video/gspca/sunplus.c | 355 ++- trunk/drivers/media/video/gspca/t613.c | 26 +- trunk/drivers/media/video/gspca/tv8532.c | 17 +- trunk/drivers/media/video/gspca/vc032x.c | 44 +- trunk/drivers/media/video/gspca/zc3xx.c | 486 ++-- trunk/drivers/media/video/ivtv/Kconfig | 2 + trunk/drivers/media/video/ivtv/ivtv-driver.c | 5 +- trunk/drivers/media/video/ivtv/ivtv-driver.h | 1 - trunk/drivers/media/video/ivtv/ivtv-ioctl.c | 130 +- trunk/drivers/media/video/ivtv/ivtv-streams.c | 7 +- trunk/drivers/media/video/m52790.c | 2 +- trunk/drivers/media/video/meye.c | 19 +- trunk/drivers/media/video/msp3400-driver.c | 2 +- trunk/drivers/media/video/msp3400-kthreads.c | 1 + trunk/drivers/media/video/mt9m001.c | 2 +- trunk/drivers/media/video/ov511.c | 38 +- trunk/drivers/media/video/ov511.h | 1 - trunk/drivers/media/video/planb.c | 2309 +++++++++++++++++ trunk/drivers/media/video/planb.h | 232 ++ trunk/drivers/media/video/pms.c | 3 +- trunk/drivers/media/video/pvrusb2/Kconfig | 2 + .../media/video/pvrusb2/pvrusb2-context.h | 4 +- .../media/video/pvrusb2/pvrusb2-devattr.c | 11 +- .../media/video/pvrusb2/pvrusb2-devattr.h | 26 +- .../media/video/pvrusb2/pvrusb2-fx2-cmd.h | 2 - .../drivers/media/video/pvrusb2/pvrusb2-hdw.c | 9 - .../media/video/pvrusb2/pvrusb2-i2c-core.c | 4 +- .../media/video/pvrusb2/pvrusb2-v4l2.c | 6 +- trunk/drivers/media/video/pwc/pwc-if.c | 16 +- trunk/drivers/media/video/pwc/pwc.h | 2 - trunk/drivers/media/video/s2255drv.c | 130 +- trunk/drivers/media/video/saa5246a.c | 3 +- trunk/drivers/media/video/saa5249.c | 3 +- trunk/drivers/media/video/saa7134/Kconfig | 2 + .../media/video/saa7134/saa7134-cards.c | 3 + .../media/video/saa7134/saa7134-core.c | 16 +- .../media/video/saa7134/saa7134-empress.c | 54 +- .../media/video/saa7134/saa7134-video.c | 98 +- trunk/drivers/media/video/saa7134/saa7134.h | 7 +- trunk/drivers/media/video/saa717x.c | 1 + trunk/drivers/media/video/saa7196.h | 117 + trunk/drivers/media/video/se401.c | 2 + trunk/drivers/media/video/se401.h | 1 - .../media/video/sh_mobile_ceu_camera.c | 1 - trunk/drivers/media/video/sn9c102/sn9c102.h | 1 - .../media/video/sn9c102/sn9c102_core.c | 62 +- trunk/drivers/media/video/soc_camera.c | 68 +- trunk/drivers/media/video/stk-webcam.c | 69 +- trunk/drivers/media/video/stradis.c | 2 +- trunk/drivers/media/video/stv680.c | 52 +- trunk/drivers/media/video/tda7432.c | 3 +- trunk/drivers/media/video/tda9875.c | 2 +- trunk/drivers/media/video/tlv320aic23b.c | 2 +- trunk/drivers/media/video/tuner-core.c | 1 - trunk/drivers/media/video/tveeprom.c | 122 +- trunk/drivers/media/video/tvp5150.c | 2 +- trunk/drivers/media/video/usbvideo/usbvideo.c | 4 +- trunk/drivers/media/video/usbvideo/usbvideo.h | 1 - trunk/drivers/media/video/usbvideo/vicam.c | 3 +- .../media/video/usbvision/usbvision-core.c | 2 + .../media/video/usbvision/usbvision-video.c | 113 +- trunk/drivers/media/video/uvc/uvc_ctrl.c | 15 +- trunk/drivers/media/video/uvc/uvc_driver.c | 4 +- trunk/drivers/media/video/uvc/uvc_v4l2.c | 1 - trunk/drivers/media/video/v4l1-compat.c | 1 - trunk/drivers/media/video/v4l2-common.c | 2 +- trunk/drivers/media/video/v4l2-dev.c | 422 --- trunk/drivers/media/video/v4l2-ioctl.c | 1875 ------------- .../drivers/media/video/videobuf-dma-contig.c | 8 +- trunk/drivers/media/video/videobuf-vmalloc.c | 2 +- trunk/drivers/media/video/videodev.c | 2262 ++++++++++++++++ trunk/drivers/media/video/vino.c | 4 +- trunk/drivers/media/video/vivi.c | 18 +- trunk/drivers/media/video/vp27smpx.c | 2 +- trunk/drivers/media/video/w9966.c | 5 +- trunk/drivers/media/video/w9968cf.c | 5 +- trunk/drivers/media/video/w9968cf.h | 2 +- trunk/drivers/media/video/wm8739.c | 2 +- trunk/drivers/media/video/wm8775.c | 2 +- trunk/drivers/media/video/zc0301/zc0301.h | 1 - .../drivers/media/video/zc0301/zc0301_core.c | 2 + trunk/drivers/media/video/zoran_card.c | 42 +- trunk/drivers/media/video/zoran_card.h | 2 +- trunk/drivers/media/video/zoran_driver.c | 7 +- trunk/drivers/media/video/zr364xx.c | 18 +- trunk/drivers/mfd/asic3.c | 14 +- trunk/drivers/mfd/tc6393xb.c | 2 +- trunk/drivers/pcmcia/soc_common.c | 12 +- trunk/drivers/video/am200epd.c | 2 +- trunk/drivers/video/omap/sossi.c | 2 +- trunk/drivers/video/pxafb.c | 2 +- trunk/fs/nfs/super.c | 6 +- trunk/fs/nfs/unlink.c | 3 +- trunk/fs/proc/base.c | 10 +- trunk/include/asm-arm/arch-pnx4008/irqs.h | 48 +- trunk/include/asm-arm/arch-pxa/idp.h | 10 +- .../asm-arm/arch-pxa/pcm990_baseboard.h | 14 +- trunk/include/asm-arm/arch-pxa/pxa25x-udc.h | 2 +- trunk/include/asm-arm/arch-sa1100/ide.h | 2 +- trunk/include/asm-arm/bitops.h | 9 +- trunk/include/asm-arm/cacheflush.h | 17 +- trunk/include/asm-arm/irq.h | 17 + trunk/include/asm-arm/pci.h | 8 - trunk/include/asm-arm/plat-s3c/iic.h | 1 - trunk/include/asm-sparc/Kbuild | 1 + .../include/asm => include/asm-sparc}/agp.h | 0 .../include/asm => include/asm-sparc}/apb.h | 0 .../include/asm => include/asm-sparc}/apc.h | 0 .../include/asm => include/asm-sparc}/asi.h | 0 .../asm => include/asm-sparc}/asmmacro.h | 0 .../asm => include/asm-sparc}/atomic.h | 4 +- .../asm => include/asm-sparc}/atomic_32.h | 0 .../asm => include/asm-sparc}/atomic_64.h | 0 .../include/asm => include/asm-sparc}/auxio.h | 4 +- .../asm => include/asm-sparc}/auxio_32.h | 2 +- .../asm => include/asm-sparc}/auxio_64.h | 0 .../asm => include/asm-sparc}/auxvec.h | 0 .../asm => include/asm-sparc}/backoff.h | 0 .../include/asm => include/asm-sparc}/bbc.h | 0 .../asm => include/asm-sparc}/bitext.h | 0 .../asm => include/asm-sparc}/bitops.h | 4 +- .../asm => include/asm-sparc}/bitops_32.h | 0 .../asm => include/asm-sparc}/bitops_64.h | 0 .../include/asm => include/asm-sparc}/bpp.h | 0 .../asm => include/asm-sparc}/btfixup.h | 2 +- .../include/asm => include/asm-sparc}/bug.h | 0 .../include/asm => include/asm-sparc}/bugs.h | 2 +- .../asm => include/asm-sparc}/byteorder.h | 0 .../include/asm => include/asm-sparc}/cache.h | 0 .../asm => include/asm-sparc}/cacheflush.h | 4 +- .../asm => include/asm-sparc}/cacheflush_32.h | 0 .../asm => include/asm-sparc}/cacheflush_64.h | 0 .../asm => include/asm-sparc}/chafsr.h | 0 .../asm => include/asm-sparc}/checksum.h | 4 +- .../asm => include/asm-sparc}/checksum_32.h | 0 .../asm => include/asm-sparc}/checksum_64.h | 0 .../asm => include/asm-sparc}/chmctrl.h | 0 .../include/asm => include/asm-sparc}/clock.h | 0 .../include/asm => include/asm-sparc}/cmt.h | 0 .../asm => include/asm-sparc}/compat.h | 0 .../asm => include/asm-sparc}/compat_signal.h | 0 .../asm => include/asm-sparc}/contregs.h | 0 .../asm => include/asm-sparc}/cpudata.h | 4 +- .../asm => include/asm-sparc}/cpudata_32.h | 2 +- .../asm => include/asm-sparc}/cpudata_64.h | 0 .../asm => include/asm-sparc}/cputime.h | 0 .../asm => include/asm-sparc}/current.h | 2 +- .../asm => include/asm-sparc}/cypress.h | 0 .../include/asm => include/asm-sparc}/dcr.h | 0 .../include/asm => include/asm-sparc}/dcu.h | 0 .../include/asm => include/asm-sparc}/delay.h | 4 +- .../asm => include/asm-sparc}/delay_32.h | 0 .../asm => include/asm-sparc}/delay_64.h | 0 .../asm => include/asm-sparc}/device.h | 0 .../asm => include/asm-sparc}/display7seg.h | 0 .../include/asm => include/asm-sparc}/div64.h | 0 .../asm => include/asm-sparc}/dma-mapping.h | 4 +- .../asm-sparc}/dma-mapping_32.h | 0 .../asm-sparc}/dma-mapping_64.h | 0 .../include/asm => include/asm-sparc}/dma.h | 4 +- .../asm => include/asm-sparc}/dma_32.h | 2 +- .../asm => include/asm-sparc}/dma_64.h | 2 +- .../include/asm => include/asm-sparc}/ebus.h | 4 +- .../asm => include/asm-sparc}/ebus_32.h | 0 .../asm => include/asm-sparc}/ebus_64.h | 0 .../include/asm => include/asm-sparc}/ecc.h | 0 .../asm => include/asm-sparc}/eeprom.h | 0 .../include/asm => include/asm-sparc}/elf.h | 4 +- .../asm => include/asm-sparc}/elf_32.h | 0 .../asm => include/asm-sparc}/elf_64.h | 0 .../asm-sparc}/emergency-restart.h | 0 .../asm => include/asm-sparc}/envctrl.h | 0 .../include/asm => include/asm-sparc}/errno.h | 0 .../asm => include/asm-sparc}/estate.h | 0 .../include/asm => include/asm-sparc}/fb.h | 0 .../include/asm => include/asm-sparc}/fbio.h | 0 .../include/asm => include/asm-sparc}/fcntl.h | 0 .../include/asm => include/asm-sparc}/fhc.h | 0 .../asm => include/asm-sparc}/fixmap.h | 0 .../asm => include/asm-sparc}/floppy.h | 4 +- .../asm => include/asm-sparc}/floppy_32.h | 2 +- .../asm => include/asm-sparc}/floppy_64.h | 0 .../asm => include/asm-sparc}/fpumacro.h | 0 .../include/asm => include/asm-sparc}/futex.h | 4 +- .../asm => include/asm-sparc}/futex_32.h | 0 .../asm => include/asm-sparc}/futex_64.h | 0 .../asm => include/asm-sparc}/hardirq.h | 4 +- .../asm => include/asm-sparc}/hardirq_32.h | 0 .../asm => include/asm-sparc}/hardirq_64.h | 0 .../include/asm => include/asm-sparc}/head.h | 4 +- .../asm => include/asm-sparc}/head_32.h | 0 .../asm => include/asm-sparc}/head_64.h | 0 .../asm => include/asm-sparc}/highmem.h | 0 .../asm => include/asm-sparc}/hugetlb.h | 0 .../asm => include/asm-sparc}/hvtramp.h | 0 .../asm => include/asm-sparc}/hw_irq.h | 0 .../asm => include/asm-sparc}/hypervisor.h | 0 .../include/asm => include/asm-sparc}/ide.h | 0 .../asm => include/asm-sparc}/idprom.h | 0 .../asm => include/asm-sparc}/intr_queue.h | 0 .../asm => include/asm-sparc}/io-unit.h | 0 .../include/asm => include/asm-sparc}/io.h | 4 +- .../include/asm => include/asm-sparc}/io_32.h | 0 .../include/asm => include/asm-sparc}/io_64.h | 0 .../include/asm => include/asm-sparc}/ioctl.h | 0 .../asm => include/asm-sparc}/ioctls.h | 0 .../include/asm => include/asm-sparc}/iommu.h | 4 +- .../asm => include/asm-sparc}/iommu_32.h | 0 .../asm => include/asm-sparc}/iommu_64.h | 0 .../asm => include/asm-sparc}/ipcbuf.h | 4 +- .../asm => include/asm-sparc}/ipcbuf_32.h | 0 .../asm => include/asm-sparc}/ipcbuf_64.h | 0 .../include/asm => include/asm-sparc}/irq.h | 4 +- .../asm => include/asm-sparc}/irq_32.h | 0 .../asm => include/asm-sparc}/irq_64.h | 0 .../asm => include/asm-sparc}/irq_regs.h | 0 .../asm => include/asm-sparc}/irqflags.h | 4 +- .../asm => include/asm-sparc}/irqflags_32.h | 2 +- .../asm => include/asm-sparc}/irqflags_64.h | 2 +- .../asm => include/asm-sparc}/jsflash.h | 0 .../asm => include/asm-sparc}/kdebug.h | 4 +- .../asm => include/asm-sparc}/kdebug_32.h | 0 .../asm => include/asm-sparc}/kdebug_64.h | 0 .../include/asm => include/asm-sparc}/kgdb.h | 0 .../asm => include/asm-sparc}/kmap_types.h | 0 .../asm => include/asm-sparc}/kprobes.h | 0 .../include/asm => include/asm-sparc}/ldc.h | 0 .../asm => include/asm-sparc}/linkage.h | 0 .../include/asm => include/asm-sparc}/lmb.h | 0 .../include/asm => include/asm-sparc}/local.h | 0 .../include/asm => include/asm-sparc}/lsu.h | 0 .../asm => include/asm-sparc}/machines.h | 0 .../include/asm => include/asm-sparc}/mbus.h | 0 .../asm => include/asm-sparc}/mc146818rtc.h | 4 +- .../asm-sparc}/mc146818rtc_32.h | 0 .../asm-sparc}/mc146818rtc_64.h | 0 .../include/asm => include/asm-sparc}/mdesc.h | 0 .../asm => include/asm-sparc}/memreg.h | 0 .../include/asm => include/asm-sparc}/mman.h | 0 .../include/asm => include/asm-sparc}/mmu.h | 4 +- .../asm => include/asm-sparc}/mmu_32.h | 0 .../asm => include/asm-sparc}/mmu_64.h | 0 .../asm => include/asm-sparc}/mmu_context.h | 4 +- .../asm-sparc}/mmu_context_32.h | 0 .../asm-sparc}/mmu_context_64.h | 0 .../asm => include/asm-sparc}/mmzone.h | 0 .../asm => include/asm-sparc}/module.h | 4 +- .../asm => include/asm-sparc}/module_32.h | 0 .../asm => include/asm-sparc}/module_64.h | 0 .../asm => include/asm-sparc}/mostek.h | 4 +- .../asm => include/asm-sparc}/mostek_32.h | 0 .../asm => include/asm-sparc}/mostek_64.h | 0 .../asm => include/asm-sparc}/mpmbox.h | 0 .../asm => include/asm-sparc}/msgbuf.h | 0 .../include/asm => include/asm-sparc}/msi.h | 0 .../include/asm => include/asm-sparc}/mutex.h | 0 .../include/asm => include/asm-sparc}/mxcc.h | 0 .../asm => include/asm-sparc}/ns87303.h | 0 .../include/asm => include/asm-sparc}/obio.h | 0 .../asm => include/asm-sparc}/of_device.h | 0 .../asm => include/asm-sparc}/of_platform.h | 4 +- .../asm-sparc}/of_platform_32.h | 2 +- .../asm-sparc}/of_platform_64.h | 2 +- .../asm => include/asm-sparc}/openprom.h | 4 +- .../asm => include/asm-sparc}/openprom_32.h | 0 .../asm => include/asm-sparc}/openprom_64.h | 0 .../asm => include/asm-sparc}/openpromio.h | 0 .../include/asm => include/asm-sparc}/oplib.h | 4 +- .../asm => include/asm-sparc}/oplib_32.h | 0 .../asm => include/asm-sparc}/oplib_64.h | 0 .../include/asm => include/asm-sparc}/page.h | 4 +- .../asm => include/asm-sparc}/page_32.h | 0 .../asm => include/asm-sparc}/page_64.h | 0 .../include/asm => include/asm-sparc}/param.h | 0 .../asm => include/asm-sparc}/parport.h | 0 .../include/asm => include/asm-sparc}/pbm.h | 0 .../include/asm => include/asm-sparc}/pci.h | 4 +- .../asm => include/asm-sparc}/pci_32.h | 0 .../asm => include/asm-sparc}/pci_64.h | 0 .../include/asm => include/asm-sparc}/pcic.h | 0 .../asm => include/asm-sparc}/percpu.h | 4 +- .../asm => include/asm-sparc}/percpu_32.h | 0 .../asm => include/asm-sparc}/percpu_64.h | 0 .../asm => include/asm-sparc}/perfctr.h | 0 .../asm => include/asm-sparc}/pgalloc.h | 4 +- .../asm => include/asm-sparc}/pgalloc_32.h | 0 .../asm => include/asm-sparc}/pgalloc_64.h | 0 .../asm => include/asm-sparc}/pgtable.h | 4 +- .../asm => include/asm-sparc}/pgtable_32.h | 2 +- .../asm => include/asm-sparc}/pgtable_64.h | 0 .../asm => include/asm-sparc}/pgtsrmmu.h | 0 .../asm => include/asm-sparc}/pgtsun4.h | 0 .../asm => include/asm-sparc}/pgtsun4c.h | 0 .../include/asm => include/asm-sparc}/pil.h | 0 .../include/asm => include/asm-sparc}/poll.h | 0 .../asm => include/asm-sparc}/posix_types.h | 4 +- .../asm-sparc}/posix_types_32.h | 0 .../asm-sparc}/posix_types_64.h | 0 .../asm => include/asm-sparc}/processor.h | 4 +- .../asm => include/asm-sparc}/processor_32.h | 3 +- .../asm => include/asm-sparc}/processor_64.h | 2 +- .../include/asm => include/asm-sparc}/prom.h | 0 .../include/asm => include/asm-sparc}/psr.h | 0 .../asm => include/asm-sparc}/psrcompat.h | 0 .../asm => include/asm-sparc}/pstate.h | 0 .../asm => include/asm-sparc}/ptrace.h | 4 +- .../asm => include/asm-sparc}/ptrace_32.h | 1 - .../asm => include/asm-sparc}/ptrace_64.h | 1 - .../asm => include/asm-sparc}/reboot.h | 0 .../include/asm => include/asm-sparc}/reg.h | 4 +- .../asm => include/asm-sparc}/reg_32.h | 2 +- .../asm => include/asm-sparc}/reg_64.h | 2 +- .../asm => include/asm-sparc}/resource.h | 0 .../include/asm => include/asm-sparc}/ross.h | 0 .../include/asm => include/asm-sparc}/rtc.h | 0 .../asm => include/asm-sparc}/rwsem-const.h | 0 .../include/asm => include/asm-sparc}/rwsem.h | 0 .../include/asm => include/asm-sparc}/sbi.h | 0 .../include/asm => include/asm-sparc}/sbus.h | 4 +- .../asm => include/asm-sparc}/sbus_32.h | 0 .../asm => include/asm-sparc}/sbus_64.h | 0 .../asm => include/asm-sparc}/scatterlist.h | 4 +- .../asm-sparc}/scatterlist_32.h | 0 .../asm-sparc}/scatterlist_64.h | 0 .../asm => include/asm-sparc}/scratchpad.h | 0 .../asm => include/asm-sparc}/seccomp.h | 0 .../asm => include/asm-sparc}/sections.h | 4 +- .../asm => include/asm-sparc}/sections_32.h | 0 .../asm => include/asm-sparc}/sections_64.h | 0 .../asm => include/asm-sparc}/sembuf.h | 0 .../include/asm => include/asm-sparc}/setup.h | 0 .../asm => include/asm-sparc}/sfafsr.h | 0 .../asm => include/asm-sparc}/sfp-machine.h | 4 +- .../asm-sparc}/sfp-machine_32.h | 0 .../asm-sparc}/sfp-machine_64.h | 0 .../asm => include/asm-sparc}/shmbuf.h | 0 .../asm => include/asm-sparc}/shmparam.h | 4 +- .../asm => include/asm-sparc}/shmparam_32.h | 0 .../asm => include/asm-sparc}/shmparam_64.h | 0 .../asm => include/asm-sparc}/sigcontext.h | 4 +- .../asm => include/asm-sparc}/sigcontext_32.h | 0 .../asm => include/asm-sparc}/sigcontext_64.h | 0 .../asm => include/asm-sparc}/siginfo.h | 4 +- .../asm => include/asm-sparc}/siginfo_32.h | 0 .../asm => include/asm-sparc}/siginfo_64.h | 0 .../asm => include/asm-sparc}/signal.h | 4 +- .../asm => include/asm-sparc}/signal_32.h | 0 .../asm => include/asm-sparc}/signal_64.h | 0 .../include/asm => include/asm-sparc}/smp.h | 4 +- .../asm => include/asm-sparc}/smp_32.h | 0 .../asm => include/asm-sparc}/smp_64.h | 0 .../asm => include/asm-sparc}/smpprim.h | 0 .../asm => include/asm-sparc}/socket.h | 0 .../asm => include/asm-sparc}/sockios.h | 0 .../asm => include/asm-sparc}/sparsemem.h | 0 .../asm => include/asm-sparc}/spinlock.h | 4 +- .../asm => include/asm-sparc}/spinlock_32.h | 0 .../asm => include/asm-sparc}/spinlock_64.h | 0 .../asm-sparc}/spinlock_types.h | 0 .../asm => include/asm-sparc}/spitfire.h | 0 .../asm => include/asm-sparc}/sstate.h | 0 .../asm => include/asm-sparc}/stacktrace.h | 0 .../asm => include/asm-sparc}/starfire.h | 0 .../include/asm => include/asm-sparc}/stat.h | 4 +- .../asm => include/asm-sparc}/stat_32.h | 0 .../asm => include/asm-sparc}/stat_64.h | 0 .../asm => include/asm-sparc}/statfs.h | 4 +- .../asm => include/asm-sparc}/statfs_32.h | 0 .../asm => include/asm-sparc}/statfs_64.h | 0 .../asm => include/asm-sparc}/string.h | 4 +- .../asm => include/asm-sparc}/string_32.h | 0 .../asm => include/asm-sparc}/string_64.h | 0 .../asm => include/asm-sparc}/sun4paddr.h | 0 .../asm => include/asm-sparc}/sun4prom.h | 0 .../asm => include/asm-sparc}/sunbpp.h | 2 +- .../include/asm => include/asm-sparc}/swift.h | 0 .../asm => include/asm-sparc}/syscalls.h | 0 .../include/asm => include/asm-sparc}/sysen.h | 0 .../asm => include/asm-sparc}/system.h | 4 +- .../asm => include/asm-sparc}/system_32.h | 0 .../asm => include/asm-sparc}/system_64.h | 0 .../asm => include/asm-sparc}/termbits.h | 0 .../asm => include/asm-sparc}/termios.h | 0 .../asm => include/asm-sparc}/thread_info.h | 4 +- .../asm-sparc}/thread_info_32.h | 7 +- .../asm-sparc}/thread_info_64.h | 8 +- .../include/asm => include/asm-sparc}/timer.h | 4 +- .../asm => include/asm-sparc}/timer_32.h | 0 .../asm => include/asm-sparc}/timer_64.h | 0 .../include/asm => include/asm-sparc}/timex.h | 4 +- .../asm => include/asm-sparc}/timex_32.h | 2 +- .../asm => include/asm-sparc}/timex_64.h | 2 +- .../include/asm => include/asm-sparc}/tlb.h | 4 +- .../asm => include/asm-sparc}/tlb_32.h | 0 .../asm => include/asm-sparc}/tlb_64.h | 0 .../asm => include/asm-sparc}/tlbflush.h | 4 +- .../asm => include/asm-sparc}/tlbflush_32.h | 0 .../asm => include/asm-sparc}/tlbflush_64.h | 0 .../asm => include/asm-sparc}/topology.h | 4 +- .../asm => include/asm-sparc}/topology_32.h | 0 .../asm => include/asm-sparc}/topology_64.h | 0 .../include/asm => include/asm-sparc}/traps.h | 0 .../include/asm => include/asm-sparc}/tsb.h | 0 .../asm => include/asm-sparc}/tsunami.h | 0 .../asm => include/asm-sparc}/ttable.h | 0 .../asm => include/asm-sparc}/turbosparc.h | 0 .../include/asm => include/asm-sparc}/types.h | 0 .../asm => include/asm-sparc}/uaccess.h | 4 +- .../asm => include/asm-sparc}/uaccess_32.h | 0 .../asm => include/asm-sparc}/uaccess_64.h | 0 .../include/asm => include/asm-sparc}/uctx.h | 0 .../asm => include/asm-sparc}/unaligned.h | 0 .../asm => include/asm-sparc}/unistd.h | 4 +- .../asm => include/asm-sparc}/unistd_32.h | 0 .../asm => include/asm-sparc}/unistd_64.h | 0 .../include/asm => include/asm-sparc}/upa.h | 0 .../include/asm => include/asm-sparc}/user.h | 0 .../include/asm => include/asm-sparc}/utrap.h | 2 +- .../asm => include/asm-sparc}/vac-ops.h | 0 .../asm => include/asm-sparc}/vaddrs.h | 2 +- .../asm => include/asm-sparc}/vfc_ioctls.h | 0 .../include/asm => include/asm-sparc}/vga.h | 0 .../asm => include/asm-sparc}/viking.h | 0 .../include/asm => include/asm-sparc}/vio.h | 0 .../asm => include/asm-sparc}/visasm.h | 0 .../asm => include/asm-sparc}/watchdog.h | 0 .../asm => include/asm-sparc}/winmacro.h | 0 .../include/asm => include/asm-sparc}/xor.h | 4 +- .../asm => include/asm-sparc}/xor_32.h | 2 +- .../asm => include/asm-sparc}/xor_64.h | 2 +- trunk/include/asm-sparc64/Kbuild | 1 + trunk/include/asm-sparc64/agp.h | 1 + trunk/include/asm-sparc64/apb.h | 1 + trunk/include/asm-sparc64/asi.h | 1 + trunk/include/asm-sparc64/atomic.h | 1 + trunk/include/asm-sparc64/auxio.h | 1 + trunk/include/asm-sparc64/auxvec.h | 1 + trunk/include/asm-sparc64/backoff.h | 1 + trunk/include/asm-sparc64/bbc.h | 1 + trunk/include/asm-sparc64/bitops.h | 1 + trunk/include/asm-sparc64/bpp.h | 1 + trunk/include/asm-sparc64/bug.h | 1 + trunk/include/asm-sparc64/bugs.h | 1 + trunk/include/asm-sparc64/byteorder.h | 1 + trunk/include/asm-sparc64/cache.h | 1 + trunk/include/asm-sparc64/cacheflush.h | 1 + trunk/include/asm-sparc64/chafsr.h | 1 + trunk/include/asm-sparc64/checksum.h | 1 + trunk/include/asm-sparc64/chmctrl.h | 1 + trunk/include/asm-sparc64/cmt.h | 1 + trunk/include/asm-sparc64/compat.h | 1 + trunk/include/asm-sparc64/compat_signal.h | 1 + trunk/include/asm-sparc64/cpudata.h | 1 + trunk/include/asm-sparc64/cputime.h | 1 + trunk/include/asm-sparc64/current.h | 1 + trunk/include/asm-sparc64/dcr.h | 1 + trunk/include/asm-sparc64/dcu.h | 1 + trunk/include/asm-sparc64/delay.h | 1 + trunk/include/asm-sparc64/device.h | 1 + trunk/include/asm-sparc64/display7seg.h | 1 + trunk/include/asm-sparc64/div64.h | 1 + trunk/include/asm-sparc64/dma-mapping.h | 1 + trunk/include/asm-sparc64/dma.h | 1 + trunk/include/asm-sparc64/ebus.h | 1 + trunk/include/asm-sparc64/elf.h | 1 + trunk/include/asm-sparc64/emergency-restart.h | 1 + trunk/include/asm-sparc64/envctrl.h | 1 + trunk/include/asm-sparc64/errno.h | 1 + trunk/include/asm-sparc64/estate.h | 1 + trunk/include/asm-sparc64/fb.h | 1 + trunk/include/asm-sparc64/fbio.h | 1 + trunk/include/asm-sparc64/fcntl.h | 1 + trunk/include/asm-sparc64/fhc.h | 1 + trunk/include/asm-sparc64/floppy.h | 1 + trunk/include/asm-sparc64/fpumacro.h | 1 + .../asm => include/asm-sparc64}/ftrace.h | 0 trunk/include/asm-sparc64/futex.h | 1 + trunk/include/asm-sparc64/hardirq.h | 1 + trunk/include/asm-sparc64/head.h | 1 + trunk/include/asm-sparc64/hugetlb.h | 1 + trunk/include/asm-sparc64/hvtramp.h | 1 + trunk/include/asm-sparc64/hw_irq.h | 1 + trunk/include/asm-sparc64/hypervisor.h | 1 + trunk/include/asm-sparc64/ide.h | 1 + trunk/include/asm-sparc64/idprom.h | 1 + trunk/include/asm-sparc64/intr_queue.h | 1 + trunk/include/asm-sparc64/io.h | 1 + trunk/include/asm-sparc64/ioctl.h | 1 + trunk/include/asm-sparc64/ioctls.h | 1 + trunk/include/asm-sparc64/iommu.h | 1 + trunk/include/asm-sparc64/ipcbuf.h | 1 + trunk/include/asm-sparc64/irq.h | 1 + trunk/include/asm-sparc64/irq_regs.h | 1 + trunk/include/asm-sparc64/irqflags.h | 1 + trunk/include/asm-sparc64/kdebug.h | 1 + trunk/include/asm-sparc64/kgdb.h | 1 + trunk/include/asm-sparc64/kmap_types.h | 1 + trunk/include/asm-sparc64/kprobes.h | 1 + trunk/include/asm-sparc64/ldc.h | 1 + trunk/include/asm-sparc64/linkage.h | 1 + trunk/include/asm-sparc64/lmb.h | 1 + trunk/include/asm-sparc64/local.h | 1 + trunk/include/asm-sparc64/lsu.h | 1 + trunk/include/asm-sparc64/mc146818rtc.h | 1 + trunk/include/asm-sparc64/mdesc.h | 1 + trunk/include/asm-sparc64/mman.h | 1 + trunk/include/asm-sparc64/mmu.h | 1 + trunk/include/asm-sparc64/mmu_context.h | 1 + trunk/include/asm-sparc64/mmzone.h | 1 + trunk/include/asm-sparc64/module.h | 1 + trunk/include/asm-sparc64/mostek.h | 1 + trunk/include/asm-sparc64/msgbuf.h | 1 + trunk/include/asm-sparc64/mutex.h | 1 + trunk/include/asm-sparc64/ns87303.h | 1 + trunk/include/asm-sparc64/of_device.h | 1 + trunk/include/asm-sparc64/of_platform.h | 1 + trunk/include/asm-sparc64/openprom.h | 1 + trunk/include/asm-sparc64/openpromio.h | 1 + trunk/include/asm-sparc64/oplib.h | 1 + trunk/include/asm-sparc64/page.h | 1 + trunk/include/asm-sparc64/param.h | 1 + trunk/include/asm-sparc64/parport.h | 1 + trunk/include/asm-sparc64/pci.h | 1 + trunk/include/asm-sparc64/percpu.h | 1 + trunk/include/asm-sparc64/perfctr.h | 1 + trunk/include/asm-sparc64/pgalloc.h | 1 + trunk/include/asm-sparc64/pgtable.h | 1 + trunk/include/asm-sparc64/pil.h | 1 + trunk/include/asm-sparc64/poll.h | 1 + trunk/include/asm-sparc64/posix_types.h | 1 + trunk/include/asm-sparc64/processor.h | 1 + trunk/include/asm-sparc64/prom.h | 1 + trunk/include/asm-sparc64/psrcompat.h | 1 + trunk/include/asm-sparc64/pstate.h | 1 + trunk/include/asm-sparc64/ptrace.h | 1 + trunk/include/asm-sparc64/reboot.h | 1 + trunk/include/asm-sparc64/reg.h | 1 + trunk/include/asm-sparc64/resource.h | 1 + trunk/include/asm-sparc64/rtc.h | 1 + trunk/include/asm-sparc64/rwsem-const.h | 1 + trunk/include/asm-sparc64/rwsem.h | 1 + trunk/include/asm-sparc64/sbus.h | 1 + trunk/include/asm-sparc64/scatterlist.h | 1 + trunk/include/asm-sparc64/scratchpad.h | 1 + trunk/include/asm-sparc64/seccomp.h | 1 + trunk/include/asm-sparc64/sections.h | 1 + trunk/include/asm-sparc64/sembuf.h | 1 + trunk/include/asm-sparc64/setup.h | 1 + trunk/include/asm-sparc64/sfafsr.h | 1 + trunk/include/asm-sparc64/sfp-machine.h | 1 + trunk/include/asm-sparc64/shmbuf.h | 1 + trunk/include/asm-sparc64/shmparam.h | 1 + trunk/include/asm-sparc64/sigcontext.h | 1 + trunk/include/asm-sparc64/siginfo.h | 1 + trunk/include/asm-sparc64/signal.h | 1 + trunk/include/asm-sparc64/smp.h | 1 + trunk/include/asm-sparc64/socket.h | 1 + trunk/include/asm-sparc64/sockios.h | 1 + trunk/include/asm-sparc64/sparsemem.h | 1 + trunk/include/asm-sparc64/spinlock.h | 1 + trunk/include/asm-sparc64/spinlock_types.h | 1 + trunk/include/asm-sparc64/spitfire.h | 1 + trunk/include/asm-sparc64/sstate.h | 1 + trunk/include/asm-sparc64/stacktrace.h | 1 + trunk/include/asm-sparc64/starfire.h | 1 + trunk/include/asm-sparc64/stat.h | 1 + trunk/include/asm-sparc64/statfs.h | 1 + trunk/include/asm-sparc64/string.h | 1 + trunk/include/asm-sparc64/sunbpp.h | 1 + trunk/include/asm-sparc64/syscalls.h | 1 + trunk/include/asm-sparc64/system.h | 1 + trunk/include/asm-sparc64/termbits.h | 1 + trunk/include/asm-sparc64/termios.h | 1 + trunk/include/asm-sparc64/thread_info.h | 1 + trunk/include/asm-sparc64/timer.h | 1 + trunk/include/asm-sparc64/timex.h | 1 + trunk/include/asm-sparc64/tlb.h | 1 + trunk/include/asm-sparc64/tlbflush.h | 1 + trunk/include/asm-sparc64/topology.h | 1 + trunk/include/asm-sparc64/tsb.h | 1 + trunk/include/asm-sparc64/ttable.h | 1 + trunk/include/asm-sparc64/types.h | 1 + trunk/include/asm-sparc64/uaccess.h | 1 + trunk/include/asm-sparc64/uctx.h | 1 + trunk/include/asm-sparc64/unaligned.h | 1 + trunk/include/asm-sparc64/unistd.h | 1 + trunk/include/asm-sparc64/upa.h | 1 + trunk/include/asm-sparc64/user.h | 1 + trunk/include/asm-sparc64/utrap.h | 1 + trunk/include/asm-sparc64/vga.h | 1 + trunk/include/asm-sparc64/vio.h | 1 + trunk/include/asm-sparc64/visasm.h | 1 + trunk/include/asm-sparc64/watchdog.h | 1 + trunk/include/asm-sparc64/xor.h | 1 + trunk/include/linux/sched.h | 12 +- trunk/include/linux/task_io_accounting.h | 17 +- trunk/include/linux/task_io_accounting_ops.h | 48 +- trunk/include/linux/videodev.h | 15 - trunk/include/linux/videodev2.h | 386 +-- trunk/include/linux/videotext.h | 16 +- trunk/include/media/audiochip.h | 26 + trunk/include/media/saa7146_vv.h | 1 - trunk/include/media/tveeprom.h | 7 +- trunk/include/media/v4l2-chip-ident.h | 7 +- trunk/include/media/v4l2-common.h | 31 +- trunk/include/media/v4l2-dev.h | 325 ++- trunk/include/media/v4l2-ioctl.h | 301 --- trunk/kernel/module.c | 25 +- trunk/kernel/tsacct.c | 14 +- trunk/net/dccp/dccp.h | 2 +- trunk/net/dccp/ipv4.c | 9 +- trunk/net/dccp/ipv6.c | 16 +- trunk/net/dccp/output.c | 53 +- trunk/net/dccp/timer.c | 20 +- trunk/net/ipv4/ipcomp.c | 4 +- trunk/net/ipv6/ipcomp6.c | 4 +- trunk/sound/i2c/other/tea575x-tuner.c | 2 + 818 files changed, 10251 insertions(+), 11550 deletions(-) delete mode 100644 trunk/Documentation/i2c/upgrading-clients mode change 100644 => 100755 trunk/arch/arm/mach-at91/board-yl-9200.c delete mode 100644 trunk/arch/sparc/include/asm/Kbuild delete mode 100644 trunk/arch/sparc/include/asm/syscall.h delete mode 100644 trunk/drivers/media/common/tuners/mxl5007t.c delete mode 100644 trunk/drivers/media/common/tuners/mxl5007t.h delete mode 100644 trunk/drivers/media/dvb/dvb-usb/dw2102.c delete mode 100644 trunk/drivers/media/dvb/dvb-usb/dw2102.h delete mode 100644 trunk/drivers/media/dvb/frontends/drx397xD.c delete mode 100644 trunk/drivers/media/dvb/frontends/drx397xD.h delete mode 100644 trunk/drivers/media/dvb/frontends/drx397xD_fw.h delete mode 100644 trunk/drivers/media/dvb/frontends/z0194a.h delete mode 100644 trunk/drivers/media/video/v4l2-dev.c delete mode 100644 trunk/drivers/media/video/v4l2-ioctl.c create mode 100644 trunk/include/asm-sparc/Kbuild rename trunk/{arch/sparc/include/asm => include/asm-sparc}/agp.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/apb.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/apc.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/asi.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/asmmacro.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/atomic.h (65%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/atomic_32.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/atomic_64.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/auxio.h (65%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/auxio_32.h (97%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/auxio_64.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/auxvec.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/backoff.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/bbc.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/bitext.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/bitops.h (65%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/bitops_32.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/bitops_64.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/bpp.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/btfixup.h (99%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/bug.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/bugs.h (87%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/byteorder.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/cache.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/cacheflush.h (64%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/cacheflush_32.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/cacheflush_64.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/chafsr.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/checksum.h (65%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/checksum_32.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/checksum_64.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/chmctrl.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/clock.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/cmt.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/compat.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/compat_signal.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/contregs.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/cpudata.h (65%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/cpudata_32.h (89%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/cpudata_64.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/cputime.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/current.h (96%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/cypress.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/dcr.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/dcu.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/delay.h (65%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/delay_32.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/delay_64.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/device.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/display7seg.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/div64.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/dma-mapping.h (64%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/dma-mapping_32.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/dma-mapping_64.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/dma.h (66%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/dma_32.h (99%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/dma_64.h (99%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/ebus.h (66%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/ebus_32.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/ebus_64.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/ecc.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/eeprom.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/elf.h (66%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/elf_32.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/elf_64.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/emergency-restart.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/envctrl.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/errno.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/estate.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/fb.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/fbio.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/fcntl.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/fhc.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/fixmap.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/floppy.h (65%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/floppy_32.h (99%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/floppy_64.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/fpumacro.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/futex.h (65%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/futex_32.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/futex_64.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/hardirq.h (65%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/hardirq_32.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/hardirq_64.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/head.h (66%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/head_32.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/head_64.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/highmem.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/hugetlb.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/hvtramp.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/hw_irq.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/hypervisor.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/ide.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/idprom.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/intr_queue.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/io-unit.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/io.h (67%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/io_32.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/io_64.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/ioctl.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/ioctls.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/iommu.h (65%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/iommu_32.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/iommu_64.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/ipcbuf.h (65%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/ipcbuf_32.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/ipcbuf_64.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/irq.h (66%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/irq_32.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/irq_64.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/irq_regs.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/irqflags.h (65%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/irqflags_32.h (96%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/irqflags_64.h (97%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/jsflash.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/kdebug.h (65%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/kdebug_32.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/kdebug_64.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/kgdb.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/kmap_types.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/kprobes.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/ldc.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/linkage.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/lmb.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/local.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/lsu.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/machines.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/mbus.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/mc146818rtc.h (64%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/mc146818rtc_32.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/mc146818rtc_64.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/mdesc.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/memreg.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/mman.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/mmu.h (66%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/mmu_32.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/mmu_64.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/mmu_context.h (64%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/mmu_context_32.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/mmu_context_64.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/mmzone.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/module.h (65%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/module_32.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/module_64.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/mostek.h (65%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/mostek_32.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/mostek_64.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/mpmbox.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/msgbuf.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/msi.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/mutex.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/mxcc.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/ns87303.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/obio.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/of_device.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/of_platform.h (64%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/of_platform_32.h (91%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/of_platform_64.h (91%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/openprom.h (65%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/openprom_32.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/openprom_64.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/openpromio.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/oplib.h (65%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/oplib_32.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/oplib_64.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/page.h (66%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/page_32.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/page_64.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/param.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/parport.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/pbm.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/pci.h (66%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/pci_32.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/pci_64.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/pcic.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/percpu.h (65%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/percpu_32.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/percpu_64.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/perfctr.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/pgalloc.h (65%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/pgalloc_32.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/pgalloc_64.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/pgtable.h (65%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/pgtable_32.h (99%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/pgtable_64.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/pgtsrmmu.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/pgtsun4.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/pgtsun4c.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/pil.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/poll.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/posix_types.h (64%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/posix_types_32.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/posix_types_64.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/processor.h (64%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/processor_32.h (97%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/processor_64.h (99%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/prom.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/psr.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/psrcompat.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/pstate.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/ptrace.h (65%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/ptrace_32.h (98%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/ptrace_64.h (99%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/reboot.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/reg.h (66%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/reg_32.h (98%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/reg_64.h (97%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/resource.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/ross.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/rtc.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/rwsem-const.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/rwsem.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/sbi.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/sbus.h (66%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/sbus_32.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/sbus_64.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/scatterlist.h (64%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/scatterlist_32.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/scatterlist_64.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/scratchpad.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/seccomp.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/sections.h (65%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/sections_32.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/sections_64.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/sembuf.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/setup.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/sfafsr.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/sfp-machine.h (64%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/sfp-machine_32.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/sfp-machine_64.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/shmbuf.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/shmparam.h (65%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/shmparam_32.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/shmparam_64.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/sigcontext.h (64%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/sigcontext_32.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/sigcontext_64.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/siginfo.h (65%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/siginfo_32.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/siginfo_64.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/signal.h (65%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/signal_32.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/signal_64.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/smp.h (66%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/smp_32.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/smp_64.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/smpprim.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/socket.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/sockios.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/sparsemem.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/spinlock.h (65%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/spinlock_32.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/spinlock_64.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/spinlock_types.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/spitfire.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/sstate.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/stacktrace.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/starfire.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/stat.h (66%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/stat_32.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/stat_64.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/statfs.h (65%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/statfs_32.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/statfs_64.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/string.h (65%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/string_32.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/string_64.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/sun4paddr.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/sun4prom.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/sunbpp.h (99%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/swift.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/syscalls.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/sysen.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/system.h (65%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/system_32.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/system_64.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/termbits.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/termios.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/thread_info.h (64%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/thread_info_32.h (95%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/thread_info_64.h (97%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/timer.h (65%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/timer_32.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/timer_64.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/timex.h (65%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/timex_32.h (89%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/timex_64.h (90%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/tlb.h (66%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/tlb_32.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/tlb_64.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/tlbflush.h (65%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/tlbflush_32.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/tlbflush_64.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/topology.h (65%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/topology_32.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/topology_64.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/traps.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/tsb.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/tsunami.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/ttable.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/turbosparc.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/types.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/uaccess.h (65%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/uaccess_32.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/uaccess_64.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/uctx.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/unaligned.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/unistd.h (65%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/unistd_32.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/unistd_64.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/upa.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/user.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/utrap.h (97%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/vac-ops.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/vaddrs.h (97%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/vfc_ioctls.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/vga.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/viking.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/vio.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/visasm.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/watchdog.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/winmacro.h (100%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/xor.h (66%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/xor_32.h (99%) rename trunk/{arch/sparc/include/asm => include/asm-sparc}/xor_64.h (98%) create mode 100644 trunk/include/asm-sparc64/Kbuild create mode 100644 trunk/include/asm-sparc64/agp.h create mode 100644 trunk/include/asm-sparc64/apb.h create mode 100644 trunk/include/asm-sparc64/asi.h create mode 100644 trunk/include/asm-sparc64/atomic.h create mode 100644 trunk/include/asm-sparc64/auxio.h create mode 100644 trunk/include/asm-sparc64/auxvec.h create mode 100644 trunk/include/asm-sparc64/backoff.h create mode 100644 trunk/include/asm-sparc64/bbc.h create mode 100644 trunk/include/asm-sparc64/bitops.h create mode 100644 trunk/include/asm-sparc64/bpp.h create mode 100644 trunk/include/asm-sparc64/bug.h create mode 100644 trunk/include/asm-sparc64/bugs.h create mode 100644 trunk/include/asm-sparc64/byteorder.h create mode 100644 trunk/include/asm-sparc64/cache.h create mode 100644 trunk/include/asm-sparc64/cacheflush.h create mode 100644 trunk/include/asm-sparc64/chafsr.h create mode 100644 trunk/include/asm-sparc64/checksum.h create mode 100644 trunk/include/asm-sparc64/chmctrl.h create mode 100644 trunk/include/asm-sparc64/cmt.h create mode 100644 trunk/include/asm-sparc64/compat.h create mode 100644 trunk/include/asm-sparc64/compat_signal.h create mode 100644 trunk/include/asm-sparc64/cpudata.h create mode 100644 trunk/include/asm-sparc64/cputime.h create mode 100644 trunk/include/asm-sparc64/current.h create mode 100644 trunk/include/asm-sparc64/dcr.h create mode 100644 trunk/include/asm-sparc64/dcu.h create mode 100644 trunk/include/asm-sparc64/delay.h create mode 100644 trunk/include/asm-sparc64/device.h create mode 100644 trunk/include/asm-sparc64/display7seg.h create mode 100644 trunk/include/asm-sparc64/div64.h create mode 100644 trunk/include/asm-sparc64/dma-mapping.h create mode 100644 trunk/include/asm-sparc64/dma.h create mode 100644 trunk/include/asm-sparc64/ebus.h create mode 100644 trunk/include/asm-sparc64/elf.h create mode 100644 trunk/include/asm-sparc64/emergency-restart.h create mode 100644 trunk/include/asm-sparc64/envctrl.h create mode 100644 trunk/include/asm-sparc64/errno.h create mode 100644 trunk/include/asm-sparc64/estate.h create mode 100644 trunk/include/asm-sparc64/fb.h create mode 100644 trunk/include/asm-sparc64/fbio.h create mode 100644 trunk/include/asm-sparc64/fcntl.h create mode 100644 trunk/include/asm-sparc64/fhc.h create mode 100644 trunk/include/asm-sparc64/floppy.h create mode 100644 trunk/include/asm-sparc64/fpumacro.h rename trunk/{arch/sparc/include/asm => include/asm-sparc64}/ftrace.h (100%) create mode 100644 trunk/include/asm-sparc64/futex.h create mode 100644 trunk/include/asm-sparc64/hardirq.h create mode 100644 trunk/include/asm-sparc64/head.h create mode 100644 trunk/include/asm-sparc64/hugetlb.h create mode 100644 trunk/include/asm-sparc64/hvtramp.h create mode 100644 trunk/include/asm-sparc64/hw_irq.h create mode 100644 trunk/include/asm-sparc64/hypervisor.h create mode 100644 trunk/include/asm-sparc64/ide.h create mode 100644 trunk/include/asm-sparc64/idprom.h create mode 100644 trunk/include/asm-sparc64/intr_queue.h create mode 100644 trunk/include/asm-sparc64/io.h create mode 100644 trunk/include/asm-sparc64/ioctl.h create mode 100644 trunk/include/asm-sparc64/ioctls.h create mode 100644 trunk/include/asm-sparc64/iommu.h create mode 100644 trunk/include/asm-sparc64/ipcbuf.h create mode 100644 trunk/include/asm-sparc64/irq.h create mode 100644 trunk/include/asm-sparc64/irq_regs.h create mode 100644 trunk/include/asm-sparc64/irqflags.h create mode 100644 trunk/include/asm-sparc64/kdebug.h create mode 100644 trunk/include/asm-sparc64/kgdb.h create mode 100644 trunk/include/asm-sparc64/kmap_types.h create mode 100644 trunk/include/asm-sparc64/kprobes.h create mode 100644 trunk/include/asm-sparc64/ldc.h create mode 100644 trunk/include/asm-sparc64/linkage.h create mode 100644 trunk/include/asm-sparc64/lmb.h create mode 100644 trunk/include/asm-sparc64/local.h create mode 100644 trunk/include/asm-sparc64/lsu.h create mode 100644 trunk/include/asm-sparc64/mc146818rtc.h create mode 100644 trunk/include/asm-sparc64/mdesc.h create mode 100644 trunk/include/asm-sparc64/mman.h create mode 100644 trunk/include/asm-sparc64/mmu.h create mode 100644 trunk/include/asm-sparc64/mmu_context.h create mode 100644 trunk/include/asm-sparc64/mmzone.h create mode 100644 trunk/include/asm-sparc64/module.h create mode 100644 trunk/include/asm-sparc64/mostek.h create mode 100644 trunk/include/asm-sparc64/msgbuf.h create mode 100644 trunk/include/asm-sparc64/mutex.h create mode 100644 trunk/include/asm-sparc64/ns87303.h create mode 100644 trunk/include/asm-sparc64/of_device.h create mode 100644 trunk/include/asm-sparc64/of_platform.h create mode 100644 trunk/include/asm-sparc64/openprom.h create mode 100644 trunk/include/asm-sparc64/openpromio.h create mode 100644 trunk/include/asm-sparc64/oplib.h create mode 100644 trunk/include/asm-sparc64/page.h create mode 100644 trunk/include/asm-sparc64/param.h create mode 100644 trunk/include/asm-sparc64/parport.h create mode 100644 trunk/include/asm-sparc64/pci.h create mode 100644 trunk/include/asm-sparc64/percpu.h create mode 100644 trunk/include/asm-sparc64/perfctr.h create mode 100644 trunk/include/asm-sparc64/pgalloc.h create mode 100644 trunk/include/asm-sparc64/pgtable.h create mode 100644 trunk/include/asm-sparc64/pil.h create mode 100644 trunk/include/asm-sparc64/poll.h create mode 100644 trunk/include/asm-sparc64/posix_types.h create mode 100644 trunk/include/asm-sparc64/processor.h create mode 100644 trunk/include/asm-sparc64/prom.h create mode 100644 trunk/include/asm-sparc64/psrcompat.h create mode 100644 trunk/include/asm-sparc64/pstate.h create mode 100644 trunk/include/asm-sparc64/ptrace.h create mode 100644 trunk/include/asm-sparc64/reboot.h create mode 100644 trunk/include/asm-sparc64/reg.h create mode 100644 trunk/include/asm-sparc64/resource.h create mode 100644 trunk/include/asm-sparc64/rtc.h create mode 100644 trunk/include/asm-sparc64/rwsem-const.h create mode 100644 trunk/include/asm-sparc64/rwsem.h create mode 100644 trunk/include/asm-sparc64/sbus.h create mode 100644 trunk/include/asm-sparc64/scatterlist.h create mode 100644 trunk/include/asm-sparc64/scratchpad.h create mode 100644 trunk/include/asm-sparc64/seccomp.h create mode 100644 trunk/include/asm-sparc64/sections.h create mode 100644 trunk/include/asm-sparc64/sembuf.h create mode 100644 trunk/include/asm-sparc64/setup.h create mode 100644 trunk/include/asm-sparc64/sfafsr.h create mode 100644 trunk/include/asm-sparc64/sfp-machine.h create mode 100644 trunk/include/asm-sparc64/shmbuf.h create mode 100644 trunk/include/asm-sparc64/shmparam.h create mode 100644 trunk/include/asm-sparc64/sigcontext.h create mode 100644 trunk/include/asm-sparc64/siginfo.h create mode 100644 trunk/include/asm-sparc64/signal.h create mode 100644 trunk/include/asm-sparc64/smp.h create mode 100644 trunk/include/asm-sparc64/socket.h create mode 100644 trunk/include/asm-sparc64/sockios.h create mode 100644 trunk/include/asm-sparc64/sparsemem.h create mode 100644 trunk/include/asm-sparc64/spinlock.h create mode 100644 trunk/include/asm-sparc64/spinlock_types.h create mode 100644 trunk/include/asm-sparc64/spitfire.h create mode 100644 trunk/include/asm-sparc64/sstate.h create mode 100644 trunk/include/asm-sparc64/stacktrace.h create mode 100644 trunk/include/asm-sparc64/starfire.h create mode 100644 trunk/include/asm-sparc64/stat.h create mode 100644 trunk/include/asm-sparc64/statfs.h create mode 100644 trunk/include/asm-sparc64/string.h create mode 100644 trunk/include/asm-sparc64/sunbpp.h create mode 100644 trunk/include/asm-sparc64/syscalls.h create mode 100644 trunk/include/asm-sparc64/system.h create mode 100644 trunk/include/asm-sparc64/termbits.h create mode 100644 trunk/include/asm-sparc64/termios.h create mode 100644 trunk/include/asm-sparc64/thread_info.h create mode 100644 trunk/include/asm-sparc64/timer.h create mode 100644 trunk/include/asm-sparc64/timex.h create mode 100644 trunk/include/asm-sparc64/tlb.h create mode 100644 trunk/include/asm-sparc64/tlbflush.h create mode 100644 trunk/include/asm-sparc64/topology.h create mode 100644 trunk/include/asm-sparc64/tsb.h create mode 100644 trunk/include/asm-sparc64/ttable.h create mode 100644 trunk/include/asm-sparc64/types.h create mode 100644 trunk/include/asm-sparc64/uaccess.h create mode 100644 trunk/include/asm-sparc64/uctx.h create mode 100644 trunk/include/asm-sparc64/unaligned.h create mode 100644 trunk/include/asm-sparc64/unistd.h create mode 100644 trunk/include/asm-sparc64/upa.h create mode 100644 trunk/include/asm-sparc64/user.h create mode 100644 trunk/include/asm-sparc64/utrap.h create mode 100644 trunk/include/asm-sparc64/vga.h create mode 100644 trunk/include/asm-sparc64/vio.h create mode 100644 trunk/include/asm-sparc64/visasm.h create mode 100644 trunk/include/asm-sparc64/watchdog.h create mode 100644 trunk/include/asm-sparc64/xor.h delete mode 100644 trunk/include/media/v4l2-ioctl.h diff --git a/[refs] b/[refs] index 7274ffff92e7..80bb3e160837 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 58f250714f2bfa3514798fde8b9d38a15e4a9836 +refs/heads/master: 15bba37d62351749c3915add81f673b256952ee1 diff --git a/trunk/Documentation/SubmittingPatches b/trunk/Documentation/SubmittingPatches index f79ad9ff6031..118ca6e9404f 100644 --- a/trunk/Documentation/SubmittingPatches +++ b/trunk/Documentation/SubmittingPatches @@ -528,33 +528,7 @@ See more details on the proper patch format in the following references. -16) Sending "git pull" requests (from Linus emails) -Please write the git repo address and branch name alone on the same line -so that I can't even by mistake pull from the wrong branch, and so -that a triple-click just selects the whole thing. - -So the proper format is something along the lines of: - - "Please pull from - - git://jdelvare.pck.nerim.net/jdelvare-2.6 i2c-for-linus - - to get these changes:" - -so that I don't have to hunt-and-peck for the address and inevitably -get it wrong (actually, I've only gotten it wrong a few times, and -checking against the diffstat tells me when I get it wrong, but I'm -just a lot more comfortable when I don't have to "look for" the right -thing to pull, and double-check that I have the right branch-name). - - -Please use "git diff -M --stat --summary" to generate the diffstat: -the -M enables rename detection, and the summary enables a summary of -new/deleted or renamed files. - -With rename detection, the statistics are rather different [...] -because git will notice that a fair number of the changes are renames. ----------------------------------- SECTION 2 - HINTS, TIPS, AND TRICKS diff --git a/trunk/Documentation/arm/Interrupts b/trunk/Documentation/arm/Interrupts index c202ed35d7d6..0d3dbf1099bc 100644 --- a/trunk/Documentation/arm/Interrupts +++ b/trunk/Documentation/arm/Interrupts @@ -138,8 +138,14 @@ So, what's changed? Set active the IRQ edge(s)/level. This replaces the SA1111 INTPOL manipulation, and the set_GPIO_IRQ_edge() - function. Type should be one of IRQ_TYPE_xxx defined in - + function. Type should be one of the following: + + #define IRQT_NOEDGE (0) + #define IRQT_RISING (__IRQT_RISEDGE) + #define IRQT_FALLING (__IRQT_FALEDGE) + #define IRQT_BOTHEDGE (__IRQT_RISEDGE|__IRQT_FALEDGE) + #define IRQT_LOW (__IRQT_LOWLVL) + #define IRQT_HIGH (__IRQT_HIGHLVL) 3. set_GPIO_IRQ_edge() is obsolete, and should be replaced by set_irq_type. diff --git a/trunk/Documentation/feature-removal-schedule.txt b/trunk/Documentation/feature-removal-schedule.txt index c23955404bf5..721c71b86e06 100644 --- a/trunk/Documentation/feature-removal-schedule.txt +++ b/trunk/Documentation/feature-removal-schedule.txt @@ -47,30 +47,6 @@ Who: Mauro Carvalho Chehab --------------------------- -What: old tuner-3036 i2c driver -When: 2.6.28 -Why: This driver is for VERY old i2c-over-parallel port teletext receiver - boxes. Rather then spending effort on converting this driver to V4L2, - and since it is extremely unlikely that anyone still uses one of these - devices, it was decided to drop it. -Who: Hans Verkuil - Mauro Carvalho Chehab - - --------------------------- - -What: V4L2 dpc7146 driver -When: 2.6.28 -Why: Old driver for the dpc7146 demonstration board that is no longer - relevant. The last time this was tested on actual hardware was - probably around 2002. Since this is a driver for a demonstration - board the decision was made to remove it rather than spending a - lot of effort continually updating this driver to stay in sync - with the latest internal V4L2 or I2C API. -Who: Hans Verkuil - Mauro Carvalho Chehab - ---------------------------- - What: PCMCIA control ioctl (needed for pcmcia-cs [cardmgr, cardctl]) When: November 2005 Files: drivers/pcmcia/: pcmcia_ioctl.c diff --git a/trunk/Documentation/i2c/upgrading-clients b/trunk/Documentation/i2c/upgrading-clients deleted file mode 100644 index 9a45f9bb6a25..000000000000 --- a/trunk/Documentation/i2c/upgrading-clients +++ /dev/null @@ -1,281 +0,0 @@ -Upgrading I2C Drivers to the new 2.6 Driver Model -================================================= - -Ben Dooks - -Introduction ------------- - -This guide outlines how to alter existing Linux 2.6 client drivers from -the old to the new new binding methods. - - -Example old-style driver ------------------------- - - -struct example_state { - struct i2c_client client; - .... -}; - -static struct i2c_driver example_driver; - -static unsigned short ignore[] = { I2C_CLIENT_END }; -static unsigned short normal_addr[] = { OUR_ADDR, I2C_CLIENT_END }; - -I2C_CLIENT_INSMOD; - -static int example_attach(struct i2c_adapter *adap, int addr, int kind) -{ - struct example_state *state; - struct device *dev = &adap->dev; /* to use for dev_ reports */ - int ret; - - state = kzalloc(sizeof(struct example_state), GFP_KERNEL); - if (state == NULL) { - dev_err(dev, "failed to create our state\n"); - return -ENOMEM; - } - - example->client.addr = addr; - example->client.flags = 0; - example->client.adapter = adap; - - i2c_set_clientdata(&state->i2c_client, state); - strlcpy(client->i2c_client.name, "example", I2C_NAME_SIZE); - - ret = i2c_attach_client(&state->i2c_client); - if (ret < 0) { - dev_err(dev, "failed to attach client\n"); - kfree(state); - return ret; - } - - dev = &state->i2c_client.dev; - - /* rest of the initialisation goes here. */ - - dev_info(dev, "example client created\n"); - - return 0; -} - -static int __devexit example_detach(struct i2c_client *client) -{ - struct example_state *state = i2c_get_clientdata(client); - - i2c_detach_client(client); - kfree(state); - return 0; -} - -static int example_attach_adapter(struct i2c_adapter *adap) -{ - return i2c_probe(adap, &addr_data, example_attach); -} - -static struct i2c_driver example_driver = { - .driver = { - .owner = THIS_MODULE, - .name = "example", - }, - .attach_adapter = example_attach_adapter, - .detach_client = __devexit_p(example_detach), - .suspend = example_suspend, - .resume = example_resume, -}; - - -Updating the client -------------------- - -The new style binding model will check against a list of supported -devices and their associated address supplied by the code registering -the busses. This means that the driver .attach_adapter and -.detach_adapter methods can be removed, along with the addr_data, -as follows: - -- static struct i2c_driver example_driver; - -- static unsigned short ignore[] = { I2C_CLIENT_END }; -- static unsigned short normal_addr[] = { OUR_ADDR, I2C_CLIENT_END }; - -- I2C_CLIENT_INSMOD; - -- static int example_attach_adapter(struct i2c_adapter *adap) -- { -- return i2c_probe(adap, &addr_data, example_attach); -- } - - static struct i2c_driver example_driver = { -- .attach_adapter = example_attach_adapter, -- .detach_client = __devexit_p(example_detach), - } - -Add the probe and remove methods to the i2c_driver, as so: - - static struct i2c_driver example_driver = { -+ .probe = example_probe, -+ .remove = __devexit_p(example_remove), - } - -Change the example_attach method to accept the new parameters -which include the i2c_client that it will be working with: - -- static int example_attach(struct i2c_adapter *adap, int addr, int kind) -+ static int example_probe(struct i2c_client *client, -+ const struct i2c_device_id *id) - -Change the name of example_attach to example_probe to align it with the -i2c_driver entry names. The rest of the probe routine will now need to be -changed as the i2c_client has already been setup for use. - -The necessary client fields have already been setup before -the probe function is called, so the following client setup -can be removed: - -- example->client.addr = addr; -- example->client.flags = 0; -- example->client.adapter = adap; -- -- strlcpy(client->i2c_client.name, "example", I2C_NAME_SIZE); - -The i2c_set_clientdata is now: - -- i2c_set_clientdata(&state->client, state); -+ i2c_set_clientdata(client, state); - -The call to i2c_attach_client is no longer needed, if the probe -routine exits successfully, then the driver will be automatically -attached by the core. Change the probe routine as so: - -- ret = i2c_attach_client(&state->i2c_client); -- if (ret < 0) { -- dev_err(dev, "failed to attach client\n"); -- kfree(state); -- return ret; -- } - - -Remove the storage of 'struct i2c_client' from the 'struct example_state' -as we are provided with the i2c_client in our example_probe. Instead we -store a pointer to it for when it is needed. - -struct example_state { -- struct i2c_client client; -+ struct i2c_client *client; - -the new i2c client as so: - -- struct device *dev = &adap->dev; /* to use for dev_ reports */ -+ struct device *dev = &i2c_client->dev; /* to use for dev_ reports */ - -And remove the change after our client is attached, as the driver no -longer needs to register a new client structure with the core: - -- dev = &state->i2c_client.dev; - -In the probe routine, ensure that the new state has the client stored -in it: - -static int example_probe(struct i2c_client *i2c_client, - const struct i2c_device_id *id) -{ - struct example_state *state; - struct device *dev = &i2c_client->dev; - int ret; - - state = kzalloc(sizeof(struct example_state), GFP_KERNEL); - if (state == NULL) { - dev_err(dev, "failed to create our state\n"); - return -ENOMEM; - } - -+ state->client = i2c_client; - -Update the detach method, by changing the name to _remove and -to delete the i2c_detach_client call. It is possible that you -can also remove the ret variable as it is not not needed for -any of the core functions. - -- static int __devexit example_detach(struct i2c_client *client) -+ static int __devexit example_remove(struct i2c_client *client) -{ - struct example_state *state = i2c_get_clientdata(client); - -- i2c_detach_client(client); - -And finally ensure that we have the correct ID table for the i2c-core -and other utilities: - -+ struct i2c_device_id example_idtable[] = { -+ { "example", 0 }, -+ { } -+}; -+ -+MODULE_DEVICE_TABLE(i2c, example_idtable); - -static struct i2c_driver example_driver = { - .driver = { - .owner = THIS_MODULE, - .name = "example", - }, -+ .id_table = example_ids, - - -Our driver should now look like this: - -struct example_state { - struct i2c_client *client; - .... -}; - -static int example_probe(struct i2c_client *client, - const struct i2c_device_id *id) -{ - struct example_state *state; - struct device *dev = &client->dev; - - state = kzalloc(sizeof(struct example_state), GFP_KERNEL); - if (state == NULL) { - dev_err(dev, "failed to create our state\n"); - return -ENOMEM; - } - - state->client = client; - i2c_set_clientdata(client, state); - - /* rest of the initialisation goes here. */ - - dev_info(dev, "example client created\n"); - - return 0; -} - -static int __devexit example_remove(struct i2c_client *client) -{ - struct example_state *state = i2c_get_clientdata(client); - - kfree(state); - return 0; -} - -static struct i2c_device_id example_idtable[] = { - { "example", 0 }, - { } -}; - -MODULE_DEVICE_TABLE(i2c, example_idtable); - -static struct i2c_driver example_driver = { - .driver = { - .owner = THIS_MODULE, - .name = "example", - }, - .id_table = example_idtable, - .probe = example_probe, - .remove = __devexit_p(example_remove), - .suspend = example_suspend, - .resume = example_resume, -}; diff --git a/trunk/Documentation/video4linux/CARDLIST.au0828 b/trunk/Documentation/video4linux/CARDLIST.au0828 index eedc399e8deb..86d1c8e7b18f 100644 --- a/trunk/Documentation/video4linux/CARDLIST.au0828 +++ b/trunk/Documentation/video4linux/CARDLIST.au0828 @@ -2,4 +2,3 @@ 1 -> Hauppauge HVR950Q (au0828) [2040:7200,2040:7210,2040:7217,2040:721b,2040:721f,2040:7280,0fd9:0008] 2 -> Hauppauge HVR850 (au0828) [2040:7240] 3 -> DViCO FusionHDTV USB (au0828) [0fe9:d620] - 4 -> Hauppauge HVR950Q rev xxF8 (au0828) [2040:7201,2040:7211,2040:7281] diff --git a/trunk/Documentation/video4linux/CARDLIST.em28xx b/trunk/Documentation/video4linux/CARDLIST.em28xx index 89c7f32abf9f..10591467ef16 100644 --- a/trunk/Documentation/video4linux/CARDLIST.em28xx +++ b/trunk/Documentation/video4linux/CARDLIST.em28xx @@ -1,11 +1,11 @@ 0 -> Unknown EM2800 video grabber (em2800) [eb1a:2800] - 1 -> Unknown EM2750/28xx video grabber (em2820/em2840) [eb1a:2820,eb1a:2821,eb1a:2860,eb1a:2861,eb1a:2870,eb1a:2881,eb1a:2883] + 1 -> Unknown EM2750/28xx video grabber (em2820/em2840) [eb1a:2750,eb1a:2820,eb1a:2821,eb1a:2860,eb1a:2861,eb1a:2870,eb1a:2881,eb1a:2883] 2 -> Terratec Cinergy 250 USB (em2820/em2840) [0ccd:0036] 3 -> Pinnacle PCTV USB 2 (em2820/em2840) [2304:0208] 4 -> Hauppauge WinTV USB 2 (em2820/em2840) [2040:4200,2040:4201] 5 -> MSI VOX USB 2.0 (em2820/em2840) 6 -> Terratec Cinergy 200 USB (em2800) - 7 -> Leadtek Winfast USB II (em2800) [0413:6023] + 7 -> Leadtek Winfast USB II (em2800) 8 -> Kworld USB2800 (em2800) 9 -> Pinnacle Dazzle DVC 90/DVC 100 (em2820/em2840) [2304:0207,2304:021a] 10 -> Hauppauge WinTV HVR 900 (em2880) [2040:6500] @@ -14,46 +14,7 @@ 13 -> Terratec Prodigy XS (em2880) [0ccd:0047] 14 -> Pixelview Prolink PlayTV USB 2.0 (em2820/em2840) 15 -> V-Gear PocketTV (em2800) - 16 -> Hauppauge WinTV HVR 950 (em2883) [2040:6513,2040:6517,2040:651b,2040:651f] + 16 -> Hauppauge WinTV HVR 950 (em2880) [2040:6513,2040:6517,2040:651b,2040:651f] 17 -> Pinnacle PCTV HD Pro Stick (em2880) [2304:0227] 18 -> Hauppauge WinTV HVR 900 (R2) (em2880) [2040:6502] 19 -> PointNix Intra-Oral Camera (em2860) - 20 -> AMD ATI TV Wonder HD 600 (em2880) [0438:b002] - 21 -> eMPIA Technology, Inc. GrabBeeX+ Video Encoder (em2800) [eb1a:2801] - 22 -> Unknown EM2750/EM2751 webcam grabber (em2750) [eb1a:2750,eb1a:2751] - 23 -> Huaqi DLCW-130 (em2750) - 24 -> D-Link DUB-T210 TV Tuner (em2820/em2840) [2001:f112] - 25 -> Gadmei UTV310 (em2820/em2840) - 26 -> Hercules Smart TV USB 2.0 (em2820/em2840) - 27 -> Pinnacle PCTV USB 2 (Philips FM1216ME) (em2820/em2840) - 28 -> Leadtek Winfast USB II Deluxe (em2820/em2840) - 29 -> Pinnacle Dazzle DVC 100 (em2820/em2840) - 30 -> Videology 20K14XUSB USB2.0 (em2820/em2840) - 31 -> Usbgear VD204v9 (em2821) - 32 -> Supercomp USB 2.0 TV (em2821) - 33 -> SIIG AVTuner-PVR/Prolink PlayTV USB 2.0 (em2821) - 34 -> Terratec Cinergy A Hybrid XS (em2860) [0ccd:004f] - 35 -> Typhoon DVD Maker (em2860) - 36 -> NetGMBH Cam (em2860) - 37 -> Gadmei UTV330 (em2860) - 38 -> Yakumo MovieMixer (em2861) - 39 -> KWorld PVRTV 300U (em2861) [eb1a:e300] - 40 -> Plextor ConvertX PX-TV100U (em2861) [093b:a005] - 41 -> Kworld 350 U DVB-T (em2870) [eb1a:e350] - 42 -> Kworld 355 U DVB-T (em2870) [eb1a:e355,eb1a:e357] - 43 -> Terratec Cinergy T XS (em2870) [0ccd:0043] - 44 -> Terratec Cinergy T XS (MT2060) (em2870) - 45 -> Pinnacle PCTV DVB-T (em2870) - 46 -> Compro, VideoMate U3 (em2870) [185b:2870] - 47 -> KWorld DVB-T 305U (em2880) [eb1a:e305] - 48 -> KWorld DVB-T 310U (em2880) - 49 -> MSI DigiVox A/D (em2880) [eb1a:e310] - 50 -> MSI DigiVox A/D II (em2880) [eb1a:e320] - 51 -> Terratec Hybrid XS Secam (em2880) [0ccd:004c] - 52 -> DNT DA2 Hybrid (em2881) - 53 -> Pinnacle Hybrid Pro (em2881) - 54 -> Kworld VS-DVB-T 323UR (em2882) [eb1a:e323] - 55 -> Terratec Hybrid XS (em2882) (em2882) [0ccd:005e] - 56 -> Pinnacle Hybrid Pro (2) (em2882) [2304:0226] - 57 -> Kworld PlusTV HD Hybrid 330 (em2883) [eb1a:a316] - 58 -> Compro VideoMate ForYou/Stereo (em2820/em2840) [185b:2041] diff --git a/trunk/Documentation/video4linux/gspca.txt b/trunk/Documentation/video4linux/gspca.txt index bcaf4ab383be..0c4880af57a3 100644 --- a/trunk/Documentation/video4linux/gspca.txt +++ b/trunk/Documentation/video4linux/gspca.txt @@ -1,4 +1,4 @@ -List of the webcams known by gspca. +List of the webcams know by gspca. The modules are: gspca_main main driver diff --git a/trunk/MAINTAINERS b/trunk/MAINTAINERS index deedc0d827b5..03c5d6ccb9f8 100644 --- a/trunk/MAINTAINERS +++ b/trunk/MAINTAINERS @@ -3796,12 +3796,6 @@ P: Ben Nizette M: bn@niasdigital.com S: Maintained -SOC-CAMERA V4L2 SUBSYSTEM -P: Guennadi Liakhovetski -M: g.liakhovetski@gmx.de -L: video4linux-list@redhat.com -S: Maintained - SOFTWARE RAID (Multiple Disks) SUPPORT P: Ingo Molnar M: mingo@redhat.com diff --git a/trunk/Makefile b/trunk/Makefile index baee3d414754..40f24810116c 100644 --- a/trunk/Makefile +++ b/trunk/Makefile @@ -206,11 +206,7 @@ ifeq ($(ARCH),x86_64) endif # Where to locate arch specific headers -ifeq ($(ARCH),sparc64) - hdr-arch := sparc -else - hdr-arch := $(SRCARCH) -endif +hdr-arch := $(SRCARCH) KCONFIG_CONFIG ?= .config diff --git a/trunk/arch/arm/Kconfig b/trunk/arch/arm/Kconfig index c8f528284a94..dabb015aa40b 100644 --- a/trunk/arch/arm/Kconfig +++ b/trunk/arch/arm/Kconfig @@ -314,7 +314,7 @@ config ARCH_IOP32X select PLAT_IOP select PCI select GENERIC_GPIO - select ARCH_REQUIRE_GPIOLIB + select HAVE_GPIO_LIB help Support for Intel's 80219 and IOP32X (XScale) family of processors. @@ -325,7 +325,7 @@ config ARCH_IOP33X select PLAT_IOP select PCI select GENERIC_GPIO - select ARCH_REQUIRE_GPIOLIB + select HAVE_GPIO_LIB help Support for Intel's IOP33X (XScale) family of processors. @@ -418,7 +418,7 @@ config ARCH_MXC select GENERIC_CLOCKEVENTS select ARCH_MTD_XIP select GENERIC_GPIO - select ARCH_REQUIRE_GPIOLIB + select HAVE_GPIO_LIB help Support for Freescale MXC/iMX-based family of processors diff --git a/trunk/arch/arm/Makefile b/trunk/arch/arm/Makefile index 2f0747744236..b20995a82e04 100644 --- a/trunk/arch/arm/Makefile +++ b/trunk/arch/arm/Makefile @@ -67,7 +67,7 @@ tune-$(CONFIG_CPU_ARM720T) :=-mtune=arm7tdmi tune-$(CONFIG_CPU_ARM740T) :=-mtune=arm7tdmi tune-$(CONFIG_CPU_ARM9TDMI) :=-mtune=arm9tdmi tune-$(CONFIG_CPU_ARM940T) :=-mtune=arm9tdmi -tune-$(CONFIG_CPU_ARM946E) :=$(call cc-option,-mtune=arm9e,-mtune=arm9tdmi) +tune-$(CONFIG_CPU_ARM946T) :=$(call cc-option,-mtune=arm9e,-mtune=arm9tdmi) tune-$(CONFIG_CPU_ARM920T) :=-mtune=arm9tdmi tune-$(CONFIG_CPU_ARM922T) :=-mtune=arm9tdmi tune-$(CONFIG_CPU_ARM925T) :=-mtune=arm9tdmi diff --git a/trunk/arch/arm/common/locomo.c b/trunk/arch/arm/common/locomo.c index 85579654d3b7..c3c3a3339049 100644 --- a/trunk/arch/arm/common/locomo.c +++ b/trunk/arch/arm/common/locomo.c @@ -331,17 +331,17 @@ static int locomo_gpio_type(unsigned int irq, unsigned int type) mask = 1 << (irq - LOCOMO_IRQ_GPIO_START); - if (type == IRQ_TYPE_PROBE) { + if (type == IRQT_PROBE) { if ((GPIO_IRQ_rising_edge | GPIO_IRQ_falling_edge) & mask) return 0; - type = IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING; + type = __IRQT_RISEDGE | __IRQT_FALEDGE; } - if (type & IRQ_TYPE_EDGE_RISING) + if (type & __IRQT_RISEDGE) GPIO_IRQ_rising_edge |= mask; else GPIO_IRQ_rising_edge &= ~mask; - if (type & IRQ_TYPE_EDGE_FALLING) + if (type & __IRQT_FALEDGE) GPIO_IRQ_falling_edge |= mask; else GPIO_IRQ_falling_edge &= ~mask; @@ -473,7 +473,7 @@ static void locomo_setup_irq(struct locomo *lchip) /* * Install handler for IRQ_LOCOMO_HW. */ - set_irq_type(lchip->irq, IRQ_TYPE_EDGE_FALLING); + set_irq_type(lchip->irq, IRQT_FALLING); set_irq_chip_data(lchip->irq, irqbase); set_irq_chained_handler(lchip->irq, locomo_handler); diff --git a/trunk/arch/arm/common/sa1111.c b/trunk/arch/arm/common/sa1111.c index f6d3fdda7067..0a8e1ff2af8a 100644 --- a/trunk/arch/arm/common/sa1111.c +++ b/trunk/arch/arm/common/sa1111.c @@ -241,14 +241,14 @@ static int sa1111_type_lowirq(unsigned int irq, unsigned int flags) void __iomem *mapbase = get_irq_chip_data(irq); unsigned long ip0; - if (flags == IRQ_TYPE_PROBE) + if (flags == IRQT_PROBE) return 0; - if ((!(flags & IRQ_TYPE_EDGE_RISING) ^ !(flags & IRQ_TYPE_EDGE_FALLING)) == 0) + if ((!(flags & __IRQT_RISEDGE) ^ !(flags & __IRQT_FALEDGE)) == 0) return -EINVAL; ip0 = sa1111_readl(mapbase + SA1111_INTPOL0); - if (flags & IRQ_TYPE_EDGE_RISING) + if (flags & __IRQT_RISEDGE) ip0 &= ~mask; else ip0 |= mask; @@ -338,14 +338,14 @@ static int sa1111_type_highirq(unsigned int irq, unsigned int flags) void __iomem *mapbase = get_irq_chip_data(irq); unsigned long ip1; - if (flags == IRQ_TYPE_PROBE) + if (flags == IRQT_PROBE) return 0; - if ((!(flags & IRQ_TYPE_EDGE_RISING) ^ !(flags & IRQ_TYPE_EDGE_FALLING)) == 0) + if ((!(flags & __IRQT_RISEDGE) ^ !(flags & __IRQT_FALEDGE)) == 0) return -EINVAL; ip1 = sa1111_readl(mapbase + SA1111_INTPOL1); - if (flags & IRQ_TYPE_EDGE_RISING) + if (flags & __IRQT_RISEDGE) ip1 &= ~mask; else ip1 |= mask; @@ -427,7 +427,7 @@ static void sa1111_setup_irq(struct sa1111 *sachip) /* * Register SA1111 interrupt */ - set_irq_type(sachip->irq, IRQ_TYPE_EDGE_RISING); + set_irq_type(sachip->irq, IRQT_RISING); set_irq_data(sachip->irq, irqbase); set_irq_chained_handler(sachip->irq, sa1111_irq_handler); } diff --git a/trunk/arch/arm/configs/eseries_pxa_defconfig b/trunk/arch/arm/configs/eseries_pxa_defconfig index 2307587a38a9..493ecee24f94 100644 --- a/trunk/arch/arm/configs/eseries_pxa_defconfig +++ b/trunk/arch/arm/configs/eseries_pxa_defconfig @@ -1,19 +1,15 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.26 -# Sat Jul 26 22:28:46 2008 +# Linux kernel version: 2.6.21-hh17 +# Fri Nov 9 20:23:03 2007 # CONFIG_ARM=y CONFIG_SYS_SUPPORTS_APM_EMULATION=y CONFIG_GENERIC_GPIO=y CONFIG_GENERIC_TIME=y -CONFIG_GENERIC_CLOCKEVENTS=y CONFIG_MMU=y # CONFIG_NO_IOPORT is not set CONFIG_GENERIC_HARDIRQS=y -CONFIG_STACKTRACE_SUPPORT=y -CONFIG_HAVE_LATENCYTOP_SUPPORT=y -CONFIG_LOCKDEP_SUPPORT=y CONFIG_TRACE_IRQFLAGS_SUPPORT=y CONFIG_HARDIRQS_SW_RESEND=y CONFIG_GENERIC_IRQ_PROBE=y @@ -22,90 +18,75 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y # CONFIG_ARCH_HAS_ILOG2_U64 is not set CONFIG_GENERIC_HWEIGHT=y CONFIG_GENERIC_CALIBRATE_DELAY=y -CONFIG_ARCH_SUPPORTS_AOUT=y CONFIG_ZONE_DMA=y CONFIG_ARCH_MTD_XIP=y -CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y CONFIG_VECTORS_BASE=0xffff0000 CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" # -# General setup +# Code maturity level options # CONFIG_EXPERIMENTAL=y CONFIG_BROKEN_ON_SMP=y CONFIG_INIT_ENV_ARG_LIMIT=32 + +# +# General setup +# CONFIG_LOCALVERSION="" CONFIG_LOCALVERSION_AUTO=y CONFIG_SWAP=y CONFIG_SYSVIPC=y +# CONFIG_IPC_NS is not set CONFIG_SYSVIPC_SYSCTL=y # CONFIG_POSIX_MQUEUE is not set # CONFIG_BSD_PROCESS_ACCT is not set # CONFIG_TASKSTATS is not set +# CONFIG_UTS_NS is not set # CONFIG_AUDIT is not set # CONFIG_IKCONFIG is not set -CONFIG_LOG_BUF_SHIFT=14 -# CONFIG_CGROUPS is not set -# CONFIG_GROUP_SCHED is not set CONFIG_SYSFS_DEPRECATED=y -CONFIG_SYSFS_DEPRECATED_V2=y # CONFIG_RELAY is not set -# CONFIG_NAMESPACES is not set -# CONFIG_BLK_DEV_INITRD is not set +CONFIG_BLK_DEV_INITRD=y +CONFIG_INITRAMFS_SOURCE="" # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set CONFIG_SYSCTL=y CONFIG_EMBEDDED=y CONFIG_UID16=y CONFIG_SYSCTL_SYSCALL=y -CONFIG_SYSCTL_SYSCALL_CHECK=y # CONFIG_KALLSYMS is not set CONFIG_HOTPLUG=y CONFIG_PRINTK=y CONFIG_BUG=y CONFIG_ELF_CORE=y -CONFIG_COMPAT_BRK=y CONFIG_BASE_FULL=y CONFIG_FUTEX=y -CONFIG_ANON_INODES=y CONFIG_EPOLL=y -CONFIG_SIGNALFD=y -CONFIG_TIMERFD=y -CONFIG_EVENTFD=y CONFIG_SHMEM=y -CONFIG_VM_EVENT_COUNTERS=y CONFIG_SLAB=y -# CONFIG_SLUB is not set -# CONFIG_SLOB is not set -# CONFIG_PROFILING is not set -# CONFIG_MARKERS is not set -CONFIG_HAVE_OPROFILE=y -# CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS is not set -# CONFIG_HAVE_IOREMAP_PROT is not set -CONFIG_HAVE_KPROBES=y -CONFIG_HAVE_KRETPROBES=y -# CONFIG_HAVE_ARCH_TRACEHOOK is not set -# CONFIG_HAVE_DMA_ATTRS is not set -# CONFIG_USE_GENERIC_SMP_HELPERS is not set -CONFIG_HAVE_CLK=y -CONFIG_PROC_PAGE_MONITOR=y -CONFIG_SLABINFO=y +CONFIG_VM_EVENT_COUNTERS=y CONFIG_RT_MUTEXES=y # CONFIG_TINY_SHMEM is not set CONFIG_BASE_SMALL=0 +# CONFIG_SLOB is not set + +# +# Loadable module support +# CONFIG_MODULES=y -# CONFIG_MODULE_FORCE_LOAD is not set CONFIG_MODULE_UNLOAD=y CONFIG_MODULE_FORCE_UNLOAD=y # CONFIG_MODVERSIONS is not set # CONFIG_MODULE_SRCVERSION_ALL is not set CONFIG_KMOD=y + +# +# Block layer +# CONFIG_BLOCK=y # CONFIG_LBD is not set # CONFIG_BLK_DEV_IO_TRACE is not set # CONFIG_LSF is not set -# CONFIG_BLK_DEV_BSG is not set -# CONFIG_BLK_DEV_INTEGRITY is not set # # IO Schedulers @@ -119,7 +100,6 @@ CONFIG_DEFAULT_AS=y # CONFIG_DEFAULT_CFQ is not set # CONFIG_DEFAULT_NOOP is not set CONFIG_DEFAULT_IOSCHED="anticipatory" -CONFIG_CLASSIC_RCU=y # # System Type @@ -131,26 +111,21 @@ CONFIG_CLASSIC_RCU=y # CONFIG_ARCH_AT91 is not set # CONFIG_ARCH_CLPS7500 is not set # CONFIG_ARCH_CLPS711X is not set +# CONFIG_ARCH_CO285 is not set # CONFIG_ARCH_EBSA110 is not set # CONFIG_ARCH_EP93XX is not set # CONFIG_ARCH_FOOTBRIDGE is not set # CONFIG_ARCH_NETX is not set # CONFIG_ARCH_H720X is not set # CONFIG_ARCH_IMX is not set -# CONFIG_ARCH_IOP13XX is not set # CONFIG_ARCH_IOP32X is not set # CONFIG_ARCH_IOP33X is not set -# CONFIG_ARCH_IXP23XX is not set -# CONFIG_ARCH_IXP2000 is not set +# CONFIG_ARCH_IOP13XX is not set # CONFIG_ARCH_IXP4XX is not set +# CONFIG_ARCH_IXP2000 is not set +# CONFIG_ARCH_IXP23XX is not set # CONFIG_ARCH_L7200 is not set -# CONFIG_ARCH_KIRKWOOD is not set -# CONFIG_ARCH_KS8695 is not set # CONFIG_ARCH_NS9XXX is not set -# CONFIG_ARCH_LOKI is not set -# CONFIG_ARCH_MV78XX0 is not set -# CONFIG_ARCH_MXC is not set -# CONFIG_ARCH_ORION5X is not set # CONFIG_ARCH_PNX4008 is not set CONFIG_ARCH_PXA=y # CONFIG_ARCH_RPC is not set @@ -158,48 +133,80 @@ CONFIG_ARCH_PXA=y # CONFIG_ARCH_S3C2410 is not set # CONFIG_ARCH_SHARK is not set # CONFIG_ARCH_LH7A40X is not set -# CONFIG_ARCH_DAVINCI is not set # CONFIG_ARCH_OMAP is not set -# CONFIG_ARCH_MSM7X00A is not set +# CONFIG_BOARD_IRQ_MAP_SMALL is not set +CONFIG_BOARD_IRQ_MAP_BIG=y +CONFIG_DMABOUNCE=y # -# Intel PXA2xx/PXA3xx Implementations +# Intel PXA2xx Implementations # -# CONFIG_ARCH_GUMSTIX is not set # CONFIG_ARCH_LUBBOCK is not set # CONFIG_MACH_LOGICPD_PXA270 is not set # CONFIG_MACH_MAINSTONE is not set # CONFIG_ARCH_PXA_IDP is not set -# CONFIG_PXA_SHARPSL is not set -CONFIG_ARCH_PXA_ESERIES=y +CONFIG_TOSHIBA_TMIO_OHCI=y +CONFIG_ARCH_ESERIES=y CONFIG_MACH_E330=y -CONFIG_MACH_E350=y CONFIG_MACH_E740=y CONFIG_MACH_E750=y CONFIG_MACH_E400=y CONFIG_MACH_E800=y -# CONFIG_MACH_TRIZEPS4 is not set -# CONFIG_MACH_EM_X270 is not set -# CONFIG_MACH_COLIBRI is not set -# CONFIG_MACH_ZYLONITE is not set -# CONFIG_MACH_LITTLETON is not set -# CONFIG_MACH_TAVOREVB is not set -# CONFIG_MACH_SAAR is not set -# CONFIG_MACH_ARMCORE is not set +CONFIG_E330_LCD=y +CONFIG_E740_LCD=y +CONFIG_E750_LCD=y +CONFIG_E400_LCD=y +CONFIG_E800_LCD=y +CONFIG_ESERIES_UDC=y +CONFIG_E330_TC6387XB=y +CONFIG_E740_T7L66XB=y +CONFIG_E400_T7L66XB=y +CONFIG_E750_E800_TC6393XB=y +CONFIG_E740_PCMCIA=m +CONFIG_E750_PCMCIA=m +CONFIG_E800_PCMCIA=m +# CONFIG_MACH_A620 is not set +# CONFIG_MACH_A716 is not set +# CONFIG_MACH_A730 is not set +# CONFIG_ARCH_H1900 is not set +# CONFIG_ARCH_H2200 is not set +# CONFIG_MACH_H3900 is not set +# CONFIG_MACH_H4000 is not set +# CONFIG_MACH_H4700 is not set +# CONFIG_MACH_HX2750 is not set +# CONFIG_ARCH_H5400 is not set +# CONFIG_MACH_HIMALAYA is not set +# CONFIG_MACH_HTCUNIVERSAL is not set +# CONFIG_MACH_HTCALPINE is not set # CONFIG_MACH_MAGICIAN is not set -# CONFIG_MACH_PCM027 is not set -# CONFIG_ARCH_PXA_PALM is not set -# CONFIG_PXA_EZX is not set +# CONFIG_MACH_HTCAPACHE is not set +# CONFIG_MACH_BLUEANGEL is not set + +# +# HTC_HW6X00 +# +# CONFIG_MACH_HTCBEETLES is not set +# CONFIG_MACH_HW6900 is not set +# CONFIG_MACH_HTCATHENA is not set +# CONFIG_ARCH_AXIMX3 is not set +# CONFIG_ARCH_AXIMX5 is not set +# CONFIG_MACH_X50 is not set +# CONFIG_ARCH_ROVERP1 is not set +# CONFIG_ARCH_ROVERP5P is not set +# CONFIG_MACH_XSCALE_PALMLD is not set +# CONFIG_MACH_T3XSCALE is not set +# CONFIG_MACH_RECON is not set +# CONFIG_MACH_GHI270HG is not set +# CONFIG_MACH_GHI270 is not set +# CONFIG_MACH_LOOXC550 is not set +# CONFIG_PXA_SHARPSL is not set +# CONFIG_MACH_TRIZEPS4 is not set CONFIG_PXA25x=y -# CONFIG_PXA_PWM is not set - -# -# Boot options -# # -# Power management +# Linux As Bootloader # +# CONFIG_LAB is not set # # Processor Type @@ -208,7 +215,6 @@ CONFIG_CPU_32=y CONFIG_CPU_XSCALE=y CONFIG_CPU_32v5=y CONFIG_CPU_ABRT_EV5T=y -CONFIG_CPU_PABRT_NOIFAR=y CONFIG_CPU_CACHE_VIVT=y CONFIG_CPU_TLB_V4WBI=y CONFIG_CPU_CP15=y @@ -226,9 +232,11 @@ CONFIG_XSCALE_PMU=y # # Bus support # -# CONFIG_PCI_SYSCALL is not set -# CONFIG_ARCH_SUPPORTS_MSI is not set -CONFIG_PCCARD=y + +# +# PCCARD (PCMCIA/CardBus) support +# +CONFIG_PCCARD=m # CONFIG_PCMCIA_DEBUG is not set CONFIG_PCMCIA=m CONFIG_PCMCIA_LOAD_CIS=y @@ -237,14 +245,11 @@ CONFIG_PCMCIA_IOCTL=y # # PC-card bridges # +CONFIG_PCMCIA_PXA2XX=m # # Kernel Features # -CONFIG_TICK_ONESHOT=y -# CONFIG_NO_HZ is not set -# CONFIG_HIGH_RES_TIMERS is not set -CONFIG_GENERIC_CLOCKEVENTS_BUILD=y # CONFIG_PREEMPT is not set CONFIG_HZ=100 CONFIG_AEABI=y @@ -257,13 +262,9 @@ CONFIG_FLATMEM_MANUAL=y CONFIG_FLATMEM=y CONFIG_FLAT_NODE_MEM_MAP=y # CONFIG_SPARSEMEM_STATIC is not set -# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set -CONFIG_PAGEFLAGS_EXTENDED=y CONFIG_SPLIT_PTLOCK_CPUS=4096 # CONFIG_RESOURCES_64BIT is not set CONFIG_ZONE_DMA_FLAG=1 -CONFIG_BOUNCE=y -CONFIG_VIRT_TO_BUS=y CONFIG_ALIGNMENT_TRAP=y # @@ -274,7 +275,7 @@ CONFIG_ZBOOT_ROM_BSS=0x0 CONFIG_CMDLINE="" # CONFIG_XIP_KERNEL is not set CONFIG_KEXEC=y -CONFIG_ATAGS_PROC=y +# CONFIG_TXTOFFSET_DELTA is not set # # CPU Frequency scaling @@ -303,12 +304,11 @@ CONFIG_BINFMT_MISC=y # Power management options # CONFIG_PM=y +CONFIG_PM_LEGACY=y # CONFIG_PM_DEBUG is not set -CONFIG_PM_SLEEP=y -CONFIG_SUSPEND=y -CONFIG_SUSPEND_FREEZER=y +# CONFIG_DPM_DEBUG is not set +# CONFIG_PM_SYSFS_DEPRECATED is not set # CONFIG_APM_EMULATION is not set -CONFIG_ARCH_SUSPEND_POSSIBLE=y # # Networking @@ -318,13 +318,13 @@ CONFIG_NET=y # # Networking options # +# CONFIG_NETDEBUG is not set # CONFIG_PACKET is not set CONFIG_UNIX=y CONFIG_XFRM=y # CONFIG_XFRM_USER is not set # CONFIG_XFRM_SUB_POLICY is not set # CONFIG_XFRM_MIGRATE is not set -# CONFIG_XFRM_STATISTICS is not set # CONFIG_NET_KEY is not set CONFIG_INET=y # CONFIG_IP_MULTICAST is not set @@ -339,40 +339,35 @@ CONFIG_IP_FIB_HASH=y # CONFIG_INET_ESP is not set # CONFIG_INET_IPCOMP is not set # CONFIG_INET_XFRM_TUNNEL is not set -CONFIG_INET_TUNNEL=y +# CONFIG_INET_TUNNEL is not set CONFIG_INET_XFRM_MODE_TRANSPORT=y CONFIG_INET_XFRM_MODE_TUNNEL=y CONFIG_INET_XFRM_MODE_BEET=y -# CONFIG_INET_LRO is not set CONFIG_INET_DIAG=y CONFIG_INET_TCP_DIAG=y # CONFIG_TCP_CONG_ADVANCED is not set CONFIG_TCP_CONG_CUBIC=y CONFIG_DEFAULT_TCP_CONG="cubic" # CONFIG_TCP_MD5SIG is not set -CONFIG_IPV6=y -# CONFIG_IPV6_PRIVACY is not set -# CONFIG_IPV6_ROUTER_PREF is not set -# CONFIG_IPV6_OPTIMISTIC_DAD is not set -# CONFIG_INET6_AH is not set -# CONFIG_INET6_ESP is not set -# CONFIG_INET6_IPCOMP is not set -# CONFIG_IPV6_MIP6 is not set +# CONFIG_IPV6 is not set # CONFIG_INET6_XFRM_TUNNEL is not set # CONFIG_INET6_TUNNEL is not set -CONFIG_INET6_XFRM_MODE_TRANSPORT=y -CONFIG_INET6_XFRM_MODE_TUNNEL=y -CONFIG_INET6_XFRM_MODE_BEET=y -# CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION is not set -CONFIG_IPV6_SIT=y -CONFIG_IPV6_NDISC_NODETYPE=y -# CONFIG_IPV6_TUNNEL is not set -# CONFIG_IPV6_MULTIPLE_TABLES is not set -# CONFIG_IPV6_MROUTE is not set # CONFIG_NETWORK_SECMARK is not set # CONFIG_NETFILTER is not set + +# +# DCCP Configuration (EXPERIMENTAL) +# # CONFIG_IP_DCCP is not set + +# +# SCTP Configuration (EXPERIMENTAL) +# # CONFIG_IP_SCTP is not set + +# +# TIPC Configuration (EXPERIMENTAL) +# # CONFIG_TIPC is not set # CONFIG_ATM is not set # CONFIG_BRIDGE is not set @@ -385,6 +380,10 @@ CONFIG_IPV6_NDISC_NODETYPE=y # CONFIG_LAPB is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set + +# +# QoS and/or fair queueing +# # CONFIG_NET_SCHED is not set # @@ -392,74 +391,15 @@ CONFIG_IPV6_NDISC_NODETYPE=y # # CONFIG_NET_PKTGEN is not set # CONFIG_HAMRADIO is not set -# CONFIG_CAN is not set -CONFIG_IRDA=y - -# -# IrDA protocols -# -CONFIG_IRLAN=m -CONFIG_IRCOMM=m -CONFIG_IRDA_ULTRA=y - -# -# IrDA options -# -CONFIG_IRDA_CACHE_LAST_LSAP=y -CONFIG_IRDA_FAST_RR=y -# CONFIG_IRDA_DEBUG is not set - -# -# Infrared-port device drivers -# - -# -# SIR device drivers -# -# CONFIG_IRTTY_SIR is not set - -# -# Dongle support -# -# CONFIG_KINGSUN_DONGLE is not set -# CONFIG_KSDAZZLE_DONGLE is not set -# CONFIG_KS959_DONGLE is not set - -# -# FIR device drivers -# -# CONFIG_USB_IRDA is not set -# CONFIG_SIGMATEL_FIR is not set -CONFIG_PXA_FICP=y -# CONFIG_MCS_FIR is not set +# CONFIG_IRDA is not set # CONFIG_BT is not set -# CONFIG_AF_RXRPC is not set - -# -# Wireless -# -CONFIG_CFG80211=m -CONFIG_NL80211=y -CONFIG_WIRELESS_EXT=y -CONFIG_WIRELESS_EXT_SYSFS=y -CONFIG_MAC80211=m - -# -# Rate control algorithm selection -# -CONFIG_MAC80211_RC_PID=y -CONFIG_MAC80211_RC_DEFAULT_PID=y -CONFIG_MAC80211_RC_DEFAULT="pid" -# CONFIG_MAC80211_MESH is not set -# CONFIG_MAC80211_LEDS is not set -# CONFIG_MAC80211_DEBUG_MENU is not set CONFIG_IEEE80211=m # CONFIG_IEEE80211_DEBUG is not set CONFIG_IEEE80211_CRYPT_WEP=m -CONFIG_IEEE80211_CRYPT_CCMP=m -CONFIG_IEEE80211_CRYPT_TKIP=m -# CONFIG_RFKILL is not set -# CONFIG_NET_9P is not set +# CONFIG_IEEE80211_CRYPT_CCMP is not set +# CONFIG_IEEE80211_CRYPT_TKIP is not set +# CONFIG_IEEE80211_SOFTMAC is not set +CONFIG_WIRELESS_EXT=y # # Device Drivers @@ -468,32 +408,38 @@ CONFIG_IEEE80211_CRYPT_TKIP=m # # Generic Driver Options # -CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" # CONFIG_STANDALONE is not set CONFIG_PREVENT_FIRMWARE_BUILD=y CONFIG_FW_LOADER=y -CONFIG_FIRMWARE_IN_KERNEL=y -CONFIG_EXTRA_FIRMWARE="" # CONFIG_SYS_HYPERVISOR is not set + +# +# Connector - unified userspace <-> kernelspace linker +# # CONFIG_CONNECTOR is not set + +# +# Memory Technology Devices (MTD) +# CONFIG_MTD=m # CONFIG_MTD_DEBUG is not set # CONFIG_MTD_CONCAT is not set -# CONFIG_MTD_PARTITIONS is not set +CONFIG_MTD_PARTITIONS=y +# CONFIG_MTD_REDBOOT_PARTS is not set +# CONFIG_MTD_AFS_PARTS is not set # # User Modules And Translation Layers # -# CONFIG_MTD_CHAR is not set -# CONFIG_MTD_BLKDEVS is not set -# CONFIG_MTD_BLOCK is not set +CONFIG_MTD_CHAR=m +CONFIG_MTD_BLKDEVS=m +CONFIG_MTD_BLOCK=m # CONFIG_MTD_BLOCK_RO is not set # CONFIG_FTL is not set # CONFIG_NFTL is not set # CONFIG_INFTL is not set # CONFIG_RFD_FTL is not set # CONFIG_SSFDC is not set -# CONFIG_MTD_OOPS is not set # # RAM/ROM/Flash chip drivers @@ -513,6 +459,7 @@ CONFIG_MTD_CFI_I2=y # CONFIG_MTD_RAM is not set # CONFIG_MTD_ROM is not set # CONFIG_MTD_ABSENT is not set +# CONFIG_MTD_OBSOLETE_CHIPS is not set # # Mapping drivers for chip access @@ -535,43 +482,82 @@ CONFIG_MTD_CFI_I2=y # CONFIG_MTD_DOC2000 is not set # CONFIG_MTD_DOC2001 is not set # CONFIG_MTD_DOC2001PLUS is not set + +# +# NAND Flash Device Drivers +# CONFIG_MTD_NAND=m -# CONFIG_MTD_NAND_VERIFY_WRITE is not set +CONFIG_MTD_NAND_VERIFY_WRITE=y # CONFIG_MTD_NAND_ECC_SMC is not set -# CONFIG_MTD_NAND_MUSEUM_IDS is not set +# CONFIG_MTD_NAND_H1900 is not set CONFIG_MTD_NAND_IDS=m # CONFIG_MTD_NAND_DISKONCHIP is not set # CONFIG_MTD_NAND_SHARPSL is not set -# CONFIG_MTD_NAND_PLATFORM is not set -# CONFIG_MTD_ALAUDA is not set +# CONFIG_MTD_NAND_NANDSIM is not set + +# +# OneNAND Flash Device Drivers +# # CONFIG_MTD_ONENAND is not set # -# UBI - Unsorted block images +# Parallel port support # -# CONFIG_MTD_UBI is not set # CONFIG_PARPORT is not set -CONFIG_BLK_DEV=y + +# +# Plug and Play support +# +# CONFIG_PNPACPI is not set + +# +# Block devices +# # CONFIG_BLK_DEV_COW_COMMON is not set CONFIG_BLK_DEV_LOOP=m # CONFIG_BLK_DEV_CRYPTOLOOP is not set # CONFIG_BLK_DEV_NBD is not set # CONFIG_BLK_DEV_UB is not set -# CONFIG_BLK_DEV_RAM is not set +CONFIG_BLK_DEV_RAM=y +CONFIG_BLK_DEV_RAM_COUNT=16 +CONFIG_BLK_DEV_RAM_SIZE=6144 +CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024 # CONFIG_CDROM_PKTCDVD is not set # CONFIG_ATA_OVER_ETH is not set -CONFIG_MISC_DEVICES=y -# CONFIG_EEPROM_93CX6 is not set -# CONFIG_ENCLOSURE_SERVICES is not set -CONFIG_HAVE_IDE=y -# CONFIG_IDE is not set + +# +# ATA/ATAPI/MFM/RLL support +# +CONFIG_IDE=m +CONFIG_IDE_MAX_HWIFS=4 +CONFIG_BLK_DEV_IDE=m + +# +# Please see Documentation/ide.txt for help/info on IDE drives +# +# CONFIG_BLK_DEV_IDE_SATA is not set +CONFIG_BLK_DEV_IDEDISK=m +# CONFIG_IDEDISK_MULTI_MODE is not set +# CONFIG_BLK_DEV_IDECS is not set +# CONFIG_BLK_DEV_IDECD is not set +# CONFIG_BLK_DEV_IDETAPE is not set +# CONFIG_BLK_DEV_IDEFLOPPY is not set +# CONFIG_BLK_DEV_IDESCSI is not set +# CONFIG_IDE_TASK_IOCTL is not set + +# +# IDE chipset support/bugfixes +# +# CONFIG_IDE_GENERIC is not set +# CONFIG_IDE_ARM is not set +# CONFIG_BLK_DEV_IDEDMA is not set +# CONFIG_BLK_DEV_HD is not set # # SCSI device support # # CONFIG_RAID_ATTRS is not set CONFIG_SCSI=m -CONFIG_SCSI_DMA=y # CONFIG_SCSI_TGT is not set # CONFIG_SCSI_NETLINK is not set # CONFIG_SCSI_PROC_FS is not set @@ -579,7 +565,7 @@ CONFIG_SCSI_DMA=y # # SCSI support type (disk, tape, CD-ROM) # -CONFIG_BLK_DEV_SD=m +# CONFIG_BLK_DEV_SD is not set # CONFIG_CHR_DEV_ST is not set # CONFIG_CHR_DEV_OSST is not set # CONFIG_BLK_DEV_SR is not set @@ -593,7 +579,6 @@ CONFIG_BLK_DEV_SD=m # CONFIG_SCSI_CONSTANTS is not set # CONFIG_SCSI_LOGGING is not set # CONFIG_SCSI_SCAN_ASYNC is not set -CONFIG_SCSI_WAIT_SCAN=m # # SCSI Transports @@ -601,78 +586,132 @@ CONFIG_SCSI_WAIT_SCAN=m # CONFIG_SCSI_SPI_ATTRS is not set # CONFIG_SCSI_FC_ATTRS is not set # CONFIG_SCSI_ISCSI_ATTRS is not set +# CONFIG_SCSI_SAS_ATTRS is not set # CONFIG_SCSI_SAS_LIBSAS is not set -# CONFIG_SCSI_SRP_ATTRS is not set -# CONFIG_SCSI_LOWLEVEL is not set -# CONFIG_SCSI_LOWLEVEL_PCMCIA is not set -# CONFIG_SCSI_DH is not set -CONFIG_ATA=m -# CONFIG_ATA_NONSTANDARD is not set -# CONFIG_SATA_PMP is not set -CONFIG_ATA_SFF=y -# CONFIG_SATA_MV is not set -CONFIG_PATA_PCMCIA=m -# CONFIG_PATA_PLATFORM is not set + +# +# SCSI low-level drivers +# +# CONFIG_ISCSI_TCP is not set +# CONFIG_SCSI_DEBUG is not set + +# +# PCMCIA SCSI adapter support +# +# CONFIG_PCMCIA_AHA152X is not set +# CONFIG_PCMCIA_FDOMAIN is not set +# CONFIG_PCMCIA_NINJA_SCSI is not set +# CONFIG_PCMCIA_QLOGIC is not set +# CONFIG_PCMCIA_SYM53C500 is not set + +# +# Serial ATA (prod) and Parallel ATA (experimental) drivers +# +# CONFIG_ATA is not set + +# +# Multi-device support (RAID and LVM) +# # CONFIG_MD is not set + +# +# Fusion MPT device support +# +# CONFIG_FUSION is not set + +# +# IEEE 1394 (FireWire) support +# + +# +# I2O device support +# + +# +# Network device support +# CONFIG_NETDEVICES=y # CONFIG_DUMMY is not set # CONFIG_BONDING is not set -# CONFIG_MACVLAN is not set # CONFIG_EQUALIZER is not set # CONFIG_TUN is not set -# CONFIG_VETH is not set + +# +# PHY device support +# + +# +# Ethernet (10 or 100Mbit) +# # CONFIG_NET_ETHERNET is not set -# CONFIG_NETDEV_1000 is not set -# CONFIG_NETDEV_10000 is not set # -# Wireless LAN +# Ethernet (1000 Mbit) +# + +# +# Ethernet (10000 Mbit) +# + +# +# Token Ring devices +# + +# +# Wireless LAN (non-hamradio) +# +CONFIG_NET_RADIO=y +# CONFIG_NET_WIRELESS_RTNETLINK is not set + +# +# Obsolete Wireless cards support (pre-802.11) +# +# CONFIG_STRIP is not set +# CONFIG_PCMCIA_WAVELAN is not set +# CONFIG_PCMCIA_NETWAVE is not set + +# +# Wireless 802.11 Frequency Hopping cards support # -# CONFIG_WLAN_PRE80211 is not set -CONFIG_WLAN_80211=y # CONFIG_PCMCIA_RAYCS is not set -# CONFIG_LIBERTAS is not set -CONFIG_HERMES=m -CONFIG_PCMCIA_HERMES=m -# CONFIG_PCMCIA_SPECTRUM is not set + +# +# Wireless 802.11b ISA/PCI cards support +# +# CONFIG_HERMES is not set # CONFIG_ATMEL is not set + +# +# Wireless 802.11b Pcmcia/Cardbus cards support +# # CONFIG_AIRO_CS is not set # CONFIG_PCMCIA_WL3501 is not set # CONFIG_USB_ZD1201 is not set -# CONFIG_USB_NET_RNDIS_WLAN is not set -# CONFIG_RTL8187 is not set -# CONFIG_MAC80211_HWSIM is not set -# CONFIG_P54_COMMON is not set -# CONFIG_IWLWIFI_LEDS is not set -# CONFIG_HOSTAP is not set -# CONFIG_B43 is not set -# CONFIG_B43LEGACY is not set -# CONFIG_ZD1211RW is not set -# CONFIG_RT2X00 is not set +CONFIG_HOSTAP=m +# CONFIG_HOSTAP_FIRMWARE is not set +# CONFIG_HOSTAP_CS is not set +# CONFIG_ACX is not set +CONFIG_NET_WIRELESS=y # -# USB Network Adapters +# PCMCIA network device support +# +# CONFIG_NET_PCMCIA is not set + +# +# Wan interfaces # -# CONFIG_USB_CATC is not set -# CONFIG_USB_KAWETH is not set -# CONFIG_USB_PEGASUS is not set -# CONFIG_USB_RTL8150 is not set -# CONFIG_USB_USBNET is not set -CONFIG_NET_PCMCIA=y -# CONFIG_PCMCIA_3C589 is not set -# CONFIG_PCMCIA_3C574 is not set -# CONFIG_PCMCIA_FMVJ18X is not set -CONFIG_PCMCIA_PCNET=m -# CONFIG_PCMCIA_NMCLAN is not set -# CONFIG_PCMCIA_SMC91C92 is not set -# CONFIG_PCMCIA_XIRC2PS is not set -# CONFIG_PCMCIA_AXNET is not set # CONFIG_WAN is not set # CONFIG_PPP is not set # CONFIG_SLIP is not set +# CONFIG_SHAPER is not set # CONFIG_NETCONSOLE is not set # CONFIG_NETPOLL is not set # CONFIG_NET_POLL_CONTROLLER is not set + +# +# ISDN subsystem +# # CONFIG_ISDN is not set # @@ -680,48 +719,38 @@ CONFIG_PCMCIA_PCNET=m # CONFIG_INPUT=y # CONFIG_INPUT_FF_MEMLESS is not set -# CONFIG_INPUT_POLLDEV is not set # # Userland interfaces # # CONFIG_INPUT_MOUSEDEV is not set # CONFIG_INPUT_JOYDEV is not set +CONFIG_INPUT_TSDEV=m +CONFIG_INPUT_TSDEV_SCREEN_X=240 +CONFIG_INPUT_TSDEV_SCREEN_Y=320 CONFIG_INPUT_EVDEV=m # CONFIG_INPUT_EVBUG is not set +# CONFIG_INPUT_LED_TRIGGER is not set # # Input Device Drivers # -CONFIG_INPUT_KEYBOARD=y -# CONFIG_KEYBOARD_ATKBD is not set -# CONFIG_KEYBOARD_SUNKBD is not set -# CONFIG_KEYBOARD_LKKBD is not set -# CONFIG_KEYBOARD_XTKBD is not set -# CONFIG_KEYBOARD_NEWTON is not set -# CONFIG_KEYBOARD_STOWAWAY is not set -CONFIG_KEYBOARD_GPIO=m +# CONFIG_INPUT_KEYBOARD is not set # CONFIG_INPUT_MOUSE is not set # CONFIG_INPUT_JOYSTICK is not set -# CONFIG_INPUT_TABLET is not set CONFIG_INPUT_TOUCHSCREEN=y -# CONFIG_TOUCHSCREEN_FUJITSU is not set # CONFIG_TOUCHSCREEN_GUNZE is not set # CONFIG_TOUCHSCREEN_ELO is not set # CONFIG_TOUCHSCREEN_MTOUCH is not set -# CONFIG_TOUCHSCREEN_INEXIO is not set # CONFIG_TOUCHSCREEN_MK712 is not set -# CONFIG_TOUCHSCREEN_PENMOUNT is not set -# CONFIG_TOUCHSCREEN_TOUCHRIGHT is not set -# CONFIG_TOUCHSCREEN_TOUCHWIN is not set -# CONFIG_TOUCHSCREEN_UCB1400 is not set CONFIG_TOUCHSCREEN_WM97XX=m CONFIG_TOUCHSCREEN_WM9705=y CONFIG_TOUCHSCREEN_WM9712=y CONFIG_TOUCHSCREEN_WM9713=y -# CONFIG_TOUCHSCREEN_WM97XX_MAINSTONE is not set -# CONFIG_TOUCHSCREEN_USB_COMPOSITE is not set -# CONFIG_TOUCHSCREEN_TOUCHIT213 is not set +# CONFIG_TOUCHSCREEN_PENMOUNT is not set +# CONFIG_TOUCHSCREEN_TOUCHRIGHT is not set +# CONFIG_TOUCHSCREEN_TOUCHWIN is not set +# CONFIG_TOUCHSCREEN_UCB1400 is not set # CONFIG_INPUT_MISC is not set # @@ -734,11 +763,9 @@ CONFIG_TOUCHSCREEN_WM9713=y # Character devices # CONFIG_VT=y -CONFIG_CONSOLE_TRANSLATIONS=y CONFIG_VT_CONSOLE=y CONFIG_HW_CONSOLE=y # CONFIG_VT_HW_CONSOLE_BINDING is not set -CONFIG_DEVKMEM=y # CONFIG_SERIAL_NONSTANDARD is not set # @@ -750,12 +777,25 @@ CONFIG_DEVKMEM=y # Non-8250 serial port support # # CONFIG_SERIAL_PXA is not set +# CONFIG_RS232_SERIAL is not set CONFIG_UNIX98_PTYS=y # CONFIG_LEGACY_PTYS is not set + +# +# IPMI +# # CONFIG_IPMI_HANDLER is not set + +# +# Watchdog Cards +# +# CONFIG_WATCHDOG is not set CONFIG_HW_RANDOM=m # CONFIG_NVRAM is not set +# CONFIG_SA1100_RTC is not set +# CONFIG_DTLK is not set # CONFIG_R3964 is not set +# CONFIG_TIHTC is not set # # PCMCIA character devices @@ -763,79 +803,117 @@ CONFIG_HW_RANDOM=m # CONFIG_SYNCLINK_CS is not set # CONFIG_CARDMAN_4000 is not set # CONFIG_CARDMAN_4040 is not set -# CONFIG_IPWIRELESS is not set # CONFIG_RAW_DRIVER is not set + +# +# TPM devices +# # CONFIG_TCG_TPM is not set -# CONFIG_I2C is not set -# CONFIG_SPI is not set -CONFIG_ARCH_REQUIRE_GPIOLIB=y -CONFIG_GPIOLIB=y -# CONFIG_GPIO_SYSFS is not set # -# I2C GPIO expanders: +# I2C support # +# CONFIG_I2C is not set # -# PCI GPIO expanders: +# SPI support # +# CONFIG_SPI is not set +# CONFIG_SPI_MASTER is not set # -# SPI GPIO expanders: +# Dallas's 1-wire bus # # CONFIG_W1 is not set -# CONFIG_POWER_SUPPLY is not set + +# +# Hardware Monitoring support +# # CONFIG_HWMON is not set -# CONFIG_WATCHDOG is not set +# CONFIG_HWMON_VID is not set +# CONFIG_POWER_SUPPLY is not set # -# Sonics Silicon Backplane +# L3 serial bus support # -CONFIG_SSB_POSSIBLE=y -# CONFIG_SSB is not set +# CONFIG_L3 is not set + +# +# Misc devices +# + +# +# Multimedia Capabilities Port drivers +# +# CONFIG_ADC is not set + +# +# Compaq/iPAQ Drivers +# + +# +# Compaq/HP iPAQ Drivers +# +# CONFIG_IPAQ_SLEEVE is not set +# CONFIG_SLEEVE_DEBUG is not set # # Multifunction device drivers # -CONFIG_MFD_CORE=y # CONFIG_MFD_SM501 is not set -# CONFIG_HTC_EGPIO is not set +# CONFIG_HTC_ASIC2 is not set +# CONFIG_HTC_ASIC3 is not set # CONFIG_HTC_PASIC3 is not set -CONFIG_MFD_TC6393XB=y +# CONFIG_HTC_EGPIO is not set +# CONFIG_HTC_BBKEYS is not set +# CONFIG_HTC_ASIC3_DS1WM is not set +# CONFIG_SOC_SAMCOP is not set +# CONFIG_SOC_HAMCOP is not set +# CONFIG_SOC_MQ11XX is not set +CONFIG_SOC_T7L66XB=y +# CONFIG_SOC_TC6387XB is not set +CONFIG_SOC_TC6393XB=y +# CONFIG_SOC_TSC2101 is not set +# CONFIG_SOC_TSC2200 is not set # -# Multimedia devices +# LED devices +# +# CONFIG_NEW_LEDS is not set + # +# LED drivers +# + +# +# LED Triggers +# +# CONFIG_LEDS_TRIGGER_BACKLIGHT is not set # -# Multimedia core support +# Multimedia devices # # CONFIG_VIDEO_DEV is not set -# CONFIG_DVB_CORE is not set -# CONFIG_VIDEO_MEDIA is not set # -# Multimedia drivers +# Digital Video Broadcasting Devices # -# CONFIG_DAB is not set +# CONFIG_DVB is not set +# CONFIG_USB_DABUSB is not set # # Graphics support # -# CONFIG_VGASTATE is not set -# CONFIG_VIDEO_OUTPUT_CONTROL is not set +CONFIG_BACKLIGHT_LCD_SUPPORT=y +CONFIG_BACKLIGHT_CLASS_DEVICE=y +CONFIG_LCD_CLASS_DEVICE=y +CONFIG_BACKLIGHT_CORGI=y CONFIG_FB=y # CONFIG_FIRMWARE_EDID is not set # CONFIG_FB_DDC is not set CONFIG_FB_CFB_FILLRECT=y CONFIG_FB_CFB_COPYAREA=y CONFIG_FB_CFB_IMAGEBLIT=y -# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set -# CONFIG_FB_SYS_FILLRECT is not set -# CONFIG_FB_SYS_COPYAREA is not set -# CONFIG_FB_SYS_IMAGEBLIT is not set -# CONFIG_FB_FOREIGN_ENDIAN is not set -# CONFIG_FB_SYS_FOPS is not set # CONFIG_FB_SVGALIB is not set # CONFIG_FB_MACMODES is not set # CONFIG_FB_BACKLIGHT is not set @@ -845,25 +923,14 @@ CONFIG_FB_CFB_IMAGEBLIT=y # # Frame buffer hardware drivers # +# CONFIG_FB_IMAGEON is not set # CONFIG_FB_S1D13XXX is not set CONFIG_FB_PXA=y -# CONFIG_FB_PXA_SMARTPANEL is not set # CONFIG_FB_PXA_PARAMETERS is not set # CONFIG_FB_MBX is not set CONFIG_FB_W100=y -# CONFIG_FB_AM200EPD is not set # CONFIG_FB_VIRTUAL is not set -CONFIG_BACKLIGHT_LCD_SUPPORT=y -CONFIG_LCD_CLASS_DEVICE=y -# CONFIG_LCD_ILI9320 is not set -# CONFIG_LCD_PLATFORM is not set -CONFIG_BACKLIGHT_CLASS_DEVICE=y -CONFIG_BACKLIGHT_CORGI=y - -# -# Display device support -# -# CONFIG_DISPLAY_SUPPORT is not set +# CONFIG_FB_VSFB is not set # # Console display driver support @@ -871,7 +938,6 @@ CONFIG_BACKLIGHT_CORGI=y # CONFIG_VGA_CONSOLE is not set CONFIG_DUMMY_CONSOLE=y CONFIG_FRAMEBUFFER_CONSOLE=y -# CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY is not set # CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set CONFIG_FONTS=y # CONFIG_FONT_8x8 is not set @@ -879,13 +945,28 @@ CONFIG_FONTS=y # CONFIG_FONT_6x11 is not set # CONFIG_FONT_7x14 is not set # CONFIG_FONT_PEARL_8x8 is not set -# CONFIG_FONT_ACORN_8x8 is not set -CONFIG_FONT_MINI_4x6=y +CONFIG_FONT_ACORN_8x8=y +# CONFIG_FONT_MINI_4x6 is not set # CONFIG_FONT_SUN8x16 is not set # CONFIG_FONT_SUN12x22 is not set # CONFIG_FONT_10x18 is not set -# CONFIG_LOGO is not set + +# +# Logo configuration +# +CONFIG_LOGO=y +# CONFIG_LOGO_LINUX_MONO is not set +# CONFIG_LOGO_LINUX_VGA16 is not set +CONFIG_LOGO_LINUX_CLUT224=y + +# +# Sound +# CONFIG_SOUND=y + +# +# Advanced Linux Sound Architecture +# CONFIG_SND=m CONFIG_SND_TIMER=m CONFIG_SND_PCM=m @@ -899,75 +980,125 @@ CONFIG_SND_SUPPORT_OLD_API=y CONFIG_SND_VERBOSE_PROCFS=y CONFIG_SND_VERBOSE_PRINTK=y # CONFIG_SND_DEBUG is not set -CONFIG_SND_DRIVERS=y + +# +# Generic devices +# # CONFIG_SND_DUMMY is not set # CONFIG_SND_MTPAV is not set # CONFIG_SND_SERIAL_U16550 is not set # CONFIG_SND_MPU401 is not set -CONFIG_SND_ARM=y + +# +# ALSA ARM devices +# # CONFIG_SND_PXA2XX_AC97 is not set -# CONFIG_SND_USB is not set -# CONFIG_SND_PCMCIA is not set -CONFIG_SND_SOC=m +# CONFIG_SND_RECON is not set + +# +# USB devices +# +# CONFIG_SND_USB_AUDIO is not set + +# +# PCMCIA devices +# +# CONFIG_SND_VXPOCKET is not set +# CONFIG_SND_PDAUDIOCF is not set + +# +# SoC audio support +# CONFIG_SND_SOC_AC97_BUS=y +CONFIG_SND_SOC=m + +# +# SoC Platforms +# + +# +# SoC Audio for the Atmel AT91 +# + +# +# SoC Audio for the Intel PXA2xx +# CONFIG_SND_PXA2XX_SOC=m CONFIG_SND_PXA2XX_SOC_AC97=m -CONFIG_SND_PXA2XX_SOC_E800=m +CONFIG_SND_PXA2XX_SOC_E740_WM9705=m +CONFIG_SND_PXA2XX_SOC_E750_WM9705=m +CONFIG_SND_PXA2XX_SOC_E800_WM9712=m +# CONFIG_SND_PXA2XX_SOC_MAGICIAN is not set +# CONFIG_SND_PXA2XX_SOC_BLUEANGEL is not set +# CONFIG_SND_PXA2XX_SOC_H5000 is not set + +# +# SoC Audio for the Freescale i.MX +# + +# +# SoC Audio for the Samsung S3C24XX +# +# CONFIG_SND_SOC_AC97_CODEC is not set +# CONFIG_SND_SOC_WM8711 is not set +# CONFIG_SND_SOC_WM8510 is not set +# CONFIG_SND_SOC_WM8731 is not set +# CONFIG_SND_SOC_WM8750 is not set +# CONFIG_SND_SOC_WM8753 is not set +# CONFIG_SND_SOC_WM8772 is not set +# CONFIG_SND_SOC_WM8971 is not set +# CONFIG_SND_SOC_WM8956 is not set +# CONFIG_SND_SOC_WM8960 is not set +# CONFIG_SND_SOC_WM8976 is not set +# CONFIG_SND_SOC_WM8974 is not set +# CONFIG_SND_SOC_WM8980 is not set +CONFIG_SND_SOC_WM9705=m +# CONFIG_SND_SOC_WM9713 is not set CONFIG_SND_SOC_WM9712=m +# CONFIG_SND_SOC_UDA1380 is not set +# CONFIG_SND_SOC_AK4535 is not set + +# +# Open Sound System +# # CONFIG_SOUND_PRIME is not set CONFIG_AC97_BUS=m -CONFIG_HID_SUPPORT=y -CONFIG_HID=y -# CONFIG_HID_DEBUG is not set -# CONFIG_HIDRAW is not set # -# USB Input Devices +# HID Devices # -CONFIG_USB_HID=m -# CONFIG_USB_HIDINPUT_POWERBOOK is not set -# CONFIG_HID_FF is not set -# CONFIG_USB_HIDDEV is not set +CONFIG_HID=y +# CONFIG_HID_DEBUG is not set # -# USB HID Boot Protocol drivers +# USB support # -# CONFIG_USB_KBD is not set -# CONFIG_USB_MOUSE is not set -CONFIG_USB_SUPPORT=y CONFIG_USB_ARCH_HAS_HCD=y -# CONFIG_USB_ARCH_HAS_OHCI is not set +CONFIG_USB_ARCH_HAS_OHCI=y # CONFIG_USB_ARCH_HAS_EHCI is not set CONFIG_USB=m -# CONFIG_USB_DEBUG is not set -# CONFIG_USB_ANNOUNCE_NEW_DEVICES is not set +CONFIG_USB_DEBUG=y # # Miscellaneous USB options # -# CONFIG_USB_DEVICEFS is not set -CONFIG_USB_DEVICE_CLASS=y -# CONFIG_USB_DYNAMIC_MINORS is not set +CONFIG_USB_DEVICEFS=y +CONFIG_USB_DYNAMIC_MINORS=y # CONFIG_USB_SUSPEND is not set # CONFIG_USB_OTG is not set -# CONFIG_USB_OTG_WHITELIST is not set -# CONFIG_USB_OTG_BLACKLIST_HUB is not set # # USB Host Controller Drivers # -# CONFIG_USB_C67X00_HCD is not set # CONFIG_USB_ISP116X_HCD is not set -# CONFIG_USB_ISP1760_HCD is not set +# CONFIG_USB_OHCI_HCD is not set # CONFIG_USB_SL811_HCD is not set -# CONFIG_USB_R8A66597_HCD is not set # # USB Device Class drivers # # CONFIG_USB_ACM is not set # CONFIG_USB_PRINTER is not set -# CONFIG_USB_WDM is not set # # NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' @@ -976,19 +1107,68 @@ CONFIG_USB_DEVICE_CLASS=y # # may also be needed; see USB_STORAGE Help for more information # -# CONFIG_USB_STORAGE is not set +CONFIG_USB_STORAGE=m +# CONFIG_USB_STORAGE_DEBUG is not set +# CONFIG_USB_STORAGE_DATAFAB is not set +# CONFIG_USB_STORAGE_FREECOM is not set +# CONFIG_USB_STORAGE_ISD200 is not set +# CONFIG_USB_STORAGE_DPCM is not set +# CONFIG_USB_STORAGE_USBAT is not set +# CONFIG_USB_STORAGE_SDDR09 is not set +# CONFIG_USB_STORAGE_SDDR55 is not set +# CONFIG_USB_STORAGE_JUMPSHOT is not set +# CONFIG_USB_STORAGE_ALAUDA is not set +# CONFIG_USB_STORAGE_KARMA is not set # CONFIG_USB_LIBUSUAL is not set +# +# USB Input Devices +# +# CONFIG_USB_HID is not set + +# +# USB HID Boot Protocol drivers +# +# CONFIG_USB_KBD is not set +# CONFIG_USB_MOUSE is not set +# CONFIG_USB_AIPTEK is not set +# CONFIG_USB_WACOM is not set +# CONFIG_USB_ACECAD is not set +# CONFIG_USB_KBTAB is not set +# CONFIG_USB_POWERMATE is not set +# CONFIG_USB_TOUCHSCREEN is not set +# CONFIG_USB_YEALINK is not set +# CONFIG_USB_XPAD is not set +# CONFIG_USB_ATI_REMOTE is not set +# CONFIG_USB_ATI_REMOTE2 is not set +# CONFIG_USB_KEYSPAN_REMOTE is not set +# CONFIG_USB_APPLETOUCH is not set +# CONFIG_USB_GTCO is not set + # # USB Imaging devices # # CONFIG_USB_MDC800 is not set # CONFIG_USB_MICROTEK is not set -CONFIG_USB_MON=y + +# +# USB Network Adapters +# +# CONFIG_USB_CATC is not set +# CONFIG_USB_KAWETH is not set +# CONFIG_USB_PEGASUS is not set +# CONFIG_USB_RTL8150 is not set +# CONFIG_USB_USBNET_MII is not set +# CONFIG_USB_USBNET is not set +# CONFIG_USB_MON is not set # # USB port drivers # + +# +# USB Serial Converter support +# # CONFIG_USB_SERIAL is not set # @@ -1012,57 +1192,56 @@ CONFIG_USB_MON=y # CONFIG_USB_LD is not set # CONFIG_USB_TRANCEVIBRATOR is not set # CONFIG_USB_IOWARRIOR is not set -# CONFIG_USB_ISIGHTFW is not set +# CONFIG_USB_TEST is not set + +# +# USB DSL modem support +# + +# +# USB Gadget Support +# CONFIG_USB_GADGET=y # CONFIG_USB_GADGET_DEBUG_FILES is not set CONFIG_USB_GADGET_SELECTED=y -# CONFIG_USB_GADGET_AMD5536UDC is not set -# CONFIG_USB_GADGET_ATMEL_USBA is not set -# CONFIG_USB_GADGET_FSL_USB2 is not set # CONFIG_USB_GADGET_NET2280 is not set -CONFIG_USB_GADGET_PXA25X=y -CONFIG_USB_PXA25X=y -CONFIG_USB_PXA25X_SMALL=y -# CONFIG_USB_GADGET_M66592 is not set +CONFIG_USB_GADGET_PXA2XX=y +CONFIG_USB_PXA2XX=y +# CONFIG_USB_PXA2XX_SMALL is not set # CONFIG_USB_GADGET_PXA27X is not set # CONFIG_USB_GADGET_GOKU is not set +# CONFIG_USB_GADGET_MQ11XX is not set # CONFIG_USB_GADGET_LH7A40X is not set -# CONFIG_USB_GADGET_OMAP is not set # CONFIG_USB_GADGET_S3C2410 is not set +# CONFIG_USB_GADGET_OMAP is not set # CONFIG_USB_GADGET_AT91 is not set # CONFIG_USB_GADGET_DUMMY_HCD is not set # CONFIG_USB_GADGET_DUALSPEED is not set # CONFIG_USB_ZERO is not set -CONFIG_USB_ETH=m +CONFIG_USB_ETH=y # CONFIG_USB_ETH_RNDIS is not set # CONFIG_USB_GADGETFS is not set # CONFIG_USB_FILE_STORAGE is not set # CONFIG_USB_G_SERIAL is not set # CONFIG_USB_MIDI_GADGET is not set -# CONFIG_USB_G_PRINTER is not set -# CONFIG_USB_CDC_COMPOSITE is not set -CONFIG_MMC=y -# CONFIG_MMC_DEBUG is not set -CONFIG_MMC_UNSAFE_RESUME=y +# CONFIG_USB_G_CHAR is not set +# CONFIG_USB_PXA2XX_GPIO is not set # -# MMC/SD Card Drivers +# MMC/SD Card support # +CONFIG_MMC=y +# CONFIG_MMC_DEBUG is not set CONFIG_MMC_BLOCK=y -CONFIG_MMC_BLOCK_BOUNCE=y -# CONFIG_SDIO_UART is not set -# CONFIG_MMC_TEST is not set +# CONFIG_MMC_PXA is not set +CONFIG_MMC_TMIO=y +# CONFIG_MMC_SAMCOP is not set # -# MMC/SD Host Controller Drivers +# Real Time Clock # -# CONFIG_MMC_PXA is not set -# CONFIG_MMC_SDHCI is not set -# CONFIG_NEW_LEDS is not set CONFIG_RTC_LIB=y # CONFIG_RTC_CLASS is not set -# CONFIG_DMADEVICES is not set -# CONFIG_UIO is not set # # File systems @@ -1076,11 +1255,14 @@ CONFIG_EXT2_FS=y # CONFIG_JFS_FS is not set # CONFIG_FS_POSIX_ACL is not set # CONFIG_XFS_FS is not set +# CONFIG_GFS2_FS is not set # CONFIG_OCFS2_FS is not set -CONFIG_DNOTIFY=y +# CONFIG_MINIX_FS is not set +# CONFIG_ROMFS_FS is not set CONFIG_INOTIFY=y CONFIG_INOTIFY_USER=y # CONFIG_QUOTA is not set +CONFIG_DNOTIFY=y # CONFIG_AUTOFS_FS is not set # CONFIG_AUTOFS4_FS is not set # CONFIG_FUSE_FS is not set @@ -1110,6 +1292,7 @@ CONFIG_SYSFS=y CONFIG_TMPFS=y # CONFIG_TMPFS_POSIX_ACL is not set # CONFIG_HUGETLB_PAGE is not set +CONFIG_RAMFS=y # CONFIG_CONFIGFS_FS is not set # @@ -1122,21 +1305,30 @@ CONFIG_TMPFS=y # CONFIG_BEFS_FS is not set # CONFIG_BFS_FS is not set # CONFIG_EFS_FS is not set -# CONFIG_JFFS2_FS is not set +CONFIG_JFFS2_FS=m +CONFIG_JFFS2_FS_DEBUG=0 +CONFIG_JFFS2_FS_WRITEBUFFER=y +# CONFIG_JFFS2_SUMMARY is not set +# CONFIG_JFFS2_FS_XATTR is not set +# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set +CONFIG_JFFS2_ZLIB=y +CONFIG_JFFS2_RTIME=y +# CONFIG_JFFS2_RUBIN is not set # CONFIG_CRAMFS is not set # CONFIG_VXFS_FS is not set -# CONFIG_MINIX_FS is not set -# CONFIG_OMFS_FS is not set # CONFIG_HPFS_FS is not set # CONFIG_QNX4FS_FS is not set -# CONFIG_ROMFS_FS is not set # CONFIG_SYSV_FS is not set # CONFIG_UFS_FS is not set -CONFIG_NETWORK_FILESYSTEMS=y + +# +# Network File Systems +# CONFIG_NFS_FS=y CONFIG_NFS_V3=y # CONFIG_NFS_V3_ACL is not set # CONFIG_NFS_V4 is not set +# CONFIG_NFS_DIRECTIO is not set # CONFIG_NFSD is not set CONFIG_LOCKD=y CONFIG_LOCKD_V4=y @@ -1149,6 +1341,7 @@ CONFIG_SUNRPC=y # CONFIG_NCP_FS is not set # CONFIG_CODA_FS is not set # CONFIG_AFS_FS is not set +# CONFIG_9P_FS is not set # # Partition Types @@ -1170,7 +1363,10 @@ CONFIG_MSDOS_PARTITION=y # CONFIG_SUN_PARTITION is not set # CONFIG_KARMA_PARTITION is not set # CONFIG_EFI_PARTITION is not set -# CONFIG_SYSV68_PARTITION is not set + +# +# Native Language Support +# CONFIG_NLS=y CONFIG_NLS_DEFAULT="iso8859-1" CONFIG_NLS_CODEPAGE_437=y @@ -1211,32 +1407,30 @@ CONFIG_NLS_ISO8859_1=y # CONFIG_NLS_KOI8_R is not set # CONFIG_NLS_KOI8_U is not set # CONFIG_NLS_UTF8 is not set + +# +# Distributed Lock Manager +# # CONFIG_DLM is not set +# +# Profiling support +# +# CONFIG_PROFILING is not set + # # Kernel hacking # # CONFIG_PRINTK_TIME is not set -# CONFIG_ENABLE_WARN_DEPRECATED is not set -# CONFIG_ENABLE_MUST_CHECK is not set -CONFIG_FRAME_WARN=1024 +CONFIG_ENABLE_MUST_CHECK=y # CONFIG_MAGIC_SYSRQ is not set # CONFIG_UNUSED_SYMBOLS is not set # CONFIG_DEBUG_FS is not set # CONFIG_HEADERS_CHECK is not set # CONFIG_DEBUG_KERNEL is not set +CONFIG_LOG_BUF_SHIFT=14 # CONFIG_DEBUG_BUGVERBOSE is not set -# CONFIG_DEBUG_MEMORY_INIT is not set CONFIG_FRAME_POINTER=y -# CONFIG_LATENCYTOP is not set -CONFIG_HAVE_FTRACE=y -CONFIG_HAVE_DYNAMIC_FTRACE=y -# CONFIG_FTRACE is not set -# CONFIG_IRQSOFF_TRACER is not set -# CONFIG_SCHED_TRACER is not set -# CONFIG_CONTEXT_SWITCH_TRACER is not set -# CONFIG_SAMPLES is not set -CONFIG_HAVE_ARCH_KGDB=y # CONFIG_DEBUG_USER is not set # @@ -1244,102 +1438,61 @@ CONFIG_HAVE_ARCH_KGDB=y # # CONFIG_KEYS is not set # CONFIG_SECURITY is not set -# CONFIG_SECURITY_FILE_CAPABILITIES is not set -CONFIG_CRYPTO=y # -# Crypto core or helper +# Cryptographic options # +CONFIG_CRYPTO=y CONFIG_CRYPTO_ALGAPI=m CONFIG_CRYPTO_BLKCIPHER=m CONFIG_CRYPTO_MANAGER=m -# CONFIG_CRYPTO_GF128MUL is not set -# CONFIG_CRYPTO_NULL is not set -# CONFIG_CRYPTO_CRYPTD is not set -# CONFIG_CRYPTO_AUTHENC is not set -# CONFIG_CRYPTO_TEST is not set - -# -# Authenticated Encryption with Associated Data -# -# CONFIG_CRYPTO_CCM is not set -# CONFIG_CRYPTO_GCM is not set -# CONFIG_CRYPTO_SEQIV is not set - -# -# Block modes -# -CONFIG_CRYPTO_CBC=m -# CONFIG_CRYPTO_CTR is not set -# CONFIG_CRYPTO_CTS is not set -CONFIG_CRYPTO_ECB=m -# CONFIG_CRYPTO_LRW is not set -CONFIG_CRYPTO_PCBC=m -# CONFIG_CRYPTO_XTS is not set - -# -# Hash modes -# # CONFIG_CRYPTO_HMAC is not set # CONFIG_CRYPTO_XCBC is not set - -# -# Digest -# -# CONFIG_CRYPTO_CRC32C is not set +# CONFIG_CRYPTO_NULL is not set # CONFIG_CRYPTO_MD4 is not set # CONFIG_CRYPTO_MD5 is not set -CONFIG_CRYPTO_MICHAEL_MIC=m -# CONFIG_CRYPTO_RMD128 is not set -# CONFIG_CRYPTO_RMD160 is not set -# CONFIG_CRYPTO_RMD256 is not set -# CONFIG_CRYPTO_RMD320 is not set # CONFIG_CRYPTO_SHA1 is not set # CONFIG_CRYPTO_SHA256 is not set # CONFIG_CRYPTO_SHA512 is not set -# CONFIG_CRYPTO_TGR192 is not set # CONFIG_CRYPTO_WP512 is not set - -# -# Ciphers -# -CONFIG_CRYPTO_AES=m -# CONFIG_CRYPTO_ANUBIS is not set -CONFIG_CRYPTO_ARC4=m -# CONFIG_CRYPTO_BLOWFISH is not set -# CONFIG_CRYPTO_CAMELLIA is not set -# CONFIG_CRYPTO_CAST5 is not set -# CONFIG_CRYPTO_CAST6 is not set +# CONFIG_CRYPTO_TGR192 is not set +# CONFIG_CRYPTO_GF128MUL is not set +CONFIG_CRYPTO_ECB=m +CONFIG_CRYPTO_CBC=m +CONFIG_CRYPTO_PCBC=m +# CONFIG_CRYPTO_LRW is not set # CONFIG_CRYPTO_DES is not set # CONFIG_CRYPTO_FCRYPT is not set -# CONFIG_CRYPTO_KHAZAD is not set -# CONFIG_CRYPTO_SALSA20 is not set -# CONFIG_CRYPTO_SEED is not set +# CONFIG_CRYPTO_BLOWFISH is not set +# CONFIG_CRYPTO_TWOFISH is not set # CONFIG_CRYPTO_SERPENT is not set +# CONFIG_CRYPTO_AES is not set +# CONFIG_CRYPTO_CAST5 is not set +# CONFIG_CRYPTO_CAST6 is not set # CONFIG_CRYPTO_TEA is not set -# CONFIG_CRYPTO_TWOFISH is not set +CONFIG_CRYPTO_ARC4=m +# CONFIG_CRYPTO_KHAZAD is not set +# CONFIG_CRYPTO_ANUBIS is not set +# CONFIG_CRYPTO_DEFLATE is not set +# CONFIG_CRYPTO_MICHAEL_MIC is not set +# CONFIG_CRYPTO_CRC32C is not set +# CONFIG_CRYPTO_CAMELLIA is not set +# CONFIG_CRYPTO_TEST is not set # -# Compression +# Hardware crypto devices # -# CONFIG_CRYPTO_DEFLATE is not set -# CONFIG_CRYPTO_LZO is not set -CONFIG_CRYPTO_HW=y # # Library routines # CONFIG_BITREVERSE=y -# CONFIG_GENERIC_FIND_FIRST_BIT is not set -# CONFIG_GENERIC_FIND_NEXT_BIT is not set -CONFIG_CRC_CCITT=y +# CONFIG_CRC_CCITT is not set # CONFIG_CRC16 is not set -# CONFIG_CRC_T10DIF is not set -# CONFIG_CRC_ITU_T is not set CONFIG_CRC32=y -# CONFIG_CRC7 is not set # CONFIG_LIBCRC32C is not set +CONFIG_ZLIB_INFLATE=m +CONFIG_ZLIB_DEFLATE=m CONFIG_PLIST=y CONFIG_HAS_IOMEM=y CONFIG_HAS_IOPORT=y -CONFIG_HAS_DMA=y diff --git a/trunk/arch/arm/mach-at91/board-cap9adk.c b/trunk/arch/arm/mach-at91/board-cap9adk.c index 117cf6c9afce..a1c41d7c0be9 100644 --- a/trunk/arch/arm/mach-at91/board-cap9adk.c +++ b/trunk/arch/arm/mach-at91/board-cap9adk.c @@ -330,10 +330,10 @@ static void __init cap9adk_board_init(void) /* Serial */ at91_add_device_serial(); /* USB Host */ - set_irq_type(AT91CAP9_ID_UHP, IRQ_TYPE_LEVEL_HIGH); + set_irq_type(AT91CAP9_ID_UHP, IRQT_HIGH); at91_add_device_usbh(&cap9adk_usbh_data); /* USB HS */ - set_irq_type(AT91CAP9_ID_UDPHS, IRQ_TYPE_LEVEL_HIGH); + set_irq_type(AT91CAP9_ID_UDPHS, IRQT_HIGH); at91_add_device_usba(&cap9adk_usba_udc_data); /* SPI */ at91_add_device_spi(cap9adk_spi_devices, ARRAY_SIZE(cap9adk_spi_devices)); @@ -350,7 +350,7 @@ static void __init cap9adk_board_init(void) /* I2C */ at91_add_device_i2c(NULL, 0); /* LCD Controller */ - set_irq_type(AT91CAP9_ID_LCDC, IRQ_TYPE_LEVEL_HIGH); + set_irq_type(AT91CAP9_ID_LCDC, IRQT_HIGH); at91_add_device_lcdc(&cap9adk_lcdc_data); /* AC97 */ at91_add_device_ac97(&cap9adk_ac97_data); diff --git a/trunk/arch/arm/mach-at91/board-yl-9200.c b/trunk/arch/arm/mach-at91/board-yl-9200.c old mode 100644 new mode 100755 diff --git a/trunk/arch/arm/mach-at91/irq.c b/trunk/arch/arm/mach-at91/irq.c index ca87587b2b4b..78a5cdb746dc 100644 --- a/trunk/arch/arm/mach-at91/irq.c +++ b/trunk/arch/arm/mach-at91/irq.c @@ -56,19 +56,19 @@ static int at91_aic_set_type(unsigned irq, unsigned type) unsigned int smr, srctype; switch (type) { - case IRQ_TYPE_LEVEL_HIGH: + case IRQT_HIGH: srctype = AT91_AIC_SRCTYPE_HIGH; break; - case IRQ_TYPE_EDGE_RISING: + case IRQT_RISING: srctype = AT91_AIC_SRCTYPE_RISING; break; - case IRQ_TYPE_LEVEL_LOW: + case IRQT_LOW: if ((irq == AT91_ID_FIQ) || is_extern_irq(irq)) /* only supported on external interrupts */ srctype = AT91_AIC_SRCTYPE_LOW; else return -EINVAL; break; - case IRQ_TYPE_EDGE_FALLING: + case IRQT_FALLING: if ((irq == AT91_ID_FIQ) || is_extern_irq(irq)) /* only supported on external interrupts */ srctype = AT91_AIC_SRCTYPE_FALLING; else diff --git a/trunk/arch/arm/mach-ep93xx/core.c b/trunk/arch/arm/mach-ep93xx/core.c index 5fed57608507..1d7bca6aa441 100644 --- a/trunk/arch/arm/mach-ep93xx/core.c +++ b/trunk/arch/arm/mach-ep93xx/core.c @@ -226,7 +226,7 @@ static void ep93xx_gpio_irq_ack(unsigned int irq) int port = line >> 3; int port_mask = 1 << (line & 7); - if ((irq_desc[irq].status & IRQ_TYPE_SENSE_MASK) == IRQ_TYPE_EDGE_BOTH) { + if ((irq_desc[irq].status & IRQ_TYPE_SENSE_MASK) == IRQT_BOTHEDGE) { gpio_int_type2[port] ^= port_mask; /* switch edge direction */ ep93xx_gpio_update_int_params(port); } @@ -240,7 +240,7 @@ static void ep93xx_gpio_irq_mask_ack(unsigned int irq) int port = line >> 3; int port_mask = 1 << (line & 7); - if ((irq_desc[irq].status & IRQ_TYPE_SENSE_MASK) == IRQ_TYPE_EDGE_BOTH) + if ((irq_desc[irq].status & IRQ_TYPE_SENSE_MASK) == IRQT_BOTHEDGE) gpio_int_type2[port] ^= port_mask; /* switch edge direction */ gpio_int_unmasked[port] &= ~port_mask; @@ -283,27 +283,27 @@ static int ep93xx_gpio_irq_type(unsigned int irq, unsigned int type) gpio_direction_input(gpio); switch (type) { - case IRQ_TYPE_EDGE_RISING: + case IRQT_RISING: gpio_int_type1[port] |= port_mask; gpio_int_type2[port] |= port_mask; desc->handle_irq = handle_edge_irq; break; - case IRQ_TYPE_EDGE_FALLING: + case IRQT_FALLING: gpio_int_type1[port] |= port_mask; gpio_int_type2[port] &= ~port_mask; desc->handle_irq = handle_edge_irq; break; - case IRQ_TYPE_LEVEL_HIGH: + case IRQT_HIGH: gpio_int_type1[port] &= ~port_mask; gpio_int_type2[port] |= port_mask; desc->handle_irq = handle_level_irq; break; - case IRQ_TYPE_LEVEL_LOW: + case IRQT_LOW: gpio_int_type1[port] &= ~port_mask; gpio_int_type2[port] &= ~port_mask; desc->handle_irq = handle_level_irq; break; - case IRQ_TYPE_EDGE_BOTH: + case IRQT_BOTHEDGE: gpio_int_type1[port] |= port_mask; /* set initial polarity based on current input level */ if (gpio_get_value(gpio)) diff --git a/trunk/arch/arm/mach-imx/irq.c b/trunk/arch/arm/mach-imx/irq.c index e1b1f028b930..e6695c4e623b 100644 --- a/trunk/arch/arm/mach-imx/irq.c +++ b/trunk/arch/arm/mach-imx/irq.c @@ -111,7 +111,7 @@ imx_gpio_irq_type(unsigned int _irq, unsigned int type) reg = irq >> 5; bit = 1 << (irq % 32); - if (type == IRQ_TYPE_PROBE) { + if (type == IRQT_PROBE) { /* Don't mess with enabled GPIOs using preconfigured edges or GPIOs set to alternate function during probe */ /* TODO: support probe */ @@ -120,7 +120,7 @@ imx_gpio_irq_type(unsigned int _irq, unsigned int type) // return 0; // if (GAFR(gpio) & (0x3 << (((gpio) & 0xf)*2))) // return 0; -// type = IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING; +// type = __IRQT_RISEDGE | __IRQT_FALEDGE; } GIUS(reg) |= bit; @@ -128,19 +128,19 @@ imx_gpio_irq_type(unsigned int _irq, unsigned int type) DEBUG_IRQ("setting type of irq %d to ", _irq); - if (type & IRQ_TYPE_EDGE_RISING) { + if (type & __IRQT_RISEDGE) { DEBUG_IRQ("rising edges\n"); irq_type = 0x0; } - if (type & IRQ_TYPE_EDGE_FALLING) { + if (type & __IRQT_FALEDGE) { DEBUG_IRQ("falling edges\n"); irq_type = 0x1; } - if (type & IRQ_TYPE_LEVEL_LOW) { + if (type & __IRQT_LOWLVL) { DEBUG_IRQ("low level\n"); irq_type = 0x3; } - if (type & IRQ_TYPE_LEVEL_HIGH) { + if (type & __IRQT_HIGHLVL) { DEBUG_IRQ("high level\n"); irq_type = 0x2; } diff --git a/trunk/arch/arm/mach-ixp2000/core.c b/trunk/arch/arm/mach-ixp2000/core.c index daf28074134b..81cdc8267206 100644 --- a/trunk/arch/arm/mach-ixp2000/core.c +++ b/trunk/arch/arm/mach-ixp2000/core.c @@ -329,19 +329,19 @@ static int ixp2000_GPIO_irq_type(unsigned int irq, unsigned int type) /* * Then, set the proper trigger type. */ - if (type & IRQ_TYPE_EDGE_FALLING) + if (type & IRQT_FALLING) GPIO_IRQ_falling_edge |= 1 << line; else GPIO_IRQ_falling_edge &= ~(1 << line); - if (type & IRQ_TYPE_EDGE_RISING) + if (type & IRQT_RISING) GPIO_IRQ_rising_edge |= 1 << line; else GPIO_IRQ_rising_edge &= ~(1 << line); - if (type & IRQ_TYPE_LEVEL_LOW) + if (type & IRQT_LOW) GPIO_IRQ_level_low |= 1 << line; else GPIO_IRQ_level_low &= ~(1 << line); - if (type & IRQ_TYPE_LEVEL_HIGH) + if (type & IRQT_HIGH) GPIO_IRQ_level_high |= 1 << line; else GPIO_IRQ_level_high &= ~(1 << line); diff --git a/trunk/arch/arm/mach-ixp23xx/core.c b/trunk/arch/arm/mach-ixp23xx/core.c index df16a4eac490..5fea5a132939 100644 --- a/trunk/arch/arm/mach-ixp23xx/core.c +++ b/trunk/arch/arm/mach-ixp23xx/core.c @@ -126,23 +126,23 @@ static int ixp23xx_irq_set_type(unsigned int irq, unsigned int type) return -EINVAL; switch (type) { - case IRQ_TYPE_EDGE_BOTH: + case IRQT_BOTHEDGE: int_style = IXP23XX_GPIO_STYLE_TRANSITIONAL; irq_type = IXP23XX_IRQ_EDGE; break; - case IRQ_TYPE_EDGE_RISING: + case IRQT_RISING: int_style = IXP23XX_GPIO_STYLE_RISING_EDGE; irq_type = IXP23XX_IRQ_EDGE; break; - case IRQ_TYPE_EDGE_FALLING: + case IRQT_FALLING: int_style = IXP23XX_GPIO_STYLE_FALLING_EDGE; irq_type = IXP23XX_IRQ_EDGE; break; - case IRQ_TYPE_LEVEL_HIGH: + case IRQT_HIGH: int_style = IXP23XX_GPIO_STYLE_ACTIVE_HIGH; irq_type = IXP23XX_IRQ_LEVEL; break; - case IRQ_TYPE_LEVEL_LOW: + case IRQT_LOW: int_style = IXP23XX_GPIO_STYLE_ACTIVE_LOW; irq_type = IXP23XX_IRQ_LEVEL; break; diff --git a/trunk/arch/arm/mach-ixp23xx/roadrunner.c b/trunk/arch/arm/mach-ixp23xx/roadrunner.c index 896ff9f840d9..f0f70ba1e46d 100644 --- a/trunk/arch/arm/mach-ixp23xx/roadrunner.c +++ b/trunk/arch/arm/mach-ixp23xx/roadrunner.c @@ -110,8 +110,8 @@ static int __init roadrunner_map_irq(struct pci_dev *dev, u8 idsel, u8 pin) static void __init roadrunner_pci_preinit(void) { - set_irq_type(IRQ_ROADRUNNER_PCI_INTC, IRQ_TYPE_LEVEL_LOW); - set_irq_type(IRQ_ROADRUNNER_PCI_INTD, IRQ_TYPE_LEVEL_LOW); + set_irq_type(IRQ_ROADRUNNER_PCI_INTC, IRQT_LOW); + set_irq_type(IRQ_ROADRUNNER_PCI_INTD, IRQT_LOW); ixp23xx_pci_preinit(); } diff --git a/trunk/arch/arm/mach-ixp4xx/avila-pci.c b/trunk/arch/arm/mach-ixp4xx/avila-pci.c index c6e044befccb..3f867691d9f2 100644 --- a/trunk/arch/arm/mach-ixp4xx/avila-pci.c +++ b/trunk/arch/arm/mach-ixp4xx/avila-pci.c @@ -30,10 +30,10 @@ void __init avila_pci_preinit(void) { - set_irq_type(IRQ_AVILA_PCI_INTA, IRQ_TYPE_LEVEL_LOW); - set_irq_type(IRQ_AVILA_PCI_INTB, IRQ_TYPE_LEVEL_LOW); - set_irq_type(IRQ_AVILA_PCI_INTC, IRQ_TYPE_LEVEL_LOW); - set_irq_type(IRQ_AVILA_PCI_INTD, IRQ_TYPE_LEVEL_LOW); + set_irq_type(IRQ_AVILA_PCI_INTA, IRQT_LOW); + set_irq_type(IRQ_AVILA_PCI_INTB, IRQT_LOW); + set_irq_type(IRQ_AVILA_PCI_INTC, IRQT_LOW); + set_irq_type(IRQ_AVILA_PCI_INTD, IRQT_LOW); ixp4xx_pci_preinit(); } diff --git a/trunk/arch/arm/mach-ixp4xx/common.c b/trunk/arch/arm/mach-ixp4xx/common.c index 3947c506b4f3..3781b3db9f49 100644 --- a/trunk/arch/arm/mach-ixp4xx/common.c +++ b/trunk/arch/arm/mach-ixp4xx/common.c @@ -142,23 +142,23 @@ static int ixp4xx_set_irq_type(unsigned int irq, unsigned int type) return -EINVAL; switch (type){ - case IRQ_TYPE_EDGE_BOTH: + case IRQT_BOTHEDGE: int_style = IXP4XX_GPIO_STYLE_TRANSITIONAL; irq_type = IXP4XX_IRQ_EDGE; break; - case IRQ_TYPE_EDGE_RISING: + case IRQT_RISING: int_style = IXP4XX_GPIO_STYLE_RISING_EDGE; irq_type = IXP4XX_IRQ_EDGE; break; - case IRQ_TYPE_EDGE_FALLING: + case IRQT_FALLING: int_style = IXP4XX_GPIO_STYLE_FALLING_EDGE; irq_type = IXP4XX_IRQ_EDGE; break; - case IRQ_TYPE_LEVEL_HIGH: + case IRQT_HIGH: int_style = IXP4XX_GPIO_STYLE_ACTIVE_HIGH; irq_type = IXP4XX_IRQ_LEVEL; break; - case IRQ_TYPE_LEVEL_LOW: + case IRQT_LOW: int_style = IXP4XX_GPIO_STYLE_ACTIVE_LOW; irq_type = IXP4XX_IRQ_LEVEL; break; diff --git a/trunk/arch/arm/mach-ixp4xx/coyote-pci.c b/trunk/arch/arm/mach-ixp4xx/coyote-pci.c index be4f4a208b90..ad2e5b97966e 100644 --- a/trunk/arch/arm/mach-ixp4xx/coyote-pci.c +++ b/trunk/arch/arm/mach-ixp4xx/coyote-pci.c @@ -27,8 +27,8 @@ void __init coyote_pci_preinit(void) { - set_irq_type(IRQ_COYOTE_PCI_SLOT0, IRQ_TYPE_LEVEL_LOW); - set_irq_type(IRQ_COYOTE_PCI_SLOT1, IRQ_TYPE_LEVEL_LOW); + set_irq_type(IRQ_COYOTE_PCI_SLOT0, IRQT_LOW); + set_irq_type(IRQ_COYOTE_PCI_SLOT1, IRQT_LOW); ixp4xx_pci_preinit(); } diff --git a/trunk/arch/arm/mach-ixp4xx/dsmg600-pci.c b/trunk/arch/arm/mach-ixp4xx/dsmg600-pci.c index 926d15f885fb..9db7e1f42011 100644 --- a/trunk/arch/arm/mach-ixp4xx/dsmg600-pci.c +++ b/trunk/arch/arm/mach-ixp4xx/dsmg600-pci.c @@ -25,12 +25,12 @@ void __init dsmg600_pci_preinit(void) { - set_irq_type(IRQ_DSMG600_PCI_INTA, IRQ_TYPE_LEVEL_LOW); - set_irq_type(IRQ_DSMG600_PCI_INTB, IRQ_TYPE_LEVEL_LOW); - set_irq_type(IRQ_DSMG600_PCI_INTC, IRQ_TYPE_LEVEL_LOW); - set_irq_type(IRQ_DSMG600_PCI_INTD, IRQ_TYPE_LEVEL_LOW); - set_irq_type(IRQ_DSMG600_PCI_INTE, IRQ_TYPE_LEVEL_LOW); - set_irq_type(IRQ_DSMG600_PCI_INTF, IRQ_TYPE_LEVEL_LOW); + set_irq_type(IRQ_DSMG600_PCI_INTA, IRQT_LOW); + set_irq_type(IRQ_DSMG600_PCI_INTB, IRQT_LOW); + set_irq_type(IRQ_DSMG600_PCI_INTC, IRQT_LOW); + set_irq_type(IRQ_DSMG600_PCI_INTD, IRQT_LOW); + set_irq_type(IRQ_DSMG600_PCI_INTE, IRQT_LOW); + set_irq_type(IRQ_DSMG600_PCI_INTF, IRQT_LOW); ixp4xx_pci_preinit(); } diff --git a/trunk/arch/arm/mach-ixp4xx/fsg-pci.c b/trunk/arch/arm/mach-ixp4xx/fsg-pci.c index ca12a9ca0830..f19f3f6feda1 100644 --- a/trunk/arch/arm/mach-ixp4xx/fsg-pci.c +++ b/trunk/arch/arm/mach-ixp4xx/fsg-pci.c @@ -25,9 +25,9 @@ void __init fsg_pci_preinit(void) { - set_irq_type(IRQ_FSG_PCI_INTA, IRQ_TYPE_LEVEL_LOW); - set_irq_type(IRQ_FSG_PCI_INTB, IRQ_TYPE_LEVEL_LOW); - set_irq_type(IRQ_FSG_PCI_INTC, IRQ_TYPE_LEVEL_LOW); + set_irq_type(IRQ_FSG_PCI_INTA, IRQT_LOW); + set_irq_type(IRQ_FSG_PCI_INTB, IRQT_LOW); + set_irq_type(IRQ_FSG_PCI_INTC, IRQT_LOW); ixp4xx_pci_preinit(); } diff --git a/trunk/arch/arm/mach-ixp4xx/gateway7001-pci.c b/trunk/arch/arm/mach-ixp4xx/gateway7001-pci.c index afd1dc14e597..6abf568322d3 100644 --- a/trunk/arch/arm/mach-ixp4xx/gateway7001-pci.c +++ b/trunk/arch/arm/mach-ixp4xx/gateway7001-pci.c @@ -29,8 +29,8 @@ void __init gateway7001_pci_preinit(void) { - set_irq_type(IRQ_IXP4XX_GPIO10, IRQ_TYPE_LEVEL_LOW); - set_irq_type(IRQ_IXP4XX_GPIO11, IRQ_TYPE_LEVEL_LOW); + set_irq_type(IRQ_IXP4XX_GPIO10, IRQT_LOW); + set_irq_type(IRQ_IXP4XX_GPIO11, IRQT_LOW); ixp4xx_pci_preinit(); } diff --git a/trunk/arch/arm/mach-ixp4xx/gtwx5715-pci.c b/trunk/arch/arm/mach-ixp4xx/gtwx5715-pci.c index 20960704183b..49dec7868807 100644 --- a/trunk/arch/arm/mach-ixp4xx/gtwx5715-pci.c +++ b/trunk/arch/arm/mach-ixp4xx/gtwx5715-pci.c @@ -41,10 +41,10 @@ */ void __init gtwx5715_pci_preinit(void) { - set_irq_type(GTWX5715_PCI_SLOT0_INTA_IRQ, IRQ_TYPE_LEVEL_LOW); - set_irq_type(GTWX5715_PCI_SLOT0_INTB_IRQ, IRQ_TYPE_LEVEL_LOW); - set_irq_type(GTWX5715_PCI_SLOT1_INTA_IRQ, IRQ_TYPE_LEVEL_LOW); - set_irq_type(GTWX5715_PCI_SLOT1_INTB_IRQ, IRQ_TYPE_LEVEL_LOW); + set_irq_type(GTWX5715_PCI_SLOT0_INTA_IRQ, IRQT_LOW); + set_irq_type(GTWX5715_PCI_SLOT0_INTB_IRQ, IRQT_LOW); + set_irq_type(GTWX5715_PCI_SLOT1_INTA_IRQ, IRQT_LOW); + set_irq_type(GTWX5715_PCI_SLOT1_INTB_IRQ, IRQT_LOW); ixp4xx_pci_preinit(); } diff --git a/trunk/arch/arm/mach-ixp4xx/ixdp425-pci.c b/trunk/arch/arm/mach-ixp4xx/ixdp425-pci.c index 7d9bb4d23104..408796004812 100644 --- a/trunk/arch/arm/mach-ixp4xx/ixdp425-pci.c +++ b/trunk/arch/arm/mach-ixp4xx/ixdp425-pci.c @@ -27,10 +27,10 @@ void __init ixdp425_pci_preinit(void) { - set_irq_type(IRQ_IXDP425_PCI_INTA, IRQ_TYPE_LEVEL_LOW); - set_irq_type(IRQ_IXDP425_PCI_INTB, IRQ_TYPE_LEVEL_LOW); - set_irq_type(IRQ_IXDP425_PCI_INTC, IRQ_TYPE_LEVEL_LOW); - set_irq_type(IRQ_IXDP425_PCI_INTD, IRQ_TYPE_LEVEL_LOW); + set_irq_type(IRQ_IXDP425_PCI_INTA, IRQT_LOW); + set_irq_type(IRQ_IXDP425_PCI_INTB, IRQT_LOW); + set_irq_type(IRQ_IXDP425_PCI_INTC, IRQT_LOW); + set_irq_type(IRQ_IXDP425_PCI_INTD, IRQT_LOW); ixp4xx_pci_preinit(); } diff --git a/trunk/arch/arm/mach-ixp4xx/ixdpg425-pci.c b/trunk/arch/arm/mach-ixp4xx/ixdpg425-pci.c index 37d9f2e8f602..d1e75b7dc3b1 100644 --- a/trunk/arch/arm/mach-ixp4xx/ixdpg425-pci.c +++ b/trunk/arch/arm/mach-ixp4xx/ixdpg425-pci.c @@ -25,8 +25,8 @@ void __init ixdpg425_pci_preinit(void) { - set_irq_type(IRQ_IXP4XX_GPIO6, IRQ_TYPE_LEVEL_LOW); - set_irq_type(IRQ_IXP4XX_GPIO7, IRQ_TYPE_LEVEL_LOW); + set_irq_type(IRQ_IXP4XX_GPIO6, IRQT_LOW); + set_irq_type(IRQ_IXP4XX_GPIO7, IRQT_LOW); ixp4xx_pci_preinit(); } diff --git a/trunk/arch/arm/mach-ixp4xx/nas100d-pci.c b/trunk/arch/arm/mach-ixp4xx/nas100d-pci.c index 1088426fdcee..b8ebaf4a9c8e 100644 --- a/trunk/arch/arm/mach-ixp4xx/nas100d-pci.c +++ b/trunk/arch/arm/mach-ixp4xx/nas100d-pci.c @@ -24,11 +24,11 @@ void __init nas100d_pci_preinit(void) { - set_irq_type(IRQ_NAS100D_PCI_INTA, IRQ_TYPE_LEVEL_LOW); - set_irq_type(IRQ_NAS100D_PCI_INTB, IRQ_TYPE_LEVEL_LOW); - set_irq_type(IRQ_NAS100D_PCI_INTC, IRQ_TYPE_LEVEL_LOW); - set_irq_type(IRQ_NAS100D_PCI_INTD, IRQ_TYPE_LEVEL_LOW); - set_irq_type(IRQ_NAS100D_PCI_INTE, IRQ_TYPE_LEVEL_LOW); + set_irq_type(IRQ_NAS100D_PCI_INTA, IRQT_LOW); + set_irq_type(IRQ_NAS100D_PCI_INTB, IRQT_LOW); + set_irq_type(IRQ_NAS100D_PCI_INTC, IRQT_LOW); + set_irq_type(IRQ_NAS100D_PCI_INTD, IRQT_LOW); + set_irq_type(IRQ_NAS100D_PCI_INTE, IRQT_LOW); ixp4xx_pci_preinit(); } diff --git a/trunk/arch/arm/mach-ixp4xx/nslu2-pci.c b/trunk/arch/arm/mach-ixp4xx/nslu2-pci.c index 4429b8448b61..04661fef97f5 100644 --- a/trunk/arch/arm/mach-ixp4xx/nslu2-pci.c +++ b/trunk/arch/arm/mach-ixp4xx/nslu2-pci.c @@ -24,9 +24,9 @@ void __init nslu2_pci_preinit(void) { - set_irq_type(IRQ_NSLU2_PCI_INTA, IRQ_TYPE_LEVEL_LOW); - set_irq_type(IRQ_NSLU2_PCI_INTB, IRQ_TYPE_LEVEL_LOW); - set_irq_type(IRQ_NSLU2_PCI_INTC, IRQ_TYPE_LEVEL_LOW); + set_irq_type(IRQ_NSLU2_PCI_INTA, IRQT_LOW); + set_irq_type(IRQ_NSLU2_PCI_INTB, IRQT_LOW); + set_irq_type(IRQ_NSLU2_PCI_INTC, IRQT_LOW); ixp4xx_pci_preinit(); } diff --git a/trunk/arch/arm/mach-ixp4xx/wg302v2-pci.c b/trunk/arch/arm/mach-ixp4xx/wg302v2-pci.c index 0f00feab67f8..6588f2c758e2 100644 --- a/trunk/arch/arm/mach-ixp4xx/wg302v2-pci.c +++ b/trunk/arch/arm/mach-ixp4xx/wg302v2-pci.c @@ -29,8 +29,8 @@ void __init wg302v2_pci_preinit(void) { - set_irq_type(IRQ_IXP4XX_GPIO8, IRQ_TYPE_LEVEL_LOW); - set_irq_type(IRQ_IXP4XX_GPIO9, IRQ_TYPE_LEVEL_LOW); + set_irq_type(IRQ_IXP4XX_GPIO8, IRQT_LOW); + set_irq_type(IRQ_IXP4XX_GPIO9, IRQT_LOW); ixp4xx_pci_preinit(); } diff --git a/trunk/arch/arm/mach-ks8695/irq.c b/trunk/arch/arm/mach-ks8695/irq.c index 0b06941a1eed..4c3ab43e1046 100644 --- a/trunk/arch/arm/mach-ks8695/irq.c +++ b/trunk/arch/arm/mach-ks8695/irq.c @@ -72,21 +72,21 @@ static int ks8695_irq_set_type(unsigned int irqno, unsigned int type) ctrl = __raw_readl(KS8695_GPIO_VA + KS8695_IOPC); switch (type) { - case IRQ_TYPE_LEVEL_HIGH: + case IRQT_HIGH: mode = IOPC_TM_HIGH; level_triggered = 1; break; - case IRQ_TYPE_LEVEL_LOW: + case IRQT_LOW: mode = IOPC_TM_LOW; level_triggered = 1; break; - case IRQ_TYPE_EDGE_RISING: + case IRQT_RISING: mode = IOPC_TM_RISING; break; - case IRQ_TYPE_EDGE_FALLING: + case IRQT_FALLING: mode = IOPC_TM_FALLING; break; - case IRQ_TYPE_EDGE_BOTH: + case IRQT_BOTHEDGE: mode = IOPC_TM_EDGE; break; default: diff --git a/trunk/arch/arm/mach-netx/generic.c b/trunk/arch/arm/mach-netx/generic.c index 99d4fb19a08a..fd7537f7d11e 100644 --- a/trunk/arch/arm/mach-netx/generic.c +++ b/trunk/arch/arm/mach-netx/generic.c @@ -99,19 +99,19 @@ netx_hif_irq_type(unsigned int _irq, unsigned int type) irq = _irq - NETX_IRQ_HIF_CHAINED(0); - if (type & IRQ_TYPE_EDGE_RISING) { + if (type & __IRQT_RISEDGE) { DEBUG_IRQ("rising edges\n"); val |= (1 << 26) << irq; } - if (type & IRQ_TYPE_EDGE_FALLING) { + if (type & __IRQT_FALEDGE) { DEBUG_IRQ("falling edges\n"); val &= ~((1 << 26) << irq); } - if (type & IRQ_TYPE_LEVEL_LOW) { + if (type & __IRQT_LOWLVL) { DEBUG_IRQ("low level\n"); val &= ~((1 << 26) << irq); } - if (type & IRQ_TYPE_LEVEL_HIGH) { + if (type & __IRQT_HIGHLVL) { DEBUG_IRQ("high level\n"); val |= (1 << 26) << irq; } diff --git a/trunk/arch/arm/mach-omap1/board-osk.c b/trunk/arch/arm/mach-omap1/board-osk.c index 41f94f6fc15c..845c66371ca3 100644 --- a/trunk/arch/arm/mach-omap1/board-osk.c +++ b/trunk/arch/arm/mach-omap1/board-osk.c @@ -288,7 +288,7 @@ static void __init osk_init_cf(void) return; } /* the CF I/O IRQ is really active-low */ - set_irq_type(OMAP_GPIO_IRQ(62), IRQ_TYPE_EDGE_FALLING); + set_irq_type(OMAP_GPIO_IRQ(62), IRQT_FALLING); } static void __init osk_init_irq(void) @@ -483,7 +483,7 @@ static void __init osk_mistral_init(void) omap_cfg_reg(P20_1610_GPIO4); /* PENIRQ */ gpio_request(4, "ts_int"); gpio_direction_input(4); - set_irq_type(OMAP_GPIO_IRQ(4), IRQ_TYPE_EDGE_FALLING); + set_irq_type(OMAP_GPIO_IRQ(4), IRQT_FALLING); spi_register_board_info(mistral_boardinfo, ARRAY_SIZE(mistral_boardinfo)); @@ -494,7 +494,7 @@ static void __init osk_mistral_init(void) int ret = 0; gpio_direction_input(OMAP_MPUIO(2)); - set_irq_type(OMAP_GPIO_IRQ(OMAP_MPUIO(2)), IRQ_TYPE_EDGE_RISING); + set_irq_type(OMAP_GPIO_IRQ(OMAP_MPUIO(2)), IRQT_RISING); #ifdef CONFIG_PM /* share the IRQ in case someone wants to use the * button for more than wakeup from system sleep. diff --git a/trunk/arch/arm/mach-omap1/board-palmz71.c b/trunk/arch/arm/mach-omap1/board-palmz71.c index 34389b63b0ec..e020c2774606 100644 --- a/trunk/arch/arm/mach-omap1/board-palmz71.c +++ b/trunk/arch/arm/mach-omap1/board-palmz71.c @@ -298,11 +298,11 @@ palmz71_powercable(int irq, void *dev_id) if (omap_get_gpio_datain(PALMZ71_USBDETECT_GPIO)) { printk(KERN_INFO "PM: Power cable connected\n"); set_irq_type(OMAP_GPIO_IRQ(PALMZ71_USBDETECT_GPIO), - IRQ_TYPE_EDGE_FALLING); + IRQT_FALLING); } else { printk(KERN_INFO "PM: Power cable disconnected\n"); set_irq_type(OMAP_GPIO_IRQ(PALMZ71_USBDETECT_GPIO), - IRQ_TYPE_EDGE_RISING); + IRQT_RISING); } return IRQ_HANDLED; } diff --git a/trunk/arch/arm/mach-omap1/board-voiceblue.c b/trunk/arch/arm/mach-omap1/board-voiceblue.c index 8948d45a2769..5c00b3f39cdd 100644 --- a/trunk/arch/arm/mach-omap1/board-voiceblue.c +++ b/trunk/arch/arm/mach-omap1/board-voiceblue.c @@ -186,10 +186,10 @@ static void __init voiceblue_init(void) omap_request_gpio(13); omap_request_gpio(14); omap_request_gpio(15); - set_irq_type(OMAP_GPIO_IRQ(12), IRQ_TYPE_EDGE_RISING); - set_irq_type(OMAP_GPIO_IRQ(13), IRQ_TYPE_EDGE_RISING); - set_irq_type(OMAP_GPIO_IRQ(14), IRQ_TYPE_EDGE_RISING); - set_irq_type(OMAP_GPIO_IRQ(15), IRQ_TYPE_EDGE_RISING); + set_irq_type(OMAP_GPIO_IRQ(12), IRQT_RISING); + set_irq_type(OMAP_GPIO_IRQ(13), IRQT_RISING); + set_irq_type(OMAP_GPIO_IRQ(14), IRQT_RISING); + set_irq_type(OMAP_GPIO_IRQ(15), IRQT_RISING); platform_add_devices(voiceblue_devices, ARRAY_SIZE(voiceblue_devices)); omap_board_config = voiceblue_config; diff --git a/trunk/arch/arm/mach-omap1/fpga.c b/trunk/arch/arm/mach-omap1/fpga.c index d963125ed755..0cf62ef5ecb7 100644 --- a/trunk/arch/arm/mach-omap1/fpga.c +++ b/trunk/arch/arm/mach-omap1/fpga.c @@ -181,7 +181,7 @@ void omap1510_fpga_init_irq(void) */ omap_request_gpio(13); omap_set_gpio_direction(13, 1); - set_irq_type(OMAP_GPIO_IRQ(13), IRQ_TYPE_EDGE_RISING); + set_irq_type(OMAP_GPIO_IRQ(13), IRQT_RISING); set_irq_chained_handler(OMAP1510_INT_FPGA, innovator_fpga_IRQ_demux); } diff --git a/trunk/arch/arm/mach-omap2/board-apollon.c b/trunk/arch/arm/mach-omap2/board-apollon.c index 870b34972d3b..620fa0f120ee 100644 --- a/trunk/arch/arm/mach-omap2/board-apollon.c +++ b/trunk/arch/arm/mach-omap2/board-apollon.c @@ -337,17 +337,17 @@ static void __init apollon_sw_init(void) omap_request_gpio(SW_DOWN_GPIO58); omap_set_gpio_direction(SW_DOWN_GPIO58, 1); - set_irq_type(OMAP_GPIO_IRQ(SW_ENTER_GPIO16), IRQ_TYPE_EDGE_RISING); + set_irq_type(OMAP_GPIO_IRQ(SW_ENTER_GPIO16), IRQT_RISING); if (request_irq(OMAP_GPIO_IRQ(SW_ENTER_GPIO16), &apollon_sw_interrupt, IRQF_SHARED, "enter sw", &apollon_sw_interrupt)) return; - set_irq_type(OMAP_GPIO_IRQ(SW_UP_GPIO17), IRQ_TYPE_EDGE_RISING); + set_irq_type(OMAP_GPIO_IRQ(SW_UP_GPIO17), IRQT_RISING); if (request_irq(OMAP_GPIO_IRQ(SW_UP_GPIO17), &apollon_sw_interrupt, IRQF_SHARED, "up sw", &apollon_sw_interrupt)) return; - set_irq_type(OMAP_GPIO_IRQ(SW_DOWN_GPIO58), IRQ_TYPE_EDGE_RISING); + set_irq_type(OMAP_GPIO_IRQ(SW_DOWN_GPIO58), IRQT_RISING); if (request_irq(OMAP_GPIO_IRQ(SW_DOWN_GPIO58), &apollon_sw_interrupt, IRQF_SHARED, "down sw", &apollon_sw_interrupt)) diff --git a/trunk/arch/arm/mach-orion5x/db88f5281-setup.c b/trunk/arch/arm/mach-orion5x/db88f5281-setup.c index 40a0bee4fbb3..88405e74e5e3 100644 --- a/trunk/arch/arm/mach-orion5x/db88f5281-setup.c +++ b/trunk/arch/arm/mach-orion5x/db88f5281-setup.c @@ -213,7 +213,7 @@ void __init db88f5281_pci_preinit(void) pin = DB88F5281_PCI_SLOT0_IRQ_PIN; if (gpio_request(pin, "PCI Int1") == 0) { if (gpio_direction_input(pin) == 0) { - set_irq_type(gpio_to_irq(pin), IRQ_TYPE_LEVEL_LOW); + set_irq_type(gpio_to_irq(pin), IRQT_LOW); } else { printk(KERN_ERR "db88f5281_pci_preinit faield to " "set_irq_type pin %d\n", pin); @@ -226,7 +226,7 @@ void __init db88f5281_pci_preinit(void) pin = DB88F5281_PCI_SLOT1_SLOT2_IRQ_PIN; if (gpio_request(pin, "PCI Int2") == 0) { if (gpio_direction_input(pin) == 0) { - set_irq_type(gpio_to_irq(pin), IRQ_TYPE_LEVEL_LOW); + set_irq_type(gpio_to_irq(pin), IRQT_LOW); } else { printk(KERN_ERR "db88f5281_pci_preinit faield " "to set_irq_type pin %d\n", pin); diff --git a/trunk/arch/arm/mach-orion5x/irq.c b/trunk/arch/arm/mach-orion5x/irq.c index 9ae3f6dc7839..e2a0084ab4a3 100644 --- a/trunk/arch/arm/mach-orion5x/irq.c +++ b/trunk/arch/arm/mach-orion5x/irq.c @@ -91,27 +91,27 @@ static int orion5x_gpio_set_irq_type(u32 irq, u32 type) desc = irq_desc + irq; switch (type) { - case IRQ_TYPE_LEVEL_HIGH: + case IRQT_HIGH: desc->handle_irq = handle_level_irq; desc->status |= IRQ_LEVEL; orion5x_clrbits(GPIO_IN_POL, (1 << pin)); break; - case IRQ_TYPE_LEVEL_LOW: + case IRQT_LOW: desc->handle_irq = handle_level_irq; desc->status |= IRQ_LEVEL; orion5x_setbits(GPIO_IN_POL, (1 << pin)); break; - case IRQ_TYPE_EDGE_RISING: + case IRQT_RISING: desc->handle_irq = handle_edge_irq; desc->status &= ~IRQ_LEVEL; orion5x_clrbits(GPIO_IN_POL, (1 << pin)); break; - case IRQ_TYPE_EDGE_FALLING: + case IRQT_FALLING: desc->handle_irq = handle_edge_irq; desc->status &= ~IRQ_LEVEL; orion5x_setbits(GPIO_IN_POL, (1 << pin)); break; - case IRQ_TYPE_EDGE_BOTH: + case IRQT_BOTHEDGE: desc->handle_irq = handle_edge_irq; desc->status &= ~IRQ_LEVEL; /* @@ -156,7 +156,7 @@ static void orion5x_gpio_irq_handler(unsigned int irq, struct irq_desc *desc) if (cause & (1 << pin)) { irq = gpio_to_irq(pin); desc = irq_desc + irq; - if ((desc->status & IRQ_TYPE_SENSE_MASK) == IRQ_TYPE_EDGE_BOTH) { + if ((desc->status & IRQ_TYPE_SENSE_MASK) == IRQT_BOTHEDGE) { /* Swap polarity (race with GPIO line) */ u32 polarity = readl(GPIO_IN_POL); polarity ^= 1 << pin; diff --git a/trunk/arch/arm/mach-orion5x/rd88f5182-setup.c b/trunk/arch/arm/mach-orion5x/rd88f5182-setup.c index 2a46d27209c1..10ae62864269 100644 --- a/trunk/arch/arm/mach-orion5x/rd88f5182-setup.c +++ b/trunk/arch/arm/mach-orion5x/rd88f5182-setup.c @@ -148,7 +148,7 @@ void __init rd88f5182_pci_preinit(void) pin = RD88F5182_PCI_SLOT0_IRQ_A_PIN; if (gpio_request(pin, "PCI IntA") == 0) { if (gpio_direction_input(pin) == 0) { - set_irq_type(gpio_to_irq(pin), IRQ_TYPE_LEVEL_LOW); + set_irq_type(gpio_to_irq(pin), IRQT_LOW); } else { printk(KERN_ERR "rd88f5182_pci_preinit faield to " "set_irq_type pin %d\n", pin); @@ -161,7 +161,7 @@ void __init rd88f5182_pci_preinit(void) pin = RD88F5182_PCI_SLOT0_IRQ_B_PIN; if (gpio_request(pin, "PCI IntB") == 0) { if (gpio_direction_input(pin) == 0) { - set_irq_type(gpio_to_irq(pin), IRQ_TYPE_LEVEL_LOW); + set_irq_type(gpio_to_irq(pin), IRQT_LOW); } else { printk(KERN_ERR "rd88f5182_pci_preinit faield to " "set_irq_type pin %d\n", pin); diff --git a/trunk/arch/arm/mach-orion5x/ts209-setup.c b/trunk/arch/arm/mach-orion5x/ts209-setup.c index f270ada2def9..a9cef9703d5b 100644 --- a/trunk/arch/arm/mach-orion5x/ts209-setup.c +++ b/trunk/arch/arm/mach-orion5x/ts209-setup.c @@ -117,7 +117,7 @@ void __init qnap_ts209_pci_preinit(void) pin = QNAP_TS209_PCI_SLOT0_IRQ_PIN; if (gpio_request(pin, "PCI Int1") == 0) { if (gpio_direction_input(pin) == 0) { - set_irq_type(gpio_to_irq(pin), IRQ_TYPE_LEVEL_LOW); + set_irq_type(gpio_to_irq(pin), IRQT_LOW); } else { printk(KERN_ERR "qnap_ts209_pci_preinit failed to " "set_irq_type pin %d\n", pin); @@ -131,7 +131,7 @@ void __init qnap_ts209_pci_preinit(void) pin = QNAP_TS209_PCI_SLOT1_IRQ_PIN; if (gpio_request(pin, "PCI Int2") == 0) { if (gpio_direction_input(pin) == 0) { - set_irq_type(gpio_to_irq(pin), IRQ_TYPE_LEVEL_LOW); + set_irq_type(gpio_to_irq(pin), IRQT_LOW); } else { printk(KERN_ERR "qnap_ts209_pci_preinit failed " "to set_irq_type pin %d\n", pin); diff --git a/trunk/arch/arm/mach-pnx4008/irq.c b/trunk/arch/arm/mach-pnx4008/irq.c index 5ed67e1947a8..968d0b027597 100644 --- a/trunk/arch/arm/mach-pnx4008/irq.c +++ b/trunk/arch/arm/mach-pnx4008/irq.c @@ -56,28 +56,28 @@ static void pnx4008_mask_ack_irq(unsigned int irq) static int pnx4008_set_irq_type(unsigned int irq, unsigned int type) { switch (type) { - case IRQ_TYPE_EDGE_RISING: + case IRQT_RISING: __raw_writel(__raw_readl(INTC_ATR(irq)) | INTC_BIT(irq), INTC_ATR(irq)); /*edge sensitive */ __raw_writel(__raw_readl(INTC_APR(irq)) | INTC_BIT(irq), INTC_APR(irq)); /*rising edge */ set_irq_handler(irq, handle_edge_irq); break; - case IRQ_TYPE_EDGE_FALLING: + case IRQT_FALLING: __raw_writel(__raw_readl(INTC_ATR(irq)) | INTC_BIT(irq), INTC_ATR(irq)); /*edge sensitive */ __raw_writel(__raw_readl(INTC_APR(irq)) & ~INTC_BIT(irq), INTC_APR(irq)); /*falling edge */ set_irq_handler(irq, handle_edge_irq); break; - case IRQ_TYPE_LEVEL_LOW: + case IRQT_LOW: __raw_writel(__raw_readl(INTC_ATR(irq)) & ~INTC_BIT(irq), INTC_ATR(irq)); /*level sensitive */ __raw_writel(__raw_readl(INTC_APR(irq)) & ~INTC_BIT(irq), INTC_APR(irq)); /*low level */ set_irq_handler(irq, handle_level_irq); break; - case IRQ_TYPE_LEVEL_HIGH: + case IRQT_HIGH: __raw_writel(__raw_readl(INTC_ATR(irq)) & ~INTC_BIT(irq), INTC_ATR(irq)); /*level sensitive */ __raw_writel(__raw_readl(INTC_APR(irq)) | INTC_BIT(irq), INTC_APR(irq)); /* high level */ set_irq_handler(irq, handle_level_irq); break; - /* IRQ_TYPE_EDGE_BOTH is not supported */ + /* IRQT_BOTHEDGE is not supported */ default: printk(KERN_ERR "PNX4008 IRQ: Unsupported irq type %d\n", type); return -1; diff --git a/trunk/arch/arm/mach-pxa/cm-x270-pci.c b/trunk/arch/arm/mach-pxa/cm-x270-pci.c index 31f5bd411ced..bcf0cde6ccc9 100644 --- a/trunk/arch/arm/mach-pxa/cm-x270-pci.c +++ b/trunk/arch/arm/mach-pxa/cm-x270-pci.c @@ -71,7 +71,7 @@ void __cmx270_pci_init_irq(int irq_gpio) cmx270_it8152_irq_gpio = irq_gpio; - set_irq_type(gpio_to_irq(irq_gpio), IRQ_TYPE_EDGE_RISING); + set_irq_type(gpio_to_irq(irq_gpio), IRQT_RISING); set_irq_chained_handler(gpio_to_irq(irq_gpio), cmx270_it8152_irq_demux); } diff --git a/trunk/arch/arm/mach-pxa/lpd270.c b/trunk/arch/arm/mach-pxa/lpd270.c index 8d1ab54e7b20..cc1c4fa06145 100644 --- a/trunk/arch/arm/mach-pxa/lpd270.c +++ b/trunk/arch/arm/mach-pxa/lpd270.c @@ -113,7 +113,7 @@ static void __init lpd270_init_irq(void) set_irq_flags(irq, IRQF_VALID | IRQF_PROBE); } set_irq_chained_handler(IRQ_GPIO(0), lpd270_irq_handler); - set_irq_type(IRQ_GPIO(0), IRQ_TYPE_EDGE_FALLING); + set_irq_type(IRQ_GPIO(0), IRQT_FALLING); } diff --git a/trunk/arch/arm/mach-pxa/lubbock.c b/trunk/arch/arm/mach-pxa/lubbock.c index af7375bb46a4..ac26423cd20c 100644 --- a/trunk/arch/arm/mach-pxa/lubbock.c +++ b/trunk/arch/arm/mach-pxa/lubbock.c @@ -152,7 +152,7 @@ static void __init lubbock_init_irq(void) } set_irq_chained_handler(IRQ_GPIO(0), lubbock_irq_handler); - set_irq_type(IRQ_GPIO(0), IRQ_TYPE_EDGE_FALLING); + set_irq_type(IRQ_GPIO(0), IRQT_FALLING); } #ifdef CONFIG_PM diff --git a/trunk/arch/arm/mach-pxa/mainstone.c b/trunk/arch/arm/mach-pxa/mainstone.c index c8e38b5ff1c4..851ec2d9b699 100644 --- a/trunk/arch/arm/mach-pxa/mainstone.c +++ b/trunk/arch/arm/mach-pxa/mainstone.c @@ -191,7 +191,7 @@ static void __init mainstone_init_irq(void) MST_INTSETCLR = 0; set_irq_chained_handler(IRQ_GPIO(0), mainstone_irq_handler); - set_irq_type(IRQ_GPIO(0), IRQ_TYPE_EDGE_FALLING); + set_irq_type(IRQ_GPIO(0), IRQT_FALLING); } #ifdef CONFIG_PM diff --git a/trunk/arch/arm/mach-pxa/sharpsl_pm.c b/trunk/arch/arm/mach-pxa/sharpsl_pm.c index 23e9b9283301..34cd585075b0 100644 --- a/trunk/arch/arm/mach-pxa/sharpsl_pm.c +++ b/trunk/arch/arm/mach-pxa/sharpsl_pm.c @@ -146,18 +146,18 @@ void sharpsl_pm_pxa_init(void) if (request_irq(IRQ_GPIO(sharpsl_pm.machinfo->gpio_acin), sharpsl_ac_isr, IRQF_DISABLED, "AC Input Detect", sharpsl_ac_isr)) { dev_err(sharpsl_pm.dev, "Could not get irq %d.\n", IRQ_GPIO(sharpsl_pm.machinfo->gpio_acin)); } - else set_irq_type(IRQ_GPIO(sharpsl_pm.machinfo->gpio_acin),IRQ_TYPE_EDGE_BOTH); + else set_irq_type(IRQ_GPIO(sharpsl_pm.machinfo->gpio_acin),IRQT_BOTHEDGE); if (request_irq(IRQ_GPIO(sharpsl_pm.machinfo->gpio_batlock), sharpsl_fatal_isr, IRQF_DISABLED, "Battery Cover", sharpsl_fatal_isr)) { dev_err(sharpsl_pm.dev, "Could not get irq %d.\n", IRQ_GPIO(sharpsl_pm.machinfo->gpio_batlock)); } - else set_irq_type(IRQ_GPIO(sharpsl_pm.machinfo->gpio_batlock),IRQ_TYPE_EDGE_FALLING); + else set_irq_type(IRQ_GPIO(sharpsl_pm.machinfo->gpio_batlock),IRQT_FALLING); if (sharpsl_pm.machinfo->gpio_fatal) { if (request_irq(IRQ_GPIO(sharpsl_pm.machinfo->gpio_fatal), sharpsl_fatal_isr, IRQF_DISABLED, "Fatal Battery", sharpsl_fatal_isr)) { dev_err(sharpsl_pm.dev, "Could not get irq %d.\n", IRQ_GPIO(sharpsl_pm.machinfo->gpio_fatal)); } - else set_irq_type(IRQ_GPIO(sharpsl_pm.machinfo->gpio_fatal),IRQ_TYPE_EDGE_FALLING); + else set_irq_type(IRQ_GPIO(sharpsl_pm.machinfo->gpio_fatal),IRQT_FALLING); } if (sharpsl_pm.machinfo->batfull_irq) @@ -166,7 +166,7 @@ void sharpsl_pm_pxa_init(void) if (request_irq(IRQ_GPIO(sharpsl_pm.machinfo->gpio_batfull), sharpsl_chrg_full_isr, IRQF_DISABLED, "CO", sharpsl_chrg_full_isr)) { dev_err(sharpsl_pm.dev, "Could not get irq %d.\n", IRQ_GPIO(sharpsl_pm.machinfo->gpio_batfull)); } - else set_irq_type(IRQ_GPIO(sharpsl_pm.machinfo->gpio_batfull),IRQ_TYPE_EDGE_RISING); + else set_irq_type(IRQ_GPIO(sharpsl_pm.machinfo->gpio_batfull),IRQT_RISING); } } diff --git a/trunk/arch/arm/mach-pxa/trizeps4.c b/trunk/arch/arm/mach-pxa/trizeps4.c index 12811b7aea07..dee7bf36f013 100644 --- a/trunk/arch/arm/mach-pxa/trizeps4.c +++ b/trunk/arch/arm/mach-pxa/trizeps4.c @@ -122,7 +122,7 @@ static struct resource dm9000_resources[] = { [2] = { .start = TRIZEPS4_ETH_IRQ, .end = TRIZEPS4_ETH_IRQ, - .flags = (IORESOURCE_IRQ | IRQ_TYPE_EDGE_RISING), + .flags = (IORESOURCE_IRQ | IRQT_RISING), }, }; diff --git a/trunk/arch/arm/mach-sa1100/cerf.c b/trunk/arch/arm/mach-sa1100/cerf.c index 56d3ee01baae..31afe50d7cd5 100644 --- a/trunk/arch/arm/mach-sa1100/cerf.c +++ b/trunk/arch/arm/mach-sa1100/cerf.c @@ -96,7 +96,7 @@ static struct resource cerf_flash_resource = { static void __init cerf_init_irq(void) { sa1100_init_irq(); - set_irq_type(CERF_ETH_IRQ, IRQ_TYPE_EDGE_RISING); + set_irq_type(CERF_ETH_IRQ, IRQT_RISING); } static struct map_desc cerf_io_desc[] __initdata = { diff --git a/trunk/arch/arm/mach-sa1100/h3600.c b/trunk/arch/arm/mach-sa1100/h3600.c index b34ff42bbd75..8473c37b77d6 100644 --- a/trunk/arch/arm/mach-sa1100/h3600.c +++ b/trunk/arch/arm/mach-sa1100/h3600.c @@ -834,7 +834,7 @@ static void __init h3800_init_irq(void) set_irq_chip(irq, &h3800_gpio_irqchip); } #endif - set_irq_type(IRQ_GPIO_H3800_ASIC, IRQ_TYPE_EDGE_RISING); + set_irq_type(IRQ_GPIO_H3800_ASIC, IRQT_RISING); set_irq_chained_handler(IRQ_GPIO_H3800_ASIC, h3800_IRQ_demux); } diff --git a/trunk/arch/arm/mach-sa1100/irq.c b/trunk/arch/arm/mach-sa1100/irq.c index c5e438b12ec7..fa0403af7eec 100644 --- a/trunk/arch/arm/mach-sa1100/irq.c +++ b/trunk/arch/arm/mach-sa1100/irq.c @@ -46,17 +46,17 @@ static int sa1100_gpio_type(unsigned int irq, unsigned int type) else mask = GPIO11_27_MASK(irq); - if (type == IRQ_TYPE_PROBE) { + if (type == IRQT_PROBE) { if ((GPIO_IRQ_rising_edge | GPIO_IRQ_falling_edge) & mask) return 0; - type = IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING; + type = __IRQT_RISEDGE | __IRQT_FALEDGE; } - if (type & IRQ_TYPE_EDGE_RISING) { + if (type & __IRQT_RISEDGE) { GPIO_IRQ_rising_edge |= mask; } else GPIO_IRQ_rising_edge &= ~mask; - if (type & IRQ_TYPE_EDGE_FALLING) { + if (type & __IRQT_FALEDGE) { GPIO_IRQ_falling_edge |= mask; } else GPIO_IRQ_falling_edge &= ~mask; diff --git a/trunk/arch/arm/mach-sa1100/neponset.c b/trunk/arch/arm/mach-sa1100/neponset.c index 967a48454f6b..9f1ed1509301 100644 --- a/trunk/arch/arm/mach-sa1100/neponset.c +++ b/trunk/arch/arm/mach-sa1100/neponset.c @@ -151,7 +151,7 @@ static int __devinit neponset_probe(struct platform_device *dev) /* * Install handler for GPIO25. */ - set_irq_type(IRQ_GPIO25, IRQ_TYPE_EDGE_RISING); + set_irq_type(IRQ_GPIO25, IRQT_RISING); set_irq_chained_handler(IRQ_GPIO25, neponset_irq_handler); /* diff --git a/trunk/arch/arm/mach-sa1100/pleb.c b/trunk/arch/arm/mach-sa1100/pleb.c index 69a71f11625e..c7bf7e0038f0 100644 --- a/trunk/arch/arm/mach-sa1100/pleb.c +++ b/trunk/arch/arm/mach-sa1100/pleb.c @@ -143,7 +143,7 @@ static void __init pleb_map_io(void) GPDR &= ~GPIO_ETH0_IRQ; - set_irq_type(GPIO_ETH0_IRQ, IRQ_TYPE_EDGE_FALLING); + set_irq_type(GPIO_ETH0_IRQ, IRQT_FALLING); } MACHINE_START(PLEB, "PLEB") diff --git a/trunk/arch/arm/mm/fault-armv.c b/trunk/arch/arm/mm/fault-armv.c index a8ec97b4752e..fbfa26058442 100644 --- a/trunk/arch/arm/mm/fault-armv.c +++ b/trunk/arch/arm/mm/fault-armv.c @@ -37,7 +37,7 @@ static int adjust_pte(struct vm_area_struct *vma, unsigned long address) pgd_t *pgd; pmd_t *pmd; pte_t *pte, entry; - int ret; + int ret = 0; pgd = pgd_offset(vma->vm_mm, address); if (pgd_none(*pgd)) @@ -54,20 +54,16 @@ static int adjust_pte(struct vm_area_struct *vma, unsigned long address) pte = pte_offset_map(pmd, address); entry = *pte; - /* - * If this page is present, it's actually being shared. - */ - ret = pte_present(entry); - /* * If this page isn't present, or is already setup to * fault (ie, is old), we can safely ignore any issues. */ - if (ret && pte_val(entry) & shared_pte_mask) { + if (pte_present(entry) && pte_val(entry) & shared_pte_mask) { flush_cache_page(vma, address, pte_pfn(entry)); pte_val(entry) &= ~shared_pte_mask; set_pte_at(vma->vm_mm, address, pte, entry); flush_tlb_page(vma, address); + ret = 1; } pte_unmap(pte); return ret; diff --git a/trunk/arch/arm/plat-mxc/gpio.c b/trunk/arch/arm/plat-mxc/gpio.c index 318b268f938e..4a7736717d86 100644 --- a/trunk/arch/arm/plat-mxc/gpio.c +++ b/trunk/arch/arm/plat-mxc/gpio.c @@ -73,19 +73,19 @@ static int gpio_set_irq_type(u32 irq, u32 type) void __iomem *reg = port->base; switch (type) { - case IRQ_TYPE_EDGE_RISING: + case IRQT_RISING: edge = GPIO_INT_RISE_EDGE; break; - case IRQ_TYPE_EDGE_FALLING: + case IRQT_FALLING: edge = GPIO_INT_FALL_EDGE; break; - case IRQ_TYPE_LEVEL_LOW: + case IRQT_LOW: edge = GPIO_INT_LOW_LEV; break; - case IRQ_TYPE_LEVEL_HIGH: + case IRQT_HIGH: edge = GPIO_INT_HIGH_LEV; break; - default: /* this includes IRQ_TYPE_EDGE_BOTH */ + default: /* this includes IRQT_BOTHEDGE */ return -EINVAL; } diff --git a/trunk/arch/arm/plat-omap/gpio.c b/trunk/arch/arm/plat-omap/gpio.c index 63e094342ef6..d8e9c2c3f0f6 100644 --- a/trunk/arch/arm/plat-omap/gpio.c +++ b/trunk/arch/arm/plat-omap/gpio.c @@ -517,13 +517,13 @@ static inline void set_24xx_gpio_triggering(struct gpio_bank *bank, int gpio, u32 gpio_bit = 1 << gpio; MOD_REG_BIT(OMAP24XX_GPIO_LEVELDETECT0, gpio_bit, - trigger & IRQ_TYPE_LEVEL_LOW); + trigger & __IRQT_LOWLVL); MOD_REG_BIT(OMAP24XX_GPIO_LEVELDETECT1, gpio_bit, - trigger & IRQ_TYPE_LEVEL_HIGH); + trigger & __IRQT_HIGHLVL); MOD_REG_BIT(OMAP24XX_GPIO_RISINGDETECT, gpio_bit, - trigger & IRQ_TYPE_EDGE_RISING); + trigger & __IRQT_RISEDGE); MOD_REG_BIT(OMAP24XX_GPIO_FALLINGDETECT, gpio_bit, - trigger & IRQ_TYPE_EDGE_FALLING); + trigger & __IRQT_FALEDGE); if (likely(!(bank->non_wakeup_gpios & gpio_bit))) { if (trigger != 0) @@ -555,9 +555,9 @@ static int _set_gpio_triggering(struct gpio_bank *bank, int gpio, int trigger) case METHOD_MPUIO: reg += OMAP_MPUIO_GPIO_INT_EDGE; l = __raw_readl(reg); - if (trigger & IRQ_TYPE_EDGE_RISING) + if (trigger & __IRQT_RISEDGE) l |= 1 << gpio; - else if (trigger & IRQ_TYPE_EDGE_FALLING) + else if (trigger & __IRQT_FALEDGE) l &= ~(1 << gpio); else goto bad; @@ -567,9 +567,9 @@ static int _set_gpio_triggering(struct gpio_bank *bank, int gpio, int trigger) case METHOD_GPIO_1510: reg += OMAP1510_GPIO_INT_CONTROL; l = __raw_readl(reg); - if (trigger & IRQ_TYPE_EDGE_RISING) + if (trigger & __IRQT_RISEDGE) l |= 1 << gpio; - else if (trigger & IRQ_TYPE_EDGE_FALLING) + else if (trigger & __IRQT_FALEDGE) l &= ~(1 << gpio); else goto bad; @@ -584,9 +584,9 @@ static int _set_gpio_triggering(struct gpio_bank *bank, int gpio, int trigger) gpio &= 0x07; l = __raw_readl(reg); l &= ~(3 << (gpio << 1)); - if (trigger & IRQ_TYPE_EDGE_RISING) + if (trigger & __IRQT_RISEDGE) l |= 2 << (gpio << 1); - if (trigger & IRQ_TYPE_EDGE_FALLING) + if (trigger & __IRQT_FALEDGE) l |= 1 << (gpio << 1); if (trigger) /* Enable wake-up during idle for dynamic tick */ @@ -599,9 +599,9 @@ static int _set_gpio_triggering(struct gpio_bank *bank, int gpio, int trigger) case METHOD_GPIO_730: reg += OMAP730_GPIO_INT_CONTROL; l = __raw_readl(reg); - if (trigger & IRQ_TYPE_EDGE_RISING) + if (trigger & __IRQT_RISEDGE) l |= 1 << gpio; - else if (trigger & IRQ_TYPE_EDGE_FALLING) + else if (trigger & __IRQT_FALEDGE) l &= ~(1 << gpio); else goto bad; @@ -887,7 +887,7 @@ static void _reset_gpio(struct gpio_bank *bank, int gpio) _set_gpio_direction(bank, get_gpio_index(gpio), 1); _set_gpio_irqenable(bank, gpio, 0); _clear_gpio_irqstatus(bank, gpio); - _set_gpio_triggering(bank, get_gpio_index(gpio), IRQ_TYPE_NONE); + _set_gpio_triggering(bank, get_gpio_index(gpio), IRQT_NOEDGE); } /* Use disable_irq_wake() and enable_irq_wake() functions from drivers */ @@ -924,7 +924,7 @@ int omap_request_gpio(int gpio) /* Set trigger to none. You need to enable the desired trigger with * request_irq() or set_irq_type(). */ - _set_gpio_triggering(bank, get_gpio_index(gpio), IRQ_TYPE_NONE); + _set_gpio_triggering(bank, get_gpio_index(gpio), IRQT_NOEDGE); #ifdef CONFIG_ARCH_OMAP15XX if (bank->method == METHOD_GPIO_1510) { diff --git a/trunk/arch/arm/plat-s3c24xx/Kconfig b/trunk/arch/arm/plat-s3c24xx/Kconfig index 0af3872fb763..5e28c217b8c2 100644 --- a/trunk/arch/arm/plat-s3c24xx/Kconfig +++ b/trunk/arch/arm/plat-s3c24xx/Kconfig @@ -9,7 +9,7 @@ config PLAT_S3C24XX depends on ARCH_S3C2410 default y if ARCH_S3C2410 select NO_IOPORT - select ARCH_REQUIRE_GPIOLIB + select HAVE_GPIO_LIB help Base platform code for any Samsung S3C24XX device diff --git a/trunk/arch/arm/plat-s3c24xx/irq.c b/trunk/arch/arm/plat-s3c24xx/irq.c index 001436c04b13..ae2c5d7efc9d 100644 --- a/trunk/arch/arm/plat-s3c24xx/irq.c +++ b/trunk/arch/arm/plat-s3c24xx/irq.c @@ -292,27 +292,27 @@ s3c_irqext_type(unsigned int irq, unsigned int type) /* Set the external interrupt to pointed trigger type */ switch (type) { - case IRQ_TYPE_NONE: + case IRQT_NOEDGE: printk(KERN_WARNING "No edge setting!\n"); break; - case IRQ_TYPE_EDGE_RISING: + case IRQT_RISING: newvalue = S3C2410_EXTINT_RISEEDGE; break; - case IRQ_TYPE_EDGE_FALLING: + case IRQT_FALLING: newvalue = S3C2410_EXTINT_FALLEDGE; break; - case IRQ_TYPE_EDGE_BOTH: + case IRQT_BOTHEDGE: newvalue = S3C2410_EXTINT_BOTHEDGE; break; - case IRQ_TYPE_LEVEL_LOW: + case IRQT_LOW: newvalue = S3C2410_EXTINT_LOWLEV; break; - case IRQ_TYPE_LEVEL_HIGH: + case IRQT_HIGH: newvalue = S3C2410_EXTINT_HILEV; break; diff --git a/trunk/arch/sparc/Kconfig b/trunk/arch/sparc/Kconfig index a214002114ed..375de7c6d082 100644 --- a/trunk/arch/sparc/Kconfig +++ b/trunk/arch/sparc/Kconfig @@ -68,7 +68,6 @@ config SPARC select HAVE_IDE select HAVE_OPROFILE select HAVE_ARCH_KGDB if !SMP - select HAVE_ARCH_TRACEHOOK # Identify this as a Sparc32 build config SPARC32 diff --git a/trunk/arch/sparc/include/asm/Kbuild b/trunk/arch/sparc/include/asm/Kbuild deleted file mode 100644 index a5f0ce734ff7..000000000000 --- a/trunk/arch/sparc/include/asm/Kbuild +++ /dev/null @@ -1,45 +0,0 @@ -# User exported sparc header files -include include/asm-generic/Kbuild.asm - -header-y += ipcbuf_32.h -header-y += ipcbuf_64.h -header-y += posix_types_32.h -header-y += posix_types_64.h -header-y += ptrace_32.h -header-y += ptrace_64.h -header-y += sigcontext_32.h -header-y += sigcontext_64.h -header-y += siginfo_32.h -header-y += siginfo_64.h -header-y += signal_32.h -header-y += signal_64.h -header-y += stat_32.h -header-y += stat_64.h -header-y += statfs_32.h -header-y += statfs_64.h -header-y += unistd_32.h -header-y += unistd_64.h - -header-y += apc.h -header-y += asi.h -header-y += bpp.h -header-y += display7seg.h -header-y += envctrl.h -header-y += fbio.h -header-y += jsflash.h -header-y += openprom.h -header-y += openprom_32.h -header-y += openprom_64.h -header-y += openpromio.h -header-y += perfctr.h -header-y += psrcompat.h -header-y += psr.h -header-y += pstate.h -header-y += reg.h -header-y += reg_32.h -header-y += reg_64.h -header-y += traps.h -header-y += uctx.h -header-y += utrap.h -header-y += vfc_ioctls.h -header-y += watchdog.h diff --git a/trunk/arch/sparc/include/asm/syscall.h b/trunk/arch/sparc/include/asm/syscall.h deleted file mode 100644 index 7486c605e23c..000000000000 --- a/trunk/arch/sparc/include/asm/syscall.h +++ /dev/null @@ -1,120 +0,0 @@ -#ifndef __ASM_SPARC_SYSCALL_H -#define __ASM_SPARC_SYSCALL_H - -#include -#include -#include - -/* The system call number is given by the user in %g1 */ -static inline long syscall_get_nr(struct task_struct *task, - struct pt_regs *regs) -{ - int syscall_p = pt_regs_is_syscall(regs); - - return (syscall_p ? regs->u_regs[UREG_G1] : -1L); -} - -static inline void syscall_rollback(struct task_struct *task, - struct pt_regs *regs) -{ - /* XXX This needs some thought. On Sparc we don't - * XXX save away the original %o0 value somewhere. - * XXX Instead we hold it in register %l5 at the top - * XXX level trap frame and pass this down to the signal - * XXX dispatch code which is the only place that value - * XXX ever was needed. - */ -} - -#ifdef CONFIG_SPARC32 -static inline bool syscall_has_error(struct pt_regs *regs) -{ - return (regs->psr & PSR_C) ? true : false; -} -static inline void syscall_set_error(struct pt_regs *regs) -{ - regs->psr |= PSR_C; -} -static inline void syscall_clear_error(struct pt_regs *regs) -{ - regs->psr &= ~PSR_C; -} -#else -static inline bool syscall_has_error(struct pt_regs *regs) -{ - return (regs->tstate & (TSTATE_XCARRY | TSTATE_ICARRY)) ? true : false; -} -static inline void syscall_set_error(struct pt_regs *regs) -{ - regs->tstate |= (TSTATE_XCARRY | TSTATE_ICARRY); -} -static inline void syscall_clear_error(struct pt_regs *regs) -{ - regs->tstate &= ~(TSTATE_XCARRY | TSTATE_ICARRY); -} -#endif - -static inline long syscall_get_error(struct task_struct *task, - struct pt_regs *regs) -{ - long val = regs->u_regs[UREG_I0]; - - return (syscall_has_error(regs) ? -val : 0); -} - -static inline long syscall_get_return_value(struct task_struct *task, - struct pt_regs *regs) -{ - long val = regs->u_regs[UREG_I0]; - - return val; -} - -static inline void syscall_set_return_value(struct task_struct *task, - struct pt_regs *regs, - int error, long val) -{ - if (error) { - syscall_set_error(regs); - regs->u_regs[UREG_I0] = -error; - } else { - syscall_clear_error(regs); - regs->u_regs[UREG_I0] = val; - } -} - -static inline void syscall_get_arguments(struct task_struct *task, - struct pt_regs *regs, - unsigned int i, unsigned int n, - unsigned long *args) -{ - int zero_extend = 0; - unsigned int j; - -#ifdef CONFIG_SPARC64 - if (test_tsk_thread_flag(task, TIF_32BIT)) - zero_extend = 1; -#endif - - for (j = 0; j < n; j++) { - unsigned long val = regs->u_regs[UREG_I0 + i + j]; - - if (zero_extend) - args[j] = (u32) val; - else - args[j] = val; - } -} - -static inline void syscall_set_arguments(struct task_struct *task, - struct pt_regs *regs, - unsigned int i, unsigned int n, - const unsigned long *args) -{ - unsigned int j; - - for (j = 0; j < n; j++) - regs->u_regs[UREG_I0 + i + j] = args[j]; -} - -#endif /* __ASM_SPARC_SYSCALL_H */ diff --git a/trunk/arch/sparc/kernel/entry.S b/trunk/arch/sparc/kernel/entry.S index e8cdf715a546..2f96256dc515 100644 --- a/trunk/arch/sparc/kernel/entry.S +++ b/trunk/arch/sparc/kernel/entry.S @@ -1196,9 +1196,8 @@ sys_rt_sigreturn: be 1f nop - add %sp, STACKFRAME_SZ, %o0 call syscall_trace - mov 1, %o1 + nop 1: /* We are returning to a signal handler. */ @@ -1288,12 +1287,8 @@ linux_fast_syscall: mov %i3, %o3 linux_syscall_trace: - add %sp, STACKFRAME_SZ, %o0 call syscall_trace - mov 0, %o1 - cmp %o0, 0 - bne 3f - mov -ENOSYS, %o0 + nop mov %i0, %o0 mov %i1, %o1 mov %i2, %o2 @@ -1342,7 +1337,6 @@ syscall_is_too_hard: call %l7 mov %i5, %o5 -3: st %o0, [%sp + STACKFRAME_SZ + PT_I0] ret_sys_call: @@ -1380,8 +1374,6 @@ ret_sys_call: st %l2, [%sp + STACKFRAME_SZ + PT_NPC] linux_syscall_trace2: - add %sp, STACKFRAME_SZ, %o0 - mov 1, %o1 call syscall_trace add %l1, 0x4, %l2 /* npc = npc+4 */ st %l1, [%sp + STACKFRAME_SZ + PT_PC] diff --git a/trunk/arch/sparc/kernel/ptrace.c b/trunk/arch/sparc/kernel/ptrace.c index 20699c701412..81f3b929743f 100644 --- a/trunk/arch/sparc/kernel/ptrace.c +++ b/trunk/arch/sparc/kernel/ptrace.c @@ -21,7 +21,6 @@ #include #include #include -#include #include #include @@ -451,16 +450,21 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) return ret; } -asmlinkage int syscall_trace(struct pt_regs *regs, int syscall_exit_p) +asmlinkage void syscall_trace(void) { - int ret = 0; - - if (test_thread_flag(TIF_SYSCALL_TRACE)) { - if (syscall_exit_p) - tracehook_report_syscall_exit(regs, 0); - else - ret = tracehook_report_syscall_entry(regs); + if (!test_thread_flag(TIF_SYSCALL_TRACE)) + return; + if (!(current->ptrace & PT_PTRACED)) + return; + ptrace_notify(SIGTRAP | ((current->ptrace & PT_TRACESYSGOOD) + ? 0x80 : 0)); + /* + * this isn't the same as continuing with a signal, but it will do + * for normal use. strace only continues with a signal if the + * stopping signal is not SIGTRAP. -brl + */ + if (current->exit_code) { + send_sig (current->exit_code, current, 1); + current->exit_code = 0; } - - return ret; } diff --git a/trunk/arch/sparc/kernel/rtrap.S b/trunk/arch/sparc/kernel/rtrap.S index 4da2e1f66290..891f460b7b96 100644 --- a/trunk/arch/sparc/kernel/rtrap.S +++ b/trunk/arch/sparc/kernel/rtrap.S @@ -69,13 +69,12 @@ ret_trap_lockless_ipi: ld [%curptr + TI_FLAGS], %g2 signal_p: - andcc %g2, _TIF_DO_NOTIFY_RESUME_MASK, %g0 + andcc %g2, (_TIF_SIGPENDING|_TIF_RESTORE_SIGMASK), %g0 bz,a ret_trap_continue ld [%sp + STACKFRAME_SZ + PT_PSR], %t_psr - mov %g2, %o2 mov %l5, %o1 - call do_notify_resume + call do_signal add %sp, STACKFRAME_SZ, %o0 ! pt_regs ptr /* Fall through. */ diff --git a/trunk/arch/sparc/kernel/signal.c b/trunk/arch/sparc/kernel/signal.c index c94f91c8b6e0..3fd1df9f9ba7 100644 --- a/trunk/arch/sparc/kernel/signal.c +++ b/trunk/arch/sparc/kernel/signal.c @@ -18,7 +18,6 @@ #include #include /* do_coredum */ #include -#include #include #include @@ -514,7 +513,7 @@ static inline void syscall_restart(unsigned long orig_i0, struct pt_regs *regs, * want to handle. Thus you cannot kill init even with a SIGKILL even by * mistake. */ -static void do_signal(struct pt_regs *regs, unsigned long orig_i0) +asmlinkage void do_signal(struct pt_regs * regs, unsigned long orig_i0) { struct k_sigaction ka; int restart_syscall; @@ -553,8 +552,6 @@ static void do_signal(struct pt_regs *regs, unsigned long orig_i0) */ if (test_thread_flag(TIF_RESTORE_SIGMASK)) clear_thread_flag(TIF_RESTORE_SIGMASK); - - tracehook_signal_handler(signr, &info, &ka, regs, 0); return; } if (restart_syscall && @@ -582,17 +579,6 @@ static void do_signal(struct pt_regs *regs, unsigned long orig_i0) } } -void do_notify_resume(struct pt_regs *regs, unsigned long orig_i0, - unsigned long thread_info_flags) -{ - if (thread_info_flags & (_TIF_SIGPENDING | _TIF_RESTORE_SIGMASK)) - do_signal(regs, orig_i0); - if (thread_info_flags & _TIF_NOTIFY_RESUME) { - clear_thread_flag(TIF_NOTIFY_RESUME); - tracehook_notify_resume(regs); - } -} - asmlinkage int do_sys_sigstack(struct sigstack __user *ssptr, struct sigstack __user *ossptr, unsigned long sp) diff --git a/trunk/arch/sparc64/Kconfig b/trunk/arch/sparc64/Kconfig index 923a98959fa7..7c88263256af 100644 --- a/trunk/arch/sparc64/Kconfig +++ b/trunk/arch/sparc64/Kconfig @@ -17,7 +17,6 @@ config SPARC64 select HAVE_LMB select HAVE_ARCH_KGDB select USE_GENERIC_SMP_HELPERS if SMP - select HAVE_ARCH_TRACEHOOK config GENERIC_TIME bool diff --git a/trunk/arch/sparc64/kernel/compat_audit.c b/trunk/arch/sparc64/kernel/compat_audit.c index c831b0a4e660..c1979482aa92 100644 --- a/trunk/arch/sparc64/kernel/compat_audit.c +++ b/trunk/arch/sparc64/kernel/compat_audit.c @@ -1,4 +1,4 @@ -#include +#include unsigned sparc32_dir_class[] = { #include diff --git a/trunk/arch/sparc64/kernel/entry.h b/trunk/arch/sparc64/kernel/entry.h index fc294a292899..32fbab620852 100644 --- a/trunk/arch/sparc64/kernel/entry.h +++ b/trunk/arch/sparc64/kernel/entry.h @@ -22,7 +22,8 @@ extern void do_notify_resume(struct pt_regs *regs, unsigned long orig_i0, unsigned long thread_info_flags); -extern asmlinkage int syscall_trace(struct pt_regs *regs, int syscall_exit_p); +extern asmlinkage void syscall_trace(struct pt_regs *regs, + int syscall_exit_p); extern void bad_trap_tl1(struct pt_regs *regs, long lvl); diff --git a/trunk/arch/sparc64/kernel/ptrace.c b/trunk/arch/sparc64/kernel/ptrace.c index bd578cc4856d..f6c9fc92921d 100644 --- a/trunk/arch/sparc64/kernel/ptrace.c +++ b/trunk/arch/sparc64/kernel/ptrace.c @@ -23,7 +23,6 @@ #include #include #include -#include #include #include @@ -1050,10 +1049,8 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) return ret; } -asmlinkage int syscall_trace(struct pt_regs *regs, int syscall_exit_p) +asmlinkage void syscall_trace(struct pt_regs *regs, int syscall_exit_p) { - int ret = 0; - /* do the secure computing check first */ secure_computing(regs->u_regs[UREG_G1]); @@ -1067,14 +1064,27 @@ asmlinkage int syscall_trace(struct pt_regs *regs, int syscall_exit_p) audit_syscall_exit(result, regs->u_regs[UREG_I0]); } - if (test_thread_flag(TIF_SYSCALL_TRACE)) { - if (syscall_exit_p) - tracehook_report_syscall_exit(regs, 0); - else - ret = tracehook_report_syscall_entry(regs); + if (!(current->ptrace & PT_PTRACED)) + goto out; + + if (!test_thread_flag(TIF_SYSCALL_TRACE)) + goto out; + + ptrace_notify(SIGTRAP | ((current->ptrace & PT_TRACESYSGOOD) + ? 0x80 : 0)); + + /* + * this isn't the same as continuing with a signal, but it will do + * for normal use. strace only continues with a signal if the + * stopping signal is not SIGTRAP. -brl + */ + if (current->exit_code) { + send_sig(current->exit_code, current, 1); + current->exit_code = 0; } - if (unlikely(current->audit_context) && !syscall_exit_p && !ret) +out: + if (unlikely(current->audit_context) && !syscall_exit_p) audit_syscall_entry((test_thread_flag(TIF_32BIT) ? AUDIT_ARCH_SPARC : AUDIT_ARCH_SPARC64), @@ -1083,6 +1093,4 @@ asmlinkage int syscall_trace(struct pt_regs *regs, int syscall_exit_p) regs->u_regs[UREG_I1], regs->u_regs[UREG_I2], regs->u_regs[UREG_I3]); - - return ret; } diff --git a/trunk/arch/sparc64/kernel/rtrap.S b/trunk/arch/sparc64/kernel/rtrap.S index 97a993c1f7f3..c6fc695fe1fe 100644 --- a/trunk/arch/sparc64/kernel/rtrap.S +++ b/trunk/arch/sparc64/kernel/rtrap.S @@ -46,7 +46,7 @@ __handle_user_windows: wrpr %g0, RTRAP_PSTATE_IRQOFF, %pstate ldx [%g6 + TI_FLAGS], %l0 -1: andcc %l0, _TIF_DO_NOTIFY_RESUME_MASK, %g0 +1: andcc %l0, _TIF_SIGPENDING, %g0 be,pt %xcc, __handle_user_windows_continue nop mov %l5, %o1 @@ -86,7 +86,7 @@ __handle_perfctrs: wrpr %g0, RTRAP_PSTATE, %pstate wrpr %g0, RTRAP_PSTATE_IRQOFF, %pstate ldx [%g6 + TI_FLAGS], %l0 -1: andcc %l0, _TIF_DO_NOTIFY_RESUME_MASK, %g0 +1: andcc %l0, _TIF_SIGPENDING, %g0 be,pt %xcc, __handle_perfctrs_continue sethi %hi(TSTATE_PEF), %o0 @@ -195,7 +195,7 @@ __handle_preemption_continue: andcc %l1, %o0, %g0 andcc %l0, _TIF_NEED_RESCHED, %g0 bne,pn %xcc, __handle_preemption - andcc %l0, _TIF_DO_NOTIFY_RESUME_MASK, %g0 + andcc %l0, _TIF_SIGPENDING, %g0 bne,pn %xcc, __handle_signal __handle_signal_continue: ldub [%g6 + TI_WSAVED], %o2 diff --git a/trunk/arch/sparc64/kernel/signal.c b/trunk/arch/sparc64/kernel/signal.c index d1b84456a9ee..9667e96fd513 100644 --- a/trunk/arch/sparc64/kernel/signal.c +++ b/trunk/arch/sparc64/kernel/signal.c @@ -17,13 +17,11 @@ #include #include #include -#include #include #include #include #include #include -#include #include #include @@ -576,8 +574,6 @@ static void do_signal(struct pt_regs *regs, unsigned long orig_i0) * clear the TS_RESTORE_SIGMASK flag. */ current_thread_info()->status &= ~TS_RESTORE_SIGMASK; - - tracehook_signal_handler(signr, &info, &ka, regs, 0); return; } if (restart_syscall && @@ -609,8 +605,4 @@ void do_notify_resume(struct pt_regs *regs, unsigned long orig_i0, unsigned long { if (thread_info_flags & _TIF_SIGPENDING) do_signal(regs, orig_i0); - if (thread_info_flags & _TIF_NOTIFY_RESUME) { - clear_thread_flag(TIF_NOTIFY_RESUME); - tracehook_notify_resume(regs); - } } diff --git a/trunk/arch/sparc64/kernel/signal32.c b/trunk/arch/sparc64/kernel/signal32.c index ba5b09ad6666..97cdd1bf4a10 100644 --- a/trunk/arch/sparc64/kernel/signal32.c +++ b/trunk/arch/sparc64/kernel/signal32.c @@ -19,7 +19,6 @@ #include #include #include -#include #include #include @@ -795,8 +794,6 @@ void do_signal32(sigset_t *oldset, struct pt_regs * regs, * clear the TS_RESTORE_SIGMASK flag. */ current_thread_info()->status &= ~TS_RESTORE_SIGMASK; - - tracehook_signal_handler(signr, &info, &ka, regs, 0); return; } if (restart_syscall && diff --git a/trunk/arch/sparc64/kernel/syscalls.S b/trunk/arch/sparc64/kernel/syscalls.S index a2f24270ed8a..db19ed67acf6 100644 --- a/trunk/arch/sparc64/kernel/syscalls.S +++ b/trunk/arch/sparc64/kernel/syscalls.S @@ -162,8 +162,6 @@ linux_syscall_trace32: add %sp, PTREGS_OFF, %o0 call syscall_trace clr %o1 - brnz,pn %o0, 3f - mov -ENOSYS, %o0 srl %i0, 0, %o0 srl %i4, 0, %o4 srl %i1, 0, %o1 @@ -175,8 +173,6 @@ linux_syscall_trace: add %sp, PTREGS_OFF, %o0 call syscall_trace clr %o1 - brnz,pn %o0, 3f - mov -ENOSYS, %o0 mov %i0, %o0 mov %i1, %o1 mov %i2, %o2 diff --git a/trunk/arch/x86/kernel/head_32.S b/trunk/arch/x86/kernel/head_32.S index a7010c3a377a..f67e93441caf 100644 --- a/trunk/arch/x86/kernel/head_32.S +++ b/trunk/arch/x86/kernel/head_32.S @@ -456,6 +456,9 @@ is386: movl $2,%ecx # set MP 1: #endif /* CONFIG_SMP */ jmp *(initial_code) +.align 4 +ENTRY(initial_code) + .long i386_start_kernel /* * We depend on ET to be correct. This checks for 287/387. @@ -598,11 +601,6 @@ ignore_int: #endif iret -.section .cpuinit.data,"wa" -.align 4 -ENTRY(initial_code) - .long i386_start_kernel - .section .text /* * Real beginning of normal "text" segment diff --git a/trunk/drivers/acpi/processor_idle.c b/trunk/drivers/acpi/processor_idle.c index 283c08f5f4d4..b7f2963693a7 100644 --- a/trunk/drivers/acpi/processor_idle.c +++ b/trunk/drivers/acpi/processor_idle.c @@ -1332,15 +1332,9 @@ int acpi_processor_cst_has_changed(struct acpi_processor *pr) if (!pr->flags.power_setup_done) return -ENODEV; - /* - * Fall back to the default idle loop, when pm_idle_save had - * been initialized. - */ - if (pm_idle_save) { - pm_idle = pm_idle_save; - /* Relies on interrupts forcing exit from idle. */ - synchronize_sched(); - } + /* Fall back to the default idle loop */ + pm_idle = pm_idle_save; + synchronize_sched(); /* Relies on interrupts forcing exit from idle. */ pr->flags.power = 0; result = acpi_processor_get_power_info(pr); @@ -1902,8 +1896,7 @@ int acpi_processor_power_exit(struct acpi_processor *pr, /* Unregister the idle handler when processor #0 is removed. */ if (pr->id == 0) { - if (pm_idle_save) - pm_idle = pm_idle_save; + pm_idle = pm_idle_save; /* * We are about to unload the current idle thread pm callback diff --git a/trunk/drivers/ata/pata_ixp4xx_cf.c b/trunk/drivers/ata/pata_ixp4xx_cf.c index 2014253f6c88..de8d186f5abf 100644 --- a/trunk/drivers/ata/pata_ixp4xx_cf.c +++ b/trunk/drivers/ata/pata_ixp4xx_cf.c @@ -169,7 +169,7 @@ static __devinit int ixp4xx_pata_probe(struct platform_device *pdev) irq = platform_get_irq(pdev, 0); if (irq) - set_irq_type(irq, IRQ_TYPE_EDGE_RISING); + set_irq_type(irq, IRQT_RISING); /* Setup expansion bus chip selects */ *data->cs0_cfg = data->cs0_bits; diff --git a/trunk/drivers/base/memory.c b/trunk/drivers/base/memory.c index af0d175c025d..3ad49a00029f 100644 --- a/trunk/drivers/base/memory.c +++ b/trunk/drivers/base/memory.c @@ -103,8 +103,7 @@ static ssize_t show_mem_phys_index(struct sys_device *dev, /* * Show whether the section of memory is likely to be hot-removable */ -static ssize_t show_mem_removable(struct sys_device *dev, - struct sysdev_attribute *attr, char *buf) +static ssize_t show_mem_removable(struct sys_device *dev, char *buf) { unsigned long start_pfn; int ret; diff --git a/trunk/drivers/char/nwflash.c b/trunk/drivers/char/nwflash.c index 006be92ee3f3..f9f72a211292 100644 --- a/trunk/drivers/char/nwflash.c +++ b/trunk/drivers/char/nwflash.c @@ -125,15 +125,15 @@ static ssize_t flash_read(struct file *file, char __user *buf, size_t size, ssize_t ret; if (flashdebug) - printk(KERN_DEBUG "flash_read: flash_read: offset=0x%llx, " - "buffer=%p, count=0x%zx.\n", *ppos, buf, size); + printk(KERN_DEBUG "flash_read: flash_read: offset=0x%lX, " + "buffer=%p, count=0x%X.\n", p, buf, count); /* * We now lock against reads and writes. --rmk */ if (mutex_lock_interruptible(&nwflash_mutex)) return -ERESTARTSYS; - ret = simple_read_from_buffer(buf, size, ppos, (void *)FLASH_BASE, gbFlashSize); + ret = simple_read_from_buffer(buf, size, ppos, FLASH_BASE, gbFlashSize); mutex_unlock(&nwflash_mutex); return ret; diff --git a/trunk/drivers/char/pcmcia/ipwireless/hardware.c b/trunk/drivers/char/pcmcia/ipwireless/hardware.c index 7d500f82195a..929101ecbae2 100644 --- a/trunk/drivers/char/pcmcia/ipwireless/hardware.c +++ b/trunk/drivers/char/pcmcia/ipwireless/hardware.c @@ -30,11 +30,11 @@ static void ipw_send_setup_packet(struct ipw_hardware *hw); static void handle_received_SETUP_packet(struct ipw_hardware *ipw, unsigned int address, - const unsigned char *data, int len, + unsigned char *data, int len, int is_last); static void ipwireless_setup_timer(unsigned long data); static void handle_received_CTRL_packet(struct ipw_hardware *hw, - unsigned int channel_idx, const unsigned char *data, int len); + unsigned int channel_idx, unsigned char *data, int len); /*#define TIMING_DIAGNOSTICS*/ @@ -79,7 +79,8 @@ static void report_timing(void) timing_stats.last_report_time = jiffies; if (!first) printk(KERN_INFO IPWIRELESS_PCCARD_NAME - ": %u us elapsed - read %lu bytes in %u us, wrote %lu bytes in %u us\n", + ": %u us elapsed - read %lu bytes in %u us, " + "wrote %lu bytes in %u us\n", jiffies_to_usecs(since), timing_stats.read_bytes, jiffies_to_usecs(timing_stats.read_time), @@ -132,17 +133,29 @@ enum { #define NL_FOLLOWING_PACKET_HEADER_SIZE 1 struct nl_first_packet_header { +#if defined(__BIG_ENDIAN_BITFIELD) + unsigned char packet_rank:2; + unsigned char address:3; + unsigned char protocol:3; +#else unsigned char protocol:3; unsigned char address:3; unsigned char packet_rank:2; +#endif unsigned char length_lsb; unsigned char length_msb; }; struct nl_packet_header { +#if defined(__BIG_ENDIAN_BITFIELD) + unsigned char packet_rank:2; + unsigned char address:3; + unsigned char protocol:3; +#else unsigned char protocol:3; unsigned char address:3; unsigned char packet_rank:2; +#endif }; /* Value of 'packet_rank' above */ @@ -214,12 +227,15 @@ struct MEMINFREG { unsigned short memreg_tx_new; /* TX2 (new) Register (R/W) */ }; +#define IODMADPR 0x00 /* DMA Data Port Register (R/W) */ + #define CARD_PRESENT_VALUE (0xBEEFCAFEUL) #define MEMTX_TX 0x0001 #define MEMRX_RX 0x0001 #define MEMRX_RX_DONE 0x0001 #define MEMRX_PCINTACKK 0x0001 +#define MEMRX_MEMSPURIOUSINT 0x0001 #define NL_NUM_OF_PRIORITIES 3 #define NL_NUM_OF_PROTOCOLS 3 @@ -229,7 +245,7 @@ struct ipw_hardware { unsigned int base_port; short hw_version; unsigned short ll_mtu; - spinlock_t lock; + spinlock_t spinlock; int initializing; int init_loops; @@ -370,52 +386,26 @@ static void dump_data_bytes(const char *type, const unsigned char *data, length < DUMP_MAX_BYTES ? length : DUMP_MAX_BYTES); } -static void swap_packet_bitfield_to_le(unsigned char *data) -{ -#ifdef __BIG_ENDIAN_BITFIELD - unsigned char tmp = *data, ret = 0; - - /* - * transform bits from aa.bbb.ccc to ccc.bbb.aa - */ - ret |= tmp & 0xc0 >> 6; - ret |= tmp & 0x38 >> 1; - ret |= tmp & 0x07 << 5; - *data = ret & 0xff; -#endif -} - -static void swap_packet_bitfield_from_le(unsigned char *data) -{ -#ifdef __BIG_ENDIAN_BITFIELD - unsigned char tmp = *data, ret = 0; - - /* - * transform bits from ccc.bbb.aa to aa.bbb.ccc - */ - ret |= tmp & 0xe0 >> 5; - ret |= tmp & 0x1c << 1; - ret |= tmp & 0x03 << 6; - *data = ret & 0xff; -#endif -} - -static void do_send_fragment(struct ipw_hardware *hw, unsigned char *data, +static int do_send_fragment(struct ipw_hardware *hw, const unsigned char *data, unsigned length) { - unsigned i; + int i; unsigned long flags; start_timing(); - BUG_ON(length > hw->ll_mtu); + + if (length == 0) + return 0; + + if (length > hw->ll_mtu) + return -1; if (ipwireless_debug) dump_data_bytes("send", data, length); - spin_lock_irqsave(&hw->lock, flags); + spin_lock_irqsave(&hw->spinlock, flags); hw->tx_ready = 0; - swap_packet_bitfield_to_le(data); if (hw->hw_version == HW_VERSION_1) { outw((unsigned short) length, hw->base_port + IODWR); @@ -424,7 +414,7 @@ static void do_send_fragment(struct ipw_hardware *hw, unsigned char *data, unsigned short d = data[i]; __le16 raw_data; - if (i + 1 < length) + if (likely(i + 1 < length)) d |= data[i + 1] << 8; raw_data = cpu_to_le16(d); outw(raw_data, hw->base_port + IODWR); @@ -432,30 +422,32 @@ static void do_send_fragment(struct ipw_hardware *hw, unsigned char *data, outw(DCR_TXDONE, hw->base_port + IODCR); } else if (hw->hw_version == HW_VERSION_2) { - outw((unsigned short) length, hw->base_port); + outw((unsigned short) length, hw->base_port + IODMADPR); for (i = 0; i < length; i += 2) { unsigned short d = data[i]; __le16 raw_data; - if (i + 1 < length) + if ((i + 1 < length)) d |= data[i + 1] << 8; raw_data = cpu_to_le16(d); - outw(raw_data, hw->base_port); + outw(raw_data, hw->base_port + IODMADPR); } while ((i & 3) != 2) { - outw((unsigned short) 0xDEAD, hw->base_port); + outw((unsigned short) 0xDEAD, hw->base_port + IODMADPR); i += 2; } writew(MEMRX_RX, &hw->memory_info_regs->memreg_rx); } - spin_unlock_irqrestore(&hw->lock, flags); + spin_unlock_irqrestore(&hw->spinlock, flags); end_write_timing(length); + + return 0; } -static void do_send_packet(struct ipw_hardware *hw, struct ipw_tx_packet *packet) +static int do_send_packet(struct ipw_hardware *hw, struct ipw_tx_packet *packet) { unsigned short fragment_data_len; unsigned short data_left = packet->length - packet->offset; @@ -470,10 +462,6 @@ static void do_send_packet(struct ipw_hardware *hw, struct ipw_tx_packet *packet if (data_left < fragment_data_len) fragment_data_len = data_left; - /* - * hdr_first is now in machine bitfield order, which will be swapped - * to le just before it goes to hw - */ pkt.hdr_first.protocol = packet->protocol; pkt.hdr_first.address = packet->dest_addr; pkt.hdr_first.packet_rank = 0; @@ -505,23 +493,25 @@ static void do_send_packet(struct ipw_hardware *hw, struct ipw_tx_packet *packet */ unsigned long flags; - spin_lock_irqsave(&hw->lock, flags); + spin_lock_irqsave(&hw->spinlock, flags); list_add(&packet->queue, &hw->tx_queue[0]); hw->tx_queued++; - spin_unlock_irqrestore(&hw->lock, flags); + spin_unlock_irqrestore(&hw->spinlock, flags); } else { if (packet->packet_callback) packet->packet_callback(packet->callback_data, packet->length); kfree(packet); } + + return 0; } static void ipw_setup_hardware(struct ipw_hardware *hw) { unsigned long flags; - spin_lock_irqsave(&hw->lock, flags); + spin_lock_irqsave(&hw->spinlock, flags); if (hw->hw_version == HW_VERSION_1) { /* Reset RX FIFO */ outw(DCR_RXRESET, hw->base_port + IODCR); @@ -540,7 +530,7 @@ static void ipw_setup_hardware(struct ipw_hardware *hw) csr |= 1; writew(csr, &hw->memregs_CCR->reg_config_and_status); } - spin_unlock_irqrestore(&hw->lock, flags); + spin_unlock_irqrestore(&hw->spinlock, flags); } /* @@ -559,23 +549,28 @@ static struct ipw_rx_packet *pool_allocate(struct ipw_hardware *hw, if (!packet) { unsigned long flags; - spin_lock_irqsave(&hw->lock, flags); + /* + * If this is the first fragment, then we will need to fetch a + * packet to put it in. + */ + spin_lock_irqsave(&hw->spinlock, flags); + /* If we have one in our pool, then pull it out. */ if (!list_empty(&hw->rx_pool)) { packet = list_first_entry(&hw->rx_pool, struct ipw_rx_packet, queue); - hw->rx_pool_size--; - spin_unlock_irqrestore(&hw->lock, flags); list_del(&packet->queue); + hw->rx_pool_size--; + spin_unlock_irqrestore(&hw->spinlock, flags); } else { - const int min_capacity = - ipwireless_ppp_mru(hw->network + 2); + /* Otherwise allocate a new one. */ + static int min_capacity = 256; int new_capacity; - spin_unlock_irqrestore(&hw->lock, flags); + spin_unlock_irqrestore(&hw->spinlock, flags); new_capacity = - (minimum_free_space > min_capacity - ? minimum_free_space - : min_capacity); + minimum_free_space > min_capacity + ? minimum_free_space + : min_capacity; packet = kmalloc(sizeof(struct ipw_rx_packet) + new_capacity, GFP_ATOMIC); if (!packet) @@ -585,6 +580,10 @@ static struct ipw_rx_packet *pool_allocate(struct ipw_hardware *hw, packet->length = 0; } + /* + * If this packet does not have sufficient capacity for the data we + * want to add, then make it bigger. + */ if (packet->length + minimum_free_space > packet->capacity) { struct ipw_rx_packet *old_packet = packet; @@ -611,15 +610,13 @@ static void pool_free(struct ipw_hardware *hw, struct ipw_rx_packet *packet) kfree(packet); else { hw->rx_pool_size++; - list_add(&packet->queue, &hw->rx_pool); + list_add_tail(&packet->queue, &hw->rx_pool); } } static void queue_received_packet(struct ipw_hardware *hw, - unsigned int protocol, - unsigned int address, - const unsigned char *data, int length, - int is_last) + unsigned int protocol, unsigned int address, + unsigned char *data, int length, int is_last) { unsigned int channel_idx = address - 1; struct ipw_rx_packet *packet = NULL; @@ -661,9 +658,9 @@ static void queue_received_packet(struct ipw_hardware *hw, packet = *assem; *assem = NULL; /* Count queued DATA bytes only */ - spin_lock_irqsave(&hw->lock, flags); + spin_lock_irqsave(&hw->spinlock, flags); hw->rx_bytes_queued += packet->length; - spin_unlock_irqrestore(&hw->lock, flags); + spin_unlock_irqrestore(&hw->spinlock, flags); } } else { /* If it's a CTRL packet, don't assemble, just queue it. */ @@ -685,13 +682,13 @@ static void queue_received_packet(struct ipw_hardware *hw, * network layer. */ if (packet) { - spin_lock_irqsave(&hw->lock, flags); + spin_lock_irqsave(&hw->spinlock, flags); list_add_tail(&packet->queue, &hw->rx_queue); /* Block reception of incoming packets if queue is full. */ hw->blocking_rx = - (hw->rx_bytes_queued >= IPWIRELESS_RX_QUEUE_SIZE); + hw->rx_bytes_queued >= IPWIRELESS_RX_QUEUE_SIZE; - spin_unlock_irqrestore(&hw->lock, flags); + spin_unlock_irqrestore(&hw->spinlock, flags); schedule_work(&hw->work_rx); } } @@ -705,7 +702,7 @@ static void ipw_receive_data_work(struct work_struct *work_rx) container_of(work_rx, struct ipw_hardware, work_rx); unsigned long flags; - spin_lock_irqsave(&hw->lock, flags); + spin_lock_irqsave(&hw->spinlock, flags); while (!list_empty(&hw->rx_queue)) { struct ipw_rx_packet *packet = list_first_entry(&hw->rx_queue, @@ -723,7 +720,7 @@ static void ipw_receive_data_work(struct work_struct *work_rx) if (packet->protocol == TL_PROTOCOLID_COM_DATA) { if (hw->network != NULL) { /* If the network hasn't been disconnected. */ - spin_unlock_irqrestore(&hw->lock, flags); + spin_unlock_irqrestore(&hw->spinlock, flags); /* * This must run unlocked due to tty processing * and mutex locking @@ -734,7 +731,7 @@ static void ipw_receive_data_work(struct work_struct *work_rx) (unsigned char *)packet + sizeof(struct ipw_rx_packet), packet->length); - spin_lock_irqsave(&hw->lock, flags); + spin_lock_irqsave(&hw->spinlock, flags); } /* Count queued DATA bytes only */ hw->rx_bytes_queued -= packet->length; @@ -758,15 +755,15 @@ static void ipw_receive_data_work(struct work_struct *work_rx) if (hw->shutting_down) break; } - spin_unlock_irqrestore(&hw->lock, flags); + spin_unlock_irqrestore(&hw->spinlock, flags); } static void handle_received_CTRL_packet(struct ipw_hardware *hw, unsigned int channel_idx, - const unsigned char *data, int len) + unsigned char *data, int len) { - const struct ipw_control_packet_body *body = - (const struct ipw_control_packet_body *) data; + struct ipw_control_packet_body *body = + (struct ipw_control_packet_body *) data; unsigned int changed_mask; if (len != sizeof(struct ipw_control_packet_body)) { @@ -808,13 +805,13 @@ static void handle_received_CTRL_packet(struct ipw_hardware *hw, } static void handle_received_packet(struct ipw_hardware *hw, - const union nl_packet *packet, + union nl_packet *packet, unsigned short len) { unsigned int protocol = packet->hdr.protocol; unsigned int address = packet->hdr.address; unsigned int header_length; - const unsigned char *data; + unsigned char *data; unsigned int data_len; int is_last = packet->hdr.packet_rank & NL_LAST_PACKET; @@ -853,7 +850,7 @@ static void acknowledge_data_read(struct ipw_hardware *hw) static void do_receive_packet(struct ipw_hardware *hw) { unsigned len; - unsigned i; + unsigned int i; unsigned char pkt[LL_MTU_MAX]; start_timing(); @@ -862,7 +859,8 @@ static void do_receive_packet(struct ipw_hardware *hw) len = inw(hw->base_port + IODRR); if (len > hw->ll_mtu) { printk(KERN_INFO IPWIRELESS_PCCARD_NAME - ": received a packet of %u bytes - longer than the MTU!\n", len); + ": received a packet of %u bytes - " + "longer than the MTU!\n", len); outw(DCR_RXDONE | DCR_RXRESET, hw->base_port + IODCR); return; } @@ -875,17 +873,18 @@ static void do_receive_packet(struct ipw_hardware *hw) pkt[i + 1] = (unsigned char) (data >> 8); } } else { - len = inw(hw->base_port); + len = inw(hw->base_port + IODMADPR); if (len > hw->ll_mtu) { printk(KERN_INFO IPWIRELESS_PCCARD_NAME - ": received a packet of %u bytes - longer than the MTU!\n", len); + ": received a packet of %u bytes - " + "longer than the MTU!\n", len); writew(MEMRX_PCINTACKK, &hw->memory_info_regs->memreg_pc_interrupt_ack); return; } for (i = 0; i < len; i += 2) { - __le16 raw_data = inw(hw->base_port); + __le16 raw_data = inw(hw->base_port + IODMADPR); unsigned short data = le16_to_cpu(raw_data); pkt[i] = (unsigned char) data; @@ -893,15 +892,13 @@ static void do_receive_packet(struct ipw_hardware *hw) } while ((i & 3) != 2) { - inw(hw->base_port); + inw(hw->base_port + IODMADPR); i += 2; } } acknowledge_data_read(hw); - swap_packet_bitfield_from_le(pkt); - if (ipwireless_debug) dump_data_bytes("recv", pkt, len); @@ -919,7 +916,8 @@ static int get_current_packet_priority(struct ipw_hardware *hw) * until setup is complete. */ return (hw->to_setup || hw->initializing - ? PRIO_SETUP + 1 : NL_NUM_OF_PRIORITIES); + ? PRIO_SETUP + 1 : + NL_NUM_OF_PRIORITIES); } /* @@ -930,17 +928,17 @@ static int get_packets_from_hw(struct ipw_hardware *hw) int received = 0; unsigned long flags; - spin_lock_irqsave(&hw->lock, flags); + spin_lock_irqsave(&hw->spinlock, flags); while (hw->rx_ready && !hw->blocking_rx) { received = 1; hw->rx_ready--; - spin_unlock_irqrestore(&hw->lock, flags); + spin_unlock_irqrestore(&hw->spinlock, flags); do_receive_packet(hw); - spin_lock_irqsave(&hw->lock, flags); + spin_lock_irqsave(&hw->spinlock, flags); } - spin_unlock_irqrestore(&hw->lock, flags); + spin_unlock_irqrestore(&hw->spinlock, flags); return received; } @@ -956,7 +954,7 @@ static int send_pending_packet(struct ipw_hardware *hw, int priority_limit) int more_to_send = 0; unsigned long flags; - spin_lock_irqsave(&hw->lock, flags); + spin_lock_irqsave(&hw->spinlock, flags); if (hw->tx_queued && hw->tx_ready) { int priority; struct ipw_tx_packet *packet = NULL; @@ -977,17 +975,17 @@ static int send_pending_packet(struct ipw_hardware *hw, int priority_limit) } if (!packet) { hw->tx_queued = 0; - spin_unlock_irqrestore(&hw->lock, flags); + spin_unlock_irqrestore(&hw->spinlock, flags); return 0; } - spin_unlock_irqrestore(&hw->lock, flags); + spin_unlock_irqrestore(&hw->spinlock, flags); /* Send */ do_send_packet(hw, packet); /* Check if more to send */ - spin_lock_irqsave(&hw->lock, flags); + spin_lock_irqsave(&hw->spinlock, flags); for (priority = 0; priority < priority_limit; priority++) if (!list_empty(&hw->tx_queue[priority])) { more_to_send = 1; @@ -997,7 +995,7 @@ static int send_pending_packet(struct ipw_hardware *hw, int priority_limit) if (!more_to_send) hw->tx_queued = 0; } - spin_unlock_irqrestore(&hw->lock, flags); + spin_unlock_irqrestore(&hw->spinlock, flags); return more_to_send; } @@ -1010,9 +1008,9 @@ static void ipwireless_do_tasklet(unsigned long hw_) struct ipw_hardware *hw = (struct ipw_hardware *) hw_; unsigned long flags; - spin_lock_irqsave(&hw->lock, flags); + spin_lock_irqsave(&hw->spinlock, flags); if (hw->shutting_down) { - spin_unlock_irqrestore(&hw->lock, flags); + spin_unlock_irqrestore(&hw->spinlock, flags); return; } @@ -1021,7 +1019,7 @@ static void ipwireless_do_tasklet(unsigned long hw_) * Initial setup data sent to hardware */ hw->to_setup = 2; - spin_unlock_irqrestore(&hw->lock, flags); + spin_unlock_irqrestore(&hw->spinlock, flags); ipw_setup_hardware(hw); ipw_send_setup_packet(hw); @@ -1032,7 +1030,7 @@ static void ipwireless_do_tasklet(unsigned long hw_) int priority_limit = get_current_packet_priority(hw); int again; - spin_unlock_irqrestore(&hw->lock, flags); + spin_unlock_irqrestore(&hw->spinlock, flags); do { again = send_pending_packet(hw, priority_limit); @@ -1070,16 +1068,16 @@ static irqreturn_t ipwireless_handle_v1_interrupt(int irq, /* Transmit complete. */ if (irqn & IR_TXINTR) { ack |= IR_TXINTR; - spin_lock_irqsave(&hw->lock, flags); + spin_lock_irqsave(&hw->spinlock, flags); hw->tx_ready = 1; - spin_unlock_irqrestore(&hw->lock, flags); + spin_unlock_irqrestore(&hw->spinlock, flags); } /* Received data */ if (irqn & IR_RXINTR) { ack |= IR_RXINTR; - spin_lock_irqsave(&hw->lock, flags); + spin_lock_irqsave(&hw->spinlock, flags); hw->rx_ready++; - spin_unlock_irqrestore(&hw->lock, flags); + spin_unlock_irqrestore(&hw->spinlock, flags); } if (ack != 0) { outw(ack, hw->base_port + IOIR); @@ -1130,8 +1128,9 @@ static irqreturn_t ipwireless_handle_v2_v3_interrupt(int irq, } else { return IRQ_NONE; } - } else + } else { return IRQ_NONE; + } } /* @@ -1150,9 +1149,9 @@ static irqreturn_t ipwireless_handle_v2_v3_interrupt(int irq, if (hw->serial_number_detected) { if (memtx_serial != hw->last_memtx_serial) { hw->last_memtx_serial = memtx_serial; - spin_lock_irqsave(&hw->lock, flags); + spin_lock_irqsave(&hw->spinlock, flags); hw->rx_ready++; - spin_unlock_irqrestore(&hw->lock, flags); + spin_unlock_irqrestore(&hw->spinlock, flags); rx = 1; } else /* Ignore 'Timer Recovery' duplicates. */ @@ -1167,18 +1166,18 @@ static irqreturn_t ipwireless_handle_v2_v3_interrupt(int irq, printk(KERN_DEBUG IPWIRELESS_PCCARD_NAME ": memreg_tx serial num detected\n"); - spin_lock_irqsave(&hw->lock, flags); + spin_lock_irqsave(&hw->spinlock, flags); hw->rx_ready++; - spin_unlock_irqrestore(&hw->lock, flags); + spin_unlock_irqrestore(&hw->spinlock, flags); } rx = 1; } } if (memrxdone & MEMRX_RX_DONE) { writew(0, &hw->memory_info_regs->memreg_rx_done); - spin_lock_irqsave(&hw->lock, flags); + spin_lock_irqsave(&hw->spinlock, flags); hw->tx_ready = 1; - spin_unlock_irqrestore(&hw->lock, flags); + spin_unlock_irqrestore(&hw->spinlock, flags); tx = 1; } if (tx) @@ -1196,7 +1195,8 @@ static irqreturn_t ipwireless_handle_v2_v3_interrupt(int irq, ": spurious interrupt - new_tx mode\n"); else { printk(KERN_WARNING IPWIRELESS_PCCARD_NAME - ": no valid memreg_tx value - switching to the old memreg_tx\n"); + ": no valid memreg_tx value - " + "switching to the old memreg_tx\n"); hw->memreg_tx = &hw->memory_info_regs->memreg_tx_old; try_mem_tx_old = 1; @@ -1211,7 +1211,7 @@ static irqreturn_t ipwireless_handle_v2_v3_interrupt(int irq, return IRQ_HANDLED; } -irqreturn_t ipwireless_interrupt(int irq, void *dev_id) +irqreturn_t ipwireless_interrupt(int irq, void *dev_id, struct pt_regs *regs) { struct ipw_hardware *hw = dev_id; @@ -1226,9 +1226,9 @@ static void flush_packets_to_hw(struct ipw_hardware *hw) int priority_limit; unsigned long flags; - spin_lock_irqsave(&hw->lock, flags); + spin_lock_irqsave(&hw->spinlock, flags); priority_limit = get_current_packet_priority(hw); - spin_unlock_irqrestore(&hw->lock, flags); + spin_unlock_irqrestore(&hw->spinlock, flags); while (send_pending_packet(hw, priority_limit)); } @@ -1238,10 +1238,10 @@ static void send_packet(struct ipw_hardware *hw, int priority, { unsigned long flags; - spin_lock_irqsave(&hw->lock, flags); + spin_lock_irqsave(&hw->spinlock, flags); list_add_tail(&packet->queue, &hw->tx_queue[priority]); hw->tx_queued++; - spin_unlock_irqrestore(&hw->lock, flags); + spin_unlock_irqrestore(&hw->spinlock, flags); flush_packets_to_hw(hw); } @@ -1291,20 +1291,21 @@ static void *alloc_ctrl_packet(int header_size, } int ipwireless_send_packet(struct ipw_hardware *hw, unsigned int channel_idx, - const unsigned char *data, unsigned int length, + unsigned char *data, unsigned int length, void (*callback) (void *cb, unsigned int length), void *callback_data) { struct ipw_tx_packet *packet; - packet = alloc_data_packet(length, (channel_idx + 1), - TL_PROTOCOLID_COM_DATA); + packet = alloc_data_packet(length, + (unsigned char) (channel_idx + 1), + TL_PROTOCOLID_COM_DATA); if (!packet) return -ENOMEM; packet->packet_callback = callback; packet->callback_data = callback_data; - memcpy((unsigned char *) packet + sizeof(struct ipw_tx_packet), data, - length); + memcpy((unsigned char *) packet + + sizeof(struct ipw_tx_packet), data, length); send_packet(hw, PRIO_DATA, packet); return 0; @@ -1320,11 +1321,12 @@ static int set_control_line(struct ipw_hardware *hw, int prio, protocolid = TL_PROTOCOLID_SETUP; packet = alloc_ctrl_packet(sizeof(struct ipw_control_packet), - (channel_idx + 1), protocolid, line); + (unsigned char) (channel_idx + 1), + protocolid, line); if (!packet) return -ENOMEM; packet->header.length = sizeof(struct ipw_control_packet_body); - packet->body.value = (state == 0 ? 0 : 1); + packet->body.value = (unsigned char) (state == 0 ? 0 : 1); send_packet(hw, prio, &packet->header); return 0; } @@ -1502,7 +1504,8 @@ static void handle_setup_get_version_rsp(struct ipw_hardware *hw, if (vers_no == TL_SETUP_VERSION) __handle_setup_get_version_rsp(hw); else - printk(KERN_ERR IPWIRELESS_PCCARD_NAME + printk(KERN_ERR + IPWIRELESS_PCCARD_NAME ": invalid hardware version no %u\n", (unsigned int) vers_no); } @@ -1525,10 +1528,10 @@ static void ipw_send_setup_packet(struct ipw_hardware *hw) static void handle_received_SETUP_packet(struct ipw_hardware *hw, unsigned int address, - const unsigned char *data, int len, + unsigned char *data, int len, int is_last) { - const union ipw_setup_rx_msg *rx_msg = (const union ipw_setup_rx_msg *) data; + union ipw_setup_rx_msg *rx_msg = (union ipw_setup_rx_msg *) data; if (address != ADDR_SETUP_PROT) { printk(KERN_INFO IPWIRELESS_PCCARD_NAME @@ -1626,7 +1629,7 @@ struct ipw_hardware *ipwireless_hardware_create(void) INIT_LIST_HEAD(&hw->rx_queue); INIT_LIST_HEAD(&hw->rx_pool); - spin_lock_init(&hw->lock); + spin_lock_init(&hw->spinlock); tasklet_init(&hw->tasklet, ipwireless_do_tasklet, (unsigned long) hw); INIT_WORK(&hw->work_rx, ipw_receive_data_work); setup_timer(&hw->setup_timer, ipwireless_setup_timer, @@ -1648,8 +1651,8 @@ void ipwireless_init_hardware_v1(struct ipw_hardware *hw, enable_irq(hw->irq); } hw->base_port = base_port; - hw->hw_version = (is_v2_card ? HW_VERSION_2 : HW_VERSION_1); - hw->ll_mtu = (hw->hw_version == HW_VERSION_1 ? LL_MTU_V1 : LL_MTU_V2); + hw->hw_version = is_v2_card ? HW_VERSION_2 : HW_VERSION_1; + hw->ll_mtu = hw->hw_version == HW_VERSION_1 ? LL_MTU_V1 : LL_MTU_V2; hw->memregs_CCR = (struct MEMCCR __iomem *) ((unsigned short __iomem *) attr_memory + 0x200); hw->memory_info_regs = (struct MEMINFREG __iomem *) common_memory; @@ -1692,10 +1695,10 @@ static void ipwireless_setup_timer(unsigned long data) if (is_card_present(hw)) { unsigned long flags; - spin_lock_irqsave(&hw->lock, flags); + spin_lock_irqsave(&hw->spinlock, flags); hw->to_setup = 1; hw->tx_ready = 1; - spin_unlock_irqrestore(&hw->lock, flags); + spin_unlock_irqrestore(&hw->spinlock, flags); tasklet_schedule(&hw->tasklet); } diff --git a/trunk/drivers/char/pcmcia/ipwireless/hardware.h b/trunk/drivers/char/pcmcia/ipwireless/hardware.h index 90a8590e43b0..19ce5eb266b1 100644 --- a/trunk/drivers/char/pcmcia/ipwireless/hardware.h +++ b/trunk/drivers/char/pcmcia/ipwireless/hardware.h @@ -34,14 +34,14 @@ struct ipw_network; struct ipw_hardware *ipwireless_hardware_create(void); void ipwireless_hardware_free(struct ipw_hardware *hw); -irqreturn_t ipwireless_interrupt(int irq, void *dev_id); +irqreturn_t ipwireless_interrupt(int irq, void *dev_id, struct pt_regs *regs); int ipwireless_set_DTR(struct ipw_hardware *hw, unsigned int channel_idx, int state); int ipwireless_set_RTS(struct ipw_hardware *hw, unsigned int channel_idx, int state); int ipwireless_send_packet(struct ipw_hardware *hw, unsigned int channel_idx, - const unsigned char *data, + unsigned char *data, unsigned int length, void (*packet_sent_callback) (void *cb, unsigned int length), diff --git a/trunk/drivers/char/pcmcia/ipwireless/main.c b/trunk/drivers/char/pcmcia/ipwireless/main.c index 5eca7a99afe6..cc7dcea2d283 100644 --- a/trunk/drivers/char/pcmcia/ipwireless/main.c +++ b/trunk/drivers/char/pcmcia/ipwireless/main.c @@ -49,7 +49,7 @@ static void ipwireless_detach(struct pcmcia_device *link); /* Debug mode: more verbose, print sent/recv bytes */ int ipwireless_debug; int ipwireless_loopback; -int ipwireless_out_queue = 10; +int ipwireless_out_queue = 1; module_param_named(debug, ipwireless_debug, int, 0); module_param_named(loopback, ipwireless_loopback, int, 0); @@ -57,7 +57,7 @@ module_param_named(out_queue, ipwireless_out_queue, int, 0); MODULE_PARM_DESC(debug, "switch on debug messages [0]"); MODULE_PARM_DESC(loopback, "debug: enable ras_raw channel [0]"); -MODULE_PARM_DESC(out_queue, "debug: set size of outgoing PPP queue [10]"); +MODULE_PARM_DESC(out_queue, "debug: set size of outgoing queue [1]"); /* Executes in process context. */ static void signalled_reboot_work(struct work_struct *work_reboot) @@ -88,6 +88,8 @@ static int config_ipwireless(struct ipw_dev *ipw) unsigned short buf[64]; cisparse_t parse; unsigned short cor_value; + win_req_t request_attr_memory; + win_req_t request_common_memory; memreq_t memreq_attr_memory; memreq_t memreq_common_memory; @@ -186,9 +188,6 @@ static int config_ipwireless(struct ipw_dev *ipw) goto exit0; } - request_region(link->io.BasePort1, link->io.NumPorts1, - IPWIRELESS_PCCARD_NAME); - /* memory settings */ tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; @@ -215,16 +214,16 @@ static int config_ipwireless(struct ipw_dev *ipw) } if (parse.cftable_entry.mem.nwin > 0) { - ipw->request_common_memory.Attributes = + request_common_memory.Attributes = WIN_DATA_WIDTH_16 | WIN_MEMORY_TYPE_CM | WIN_ENABLE; - ipw->request_common_memory.Base = + request_common_memory.Base = parse.cftable_entry.mem.win[0].host_addr; - ipw->request_common_memory.Size = parse.cftable_entry.mem.win[0].len; - if (ipw->request_common_memory.Size < 0x1000) - ipw->request_common_memory.Size = 0x1000; - ipw->request_common_memory.AccessSpeed = 0; + request_common_memory.Size = parse.cftable_entry.mem.win[0].len; + if (request_common_memory.Size < 0x1000) + request_common_memory.Size = 0x1000; + request_common_memory.AccessSpeed = 0; - ret = pcmcia_request_window(&link, &ipw->request_common_memory, + ret = pcmcia_request_window(&link, &request_common_memory, &ipw->handle_common_memory); if (ret != CS_SUCCESS) { @@ -247,18 +246,16 @@ static int config_ipwireless(struct ipw_dev *ipw) ipw->is_v2_card = parse.cftable_entry.mem.win[0].len == 0x100; - ipw->common_memory = ioremap(ipw->request_common_memory.Base, - ipw->request_common_memory.Size); - request_mem_region(ipw->request_common_memory.Base, - ipw->request_common_memory.Size, IPWIRELESS_PCCARD_NAME); + ipw->common_memory = ioremap(request_common_memory.Base, + request_common_memory.Size); - ipw->request_attr_memory.Attributes = + request_attr_memory.Attributes = WIN_DATA_WIDTH_16 | WIN_MEMORY_TYPE_AM | WIN_ENABLE; - ipw->request_attr_memory.Base = 0; - ipw->request_attr_memory.Size = 0; /* this used to be 0x1000 */ - ipw->request_attr_memory.AccessSpeed = 0; + request_attr_memory.Base = 0; + request_attr_memory.Size = 0; /* this used to be 0x1000 */ + request_attr_memory.AccessSpeed = 0; - ret = pcmcia_request_window(&link, &ipw->request_attr_memory, + ret = pcmcia_request_window(&link, &request_attr_memory, &ipw->handle_attr_memory); if (ret != CS_SUCCESS) { @@ -277,10 +274,8 @@ static int config_ipwireless(struct ipw_dev *ipw) goto exit2; } - ipw->attr_memory = ioremap(ipw->request_attr_memory.Base, - ipw->request_attr_memory.Size); - request_mem_region(ipw->request_attr_memory.Base, ipw->request_attr_memory.Size, - IPWIRELESS_PCCARD_NAME); + ipw->attr_memory = ioremap(request_attr_memory.Base, + request_attr_memory.Size); } INIT_WORK(&ipw->work_reboot, signalled_reboot_work); @@ -316,13 +311,14 @@ static int config_ipwireless(struct ipw_dev *ipw) (unsigned int) link->irq.AssignedIRQ); if (ipw->attr_memory && ipw->common_memory) printk(KERN_INFO IPWIRELESS_PCCARD_NAME - ": attr memory 0x%08lx-0x%08lx, common memory 0x%08lx-0x%08lx\n", - ipw->request_attr_memory.Base, - ipw->request_attr_memory.Base - + ipw->request_attr_memory.Size - 1, - ipw->request_common_memory.Base, - ipw->request_common_memory.Base - + ipw->request_common_memory.Size - 1); + ": attr memory 0x%08lx-0x%08lx, " + "common memory 0x%08lx-0x%08lx\n", + request_attr_memory.Base, + request_attr_memory.Base + + request_attr_memory.Size - 1, + request_common_memory.Base, + request_common_memory.Base + + request_common_memory.Size - 1); ipw->network = ipwireless_network_create(ipw->hardware); if (!ipw->network) @@ -354,16 +350,12 @@ static int config_ipwireless(struct ipw_dev *ipw) pcmcia_disable_device(link); exit3: if (ipw->attr_memory) { - release_mem_region(ipw->request_attr_memory.Base, - ipw->request_attr_memory.Size); iounmap(ipw->attr_memory); pcmcia_release_window(ipw->handle_attr_memory); pcmcia_disable_device(link); } exit2: if (ipw->common_memory) { - release_mem_region(ipw->request_common_memory.Base, - ipw->request_common_memory.Size); iounmap(ipw->common_memory); pcmcia_release_window(ipw->handle_common_memory); } @@ -375,25 +367,19 @@ static int config_ipwireless(struct ipw_dev *ipw) static void release_ipwireless(struct ipw_dev *ipw) { - pcmcia_disable_device(ipw->link); + struct pcmcia_device *link = ipw->link; - if (ipw->common_memory) { - release_mem_region(ipw->request_common_memory.Base, - ipw->request_common_memory.Size); + pcmcia_disable_device(link); + + if (ipw->common_memory) iounmap(ipw->common_memory); - } - if (ipw->attr_memory) { - release_mem_region(ipw->request_attr_memory.Base, - ipw->request_attr_memory.Size); + if (ipw->attr_memory) iounmap(ipw->attr_memory); - } if (ipw->common_memory) pcmcia_release_window(ipw->handle_common_memory); if (ipw->attr_memory) pcmcia_release_window(ipw->handle_attr_memory); - - /* Break the link with Card Services */ - pcmcia_disable_device(ipw->link); + pcmcia_disable_device(link); } /* @@ -451,6 +437,10 @@ static void ipwireless_detach(struct pcmcia_device *link) release_ipwireless(ipw); + /* Break the link with Card Services */ + if (link) + pcmcia_disable_device(link); + if (ipw->tty != NULL) ipwireless_tty_free(ipw->tty); if (ipw->network != NULL) diff --git a/trunk/drivers/char/pcmcia/ipwireless/main.h b/trunk/drivers/char/pcmcia/ipwireless/main.h index 0e0363af9ab2..1bfdcc8d47d6 100644 --- a/trunk/drivers/char/pcmcia/ipwireless/main.h +++ b/trunk/drivers/char/pcmcia/ipwireless/main.h @@ -45,15 +45,10 @@ struct ipw_tty; struct ipw_dev { struct pcmcia_device *link; int is_v2_card; - window_handle_t handle_attr_memory; void __iomem *attr_memory; - win_req_t request_attr_memory; - window_handle_t handle_common_memory; void __iomem *common_memory; - win_req_t request_common_memory; - dev_node_t nodes[2]; /* Reference to attribute memory, containing CIS data */ void *attribute_memory; diff --git a/trunk/drivers/char/pcmcia/ipwireless/network.c b/trunk/drivers/char/pcmcia/ipwireless/network.c index 590762a7f217..fe914d34f7f6 100644 --- a/trunk/drivers/char/pcmcia/ipwireless/network.c +++ b/trunk/drivers/char/pcmcia/ipwireless/network.c @@ -29,6 +29,7 @@ #include "main.h" #include "tty.h" +#define MAX_OUTGOING_PACKETS_QUEUED ipwireless_out_queue #define MAX_ASSOCIATED_TTYS 2 #define SC_RCV_BITS (SC_RCV_B7_1|SC_RCV_B7_0|SC_RCV_ODDP|SC_RCV_EVNP) @@ -45,7 +46,7 @@ struct ipw_network { /* Number of packets queued up in hardware module. */ int outgoing_packets_queued; /* Spinlock to avoid interrupts during shutdown */ - spinlock_t lock; + spinlock_t spinlock; struct mutex close_lock; /* PPP ioctl data, not actually used anywere */ @@ -67,20 +68,20 @@ static void notify_packet_sent(void *callback_data, unsigned int packet_length) struct ipw_network *network = callback_data; unsigned long flags; - spin_lock_irqsave(&network->lock, flags); + spin_lock_irqsave(&network->spinlock, flags); network->outgoing_packets_queued--; if (network->ppp_channel != NULL) { if (network->ppp_blocked) { network->ppp_blocked = 0; - spin_unlock_irqrestore(&network->lock, flags); + spin_unlock_irqrestore(&network->spinlock, flags); ppp_output_wakeup(network->ppp_channel); if (ipwireless_debug) - printk(KERN_DEBUG IPWIRELESS_PCCARD_NAME + printk(KERN_INFO IPWIRELESS_PCCARD_NAME ": ppp unblocked\n"); } else - spin_unlock_irqrestore(&network->lock, flags); + spin_unlock_irqrestore(&network->spinlock, flags); } else - spin_unlock_irqrestore(&network->lock, flags); + spin_unlock_irqrestore(&network->spinlock, flags); } /* @@ -92,8 +93,8 @@ static int ipwireless_ppp_start_xmit(struct ppp_channel *ppp_channel, struct ipw_network *network = ppp_channel->private; unsigned long flags; - spin_lock_irqsave(&network->lock, flags); - if (network->outgoing_packets_queued < ipwireless_out_queue) { + spin_lock_irqsave(&network->spinlock, flags); + if (network->outgoing_packets_queued < MAX_OUTGOING_PACKETS_QUEUED) { unsigned char *buf; static unsigned char header[] = { PPP_ALLSTATIONS, /* 0xff */ @@ -102,7 +103,7 @@ static int ipwireless_ppp_start_xmit(struct ppp_channel *ppp_channel, int ret; network->outgoing_packets_queued++; - spin_unlock_irqrestore(&network->lock, flags); + spin_unlock_irqrestore(&network->spinlock, flags); /* * If we have the requested amount of headroom in the skb we @@ -143,9 +144,7 @@ static int ipwireless_ppp_start_xmit(struct ppp_channel *ppp_channel, * needs to be unblocked once we are ready to send. */ network->ppp_blocked = 1; - spin_unlock_irqrestore(&network->lock, flags); - if (ipwireless_debug) - printk(KERN_DEBUG IPWIRELESS_PCCARD_NAME ": ppp blocked\n"); + spin_unlock_irqrestore(&network->spinlock, flags); return 0; } } @@ -250,11 +249,11 @@ static void do_go_online(struct work_struct *work_go_online) work_go_online); unsigned long flags; - spin_lock_irqsave(&network->lock, flags); + spin_lock_irqsave(&network->spinlock, flags); if (!network->ppp_channel) { struct ppp_channel *channel; - spin_unlock_irqrestore(&network->lock, flags); + spin_unlock_irqrestore(&network->spinlock, flags); channel = kzalloc(sizeof(struct ppp_channel), GFP_KERNEL); if (!channel) { printk(KERN_ERR IPWIRELESS_PCCARD_NAME @@ -274,10 +273,10 @@ static void do_go_online(struct work_struct *work_go_online) network->xaccm[3] = 0x60000000U; network->raccm = ~0U; ppp_register_channel(channel); - spin_lock_irqsave(&network->lock, flags); + spin_lock_irqsave(&network->spinlock, flags); network->ppp_channel = channel; } - spin_unlock_irqrestore(&network->lock, flags); + spin_unlock_irqrestore(&network->spinlock, flags); } static void do_go_offline(struct work_struct *work_go_offline) @@ -288,16 +287,16 @@ static void do_go_offline(struct work_struct *work_go_offline) unsigned long flags; mutex_lock(&network->close_lock); - spin_lock_irqsave(&network->lock, flags); + spin_lock_irqsave(&network->spinlock, flags); if (network->ppp_channel != NULL) { struct ppp_channel *channel = network->ppp_channel; network->ppp_channel = NULL; - spin_unlock_irqrestore(&network->lock, flags); + spin_unlock_irqrestore(&network->spinlock, flags); mutex_unlock(&network->close_lock); ppp_unregister_channel(channel); } else { - spin_unlock_irqrestore(&network->lock, flags); + spin_unlock_irqrestore(&network->spinlock, flags); mutex_unlock(&network->close_lock); } } @@ -382,18 +381,18 @@ void ipwireless_network_packet_received(struct ipw_network *network, * the PPP layer. */ mutex_lock(&network->close_lock); - spin_lock_irqsave(&network->lock, flags); + spin_lock_irqsave(&network->spinlock, flags); if (network->ppp_channel != NULL) { struct sk_buff *skb; - spin_unlock_irqrestore(&network->lock, + spin_unlock_irqrestore(&network->spinlock, flags); /* Send the data to the ppp_generic module. */ skb = ipw_packet_received_skb(data, length); ppp_input(network->ppp_channel, skb); } else - spin_unlock_irqrestore(&network->lock, + spin_unlock_irqrestore(&network->spinlock, flags); mutex_unlock(&network->close_lock); } @@ -411,7 +410,7 @@ struct ipw_network *ipwireless_network_create(struct ipw_hardware *hw) if (!network) return NULL; - spin_lock_init(&network->lock); + spin_lock_init(&network->spinlock); mutex_init(&network->close_lock); network->hardware = hw; @@ -479,10 +478,10 @@ int ipwireless_ppp_channel_index(struct ipw_network *network) int ret = -1; unsigned long flags; - spin_lock_irqsave(&network->lock, flags); + spin_lock_irqsave(&network->spinlock, flags); if (network->ppp_channel != NULL) ret = ppp_channel_index(network->ppp_channel); - spin_unlock_irqrestore(&network->lock, flags); + spin_unlock_irqrestore(&network->spinlock, flags); return ret; } @@ -492,15 +491,10 @@ int ipwireless_ppp_unit_number(struct ipw_network *network) int ret = -1; unsigned long flags; - spin_lock_irqsave(&network->lock, flags); + spin_lock_irqsave(&network->spinlock, flags); if (network->ppp_channel != NULL) ret = ppp_unit_number(network->ppp_channel); - spin_unlock_irqrestore(&network->lock, flags); + spin_unlock_irqrestore(&network->spinlock, flags); return ret; } - -int ipwireless_ppp_mru(const struct ipw_network *network) -{ - return network->mru; -} diff --git a/trunk/drivers/char/pcmcia/ipwireless/network.h b/trunk/drivers/char/pcmcia/ipwireless/network.h index 561f765b3334..ccacd26fc7ef 100644 --- a/trunk/drivers/char/pcmcia/ipwireless/network.h +++ b/trunk/drivers/char/pcmcia/ipwireless/network.h @@ -48,6 +48,5 @@ void ipwireless_ppp_open(struct ipw_network *net); void ipwireless_ppp_close(struct ipw_network *net); int ipwireless_ppp_channel_index(struct ipw_network *net); int ipwireless_ppp_unit_number(struct ipw_network *net); -int ipwireless_ppp_mru(const struct ipw_network *net); #endif diff --git a/trunk/drivers/char/pcmcia/ipwireless/tty.c b/trunk/drivers/char/pcmcia/ipwireless/tty.c index b1414507997c..42f3815c5ce3 100644 --- a/trunk/drivers/char/pcmcia/ipwireless/tty.c +++ b/trunk/drivers/char/pcmcia/ipwireless/tty.c @@ -259,7 +259,7 @@ static int ipw_write(struct tty_struct *linux_tty, } ret = ipwireless_send_packet(tty->hardware, IPW_CHANNEL_RAS, - buf, count, + (unsigned char *) buf, count, ipw_write_packet_sent_callback, tty); if (ret == -1) { mutex_unlock(&tty->ipw_tty_mutex); diff --git a/trunk/drivers/cpuidle/cpuidle.c b/trunk/drivers/cpuidle/cpuidle.c index 5ce07b517c58..5405769020a1 100644 --- a/trunk/drivers/cpuidle/cpuidle.c +++ b/trunk/drivers/cpuidle/cpuidle.c @@ -94,7 +94,7 @@ void cpuidle_install_idle_handler(void) */ void cpuidle_uninstall_idle_handler(void) { - if (enabled_devices && pm_idle_old && (pm_idle != pm_idle_old)) { + if (enabled_devices && (pm_idle != pm_idle_old)) { pm_idle = pm_idle_old; cpuidle_kick_cpus(); } diff --git a/trunk/drivers/i2c/busses/i2c-bfin-twi.c b/trunk/drivers/i2c/busses/i2c-bfin-twi.c index 3c855ff2992f..48d084bdf7c8 100644 --- a/trunk/drivers/i2c/busses/i2c-bfin-twi.c +++ b/trunk/drivers/i2c/busses/i2c-bfin-twi.c @@ -49,8 +49,6 @@ struct bfin_twi_iface { struct i2c_msg *pmsg; int msg_num; int cur_msg; - u16 saved_clkdiv; - u16 saved_control; void __iomem *regs_base; }; @@ -567,43 +565,32 @@ static u32 bfin_twi_functionality(struct i2c_adapter *adap) I2C_FUNC_I2C; } + static struct i2c_algorithm bfin_twi_algorithm = { .master_xfer = bfin_twi_master_xfer, .smbus_xfer = bfin_twi_smbus_xfer, .functionality = bfin_twi_functionality, }; -static int i2c_bfin_twi_suspend(struct platform_device *pdev, pm_message_t state) -{ - struct bfin_twi_iface *iface = platform_get_drvdata(pdev); - iface->saved_clkdiv = read_CLKDIV(iface); - iface->saved_control = read_CONTROL(iface); - - free_irq(iface->irq, iface); +static int i2c_bfin_twi_suspend(struct platform_device *dev, pm_message_t state) +{ + struct bfin_twi_iface *iface = platform_get_drvdata(dev); /* Disable TWI */ - write_CONTROL(iface, iface->saved_control & ~TWI_ENA); + write_CONTROL(iface, read_CONTROL(iface) & ~TWI_ENA); + SSYNC(); return 0; } -static int i2c_bfin_twi_resume(struct platform_device *pdev) +static int i2c_bfin_twi_resume(struct platform_device *dev) { - struct bfin_twi_iface *iface = platform_get_drvdata(pdev); + struct bfin_twi_iface *iface = platform_get_drvdata(dev); - int rc = request_irq(iface->irq, bfin_twi_interrupt_entry, - IRQF_DISABLED, pdev->name, iface); - if (rc) { - dev_err(&pdev->dev, "Can't get IRQ %d !\n", iface->irq); - return -ENODEV; - } - - /* Resume TWI interface clock as specified */ - write_CLKDIV(iface, iface->saved_clkdiv); - - /* Resume TWI */ - write_CONTROL(iface, iface->saved_control); + /* Enable TWI */ + write_CONTROL(iface, read_CONTROL(iface) | TWI_ENA); + SSYNC(); return 0; } diff --git a/trunk/drivers/i2c/busses/i2c-gpio.c b/trunk/drivers/i2c/busses/i2c-gpio.c index 32104eac8d3d..79b455a1f090 100644 --- a/trunk/drivers/i2c/busses/i2c-gpio.c +++ b/trunk/drivers/i2c/busses/i2c-gpio.c @@ -77,7 +77,7 @@ static int i2c_gpio_getscl(void *data) return gpio_get_value(pdata->scl_pin); } -static int __devinit i2c_gpio_probe(struct platform_device *pdev) +static int __init i2c_gpio_probe(struct platform_device *pdev) { struct i2c_gpio_platform_data *pdata; struct i2c_algo_bit_data *bit_data; @@ -174,7 +174,7 @@ static int __devinit i2c_gpio_probe(struct platform_device *pdev) return ret; } -static int __devexit i2c_gpio_remove(struct platform_device *pdev) +static int __exit i2c_gpio_remove(struct platform_device *pdev) { struct i2c_gpio_platform_data *pdata; struct i2c_adapter *adap; @@ -196,15 +196,14 @@ static struct platform_driver i2c_gpio_driver = { .name = "i2c-gpio", .owner = THIS_MODULE, }, - .probe = i2c_gpio_probe, - .remove = __devexit_p(i2c_gpio_remove), + .remove = __exit_p(i2c_gpio_remove), }; static int __init i2c_gpio_init(void) { int ret; - ret = platform_driver_register(&i2c_gpio_driver); + ret = platform_driver_probe(&i2c_gpio_driver, i2c_gpio_probe); if (ret) printk(KERN_ERR "i2c-gpio: probe failed: %d\n", ret); diff --git a/trunk/drivers/i2c/busses/i2c-s3c2410.c b/trunk/drivers/i2c/busses/i2c-s3c2410.c index 4864723c7425..007390ad9810 100644 --- a/trunk/drivers/i2c/busses/i2c-s3c2410.c +++ b/trunk/drivers/i2c/busses/i2c-s3c2410.c @@ -33,7 +33,6 @@ #include #include #include -#include #include #include @@ -65,7 +64,6 @@ struct s3c24xx_i2c { unsigned int tx_setup; enum s3c24xx_i2c_state state; - unsigned long clkrate; void __iomem *regs; struct clk *clk; @@ -73,10 +71,6 @@ struct s3c24xx_i2c { struct resource *irq; struct resource *ioarea; struct i2c_adapter adap; - -#ifdef CONFIG_CPU_FREQ - struct notifier_block freq_transition; -#endif }; /* default platform data to use if not supplied in the platform_device @@ -507,9 +501,6 @@ static int s3c24xx_i2c_doxfer(struct s3c24xx_i2c *i2c, struct i2c_msg *msgs, int unsigned long timeout; int ret; - if (!readl(i2c->regs + S3C2410_IICCON) & S3C2410_IICCON_IRQEN) - return -EIO; - ret = s3c24xx_i2c_set_master(i2c); if (ret != 0) { dev_err(i2c->dev, "cannot get bus (error %d)\n", ret); @@ -645,28 +636,27 @@ static inline int freq_acceptable(unsigned int freq, unsigned int wanted) return (diff >= -2 && diff <= 2); } -/* s3c24xx_i2c_clockrate +/* s3c24xx_i2c_getdivisor * * work out a divisor for the user requested frequency setting, * either by the requested frequency, or scanning the acceptable * range of frequencies until something is found */ -static int s3c24xx_i2c_clockrate(struct s3c24xx_i2c *i2c, unsigned int *got) +static int s3c24xx_i2c_getdivisor(struct s3c24xx_i2c *i2c, + struct s3c2410_platform_i2c *pdata, + unsigned long *iicon, + unsigned int *got) { - struct s3c2410_platform_i2c *pdata; unsigned long clkin = clk_get_rate(i2c->clk); + unsigned int divs, div1; - u32 iiccon; int freq; int start, end; - i2c->clkrate = clkin; - - pdata = s3c24xx_i2c_get_platformdata(i2c->adap.dev.parent); clkin /= 1000; /* clkin now in KHz */ - dev_dbg(i2c->dev, "pdata %p, freq %lu %lu..%lu\n", + dev_dbg(i2c->dev, "pdata %p, freq %lu %lu..%lu\n", pdata, pdata->bus_freq, pdata->min_freq, pdata->max_freq); if (pdata->bus_freq != 0) { @@ -698,79 +688,11 @@ static int s3c24xx_i2c_clockrate(struct s3c24xx_i2c *i2c, unsigned int *got) found: *got = freq; - - iiccon = readl(i2c->regs + S3C2410_IICCON); - iiccon &= ~(S3C2410_IICCON_SCALEMASK | S3C2410_IICCON_TXDIV_512); - iiccon |= (divs-1); - - if (div1 == 512) - iiccon |= S3C2410_IICCON_TXDIV_512; - - writel(iiccon, i2c->regs + S3C2410_IICCON); - - return 0; -} - -#ifdef CONFIG_CPU_FREQ - -#define freq_to_i2c(_n) container_of(_n, struct s3c24xx_i2c, freq_transition) - -static int s3c24xx_i2c_cpufreq_transition(struct notifier_block *nb, - unsigned long val, void *data) -{ - struct s3c24xx_i2c *i2c = freq_to_i2c(nb); - unsigned long flags; - unsigned int got; - int delta_f; - int ret; - - delta_f = clk_get_rate(i2c->clk) - i2c->clkrate; - - /* if we're post-change and the input clock has slowed down - * or at pre-change and the clock is about to speed up, then - * adjust our clock rate. <0 is slow, >0 speedup. - */ - - if ((val == CPUFREQ_POSTCHANGE && delta_f < 0) || - (val == CPUFREQ_PRECHANGE && delta_f > 0)) { - spin_lock_irqsave(&i2c->lock, flags); - ret = s3c24xx_i2c_clockrate(i2c, &got); - spin_unlock_irqrestore(&i2c->lock, flags); - - if (ret < 0) - dev_err(i2c->dev, "cannot find frequency\n"); - else - dev_info(i2c->dev, "setting freq %d\n", got); - } - - return 0; -} - -static inline int s3c24xx_i2c_register_cpufreq(struct s3c24xx_i2c *i2c) -{ - i2c->freq_transition.notifier_call = s3c24xx_i2c_cpufreq_transition; - - return cpufreq_register_notifier(&i2c->freq_transition, - CPUFREQ_TRANSITION_NOTIFIER); -} - -static inline void s3c24xx_i2c_deregister_cpufreq(struct s3c24xx_i2c *i2c) -{ - cpufreq_unregister_notifier(&i2c->freq_transition, - CPUFREQ_TRANSITION_NOTIFIER); -} - -#else -static inline int s3c24xx_i2c_register_cpufreq(struct s3c24xx_i2c *i2c) -{ + *iicon |= (divs-1); + *iicon |= (div1 == 512) ? S3C2410_IICCON_TXDIV_512 : 0; return 0; } -static inline void s3c24xx_i2c_deregister_cpufreq(struct s3c24xx_i2c *i2c) -{ -} -#endif - /* s3c24xx_i2c_init * * initialise the controller, set the IO lines and frequency @@ -797,12 +719,9 @@ static int s3c24xx_i2c_init(struct s3c24xx_i2c *i2c) dev_info(i2c->dev, "slave address 0x%02x\n", pdata->slave_addr); - writel(iicon, i2c->regs + S3C2410_IICCON); - /* we need to work out the divisors for the clock... */ - if (s3c24xx_i2c_clockrate(i2c, &freq) != 0) { - writel(0, i2c->regs + S3C2410_IICCON); + if (s3c24xx_i2c_getdivisor(i2c, pdata, &iicon, &freq) != 0) { dev_err(i2c->dev, "cannot meet bus frequency required\n"); return -EINVAL; } @@ -811,6 +730,8 @@ static int s3c24xx_i2c_init(struct s3c24xx_i2c *i2c) dev_info(i2c->dev, "bus frequency set to %d KHz\n", freq); dev_dbg(i2c->dev, "S3C2410_IICCON=0x%02lx\n", iicon); + + writel(iicon, i2c->regs + S3C2410_IICCON); /* check for s3c2440 i2c controller */ @@ -831,12 +752,9 @@ static int s3c24xx_i2c_init(struct s3c24xx_i2c *i2c) static int s3c24xx_i2c_probe(struct platform_device *pdev) { struct s3c24xx_i2c *i2c = &s3c24xx_i2c; - struct s3c2410_platform_i2c *pdata; struct resource *res; int ret; - pdata = s3c24xx_i2c_get_platformdata(&pdev->dev); - /* find the clock and enable it */ i2c->dev = &pdev->dev; @@ -914,24 +832,10 @@ static int s3c24xx_i2c_probe(struct platform_device *pdev) dev_dbg(&pdev->dev, "irq resource %p (%lu)\n", res, (unsigned long)res->start); - ret = s3c24xx_i2c_register_cpufreq(i2c); - if (ret < 0) { - dev_err(&pdev->dev, "failed to register cpufreq notifier\n"); - goto err_irq; - } - - /* Note, previous versions of the driver used i2c_add_adapter() - * to add the bus at any number. We now pass the bus number via - * the platform data, so if unset it will now default to always - * being bus 0. - */ - - i2c->adap.nr = pdata->bus_num; - - ret = i2c_add_numbered_adapter(&i2c->adap); + ret = i2c_add_adapter(&i2c->adap); if (ret < 0) { dev_err(&pdev->dev, "failed to add bus to i2c core\n"); - goto err_cpufreq; + goto err_irq; } platform_set_drvdata(pdev, i2c); @@ -939,9 +843,6 @@ static int s3c24xx_i2c_probe(struct platform_device *pdev) dev_info(&pdev->dev, "%s: S3C I2C adapter\n", i2c->adap.dev.bus_id); return 0; - err_cpufreq: - s3c24xx_i2c_deregister_cpufreq(i2c); - err_irq: free_irq(i2c->irq->start, i2c); @@ -969,8 +870,6 @@ static int s3c24xx_i2c_remove(struct platform_device *pdev) { struct s3c24xx_i2c *i2c = platform_get_drvdata(pdev); - s3c24xx_i2c_deregister_cpufreq(i2c); - i2c_del_adapter(&i2c->adap); free_irq(i2c->irq->start, i2c); diff --git a/trunk/drivers/input/touchscreen/corgi_ts.c b/trunk/drivers/input/touchscreen/corgi_ts.c index d0e13fc4a88c..4e9d8eece2e0 100644 --- a/trunk/drivers/input/touchscreen/corgi_ts.c +++ b/trunk/drivers/input/touchscreen/corgi_ts.c @@ -195,7 +195,7 @@ static void ts_interrupt_main(struct corgi_ts *corgi_ts, int isTimer) { if ((GPLR(IRQ_TO_GPIO(corgi_ts->irq_gpio)) & GPIO_bit(IRQ_TO_GPIO(corgi_ts->irq_gpio))) == 0) { /* Disable Interrupt */ - set_irq_type(corgi_ts->irq_gpio, IRQ_TYPE_NONE); + set_irq_type(corgi_ts->irq_gpio, IRQT_NOEDGE); if (read_xydata(corgi_ts)) { corgi_ts->pendown = 1; new_data(corgi_ts); @@ -214,7 +214,7 @@ static void ts_interrupt_main(struct corgi_ts *corgi_ts, int isTimer) } /* Enable Falling Edge */ - set_irq_type(corgi_ts->irq_gpio, IRQ_TYPE_EDGE_FALLING); + set_irq_type(corgi_ts->irq_gpio, IRQT_FALLING); corgi_ts->pendown = 0; } } @@ -258,7 +258,7 @@ static int corgits_resume(struct platform_device *dev) corgi_ssp_ads7846_putget((4u << ADSCTRL_ADR_SH) | ADSCTRL_STS); /* Enable Falling Edge */ - set_irq_type(corgi_ts->irq_gpio, IRQ_TYPE_EDGE_FALLING); + set_irq_type(corgi_ts->irq_gpio, IRQT_FALLING); corgi_ts->power_mode = PWR_MODE_ACTIVE; return 0; @@ -333,7 +333,7 @@ static int __init corgits_probe(struct platform_device *pdev) corgi_ts->power_mode = PWR_MODE_ACTIVE; /* Enable Falling Edge */ - set_irq_type(corgi_ts->irq_gpio, IRQ_TYPE_EDGE_FALLING); + set_irq_type(corgi_ts->irq_gpio, IRQT_FALLING); return 0; diff --git a/trunk/drivers/input/touchscreen/mainstone-wm97xx.c b/trunk/drivers/input/touchscreen/mainstone-wm97xx.c index 590a1379aa32..a79f029b91c0 100644 --- a/trunk/drivers/input/touchscreen/mainstone-wm97xx.c +++ b/trunk/drivers/input/touchscreen/mainstone-wm97xx.c @@ -198,7 +198,7 @@ static int wm97xx_acc_startup(struct wm97xx *wm) switch (wm->id) { case WM9705_ID2: wm->pen_irq = IRQ_GPIO(4); - set_irq_type(IRQ_GPIO(4), IRQ_TYPE_EDGE_BOTH); + set_irq_type(IRQ_GPIO(4), IRQT_BOTHEDGE); break; case WM9712_ID2: case WM9713_ID2: diff --git a/trunk/drivers/media/common/saa7146_fops.c b/trunk/drivers/media/common/saa7146_fops.c index cf6a817d5059..171afe7da6b6 100644 --- a/trunk/drivers/media/common/saa7146_fops.c +++ b/trunk/drivers/media/common/saa7146_fops.c @@ -563,7 +563,7 @@ int saa7146_unregister_device(struct video_device **vid, struct saa7146_dev* dev DEB_EE(("dev:%p\n",dev)); - if ((*vid)->vfl_type == VFL_TYPE_GRABBER) { + if( VFL_TYPE_GRABBER == (*vid)->type ) { vv->video_minor = -1; } else { vv->vbi_minor = -1; diff --git a/trunk/drivers/media/common/saa7146_video.c b/trunk/drivers/media/common/saa7146_video.c index e8bc7abf2409..a5e62750eea3 100644 --- a/trunk/drivers/media/common/saa7146_video.c +++ b/trunk/drivers/media/common/saa7146_video.c @@ -656,7 +656,7 @@ static int saa7146_pgtable_build(struct saa7146_dev *dev, struct saa7146_buf *bu /* if we have a user buffer, the first page may not be aligned to a page boundary. */ - pt1->offset = dma->sglist->offset; + pt1->offset = list->offset; pt2->offset = pt1->offset+o1; pt3->offset = pt1->offset+o2; @@ -958,18 +958,21 @@ int saa7146_video_do_ioctl(struct inode *inode, struct file *file, unsigned int case VIDIOC_ENUM_FMT: { struct v4l2_fmtdesc *f = arg; + int index; switch (f->type) { case V4L2_BUF_TYPE_VIDEO_CAPTURE: - case V4L2_BUF_TYPE_VIDEO_OVERLAY: - if (f->index >= NUM_FORMATS) + case V4L2_BUF_TYPE_VIDEO_OVERLAY: { + index = f->index; + if (index < 0 || index >= NUM_FORMATS) { return -EINVAL; - strlcpy((char *)f->description, formats[f->index].name, - sizeof(f->description)); - f->pixelformat = formats[f->index].pixelformat; - f->flags = 0; - memset(f->reserved, 0, sizeof(f->reserved)); + } + memset(f,0,sizeof(*f)); + f->index = index; + strlcpy((char *)f->description,formats[index].name,sizeof(f->description)); + f->pixelformat = formats[index].pixelformat; break; + } default: return -EINVAL; } diff --git a/trunk/drivers/media/common/tuners/Kconfig b/trunk/drivers/media/common/tuners/Kconfig index 6f92beaa5ac8..850d5689b14d 100644 --- a/trunk/drivers/media/common/tuners/Kconfig +++ b/trunk/drivers/media/common/tuners/Kconfig @@ -21,8 +21,9 @@ config MEDIA_TUNER tristate default VIDEO_MEDIA && I2C depends on VIDEO_MEDIA && I2C - select MEDIA_TUNER_XC2028 if !MEDIA_TUNER_CUSTOMIZE - select MEDIA_TUNER_XC5000 if !MEDIA_TUNER_CUSTOMIZE + select FW_LOADER if !MEDIA_TUNER_CUSTOMIZE && HOTPLUG + select MEDIA_TUNER_XC2028 if !MEDIA_TUNER_CUSTOMIZE && HOTPLUG + select MEDIA_TUNER_XC5000 if !MEDIA_TUNER_CUSTOMIZE && HOTPLUG select MEDIA_TUNER_MT20XX if !MEDIA_TUNER_CUSTOMIZE select MEDIA_TUNER_TDA8290 if !MEDIA_TUNER_CUSTOMIZE select MEDIA_TUNER_TEA5761 if !MEDIA_TUNER_CUSTOMIZE @@ -137,6 +138,8 @@ config MEDIA_TUNER_QT1010 config MEDIA_TUNER_XC2028 tristate "XCeive xc2028/xc3028 tuners" depends on VIDEO_MEDIA && I2C + depends on HOTPLUG + select FW_LOADER default m if MEDIA_TUNER_CUSTOMIZE help Say Y here to include support for the xc2028/xc3028 tuners. @@ -144,6 +147,8 @@ config MEDIA_TUNER_XC2028 config MEDIA_TUNER_XC5000 tristate "Xceive XC5000 silicon tuner" depends on VIDEO_MEDIA && I2C + depends on HOTPLUG + select FW_LOADER default m if DVB_FE_CUSTOMISE help A driver for the silicon tuner XC5000 from Xceive. @@ -157,11 +162,4 @@ config MEDIA_TUNER_MXL5005S help A driver for the silicon tuner MXL5005S from MaxLinear. -config MEDIA_TUNER_MXL5007T - tristate "MaxLinear MxL5007T silicon tuner" - depends on VIDEO_MEDIA && I2C - default m if DVB_FE_CUSTOMISE - help - A driver for the silicon tuner MxL5007T from MaxLinear. - endif # MEDIA_TUNER_CUSTOMIZE diff --git a/trunk/drivers/media/common/tuners/Makefile b/trunk/drivers/media/common/tuners/Makefile index 4dfbe5b8264f..55f7e6706297 100644 --- a/trunk/drivers/media/common/tuners/Makefile +++ b/trunk/drivers/media/common/tuners/Makefile @@ -21,7 +21,6 @@ obj-$(CONFIG_MEDIA_TUNER_MT2266) += mt2266.o obj-$(CONFIG_MEDIA_TUNER_QT1010) += qt1010.o obj-$(CONFIG_MEDIA_TUNER_MT2131) += mt2131.o obj-$(CONFIG_MEDIA_TUNER_MXL5005S) += mxl5005s.o -obj-$(CONFIG_MEDIA_TUNER_MXL5007T) += mxl5007t.o EXTRA_CFLAGS += -Idrivers/media/dvb/dvb-core EXTRA_CFLAGS += -Idrivers/media/dvb/frontends diff --git a/trunk/drivers/media/common/tuners/mt20xx.c b/trunk/drivers/media/common/tuners/mt20xx.c index 35b763a16d53..fbcb28233737 100644 --- a/trunk/drivers/media/common/tuners/mt20xx.c +++ b/trunk/drivers/media/common/tuners/mt20xx.c @@ -148,8 +148,7 @@ static int mt2032_compute_freq(struct dvb_frontend *fe, tuner_dbg("mt2032: rfin=%d lo2=%d lo2n=%d lo2a=%d num=%d lo2freq=%d\n", rfin,lo2,lo2n,lo2a,lo2num,lo2freq); - if (lo1a > 7 || lo1n < 17 || lo1n > 48 || lo2a > 7 || lo2n < 17 || - lo2n > 30) { + if(lo1a<0 || lo1a>7 || lo1n<17 ||lo1n>48 || lo2a<0 ||lo2a >7 ||lo2n<17 || lo2n>30) { tuner_info("mt2032: frequency parameters out of range: %d %d %d %d\n", lo1a, lo1n, lo2a,lo2n); return(-1); diff --git a/trunk/drivers/media/common/tuners/mxl5007t.c b/trunk/drivers/media/common/tuners/mxl5007t.c deleted file mode 100644 index cb25e43502fe..000000000000 --- a/trunk/drivers/media/common/tuners/mxl5007t.c +++ /dev/null @@ -1,1030 +0,0 @@ -/* - * mxl5007t.c - driver for the MaxLinear MxL5007T silicon tuner - * - * Copyright (C) 2008 Michael Krufky - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 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 General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#include -#include -#include -#include "tuner-i2c.h" -#include "mxl5007t.h" - -static DEFINE_MUTEX(mxl5007t_list_mutex); -static LIST_HEAD(hybrid_tuner_instance_list); - -static int mxl5007t_debug; -module_param_named(debug, mxl5007t_debug, int, 0644); -MODULE_PARM_DESC(debug, "set debug level"); - -/* ------------------------------------------------------------------------- */ - -#define mxl_printk(kern, fmt, arg...) \ - printk(kern "%s: " fmt "\n", __func__, ##arg) - -#define mxl_err(fmt, arg...) \ - mxl_printk(KERN_ERR, "%d: " fmt, __LINE__, ##arg) - -#define mxl_warn(fmt, arg...) \ - mxl_printk(KERN_WARNING, fmt, ##arg) - -#define mxl_info(fmt, arg...) \ - mxl_printk(KERN_INFO, fmt, ##arg) - -#define mxl_debug(fmt, arg...) \ -({ \ - if (mxl5007t_debug) \ - mxl_printk(KERN_DEBUG, fmt, ##arg); \ -}) - -#define mxl_fail(ret) \ -({ \ - int __ret; \ - __ret = (ret < 0); \ - if (__ret) \ - mxl_printk(KERN_ERR, "error %d on line %d", \ - ret, __LINE__); \ - __ret; \ -}) - -/* ------------------------------------------------------------------------- */ - -#define MHz 1000000 - -enum mxl5007t_mode { - MxL_MODE_OTA_DVBT_ATSC = 0, - MxL_MODE_OTA_NTSC_PAL_GH = 1, - MxL_MODE_OTA_PAL_IB = 2, - MxL_MODE_OTA_PAL_D_SECAM_KL = 3, - MxL_MODE_OTA_ISDBT = 4, - MxL_MODE_CABLE_DIGITAL = 0x10, - MxL_MODE_CABLE_NTSC_PAL_GH = 0x11, - MxL_MODE_CABLE_PAL_IB = 0x12, - MxL_MODE_CABLE_PAL_D_SECAM_KL = 0x13, - MxL_MODE_CABLE_SCTE40 = 0x14, -}; - -enum mxl5007t_chip_version { - MxL_UNKNOWN_ID = 0x00, - MxL_5007_V1_F1 = 0x11, - MxL_5007_V1_F2 = 0x12, - MxL_5007_V2_100_F1 = 0x21, - MxL_5007_V2_100_F2 = 0x22, - MxL_5007_V2_200_F1 = 0x23, - MxL_5007_V2_200_F2 = 0x24, -}; - -struct reg_pair_t { - u8 reg; - u8 val; -}; - -/* ------------------------------------------------------------------------- */ - -static struct reg_pair_t init_tab[] = { - { 0x0b, 0x44 }, /* XTAL */ - { 0x0c, 0x60 }, /* IF */ - { 0x10, 0x00 }, /* MISC */ - { 0x12, 0xca }, /* IDAC */ - { 0x16, 0x90 }, /* MODE */ - { 0x32, 0x38 }, /* MODE Analog/Digital */ - { 0xd8, 0x18 }, /* CLK_OUT_ENABLE */ - { 0x2c, 0x34 }, /* OVERRIDE */ - { 0x4d, 0x40 }, /* OVERRIDE */ - { 0x7f, 0x02 }, /* OVERRIDE */ - { 0x9a, 0x52 }, /* OVERRIDE */ - { 0x48, 0x5a }, /* OVERRIDE */ - { 0x76, 0x1a }, /* OVERRIDE */ - { 0x6a, 0x48 }, /* OVERRIDE */ - { 0x64, 0x28 }, /* OVERRIDE */ - { 0x66, 0xe6 }, /* OVERRIDE */ - { 0x35, 0x0e }, /* OVERRIDE */ - { 0x7e, 0x01 }, /* OVERRIDE */ - { 0x83, 0x00 }, /* OVERRIDE */ - { 0x04, 0x0b }, /* OVERRIDE */ - { 0x05, 0x01 }, /* TOP_MASTER_ENABLE */ - { 0, 0 } -}; - -static struct reg_pair_t init_tab_cable[] = { - { 0x0b, 0x44 }, /* XTAL */ - { 0x0c, 0x60 }, /* IF */ - { 0x10, 0x00 }, /* MISC */ - { 0x12, 0xca }, /* IDAC */ - { 0x16, 0x90 }, /* MODE */ - { 0x32, 0x38 }, /* MODE A/D */ - { 0x71, 0x3f }, /* TOP1 */ - { 0x72, 0x3f }, /* TOP2 */ - { 0x74, 0x3f }, /* TOP3 */ - { 0xd8, 0x18 }, /* CLK_OUT_ENABLE */ - { 0x2c, 0x34 }, /* OVERRIDE */ - { 0x4d, 0x40 }, /* OVERRIDE */ - { 0x7f, 0x02 }, /* OVERRIDE */ - { 0x9a, 0x52 }, /* OVERRIDE */ - { 0x48, 0x5a }, /* OVERRIDE */ - { 0x76, 0x1a }, /* OVERRIDE */ - { 0x6a, 0x48 }, /* OVERRIDE */ - { 0x64, 0x28 }, /* OVERRIDE */ - { 0x66, 0xe6 }, /* OVERRIDE */ - { 0x35, 0x0e }, /* OVERRIDE */ - { 0x7e, 0x01 }, /* OVERRIDE */ - { 0x04, 0x0b }, /* OVERRIDE */ - { 0x68, 0xb4 }, /* OVERRIDE */ - { 0x36, 0x00 }, /* OVERRIDE */ - { 0x05, 0x01 }, /* TOP_MASTER_ENABLE */ - { 0, 0 } -}; - -/* ------------------------------------------------------------------------- */ - -static struct reg_pair_t reg_pair_rftune[] = { - { 0x11, 0x00 }, /* abort tune */ - { 0x13, 0x15 }, - { 0x14, 0x40 }, - { 0x15, 0x0e }, - { 0x11, 0x02 }, /* start tune */ - { 0, 0 } -}; - -/* ------------------------------------------------------------------------- */ - -struct mxl5007t_state { - struct list_head hybrid_tuner_instance_list; - struct tuner_i2c_props i2c_props; - - struct mutex lock; - - struct mxl5007t_config *config; - - enum mxl5007t_chip_version chip_id; - - struct reg_pair_t tab_init[ARRAY_SIZE(init_tab)]; - struct reg_pair_t tab_init_cable[ARRAY_SIZE(init_tab_cable)]; - struct reg_pair_t tab_rftune[ARRAY_SIZE(reg_pair_rftune)]; - - u32 frequency; - u32 bandwidth; -}; - -/* ------------------------------------------------------------------------- */ - -/* called by _init and _rftun to manipulate the register arrays */ - -static void set_reg_bits(struct reg_pair_t *reg_pair, u8 reg, u8 mask, u8 val) -{ - unsigned int i = 0; - - while (reg_pair[i].reg || reg_pair[i].val) { - if (reg_pair[i].reg == reg) { - reg_pair[i].val &= ~mask; - reg_pair[i].val |= val; - } - i++; - - } - return; -} - -static void copy_reg_bits(struct reg_pair_t *reg_pair1, - struct reg_pair_t *reg_pair2) -{ - unsigned int i, j; - - i = j = 0; - - while (reg_pair1[i].reg || reg_pair1[i].val) { - while (reg_pair2[j].reg || reg_pair2[j].reg) { - if (reg_pair1[i].reg != reg_pair2[j].reg) { - j++; - continue; - } - reg_pair2[j].val = reg_pair1[i].val; - break; - } - i++; - } - return; -} - -/* ------------------------------------------------------------------------- */ - -static void mxl5007t_set_mode_bits(struct mxl5007t_state *state, - enum mxl5007t_mode mode, - s32 if_diff_out_level) -{ - switch (mode) { - case MxL_MODE_OTA_DVBT_ATSC: - set_reg_bits(state->tab_init, 0x32, 0x0f, 0x06); - set_reg_bits(state->tab_init, 0x35, 0xff, 0x0e); - break; - case MxL_MODE_OTA_ISDBT: - set_reg_bits(state->tab_init, 0x32, 0x0f, 0x06); - set_reg_bits(state->tab_init, 0x35, 0xff, 0x12); - break; - case MxL_MODE_OTA_NTSC_PAL_GH: - set_reg_bits(state->tab_init, 0x16, 0x70, 0x00); - set_reg_bits(state->tab_init, 0x32, 0xff, 0x85); - break; - case MxL_MODE_OTA_PAL_IB: - set_reg_bits(state->tab_init, 0x16, 0x70, 0x10); - set_reg_bits(state->tab_init, 0x32, 0xff, 0x85); - break; - case MxL_MODE_OTA_PAL_D_SECAM_KL: - set_reg_bits(state->tab_init, 0x16, 0x70, 0x20); - set_reg_bits(state->tab_init, 0x32, 0xff, 0x85); - break; - case MxL_MODE_CABLE_DIGITAL: - set_reg_bits(state->tab_init_cable, 0x71, 0xff, 0x01); - set_reg_bits(state->tab_init_cable, 0x72, 0xff, - 8 - if_diff_out_level); - set_reg_bits(state->tab_init_cable, 0x74, 0xff, 0x17); - break; - case MxL_MODE_CABLE_NTSC_PAL_GH: - set_reg_bits(state->tab_init, 0x16, 0x70, 0x00); - set_reg_bits(state->tab_init, 0x32, 0xff, 0x85); - set_reg_bits(state->tab_init_cable, 0x71, 0xff, 0x01); - set_reg_bits(state->tab_init_cable, 0x72, 0xff, - 8 - if_diff_out_level); - set_reg_bits(state->tab_init_cable, 0x74, 0xff, 0x17); - break; - case MxL_MODE_CABLE_PAL_IB: - set_reg_bits(state->tab_init, 0x16, 0x70, 0x10); - set_reg_bits(state->tab_init, 0x32, 0xff, 0x85); - set_reg_bits(state->tab_init_cable, 0x71, 0xff, 0x01); - set_reg_bits(state->tab_init_cable, 0x72, 0xff, - 8 - if_diff_out_level); - set_reg_bits(state->tab_init_cable, 0x74, 0xff, 0x17); - break; - case MxL_MODE_CABLE_PAL_D_SECAM_KL: - set_reg_bits(state->tab_init, 0x16, 0x70, 0x20); - set_reg_bits(state->tab_init, 0x32, 0xff, 0x85); - set_reg_bits(state->tab_init_cable, 0x71, 0xff, 0x01); - set_reg_bits(state->tab_init_cable, 0x72, 0xff, - 8 - if_diff_out_level); - set_reg_bits(state->tab_init_cable, 0x74, 0xff, 0x17); - break; - case MxL_MODE_CABLE_SCTE40: - set_reg_bits(state->tab_init_cable, 0x36, 0xff, 0x08); - set_reg_bits(state->tab_init_cable, 0x68, 0xff, 0xbc); - set_reg_bits(state->tab_init_cable, 0x71, 0xff, 0x01); - set_reg_bits(state->tab_init_cable, 0x72, 0xff, - 8 - if_diff_out_level); - set_reg_bits(state->tab_init_cable, 0x74, 0xff, 0x17); - break; - default: - mxl_fail(-EINVAL); - } - return; -} - -static void mxl5007t_set_if_freq_bits(struct mxl5007t_state *state, - enum mxl5007t_if_freq if_freq, - int invert_if) -{ - u8 val; - - switch (if_freq) { - case MxL_IF_4_MHZ: - val = 0x00; - break; - case MxL_IF_4_5_MHZ: - val = 0x20; - break; - case MxL_IF_4_57_MHZ: - val = 0x30; - break; - case MxL_IF_5_MHZ: - val = 0x40; - break; - case MxL_IF_5_38_MHZ: - val = 0x50; - break; - case MxL_IF_6_MHZ: - val = 0x60; - break; - case MxL_IF_6_28_MHZ: - val = 0x70; - break; - case MxL_IF_9_1915_MHZ: - val = 0x80; - break; - case MxL_IF_35_25_MHZ: - val = 0x90; - break; - case MxL_IF_36_15_MHZ: - val = 0xa0; - break; - case MxL_IF_44_MHZ: - val = 0xb0; - break; - default: - mxl_fail(-EINVAL); - return; - } - set_reg_bits(state->tab_init, 0x0c, 0xf0, val); - - /* set inverted IF or normal IF */ - set_reg_bits(state->tab_init, 0x0c, 0x08, invert_if ? 0x08 : 0x00); - - return; -} - -static void mxl5007t_set_xtal_freq_bits(struct mxl5007t_state *state, - enum mxl5007t_xtal_freq xtal_freq) -{ - u8 val; - - switch (xtal_freq) { - case MxL_XTAL_16_MHZ: - val = 0x00; /* select xtal freq & Ref Freq */ - break; - case MxL_XTAL_20_MHZ: - val = 0x11; - break; - case MxL_XTAL_20_25_MHZ: - val = 0x22; - break; - case MxL_XTAL_20_48_MHZ: - val = 0x33; - break; - case MxL_XTAL_24_MHZ: - val = 0x44; - break; - case MxL_XTAL_25_MHZ: - val = 0x55; - break; - case MxL_XTAL_25_14_MHZ: - val = 0x66; - break; - case MxL_XTAL_27_MHZ: - val = 0x77; - break; - case MxL_XTAL_28_8_MHZ: - val = 0x88; - break; - case MxL_XTAL_32_MHZ: - val = 0x99; - break; - case MxL_XTAL_40_MHZ: - val = 0xaa; - break; - case MxL_XTAL_44_MHZ: - val = 0xbb; - break; - case MxL_XTAL_48_MHZ: - val = 0xcc; - break; - case MxL_XTAL_49_3811_MHZ: - val = 0xdd; - break; - default: - mxl_fail(-EINVAL); - return; - } - set_reg_bits(state->tab_init, 0x0b, 0xff, val); - - return; -} - -static struct reg_pair_t *mxl5007t_calc_init_regs(struct mxl5007t_state *state, - enum mxl5007t_mode mode) -{ - struct mxl5007t_config *cfg = state->config; - - memcpy(&state->tab_init, &init_tab, sizeof(init_tab)); - memcpy(&state->tab_init_cable, &init_tab_cable, sizeof(init_tab_cable)); - - mxl5007t_set_mode_bits(state, mode, cfg->if_diff_out_level); - mxl5007t_set_if_freq_bits(state, cfg->if_freq_hz, cfg->invert_if); - mxl5007t_set_xtal_freq_bits(state, cfg->xtal_freq_hz); - - set_reg_bits(state->tab_init, 0x10, 0x40, cfg->loop_thru_enable << 6); - - set_reg_bits(state->tab_init, 0xd8, 0x08, cfg->clk_out_enable << 3); - - set_reg_bits(state->tab_init, 0x10, 0x07, cfg->clk_out_amp); - - /* set IDAC to automatic mode control by AGC */ - set_reg_bits(state->tab_init, 0x12, 0x80, 0x00); - - if (mode >= MxL_MODE_CABLE_DIGITAL) { - copy_reg_bits(state->tab_init, state->tab_init_cable); - return state->tab_init_cable; - } else - return state->tab_init; -} - -/* ------------------------------------------------------------------------- */ - -enum mxl5007t_bw_mhz { - MxL_BW_6MHz = 6, - MxL_BW_7MHz = 7, - MxL_BW_8MHz = 8, -}; - -static void mxl5007t_set_bw_bits(struct mxl5007t_state *state, - enum mxl5007t_bw_mhz bw) -{ - u8 val; - - switch (bw) { - case MxL_BW_6MHz: - val = 0x15; /* set DIG_MODEINDEX, DIG_MODEINDEX_A, - * and DIG_MODEINDEX_CSF */ - break; - case MxL_BW_7MHz: - val = 0x21; - break; - case MxL_BW_8MHz: - val = 0x3f; - break; - default: - mxl_fail(-EINVAL); - return; - } - set_reg_bits(state->tab_rftune, 0x13, 0x3f, val); - - return; -} - -static struct -reg_pair_t *mxl5007t_calc_rf_tune_regs(struct mxl5007t_state *state, - u32 rf_freq, enum mxl5007t_bw_mhz bw) -{ - u32 dig_rf_freq = 0; - u32 temp; - u32 frac_divider = 1000000; - unsigned int i; - - memcpy(&state->tab_rftune, ®_pair_rftune, sizeof(reg_pair_rftune)); - - mxl5007t_set_bw_bits(state, bw); - - /* Convert RF frequency into 16 bits => - * 10 bit integer (MHz) + 6 bit fraction */ - dig_rf_freq = rf_freq / MHz; - - temp = rf_freq % MHz; - - for (i = 0; i < 6; i++) { - dig_rf_freq <<= 1; - frac_divider /= 2; - if (temp > frac_divider) { - temp -= frac_divider; - dig_rf_freq++; - } - } - - /* add to have shift center point by 7.8124 kHz */ - if (temp > 7812) - dig_rf_freq++; - - set_reg_bits(state->tab_rftune, 0x14, 0xff, (u8)dig_rf_freq); - set_reg_bits(state->tab_rftune, 0x15, 0xff, (u8)(dig_rf_freq >> 8)); - - return state->tab_rftune; -} - -/* ------------------------------------------------------------------------- */ - -static int mxl5007t_write_reg(struct mxl5007t_state *state, u8 reg, u8 val) -{ - u8 buf[] = { reg, val }; - struct i2c_msg msg = { .addr = state->i2c_props.addr, .flags = 0, - .buf = buf, .len = 2 }; - int ret; - - ret = i2c_transfer(state->i2c_props.adap, &msg, 1); - if (ret != 1) { - mxl_err("failed!"); - return -EREMOTEIO; - } - return 0; -} - -static int mxl5007t_write_regs(struct mxl5007t_state *state, - struct reg_pair_t *reg_pair) -{ - unsigned int i = 0; - int ret = 0; - - while ((ret == 0) && (reg_pair[i].reg || reg_pair[i].val)) { - ret = mxl5007t_write_reg(state, - reg_pair[i].reg, reg_pair[i].val); - i++; - } - return ret; -} - -static int mxl5007t_read_reg(struct mxl5007t_state *state, u8 reg, u8 *val) -{ - struct i2c_msg msg[] = { - { .addr = state->i2c_props.addr, .flags = 0, - .buf = ®, .len = 1 }, - { .addr = state->i2c_props.addr, .flags = I2C_M_RD, - .buf = val, .len = 1 }, - }; - int ret; - - ret = i2c_transfer(state->i2c_props.adap, msg, 2); - if (ret != 2) { - mxl_err("failed!"); - return -EREMOTEIO; - } - return 0; -} - -static int mxl5007t_soft_reset(struct mxl5007t_state *state) -{ - u8 d = 0xff; - struct i2c_msg msg = { .addr = state->i2c_props.addr, .flags = 0, - .buf = &d, .len = 1 }; - - int ret = i2c_transfer(state->i2c_props.adap, &msg, 1); - - if (ret != 1) { - mxl_err("failed!"); - return -EREMOTEIO; - } - return 0; -} - -static int mxl5007t_tuner_init(struct mxl5007t_state *state, - enum mxl5007t_mode mode) -{ - struct reg_pair_t *init_regs; - int ret; - - ret = mxl5007t_soft_reset(state); - if (mxl_fail(ret)) - goto fail; - - /* calculate initialization reg array */ - init_regs = mxl5007t_calc_init_regs(state, mode); - - ret = mxl5007t_write_regs(state, init_regs); - if (mxl_fail(ret)) - goto fail; - mdelay(1); - - ret = mxl5007t_write_reg(state, 0x2c, 0x35); - mxl_fail(ret); -fail: - return ret; -} - -static int mxl5007t_tuner_rf_tune(struct mxl5007t_state *state, u32 rf_freq_hz, - enum mxl5007t_bw_mhz bw) -{ - struct reg_pair_t *rf_tune_regs; - int ret; - - /* calculate channel change reg array */ - rf_tune_regs = mxl5007t_calc_rf_tune_regs(state, rf_freq_hz, bw); - - ret = mxl5007t_write_regs(state, rf_tune_regs); - if (mxl_fail(ret)) - goto fail; - msleep(3); -fail: - return ret; -} - -/* ------------------------------------------------------------------------- */ - -static int mxl5007t_synth_lock_status(struct mxl5007t_state *state, - int *rf_locked, int *ref_locked) -{ - u8 d; - int ret; - - *rf_locked = 0; - *ref_locked = 0; - - ret = mxl5007t_read_reg(state, 0xcf, &d); - if (mxl_fail(ret)) - goto fail; - - if ((d & 0x0c) == 0x0c) - *rf_locked = 1; - - if ((d & 0x03) == 0x03) - *ref_locked = 1; -fail: - return ret; -} - -static int mxl5007t_check_rf_input_power(struct mxl5007t_state *state, - s32 *rf_input_level) -{ - u8 d1, d2; - int ret; - - ret = mxl5007t_read_reg(state, 0xb7, &d1); - if (mxl_fail(ret)) - goto fail; - - ret = mxl5007t_read_reg(state, 0xbf, &d2); - if (mxl_fail(ret)) - goto fail; - - d2 = d2 >> 4; - if (d2 > 7) - d2 += 0xf0; - - *rf_input_level = (s32)(d1 + d2 - 113); -fail: - return ret; -} - -/* ------------------------------------------------------------------------- */ - -static int mxl5007t_get_status(struct dvb_frontend *fe, u32 *status) -{ - struct mxl5007t_state *state = fe->tuner_priv; - int rf_locked, ref_locked; - s32 rf_input_level; - int ret; - - if (fe->ops.i2c_gate_ctrl) - fe->ops.i2c_gate_ctrl(fe, 1); - - ret = mxl5007t_synth_lock_status(state, &rf_locked, &ref_locked); - if (mxl_fail(ret)) - goto fail; - mxl_debug("%s%s", rf_locked ? "rf locked " : "", - ref_locked ? "ref locked" : ""); - - ret = mxl5007t_check_rf_input_power(state, &rf_input_level); - if (mxl_fail(ret)) - goto fail; - mxl_debug("rf input power: %d", rf_input_level); -fail: - if (fe->ops.i2c_gate_ctrl) - fe->ops.i2c_gate_ctrl(fe, 0); - - return ret; -} - -/* ------------------------------------------------------------------------- */ - -static int mxl5007t_set_params(struct dvb_frontend *fe, - struct dvb_frontend_parameters *params) -{ - struct mxl5007t_state *state = fe->tuner_priv; - enum mxl5007t_bw_mhz bw; - enum mxl5007t_mode mode; - int ret; - u32 freq = params->frequency; - - if (fe->ops.info.type == FE_ATSC) { - switch (params->u.vsb.modulation) { - case VSB_8: - case VSB_16: - mode = MxL_MODE_OTA_DVBT_ATSC; - break; - case QAM_64: - case QAM_256: - mode = MxL_MODE_CABLE_DIGITAL; - break; - default: - mxl_err("modulation not set!"); - return -EINVAL; - } - bw = MxL_BW_6MHz; - } else if (fe->ops.info.type == FE_OFDM) { - switch (params->u.ofdm.bandwidth) { - case BANDWIDTH_6_MHZ: - bw = MxL_BW_6MHz; - break; - case BANDWIDTH_7_MHZ: - bw = MxL_BW_7MHz; - break; - case BANDWIDTH_8_MHZ: - bw = MxL_BW_8MHz; - break; - default: - mxl_err("bandwidth not set!"); - return -EINVAL; - } - mode = MxL_MODE_OTA_DVBT_ATSC; - } else { - mxl_err("modulation type not supported!"); - return -EINVAL; - } - - if (fe->ops.i2c_gate_ctrl) - fe->ops.i2c_gate_ctrl(fe, 1); - - mutex_lock(&state->lock); - - ret = mxl5007t_tuner_init(state, mode); - if (mxl_fail(ret)) - goto fail; - - ret = mxl5007t_tuner_rf_tune(state, freq, bw); - if (mxl_fail(ret)) - goto fail; - - state->frequency = freq; - state->bandwidth = (fe->ops.info.type == FE_OFDM) ? - params->u.ofdm.bandwidth : 0; -fail: - mutex_unlock(&state->lock); - - if (fe->ops.i2c_gate_ctrl) - fe->ops.i2c_gate_ctrl(fe, 0); - - return ret; -} - -static int mxl5007t_set_analog_params(struct dvb_frontend *fe, - struct analog_parameters *params) -{ - struct mxl5007t_state *state = fe->tuner_priv; - enum mxl5007t_bw_mhz bw = 0; /* FIXME */ - enum mxl5007t_mode cbl_mode; - enum mxl5007t_mode ota_mode; - char *mode_name; - int ret; - u32 freq = params->frequency * 62500; - -#define cable 1 - if (params->std & V4L2_STD_MN) { - cbl_mode = MxL_MODE_CABLE_NTSC_PAL_GH; - ota_mode = MxL_MODE_OTA_NTSC_PAL_GH; - mode_name = "MN"; - } else if (params->std & V4L2_STD_B) { - cbl_mode = MxL_MODE_CABLE_PAL_IB; - ota_mode = MxL_MODE_OTA_PAL_IB; - mode_name = "B"; - } else if (params->std & V4L2_STD_GH) { - cbl_mode = MxL_MODE_CABLE_NTSC_PAL_GH; - ota_mode = MxL_MODE_OTA_NTSC_PAL_GH; - mode_name = "GH"; - } else if (params->std & V4L2_STD_PAL_I) { - cbl_mode = MxL_MODE_CABLE_PAL_IB; - ota_mode = MxL_MODE_OTA_PAL_IB; - mode_name = "I"; - } else if (params->std & V4L2_STD_DK) { - cbl_mode = MxL_MODE_CABLE_PAL_D_SECAM_KL; - ota_mode = MxL_MODE_OTA_PAL_D_SECAM_KL; - mode_name = "DK"; - } else if (params->std & V4L2_STD_SECAM_L) { - cbl_mode = MxL_MODE_CABLE_PAL_D_SECAM_KL; - ota_mode = MxL_MODE_OTA_PAL_D_SECAM_KL; - mode_name = "L"; - } else if (params->std & V4L2_STD_SECAM_LC) { - cbl_mode = MxL_MODE_CABLE_PAL_D_SECAM_KL; - ota_mode = MxL_MODE_OTA_PAL_D_SECAM_KL; - mode_name = "L'"; - } else { - mode_name = "xx"; - /* FIXME */ - cbl_mode = MxL_MODE_CABLE_NTSC_PAL_GH; - ota_mode = MxL_MODE_OTA_NTSC_PAL_GH; - } - mxl_debug("setting mxl5007 to system %s", mode_name); - - if (fe->ops.i2c_gate_ctrl) - fe->ops.i2c_gate_ctrl(fe, 1); - - mutex_lock(&state->lock); - - ret = mxl5007t_tuner_init(state, cable ? cbl_mode : ota_mode); - if (mxl_fail(ret)) - goto fail; - - ret = mxl5007t_tuner_rf_tune(state, freq, bw); - if (mxl_fail(ret)) - goto fail; - - state->frequency = freq; - state->bandwidth = 0; -fail: - mutex_unlock(&state->lock); - - if (fe->ops.i2c_gate_ctrl) - fe->ops.i2c_gate_ctrl(fe, 0); - - return ret; -} - -/* ------------------------------------------------------------------------- */ - -static int mxl5007t_init(struct dvb_frontend *fe) -{ - struct mxl5007t_state *state = fe->tuner_priv; - int ret; - u8 d; - - if (fe->ops.i2c_gate_ctrl) - fe->ops.i2c_gate_ctrl(fe, 1); - - ret = mxl5007t_read_reg(state, 0x05, &d); - if (mxl_fail(ret)) - goto fail; - - ret = mxl5007t_write_reg(state, 0x05, d | 0x01); - mxl_fail(ret); -fail: - if (fe->ops.i2c_gate_ctrl) - fe->ops.i2c_gate_ctrl(fe, 0); - - return ret; -} - -static int mxl5007t_sleep(struct dvb_frontend *fe) -{ - struct mxl5007t_state *state = fe->tuner_priv; - int ret; - u8 d; - - if (fe->ops.i2c_gate_ctrl) - fe->ops.i2c_gate_ctrl(fe, 1); - - ret = mxl5007t_read_reg(state, 0x05, &d); - if (mxl_fail(ret)) - goto fail; - - ret = mxl5007t_write_reg(state, 0x05, d & ~0x01); - mxl_fail(ret); -fail: - if (fe->ops.i2c_gate_ctrl) - fe->ops.i2c_gate_ctrl(fe, 0); - - return ret; -} - -/* ------------------------------------------------------------------------- */ - -static int mxl5007t_get_frequency(struct dvb_frontend *fe, u32 *frequency) -{ - struct mxl5007t_state *state = fe->tuner_priv; - *frequency = state->frequency; - return 0; -} - -static int mxl5007t_get_bandwidth(struct dvb_frontend *fe, u32 *bandwidth) -{ - struct mxl5007t_state *state = fe->tuner_priv; - *bandwidth = state->bandwidth; - return 0; -} - -static int mxl5007t_release(struct dvb_frontend *fe) -{ - struct mxl5007t_state *state = fe->tuner_priv; - - mutex_lock(&mxl5007t_list_mutex); - - if (state) - hybrid_tuner_release_state(state); - - mutex_unlock(&mxl5007t_list_mutex); - - fe->tuner_priv = NULL; - - return 0; -} - -/* ------------------------------------------------------------------------- */ - -static struct dvb_tuner_ops mxl5007t_tuner_ops = { - .info = { - .name = "MaxLinear MxL5007T", - }, - .init = mxl5007t_init, - .sleep = mxl5007t_sleep, - .set_params = mxl5007t_set_params, - .set_analog_params = mxl5007t_set_analog_params, - .get_status = mxl5007t_get_status, - .get_frequency = mxl5007t_get_frequency, - .get_bandwidth = mxl5007t_get_bandwidth, - .release = mxl5007t_release, -}; - -static int mxl5007t_get_chip_id(struct mxl5007t_state *state) -{ - char *name; - int ret; - u8 id; - - ret = mxl5007t_read_reg(state, 0xd3, &id); - if (mxl_fail(ret)) - goto fail; - - switch (id) { - case MxL_5007_V1_F1: - name = "MxL5007.v1.f1"; - break; - case MxL_5007_V1_F2: - name = "MxL5007.v1.f2"; - break; - case MxL_5007_V2_100_F1: - name = "MxL5007.v2.100.f1"; - break; - case MxL_5007_V2_100_F2: - name = "MxL5007.v2.100.f2"; - break; - case MxL_5007_V2_200_F1: - name = "MxL5007.v2.200.f1"; - break; - case MxL_5007_V2_200_F2: - name = "MxL5007.v2.200.f2"; - break; - default: - name = "MxL5007T"; - id = MxL_UNKNOWN_ID; - } - state->chip_id = id; - mxl_info("%s detected @ %d-%04x", name, - i2c_adapter_id(state->i2c_props.adap), - state->i2c_props.addr); - return 0; -fail: - mxl_warn("unable to identify device @ %d-%04x", - i2c_adapter_id(state->i2c_props.adap), - state->i2c_props.addr); - - state->chip_id = MxL_UNKNOWN_ID; - return ret; -} - -struct dvb_frontend *mxl5007t_attach(struct dvb_frontend *fe, - struct i2c_adapter *i2c, u8 addr, - struct mxl5007t_config *cfg) -{ - struct mxl5007t_state *state = NULL; - int instance, ret; - - mutex_lock(&mxl5007t_list_mutex); - instance = hybrid_tuner_request_state(struct mxl5007t_state, state, - hybrid_tuner_instance_list, - i2c, addr, "mxl5007"); - switch (instance) { - case 0: - goto fail; - break; - case 1: - /* new tuner instance */ - state->config = cfg; - - mutex_init(&state->lock); - - if (fe->ops.i2c_gate_ctrl) - fe->ops.i2c_gate_ctrl(fe, 1); - - ret = mxl5007t_get_chip_id(state); - - if (fe->ops.i2c_gate_ctrl) - fe->ops.i2c_gate_ctrl(fe, 0); - - /* check return value of mxl5007t_get_chip_id */ - if (mxl_fail(ret)) - goto fail; - break; - default: - /* existing tuner instance */ - break; - } - fe->tuner_priv = state; - mutex_unlock(&mxl5007t_list_mutex); - - memcpy(&fe->ops.tuner_ops, &mxl5007t_tuner_ops, - sizeof(struct dvb_tuner_ops)); - - return fe; -fail: - mutex_unlock(&mxl5007t_list_mutex); - - mxl5007t_release(fe); - return NULL; -} -EXPORT_SYMBOL_GPL(mxl5007t_attach); -MODULE_DESCRIPTION("MaxLinear MxL5007T Silicon IC tuner driver"); -MODULE_AUTHOR("Michael Krufky "); -MODULE_LICENSE("GPL"); -MODULE_VERSION("0.1"); - -/* - * Overrides for Emacs so that we follow Linus's tabbing style. - * --------------------------------------------------------------------------- - * Local variables: - * c-basic-offset: 8 - * End: - */ diff --git a/trunk/drivers/media/common/tuners/mxl5007t.h b/trunk/drivers/media/common/tuners/mxl5007t.h deleted file mode 100644 index aa3eea0b5262..000000000000 --- a/trunk/drivers/media/common/tuners/mxl5007t.h +++ /dev/null @@ -1,104 +0,0 @@ -/* - * mxl5007t.h - driver for the MaxLinear MxL5007T silicon tuner - * - * Copyright (C) 2008 Michael Krufky - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 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 General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#ifndef __MXL5007T_H__ -#define __MXL5007T_H__ - -#include "dvb_frontend.h" - -/* ------------------------------------------------------------------------- */ - -enum mxl5007t_if_freq { - MxL_IF_4_MHZ, /* 4000000 */ - MxL_IF_4_5_MHZ, /* 4500000 */ - MxL_IF_4_57_MHZ, /* 4570000 */ - MxL_IF_5_MHZ, /* 5000000 */ - MxL_IF_5_38_MHZ, /* 5380000 */ - MxL_IF_6_MHZ, /* 6000000 */ - MxL_IF_6_28_MHZ, /* 6280000 */ - MxL_IF_9_1915_MHZ, /* 9191500 */ - MxL_IF_35_25_MHZ, /* 35250000 */ - MxL_IF_36_15_MHZ, /* 36150000 */ - MxL_IF_44_MHZ, /* 44000000 */ -}; - -enum mxl5007t_xtal_freq { - MxL_XTAL_16_MHZ, /* 16000000 */ - MxL_XTAL_20_MHZ, /* 20000000 */ - MxL_XTAL_20_25_MHZ, /* 20250000 */ - MxL_XTAL_20_48_MHZ, /* 20480000 */ - MxL_XTAL_24_MHZ, /* 24000000 */ - MxL_XTAL_25_MHZ, /* 25000000 */ - MxL_XTAL_25_14_MHZ, /* 25140000 */ - MxL_XTAL_27_MHZ, /* 27000000 */ - MxL_XTAL_28_8_MHZ, /* 28800000 */ - MxL_XTAL_32_MHZ, /* 32000000 */ - MxL_XTAL_40_MHZ, /* 40000000 */ - MxL_XTAL_44_MHZ, /* 44000000 */ - MxL_XTAL_48_MHZ, /* 48000000 */ - MxL_XTAL_49_3811_MHZ, /* 49381100 */ -}; - -enum mxl5007t_clkout_amp { - MxL_CLKOUT_AMP_0_94V = 0, - MxL_CLKOUT_AMP_0_53V = 1, - MxL_CLKOUT_AMP_0_37V = 2, - MxL_CLKOUT_AMP_0_28V = 3, - MxL_CLKOUT_AMP_0_23V = 4, - MxL_CLKOUT_AMP_0_20V = 5, - MxL_CLKOUT_AMP_0_17V = 6, - MxL_CLKOUT_AMP_0_15V = 7, -}; - -struct mxl5007t_config { - s32 if_diff_out_level; - enum mxl5007t_clkout_amp clk_out_amp; - enum mxl5007t_xtal_freq xtal_freq_hz; - enum mxl5007t_if_freq if_freq_hz; - unsigned int invert_if:1; - unsigned int loop_thru_enable:1; - unsigned int clk_out_enable:1; -}; - -#if defined(CONFIG_MEDIA_TUNER_MXL5007T) || (defined(CONFIG_MEDIA_TUNER_MXL5007T_MODULE) && defined(MODULE)) -extern struct dvb_frontend *mxl5007t_attach(struct dvb_frontend *fe, - struct i2c_adapter *i2c, u8 addr, - struct mxl5007t_config *cfg); -#else -static inline struct dvb_frontend *mxl5007t_attach(struct dvb_frontend *fe, - struct i2c_adapter *i2c, - u8 addr, - struct mxl5007t_config *cfg) -{ - printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__); - return NULL; -} -#endif - -#endif /* __MXL5007T_H__ */ - -/* - * Overrides for Emacs so that we follow Linus's tabbing style. - * --------------------------------------------------------------------------- - * Local variables: - * c-basic-offset: 8 - * End: - */ - diff --git a/trunk/drivers/media/common/tuners/tda9887.c b/trunk/drivers/media/common/tuners/tda9887.c index 72abf0b73486..a0545ba957b0 100644 --- a/trunk/drivers/media/common/tuners/tda9887.c +++ b/trunk/drivers/media/common/tuners/tda9887.c @@ -6,7 +6,7 @@ #include #include #include -#include +#include #include #include #include "tuner-i2c.h" diff --git a/trunk/drivers/media/common/tuners/tuner-simple.c b/trunk/drivers/media/common/tuners/tuner-simple.c index 597e47f5d69c..266c255cf0d8 100644 --- a/trunk/drivers/media/common/tuners/tuner-simple.c +++ b/trunk/drivers/media/common/tuners/tuner-simple.c @@ -6,7 +6,7 @@ */ #include #include -#include +#include #include #include #include diff --git a/trunk/drivers/media/dvb/bt8xx/Kconfig b/trunk/drivers/media/dvb/bt8xx/Kconfig index 7e9c090fc04e..7588db1319d0 100644 --- a/trunk/drivers/media/dvb/bt8xx/Kconfig +++ b/trunk/drivers/media/dvb/bt8xx/Kconfig @@ -1,6 +1,7 @@ config DVB_BT8XX tristate "BT8xx based PCI cards" depends on DVB_CORE && PCI && I2C && VIDEO_BT848 + depends on HOTPLUG # due to FW_LOADER select DVB_MT352 if !DVB_FE_CUSTOMISE select DVB_SP887X if !DVB_FE_CUSTOMISE select DVB_NXT6000 if !DVB_FE_CUSTOMISE @@ -9,6 +10,7 @@ config DVB_BT8XX select DVB_LGDT330X if !DVB_FE_CUSTOMISE select DVB_ZL10353 if !DVB_FE_CUSTOMISE select MEDIA_TUNER_SIMPLE if !DVB_FE_CUSTOMISE + select FW_LOADER help Support for PCI cards based on the Bt8xx PCI bridge. Examples are the Nebula cards, the Pinnacle PCTV cards, the Twinhan DST cards, diff --git a/trunk/drivers/media/dvb/dvb-usb/Kconfig b/trunk/drivers/media/dvb/dvb-usb/Kconfig index e84152b7576d..a577c0f89f67 100644 --- a/trunk/drivers/media/dvb/dvb-usb/Kconfig +++ b/trunk/drivers/media/dvb/dvb-usb/Kconfig @@ -1,6 +1,8 @@ config DVB_USB tristate "Support for various USB DVB devices" depends on DVB_CORE && USB && I2C && INPUT + depends on HOTPLUG # due to FW_LOADER + select FW_LOADER help By enabling this you will be able to choose the various supported USB1.1 and USB2.0 DVB devices. @@ -244,14 +246,6 @@ config DVB_USB_AF9005_REMOTE Say Y here to support the default remote control decoding for the Afatech AF9005 based receiver. -config DVB_USB_DW2102 - tristate "DvbWorld 2102 DVB-S USB2.0 receiver" - depends on DVB_USB - select DVB_STV0299 if !DVB_FE_CUSTOMISE - select DVB_PLL if !DVB_FE_CUSTOMISE - help - Say Y here to support the DvbWorld 2102 DVB-S USB2.0 receiver. - config DVB_USB_ANYSEE tristate "Anysee DVB-T/C USB2.0 support" depends on DVB_USB diff --git a/trunk/drivers/media/dvb/dvb-usb/Makefile b/trunk/drivers/media/dvb/dvb-usb/Makefile index e206f1ea0027..44c11e45e564 100644 --- a/trunk/drivers/media/dvb/dvb-usb/Makefile +++ b/trunk/drivers/media/dvb/dvb-usb/Makefile @@ -64,9 +64,6 @@ obj-$(CONFIG_DVB_USB_AF9005_REMOTE) += dvb-usb-af9005-remote.o dvb-usb-anysee-objs = anysee.o obj-$(CONFIG_DVB_USB_ANYSEE) += dvb-usb-anysee.o -dvb-usb-dw2102-objs = dw2102.o -obj-$(CONFIG_DVB_USB_DW2102) += dvb-usb-dw2102.o - EXTRA_CFLAGS += -Idrivers/media/dvb/dvb-core/ -Idrivers/media/dvb/frontends/ # due to tuner-xc3028 EXTRA_CFLAGS += -Idrivers/media/common/tuners diff --git a/trunk/drivers/media/dvb/dvb-usb/anysee.c b/trunk/drivers/media/dvb/dvb-usb/anysee.c index 2f408d2e1ef3..adfd4fc82efd 100644 --- a/trunk/drivers/media/dvb/dvb-usb/anysee.c +++ b/trunk/drivers/media/dvb/dvb-usb/anysee.c @@ -43,7 +43,7 @@ module_param_named(debug, dvb_usb_anysee_debug, int, 0644); MODULE_PARM_DESC(debug, "set debugging level" DVB_USB_DEBUG_STATUS); DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr); -static struct mutex anysee_usb_mutex; +struct mutex anysee_usb_mutex; static int anysee_ctrl_msg(struct dvb_usb_device *d, u8 *sbuf, u8 slen, u8 *rbuf, u8 rlen) diff --git a/trunk/drivers/media/dvb/dvb-usb/dvb-usb-ids.h b/trunk/drivers/media/dvb/dvb-usb/dvb-usb-ids.h index 029b437caf9a..e5238b31e946 100644 --- a/trunk/drivers/media/dvb/dvb-usb/dvb-usb-ids.h +++ b/trunk/drivers/media/dvb/dvb-usb/dvb-usb-ids.h @@ -204,6 +204,5 @@ #define USB_PID_ASUS_U3000 0x171f #define USB_PID_ASUS_U3100 0x173f #define USB_PID_YUAN_EC372S 0x1edc -#define USB_PID_DW2102 0x2102 #endif diff --git a/trunk/drivers/media/dvb/dvb-usb/dw2102.c b/trunk/drivers/media/dvb/dvb-usb/dw2102.c deleted file mode 100644 index a4d898b44e55..000000000000 --- a/trunk/drivers/media/dvb/dvb-usb/dw2102.c +++ /dev/null @@ -1,425 +0,0 @@ -/* DVB USB framework compliant Linux driver for the DVBWorld DVB-S 2102 Card -* -* Copyright (C) 2008 Igor M. Liplianin (liplianin@me.by) -* -* This program is free software; you can redistribute it and/or modify it -* under the terms of the GNU General Public License as published by the -* Free Software Foundation, version 2. -* -* see Documentation/dvb/README.dvb-usb for more information -*/ -#include -#include "dw2102.h" -#include "stv0299.h" -#include "z0194a.h" - -#ifndef USB_PID_DW2102 -#define USB_PID_DW2102 0x2102 -#endif - -#define DW2102_READ_MSG 0 -#define DW2102_WRITE_MSG 1 - -#define REG_1F_SYMBOLRATE_BYTE0 0x1f -#define REG_20_SYMBOLRATE_BYTE1 0x20 -#define REG_21_SYMBOLRATE_BYTE2 0x21 - -#define DW2102_VOLTAGE_CTRL (0x1800) -#define DW2102_RC_QUERY (0x1a00) - -struct dw2102_state { - u32 last_key_pressed; -}; -struct dw2102_rc_keys { - u32 keycode; - u32 event; -}; - -DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr); - -static int dw2102_op_rw(struct usb_device *dev, u8 request, u16 value, - u8 *data, u16 len, int flags) -{ - int ret; - u8 u8buf[len]; - - unsigned int pipe = (flags == DW2102_READ_MSG) ? - usb_rcvctrlpipe(dev, 0) : usb_sndctrlpipe(dev, 0); - u8 request_type = (flags == DW2102_READ_MSG) ? USB_DIR_IN : USB_DIR_OUT; - - if (flags == DW2102_WRITE_MSG) - memcpy(u8buf, data, len); - ret = usb_control_msg(dev, pipe, request, - request_type | USB_TYPE_VENDOR, value, 0 , u8buf, len, 2000); - - if (flags == DW2102_READ_MSG) - memcpy(data, u8buf, len); - return ret; -} - -/* I2C */ - -static int dw2102_i2c_transfer(struct i2c_adapter *adap, struct i2c_msg msg[], - int num) -{ -struct dvb_usb_device *d = i2c_get_adapdata(adap); - int i = 0, ret = 0; - u8 buf6[] = {0x2c, 0x05, 0xc0, 0, 0, 0, 0}; - u8 request; - u16 value; - - if (!d) - return -ENODEV; - if (mutex_lock_interruptible(&d->i2c_mutex) < 0) - return -EAGAIN; - - switch (num) { - case 2: - /* read stv0299 register */ - request = 0xb5; - value = msg[0].buf[0];/* register */ - for (i = 0; i < msg[1].len; i++) { - value = value + i; - ret = dw2102_op_rw(d->udev, 0xb5, - value, buf6, 2, DW2102_READ_MSG); - msg[1].buf[i] = buf6[0]; - - } - break; - case 1: - switch (msg[0].addr) { - case 0x68: - /* write to stv0299 register */ - buf6[0] = 0x2a; - buf6[1] = msg[0].buf[0]; - buf6[2] = msg[0].buf[1]; - ret = dw2102_op_rw(d->udev, 0xb2, - 0, buf6, 3, DW2102_WRITE_MSG); - break; - case 0x60: - if (msg[0].flags == 0) { - /* write to tuner pll */ - buf6[0] = 0x2c; - buf6[1] = 5; - buf6[2] = 0xc0; - buf6[3] = msg[0].buf[0]; - buf6[4] = msg[0].buf[1]; - buf6[5] = msg[0].buf[2]; - buf6[6] = msg[0].buf[3]; - ret = dw2102_op_rw(d->udev, 0xb2, - 0, buf6, 7, DW2102_WRITE_MSG); - } else { - /* write to tuner pll */ - ret = dw2102_op_rw(d->udev, 0xb5, - 0, buf6, 1, DW2102_READ_MSG); - msg[0].buf[0] = buf6[0]; - } - break; - case (DW2102_RC_QUERY): - ret = dw2102_op_rw(d->udev, 0xb8, - 0, buf6, 2, DW2102_READ_MSG); - msg[0].buf[0] = buf6[0]; - msg[0].buf[1] = buf6[1]; - break; - case (DW2102_VOLTAGE_CTRL): - buf6[0] = 0x30; - buf6[1] = msg[0].buf[0]; - ret = dw2102_op_rw(d->udev, 0xb2, - 0, buf6, 2, DW2102_WRITE_MSG); - break; - } - - break; - } - - mutex_unlock(&d->i2c_mutex); - return num; -} - -static u32 dw2102_i2c_func(struct i2c_adapter *adapter) -{ - return I2C_FUNC_I2C; -} - -static struct i2c_algorithm dw2102_i2c_algo = { - .master_xfer = dw2102_i2c_transfer, - .functionality = dw2102_i2c_func, -}; - -static int dw2102_set_voltage(struct dvb_frontend *fe, fe_sec_voltage_t voltage) -{ - static u8 command_13v[1] = {0x00}; - static u8 command_18v[1] = {0x01}; - struct i2c_msg msg[] = { - {.addr = DW2102_VOLTAGE_CTRL, .flags = 0, - .buf = command_13v, .len = 1}, - }; - - struct dvb_usb_adapter *udev_adap = - (struct dvb_usb_adapter *)(fe->dvb->priv); - if (voltage == SEC_VOLTAGE_18) - msg[0].buf = command_18v; - i2c_transfer(&udev_adap->dev->i2c_adap, msg, 1); - return 0; -} - -static int dw2102_frontend_attach(struct dvb_usb_adapter *d) -{ - d->fe = dvb_attach(stv0299_attach, &sharp_z0194a_config, - &d->dev->i2c_adap); - if (d->fe != NULL) { - d->fe->ops.set_voltage = dw2102_set_voltage; - info("Attached stv0299!\n"); - return 0; - } - return -EIO; -} - -static int dw2102_tuner_attach(struct dvb_usb_adapter *adap) -{ - dvb_attach(dvb_pll_attach, adap->fe, 0x60, - &adap->dev->i2c_adap, DVB_PLL_OPERA1); - return 0; -} - -static struct dvb_usb_rc_key dw2102_rc_keys[] = { - { 0xf8, 0x0a, KEY_Q }, /*power*/ - { 0xf8, 0x0c, KEY_M }, /*mute*/ - { 0xf8, 0x11, KEY_1 }, - { 0xf8, 0x12, KEY_2 }, - { 0xf8, 0x13, KEY_3 }, - { 0xf8, 0x14, KEY_4 }, - { 0xf8, 0x15, KEY_5 }, - { 0xf8, 0x16, KEY_6 }, - { 0xf8, 0x17, KEY_7 }, - { 0xf8, 0x18, KEY_8 }, - { 0xf8, 0x19, KEY_9 }, - { 0xf8, 0x10, KEY_0 }, - { 0xf8, 0x1c, KEY_PAGEUP }, /*ch+*/ - { 0xf8, 0x0f, KEY_PAGEDOWN }, /*ch-*/ - { 0xf8, 0x1a, KEY_O }, /*vol+*/ - { 0xf8, 0x0e, KEY_Z }, /*vol-*/ - { 0xf8, 0x04, KEY_R }, /*rec*/ - { 0xf8, 0x09, KEY_D }, /*fav*/ - { 0xf8, 0x08, KEY_BACKSPACE }, /*rewind*/ - { 0xf8, 0x07, KEY_A }, /*fast*/ - { 0xf8, 0x0b, KEY_P }, /*pause*/ - { 0xf8, 0x02, KEY_ESC }, /*cancel*/ - { 0xf8, 0x03, KEY_G }, /*tab*/ - { 0xf8, 0x00, KEY_UP }, /*up*/ - { 0xf8, 0x1f, KEY_ENTER }, /*ok*/ - { 0xf8, 0x01, KEY_DOWN }, /*down*/ - { 0xf8, 0x05, KEY_C }, /*cap*/ - { 0xf8, 0x06, KEY_S }, /*stop*/ - { 0xf8, 0x40, KEY_F }, /*full*/ - { 0xf8, 0x1e, KEY_W }, /*tvmode*/ - { 0xf8, 0x1b, KEY_B }, /*recall*/ - -}; - - - -static int dw2102_rc_query(struct dvb_usb_device *d, u32 *event, int *state) -{ - struct dw2102_state *st = d->priv; - u8 key[2]; - struct i2c_msg msg[] = { - {.addr = DW2102_RC_QUERY, .flags = I2C_M_RD, .buf = key, - .len = 2}, - }; - int i; - - *state = REMOTE_NO_KEY_PRESSED; - if (dw2102_i2c_transfer(&d->i2c_adap, msg, 1) == 1) { - for (i = 0; i < ARRAY_SIZE(dw2102_rc_keys); i++) { - if (dw2102_rc_keys[i].data == msg[0].buf[0]) { - *state = REMOTE_KEY_PRESSED; - *event = dw2102_rc_keys[i].event; - st->last_key_pressed = - dw2102_rc_keys[i].event; - break; - } - st->last_key_pressed = 0; - } - } - /* info("key: %x %x\n",key[0],key[1]); */ - return 0; -} - -static struct usb_device_id dw2102_table[] = { - {USB_DEVICE(USB_VID_CYPRESS, USB_PID_DW2102)}, - {USB_DEVICE(USB_VID_CYPRESS, 0x2101)}, - { } -}; - -MODULE_DEVICE_TABLE(usb, dw2102_table); - -static int dw2102_load_firmware(struct usb_device *dev, - const struct firmware *frmwr) -{ - u8 *b, *p; - int ret = 0, i; - u8 reset; - u8 reset16 [] = {0, 0, 0, 0, 0, 0, 0}; - const struct firmware *fw; - const char *filename = "dvb-usb-dw2101.fw"; - switch (dev->descriptor.idProduct) { - case 0x2101: - ret = request_firmware(&fw, filename, &dev->dev); - if (ret != 0) { - err("did not find the firmware file. (%s) " - "Please see linux/Documentation/dvb/ for more details " - "on firmware-problems.", filename); - return ret; - } - break; - case USB_PID_DW2102: - fw = frmwr; - break; - } - info("start downloading DW2102 firmware"); - p = kmalloc(fw->size, GFP_KERNEL); - reset = 1; - /*stop the CPU*/ - dw2102_op_rw(dev, 0xa0, 0x7f92, &reset, 1, DW2102_WRITE_MSG); - dw2102_op_rw(dev, 0xa0, 0xe600, &reset, 1, DW2102_WRITE_MSG); - - if (p != NULL) { - memcpy(p, fw->data, fw->size); - for (i = 0; i < fw->size; i += 0x40) { - b = (u8 *) p + i; - if (dw2102_op_rw - (dev, 0xa0, i, b , 0x40, - DW2102_WRITE_MSG) != 0x40 - ) { - err("error while transferring firmware"); - ret = -EINVAL; - break; - } - } - /* restart the CPU */ - reset = 0; - if (ret || dw2102_op_rw - (dev, 0xa0, 0x7f92, &reset, 1, - DW2102_WRITE_MSG) != 1) { - err("could not restart the USB controller CPU."); - ret = -EINVAL; - } - if (ret || dw2102_op_rw - (dev, 0xa0, 0xe600, &reset, 1, - DW2102_WRITE_MSG) != 1) { - err("could not restart the USB controller CPU."); - ret = -EINVAL; - } - /* init registers */ - switch (dev->descriptor.idProduct) { - case USB_PID_DW2102: - dw2102_op_rw - (dev, 0xbf, 0x0040, &reset, 0, - DW2102_WRITE_MSG); - dw2102_op_rw - (dev, 0xb9, 0x0000, &reset16[0], 2, - DW2102_READ_MSG); - break; - case 0x2101: - dw2102_op_rw - (dev, 0xbc, 0x0030, &reset16[0], 2, - DW2102_READ_MSG); - dw2102_op_rw - (dev, 0xba, 0x0000, &reset16[0], 7, - DW2102_READ_MSG); - dw2102_op_rw - (dev, 0xba, 0x0000, &reset16[0], 7, - DW2102_READ_MSG); - dw2102_op_rw - (dev, 0xb9, 0x0000, &reset16[0], 2, - DW2102_READ_MSG); - break; - } - kfree(p); - } - return ret; -} - -static struct dvb_usb_device_properties dw2102_properties = { - .caps = DVB_USB_IS_AN_I2C_ADAPTER, - .usb_ctrl = DEVICE_SPECIFIC, - .firmware = "dvb-usb-dw2102.fw", - .size_of_priv = sizeof(struct dw2102_state), - .no_reconnect = 1, - - .i2c_algo = &dw2102_i2c_algo, - .rc_key_map = dw2102_rc_keys, - .rc_key_map_size = ARRAY_SIZE(dw2102_rc_keys), - .rc_interval = 150, - .rc_query = dw2102_rc_query, - - .generic_bulk_ctrl_endpoint = 0x81, - /* parameter for the MPEG2-data transfer */ - .num_adapters = 1, - .download_firmware = dw2102_load_firmware, - .adapter = { - { - .frontend_attach = dw2102_frontend_attach, - .streaming_ctrl = NULL, - .tuner_attach = dw2102_tuner_attach, - .stream = { - .type = USB_BULK, - .count = 8, - .endpoint = 0x82, - .u = { - .bulk = { - .buffersize = 4096, - } - } - }, - } - }, - .num_device_descs = 2, - .devices = { - {"DVBWorld DVB-S 2102 USB2.0", - {&dw2102_table[0], NULL}, - {NULL}, - }, - {"DVBWorld DVB-S 2101 USB2.0", - {&dw2102_table[1], NULL}, - {NULL}, - }, - } -}; - -static int dw2102_probe(struct usb_interface *intf, - const struct usb_device_id *id) -{ - return dvb_usb_device_init(intf, &dw2102_properties, - THIS_MODULE, NULL, adapter_nr); -} - -static struct usb_driver dw2102_driver = { - .name = "dw2102", - .probe = dw2102_probe, - .disconnect = dvb_usb_device_exit, - .id_table = dw2102_table, -}; - -static int __init dw2102_module_init(void) -{ - int ret = usb_register(&dw2102_driver); - if (ret) - err("usb_register failed. Error number %d", ret); - - return ret; -} - -static void __exit dw2102_module_exit(void) -{ - usb_deregister(&dw2102_driver); -} - -module_init(dw2102_module_init); -module_exit(dw2102_module_exit); - -MODULE_AUTHOR("Igor M. Liplianin (c) liplianin@me.by"); -MODULE_DESCRIPTION("Driver for DVBWorld DVB-S 2101 2102 USB2.0 device"); -MODULE_VERSION("0.1"); -MODULE_LICENSE("GPL"); diff --git a/trunk/drivers/media/dvb/dvb-usb/dw2102.h b/trunk/drivers/media/dvb/dvb-usb/dw2102.h deleted file mode 100644 index 7a310f906837..000000000000 --- a/trunk/drivers/media/dvb/dvb-usb/dw2102.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef _DW2102_H_ -#define _DW2102_H_ - -#define DVB_USB_LOG_PREFIX "dw2102" -#include "dvb-usb.h" - -extern int dvb_usb_dw2102_debug; -#define deb_xfer(args...) dprintk(dvb_usb_dw2102_debug, 0x02, args) -#endif diff --git a/trunk/drivers/media/dvb/frontends/Kconfig b/trunk/drivers/media/dvb/frontends/Kconfig index 574dffe91b68..c20553c4da1f 100644 --- a/trunk/drivers/media/dvb/frontends/Kconfig +++ b/trunk/drivers/media/dvb/frontends/Kconfig @@ -97,8 +97,9 @@ comment "DVB-T (terrestrial) frontends" config DVB_SP8870 tristate "Spase sp8870 based" - depends on DVB_CORE && I2C + depends on DVB_CORE && I2C && HOTPLUG default m if DVB_FE_CUSTOMISE + select FW_LOADER help A DVB-T tuner module. Say Y when you want to support this frontend. @@ -109,8 +110,9 @@ config DVB_SP8870 config DVB_SP887X tristate "Spase sp887x based" - depends on DVB_CORE && I2C + depends on DVB_CORE && I2C && HOTPLUG default m if DVB_FE_CUSTOMISE + select FW_LOADER help A DVB-T tuner module. Say Y when you want to support this frontend. @@ -133,20 +135,6 @@ config DVB_CX22702 help A DVB-T tuner module. Say Y when you want to support this frontend. -config DVB_DRX397XD - tristate "Micronas DRX3975D/DRX3977D based" - depends on DVB_CORE && I2C && HOTPLUG - default m if DVB_FE_CUSTOMISE - select FW_LOADER - help - A DVB-T tuner module. Say Y when you want to support this frontend. - - TODO: - This driver needs external firmware. Please use the command - "/Documentation/dvb/get_dvb_firmware drx397xD" to - download/extract them, and then copy them to /usr/lib/hotplug/firmware - or /lib/firmware (depending on configuration of firmware hotplug). - config DVB_L64781 tristate "LSI L64781" depends on DVB_CORE && I2C @@ -156,8 +144,9 @@ config DVB_L64781 config DVB_TDA1004X tristate "Philips TDA10045H/TDA10046H based" - depends on DVB_CORE && I2C + depends on DVB_CORE && I2C && HOTPLUG default m if DVB_FE_CUSTOMISE + select FW_LOADER help A DVB-T tuner module. Say Y when you want to support this frontend. @@ -222,8 +211,9 @@ config DVB_DIB7000P config DVB_TDA10048 tristate "Philips TDA10048HN based" - depends on DVB_CORE && I2C + depends on DVB_CORE && I2C && HOTPLUG default m if DVB_FE_CUSTOMISE + select FW_LOADER help A DVB-T tuner module. Say Y when you want to support this frontend. @@ -263,8 +253,9 @@ comment "ATSC (North American/Korean Terrestrial/Cable DTV) frontends" config DVB_NXT200X tristate "NxtWave Communications NXT2002/NXT2004 based" - depends on DVB_CORE && I2C + depends on DVB_CORE && I2C && HOTPLUG default m if DVB_FE_CUSTOMISE + select FW_LOADER help An ATSC 8VSB and QAM64/256 tuner module. Say Y when you want to support this frontend. @@ -277,8 +268,9 @@ config DVB_NXT200X config DVB_OR51211 tristate "Oren OR51211 based" - depends on DVB_CORE && I2C + depends on DVB_CORE && I2C && HOTPLUG default m if DVB_FE_CUSTOMISE + select FW_LOADER help An ATSC 8VSB tuner module. Say Y when you want to support this frontend. @@ -289,8 +281,9 @@ config DVB_OR51211 config DVB_OR51132 tristate "Oren OR51132 based" - depends on DVB_CORE && I2C + depends on DVB_CORE && I2C && HOTPLUG default m if DVB_FE_CUSTOMISE + select FW_LOADER help An ATSC 8VSB and QAM64/256 tuner module. Say Y when you want to support this frontend. @@ -304,8 +297,9 @@ config DVB_OR51132 config DVB_BCM3510 tristate "Broadcom BCM3510" - depends on DVB_CORE && I2C + depends on DVB_CORE && I2C && HOTPLUG default m if DVB_FE_CUSTOMISE + select FW_LOADER help An ATSC 8VSB/16VSB and QAM64/256 tuner module. Say Y when you want to support this frontend. diff --git a/trunk/drivers/media/dvb/frontends/Makefile b/trunk/drivers/media/dvb/frontends/Makefile index 028da55611c0..a89dc0fc4c6f 100644 --- a/trunk/drivers/media/dvb/frontends/Makefile +++ b/trunk/drivers/media/dvb/frontends/Makefile @@ -25,7 +25,6 @@ obj-$(CONFIG_DVB_NXT6000) += nxt6000.o obj-$(CONFIG_DVB_MT352) += mt352.o obj-$(CONFIG_DVB_ZL10353) += zl10353.o obj-$(CONFIG_DVB_CX22702) += cx22702.o -obj-$(CONFIG_DVB_DRX397XD) += drx397xD.o obj-$(CONFIG_DVB_TDA10021) += tda10021.o obj-$(CONFIG_DVB_TDA10023) += tda10023.o obj-$(CONFIG_DVB_STV0297) += stv0297.o diff --git a/trunk/drivers/media/dvb/frontends/drx397xD.c b/trunk/drivers/media/dvb/frontends/drx397xD.c deleted file mode 100644 index 3cbed874a6f8..000000000000 --- a/trunk/drivers/media/dvb/frontends/drx397xD.c +++ /dev/null @@ -1,1504 +0,0 @@ -/* - * Driver for Micronas drx397xD demodulator - * - * Copyright (C) 2007 Henk Vergonet - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 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 General Public License - * along with this program; If not, see . - */ - -#define DEBUG /* uncomment if you want debugging output */ -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "dvb_frontend.h" -#include "drx397xD.h" - -static const char mod_name[] = "drx397xD"; - -#define MAX_CLOCK_DRIFT 200 /* maximal 200 PPM allowed */ - -#define F_SET_0D0h 1 -#define F_SET_0D4h 2 - -typedef enum fw_ix { -#define _FW_ENTRY(a, b) b -#include "drx397xD_fw.h" -} fw_ix_t; - -/* chip specifics */ -struct drx397xD_state { - struct i2c_adapter *i2c; - struct dvb_frontend frontend; - struct drx397xD_config config; - fw_ix_t chip_rev; - int flags; - u32 bandwidth_parm; /* internal bandwidth conversions */ - u32 f_osc; /* w90: actual osc frequency [Hz] */ -}; - -/******************************************************************************* - * Firmware - ******************************************************************************/ - -static const char *blob_name[] = { -#define _BLOB_ENTRY(a, b) a -#include "drx397xD_fw.h" -}; - -typedef enum blob_ix { -#define _BLOB_ENTRY(a, b) b -#include "drx397xD_fw.h" -} blob_ix_t; - -static struct { - const char *name; - const struct firmware *file; - rwlock_t lock; - int refcnt; - const u8 *data[ARRAY_SIZE(blob_name)]; -} fw[] = { -#define _FW_ENTRY(a, b) { \ - .name = a, \ - .file = 0, \ - .lock = RW_LOCK_UNLOCKED, \ - .refcnt = 0, \ - .data = { } } -#include "drx397xD_fw.h" -}; - -/* use only with writer lock aquired */ -static void _drx_release_fw(struct drx397xD_state *s, fw_ix_t ix) -{ - memset(&fw[ix].data[0], 0, sizeof(fw[0].data)); - if (fw[ix].file) - release_firmware(fw[ix].file); -} - -static void drx_release_fw(struct drx397xD_state *s) -{ - fw_ix_t ix = s->chip_rev; - - pr_debug("%s\n", __FUNCTION__); - - write_lock(&fw[ix].lock); - if (fw[ix].refcnt) { - fw[ix].refcnt--; - if (fw[ix].refcnt == 0) - _drx_release_fw(s, ix); - } - write_unlock(&fw[ix].lock); -} - -static int drx_load_fw(struct drx397xD_state *s, fw_ix_t ix) -{ - const u8 *data; - size_t size, len; - int i = 0, j, rc = -EINVAL; - - pr_debug("%s\n", __FUNCTION__); - - if (ix < 0 || ix >= ARRAY_SIZE(fw)) - return -EINVAL; - s->chip_rev = ix; - - write_lock(&fw[ix].lock); - if (fw[ix].file) { - rc = 0; - goto exit_ok; - } - memset(&fw[ix].data[0], 0, sizeof(fw[0].data)); - - if (request_firmware(&fw[ix].file, fw[ix].name, &s->i2c->dev) != 0) { - printk(KERN_ERR "%s: Firmware \"%s\" not available\n", - mod_name, fw[ix].name); - rc = -ENOENT; - goto exit_err; - } - - if (!fw[ix].file->data || fw[ix].file->size < 10) - goto exit_corrupt; - - data = fw[ix].file->data; - size = fw[ix].file->size; - - if (data[i++] != 2) /* check firmware version */ - goto exit_corrupt; - - do { - switch (data[i++]) { - case 0x00: /* bytecode */ - if (i >= size) - break; - i += data[i]; - case 0x01: /* reset */ - case 0x02: /* sleep */ - i++; - break; - case 0xfe: /* name */ - len = strnlen(&data[i], size - i); - if (i + len + 1 >= size) - goto exit_corrupt; - if (data[i + len + 1] != 0) - goto exit_corrupt; - for (j = 0; j < ARRAY_SIZE(blob_name); j++) { - if (strcmp(blob_name[j], &data[i]) == 0) { - fw[ix].data[j] = &data[i + len + 1]; - pr_debug("Loading %s\n", blob_name[j]); - } - } - i += len + 1; - break; - case 0xff: /* file terminator */ - if (i == size) { - rc = 0; - goto exit_ok; - } - default: - goto exit_corrupt; - } - } while (i < size); - exit_corrupt: - printk(KERN_ERR "%s: Firmware is corrupt\n", mod_name); - exit_err: - _drx_release_fw(s, ix); - fw[ix].refcnt--; - exit_ok: - fw[ix].refcnt++; - write_unlock(&fw[ix].lock); - return rc; -} - -/******************************************************************************* - * i2c bus IO - ******************************************************************************/ - -static int write_fw(struct drx397xD_state *s, blob_ix_t ix) -{ - struct i2c_msg msg = {.addr = s->config.demod_address,.flags = 0 }; - const u8 *data; - int len, rc = 0, i = 0; - - if (ix < 0 || ix >= ARRAY_SIZE(blob_name)) { - pr_debug("%s drx_fw_ix_t out of range\n", __FUNCTION__); - return -EINVAL; - } - pr_debug("%s %s\n", __FUNCTION__, blob_name[ix]); - - read_lock(&fw[s->chip_rev].lock); - data = fw[s->chip_rev].data[ix]; - if (!data) { - rc = -EINVAL; - goto exit_rc; - } - - for (;;) { - switch (data[i++]) { - case 0: /* bytecode */ - len = data[i++]; - msg.len = len; - msg.buf = (__u8 *) &data[i]; - if (i2c_transfer(s->i2c, &msg, 1) != 1) { - rc = -EIO; - goto exit_rc; - } - i += len; - break; - case 1: /* reset */ - case 2: /* sleep */ - i++; - break; - default: - goto exit_rc; - } - } - exit_rc: - read_unlock(&fw[s->chip_rev].lock); - return 0; -} - -/* Function is not endian safe, use the RD16 wrapper below */ -static int _read16(struct drx397xD_state *s, u32 i2c_adr) -{ - int rc; - u8 a[4]; - u16 v; - struct i2c_msg msg[2] = { - { - .addr = s->config.demod_address, - .flags = 0, - .buf = a, - .len = sizeof(a) - } - , { - .addr = s->config.demod_address, - .flags = I2C_M_RD, - .buf = (u8 *) & v, - .len = sizeof(v) - } - }; - - *(u32 *) a = i2c_adr; - - rc = i2c_transfer(s->i2c, msg, 2); - if (rc != 2) - return -EIO; - - return le16_to_cpu(v); -} - -/* Function is not endian safe, use the WR16.. wrappers below */ -static int _write16(struct drx397xD_state *s, u32 i2c_adr, u16 val) -{ - u8 a[6]; - int rc; - struct i2c_msg msg = { - .addr = s->config.demod_address, - .flags = 0, - .buf = a, - .len = sizeof(a) - }; - - *(u32 *) a = i2c_adr; - *(u16 *) & a[4] = val; - - rc = i2c_transfer(s->i2c, &msg, 1); - if (rc != 1) - return -EIO; - return 0; -} - -#define WR16(ss,adr, val) \ - _write16(ss, I2C_ADR_C0(adr), cpu_to_le16(val)) -#define WR16_E0(ss,adr, val) \ - _write16(ss, I2C_ADR_E0(adr), cpu_to_le16(val)) -#define RD16(ss,adr) \ - _read16(ss, I2C_ADR_C0(adr)) - -#define EXIT_RC( cmd ) if ( (rc = (cmd)) < 0) goto exit_rc - -/******************************************************************************* - * Tuner callback - ******************************************************************************/ - -static int PLL_Set(struct drx397xD_state *s, - struct dvb_frontend_parameters *fep, int *df_tuner) -{ - struct dvb_frontend *fe = &s->frontend; - u32 f_tuner, f = fep->frequency; - int rc; - - pr_debug("%s\n", __FUNCTION__); - - if ((f > s->frontend.ops.tuner_ops.info.frequency_max) || - (f < s->frontend.ops.tuner_ops.info.frequency_min)) - return -EINVAL; - - *df_tuner = 0; - if (!s->frontend.ops.tuner_ops.set_params || - !s->frontend.ops.tuner_ops.get_frequency) - return -ENOSYS; - - rc = s->frontend.ops.tuner_ops.set_params(fe, fep); - if (rc < 0) - return rc; - - rc = s->frontend.ops.tuner_ops.get_frequency(fe, &f_tuner); - if (rc < 0) - return rc; - - *df_tuner = f_tuner - f; - pr_debug("%s requested %d [Hz] tuner %d [Hz]\n", __FUNCTION__, f, - f_tuner); - - return 0; -} - -/******************************************************************************* - * Demodulator helper functions - ******************************************************************************/ - -static int SC_WaitForReady(struct drx397xD_state *s) -{ - int cnt = 1000; - int rc; - - pr_debug("%s\n", __FUNCTION__); - - while (cnt--) { - rc = RD16(s, 0x820043); - if (rc == 0) - return 0; - } - return -1; -} - -static int SC_SendCommand(struct drx397xD_state *s, int cmd) -{ - int rc; - - pr_debug("%s\n", __FUNCTION__); - - WR16(s, 0x820043, cmd); - SC_WaitForReady(s); - rc = RD16(s, 0x820042); - if ((rc & 0xffff) == 0xffff) - return -1; - return 0; -} - -static int HI_Command(struct drx397xD_state *s, u16 cmd) -{ - int rc, cnt = 1000; - - pr_debug("%s\n", __FUNCTION__); - - rc = WR16(s, 0x420032, cmd); - if (rc < 0) - return rc; - - do { - rc = RD16(s, 0x420032); - if (rc == 0) { - rc = RD16(s, 0x420031); - return rc; - } - if (rc < 0) - return rc; - } while (--cnt); - return rc; -} - -static int HI_CfgCommand(struct drx397xD_state *s) -{ - - pr_debug("%s\n", __FUNCTION__); - - WR16(s, 0x420033, 0x3973); - WR16(s, 0x420034, s->config.w50); // code 4, log 4 - WR16(s, 0x420035, s->config.w52); // code 15, log 9 - WR16(s, 0x420036, s->config.demod_address << 1); - WR16(s, 0x420037, s->config.w56); // code (set_i2c ?? initX 1 ), log 1 -// WR16(s, 0x420033, 0x3973); - if ((s->config.w56 & 8) == 0) - return HI_Command(s, 3); - return WR16(s, 0x420032, 0x3); -} - -static const u8 fastIncrDecLUT_15273[] = { - 0x0e, 0x0f, 0x0f, 0x10, 0x11, 0x12, 0x12, 0x13, 0x14, - 0x15, 0x16, 0x17, 0x18, 0x1a, 0x1b, 0x1c, 0x1d, 0x1f -}; - -static const u8 slowIncrDecLUT_15272[] = { - 3, 4, 4, 5, 6 -}; - -static int SetCfgIfAgc(struct drx397xD_state *s, struct drx397xD_CfgIfAgc *agc) -{ - u16 w06 = agc->w06; - u16 w08 = agc->w08; - u16 w0A = agc->w0A; - u16 w0C = agc->w0C; - int quot, rem, i, rc = -EINVAL; - - pr_debug("%s\n", __FUNCTION__); - - if (agc->w04 > 0x3ff) - goto exit_rc; - - if (agc->d00 == 1) { - EXIT_RC(RD16(s, 0x0c20010)); - rc &= ~0x10; - EXIT_RC(WR16(s, 0x0c20010, rc)); - return WR16(s, 0x0c20030, agc->w04 & 0x7ff); - } - - if (agc->d00 != 0) - goto exit_rc; - if (w0A < w08) - goto exit_rc; - if (w0A > 0x3ff) - goto exit_rc; - if (w0C > 0x3ff) - goto exit_rc; - if (w06 > 0x3ff) - goto exit_rc; - - EXIT_RC(RD16(s, 0x0c20010)); - rc |= 0x10; - EXIT_RC(WR16(s, 0x0c20010, rc)); - - EXIT_RC(WR16(s, 0x0c20025, (w06 >> 1) & 0x1ff)); - EXIT_RC(WR16(s, 0x0c20031, (w0A - w08) >> 1)); - EXIT_RC(WR16(s, 0x0c20032, ((w0A + w08) >> 1) - 0x1ff)); - - quot = w0C / 113; - rem = w0C % 113; - if (quot <= 8) { - quot = 8 - quot; - } else { - quot = 0; - rem += 113; - } - - EXIT_RC(WR16(s, 0x0c20024, quot)); - - i = fastIncrDecLUT_15273[rem / 8]; - EXIT_RC(WR16(s, 0x0c2002d, i)); - EXIT_RC(WR16(s, 0x0c2002e, i)); - - i = slowIncrDecLUT_15272[rem / 28]; - EXIT_RC(WR16(s, 0x0c2002b, i)); - rc = WR16(s, 0x0c2002c, i); - exit_rc: - return rc; -} - -static int SetCfgRfAgc(struct drx397xD_state *s, struct drx397xD_CfgRfAgc *agc) -{ - u16 w04 = agc->w04; - u16 w06 = agc->w06; - int rc = -1; - - pr_debug("%s %d 0x%x 0x%x\n", __FUNCTION__, agc->d00, w04, w06); - - if (w04 > 0x3ff) - goto exit_rc; - - switch (agc->d00) { - case 1: - if (w04 == 0x3ff) - w04 = 0x400; - - EXIT_RC(WR16(s, 0x0c20036, w04)); - s->config.w9C &= ~2; - EXIT_RC(WR16(s, 0x0c20015, s->config.w9C)); - EXIT_RC(RD16(s, 0x0c20010)); - rc &= 0xbfdf; - EXIT_RC(WR16(s, 0x0c20010, rc)); - EXIT_RC(RD16(s, 0x0c20013)); - rc &= ~2; - break; - case 0: - // loc_8000659 - s->config.w9C &= ~2; - EXIT_RC(WR16(s, 0x0c20015, s->config.w9C)); - EXIT_RC(RD16(s, 0x0c20010)); - rc &= 0xbfdf; - rc |= 0x4000; - EXIT_RC(WR16(s, 0x0c20010, rc)); - EXIT_RC(WR16(s, 0x0c20051, (w06 >> 4) & 0x3f)); - EXIT_RC(RD16(s, 0x0c20013)); - rc &= ~2; - break; - default: - s->config.w9C |= 2; - EXIT_RC(WR16(s, 0x0c20015, s->config.w9C)); - EXIT_RC(RD16(s, 0x0c20010)); - rc &= 0xbfdf; - EXIT_RC(WR16(s, 0x0c20010, rc)); - - EXIT_RC(WR16(s, 0x0c20036, 0)); - - EXIT_RC(RD16(s, 0x0c20013)); - rc |= 2; - } - rc = WR16(s, 0x0c20013, rc); - exit_rc: - return rc; -} - -static int GetLockStatus(struct drx397xD_state *s, int *lockstat) -{ - int rc; - - *lockstat = 0; - - rc = RD16(s, 0x082004b); - if (rc < 0) - return rc; - - if (s->config.d60 != 2) - return 0; - - if ((rc & 7) == 7) - *lockstat |= 1; - if ((rc & 3) == 3) - *lockstat |= 2; - if (rc & 1) - *lockstat |= 4; - return 0; -} - -static int CorrectSysClockDeviation(struct drx397xD_state *s) -{ - int rc = -EINVAL; - int lockstat; - u32 clk, clk_limit; - - pr_debug("%s\n", __FUNCTION__); - - if (s->config.d5C == 0) { - EXIT_RC(WR16(s, 0x08200e8, 0x010)); - EXIT_RC(WR16(s, 0x08200e9, 0x113)); - s->config.d5C = 1; - return rc; - } - if (s->config.d5C != 1) - goto exit_rc; - - rc = RD16(s, 0x0820048); - - rc = GetLockStatus(s, &lockstat); - if (rc < 0) - goto exit_rc; - if ((lockstat & 1) == 0) - goto exit_rc; - - EXIT_RC(WR16(s, 0x0420033, 0x200)); - EXIT_RC(WR16(s, 0x0420034, 0xc5)); - EXIT_RC(WR16(s, 0x0420035, 0x10)); - EXIT_RC(WR16(s, 0x0420036, 0x1)); - EXIT_RC(WR16(s, 0x0420037, 0xa)); - EXIT_RC(HI_Command(s, 6)); - EXIT_RC(RD16(s, 0x0420040)); - clk = rc; - EXIT_RC(RD16(s, 0x0420041)); - clk |= rc << 16; - - if (clk <= 0x26ffff) - goto exit_rc; - if (clk > 0x610000) - goto exit_rc; - - if (!s->bandwidth_parm) - return -EINVAL; - - /* round & convert to Hz */ - clk = ((u64) (clk + 0x800000) * s->bandwidth_parm + (1 << 20)) >> 21; - clk_limit = s->config.f_osc * MAX_CLOCK_DRIFT / 1000; - - if (clk - s->config.f_osc * 1000 + clk_limit <= 2 * clk_limit) { - s->f_osc = clk; - pr_debug("%s: osc %d %d [Hz]\n", __FUNCTION__, - s->config.f_osc * 1000, clk - s->config.f_osc * 1000); - } - rc = WR16(s, 0x08200e8, 0); - exit_rc: - return rc; -} - -static int ConfigureMPEGOutput(struct drx397xD_state *s, int type) -{ - int rc, si, bp; - - pr_debug("%s\n", __FUNCTION__); - - si = s->config.wA0; - if (s->config.w98 == 0) { - si |= 1; - bp = 0; - } else { - si &= ~1; - bp = 0x200; - } - if (s->config.w9A == 0) { - si |= 0x80; - } else { - si &= ~0x80; - } - - EXIT_RC(WR16(s, 0x2150045, 0)); - EXIT_RC(WR16(s, 0x2150010, si)); - EXIT_RC(WR16(s, 0x2150011, bp)); - rc = WR16(s, 0x2150012, (type == 0 ? 0xfff : 0)); - exit_rc: - return rc; -} - -static int drx_tune(struct drx397xD_state *s, - struct dvb_frontend_parameters *fep) -{ - u16 v22 = 0; - u16 v1C = 0; - u16 v1A = 0; - u16 v18 = 0; - u32 edi = 0, ebx = 0, ebp = 0, edx = 0; - u16 v20 = 0, v1E = 0, v16 = 0, v14 = 0, v12 = 0, v10 = 0, v0E = 0; - - int rc, df_tuner; - int a, b, c, d; - pr_debug("%s %d\n", __FUNCTION__, s->config.d60); - - if (s->config.d60 != 2) - goto set_tuner; - rc = CorrectSysClockDeviation(s); - if (rc < 0) - goto set_tuner; - - s->config.d60 = 1; - rc = ConfigureMPEGOutput(s, 0); - if (rc < 0) - goto set_tuner; - set_tuner: - - rc = PLL_Set(s, fep, &df_tuner); - if (rc < 0) { - printk(KERN_ERR "Error in pll_set\n"); - goto exit_rc; - } - msleep(200); - - a = rc = RD16(s, 0x2150016); - if (rc < 0) - goto exit_rc; - b = rc = RD16(s, 0x2150010); - if (rc < 0) - goto exit_rc; - c = rc = RD16(s, 0x2150034); - if (rc < 0) - goto exit_rc; - d = rc = RD16(s, 0x2150035); - if (rc < 0) - goto exit_rc; - rc = WR16(s, 0x2150014, c); - rc = WR16(s, 0x2150015, d); - rc = WR16(s, 0x2150010, 0); - rc = WR16(s, 0x2150000, 2); - rc = WR16(s, 0x2150036, 0x0fff); - rc = WR16(s, 0x2150016, a); - - rc = WR16(s, 0x2150010, 2); - rc = WR16(s, 0x2150007, 0); - rc = WR16(s, 0x2150000, 1); - rc = WR16(s, 0x2110000, 0); - rc = WR16(s, 0x0800000, 0); - rc = WR16(s, 0x2800000, 0); - rc = WR16(s, 0x2110010, 0x664); - - rc = write_fw(s, DRXD_ResetECRAM); - rc = WR16(s, 0x2110000, 1); - - rc = write_fw(s, DRXD_InitSC); - if (rc < 0) - goto exit_rc; - - rc = SetCfgIfAgc(s, &s->config.ifagc); - if (rc < 0) - goto exit_rc; - - rc = SetCfgRfAgc(s, &s->config.rfagc); - if (rc < 0) - goto exit_rc; - - if (fep->u.ofdm.transmission_mode != TRANSMISSION_MODE_2K) - v22 = 1; - switch (fep->u.ofdm.transmission_mode) { - case TRANSMISSION_MODE_8K: - edi = 1; - if (s->chip_rev == DRXD_FW_B1) - break; - - rc = WR16(s, 0x2010010, 0); - if (rc < 0) - break; - v1C = 0x63; - v1A = 0x53; - v18 = 0x43; - break; - default: - edi = 0; - if (s->chip_rev == DRXD_FW_B1) - break; - - rc = WR16(s, 0x2010010, 1); - if (rc < 0) - break; - - v1C = 0x61; - v1A = 0x47; - v18 = 0x41; - } - - switch (fep->u.ofdm.guard_interval) { - case GUARD_INTERVAL_1_4: - edi |= 0x0c; - break; - case GUARD_INTERVAL_1_8: - edi |= 0x08; - break; - case GUARD_INTERVAL_1_16: - edi |= 0x04; - break; - case GUARD_INTERVAL_1_32: - break; - default: - v22 |= 2; - } - - ebx = 0; - ebp = 0; - v20 = 0; - v1E = 0; - v16 = 0; - v14 = 0; - v12 = 0; - v10 = 0; - v0E = 0; - - switch (fep->u.ofdm.hierarchy_information) { - case HIERARCHY_1: - edi |= 0x40; - if (s->chip_rev == DRXD_FW_B1) - break; - rc = WR16(s, 0x1c10047, 1); - if (rc < 0) - goto exit_rc; - rc = WR16(s, 0x2010012, 1); - if (rc < 0) - goto exit_rc; - ebx = 0x19f; - ebp = 0x1fb; - v20 = 0x0c0; - v1E = 0x195; - v16 = 0x1d6; - v14 = 0x1ef; - v12 = 4; - v10 = 5; - v0E = 5; - break; - case HIERARCHY_2: - edi |= 0x80; - if (s->chip_rev == DRXD_FW_B1) - break; - rc = WR16(s, 0x1c10047, 2); - if (rc < 0) - goto exit_rc; - rc = WR16(s, 0x2010012, 2); - if (rc < 0) - goto exit_rc; - ebx = 0x08f; - ebp = 0x12f; - v20 = 0x0c0; - v1E = 0x11e; - v16 = 0x1d6; - v14 = 0x15e; - v12 = 4; - v10 = 5; - v0E = 5; - break; - case HIERARCHY_4: - edi |= 0xc0; - if (s->chip_rev == DRXD_FW_B1) - break; - rc = WR16(s, 0x1c10047, 3); - if (rc < 0) - goto exit_rc; - rc = WR16(s, 0x2010012, 3); - if (rc < 0) - goto exit_rc; - ebx = 0x14d; - ebp = 0x197; - v20 = 0x0c0; - v1E = 0x1ce; - v16 = 0x1d6; - v14 = 0x11a; - v12 = 4; - v10 = 6; - v0E = 5; - break; - default: - v22 |= 8; - if (s->chip_rev == DRXD_FW_B1) - break; - rc = WR16(s, 0x1c10047, 0); - if (rc < 0) - goto exit_rc; - rc = WR16(s, 0x2010012, 0); - if (rc < 0) - goto exit_rc; - // QPSK QAM16 QAM64 - ebx = 0x19f; // 62 - ebp = 0x1fb; // 15 - v20 = 0x16a; // 62 - v1E = 0x195; // 62 - v16 = 0x1bb; // 15 - v14 = 0x1ef; // 15 - v12 = 5; // 16 - v10 = 5; // 16 - v0E = 5; // 16 - } - - switch (fep->u.ofdm.constellation) { - default: - v22 |= 4; - case QPSK: - if (s->chip_rev == DRXD_FW_B1) - break; - - rc = WR16(s, 0x1c10046, 0); - if (rc < 0) - goto exit_rc; - rc = WR16(s, 0x2010011, 0); - if (rc < 0) - goto exit_rc; - rc = WR16(s, 0x201001a, 0x10); - if (rc < 0) - goto exit_rc; - rc = WR16(s, 0x201001b, 0); - if (rc < 0) - goto exit_rc; - rc = WR16(s, 0x201001c, 0); - if (rc < 0) - goto exit_rc; - rc = WR16(s, 0x1c10062, v20); - if (rc < 0) - goto exit_rc; - rc = WR16(s, 0x1c1002a, v1C); - if (rc < 0) - goto exit_rc; - rc = WR16(s, 0x1c10015, v16); - if (rc < 0) - goto exit_rc; - rc = WR16(s, 0x1c10016, v12); - if (rc < 0) - goto exit_rc; - break; - case QAM_16: - edi |= 0x10; - if (s->chip_rev == DRXD_FW_B1) - break; - - rc = WR16(s, 0x1c10046, 1); - if (rc < 0) - goto exit_rc; - rc = WR16(s, 0x2010011, 1); - if (rc < 0) - goto exit_rc; - rc = WR16(s, 0x201001a, 0x10); - if (rc < 0) - goto exit_rc; - rc = WR16(s, 0x201001b, 4); - if (rc < 0) - goto exit_rc; - rc = WR16(s, 0x201001c, 0); - if (rc < 0) - goto exit_rc; - rc = WR16(s, 0x1c10062, v1E); - if (rc < 0) - goto exit_rc; - rc = WR16(s, 0x1c1002a, v1A); - if (rc < 0) - goto exit_rc; - rc = WR16(s, 0x1c10015, v14); - if (rc < 0) - goto exit_rc; - rc = WR16(s, 0x1c10016, v10); - if (rc < 0) - goto exit_rc; - break; - case QAM_64: - edi |= 0x20; - rc = WR16(s, 0x1c10046, 2); - if (rc < 0) - goto exit_rc; - rc = WR16(s, 0x2010011, 2); - if (rc < 0) - goto exit_rc; - rc = WR16(s, 0x201001a, 0x20); - if (rc < 0) - goto exit_rc; - rc = WR16(s, 0x201001b, 8); - if (rc < 0) - goto exit_rc; - rc = WR16(s, 0x201001c, 2); - if (rc < 0) - goto exit_rc; - rc = WR16(s, 0x1c10062, ebx); - if (rc < 0) - goto exit_rc; - rc = WR16(s, 0x1c1002a, v18); - if (rc < 0) - goto exit_rc; - rc = WR16(s, 0x1c10015, ebp); - if (rc < 0) - goto exit_rc; - rc = WR16(s, 0x1c10016, v0E); - if (rc < 0) - goto exit_rc; - break; - } - - if (s->config.s20d24 == 1) { - rc = WR16(s, 0x2010013, 0); - } else { - rc = WR16(s, 0x2010013, 1); - edi |= 0x1000; - } - - switch (fep->u.ofdm.code_rate_HP) { - default: - v22 |= 0x10; - case FEC_1_2: - if (s->chip_rev == DRXD_FW_B1) - break; - rc = WR16(s, 0x2090011, 0); - break; - case FEC_2_3: - edi |= 0x200; - if (s->chip_rev == DRXD_FW_B1) - break; - rc = WR16(s, 0x2090011, 1); - break; - case FEC_3_4: - edi |= 0x400; - if (s->chip_rev == DRXD_FW_B1) - break; - rc = WR16(s, 0x2090011, 2); - break; - case FEC_5_6: /* 5 */ - edi |= 0x600; - if (s->chip_rev == DRXD_FW_B1) - break; - rc = WR16(s, 0x2090011, 3); - break; - case FEC_7_8: /* 7 */ - edi |= 0x800; - if (s->chip_rev == DRXD_FW_B1) - break; - rc = WR16(s, 0x2090011, 4); - break; - }; - if (rc < 0) - goto exit_rc; - - switch (fep->u.ofdm.bandwidth) { - default: - rc = -EINVAL; - goto exit_rc; - case BANDWIDTH_8_MHZ: /* 0 */ - case BANDWIDTH_AUTO: - rc = WR16(s, 0x0c2003f, 0x32); - s->bandwidth_parm = ebx = 0x8b8249; // 9142857 - edx = 0; - break; - case BANDWIDTH_7_MHZ: - rc = WR16(s, 0x0c2003f, 0x3b); - s->bandwidth_parm = ebx = 0x7a1200; // 8000000 - edx = 0x4807; - break; - case BANDWIDTH_6_MHZ: - rc = WR16(s, 0x0c2003f, 0x47); - s->bandwidth_parm = ebx = 0x68a1b6; // 6857142 - edx = 0x0f07; - break; - }; - - if (rc < 0) - goto exit_rc; - - rc = WR16(s, 0x08200ec, edx); - if (rc < 0) - goto exit_rc; - - rc = RD16(s, 0x0820050); - if (rc < 0) - goto exit_rc; - rc = WR16(s, 0x0820050, rc); - - { - /* Configure bandwidth specific factor */ - ebx = div64_u64(((u64) (s->f_osc) << 21) + (ebx >> 1), - (u64)ebx) - 0x800000; - EXIT_RC(WR16(s, 0x0c50010, ebx & 0xffff)); - EXIT_RC(WR16(s, 0x0c50011, ebx >> 16)); - - /* drx397xD oscillator calibration */ - ebx = div64_u64(((u64) (s->config.f_if + df_tuner) << 28) + - (s->f_osc >> 1), (u64)s->f_osc); - } - ebx &= 0xfffffff; - if (fep->inversion == INVERSION_ON) - ebx = 0x10000000 - ebx; - - EXIT_RC(WR16(s, 0x0c30010, ebx & 0xffff)); - EXIT_RC(WR16(s, 0x0c30011, ebx >> 16)); - - EXIT_RC(WR16(s, 0x0800000, 1)); - EXIT_RC(RD16(s, 0x0800000)); - - - EXIT_RC(SC_WaitForReady(s)); - EXIT_RC(WR16(s, 0x0820042, 0)); - EXIT_RC(WR16(s, 0x0820041, v22)); - EXIT_RC(WR16(s, 0x0820040, edi)); - EXIT_RC(SC_SendCommand(s, 3)); - - rc = RD16(s, 0x0800000); - - SC_WaitForReady(s); - WR16(s, 0x0820042, 0); - WR16(s, 0x0820041, 1); - WR16(s, 0x0820040, 1); - SC_SendCommand(s, 1); - -// rc = WR16(s, 0x2150000, 1); -// if (rc < 0) goto exit_rc; - - rc = WR16(s, 0x2150000, 2); - rc = WR16(s, 0x2150016, a); - rc = WR16(s, 0x2150010, 4); - rc = WR16(s, 0x2150036, 0); - rc = WR16(s, 0x2150000, 1); - s->config.d60 = 2; - exit_rc: - return rc; -} - -/******************************************************************************* - * DVB interface - ******************************************************************************/ - -static int drx397x_init(struct dvb_frontend *fe) -{ - struct drx397xD_state *s = fe->demodulator_priv; - int rc; - - pr_debug("%s\n", __FUNCTION__); - - s->config.rfagc.d00 = 2; /* 0x7c */ - s->config.rfagc.w04 = 0; - s->config.rfagc.w06 = 0x3ff; - - s->config.ifagc.d00 = 0; /* 0x68 */ - s->config.ifagc.w04 = 0; - s->config.ifagc.w06 = 140; - s->config.ifagc.w08 = 0; - s->config.ifagc.w0A = 0x3ff; - s->config.ifagc.w0C = 0x388; - - /* for signal strenght calculations */ - s->config.ss76 = 820; - s->config.ss78 = 2200; - s->config.ss7A = 150; - - /* HI_CfgCommand */ - s->config.w50 = 4; - s->config.w52 = 9; // 0xf; - - s->config.f_if = 42800000; /* d14: intermediate frequency [Hz] */ - s->config.f_osc = 48000; /* s66 : oscillator frequency [kHz] */ - s->config.w92 = 12000; // 20000; - - s->config.w9C = 0x000e; - s->config.w9E = 0x0000; - - /* ConfigureMPEGOutput params */ - s->config.wA0 = 4; - s->config.w98 = 1; // 0; - s->config.w9A = 1; - - /* get chip revision */ - rc = RD16(s, 0x2410019); - if (rc < 0) - return -ENODEV; - - if (rc == 0) { - printk(KERN_INFO "%s: chip revision A2\n", mod_name); - rc = drx_load_fw(s, DRXD_FW_A2); - } else { - - rc = (rc >> 12) - 3; - switch (rc) { - case 1: - s->flags |= F_SET_0D4h; - case 0: - case 4: - s->flags |= F_SET_0D0h; - break; - case 2: - case 5: - break; - case 3: - s->flags |= F_SET_0D4h; - break; - default: - return -ENODEV; - }; - printk(KERN_INFO "%s: chip revision B1.%d\n", mod_name, rc); - rc = drx_load_fw(s, DRXD_FW_B1); - } - if (rc < 0) - goto error; - - rc = WR16(s, 0x0420033, 0x3973); - if (rc < 0) - goto error; - - rc = HI_Command(s, 2); - - msleep(1); - - if (s->chip_rev == DRXD_FW_A2) { - rc = WR16(s, 0x043012d, 0x47F); - if (rc < 0) - goto error; - } - rc = WR16_E0(s, 0x0400000, 0); - if (rc < 0) - goto error; - - if (s->config.w92 > 20000 || s->config.w92 % 4000) { - printk(KERN_ERR "%s: invalid osc frequency\n", mod_name); - rc = -1; - goto error; - } - - rc = WR16(s, 0x2410010, 1); - if (rc < 0) - goto error; - rc = WR16(s, 0x2410011, 0x15); - if (rc < 0) - goto error; - rc = WR16(s, 0x2410012, s->config.w92 / 4000); - if (rc < 0) - goto error; -#ifdef ORIG_FW - rc = WR16(s, 0x2410015, 2); - if (rc < 0) - goto error; -#endif - rc = WR16(s, 0x2410017, 0x3973); - if (rc < 0) - goto error; - - s->f_osc = s->config.f_osc * 1000; /* initial estimator */ - - s->config.w56 = 1; - - rc = HI_CfgCommand(s); - if (rc < 0) - goto error; - - rc = write_fw(s, DRXD_InitAtomicRead); - if (rc < 0) - goto error; - - if (s->chip_rev == DRXD_FW_A2) { - rc = WR16(s, 0x2150013, 0); - if (rc < 0) - goto error; - } - - rc = WR16_E0(s, 0x0400002, 0); - if (rc < 0) - goto error; - rc = WR16(s, 0x0400002, 0); - if (rc < 0) - goto error; - - if (s->chip_rev == DRXD_FW_A2) { - rc = write_fw(s, DRXD_ResetCEFR); - if (rc < 0) - goto error; - } - rc = write_fw(s, DRXD_microcode); - if (rc < 0) - goto error; - - s->config.w9C = 0x0e; - if (s->flags & F_SET_0D0h) { - s->config.w9C = 0; - rc = RD16(s, 0x0c20010); - if (rc < 0) - goto write_DRXD_InitFE_1; - - rc &= ~0x1000; - rc = WR16(s, 0x0c20010, rc); - if (rc < 0) - goto write_DRXD_InitFE_1; - - rc = RD16(s, 0x0c20011); - if (rc < 0) - goto write_DRXD_InitFE_1; - - rc &= ~0x8; - rc = WR16(s, 0x0c20011, rc); - if (rc < 0) - goto write_DRXD_InitFE_1; - - rc = WR16(s, 0x0c20012, 1); - } - - write_DRXD_InitFE_1: - - rc = write_fw(s, DRXD_InitFE_1); - if (rc < 0) - goto error; - - rc = 1; - if (s->chip_rev == DRXD_FW_B1) { - if (s->flags & F_SET_0D0h) - rc = 0; - } else { - if (s->flags & F_SET_0D0h) - rc = 4; - } - - rc = WR16(s, 0x0C20012, rc); - if (rc < 0) - goto error; - - rc = WR16(s, 0x0C20013, s->config.w9E); - if (rc < 0) - goto error; - rc = WR16(s, 0x0C20015, s->config.w9C); - if (rc < 0) - goto error; - - rc = write_fw(s, DRXD_InitFE_2); - if (rc < 0) - goto error; - rc = write_fw(s, DRXD_InitFT); - if (rc < 0) - goto error; - rc = write_fw(s, DRXD_InitCP); - if (rc < 0) - goto error; - rc = write_fw(s, DRXD_InitCE); - if (rc < 0) - goto error; - rc = write_fw(s, DRXD_InitEQ); - if (rc < 0) - goto error; - rc = write_fw(s, DRXD_InitEC); - if (rc < 0) - goto error; - rc = write_fw(s, DRXD_InitSC); - if (rc < 0) - goto error; - - rc = SetCfgIfAgc(s, &s->config.ifagc); - if (rc < 0) - goto error; - - rc = SetCfgRfAgc(s, &s->config.rfagc); - if (rc < 0) - goto error; - - rc = ConfigureMPEGOutput(s, 1); - rc = WR16(s, 0x08201fe, 0x0017); - rc = WR16(s, 0x08201ff, 0x0101); - - s->config.d5C = 0; - s->config.d60 = 1; - s->config.d48 = 1; - error: - return rc; -} - -static int drx397x_get_frontend(struct dvb_frontend *fe, - struct dvb_frontend_parameters *params) -{ - return 0; -} - -static int drx397x_set_frontend(struct dvb_frontend *fe, - struct dvb_frontend_parameters *params) -{ - struct drx397xD_state *s = fe->demodulator_priv; - - s->config.s20d24 = 1; // 0; - return drx_tune(s, params); -} - -static int drx397x_get_tune_settings(struct dvb_frontend *fe, - struct dvb_frontend_tune_settings - *fe_tune_settings) -{ - fe_tune_settings->min_delay_ms = 10000; - fe_tune_settings->step_size = 0; - fe_tune_settings->max_drift = 0; - return 0; -} - -static int drx397x_read_status(struct dvb_frontend *fe, fe_status_t * status) -{ - struct drx397xD_state *s = fe->demodulator_priv; - int lockstat; - - GetLockStatus(s, &lockstat); - /* TODO */ -// if (lockstat & 1) -// CorrectSysClockDeviation(s); - - *status = 0; - if (lockstat & 2) { - CorrectSysClockDeviation(s); - ConfigureMPEGOutput(s, 1); - *status = FE_HAS_LOCK | FE_HAS_SYNC | FE_HAS_VITERBI; - } - if (lockstat & 4) { - *status |= FE_HAS_CARRIER | FE_HAS_SIGNAL; - } - - return 0; -} - -static int drx397x_read_ber(struct dvb_frontend *fe, unsigned int *ber) -{ - *ber = 0; - return 0; -} - -static int drx397x_read_snr(struct dvb_frontend *fe, u16 * snr) -{ - *snr = 0; - return 0; -} - -static int drx397x_read_signal_strength(struct dvb_frontend *fe, u16 * strength) -{ - struct drx397xD_state *s = fe->demodulator_priv; - int rc; - - if (s->config.ifagc.d00 == 2) { - *strength = 0xffff; - return 0; - } - rc = RD16(s, 0x0c20035); - if (rc < 0) { - *strength = 0; - return 0; - } - rc &= 0x3ff; - /* Signal strength is calculated using the following formula: - * - * a = 2200 * 150 / (2200 + 150); - * a = a * 3300 / (a + 820); - * b = 2200 * 3300 / (2200 + 820); - * c = (((b-a) * rc) >> 10 + a) << 4; - * strength = ~c & 0xffff; - * - * The following does the same but with less rounding errors: - */ - *strength = ~(7720 + (rc * 30744 >> 10)); - return 0; -} - -static int drx397x_read_ucblocks(struct dvb_frontend *fe, - unsigned int *ucblocks) -{ - *ucblocks = 0; - return 0; -} - -static int drx397x_sleep(struct dvb_frontend *fe) -{ - return 0; -} - -static void drx397x_release(struct dvb_frontend *fe) -{ - struct drx397xD_state *s = fe->demodulator_priv; - printk(KERN_INFO "%s: release demodulator\n", mod_name); - if (s) { - drx_release_fw(s); - kfree(s); - } - -} - -static struct dvb_frontend_ops drx397x_ops = { - - .info = { - .name = "Micronas DRX397xD DVB-T Frontend", - .type = FE_OFDM, - .frequency_min = 47125000, - .frequency_max = 855250000, - .frequency_stepsize = 166667, - .frequency_tolerance = 0, - .caps = /* 0x0C01B2EAE */ - FE_CAN_FEC_1_2 | // = 0x2, - FE_CAN_FEC_2_3 | // = 0x4, - FE_CAN_FEC_3_4 | // = 0x8, - FE_CAN_FEC_5_6 | // = 0x20, - FE_CAN_FEC_7_8 | // = 0x80, - FE_CAN_FEC_AUTO | // = 0x200, - FE_CAN_QPSK | // = 0x400, - FE_CAN_QAM_16 | // = 0x800, - FE_CAN_QAM_64 | // = 0x2000, - FE_CAN_QAM_AUTO | // = 0x10000, - FE_CAN_TRANSMISSION_MODE_AUTO | // = 0x20000, - FE_CAN_GUARD_INTERVAL_AUTO | // = 0x80000, - FE_CAN_HIERARCHY_AUTO | // = 0x100000, - FE_CAN_RECOVER | // = 0x40000000, - FE_CAN_MUTE_TS // = 0x80000000 - }, - - .release = drx397x_release, - .init = drx397x_init, - .sleep = drx397x_sleep, - - .set_frontend = drx397x_set_frontend, - .get_tune_settings = drx397x_get_tune_settings, - .get_frontend = drx397x_get_frontend, - - .read_status = drx397x_read_status, - .read_snr = drx397x_read_snr, - .read_signal_strength = drx397x_read_signal_strength, - .read_ber = drx397x_read_ber, - .read_ucblocks = drx397x_read_ucblocks, -}; - -struct dvb_frontend *drx397xD_attach(const struct drx397xD_config *config, - struct i2c_adapter *i2c) -{ - struct drx397xD_state *s = NULL; - - /* allocate memory for the internal state */ - s = kzalloc(sizeof(struct drx397xD_state), GFP_KERNEL); - if (s == NULL) - goto error; - - /* setup the state */ - s->i2c = i2c; - memcpy(&s->config, config, sizeof(struct drx397xD_config)); - - /* check if the demod is there */ - if (RD16(s, 0x2410019) < 0) - goto error; - - /* create dvb_frontend */ - memcpy(&s->frontend.ops, &drx397x_ops, sizeof(struct dvb_frontend_ops)); - s->frontend.demodulator_priv = s; - - return &s->frontend; - error: - kfree(s); - return NULL; -} - -MODULE_DESCRIPTION("Micronas DRX397xD DVB-T Frontend"); -MODULE_AUTHOR("Henk Vergonet"); -MODULE_LICENSE("GPL"); - -EXPORT_SYMBOL(drx397xD_attach); diff --git a/trunk/drivers/media/dvb/frontends/drx397xD.h b/trunk/drivers/media/dvb/frontends/drx397xD.h deleted file mode 100644 index ddc7a07971b7..000000000000 --- a/trunk/drivers/media/dvb/frontends/drx397xD.h +++ /dev/null @@ -1,130 +0,0 @@ -/* - * Driver for Micronas DVB-T drx397xD demodulator - * - * Copyright (C) 2007 Henk vergonet - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 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 General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.= - */ - -#ifndef _DRX397XD_H_INCLUDED -#define _DRX397XD_H_INCLUDED - -#include - -#define DRX_F_STEPSIZE 166667 -#define DRX_F_OFFSET 36000000 - -#define I2C_ADR_C0(x) \ -( (u32)cpu_to_le32( \ - (u32)( \ - (((u32)(x) & (u32)0x000000ffUL) ) | \ - (((u32)(x) & (u32)0x0000ff00UL) << 16) | \ - (((u32)(x) & (u32)0x0fff0000UL) >> 8) | \ - ( (u32)0x00c00000UL) \ - )) \ -) - -#define I2C_ADR_E0(x) \ -( (u32)cpu_to_le32( \ - (u32)( \ - (((u32)(x) & (u32)0x000000ffUL) ) | \ - (((u32)(x) & (u32)0x0000ff00UL) << 16) | \ - (((u32)(x) & (u32)0x0fff0000UL) >> 8) | \ - ( (u32)0x00e00000UL) \ - )) \ -) - -struct drx397xD_CfgRfAgc /* 0x7c */ -{ - int d00; /* 2 */ - u16 w04; - u16 w06; -}; - -struct drx397xD_CfgIfAgc /* 0x68 */ -{ - int d00; /* 0 */ - u16 w04; /* 0 */ - u16 w06; - u16 w08; - u16 w0A; - u16 w0C; -}; - -struct drx397xD_s20 { - int d04; - u32 d18; - u32 d1C; - u32 d20; - u32 d14; - u32 d24; - u32 d0C; - u32 d08; -}; - -struct drx397xD_config -{ - /* demodulator's I2C address */ - u8 demod_address; /* 0x0f */ - - struct drx397xD_CfgIfAgc ifagc; /* 0x68 */ - struct drx397xD_CfgRfAgc rfagc; /* 0x7c */ - u32 s20d24; - - /* HI_CfgCommand parameters */ - u16 w50, w52, /* w54, */ w56; - - int d5C; - int d60; - int d48; - int d28; - - u32 f_if; /* d14: intermediate frequency [Hz] */ - /* 36000000 on Cinergy 2400i DT */ - /* 42800000 on Pinnacle Hybrid PRO 330e */ - - u16 f_osc; /* s66: 48000 oscillator frequency [kHz] */ - - u16 w92; /* 20000 */ - - u16 wA0; - u16 w98; - u16 w9A; - - u16 w9C; /* 0xe0 */ - u16 w9E; /* 0x00 */ - - /* used for signal strength calculations in - drx397x_read_signal_strength - */ - u16 ss78; // 2200 - u16 ss7A; // 150 - u16 ss76; // 820 -}; - -#if defined(CONFIG_DVB_DRX397XD) || (defined(CONFIG_DVB_DRX397XD_MODULE) && defined(MODULE)) -extern struct dvb_frontend* drx397xD_attach(const struct drx397xD_config *config, - struct i2c_adapter *i2c); -#else -static inline struct dvb_frontend* drx397xD_attach(const struct drx397xD_config *config, - struct i2c_adapter *i2c) -{ - printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __FUNCTION__); - return NULL; -} -#endif /* CONFIG_DVB_DRX397XD */ - -#endif /* _DRX397XD_H_INCLUDED */ diff --git a/trunk/drivers/media/dvb/frontends/drx397xD_fw.h b/trunk/drivers/media/dvb/frontends/drx397xD_fw.h deleted file mode 100644 index 01de02a81cd4..000000000000 --- a/trunk/drivers/media/dvb/frontends/drx397xD_fw.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Firmware definitions for Micronas drx397xD - * - * Copyright (C) 2007 Henk Vergonet - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 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 General Public License - * along with this program; If not, see . - */ - -#ifdef _FW_ENTRY - _FW_ENTRY("drx397xD.A2.fw", DRXD_FW_A2 = 0 ), - _FW_ENTRY("drx397xD.B1.fw", DRXD_FW_B1 ), -#undef _FW_ENTRY -#endif /* _FW_ENTRY */ - -#ifdef _BLOB_ENTRY - _BLOB_ENTRY("InitAtomicRead", DRXD_InitAtomicRead = 0 ), - _BLOB_ENTRY("InitCE", DRXD_InitCE ), - _BLOB_ENTRY("InitCP", DRXD_InitCP ), - _BLOB_ENTRY("InitEC", DRXD_InitEC ), - _BLOB_ENTRY("InitEQ", DRXD_InitEQ ), - _BLOB_ENTRY("InitFE_1", DRXD_InitFE_1 ), - _BLOB_ENTRY("InitFE_2", DRXD_InitFE_2 ), - _BLOB_ENTRY("InitFT", DRXD_InitFT ), - _BLOB_ENTRY("InitSC", DRXD_InitSC ), - _BLOB_ENTRY("ResetCEFR", DRXD_ResetCEFR ), - _BLOB_ENTRY("ResetECRAM", DRXD_ResetECRAM ), - _BLOB_ENTRY("microcode", DRXD_microcode ), -#undef _BLOB_ENTRY -#endif /* _BLOB_ENTRY */ diff --git a/trunk/drivers/media/dvb/frontends/z0194a.h b/trunk/drivers/media/dvb/frontends/z0194a.h deleted file mode 100644 index d2876d2e1769..000000000000 --- a/trunk/drivers/media/dvb/frontends/z0194a.h +++ /dev/null @@ -1,97 +0,0 @@ -/* z0194a.h Sharp z0194a tuner support -* -* Copyright (C) 2008 Igor M. Liplianin (liplianin@me.by) -* -* This program is free software; you can redistribute it and/or modify it -* under the terms of the GNU General Public License as published by the -* Free Software Foundation, version 2. -* -* see Documentation/dvb/README.dvb-usb for more information -*/ - -#ifndef Z0194A -#define Z0194A - -static int sharp_z0194a__set_symbol_rate(struct dvb_frontend *fe, - u32 srate, u32 ratio) -{ - u8 aclk = 0; - u8 bclk = 0; - - if (srate < 1500000) { - aclk = 0xb7; bclk = 0x47; } - else if (srate < 3000000) { - aclk = 0xb7; bclk = 0x4b; } - else if (srate < 7000000) { - aclk = 0xb7; bclk = 0x4f; } - else if (srate < 14000000) { - aclk = 0xb7; bclk = 0x53; } - else if (srate < 30000000) { - aclk = 0xb6; bclk = 0x53; } - else if (srate < 45000000) { - aclk = 0xb4; bclk = 0x51; } - - stv0299_writereg(fe, 0x13, aclk); - stv0299_writereg(fe, 0x14, bclk); - stv0299_writereg(fe, 0x1f, (ratio >> 16) & 0xff); - stv0299_writereg(fe, 0x20, (ratio >> 8) & 0xff); - stv0299_writereg(fe, 0x21, (ratio) & 0xf0); - - return 0; -} - -static u8 sharp_z0194a__inittab[] = { - 0x01, 0x15, - 0x02, 0x00, - 0x03, 0x00, - 0x04, 0x7d, /* F22FR = 0x7d, F22 = f_VCO / 128 / 0x7d = 22 kHz */ - 0x05, 0x35, /* I2CT = 0, SCLT = 1, SDAT = 1 */ - 0x06, 0x40, /* DAC not used, set to high impendance mode */ - 0x07, 0x00, /* DAC LSB */ - 0x08, 0x40, /* DiSEqC off, LNB power on OP2/LOCK pin on */ - 0x09, 0x00, /* FIFO */ - 0x0c, 0x51, /* OP1 ctl = Normal, OP1 val = 1 (LNB Power ON) */ - 0x0d, 0x82, /* DC offset compensation = ON, beta_agc1 = 2 */ - 0x0e, 0x23, /* alpha_tmg = 2, beta_tmg = 3 */ - 0x10, 0x3f, /* AGC2 0x3d */ - 0x11, 0x84, - 0x12, 0xb9, - 0x15, 0xc9, /* lock detector threshold */ - 0x16, 0x00, - 0x17, 0x00, - 0x18, 0x00, - 0x19, 0x00, - 0x1a, 0x00, - 0x1f, 0x50, - 0x20, 0x00, - 0x21, 0x00, - 0x22, 0x00, - 0x23, 0x00, - 0x28, 0x00, /* out imp: normal out type: parallel FEC mode:0 */ - 0x29, 0x1e, /* 1/2 threshold */ - 0x2a, 0x14, /* 2/3 threshold */ - 0x2b, 0x0f, /* 3/4 threshold */ - 0x2c, 0x09, /* 5/6 threshold */ - 0x2d, 0x05, /* 7/8 threshold */ - 0x2e, 0x01, - 0x31, 0x1f, /* test all FECs */ - 0x32, 0x19, /* viterbi and synchro search */ - 0x33, 0xfc, /* rs control */ - 0x34, 0x93, /* error control */ - 0x0f, 0x52, - 0xff, 0xff -}; - -static struct stv0299_config sharp_z0194a_config = { - .demod_address = 0x68, - .inittab = sharp_z0194a__inittab, - .mclk = 88000000UL, - .invert = 1, - .skip_reinit = 0, - .lock_output = STV0299_LOCKOUTPUT_1, - .volt13_op0_op1 = STV0299_VOLT13_OP1, - .min_delay_ms = 100, - .set_symbol_rate = sharp_z0194a__set_symbol_rate, -}; - -#endif diff --git a/trunk/drivers/media/dvb/siano/smscoreapi.c b/trunk/drivers/media/dvb/siano/smscoreapi.c index c5f45fed69dc..b4b8ed795c95 100644 --- a/trunk/drivers/media/dvb/siano/smscoreapi.c +++ b/trunk/drivers/media/dvb/siano/smscoreapi.c @@ -110,12 +110,12 @@ struct smscore_registry_entry_t { enum sms_device_type_st type; }; -static struct list_head g_smscore_notifyees; -static struct list_head g_smscore_devices; -static struct mutex g_smscore_deviceslock; +struct list_head g_smscore_notifyees; +struct list_head g_smscore_devices; +struct mutex g_smscore_deviceslock; -static struct list_head g_smscore_registry; -static struct mutex g_smscore_registrylock; +struct list_head g_smscore_registry; +struct mutex g_smscore_registrylock; static int default_mode = 4; @@ -1187,7 +1187,7 @@ int smsclient_sendrequest(struct smscore_client_t *client, } -static int __init smscore_module_init(void) +int smscore_module_init(void) { int rc = 0; @@ -1209,7 +1209,7 @@ static int __init smscore_module_init(void) return rc; } -static void __exit smscore_module_exit(void) +void smscore_module_exit(void) { kmutex_lock(&g_smscore_deviceslock); diff --git a/trunk/drivers/media/dvb/siano/smsdvb.c b/trunk/drivers/media/dvb/siano/smsdvb.c index 229274a14110..6f9c18563867 100644 --- a/trunk/drivers/media/dvb/siano/smsdvb.c +++ b/trunk/drivers/media/dvb/siano/smsdvb.c @@ -27,8 +27,8 @@ DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr); -static struct list_head g_smsdvb_clients; -static struct mutex g_smsdvb_clientslock; +struct list_head g_smsdvb_clients; +struct mutex g_smsdvb_clientslock; static int smsdvb_onresponse(void *context, struct smscore_buffer_t *cb) { diff --git a/trunk/drivers/media/dvb/ttpci/Kconfig b/trunk/drivers/media/dvb/ttpci/Kconfig index 41b5a988b619..87c973ac668b 100644 --- a/trunk/drivers/media/dvb/ttpci/Kconfig +++ b/trunk/drivers/media/dvb/ttpci/Kconfig @@ -5,6 +5,8 @@ config TTPCI_EEPROM config DVB_AV7110 tristate "AV7110 cards" depends on DVB_CORE && PCI && I2C + depends on HOTPLUG + select FW_LOADER if !DVB_AV7110_FIRMWARE select TTPCI_EEPROM select VIDEO_SAA7146_VV depends on VIDEO_DEV # dependencies of VIDEO_SAA7146_VV @@ -125,12 +127,14 @@ config DVB_BUDGET_AV depends on DVB_BUDGET_CORE && I2C select VIDEO_SAA7146_VV depends on VIDEO_DEV # dependencies of VIDEO_SAA7146_VV + depends on HOTPLUG # dependency of FW_LOADER select DVB_PLL if !DVB_FE_CUSTOMISE select DVB_STV0299 if !DVB_FE_CUSTOMISE select DVB_TDA1004X if !DVB_FE_CUSTOMISE select DVB_TDA10021 if !DVB_FE_CUSTOMISE select DVB_TDA10023 if !DVB_FE_CUSTOMISE select DVB_TUA6100 if !DVB_FE_CUSTOMISE + select FW_LOADER help Support for simple SAA7146 based DVB cards (so called Budget- or Nova-PCI cards) without onboard diff --git a/trunk/drivers/media/dvb/ttusb-dec/Kconfig b/trunk/drivers/media/dvb/ttusb-dec/Kconfig index d5f48a3102bd..a23cc0aa17d3 100644 --- a/trunk/drivers/media/dvb/ttusb-dec/Kconfig +++ b/trunk/drivers/media/dvb/ttusb-dec/Kconfig @@ -1,6 +1,8 @@ config DVB_TTUSB_DEC tristate "Technotrend/Hauppauge USB DEC devices" depends on DVB_CORE && USB && INPUT + depends on HOTPLUG # due to FW_LOADER + select FW_LOADER select CRC32 help Support for external USB adapters designed by Technotrend and diff --git a/trunk/drivers/media/radio/dsbr100.c b/trunk/drivers/media/radio/dsbr100.c index 1ed88f3abe61..4e3f83e4e48f 100644 --- a/trunk/drivers/media/radio/dsbr100.c +++ b/trunk/drivers/media/radio/dsbr100.c @@ -85,7 +85,6 @@ #include #include #include -#include #include /* @@ -445,7 +444,14 @@ static const struct file_operations usb_dsbr100_fops = { .llseek = no_llseek, }; -static const struct v4l2_ioctl_ops usb_dsbr100_ioctl_ops = { +/* V4L2 interface */ +static struct video_device dsbr100_videodev_template = +{ + .owner = THIS_MODULE, + .name = "D-Link DSB-R 100", + .type = VID_TYPE_TUNER, + .fops = &usb_dsbr100_fops, + .release = video_device_release, .vidioc_querycap = vidioc_querycap, .vidioc_g_tuner = vidioc_g_tuner, .vidioc_s_tuner = vidioc_s_tuner, @@ -460,14 +466,6 @@ static const struct v4l2_ioctl_ops usb_dsbr100_ioctl_ops = { .vidioc_s_input = vidioc_s_input, }; -/* V4L2 interface */ -static struct video_device dsbr100_videodev_template = { - .name = "D-Link DSB-R 100", - .fops = &usb_dsbr100_fops, - .ioctl_ops = &usb_dsbr100_ioctl_ops, - .release = video_device_release, -}; - /* check if the device is present and register with v4l and usb if it is */ static int usb_dsbr100_probe(struct usb_interface *intf, diff --git a/trunk/drivers/media/radio/miropcm20-radio.c b/trunk/drivers/media/radio/miropcm20-radio.c index 7fd7ee2d32c1..09fe6f1cdf14 100644 --- a/trunk/drivers/media/radio/miropcm20-radio.c +++ b/trunk/drivers/media/radio/miropcm20-radio.c @@ -23,7 +23,6 @@ #include #include #include -#include #include "oss/aci.h" #include "miropcm20-rds-core.h" @@ -229,7 +228,9 @@ static const struct file_operations pcm20_fops = { }; static struct video_device pcm20_radio = { + .owner = THIS_MODULE, .name = "Miro PCM 20 radio", + .type = VID_TYPE_TUNER, .fops = &pcm20_fops, .priv = &pcm20_unit }; diff --git a/trunk/drivers/media/radio/radio-aimslab.c b/trunk/drivers/media/radio/radio-aimslab.c index eba9209b3024..1ec18ed1a733 100644 --- a/trunk/drivers/media/radio/radio-aimslab.c +++ b/trunk/drivers/media/radio/radio-aimslab.c @@ -36,7 +36,6 @@ #include /* copy to/from user */ #include /* kernel radio structs */ #include -#include #include /* for KERNEL_VERSION MACRO */ #define RADIO_VERSION KERNEL_VERSION(0,0,2) @@ -389,7 +388,12 @@ static const struct file_operations rtrack_fops = { .llseek = no_llseek, }; -static const struct v4l2_ioctl_ops rtrack_ioctl_ops = { +static struct video_device rtrack_radio= +{ + .owner = THIS_MODULE, + .name = "RadioTrack radio", + .type = VID_TYPE_TUNER, + .fops = &rtrack_fops, .vidioc_querycap = vidioc_querycap, .vidioc_g_tuner = vidioc_g_tuner, .vidioc_s_tuner = vidioc_s_tuner, @@ -404,12 +408,6 @@ static const struct v4l2_ioctl_ops rtrack_ioctl_ops = { .vidioc_s_ctrl = vidioc_s_ctrl, }; -static struct video_device rtrack_radio = { - .name = "RadioTrack radio", - .fops = &rtrack_fops, - .ioctl_ops = &rtrack_ioctl_ops, -}; - static int __init rtrack_init(void) { if(io==-1) diff --git a/trunk/drivers/media/radio/radio-aztech.c b/trunk/drivers/media/radio/radio-aztech.c index 3fe5504428c5..46cdb549eac7 100644 --- a/trunk/drivers/media/radio/radio-aztech.c +++ b/trunk/drivers/media/radio/radio-aztech.c @@ -33,7 +33,6 @@ #include /* copy to/from user */ #include /* kernel radio structs */ #include -#include #include /* for KERNEL_VERSION MACRO */ #define RADIO_VERSION KERNEL_VERSION(0,0,2) @@ -353,7 +352,12 @@ static const struct file_operations aztech_fops = { .llseek = no_llseek, }; -static const struct v4l2_ioctl_ops aztech_ioctl_ops = { +static struct video_device aztech_radio= +{ + .owner = THIS_MODULE, + .name = "Aztech radio", + .type = VID_TYPE_TUNER, + .fops = &aztech_fops, .vidioc_querycap = vidioc_querycap, .vidioc_g_tuner = vidioc_g_tuner, .vidioc_s_tuner = vidioc_s_tuner, @@ -368,12 +372,6 @@ static const struct v4l2_ioctl_ops aztech_ioctl_ops = { .vidioc_s_ctrl = vidioc_s_ctrl, }; -static struct video_device aztech_radio = { - .name = "Aztech radio", - .fops = &aztech_fops, - .ioctl_ops = &aztech_ioctl_ops, -}; - module_param_named(debug,aztech_radio.debug, int, 0644); MODULE_PARM_DESC(debug,"activates debug info"); diff --git a/trunk/drivers/media/radio/radio-cadet.c b/trunk/drivers/media/radio/radio-cadet.c index 6166e726ed72..b14db53ea456 100644 --- a/trunk/drivers/media/radio/radio-cadet.c +++ b/trunk/drivers/media/radio/radio-cadet.c @@ -39,7 +39,6 @@ #include /* copy to/from user */ #include /* V4L2 API defs */ #include -#include #include #include @@ -570,7 +569,12 @@ static const struct file_operations cadet_fops = { .llseek = no_llseek, }; -static const struct v4l2_ioctl_ops cadet_ioctl_ops = { +static struct video_device cadet_radio= +{ + .owner = THIS_MODULE, + .name = "Cadet radio", + .type = VID_TYPE_TUNER, + .fops = &cadet_fops, .vidioc_querycap = vidioc_querycap, .vidioc_g_tuner = vidioc_g_tuner, .vidioc_s_tuner = vidioc_s_tuner, @@ -585,12 +589,6 @@ static const struct v4l2_ioctl_ops cadet_ioctl_ops = { .vidioc_s_input = vidioc_s_input, }; -static struct video_device cadet_radio = { - .name = "Cadet radio", - .fops = &cadet_fops, - .ioctl_ops = &cadet_ioctl_ops, -}; - #ifdef CONFIG_PNP static struct pnp_device_id cadet_pnp_devices[] = { diff --git a/trunk/drivers/media/radio/radio-gemtek-pci.c b/trunk/drivers/media/radio/radio-gemtek-pci.c index 36e754e3ffb2..de49be971480 100644 --- a/trunk/drivers/media/radio/radio-gemtek-pci.c +++ b/trunk/drivers/media/radio/radio-gemtek-pci.c @@ -46,7 +46,6 @@ #include #include #include -#include #include #include /* for KERNEL_VERSION MACRO */ @@ -375,7 +374,11 @@ static const struct file_operations gemtek_pci_fops = { .llseek = no_llseek, }; -static const struct v4l2_ioctl_ops gemtek_pci_ioctl_ops = { +static struct video_device vdev_template = { + .owner = THIS_MODULE, + .name = "Gemtek PCI Radio", + .type = VID_TYPE_TUNER, + .fops = &gemtek_pci_fops, .vidioc_querycap = vidioc_querycap, .vidioc_g_tuner = vidioc_g_tuner, .vidioc_s_tuner = vidioc_s_tuner, @@ -390,12 +393,6 @@ static const struct v4l2_ioctl_ops gemtek_pci_ioctl_ops = { .vidioc_s_ctrl = vidioc_s_ctrl, }; -static struct video_device vdev_template = { - .name = "Gemtek PCI Radio", - .fops = &gemtek_pci_fops, - .ioctl_ops = &gemtek_pci_ioctl_ops, -}; - static int __devinit gemtek_pci_probe( struct pci_dev *pci_dev, const struct pci_device_id *pci_id ) { struct gemtek_pci_card *card; diff --git a/trunk/drivers/media/radio/radio-gemtek.c b/trunk/drivers/media/radio/radio-gemtek.c index 2b1a6221de6d..81f6aeb1cd11 100644 --- a/trunk/drivers/media/radio/radio-gemtek.c +++ b/trunk/drivers/media/radio/radio-gemtek.c @@ -23,7 +23,6 @@ #include /* outb, outb_p */ #include /* copy to/from user */ #include /* kernel radio structs */ -#include #include #include @@ -553,7 +552,11 @@ static int vidioc_s_audio(struct file *file, void *priv, struct v4l2_audio *a) return 0; } -static const struct v4l2_ioctl_ops gemtek_ioctl_ops = { +static struct video_device gemtek_radio = { + .owner = THIS_MODULE, + .name = "GemTek Radio card", + .type = VID_TYPE_TUNER, + .fops = &gemtek_fops, .vidioc_querycap = vidioc_querycap, .vidioc_g_tuner = vidioc_g_tuner, .vidioc_s_tuner = vidioc_s_tuner, @@ -568,12 +571,6 @@ static const struct v4l2_ioctl_ops gemtek_ioctl_ops = { .vidioc_s_ctrl = vidioc_s_ctrl }; -static struct video_device gemtek_radio = { - .name = "GemTek Radio card", - .fops = &gemtek_fops, - .ioctl_ops = &gemtek_ioctl_ops, -}; - /* * Initialization / cleanup related stuff. */ diff --git a/trunk/drivers/media/radio/radio-maestro.c b/trunk/drivers/media/radio/radio-maestro.c index 0ada1c697e8a..bddd3c409aa9 100644 --- a/trunk/drivers/media/radio/radio-maestro.c +++ b/trunk/drivers/media/radio/radio-maestro.c @@ -27,7 +27,6 @@ #include #include #include -#include #include /* for KERNEL_VERSION MACRO */ #define RADIO_VERSION KERNEL_VERSION(0,0,6) @@ -355,7 +354,10 @@ static u16 __devinit radio_power_on(struct radio_device *dev) return (ofreq == radio_bits_get(dev)); } -static const struct v4l2_ioctl_ops maestro_ioctl_ops = { +static struct video_device maestro_radio = { + .name = "Maestro radio", + .type = VID_TYPE_TUNER, + .fops = &maestro_fops, .vidioc_querycap = vidioc_querycap, .vidioc_g_tuner = vidioc_g_tuner, .vidioc_s_tuner = vidioc_s_tuner, @@ -370,12 +372,6 @@ static const struct v4l2_ioctl_ops maestro_ioctl_ops = { .vidioc_s_ctrl = vidioc_s_ctrl, }; -static struct video_device maestro_radio = { - .name = "Maestro radio", - .fops = &maestro_fops, - .ioctl_ops = &maestro_ioctl_ops, -}; - static int __devinit maestro_probe(struct pci_dev *pdev, const struct pci_device_id *ent) { diff --git a/trunk/drivers/media/radio/radio-maxiradio.c b/trunk/drivers/media/radio/radio-maxiradio.c index 43c75497dc49..0133ecf3e040 100644 --- a/trunk/drivers/media/radio/radio-maxiradio.c +++ b/trunk/drivers/media/radio/radio-maxiradio.c @@ -44,7 +44,6 @@ #include #include #include -#include #define DRIVER_VERSION "0.77" @@ -374,7 +373,13 @@ static int vidioc_s_ctrl (struct file *file, void *priv, return -EINVAL; } -static const struct v4l2_ioctl_ops maxiradio_ioctl_ops = { +static struct video_device maxiradio_radio = +{ + .owner = THIS_MODULE, + .name = "Maxi Radio FM2000 radio", + .type = VID_TYPE_TUNER, + .fops = &maxiradio_fops, + .vidioc_querycap = vidioc_querycap, .vidioc_g_tuner = vidioc_g_tuner, .vidioc_s_tuner = vidioc_s_tuner, @@ -389,12 +394,6 @@ static const struct v4l2_ioctl_ops maxiradio_ioctl_ops = { .vidioc_s_ctrl = vidioc_s_ctrl, }; -static struct video_device maxiradio_radio = { - .name = "Maxi Radio FM2000 radio", - .fops = &maxiradio_fops, - .ioctl_ops = &maxiradio_ioctl_ops, -}; - static int __devinit maxiradio_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) { if(!request_region(pci_resource_start(pdev, 0), diff --git a/trunk/drivers/media/radio/radio-rtrack2.c b/trunk/drivers/media/radio/radio-rtrack2.c index e2dde0807268..070802103dc3 100644 --- a/trunk/drivers/media/radio/radio-rtrack2.c +++ b/trunk/drivers/media/radio/radio-rtrack2.c @@ -17,7 +17,6 @@ #include /* copy to/from user */ #include /* kernel radio structs */ #include -#include #include #include /* for KERNEL_VERSION MACRO */ @@ -295,7 +294,12 @@ static const struct file_operations rtrack2_fops = { .llseek = no_llseek, }; -static const struct v4l2_ioctl_ops rtrack2_ioctl_ops = { +static struct video_device rtrack2_radio= +{ + .owner = THIS_MODULE, + .name = "RadioTrack II radio", + .type = VID_TYPE_TUNER, + .fops = &rtrack2_fops, .vidioc_querycap = vidioc_querycap, .vidioc_g_tuner = vidioc_g_tuner, .vidioc_s_tuner = vidioc_s_tuner, @@ -310,12 +314,6 @@ static const struct v4l2_ioctl_ops rtrack2_ioctl_ops = { .vidioc_s_input = vidioc_s_input, }; -static struct video_device rtrack2_radio = { - .name = "RadioTrack II radio", - .fops = &rtrack2_fops, - .ioctl_ops = &rtrack2_ioctl_ops, -}; - static int __init rtrack2_init(void) { if(io==-1) diff --git a/trunk/drivers/media/radio/radio-sf16fmi.c b/trunk/drivers/media/radio/radio-sf16fmi.c index bb5d92f104af..66e052fd3909 100644 --- a/trunk/drivers/media/radio/radio-sf16fmi.c +++ b/trunk/drivers/media/radio/radio-sf16fmi.c @@ -24,7 +24,6 @@ #include /* udelay */ #include /* kernel radio structs */ #include -#include #include #include /* outb, outb_p */ #include /* copy to/from user */ @@ -295,7 +294,12 @@ static const struct file_operations fmi_fops = { .llseek = no_llseek, }; -static const struct v4l2_ioctl_ops fmi_ioctl_ops = { +static struct video_device fmi_radio= +{ + .owner = THIS_MODULE, + .name = "SF16FMx radio", + .type = VID_TYPE_TUNER, + .fops = &fmi_fops, .vidioc_querycap = vidioc_querycap, .vidioc_g_tuner = vidioc_g_tuner, .vidioc_s_tuner = vidioc_s_tuner, @@ -310,12 +314,6 @@ static const struct v4l2_ioctl_ops fmi_ioctl_ops = { .vidioc_s_ctrl = vidioc_s_ctrl, }; -static struct video_device fmi_radio = { - .name = "SF16FMx radio", - .fops = &fmi_fops, - .ioctl_ops = &fmi_ioctl_ops, -}; - /* ladis: this is my card. does any other types exist? */ static struct isapnp_device_id id_table[] __devinitdata = { { ISAPNP_ANY_ID, ISAPNP_ANY_ID, diff --git a/trunk/drivers/media/radio/radio-sf16fmr2.c b/trunk/drivers/media/radio/radio-sf16fmr2.c index 6290553d24be..b0ccf7cb5952 100644 --- a/trunk/drivers/media/radio/radio-sf16fmr2.c +++ b/trunk/drivers/media/radio/radio-sf16fmr2.c @@ -22,7 +22,6 @@ #include /* copy to/from user */ #include /* kernel radio structs */ #include -#include #include static struct mutex lock; @@ -411,7 +410,12 @@ static const struct file_operations fmr2_fops = { .llseek = no_llseek, }; -static const struct v4l2_ioctl_ops fmr2_ioctl_ops = { +static struct video_device fmr2_radio= +{ + .owner = THIS_MODULE, + .name = "SF16FMR2 radio", + . type = VID_TYPE_TUNER, + .fops = &fmr2_fops, .vidioc_querycap = vidioc_querycap, .vidioc_g_tuner = vidioc_g_tuner, .vidioc_s_tuner = vidioc_s_tuner, @@ -426,12 +430,6 @@ static const struct v4l2_ioctl_ops fmr2_ioctl_ops = { .vidioc_s_ctrl = vidioc_s_ctrl, }; -static struct video_device fmr2_radio = { - .name = "SF16FMR2 radio", - .fops = &fmr2_fops, - .ioctl_ops = &fmr2_ioctl_ops, -}; - static int __init fmr2_init(void) { fmr2_unit.port = io; diff --git a/trunk/drivers/media/radio/radio-si470x.c b/trunk/drivers/media/radio/radio-si470x.c index a4984ff87c9c..dc93a882b385 100644 --- a/trunk/drivers/media/radio/radio-si470x.c +++ b/trunk/drivers/media/radio/radio-si470x.c @@ -133,7 +133,6 @@ #include #include #include -#include #include #include @@ -1586,7 +1585,15 @@ static int si470x_vidioc_s_hw_freq_seek(struct file *file, void *priv, return retval; } -static const struct v4l2_ioctl_ops si470x_ioctl_ops = { + +/* + * si470x_viddev_tamples - video device interface + */ +static struct video_device si470x_viddev_template = { + .fops = &si470x_fops, + .name = DRIVER_NAME, + .type = VID_TYPE_TUNER, + .release = video_device_release, .vidioc_querycap = si470x_vidioc_querycap, .vidioc_g_input = si470x_vidioc_g_input, .vidioc_s_input = si470x_vidioc_s_input, @@ -1600,16 +1607,7 @@ static const struct v4l2_ioctl_ops si470x_ioctl_ops = { .vidioc_g_frequency = si470x_vidioc_g_frequency, .vidioc_s_frequency = si470x_vidioc_s_frequency, .vidioc_s_hw_freq_seek = si470x_vidioc_s_hw_freq_seek, -}; - -/* - * si470x_viddev_tamples - video device interface - */ -static struct video_device si470x_viddev_template = { - .fops = &si470x_fops, - .ioctl_ops = &si470x_ioctl_ops, - .name = DRIVER_NAME, - .release = video_device_release, + .owner = THIS_MODULE, }; diff --git a/trunk/drivers/media/radio/radio-terratec.c b/trunk/drivers/media/radio/radio-terratec.c index cefa44fc5aed..acc32080e9bd 100644 --- a/trunk/drivers/media/radio/radio-terratec.c +++ b/trunk/drivers/media/radio/radio-terratec.c @@ -32,7 +32,6 @@ #include /* copy to/from user */ #include /* kernel radio structs */ #include -#include #include #include /* for KERNEL_VERSION MACRO */ @@ -367,7 +366,12 @@ static const struct file_operations terratec_fops = { .llseek = no_llseek, }; -static const struct v4l2_ioctl_ops terratec_ioctl_ops = { +static struct video_device terratec_radio= +{ + .owner = THIS_MODULE, + .name = "TerraTec ActiveRadio", + .type = VID_TYPE_TUNER, + .fops = &terratec_fops, .vidioc_querycap = vidioc_querycap, .vidioc_g_tuner = vidioc_g_tuner, .vidioc_s_tuner = vidioc_s_tuner, @@ -382,12 +386,6 @@ static const struct v4l2_ioctl_ops terratec_ioctl_ops = { .vidioc_s_input = vidioc_s_input, }; -static struct video_device terratec_radio = { - .name = "TerraTec ActiveRadio", - .fops = &terratec_fops, - .ioctl_ops = &terratec_ioctl_ops, -}; - static int __init terratec_init(void) { if(io==-1) diff --git a/trunk/drivers/media/radio/radio-trust.c b/trunk/drivers/media/radio/radio-trust.c index d70172d23edb..4ebdfbadeb9c 100644 --- a/trunk/drivers/media/radio/radio-trust.c +++ b/trunk/drivers/media/radio/radio-trust.c @@ -23,7 +23,6 @@ #include #include #include -#include #include /* for KERNEL_VERSION MACRO */ #define RADIO_VERSION KERNEL_VERSION(0,0,2) @@ -347,7 +346,12 @@ static const struct file_operations trust_fops = { .llseek = no_llseek, }; -static const struct v4l2_ioctl_ops trust_ioctl_ops = { +static struct video_device trust_radio= +{ + .owner = THIS_MODULE, + .name = "Trust FM Radio", + .type = VID_TYPE_TUNER, + .fops = &trust_fops, .vidioc_querycap = vidioc_querycap, .vidioc_g_tuner = vidioc_g_tuner, .vidioc_s_tuner = vidioc_s_tuner, @@ -362,12 +366,6 @@ static const struct v4l2_ioctl_ops trust_ioctl_ops = { .vidioc_s_input = vidioc_s_input, }; -static struct video_device trust_radio = { - .name = "Trust FM Radio", - .fops = &trust_fops, - .ioctl_ops = &trust_ioctl_ops, -}; - static int __init trust_init(void) { if(io == -1) { diff --git a/trunk/drivers/media/radio/radio-typhoon.c b/trunk/drivers/media/radio/radio-typhoon.c index f8d62cfea774..18f2abd7e255 100644 --- a/trunk/drivers/media/radio/radio-typhoon.c +++ b/trunk/drivers/media/radio/radio-typhoon.c @@ -40,7 +40,6 @@ #include /* copy to/from user */ #include /* kernel radio structs */ #include -#include #include /* for KERNEL_VERSION MACRO */ #define RADIO_VERSION KERNEL_VERSION(0,1,1) @@ -345,7 +344,12 @@ static const struct file_operations typhoon_fops = { .llseek = no_llseek, }; -static const struct v4l2_ioctl_ops typhoon_ioctl_ops = { +static struct video_device typhoon_radio = +{ + .owner = THIS_MODULE, + .name = "Typhoon Radio", + .type = VID_TYPE_TUNER, + .fops = &typhoon_fops, .vidioc_querycap = vidioc_querycap, .vidioc_g_tuner = vidioc_g_tuner, .vidioc_s_tuner = vidioc_s_tuner, @@ -360,12 +364,6 @@ static const struct v4l2_ioctl_ops typhoon_ioctl_ops = { .vidioc_s_ctrl = vidioc_s_ctrl, }; -static struct video_device typhoon_radio = { - .name = "Typhoon Radio", - .fops = &typhoon_fops, - .ioctl_ops = &typhoon_ioctl_ops, -}; - #ifdef CONFIG_RADIO_TYPHOON_PROC_FS static int typhoon_proc_show(struct seq_file *m, void *v) diff --git a/trunk/drivers/media/radio/radio-zoltrix.c b/trunk/drivers/media/radio/radio-zoltrix.c index 9f17a332fa11..43773c56c62f 100644 --- a/trunk/drivers/media/radio/radio-zoltrix.c +++ b/trunk/drivers/media/radio/radio-zoltrix.c @@ -37,7 +37,6 @@ #include /* copy to/from user */ #include /* kernel radio structs */ #include -#include #include /* for KERNEL_VERSION MACRO */ #define RADIO_VERSION KERNEL_VERSION(0,0,2) @@ -408,7 +407,12 @@ static const struct file_operations zoltrix_fops = .llseek = no_llseek, }; -static const struct v4l2_ioctl_ops zoltrix_ioctl_ops = { +static struct video_device zoltrix_radio = +{ + .owner = THIS_MODULE, + .name = "Zoltrix Radio Plus", + .type = VID_TYPE_TUNER, + .fops = &zoltrix_fops, .vidioc_querycap = vidioc_querycap, .vidioc_g_tuner = vidioc_g_tuner, .vidioc_s_tuner = vidioc_s_tuner, @@ -423,12 +427,6 @@ static const struct v4l2_ioctl_ops zoltrix_ioctl_ops = { .vidioc_s_ctrl = vidioc_s_ctrl, }; -static struct video_device zoltrix_radio = { - .name = "Zoltrix Radio Plus", - .fops = &zoltrix_fops, - .ioctl_ops = &zoltrix_ioctl_ops, -}; - static int __init zoltrix_init(void) { if (io == -1) { diff --git a/trunk/drivers/media/video/Kconfig b/trunk/drivers/media/video/Kconfig index d4a6e56a7135..f606d2951fde 100644 --- a/trunk/drivers/media/video/Kconfig +++ b/trunk/drivers/media/video/Kconfig @@ -487,6 +487,17 @@ config VIDEO_PMS To compile this driver as a module, choose M here: the module will be called pms. +config VIDEO_PLANB + tristate "PlanB Video-In on PowerMac" + depends on PPC_PMAC && VIDEO_V4L1 && BROKEN + help + PlanB is the V4L driver for the PowerMac 7x00/8x00 series video + input hardware. If you want to experiment with this, say Y. + Otherwise, or if you don't understand a word, say N. See + for more info. + + Saying M will compile this driver as a module (planb). + config VIDEO_BWQCAM tristate "Quickcam BW Video For Linux" depends on PARPORT && VIDEO_V4L1 @@ -795,7 +806,13 @@ menuconfig V4L_USB_DRIVERS if V4L_USB_DRIVERS && USB -source "drivers/media/video/uvc/Kconfig" +config USB_VIDEO_CLASS + tristate "USB Video Class (UVC)" + ---help--- + Support for the USB Video Class (UVC). Currently only video + input devices, such as webcams, are supported. + + For more information see: source "drivers/media/video/gspca/Kconfig" diff --git a/trunk/drivers/media/video/Makefile b/trunk/drivers/media/video/Makefile index bbc6f8b82297..45d5db5abb1e 100644 --- a/trunk/drivers/media/video/Makefile +++ b/trunk/drivers/media/video/Makefile @@ -10,8 +10,6 @@ msp3400-objs := msp3400-driver.o msp3400-kthreads.o stkwebcam-objs := stk-webcam.o stk-sensor.o -videodev-objs := v4l2-dev.o v4l2-ioctl.o - obj-$(CONFIG_VIDEO_DEV) += videodev.o compat_ioctl32.o v4l2-int-device.o obj-$(CONFIG_VIDEO_V4L2_COMMON) += v4l2-common.o @@ -57,6 +55,7 @@ obj-$(CONFIG_VIDEO_ZORAN_DC30) += zr36050.o zr36016.o obj-$(CONFIG_VIDEO_ZORAN_ZR36060) += zr36060.o obj-$(CONFIG_VIDEO_PMS) += pms.o +obj-$(CONFIG_VIDEO_PLANB) += planb.o obj-$(CONFIG_VIDEO_VINO) += vino.o indycam.o obj-$(CONFIG_VIDEO_STRADIS) += stradis.o obj-$(CONFIG_VIDEO_CPIA) += cpia.o diff --git a/trunk/drivers/media/video/arv.c b/trunk/drivers/media/video/arv.c index 56ebfd5ef6fa..8c7d1958856b 100644 --- a/trunk/drivers/media/video/arv.c +++ b/trunk/drivers/media/video/arv.c @@ -754,6 +754,7 @@ static const struct file_operations ar_fops = { }; static struct video_device ar_template = { + .owner = THIS_MODULE, .name = "Colour AR VGA", .type = VID_TYPE_CAPTURE, .fops = &ar_fops, diff --git a/trunk/drivers/media/video/au0828/Kconfig b/trunk/drivers/media/video/au0828/Kconfig index ed9a50f189fc..52b2491581a8 100644 --- a/trunk/drivers/media/video/au0828/Kconfig +++ b/trunk/drivers/media/video/au0828/Kconfig @@ -6,7 +6,6 @@ config VIDEO_AU0828 select VIDEO_TVEEPROM select DVB_AU8522 if !DVB_FE_CUSTOMIZE select MEDIA_TUNER_XC5000 if !DVB_FE_CUSTOMIZE - select MEDIA_TUNER_MXL5007T if !DVB_FE_CUSTOMIZE ---help--- This is a video4linux driver for Auvitek's USB device. diff --git a/trunk/drivers/media/video/au0828/au0828-cards.c b/trunk/drivers/media/video/au0828/au0828-cards.c index 443e59009762..898e12395e7c 100644 --- a/trunk/drivers/media/video/au0828/au0828-cards.c +++ b/trunk/drivers/media/video/au0828/au0828-cards.c @@ -32,9 +32,6 @@ struct au0828_board au0828_boards[] = { [AU0828_BOARD_HAUPPAUGE_HVR950Q] = { .name = "Hauppauge HVR950Q", }, - [AU0828_BOARD_HAUPPAUGE_HVR950Q_MXL] = { - .name = "Hauppauge HVR950Q rev xxF8", - }, [AU0828_BOARD_DVICO_FUSIONHDTV7] = { .name = "DViCO FusionHDTV USB", }, @@ -52,7 +49,6 @@ int au0828_tuner_callback(void *priv, int command, int arg) switch (dev->board) { case AU0828_BOARD_HAUPPAUGE_HVR850: case AU0828_BOARD_HAUPPAUGE_HVR950Q: - case AU0828_BOARD_HAUPPAUGE_HVR950Q_MXL: case AU0828_BOARD_DVICO_FUSIONHDTV7: if (command == 0) { /* Tuner Reset Command from xc5000 */ @@ -114,7 +110,6 @@ void au0828_card_setup(struct au0828_dev *dev) switch (dev->board) { case AU0828_BOARD_HAUPPAUGE_HVR850: case AU0828_BOARD_HAUPPAUGE_HVR950Q: - case AU0828_BOARD_HAUPPAUGE_HVR950Q_MXL: if (dev->i2c_rc == 0) hauppauge_eeprom(dev, eeprom+0xa0); break; @@ -133,7 +128,6 @@ void au0828_gpio_setup(struct au0828_dev *dev) switch (dev->board) { case AU0828_BOARD_HAUPPAUGE_HVR850: case AU0828_BOARD_HAUPPAUGE_HVR950Q: - case AU0828_BOARD_HAUPPAUGE_HVR950Q_MXL: /* GPIO's * 4 - CS5340 * 5 - AU8522 Demodulator @@ -199,12 +193,6 @@ struct usb_device_id au0828_usb_id_table [] = { .driver_info = AU0828_BOARD_HAUPPAUGE_HVR950Q }, { USB_DEVICE(0x0fd9, 0x0008), .driver_info = AU0828_BOARD_HAUPPAUGE_HVR950Q }, - { USB_DEVICE(0x2040, 0x7201), - .driver_info = AU0828_BOARD_HAUPPAUGE_HVR950Q_MXL }, - { USB_DEVICE(0x2040, 0x7211), - .driver_info = AU0828_BOARD_HAUPPAUGE_HVR950Q_MXL }, - { USB_DEVICE(0x2040, 0x7281), - .driver_info = AU0828_BOARD_HAUPPAUGE_HVR950Q_MXL }, { }, }; diff --git a/trunk/drivers/media/video/au0828/au0828-cards.h b/trunk/drivers/media/video/au0828/au0828-cards.h index c37f5fd0fa80..e26f54a961d0 100644 --- a/trunk/drivers/media/video/au0828/au0828-cards.h +++ b/trunk/drivers/media/video/au0828/au0828-cards.h @@ -23,4 +23,3 @@ #define AU0828_BOARD_HAUPPAUGE_HVR950Q 1 #define AU0828_BOARD_HAUPPAUGE_HVR850 2 #define AU0828_BOARD_DVICO_FUSIONHDTV7 3 -#define AU0828_BOARD_HAUPPAUGE_HVR950Q_MXL 4 diff --git a/trunk/drivers/media/video/au0828/au0828-dvb.c b/trunk/drivers/media/video/au0828/au0828-dvb.c index 584a83a94a2a..c6d470590380 100644 --- a/trunk/drivers/media/video/au0828/au0828-dvb.c +++ b/trunk/drivers/media/video/au0828/au0828-dvb.c @@ -28,7 +28,6 @@ #include "au0828.h" #include "au8522.h" #include "xc5000.h" -#include "mxl5007t.h" DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr); @@ -46,11 +45,6 @@ static struct xc5000_config hauppauge_hvr950q_tunerconfig = { .tuner_callback = au0828_tuner_callback }; -static struct mxl5007t_config mxl5007t_hvr950q_config = { - .xtal_freq_hz = MxL_XTAL_24_MHZ, - .if_freq_hz = MxL_IF_6_MHZ, -}; - /*-------------------------------------------------------------------*/ static void urb_completion(struct urb *purb) { @@ -348,15 +342,6 @@ int au0828_dvb_register(struct au0828_dev *dev) &dev->i2c_adap, &hauppauge_hvr950q_tunerconfig, dev); break; - case AU0828_BOARD_HAUPPAUGE_HVR950Q_MXL: - dvb->frontend = dvb_attach(au8522_attach, - &hauppauge_hvr950q_config, - &dev->i2c_adap); - if (dvb->frontend != NULL) - dvb_attach(mxl5007t_attach, dvb->frontend, - &dev->i2c_adap, 0x60, - &mxl5007t_hvr950q_config); - break; default: printk(KERN_WARNING "The frontend of your DVB/ATSC card " "isn't supported yet\n"); diff --git a/trunk/drivers/media/video/bt8xx/Kconfig b/trunk/drivers/media/video/bt8xx/Kconfig index ce71e8e7b835..24a34fc1f2b3 100644 --- a/trunk/drivers/media/video/bt8xx/Kconfig +++ b/trunk/drivers/media/video/bt8xx/Kconfig @@ -1,7 +1,9 @@ config VIDEO_BT848 tristate "BT848 Video For Linux" depends on VIDEO_DEV && PCI && I2C && VIDEO_V4L2 && INPUT + depends on HOTPLUG # due to FW_LOADER select I2C_ALGOBIT + select FW_LOADER select VIDEO_BTCX select VIDEOBUF_DMA_SG select VIDEO_IR diff --git a/trunk/drivers/media/video/bt8xx/bttv-driver.c b/trunk/drivers/media/video/bt8xx/bttv-driver.c index 85bf31ab8789..0ea559a7fe59 100644 --- a/trunk/drivers/media/video/bt8xx/bttv-driver.c +++ b/trunk/drivers/media/video/bt8xx/bttv-driver.c @@ -45,7 +45,6 @@ #include #include "bttvp.h" #include -#include #include #include @@ -164,8 +163,8 @@ MODULE_LICENSE("GPL"); static ssize_t show_card(struct device *cd, struct device_attribute *attr, char *buf) { - struct video_device *vfd = container_of(cd, struct video_device, dev); - struct bttv *btv = dev_get_drvdata(vfd->parent); + struct video_device *vfd = container_of(cd, struct video_device, class_dev); + struct bttv *btv = dev_get_drvdata(vfd->dev); return sprintf(buf, "%d\n", btv ? btv->c.type : UNSET); } static DEVICE_ATTR(card, S_IRUGO, show_card, NULL); @@ -3358,7 +3357,10 @@ static const struct file_operations bttv_fops = .poll = bttv_poll, }; -static const struct v4l2_ioctl_ops bttv_ioctl_ops = { +static struct video_device bttv_video_template = +{ + .fops = &bttv_fops, + .minor = -1, .vidioc_querycap = bttv_querycap, .vidioc_enum_fmt_vid_cap = bttv_enum_fmt_vid_cap, .vidioc_g_fmt_vid_cap = bttv_g_fmt_vid_cap, @@ -3409,14 +3411,8 @@ static const struct v4l2_ioctl_ops bttv_ioctl_ops = { .vidioc_g_register = bttv_g_register, .vidioc_s_register = bttv_s_register, #endif -}; - -static struct video_device bttv_video_template = { - .fops = &bttv_fops, - .minor = -1, - .ioctl_ops = &bttv_ioctl_ops, - .tvnorms = BTTV_NORMS, - .current_norm = V4L2_STD_PAL, + .tvnorms = BTTV_NORMS, + .current_norm = V4L2_STD_PAL, }; /* ----------------------------------------------------------------------- */ @@ -3639,7 +3635,10 @@ static const struct file_operations radio_fops = .poll = radio_poll, }; -static const struct v4l2_ioctl_ops radio_ioctl_ops = { +static struct video_device radio_template = +{ + .fops = &radio_fops, + .minor = -1, .vidioc_querycap = radio_querycap, .vidioc_g_tuner = radio_g_tuner, .vidioc_enum_input = radio_enum_input, @@ -3656,12 +3655,6 @@ static const struct v4l2_ioctl_ops radio_ioctl_ops = { .vidioc_s_frequency = bttv_s_frequency, }; -static struct video_device radio_template = { - .fops = &radio_fops, - .minor = -1, - .ioctl_ops = &radio_ioctl_ops, -}; - /* ----------------------------------------------------------------------- */ /* some debug code */ @@ -4182,7 +4175,8 @@ static irqreturn_t bttv_irq(int irq, void *dev_id) static struct video_device *vdev_init(struct bttv *btv, const struct video_device *template, - const char *type_name) + const char *type_name, + const int type) { struct video_device *vfd; @@ -4191,8 +4185,9 @@ static struct video_device *vdev_init(struct bttv *btv, return NULL; *vfd = *template; vfd->minor = -1; - vfd->parent = &btv->c.pci->dev; + vfd->dev = &btv->c.pci->dev; vfd->release = video_device_release; + vfd->type = type; vfd->debug = bttv_debug; snprintf(vfd->name, sizeof(vfd->name), "BT%d%s %s (%s)", btv->id, (btv->id==848 && btv->revision==0x12) ? "A" : "", @@ -4228,11 +4223,20 @@ static void bttv_unregister_video(struct bttv *btv) /* register video4linux devices */ static int __devinit bttv_register_video(struct bttv *btv) { - if (no_overlay > 0) + int video_type = VID_TYPE_CAPTURE | + VID_TYPE_TUNER | + VID_TYPE_CLIPPING| + VID_TYPE_SCALES; + + if (no_overlay <= 0) { + bttv_video_template.type |= VID_TYPE_OVERLAY; + } else { printk("bttv: Overlay support disabled.\n"); + } /* video */ - btv->video_dev = vdev_init(btv, &bttv_video_template, "video"); + btv->video_dev = vdev_init(btv, &bttv_video_template, + "video", video_type); if (NULL == btv->video_dev) goto err; @@ -4240,7 +4244,7 @@ static int __devinit bttv_register_video(struct bttv *btv) goto err; printk(KERN_INFO "bttv%d: registered device video%d\n", btv->c.nr,btv->video_dev->minor & 0x1f); - if (device_create_file(&btv->video_dev->dev, + if (device_create_file(&btv->video_dev->class_dev, &dev_attr_card)<0) { printk(KERN_ERR "bttv%d: device_create_file 'card' " "failed\n", btv->c.nr); @@ -4248,7 +4252,8 @@ static int __devinit bttv_register_video(struct bttv *btv) } /* vbi */ - btv->vbi_dev = vdev_init(btv, &bttv_video_template, "vbi"); + btv->vbi_dev = vdev_init(btv, &bttv_video_template, + "vbi", VID_TYPE_TUNER | VID_TYPE_TELETEXT); if (NULL == btv->vbi_dev) goto err; @@ -4260,7 +4265,8 @@ static int __devinit bttv_register_video(struct bttv *btv) if (!btv->has_radio) return 0; /* radio */ - btv->radio_dev = vdev_init(btv, &radio_template, "radio"); + btv->radio_dev = vdev_init(btv, &radio_template, + "radio", VID_TYPE_TUNER); if (NULL == btv->radio_dev) goto err; if (video_register_device(btv->radio_dev, VFL_TYPE_RADIO,radio_nr)<0) diff --git a/trunk/drivers/media/video/bt8xx/bttv-risc.c b/trunk/drivers/media/video/bt8xx/bttv-risc.c index 649682aac1ac..0af586876e72 100644 --- a/trunk/drivers/media/video/bt8xx/bttv-risc.c +++ b/trunk/drivers/media/video/bt8xx/bttv-risc.c @@ -31,7 +31,6 @@ #include #include #include -#include #include "bttvp.h" diff --git a/trunk/drivers/media/video/bt8xx/bttv-vbi.c b/trunk/drivers/media/video/bt8xx/bttv-vbi.c index 6819e21a3773..68f28e5fa040 100644 --- a/trunk/drivers/media/video/bt8xx/bttv-vbi.c +++ b/trunk/drivers/media/video/bt8xx/bttv-vbi.c @@ -29,7 +29,6 @@ #include #include #include -#include #include #include "bttvp.h" diff --git a/trunk/drivers/media/video/bw-qcam.c b/trunk/drivers/media/video/bw-qcam.c index d3b3268bace8..b364adaae78d 100644 --- a/trunk/drivers/media/video/bw-qcam.c +++ b/trunk/drivers/media/video/bw-qcam.c @@ -74,7 +74,6 @@ OTHER DEALINGS IN THE SOFTWARE. #include #include #include -#include #include #include @@ -907,7 +906,9 @@ static const struct file_operations qcam_fops = { }; static struct video_device qcam_template= { + .owner = THIS_MODULE, .name = "Connectix Quickcam", + .type = VID_TYPE_CAPTURE, .fops = &qcam_fops, }; diff --git a/trunk/drivers/media/video/c-qcam.c b/trunk/drivers/media/video/c-qcam.c index fe9379b282d3..fe1e67bb1ca8 100644 --- a/trunk/drivers/media/video/c-qcam.c +++ b/trunk/drivers/media/video/c-qcam.c @@ -35,7 +35,6 @@ #include #include #include -#include #include #include @@ -702,7 +701,9 @@ static const struct file_operations qcam_fops = { static struct video_device qcam_template= { + .owner = THIS_MODULE, .name = "Colour QuickCam", + .type = VID_TYPE_CAPTURE, .fops = &qcam_fops, }; diff --git a/trunk/drivers/media/video/cafe_ccic.c b/trunk/drivers/media/video/cafe_ccic.c index c149b7d712e5..d99453faaab7 100644 --- a/trunk/drivers/media/video/cafe_ccic.c +++ b/trunk/drivers/media/video/cafe_ccic.c @@ -25,7 +25,6 @@ #include #include #include -#include #include #include #include @@ -1769,7 +1768,17 @@ static const struct file_operations cafe_v4l_fops = { .llseek = no_llseek, }; -static const struct v4l2_ioctl_ops cafe_v4l_ioctl_ops = { +static struct video_device cafe_v4l_template = { + .name = "cafe", + .type = VFL_TYPE_GRABBER, + .type2 = VID_TYPE_CAPTURE, + .minor = -1, /* Get one dynamically */ + .tvnorms = V4L2_STD_NTSC_M, + .current_norm = V4L2_STD_NTSC_M, /* make mplayer happy */ + + .fops = &cafe_v4l_fops, + .release = cafe_v4l_dev_release, + .vidioc_querycap = cafe_vidioc_querycap, .vidioc_enum_fmt_vid_cap = cafe_vidioc_enum_fmt_vid_cap, .vidioc_try_fmt_vid_cap = cafe_vidioc_try_fmt_vid_cap, @@ -1792,17 +1801,6 @@ static const struct v4l2_ioctl_ops cafe_v4l_ioctl_ops = { .vidioc_s_parm = cafe_vidioc_s_parm, }; -static struct video_device cafe_v4l_template = { - .name = "cafe", - .minor = -1, /* Get one dynamically */ - .tvnorms = V4L2_STD_NTSC_M, - .current_norm = V4L2_STD_NTSC_M, /* make mplayer happy */ - - .fops = &cafe_v4l_fops, - .ioctl_ops = &cafe_v4l_ioctl_ops, - .release = cafe_v4l_dev_release, -}; - @@ -2159,7 +2157,7 @@ static int cafe_pci_probe(struct pci_dev *pdev, cam->v4ldev = cafe_v4l_template; cam->v4ldev.debug = 0; // cam->v4ldev.debug = V4L2_DEBUG_IOCTL_ARG; - cam->v4ldev.parent = &pdev->dev; + cam->v4ldev.dev = &pdev->dev; ret = video_register_device(&cam->v4ldev, VFL_TYPE_GRABBER, -1); if (ret) goto out_smbus; diff --git a/trunk/drivers/media/video/compat_ioctl32.c b/trunk/drivers/media/video/compat_ioctl32.c index bd5d9de5a008..54de0cd482e9 100644 --- a/trunk/drivers/media/video/compat_ioctl32.c +++ b/trunk/drivers/media/video/compat_ioctl32.c @@ -17,7 +17,7 @@ #include #include #include -#include +#include #ifdef CONFIG_COMPAT diff --git a/trunk/drivers/media/video/cpia.c b/trunk/drivers/media/video/cpia.c index dc8cc6115e2f..2a81376ef503 100644 --- a/trunk/drivers/media/video/cpia.c +++ b/trunk/drivers/media/video/cpia.c @@ -3799,7 +3799,9 @@ static const struct file_operations cpia_fops = { }; static struct video_device cpia_template = { + .owner = THIS_MODULE, .name = "CPiA Camera", + .type = VID_TYPE_CAPTURE, .fops = &cpia_fops, }; diff --git a/trunk/drivers/media/video/cpia.h b/trunk/drivers/media/video/cpia.h index 8f0cfee4b8a1..5096058bf579 100644 --- a/trunk/drivers/media/video/cpia.h +++ b/trunk/drivers/media/video/cpia.h @@ -46,7 +46,6 @@ #include #include #include -#include #include #include diff --git a/trunk/drivers/media/video/cpia2/cpia2_core.c b/trunk/drivers/media/video/cpia2/cpia2_core.c index af8b9ec8e358..f2e8b1c82c66 100644 --- a/trunk/drivers/media/video/cpia2/cpia2_core.c +++ b/trunk/drivers/media/video/cpia2/cpia2_core.c @@ -32,7 +32,6 @@ #include "cpia2.h" #include -#include #include #include diff --git a/trunk/drivers/media/video/cpia2/cpia2_v4l.c b/trunk/drivers/media/video/cpia2/cpia2_v4l.c index 515c8b57a60d..7ce2789fa976 100644 --- a/trunk/drivers/media/video/cpia2/cpia2_v4l.c +++ b/trunk/drivers/media/video/cpia2/cpia2_v4l.c @@ -37,7 +37,6 @@ #include #include #include -#include #include "cpia2.h" #include "cpia2dev.h" @@ -1936,7 +1935,11 @@ static const struct file_operations fops_template = { static struct video_device cpia2_template = { /* I could not find any place for the old .initialize initializer?? */ + .owner= THIS_MODULE, .name= "CPiA2 Camera", + .type= VID_TYPE_CAPTURE, + .type2 = V4L2_CAP_VIDEO_CAPTURE | + V4L2_CAP_STREAMING, .minor= -1, .fops= &fops_template, .release= video_device_release, diff --git a/trunk/drivers/media/video/cs5345.c b/trunk/drivers/media/video/cs5345.c index 61d14d26686f..1c3fa3a7470a 100644 --- a/trunk/drivers/media/video/cs5345.c +++ b/trunk/drivers/media/video/cs5345.c @@ -111,7 +111,7 @@ static int cs5345_command(struct i2c_client *client, unsigned cmd, void *arg) if (cmd == VIDIOC_DBG_G_REGISTER) reg->val = cs5345_read(client, reg->reg & 0x1f); else - cs5345_write(client, reg->reg & 0x1f, reg->val & 0xff); + cs5345_write(client, reg->reg & 0x1f, reg->val & 0x1f); break; } #endif diff --git a/trunk/drivers/media/video/cs53l32a.c b/trunk/drivers/media/video/cs53l32a.c index e30a589c0e18..645b339152d3 100644 --- a/trunk/drivers/media/video/cs53l32a.c +++ b/trunk/drivers/media/video/cs53l32a.c @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/trunk/drivers/media/video/cx18/Kconfig b/trunk/drivers/media/video/cx18/Kconfig index ef48565de7f1..9aefdc5ea79a 100644 --- a/trunk/drivers/media/video/cx18/Kconfig +++ b/trunk/drivers/media/video/cx18/Kconfig @@ -2,7 +2,9 @@ config VIDEO_CX18 tristate "Conexant cx23418 MPEG encoder support" depends on VIDEO_V4L2 && DVB_CORE && PCI && I2C && EXPERIMENTAL depends on INPUT # due to VIDEO_IR + depends on HOTPLUG # due to FW_LOADER select I2C_ALGOBIT + select FW_LOADER select VIDEO_IR select VIDEO_TUNER select VIDEO_TVEEPROM diff --git a/trunk/drivers/media/video/cx18/cx18-av-audio.c b/trunk/drivers/media/video/cx18/cx18-av-audio.c index 0b55837880a7..c40a286de1b9 100644 --- a/trunk/drivers/media/video/cx18/cx18-av-audio.c +++ b/trunk/drivers/media/video/cx18/cx18-av-audio.c @@ -30,6 +30,7 @@ static int set_audclk_freq(struct cx18 *cx, u32 freq) if (freq != 32000 && freq != 44100 && freq != 48000) return -EINVAL; + /* common for all inputs and rates */ /* SA_MCLK_SEL=1, SA_MCLK_DIV=0x10 */ cx18_av_write(cx, 0x127, 0x50); @@ -37,30 +38,15 @@ static int set_audclk_freq(struct cx18 *cx, u32 freq) switch (freq) { case 32000: /* VID_PLL and AUX_PLL */ - cx18_av_write4(cx, 0x108, 0x1408040f); + cx18_av_write4(cx, 0x108, 0x1006040f); /* AUX_PLL_FRAC */ - /* 0x8.9504318a * 28,636,363.636 / 0x14 = 32000 * 384 */ - cx18_av_write4(cx, 0x110, 0x012a0863); + cx18_av_write4(cx, 0x110, 0x01bb39ee); - /* src3/4/6_ctl */ - /* 0x1.f77f = (4 * 15734.26) / 32000 */ + /* src3/4/6_ctl = 0x0801f77f */ cx18_av_write4(cx, 0x900, 0x0801f77f); cx18_av_write4(cx, 0x904, 0x0801f77f); cx18_av_write4(cx, 0x90c, 0x0801f77f); - - /* SA_MCLK_SEL=1, SA_MCLK_DIV=0x14 */ - cx18_av_write(cx, 0x127, 0x54); - - /* AUD_COUNT = 0x2fff = 8 samples * 4 * 384 - 1 */ - cx18_av_write4(cx, 0x12c, 0x11202fff); - - /* - * EN_AV_LOCK = 1 - * VID_COUNT = 0x0d2ef8 = 107999.000 * 8 = - * ((8 samples/32,000) * (13,500,000 * 8) * 4 - 1) * 8 - */ - cx18_av_write4(cx, 0x128, 0xa10d2ef8); break; case 44100: @@ -68,24 +54,12 @@ static int set_audclk_freq(struct cx18 *cx, u32 freq) cx18_av_write4(cx, 0x108, 0x1009040f); /* AUX_PLL_FRAC */ - /* 0x9.7635e7 * 28,636,363.63 / 0x10 = 44100 * 384 */ - cx18_av_write4(cx, 0x110, 0x00ec6bce); + cx18_av_write4(cx, 0x110, 0x00ec6bd6); - /* src3/4/6_ctl */ - /* 0x1.6d59 = (4 * 15734.26) / 44100 */ + /* src3/4/6_ctl = 0x08016d59 */ cx18_av_write4(cx, 0x900, 0x08016d59); cx18_av_write4(cx, 0x904, 0x08016d59); cx18_av_write4(cx, 0x90c, 0x08016d59); - - /* AUD_COUNT = 0x92ff = 49 samples * 2 * 384 - 1 */ - cx18_av_write4(cx, 0x12c, 0x112092ff); - - /* - * EN_AV_LOCK = 1 - * VID_COUNT = 0x1d4bf8 = 239999.000 * 8 = - * ((49 samples/44,100) * (13,500,000 * 8) * 2 - 1) * 8 - */ - cx18_av_write4(cx, 0x128, 0xa11d4bf8); break; case 48000: @@ -93,24 +67,12 @@ static int set_audclk_freq(struct cx18 *cx, u32 freq) cx18_av_write4(cx, 0x108, 0x100a040f); /* AUX_PLL_FRAC */ - /* 0xa.4c6b6ea * 28,636,363.63 / 0x10 = 48000 * 384 */ - cx18_av_write4(cx, 0x110, 0x0098d6dd); + cx18_av_write4(cx, 0x110, 0x0098d6e5); - /* src3/4/6_ctl */ - /* 0x1.4faa = (4 * 15734.26) / 48000 */ + /* src3/4/6_ctl = 0x08014faa */ cx18_av_write4(cx, 0x900, 0x08014faa); cx18_av_write4(cx, 0x904, 0x08014faa); cx18_av_write4(cx, 0x90c, 0x08014faa); - - /* AUD_COUNT = 0x5fff = 4 samples * 16 * 384 - 1 */ - cx18_av_write4(cx, 0x12c, 0x11205fff); - - /* - * EN_AV_LOCK = 1 - * VID_COUNT = 0x1193f8 = 143999.000 * 8 = - * ((4 samples/48,000) * (13,500,000 * 8) * 16 - 1) * 8 - */ - cx18_av_write4(cx, 0x128, 0xa11193f8); break; } } else { @@ -120,31 +82,18 @@ static int set_audclk_freq(struct cx18 *cx, u32 freq) cx18_av_write4(cx, 0x108, 0x1e08040f); /* AUX_PLL_FRAC */ - /* 0x8.9504318 * 28,636,363.63 / 0x1e = 32000 * 256 */ - cx18_av_write4(cx, 0x110, 0x012a0863); + cx18_av_write4(cx, 0x110, 0x012a0869); - /* src1_ctl */ - /* 0x1.0000 = 32000/32000 */ + /* src1_ctl = 0x08010000 */ cx18_av_write4(cx, 0x8f8, 0x08010000); - /* src3/4/6_ctl */ - /* 0x2.0000 = 2 * (32000/32000) */ + /* src3/4/6_ctl = 0x08020000 */ cx18_av_write4(cx, 0x900, 0x08020000); cx18_av_write4(cx, 0x904, 0x08020000); cx18_av_write4(cx, 0x90c, 0x08020000); /* SA_MCLK_SEL=1, SA_MCLK_DIV=0x14 */ cx18_av_write(cx, 0x127, 0x54); - - /* AUD_COUNT = 0x1fff = 8 samples * 4 * 256 - 1 */ - cx18_av_write4(cx, 0x12c, 0x11201fff); - - /* - * EN_AV_LOCK = 1 - * VID_COUNT = 0x0d2ef8 = 107999.000 * 8 = - * ((8 samples/32,000) * (13,500,000 * 8) * 4 - 1) * 8 - */ - cx18_av_write4(cx, 0x128, 0xa10d2ef8); break; case 44100: @@ -152,28 +101,15 @@ static int set_audclk_freq(struct cx18 *cx, u32 freq) cx18_av_write4(cx, 0x108, 0x1809040f); /* AUX_PLL_FRAC */ - /* 0x9.7635e74 * 28,636,363.63 / 0x18 = 44100 * 256 */ - cx18_av_write4(cx, 0x110, 0x00ec6bce); + cx18_av_write4(cx, 0x110, 0x00ec6bd6); - /* src1_ctl */ - /* 0x1.60cd = 44100/32000 */ + /* src1_ctl = 0x08010000 */ cx18_av_write4(cx, 0x8f8, 0x080160cd); - /* src3/4/6_ctl */ - /* 0x1.7385 = 2 * (32000/44100) */ + /* src3/4/6_ctl = 0x08020000 */ cx18_av_write4(cx, 0x900, 0x08017385); cx18_av_write4(cx, 0x904, 0x08017385); cx18_av_write4(cx, 0x90c, 0x08017385); - - /* AUD_COUNT = 0x61ff = 49 samples * 2 * 256 - 1 */ - cx18_av_write4(cx, 0x12c, 0x112061ff); - - /* - * EN_AV_LOCK = 1 - * VID_COUNT = 0x1d4bf8 = 239999.000 * 8 = - * ((49 samples/44,100) * (13,500,000 * 8) * 2 - 1) * 8 - */ - cx18_av_write4(cx, 0x128, 0xa11d4bf8); break; case 48000: @@ -181,28 +117,15 @@ static int set_audclk_freq(struct cx18 *cx, u32 freq) cx18_av_write4(cx, 0x108, 0x180a040f); /* AUX_PLL_FRAC */ - /* 0xa.4c6b6ea * 28,636,363.63 / 0x18 = 48000 * 256 */ - cx18_av_write4(cx, 0x110, 0x0098d6dd); + cx18_av_write4(cx, 0x110, 0x0098d6e5); - /* src1_ctl */ - /* 0x1.8000 = 48000/32000 */ + /* src1_ctl = 0x08010000 */ cx18_av_write4(cx, 0x8f8, 0x08018000); - /* src3/4/6_ctl */ - /* 0x1.5555 = 2 * (32000/48000) */ + /* src3/4/6_ctl = 0x08020000 */ cx18_av_write4(cx, 0x900, 0x08015555); cx18_av_write4(cx, 0x904, 0x08015555); cx18_av_write4(cx, 0x90c, 0x08015555); - - /* AUD_COUNT = 0x3fff = 4 samples * 16 * 256 - 1 */ - cx18_av_write4(cx, 0x12c, 0x11203fff); - - /* - * EN_AV_LOCK = 1 - * VID_COUNT = 0x1193f8 = 143999.000 * 8 = - * ((4 samples/48,000) * (13,500,000 * 8) * 16 - 1) * 8 - */ - cx18_av_write4(cx, 0x128, 0xa11193f8); break; } } diff --git a/trunk/drivers/media/video/cx18/cx18-driver.h b/trunk/drivers/media/video/cx18/cx18-driver.h index 4801bc7fb5b2..45e31b04730e 100644 --- a/trunk/drivers/media/video/cx18/cx18-driver.h +++ b/trunk/drivers/media/video/cx18/cx18-driver.h @@ -46,7 +46,6 @@ #include #include #include -#include #include #include "cx18-mailbox.h" #include "cx18-av-core.h" diff --git a/trunk/drivers/media/video/cx18/cx18-firmware.c b/trunk/drivers/media/video/cx18/cx18-firmware.c index 78fadd2ada5d..2d630d9f7496 100644 --- a/trunk/drivers/media/video/cx18/cx18-firmware.c +++ b/trunk/drivers/media/video/cx18/cx18-firmware.c @@ -86,6 +86,10 @@ #define CX18_DSP0_INTERRUPT_MASK 0xd0004C +/* Encoder/decoder firmware sizes */ +#define CX18_FW_CPU_SIZE (158332) +#define CX18_FW_APU_SIZE (141200) + #define APU_ROM_SYNC1 0x6D676553 /* "mgeS" */ #define APU_ROM_SYNC2 0x72646548 /* "rdeH" */ @@ -96,22 +100,35 @@ struct cx18_apu_rom_seghdr { u32 size; }; -static int load_cpu_fw_direct(const char *fn, u8 __iomem *mem, struct cx18 *cx) +static int load_cpu_fw_direct(const char *fn, u8 __iomem *mem, struct cx18 *cx, long size) { const struct firmware *fw = NULL; + int retries = 3; int i, j; - unsigned size; u32 __iomem *dst = (u32 __iomem *)mem; const u32 *src; - if (request_firmware(&fw, fn, &cx->dev->dev)) { - CX18_ERR("Unable to open firmware %s\n", fn); +retry: + if (!retries || request_firmware(&fw, fn, &cx->dev->dev)) { + CX18_ERR("Unable to open firmware %s (must be %ld bytes)\n", + fn, size); CX18_ERR("Did you put the firmware in the hotplug firmware directory?\n"); return -ENOMEM; } src = (const u32 *)fw->data; + if (fw->size != size) { + /* Due to race conditions in firmware loading (esp. with + udev <0.95) the wrong file was sometimes loaded. So we check + filesizes to see if at least the right-sized file was + loaded. If not, then we retry. */ + CX18_INFO("retry: file loaded was not %s (expected size %ld, got %zd)\n", + fn, size, fw->size); + release_firmware(fw); + retries--; + goto retry; + } for (i = 0; i < fw->size; i += 4096) { setup_page(i); for (j = i; j < fw->size && j < i + 4096; j += 4) { @@ -128,16 +145,15 @@ static int load_cpu_fw_direct(const char *fn, u8 __iomem *mem, struct cx18 *cx) } if (!test_bit(CX18_F_I_LOADED_FW, &cx->i_flags)) CX18_INFO("loaded %s firmware (%zd bytes)\n", fn, fw->size); - size = fw->size; release_firmware(fw); return size; } -static int load_apu_fw_direct(const char *fn, u8 __iomem *dst, struct cx18 *cx) +static int load_apu_fw_direct(const char *fn, u8 __iomem *dst, struct cx18 *cx, long size) { const struct firmware *fw = NULL; + int retries = 3; int i, j; - unsigned size; const u32 *src; struct cx18_apu_rom_seghdr seghdr; const u8 *vers; @@ -145,8 +161,10 @@ static int load_apu_fw_direct(const char *fn, u8 __iomem *dst, struct cx18 *cx) u32 apu_version = 0; int sz; - if (request_firmware(&fw, fn, &cx->dev->dev)) { - CX18_ERR("unable to open firmware %s\n", fn); +retry: + if (!retries || request_firmware(&fw, fn, &cx->dev->dev)) { + CX18_ERR("unable to open firmware %s (must be %ld bytes)\n", + fn, size); CX18_ERR("did you put the firmware in the hotplug firmware directory?\n"); return -ENOMEM; } @@ -155,8 +173,19 @@ static int load_apu_fw_direct(const char *fn, u8 __iomem *dst, struct cx18 *cx) vers = fw->data + sizeof(seghdr); sz = fw->size; + if (fw->size != size) { + /* Due to race conditions in firmware loading (esp. with + udev <0.95) the wrong file was sometimes loaded. So we check + filesizes to see if at least the right-sized file was + loaded. If not, then we retry. */ + CX18_INFO("retry: file loaded was not %s (expected size %ld, got %zd)\n", + fn, size, fw->size); + release_firmware(fw); + retries--; + goto retry; + } apu_version = (vers[0] << 24) | (vers[4] << 16) | vers[32]; - while (offset + sizeof(seghdr) < fw->size) { + while (offset + sizeof(seghdr) < size) { /* TODO: byteswapping */ memcpy(&seghdr, src + offset / 4, sizeof(seghdr)); offset += sizeof(seghdr); @@ -186,7 +215,6 @@ static int load_apu_fw_direct(const char *fn, u8 __iomem *dst, struct cx18 *cx) if (!test_bit(CX18_F_I_LOADED_FW, &cx->i_flags)) CX18_INFO("loaded %s firmware V%08x (%zd bytes)\n", fn, apu_version, fw->size); - size = fw->size; release_firmware(fw); /* Clear bit0 for APU to start from 0 */ write_reg(read_reg(0xc72030) & ~1, 0xc72030); @@ -312,7 +340,7 @@ int cx18_firmware_init(struct cx18 *cx) /* Only if the processor is not running */ if (read_reg(CX18_PROC_SOFT_RESET) & 8) { int sz = load_apu_fw_direct("v4l-cx23418-apu.fw", - cx->enc_mem, cx); + cx->enc_mem, cx, CX18_FW_APU_SIZE); write_enc(0xE51FF004, 0); write_enc(0xa00000, 4); /* todo: not hardcoded */ @@ -320,7 +348,7 @@ int cx18_firmware_init(struct cx18 *cx) cx18_msleep_timeout(500, 0); sz = sz <= 0 ? sz : load_cpu_fw_direct("v4l-cx23418-cpu.fw", - cx->enc_mem, cx); + cx->enc_mem, cx, CX18_FW_CPU_SIZE); if (sz > 0) { int retries = 0; diff --git a/trunk/drivers/media/video/cx18/cx18-ioctl.c b/trunk/drivers/media/video/cx18/cx18-ioctl.c index a7f839631d6a..0d74e59e503e 100644 --- a/trunk/drivers/media/video/cx18/cx18-ioctl.c +++ b/trunk/drivers/media/video/cx18/cx18-ioctl.c @@ -787,54 +787,50 @@ int cx18_v4l2_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, return res; } -static const struct v4l2_ioctl_ops cx18_ioctl_ops = { - .vidioc_querycap = cx18_querycap, - .vidioc_g_priority = cx18_g_priority, - .vidioc_s_priority = cx18_s_priority, - .vidioc_s_audio = cx18_s_audio, - .vidioc_g_audio = cx18_g_audio, - .vidioc_enumaudio = cx18_enumaudio, - .vidioc_enum_input = cx18_enum_input, - .vidioc_cropcap = cx18_cropcap, - .vidioc_s_crop = cx18_s_crop, - .vidioc_g_crop = cx18_g_crop, - .vidioc_g_input = cx18_g_input, - .vidioc_s_input = cx18_s_input, - .vidioc_g_frequency = cx18_g_frequency, - .vidioc_s_frequency = cx18_s_frequency, - .vidioc_s_tuner = cx18_s_tuner, - .vidioc_g_tuner = cx18_g_tuner, - .vidioc_g_enc_index = cx18_g_enc_index, - .vidioc_g_std = cx18_g_std, - .vidioc_s_std = cx18_s_std, - .vidioc_log_status = cx18_log_status, - .vidioc_enum_fmt_vid_cap = cx18_enum_fmt_vid_cap, - .vidioc_encoder_cmd = cx18_encoder_cmd, - .vidioc_try_encoder_cmd = cx18_try_encoder_cmd, - .vidioc_g_fmt_vid_cap = cx18_g_fmt_vid_cap, - .vidioc_g_fmt_vbi_cap = cx18_g_fmt_vbi_cap, - .vidioc_g_fmt_sliced_vbi_cap = cx18_g_fmt_sliced_vbi_cap, - .vidioc_s_fmt_vid_cap = cx18_s_fmt_vid_cap, - .vidioc_s_fmt_vbi_cap = cx18_s_fmt_vbi_cap, - .vidioc_s_fmt_sliced_vbi_cap = cx18_s_fmt_sliced_vbi_cap, - .vidioc_try_fmt_vid_cap = cx18_try_fmt_vid_cap, - .vidioc_try_fmt_vbi_cap = cx18_try_fmt_vbi_cap, - .vidioc_try_fmt_sliced_vbi_cap = cx18_try_fmt_sliced_vbi_cap, - .vidioc_g_sliced_vbi_cap = cx18_g_sliced_vbi_cap, - .vidioc_g_chip_ident = cx18_g_chip_ident, -#ifdef CONFIG_VIDEO_ADV_DEBUG - .vidioc_g_register = cx18_g_register, - .vidioc_s_register = cx18_s_register, -#endif - .vidioc_default = cx18_default, - .vidioc_queryctrl = cx18_queryctrl, - .vidioc_querymenu = cx18_querymenu, - .vidioc_g_ext_ctrls = cx18_g_ext_ctrls, - .vidioc_s_ext_ctrls = cx18_s_ext_ctrls, - .vidioc_try_ext_ctrls = cx18_try_ext_ctrls, -}; - void cx18_set_funcs(struct video_device *vdev) { - vdev->ioctl_ops = &cx18_ioctl_ops; + vdev->vidioc_querycap = cx18_querycap; + vdev->vidioc_g_priority = cx18_g_priority; + vdev->vidioc_s_priority = cx18_s_priority; + vdev->vidioc_s_audio = cx18_s_audio; + vdev->vidioc_g_audio = cx18_g_audio; + vdev->vidioc_enumaudio = cx18_enumaudio; + vdev->vidioc_enum_input = cx18_enum_input; + vdev->vidioc_cropcap = cx18_cropcap; + vdev->vidioc_s_crop = cx18_s_crop; + vdev->vidioc_g_crop = cx18_g_crop; + vdev->vidioc_g_input = cx18_g_input; + vdev->vidioc_s_input = cx18_s_input; + vdev->vidioc_g_frequency = cx18_g_frequency; + vdev->vidioc_s_frequency = cx18_s_frequency; + vdev->vidioc_s_tuner = cx18_s_tuner; + vdev->vidioc_g_tuner = cx18_g_tuner; + vdev->vidioc_g_enc_index = cx18_g_enc_index; + vdev->vidioc_g_std = cx18_g_std; + vdev->vidioc_s_std = cx18_s_std; + vdev->vidioc_log_status = cx18_log_status; + vdev->vidioc_enum_fmt_vid_cap = cx18_enum_fmt_vid_cap; + vdev->vidioc_encoder_cmd = cx18_encoder_cmd; + vdev->vidioc_try_encoder_cmd = cx18_try_encoder_cmd; + vdev->vidioc_g_fmt_vid_cap = cx18_g_fmt_vid_cap; + vdev->vidioc_g_fmt_vbi_cap = cx18_g_fmt_vbi_cap; + vdev->vidioc_g_fmt_sliced_vbi_cap = cx18_g_fmt_sliced_vbi_cap; + vdev->vidioc_s_fmt_vid_cap = cx18_s_fmt_vid_cap; + vdev->vidioc_s_fmt_vbi_cap = cx18_s_fmt_vbi_cap; + vdev->vidioc_s_fmt_sliced_vbi_cap = cx18_s_fmt_sliced_vbi_cap; + vdev->vidioc_try_fmt_vid_cap = cx18_try_fmt_vid_cap; + vdev->vidioc_try_fmt_vbi_cap = cx18_try_fmt_vbi_cap; + vdev->vidioc_try_fmt_sliced_vbi_cap = cx18_try_fmt_sliced_vbi_cap; + vdev->vidioc_g_sliced_vbi_cap = cx18_g_sliced_vbi_cap; + vdev->vidioc_g_chip_ident = cx18_g_chip_ident; +#ifdef CONFIG_VIDEO_ADV_DEBUG + vdev->vidioc_g_register = cx18_g_register; + vdev->vidioc_s_register = cx18_s_register; +#endif + vdev->vidioc_default = cx18_default; + vdev->vidioc_queryctrl = cx18_queryctrl; + vdev->vidioc_querymenu = cx18_querymenu; + vdev->vidioc_g_ext_ctrls = cx18_g_ext_ctrls; + vdev->vidioc_s_ext_ctrls = cx18_s_ext_ctrls; + vdev->vidioc_try_ext_ctrls = cx18_try_ext_ctrls; } diff --git a/trunk/drivers/media/video/cx18/cx18-streams.c b/trunk/drivers/media/video/cx18/cx18-streams.c index 0da57f583bf7..1728b1d832a9 100644 --- a/trunk/drivers/media/video/cx18/cx18-streams.c +++ b/trunk/drivers/media/video/cx18/cx18-streams.c @@ -187,11 +187,14 @@ static int cx18_prep_dev(struct cx18 *cx, int type) return -ENOMEM; } + s->v4l2dev->type = + VID_TYPE_CAPTURE | VID_TYPE_TUNER | VID_TYPE_TELETEXT | + VID_TYPE_CLIPPING | VID_TYPE_SCALES | VID_TYPE_MPEG_ENCODER; snprintf(s->v4l2dev->name, sizeof(s->v4l2dev->name), "cx18-%d", cx->num); s->v4l2dev->minor = minor; - s->v4l2dev->parent = &cx->dev->dev; + s->v4l2dev->dev = &cx->dev->dev; s->v4l2dev->fops = cx18_stream_info[type].fops; s->v4l2dev->release = video_device_release; s->v4l2dev->tvnorms = V4L2_STD_ALL; diff --git a/trunk/drivers/media/video/cx23885/Kconfig b/trunk/drivers/media/video/cx23885/Kconfig index e60bd31b51a3..5cfb46bbdaa9 100644 --- a/trunk/drivers/media/video/cx23885/Kconfig +++ b/trunk/drivers/media/video/cx23885/Kconfig @@ -1,7 +1,9 @@ config VIDEO_CX23885 tristate "Conexant cx23885 (2388x successor) support" depends on DVB_CORE && VIDEO_DEV && PCI && I2C && INPUT + depends on HOTPLUG # due to FW_LOADER select I2C_ALGOBIT + select FW_LOADER select VIDEO_BTCX select VIDEO_TUNER select VIDEO_TVEEPROM diff --git a/trunk/drivers/media/video/cx23885/cx23885-417.c b/trunk/drivers/media/video/cx23885/cx23885-417.c index 8118091568fc..e7ef093265af 100644 --- a/trunk/drivers/media/video/cx23885/cx23885-417.c +++ b/trunk/drivers/media/video/cx23885/cx23885-417.c @@ -32,7 +32,6 @@ #include #include #include -#include #include #include "cx23885.h" @@ -1700,7 +1699,14 @@ static struct file_operations mpeg_fops = { .llseek = no_llseek, }; -static const struct v4l2_ioctl_ops mpeg_ioctl_ops = { +static struct video_device cx23885_mpeg_template = { + .name = "cx23885", + .type = VID_TYPE_CAPTURE | + VID_TYPE_TUNER | + VID_TYPE_SCALES | + VID_TYPE_MPEG_ENCODER, + .fops = &mpeg_fops, + .minor = -1, .vidioc_s_std = vidioc_s_std, .vidioc_enum_input = vidioc_enum_input, .vidioc_g_input = vidioc_g_input, @@ -1729,13 +1735,6 @@ static const struct v4l2_ioctl_ops mpeg_ioctl_ops = { .vidioc_queryctrl = vidioc_queryctrl, }; -static struct video_device cx23885_mpeg_template = { - .name = "cx23885", - .fops = &mpeg_fops, - .ioctl_ops = &mpeg_ioctl_ops, - .minor = -1, -}; - void cx23885_417_unregister(struct cx23885_dev *dev) { dprintk(1, "%s()\n", __func__); @@ -1767,7 +1766,7 @@ static struct video_device *cx23885_video_dev_alloc( vfd->minor = -1; snprintf(vfd->name, sizeof(vfd->name), "%s %s (%s)", dev->name, type, cx23885_boards[tsport->dev->board].name); - vfd->parent = &pci->dev; + vfd->dev = &pci->dev; vfd->release = video_device_release; return vfd; } diff --git a/trunk/drivers/media/video/cx23885/cx23885-cards.c b/trunk/drivers/media/video/cx23885/cx23885-cards.c index a19de850955d..fd7112c11d35 100644 --- a/trunk/drivers/media/video/cx23885/cx23885-cards.c +++ b/trunk/drivers/media/video/cx23885/cx23885-cards.c @@ -145,7 +145,6 @@ struct cx23885_board cx23885_boards[] = { }, [CX23885_BOARD_DVICO_FUSIONHDTV_7_DUAL_EXP] = { .name = "DViCO FusionHDTV7 Dual Express", - .portb = CX23885_MPEG_DVB, .portc = CX23885_MPEG_DVB, }, }; @@ -326,41 +325,25 @@ int cx23885_tuner_callback(void *priv, int command, int arg) { struct cx23885_i2c *bus = priv; struct cx23885_dev *dev = bus->dev; - u32 bitmask = 0; - - if (command != 0) { - printk(KERN_ERR "%s(): Unknown command 0x%x.\n", - __func__, command); - return -EINVAL; - } switch(dev->board) { case CX23885_BOARD_HAUPPAUGE_HVR1500Q: - /* Tuner Reset Command from xc5000 */ - if (command == 0) - bitmask = 0x04; - break; - case CX23885_BOARD_DVICO_FUSIONHDTV_7_DUAL_EXP: - if (command == 0) { - - /* Two identical tuners on two different i2c buses, - * we need to reset the correct gpio. */ - if (bus->nr == 0) - bitmask = 0x01; - else if (bus->nr == 1) - bitmask = 0x04; + if(command == 0) { /* Tuner Reset Command from xc5000 */ + /* Drive the tuner into reset and out */ + cx_clear(GP0_IO, 0x00000004); + mdelay(200); + cx_set(GP0_IO, 0x00000004); + return 0; + } + else { + printk(KERN_ERR + "%s(): Unknow command.\n", __func__); + return -EINVAL; } break; } - if (bitmask) { - /* Drive the tuner into reset and back out */ - cx_clear(GP0_IO, bitmask); - mdelay(200); - cx_set(GP0_IO, bitmask); - } - - return 0; + return 0; /* Should never be here */ } void cx23885_gpio_setup(struct cx23885_dev *dev) @@ -452,19 +435,6 @@ void cx23885_gpio_setup(struct cx23885_dev *dev) mdelay(20); cx_set(GP0_IO, 0x00050005); break; - case CX23885_BOARD_DVICO_FUSIONHDTV_7_DUAL_EXP: - /* GPIO-0 xc5000 tuner reset i2c bus 0 */ - /* GPIO-1 s5h1409 demod reset i2c bus 0 */ - /* GPIO-2 xc5000 tuner reset i2c bus 1 */ - /* GPIO-3 s5h1409 demod reset i2c bus 0 */ - - /* Put the parts into reset and back */ - cx_set(GP0_IO, 0x000f0000); - mdelay(20); - cx_clear(GP0_IO, 0x0000000f); - mdelay(20); - cx_set(GP0_IO, 0x000f000f); - break; } } diff --git a/trunk/drivers/media/video/cx23885/cx23885-core.c b/trunk/drivers/media/video/cx23885/cx23885-core.c index 6286a9cf957e..d17343ea0d33 100644 --- a/trunk/drivers/media/video/cx23885/cx23885-core.c +++ b/trunk/drivers/media/video/cx23885/cx23885-core.c @@ -76,117 +76,6 @@ LIST_HEAD(cx23885_devlist); * 0x00010ea0 0x00010xxx Free */ -static struct sram_channel cx23885_sram_channels[] = { - [SRAM_CH01] = { - .name = "VID A", - .cmds_start = 0x10000, - .ctrl_start = 0x10380, - .cdt = 0x104c0, - .fifo_start = 0x40, - .fifo_size = 0x2800, - .ptr1_reg = DMA1_PTR1, - .ptr2_reg = DMA1_PTR2, - .cnt1_reg = DMA1_CNT1, - .cnt2_reg = DMA1_CNT2, - }, - [SRAM_CH02] = { - .name = "ch2", - .cmds_start = 0x0, - .ctrl_start = 0x0, - .cdt = 0x0, - .fifo_start = 0x0, - .fifo_size = 0x0, - .ptr1_reg = DMA2_PTR1, - .ptr2_reg = DMA2_PTR2, - .cnt1_reg = DMA2_CNT1, - .cnt2_reg = DMA2_CNT2, - }, - [SRAM_CH03] = { - .name = "TS1 B", - .cmds_start = 0x100A0, - .ctrl_start = 0x10400, - .cdt = 0x10580, - .fifo_start = 0x5000, - .fifo_size = 0x1000, - .ptr1_reg = DMA3_PTR1, - .ptr2_reg = DMA3_PTR2, - .cnt1_reg = DMA3_CNT1, - .cnt2_reg = DMA3_CNT2, - }, - [SRAM_CH04] = { - .name = "ch4", - .cmds_start = 0x0, - .ctrl_start = 0x0, - .cdt = 0x0, - .fifo_start = 0x0, - .fifo_size = 0x0, - .ptr1_reg = DMA4_PTR1, - .ptr2_reg = DMA4_PTR2, - .cnt1_reg = DMA4_CNT1, - .cnt2_reg = DMA4_CNT2, - }, - [SRAM_CH05] = { - .name = "ch5", - .cmds_start = 0x0, - .ctrl_start = 0x0, - .cdt = 0x0, - .fifo_start = 0x0, - .fifo_size = 0x0, - .ptr1_reg = DMA5_PTR1, - .ptr2_reg = DMA5_PTR2, - .cnt1_reg = DMA5_CNT1, - .cnt2_reg = DMA5_CNT2, - }, - [SRAM_CH06] = { - .name = "TS2 C", - .cmds_start = 0x10140, - .ctrl_start = 0x10440, - .cdt = 0x105e0, - .fifo_start = 0x6000, - .fifo_size = 0x1000, - .ptr1_reg = DMA5_PTR1, - .ptr2_reg = DMA5_PTR2, - .cnt1_reg = DMA5_CNT1, - .cnt2_reg = DMA5_CNT2, - }, - [SRAM_CH07] = { - .name = "ch7", - .cmds_start = 0x0, - .ctrl_start = 0x0, - .cdt = 0x0, - .fifo_start = 0x0, - .fifo_size = 0x0, - .ptr1_reg = DMA6_PTR1, - .ptr2_reg = DMA6_PTR2, - .cnt1_reg = DMA6_CNT1, - .cnt2_reg = DMA6_CNT2, - }, - [SRAM_CH08] = { - .name = "ch8", - .cmds_start = 0x0, - .ctrl_start = 0x0, - .cdt = 0x0, - .fifo_start = 0x0, - .fifo_size = 0x0, - .ptr1_reg = DMA7_PTR1, - .ptr2_reg = DMA7_PTR2, - .cnt1_reg = DMA7_CNT1, - .cnt2_reg = DMA7_CNT2, - }, - [SRAM_CH09] = { - .name = "ch9", - .cmds_start = 0x0, - .ctrl_start = 0x0, - .cdt = 0x0, - .fifo_start = 0x0, - .fifo_size = 0x0, - .ptr1_reg = DMA8_PTR1, - .ptr2_reg = DMA8_PTR2, - .cnt1_reg = DMA8_CNT1, - .cnt2_reg = DMA8_CNT2, - }, -}; - static struct sram_channel cx23887_sram_channels[] = { [SRAM_CH01] = { .name = "VID A", @@ -215,8 +104,8 @@ static struct sram_channel cx23887_sram_channels[] = { [SRAM_CH03] = { .name = "TS1 B", .cmds_start = 0x100A0, - .ctrl_start = 0x10630, - .cdt = 0x10870, + .ctrl_start = 0x10780, + .cdt = 0x10400, .fifo_start = 0x5000, .fifo_size = 0x1000, .ptr1_reg = DMA3_PTR1, @@ -251,7 +140,7 @@ static struct sram_channel cx23887_sram_channels[] = { [SRAM_CH06] = { .name = "TS2 C", .cmds_start = 0x10140, - .ctrl_start = 0x10670, + .ctrl_start = 0x10680, .cdt = 0x108d0, .fifo_start = 0x6000, .fifo_size = 0x1000, @@ -571,7 +460,6 @@ static void cx23885_reset(struct cx23885_dev *dev) cx_write(AUDIO_INT_INT_STAT, 0xffffffff); cx_write(AUDIO_EXT_INT_STAT, 0xffffffff); cx_write(CLK_DELAY, cx_read(CLK_DELAY) & 0x80000000); - cx_write(PAD_CTRL, 0x00500300); mdelay(100); @@ -737,6 +625,7 @@ static int cx23885_dev_setup(struct cx23885_dev *dev) atomic_inc(&dev->refcount); dev->nr = cx23885_devcount++; + dev->sram_channels = cx23887_sram_channels; sprintf(dev->name, "cx23885[%d]", dev->nr); mutex_lock(&devlist); @@ -748,13 +637,11 @@ static int cx23885_dev_setup(struct cx23885_dev *dev) dev->bridge = CX23885_BRIDGE_887; /* Apply a sensible clock frequency for the PCIe bridge */ dev->clk_freq = 25000000; - dev->sram_channels = cx23887_sram_channels; } else if(dev->pci->device == 0x8852) { dev->bridge = CX23885_BRIDGE_885; /* Apply a sensible clock frequency for the PCIe bridge */ dev->clk_freq = 28000000; - dev->sram_channels = cx23885_sram_channels; } else BUG(); @@ -1123,9 +1010,8 @@ static void cx23885_tsport_reg_dump(struct cx23885_tsport *port) port->reg_gpcnt_ctl, cx_read(port->reg_gpcnt_ctl)); dprintk(1, "%s() dma_ctl(0x%08X) 0x%08x\n", __func__, port->reg_dma_ctl, cx_read(port->reg_dma_ctl)); - if (port->reg_src_sel) - dprintk(1, "%s() src_sel(0x%08X) 0x%08x\n", __func__, - port->reg_src_sel, cx_read(port->reg_src_sel)); + dprintk(1, "%s() src_sel(0x%08X) 0x%08x\n", __func__, + port->reg_src_sel, cx_read(port->reg_src_sel)); dprintk(1, "%s() lngth(0x%08X) 0x%08x\n", __func__, port->reg_lngth, cx_read(port->reg_lngth)); dprintk(1, "%s() hw_sop_ctrl(0x%08X) 0x%08x\n", __func__, @@ -1156,9 +1042,6 @@ static int cx23885_start_dma(struct cx23885_tsport *port, dprintk(1, "%s() w: %d, h: %d, f: %d\n", __func__, buf->vb.width, buf->vb.height, buf->vb.field); - /* Stop the fifo and risc engine for this port */ - cx_clear(port->reg_dma_ctl, port->dma_ctl_val); - /* setup fifo + format */ cx23885_sram_channel_setup(dev, &dev->sram_channels[ port->sram_chno ], @@ -1200,21 +1083,7 @@ static int cx23885_start_dma(struct cx23885_tsport *port, cx_write(port->reg_gpcnt_ctl, 3); q->count = 1; - /* Set VIDB pins to input */ - if (cx23885_boards[dev->board].portb == CX23885_MPEG_DVB) { - reg = cx_read(PAD_CTRL); - reg &= ~0x3; /* Clear TS1_OE & TS1_SOP_OE */ - cx_write(PAD_CTRL, reg); - } - - /* Set VIDC pins to input */ - if (cx23885_boards[dev->board].portc == CX23885_MPEG_DVB) { - reg = cx_read(PAD_CTRL); - reg &= ~0x4; /* Clear TS2_SOP_OE */ - cx_write(PAD_CTRL, reg); - } - - if (cx23885_boards[dev->board].portb == CX23885_MPEG_ENCODER) { + if (cx23885_boards[dev->board].portb & CX23885_MPEG_ENCODER) { reg = cx_read(PAD_CTRL); reg = reg & ~0x1; /* Clear TS1_OE */ @@ -1264,7 +1133,7 @@ static int cx23885_stop_dma(struct cx23885_tsport *port) cx_clear(port->reg_ts_int_msk, port->ts_int_msk_val); cx_clear(port->reg_dma_ctl, port->dma_ctl_val); - if (cx23885_boards[dev->board].portb == CX23885_MPEG_ENCODER) { + if (cx23885_boards[dev->board].portb & CX23885_MPEG_ENCODER) { reg = cx_read(PAD_CTRL); diff --git a/trunk/drivers/media/video/cx23885/cx23885-video.c b/trunk/drivers/media/video/cx23885/cx23885-video.c index ad2235dab5b1..043fc4e5c586 100644 --- a/trunk/drivers/media/video/cx23885/cx23885-video.c +++ b/trunk/drivers/media/video/cx23885/cx23885-video.c @@ -33,7 +33,6 @@ #include "cx23885.h" #include -#include #ifdef CONFIG_VIDEO_V4L1_COMPAT /* Include V4L1 specific functions. Should be removed soon */ @@ -327,7 +326,7 @@ struct video_device *cx23885_vdev_init(struct cx23885_dev *dev, return NULL; *vfd = *template; vfd->minor = -1; - vfd->parent = &pci->dev; + vfd->dev = &pci->dev; vfd->release = video_device_release; snprintf(vfd->name, sizeof(vfd->name), "%s %s (%s)", dev->name, type, cx23885_boards[dev->board].name); @@ -1434,7 +1433,12 @@ static const struct file_operations video_fops = { .llseek = no_llseek, }; -static const struct v4l2_ioctl_ops video_ioctl_ops = { +static struct video_device cx23885_vbi_template; +static struct video_device cx23885_video_template = { + .name = "cx23885-video", + .type = VID_TYPE_CAPTURE|VID_TYPE_TUNER|VID_TYPE_SCALES, + .fops = &video_fops, + .minor = -1, .vidioc_querycap = vidioc_querycap, .vidioc_enum_fmt_vid_cap = vidioc_enum_fmt_vid_cap, .vidioc_g_fmt_vid_cap = vidioc_g_fmt_vid_cap, @@ -1467,14 +1471,6 @@ static const struct v4l2_ioctl_ops video_ioctl_ops = { .vidioc_g_register = vidioc_g_register, .vidioc_s_register = vidioc_s_register, #endif -}; - -static struct video_device cx23885_vbi_template; -static struct video_device cx23885_video_template = { - .name = "cx23885-video", - .fops = &video_fops, - .minor = -1, - .ioctl_ops = &video_ioctl_ops, .tvnorms = CX23885_NORMS, .current_norm = V4L2_STD_NTSC_M, }; @@ -1516,6 +1512,7 @@ int cx23885_video_register(struct cx23885_dev *dev) memcpy(&cx23885_vbi_template, &cx23885_video_template, sizeof(cx23885_vbi_template)); strcpy(cx23885_vbi_template.name, "cx23885-vbi"); + cx23885_vbi_template.type = VID_TYPE_TELETEXT|VID_TYPE_TUNER; dev->tvnorm = cx23885_video_template.current_norm; diff --git a/trunk/drivers/media/video/cx25840/Kconfig b/trunk/drivers/media/video/cx25840/Kconfig index de515dadadc2..448f4cd0ce34 100644 --- a/trunk/drivers/media/video/cx25840/Kconfig +++ b/trunk/drivers/media/video/cx25840/Kconfig @@ -1,6 +1,8 @@ config VIDEO_CX25840 tristate "Conexant CX2584x audio/video decoders" depends on VIDEO_V4L2 && I2C && EXPERIMENTAL + depends on HOTPLUG # due to FW_LOADER + select FW_LOADER ---help--- Support for the Conexant CX2584x audio/video decoders. diff --git a/trunk/drivers/media/video/cx25840/cx25840-core.c b/trunk/drivers/media/video/cx25840/cx25840-core.c index 209d3bcb5dbb..e7bf4f4c1319 100644 --- a/trunk/drivers/media/video/cx25840/cx25840-core.c +++ b/trunk/drivers/media/video/cx25840/cx25840-core.c @@ -50,7 +50,7 @@ MODULE_LICENSE("GPL"); static unsigned short normal_i2c[] = { 0x88 >> 1, I2C_CLIENT_END }; -static int cx25840_debug; +int cx25840_debug; module_param_named(debug,cx25840_debug, int, 0644); diff --git a/trunk/drivers/media/video/cx25840/cx25840-core.h b/trunk/drivers/media/video/cx25840/cx25840-core.h index b87337e590b4..72916ba975a8 100644 --- a/trunk/drivers/media/video/cx25840/cx25840-core.h +++ b/trunk/drivers/media/video/cx25840/cx25840-core.h @@ -24,6 +24,8 @@ #include #include +extern int cx25840_debug; + /* ENABLE_PVR150_WORKAROUND activates a workaround for a hardware bug that is present in Hauppauge PVR-150 (and possibly PVR-500) cards that have certain NTSC tuners (tveeprom tuner model numbers 85, 99 and 112). The diff --git a/trunk/drivers/media/video/cx88/Kconfig b/trunk/drivers/media/video/cx88/Kconfig index 9dd7bdf659b9..10e20d8196dc 100644 --- a/trunk/drivers/media/video/cx88/Kconfig +++ b/trunk/drivers/media/video/cx88/Kconfig @@ -33,8 +33,9 @@ config VIDEO_CX88_ALSA config VIDEO_CX88_BLACKBIRD tristate "Blackbird MPEG encoder support (cx2388x + cx23416)" - depends on VIDEO_CX88 + depends on VIDEO_CX88 && HOTPLUG select VIDEO_CX2341X + select FW_LOADER ---help--- This adds support for MPEG encoder cards based on the Blackbird reference design, using the Conexant 2388x diff --git a/trunk/drivers/media/video/cx88/cx88-blackbird.c b/trunk/drivers/media/video/cx88/cx88-blackbird.c index 9a1374a38ec7..bfdca5847764 100644 --- a/trunk/drivers/media/video/cx88/cx88-blackbird.c +++ b/trunk/drivers/media/video/cx88/cx88-blackbird.c @@ -33,7 +33,6 @@ #include #include #include -#include #include #include "cx88.h" @@ -1175,7 +1174,12 @@ static const struct file_operations mpeg_fops = .llseek = no_llseek, }; -static const struct v4l2_ioctl_ops mpeg_ioctl_ops = { +static struct video_device cx8802_mpeg_template = +{ + .name = "cx8802", + .type = VID_TYPE_CAPTURE|VID_TYPE_TUNER|VID_TYPE_SCALES|VID_TYPE_MPEG_ENCODER, + .fops = &mpeg_fops, + .minor = -1, .vidioc_querymenu = vidioc_querymenu, .vidioc_querycap = vidioc_querycap, .vidioc_enum_fmt_vid_cap = vidioc_enum_fmt_vid_cap, @@ -1203,13 +1207,6 @@ static const struct v4l2_ioctl_ops mpeg_ioctl_ops = { .vidioc_g_tuner = vidioc_g_tuner, .vidioc_s_tuner = vidioc_s_tuner, .vidioc_s_std = vidioc_s_std, -}; - -static struct video_device cx8802_mpeg_template = { - .name = "cx8802", - .fops = &mpeg_fops, - .ioctl_ops = &mpeg_ioctl_ops, - .minor = -1, .tvnorms = CX88_NORMS, .current_norm = V4L2_STD_NTSC_M, }; diff --git a/trunk/drivers/media/video/cx88/cx88-cards.c b/trunk/drivers/media/video/cx88/cx88-cards.c index de199a206a15..fa6d398e97b9 100644 --- a/trunk/drivers/media/video/cx88/cx88-cards.c +++ b/trunk/drivers/media/video/cx88/cx88-cards.c @@ -1348,7 +1348,7 @@ static const struct cx88_board cx88_boards[] = { .tuner_addr = ADDR_UNSET, .radio_addr = ADDR_UNSET, .tda9887_conf = TDA9887_PRESENT, - .audio_chip = V4L2_IDENT_WM8775, + .audio_chip = AUDIO_CHIP_WM8775, .input = {{ .type = CX88_VMUX_TELEVISION, .vmux = 0, diff --git a/trunk/drivers/media/video/cx88/cx88-core.c b/trunk/drivers/media/video/cx88/cx88-core.c index d656fec59010..60eeda3057e9 100644 --- a/trunk/drivers/media/video/cx88/cx88-core.c +++ b/trunk/drivers/media/video/cx88/cx88-core.c @@ -40,7 +40,6 @@ #include "cx88.h" #include -#include MODULE_DESCRIPTION("v4l2 driver module for cx2388x based TV cards"); MODULE_AUTHOR("Gerd Knorr [SuSE Labs]"); @@ -1007,7 +1006,7 @@ struct video_device *cx88_vdev_init(struct cx88_core *core, return NULL; *vfd = *template; vfd->minor = -1; - vfd->parent = &pci->dev; + vfd->dev = &pci->dev; vfd->release = video_device_release; snprintf(vfd->name, sizeof(vfd->name), "%s %s (%s)", core->name, type, core->board.name); diff --git a/trunk/drivers/media/video/cx88/cx88-video.c b/trunk/drivers/media/video/cx88/cx88-video.c index ef4d56ea0027..0fed5cd2ccea 100644 --- a/trunk/drivers/media/video/cx88/cx88-video.c +++ b/trunk/drivers/media/video/cx88/cx88-video.c @@ -39,7 +39,6 @@ #include "cx88.h" #include -#include #ifdef CONFIG_VIDEO_V4L1_COMPAT /* Include V4L1 specific functions. Should be removed soon */ @@ -448,7 +447,7 @@ int cx88_video_mux(struct cx88_core *core, unsigned int input) the initialization. Some boards may use different routes for different inputs. HVR-1300 surely does */ if (core->board.audio_chip && - core->board.audio_chip == V4L2_IDENT_WM8775) { + core->board.audio_chip == AUDIO_CHIP_WM8775) { struct v4l2_routing route; route.input = INPUT(input).audioroute; @@ -1683,7 +1682,13 @@ static const struct file_operations video_fops = .llseek = no_llseek, }; -static const struct v4l2_ioctl_ops video_ioctl_ops = { +static struct video_device cx8800_vbi_template; +static struct video_device cx8800_video_template = +{ + .name = "cx8800-video", + .type = VID_TYPE_CAPTURE|VID_TYPE_TUNER|VID_TYPE_SCALES, + .fops = &video_fops, + .minor = -1, .vidioc_querycap = vidioc_querycap, .vidioc_enum_fmt_vid_cap = vidioc_enum_fmt_vid_cap, .vidioc_g_fmt_vid_cap = vidioc_g_fmt_vid_cap, @@ -1716,15 +1721,6 @@ static const struct v4l2_ioctl_ops video_ioctl_ops = { .vidioc_g_register = vidioc_g_register, .vidioc_s_register = vidioc_s_register, #endif -}; - -static struct video_device cx8800_vbi_template; - -static struct video_device cx8800_video_template = { - .name = "cx8800-video", - .fops = &video_fops, - .minor = -1, - .ioctl_ops = &video_ioctl_ops, .tvnorms = CX88_NORMS, .current_norm = V4L2_STD_NTSC_M, }; @@ -1739,7 +1735,12 @@ static const struct file_operations radio_fops = .llseek = no_llseek, }; -static const struct v4l2_ioctl_ops radio_ioctl_ops = { +static struct video_device cx8800_radio_template = +{ + .name = "cx8800-radio", + .type = VID_TYPE_TUNER, + .fops = &radio_fops, + .minor = -1, .vidioc_querycap = radio_querycap, .vidioc_g_tuner = radio_g_tuner, .vidioc_enum_input = radio_enum_input, @@ -1758,13 +1759,6 @@ static const struct v4l2_ioctl_ops radio_ioctl_ops = { #endif }; -static struct video_device cx8800_radio_template = { - .name = "cx8800-radio", - .fops = &radio_fops, - .minor = -1, - .ioctl_ops = &radio_ioctl_ops, -}; - /* ----------------------------------------------------------- */ static void cx8800_unregister_video(struct cx8800_dev *dev) @@ -1836,6 +1830,7 @@ static int __devinit cx8800_initdev(struct pci_dev *pci_dev, memcpy( &cx8800_vbi_template, &cx8800_video_template, sizeof(cx8800_vbi_template) ); strcpy(cx8800_vbi_template.name,"cx8800-vbi"); + cx8800_vbi_template.type = VID_TYPE_TELETEXT|VID_TYPE_TUNER; /* initialize driver struct */ spin_lock_init(&dev->slock); @@ -1871,7 +1866,7 @@ static int __devinit cx8800_initdev(struct pci_dev *pci_dev, /* load and configure helper modules */ - if (core->board.audio_chip == V4L2_IDENT_WM8775) + if (core->board.audio_chip == AUDIO_CHIP_WM8775) request_module("wm8775"); switch (core->boardnr) { diff --git a/trunk/drivers/media/video/cx88/cx88.h b/trunk/drivers/media/video/cx88/cx88.h index 54fe65094711..14ac173f4071 100644 --- a/trunk/drivers/media/video/cx88/cx88.h +++ b/trunk/drivers/media/video/cx88/cx88.h @@ -29,8 +29,8 @@ #include #include #include -#include #include +#include #if defined(CONFIG_VIDEO_CX88_DVB) || defined(CONFIG_VIDEO_CX88_DVB_MODULE) #include #endif @@ -252,7 +252,7 @@ struct cx88_board { struct cx88_input input[MAX_CX88_INPUT]; struct cx88_input radio; enum cx88_board_type mpeg; - unsigned int audio_chip; + enum audiochip audio_chip; }; struct cx88_subid { diff --git a/trunk/drivers/media/video/em28xx/em28xx-cards.c b/trunk/drivers/media/video/em28xx/em28xx-cards.c index 476ae44a62d2..05f0d5a15058 100644 --- a/trunk/drivers/media/video/em28xx/em28xx-cards.c +++ b/trunk/drivers/media/video/em28xx/em28xx-cards.c @@ -32,8 +32,8 @@ #include #include #include +#include #include -#include #include "em28xx.h" @@ -52,15 +52,6 @@ struct em28xx_hash_table { }; struct em28xx_board em28xx_boards[] = { - [EM2750_BOARD_UNKNOWN] = { - .name = "Unknown EM2750/EM2751 webcam grabber", - .vchannels = 1, - .input = { { - .type = EM28XX_VMUX_COMPOSITE1, - .vmux = 0, - .amux = 0, - } }, - }, [EM2800_BOARD_UNKNOWN] = { .name = "Unknown EM2800 video grabber", .is_em2800 = 1, @@ -82,39 +73,6 @@ struct em28xx_board em28xx_boards[] = { .is_em2800 = 0, .tuner_type = TUNER_ABSENT, }, - [EM2750_BOARD_DLCW_130] = { - /* Beijing Huaqi Information Digital Technology Co., Ltd */ - .name = "Huaqi DLCW-130", - .valid = EM28XX_BOARD_NOT_VALIDATED, - .vchannels = 1, - .input = { { - .type = EM28XX_VMUX_COMPOSITE1, - .vmux = 0, - .amux = 0, - } }, - }, - [EM2800_BOARD_KWORLD_USB2800] = { - .name = "Kworld USB2800", - .valid = EM28XX_BOARD_NOT_VALIDATED, - .is_em2800 = 1, - .vchannels = 3, - .tuner_type = TUNER_PHILIPS_FCV1236D, - .tda9887_conf = TDA9887_PRESENT, - .decoder = EM28XX_SAA7113, - .input = { { - .type = EM28XX_VMUX_TELEVISION, - .vmux = SAA7115_COMPOSITE2, - .amux = 0, - }, { - .type = EM28XX_VMUX_COMPOSITE1, - .vmux = SAA7115_COMPOSITE0, - .amux = 1, - }, { - .type = EM28XX_VMUX_SVIDEO, - .vmux = SAA7115_SVIDEO3, - .amux = 1, - } }, - }, [EM2820_BOARD_KWORLD_PVRTV2800RF] = { .name = "Kworld PVR TV 2800 RF", .is_em2800 = 0, @@ -193,271 +151,13 @@ struct em28xx_board em28xx_boards[] = { MSP_DSP_IN_SCART, MSP_DSP_IN_SCART), } }, }, - [EM2820_BOARD_DLINK_USB_TV] = { - .name = "D-Link DUB-T210 TV Tuner", - .valid = EM28XX_BOARD_NOT_VALIDATED, - .vchannels = 3, - .is_em2800 = 0, - .tuner_type = TUNER_LG_PAL_NEW_TAPC, - .tda9887_conf = TDA9887_PRESENT, - .decoder = EM28XX_SAA7113, - .input = { { - .type = EM28XX_VMUX_TELEVISION, - .vmux = SAA7115_COMPOSITE2, - .amux = 1, - }, { - .type = EM28XX_VMUX_COMPOSITE1, - .vmux = SAA7115_COMPOSITE0, - .amux = 1, - }, { - .type = EM28XX_VMUX_SVIDEO, - .vmux = SAA7115_SVIDEO3, - .amux = 1, - } }, - }, - [EM2820_BOARD_HERCULES_SMART_TV_USB2] = { - .name = "Hercules Smart TV USB 2.0", - .valid = EM28XX_BOARD_NOT_VALIDATED, - .vchannels = 3, - .tuner_type = TUNER_LG_PAL_NEW_TAPC, - .tda9887_conf = TDA9887_PRESENT, - .decoder = EM28XX_SAA7113, - .input = { { - .type = EM28XX_VMUX_TELEVISION, - .vmux = SAA7115_COMPOSITE2, - .amux = 1, - }, { - .type = EM28XX_VMUX_COMPOSITE1, - .vmux = SAA7115_COMPOSITE0, - .amux = 1, - }, { - .type = EM28XX_VMUX_SVIDEO, - .vmux = SAA7115_SVIDEO3, - .amux = 1, - } }, - }, - [EM2820_BOARD_PINNACLE_USB_2_FM1216ME] = { - .name = "Pinnacle PCTV USB 2 (Philips FM1216ME)", - .valid = EM28XX_BOARD_NOT_VALIDATED, - .vchannels = 3, - .is_em2800 = 0, - .tuner_type = TUNER_PHILIPS_FM1216ME_MK3, - .tda9887_conf = TDA9887_PRESENT, - .decoder = EM28XX_SAA7113, - .input = { { - .type = EM28XX_VMUX_TELEVISION, - .vmux = SAA7115_COMPOSITE2, - .amux = 0, - }, { - .type = EM28XX_VMUX_COMPOSITE1, - .vmux = SAA7115_COMPOSITE0, - .amux = 1, - }, { - .type = EM28XX_VMUX_SVIDEO, - .vmux = SAA7115_SVIDEO3, - .amux = 1, - } }, - }, - [EM2820_BOARD_GADMEI_UTV310] = { - .name = "Gadmei UTV310", - .valid = EM28XX_BOARD_NOT_VALIDATED, - .vchannels = 3, - .tuner_type = TUNER_TNF_5335MF, - .tda9887_conf = TDA9887_PRESENT, - .decoder = EM28XX_SAA7113, - .input = { { - .type = EM28XX_VMUX_TELEVISION, - .vmux = SAA7115_COMPOSITE1, - .amux = 1, - }, { - .type = EM28XX_VMUX_COMPOSITE1, - .vmux = SAA7115_COMPOSITE0, - .amux = 1, - }, { - .type = EM28XX_VMUX_SVIDEO, - .vmux = SAA7115_SVIDEO3, - .amux = 1, - } }, - }, - [EM2820_BOARD_LEADTEK_WINFAST_USBII_DELUXE] = { - .name = "Leadtek Winfast USB II Deluxe", - .valid = EM28XX_BOARD_NOT_VALIDATED, - .vchannels = 3, - .tuner_type = TUNER_PHILIPS_FM1216ME_MK3, - .tda9887_conf = TDA9887_PRESENT, - .decoder = EM28XX_SAA7114, - .input = { { - .type = EM28XX_VMUX_TELEVISION, - .vmux = 2, - .amux = 0, - }, { - .type = EM28XX_VMUX_COMPOSITE1, - .vmux = 0, - .amux = 1, - }, { - .type = EM28XX_VMUX_SVIDEO, - .vmux = 9, - .amux = 1, - } }, - }, - [EM2820_BOARD_PINNACLE_DVC_100] = { - .name = "Pinnacle Dazzle DVC 100", - .valid = EM28XX_BOARD_NOT_VALIDATED, - .vchannels = 3, - .decoder = EM28XX_SAA7113, - .input = { { - .type = EM28XX_VMUX_COMPOSITE1, - .vmux = SAA7115_COMPOSITE0, - .amux = 1, - }, { - .type = EM28XX_VMUX_SVIDEO, - .vmux = SAA7115_SVIDEO3, - .amux = 1, - } }, - }, - [EM2820_BOARD_VIDEOLOGY_20K14XUSB] = { - .name = "Videology 20K14XUSB USB2.0", - .valid = EM28XX_BOARD_NOT_VALIDATED, - .vchannels = 1, - .input = { { - .type = EM28XX_VMUX_COMPOSITE1, - .vmux = 0, - .amux = 0, - } }, - }, - [EM2821_BOARD_PROLINK_PLAYTV_USB2] = { - .name = "SIIG AVTuner-PVR/Prolink PlayTV USB 2.0", - .valid = EM28XX_BOARD_NOT_VALIDATED, - .vchannels = 3, - .is_em2800 = 0, - .tuner_type = TUNER_LG_PAL_NEW_TAPC, /* unknown? */ - .tda9887_conf = TDA9887_PRESENT, /* unknown? */ - .decoder = EM28XX_SAA7113, - .input = { { - .type = EM28XX_VMUX_TELEVISION, - .vmux = SAA7115_COMPOSITE2, - .amux = 1, - }, { - .type = EM28XX_VMUX_COMPOSITE1, - .vmux = SAA7115_COMPOSITE0, - .amux = 1, - }, { - .type = EM28XX_VMUX_SVIDEO, - .vmux = SAA7115_SVIDEO3, - .amux = 1, - } }, - }, - [EM2821_BOARD_SUPERCOMP_USB_2] = { - .name = "Supercomp USB 2.0 TV", - .valid = EM28XX_BOARD_NOT_VALIDATED, - .vchannels = 3, - .is_em2800 = 0, - .tuner_type = TUNER_PHILIPS_FM1236_MK3, - .tda9887_conf = TDA9887_PRESENT | - TDA9887_PORT1_ACTIVE | - TDA9887_PORT2_ACTIVE, - .decoder = EM28XX_SAA7113, - .input = { { - .type = EM28XX_VMUX_TELEVISION, - .vmux = SAA7115_COMPOSITE2, - .amux = 1, - }, { - .type = EM28XX_VMUX_COMPOSITE1, - .vmux = SAA7115_COMPOSITE0, - .amux = 0, - }, { - .type = EM28XX_VMUX_SVIDEO, - .vmux = SAA7115_SVIDEO3, - .amux = 1, - } }, - }, - [EM2821_BOARD_USBGEAR_VD204] = { - .name = "Usbgear VD204v9", - .valid = EM28XX_BOARD_NOT_VALIDATED, - .vchannels = 2, - .decoder = EM28XX_SAA7113, - .input = { { - .type = EM28XX_VMUX_COMPOSITE1, - .vmux = SAA7115_COMPOSITE0, - .amux = 1, - }, { - .type = EM28XX_VMUX_SVIDEO, - .vmux = SAA7115_SVIDEO3, - .amux = 1, - } }, - }, - [EM2860_BOARD_NETGMBH_CAM] = { - /* Beijing Huaqi Information Digital Technology Co., Ltd */ - .name = "NetGMBH Cam", - .valid = EM28XX_BOARD_NOT_VALIDATED, - .vchannels = 1, - .input = { { - .type = EM28XX_VMUX_COMPOSITE1, - .vmux = 0, - .amux = 0, - } }, - }, - [EM2860_BOARD_TYPHOON_DVD_MAKER] = { - .name = "Typhoon DVD Maker", - .valid = EM28XX_BOARD_NOT_VALIDATED, - .vchannels = 2, - .decoder = EM28XX_SAA7113, - .input = { { - .type = EM28XX_VMUX_COMPOSITE1, - .vmux = SAA7115_COMPOSITE0, - .amux = 1, - }, { - .type = EM28XX_VMUX_SVIDEO, - .vmux = SAA7115_SVIDEO3, - .amux = 1, - } }, - }, - [EM2860_BOARD_GADMEI_UTV330] = { - .name = "Gadmei UTV330", - .valid = EM28XX_BOARD_NOT_VALIDATED, + [EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900] = { + .name = "Hauppauge WinTV HVR 900", .vchannels = 3, - .tuner_type = TUNER_TNF_5335MF, .tda9887_conf = TDA9887_PRESENT, - .decoder = EM28XX_SAA7113, - .input = { { - .type = EM28XX_VMUX_TELEVISION, - .vmux = SAA7115_COMPOSITE2, - .amux = 0, - }, { - .type = EM28XX_VMUX_COMPOSITE1, - .vmux = SAA7115_COMPOSITE0, - .amux = 1, - }, { - .type = EM28XX_VMUX_SVIDEO, - .vmux = SAA7115_SVIDEO3, - .amux = 1, - } }, - }, - [EM2860_BOARD_TERRATEC_HYBRID_XS] = { - .name = "Terratec Cinergy A Hybrid XS", - .valid = EM28XX_BOARD_NOT_VALIDATED, - .vchannels = 3, - .tuner_type = TUNER_XC2028, - .decoder = EM28XX_TVP5150, - .input = { { - .type = EM28XX_VMUX_TELEVISION, - .vmux = TVP5150_COMPOSITE0, - .amux = 0, - }, { - .type = EM28XX_VMUX_COMPOSITE1, - .vmux = TVP5150_COMPOSITE1, - .amux = 1, - }, { - .type = EM28XX_VMUX_SVIDEO, - .vmux = TVP5150_SVIDEO, - .amux = 1, - } }, - }, - [EM2861_BOARD_KWORLD_PVRTV_300U] = { - .name = "KWorld PVRTV 300U", - .valid = EM28XX_BOARD_NOT_VALIDATED, - .vchannels = 3, .tuner_type = TUNER_XC2028, + .mts_firmware = 1, + .has_dvb = 1, .decoder = EM28XX_TVP5150, .input = { { .type = EM28XX_VMUX_TELEVISION, @@ -473,81 +173,12 @@ struct em28xx_board em28xx_boards[] = { .amux = 1, } }, }, - [EM2861_BOARD_YAKUMO_MOVIE_MIXER] = { - .name = "Yakumo MovieMixer", - .valid = EM28XX_BOARD_NOT_VALIDATED, - .vchannels = 1, - .decoder = EM28XX_TVP5150, - .input = { { - .type = EM28XX_VMUX_TELEVISION, - .vmux = TVP5150_COMPOSITE0, - .amux = 0, - }, { - .type = EM28XX_VMUX_COMPOSITE1, - .vmux = TVP5150_COMPOSITE1, - .amux = 1, - }, { - .type = EM28XX_VMUX_SVIDEO, - .vmux = TVP5150_SVIDEO, - .amux = 1, - } }, - }, - [EM2861_BOARD_PLEXTOR_PX_TV100U] = { - .name = "Plextor ConvertX PX-TV100U", - .valid = EM28XX_BOARD_NOT_VALIDATED, + [EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900_R2] = { + .name = "Hauppauge WinTV HVR 900 (R2)", .vchannels = 3, - .tuner_type = TUNER_TNF_5335MF, .tda9887_conf = TDA9887_PRESENT, - .decoder = EM28XX_TVP5150, - .input = { { - .type = EM28XX_VMUX_TELEVISION, - .vmux = TVP5150_COMPOSITE0, - .amux = 1, - }, { - .type = EM28XX_VMUX_COMPOSITE1, - .vmux = TVP5150_COMPOSITE1, - .amux = 1, - }, { - .type = EM28XX_VMUX_SVIDEO, - .vmux = TVP5150_SVIDEO, - .amux = 1, - } }, - }, - [EM2870_BOARD_TERRATEC_XS] = { - .name = "Terratec Cinergy T XS", - .valid = EM28XX_BOARD_NOT_VALIDATED, - .tuner_type = TUNER_XC2028, - }, - [EM2870_BOARD_TERRATEC_XS_MT2060] = { - .name = "Terratec Cinergy T XS (MT2060)", - .valid = EM28XX_BOARD_NOT_VALIDATED, - .tuner_type = TUNER_ABSENT, /* MT2060 */ - }, - [EM2870_BOARD_KWORLD_350U] = { - .name = "Kworld 350 U DVB-T", - .valid = EM28XX_BOARD_NOT_VALIDATED, - .tuner_type = TUNER_XC2028, - }, - [EM2870_BOARD_KWORLD_355U] = { - .name = "Kworld 355 U DVB-T", - .valid = EM28XX_BOARD_NOT_VALIDATED, - }, - [EM2870_BOARD_PINNACLE_PCTV_DVB] = { - .name = "Pinnacle PCTV DVB-T", - .valid = EM28XX_BOARD_NOT_VALIDATED, - .tuner_type = TUNER_ABSENT, /* MT2060 */ - }, - [EM2870_BOARD_COMPRO_VIDEOMATE] = { - .name = "Compro, VideoMate U3", - .valid = EM28XX_BOARD_NOT_VALIDATED, - .tuner_type = TUNER_ABSENT, /* MT2060 */ - }, - [EM2880_BOARD_TERRATEC_HYBRID_XS_FR] = { - .name = "Terratec Hybrid XS Secam", - .valid = EM28XX_BOARD_NOT_VALIDATED, - .vchannels = 3, - .has_msp34xx = 1, .tuner_type = TUNER_XC2028, + .mts_firmware = 1, .decoder = EM28XX_TVP5150, .input = { { .type = EM28XX_VMUX_TELEVISION, @@ -563,339 +194,15 @@ struct em28xx_board em28xx_boards[] = { .amux = 1, } }, }, - [EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900] = { - .name = "Hauppauge WinTV HVR 900", - .vchannels = 3, - .tda9887_conf = TDA9887_PRESENT, - .tuner_type = TUNER_XC2028, - .mts_firmware = 1, - .has_dvb = 1, - .decoder = EM28XX_TVP5150, - .input = { { - .type = EM28XX_VMUX_TELEVISION, - .vmux = TVP5150_COMPOSITE0, - .amux = 0, - }, { - .type = EM28XX_VMUX_COMPOSITE1, - .vmux = TVP5150_COMPOSITE1, - .amux = 1, - }, { - .type = EM28XX_VMUX_SVIDEO, - .vmux = TVP5150_SVIDEO, - .amux = 1, - } }, - }, - [EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900_R2] = { - .name = "Hauppauge WinTV HVR 900 (R2)", - .vchannels = 3, - .tda9887_conf = TDA9887_PRESENT, - .tuner_type = TUNER_XC2028, - .mts_firmware = 1, - .decoder = EM28XX_TVP5150, - .input = { { - .type = EM28XX_VMUX_TELEVISION, - .vmux = TVP5150_COMPOSITE0, - .amux = 0, - }, { - .type = EM28XX_VMUX_COMPOSITE1, - .vmux = TVP5150_COMPOSITE1, - .amux = 1, - }, { - .type = EM28XX_VMUX_SVIDEO, - .vmux = TVP5150_SVIDEO, - .amux = 1, - } }, - }, - [EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950] = { + [EM2880_BOARD_HAUPPAUGE_WINTV_HVR_950] = { .name = "Hauppauge WinTV HVR 950", .vchannels = 3, .tda9887_conf = TDA9887_PRESENT, .tuner_type = TUNER_XC2028, .mts_firmware = 1, .has_12mhz_i2s = 1, - .has_dvb = 1, - .decoder = EM28XX_TVP5150, - .input = { { - .type = EM28XX_VMUX_TELEVISION, - .vmux = TVP5150_COMPOSITE0, - .amux = 0, - }, { - .type = EM28XX_VMUX_COMPOSITE1, - .vmux = TVP5150_COMPOSITE1, - .amux = 1, - }, { - .type = EM28XX_VMUX_SVIDEO, - .vmux = TVP5150_SVIDEO, - .amux = 1, - } }, - }, - [EM2880_BOARD_PINNACLE_PCTV_HD_PRO] = { - .name = "Pinnacle PCTV HD Pro Stick", - .vchannels = 3, - .tda9887_conf = TDA9887_PRESENT, - .tuner_type = TUNER_XC2028, - .mts_firmware = 1, - .has_12mhz_i2s = 1, - .has_dvb = 1, - .decoder = EM28XX_TVP5150, - .input = { { - .type = EM28XX_VMUX_TELEVISION, - .vmux = TVP5150_COMPOSITE0, - .amux = 0, - }, { - .type = EM28XX_VMUX_COMPOSITE1, - .vmux = TVP5150_COMPOSITE1, - .amux = 1, - }, { - .type = EM28XX_VMUX_SVIDEO, - .vmux = TVP5150_SVIDEO, - .amux = 1, - } }, - }, - [EM2880_BOARD_AMD_ATI_TV_WONDER_HD_600] = { - .name = "AMD ATI TV Wonder HD 600", - .vchannels = 3, - .tda9887_conf = TDA9887_PRESENT, - .tuner_type = TUNER_XC2028, - .mts_firmware = 1, - .has_12mhz_i2s = 1, - .has_dvb = 1, - .decoder = EM28XX_TVP5150, - .input = { { - .type = EM28XX_VMUX_TELEVISION, - .vmux = TVP5150_COMPOSITE0, - .amux = 0, - }, { - .type = EM28XX_VMUX_COMPOSITE1, - .vmux = TVP5150_COMPOSITE1, - .amux = 1, - }, { - .type = EM28XX_VMUX_SVIDEO, - .vmux = TVP5150_SVIDEO, - .amux = 1, - } }, - }, - [EM2880_BOARD_TERRATEC_HYBRID_XS] = { - .name = "Terratec Hybrid XS", - .vchannels = 3, - .tda9887_conf = TDA9887_PRESENT, - .tuner_type = TUNER_XC2028, - .decoder = EM28XX_TVP5150, - .has_dvb = 1, - .input = { { - .type = EM28XX_VMUX_TELEVISION, - .vmux = TVP5150_COMPOSITE0, - .amux = 0, - }, { - .type = EM28XX_VMUX_COMPOSITE1, - .vmux = TVP5150_COMPOSITE1, - .amux = 1, - }, { - .type = EM28XX_VMUX_SVIDEO, - .vmux = TVP5150_SVIDEO, - .amux = 1, - } }, - }, - /* maybe there's a reason behind it why Terratec sells the Hybrid XS - as Prodigy XS with a different PID, let's keep it separated for now - maybe we'll need it lateron */ - [EM2880_BOARD_TERRATEC_PRODIGY_XS] = { - .name = "Terratec Prodigy XS", - .vchannels = 3, - .tda9887_conf = TDA9887_PRESENT, - .tuner_type = TUNER_XC2028, - .decoder = EM28XX_TVP5150, - .input = { { - .type = EM28XX_VMUX_TELEVISION, - .vmux = TVP5150_COMPOSITE0, - .amux = 0, - }, { - .type = EM28XX_VMUX_COMPOSITE1, - .vmux = TVP5150_COMPOSITE1, - .amux = 1, - }, { - .type = EM28XX_VMUX_SVIDEO, - .vmux = TVP5150_SVIDEO, - .amux = 1, - } }, - }, - [EM2820_BOARD_MSI_VOX_USB_2] = { - .name = "MSI VOX USB 2.0", - .vchannels = 3, - .tuner_type = TUNER_LG_PAL_NEW_TAPC, - .tda9887_conf = TDA9887_PRESENT | - TDA9887_PORT1_ACTIVE | - TDA9887_PORT2_ACTIVE, - .max_range_640_480 = 1, - - .decoder = EM28XX_SAA7114, - .input = { { - .type = EM28XX_VMUX_TELEVISION, - .vmux = SAA7115_COMPOSITE4, - .amux = 0, - }, { - .type = EM28XX_VMUX_COMPOSITE1, - .vmux = SAA7115_COMPOSITE0, - .amux = 1, - }, { - .type = EM28XX_VMUX_SVIDEO, - .vmux = SAA7115_SVIDEO3, - .amux = 1, - } }, - }, - [EM2800_BOARD_TERRATEC_CINERGY_200] = { - .name = "Terratec Cinergy 200 USB", - .is_em2800 = 1, - .vchannels = 3, - .tuner_type = TUNER_LG_PAL_NEW_TAPC, - .tda9887_conf = TDA9887_PRESENT, - .decoder = EM28XX_SAA7113, - .input = { { - .type = EM28XX_VMUX_TELEVISION, - .vmux = SAA7115_COMPOSITE2, - .amux = 0, - }, { - .type = EM28XX_VMUX_COMPOSITE1, - .vmux = SAA7115_COMPOSITE0, - .amux = 1, - }, { - .type = EM28XX_VMUX_SVIDEO, - .vmux = SAA7115_SVIDEO3, - .amux = 1, - } }, - }, - [EM2800_BOARD_GRABBEEX_USB2800] = { - .name = "eMPIA Technology, Inc. GrabBeeX+ Video Encoder", - .is_em2800 = 1, - .vchannels = 2, - .decoder = EM28XX_SAA7113, - .input = { { - .type = EM28XX_VMUX_COMPOSITE1, - .vmux = SAA7115_COMPOSITE0, - .amux = 1, - }, { - .type = EM28XX_VMUX_SVIDEO, - .vmux = SAA7115_SVIDEO3, - .amux = 1, - } }, - }, - [EM2800_BOARD_LEADTEK_WINFAST_USBII] = { - .name = "Leadtek Winfast USB II", - .is_em2800 = 1, - .vchannels = 3, - .tuner_type = TUNER_LG_PAL_NEW_TAPC, - .tda9887_conf = TDA9887_PRESENT, - .decoder = EM28XX_SAA7113, - .input = { { - .type = EM28XX_VMUX_TELEVISION, - .vmux = SAA7115_COMPOSITE2, - .amux = 0, - }, { - .type = EM28XX_VMUX_COMPOSITE1, - .vmux = SAA7115_COMPOSITE0, - .amux = 1, - }, { - .type = EM28XX_VMUX_SVIDEO, - .vmux = SAA7115_SVIDEO3, - .amux = 1, - } }, - }, - [EM2800_BOARD_KWORLD_USB2800] = { - .name = "Kworld USB2800", - .is_em2800 = 1, - .vchannels = 3, - .tuner_type = TUNER_PHILIPS_FCV1236D, - .tda9887_conf = TDA9887_PRESENT, - .decoder = EM28XX_SAA7113, - .input = { { - .type = EM28XX_VMUX_TELEVISION, - .vmux = SAA7115_COMPOSITE2, - .amux = 0, - }, { - .type = EM28XX_VMUX_COMPOSITE1, - .vmux = SAA7115_COMPOSITE0, - .amux = 1, - }, { - .type = EM28XX_VMUX_SVIDEO, - .vmux = SAA7115_SVIDEO3, - .amux = 1, - } }, - }, - [EM2820_BOARD_PINNACLE_DVC_90] = { - .name = "Pinnacle Dazzle DVC 90/DVC 100", - .vchannels = 3, - .tuner_type = TUNER_ABSENT, - .decoder = EM28XX_SAA7113, - .input = { { - .type = EM28XX_VMUX_COMPOSITE1, - .vmux = SAA7115_COMPOSITE0, - .amux = 1, - }, { - .type = EM28XX_VMUX_SVIDEO, - .vmux = SAA7115_SVIDEO3, - .amux = 1, - } }, - }, - [EM2800_BOARD_VGEAR_POCKETTV] = { - .name = "V-Gear PocketTV", - .is_em2800 = 1, - .vchannels = 3, - .tuner_type = TUNER_LG_PAL_NEW_TAPC, - .tda9887_conf = TDA9887_PRESENT, - .decoder = EM28XX_SAA7113, - .input = { { - .type = EM28XX_VMUX_TELEVISION, - .vmux = SAA7115_COMPOSITE2, - .amux = 0, - }, { - .type = EM28XX_VMUX_COMPOSITE1, - .vmux = SAA7115_COMPOSITE0, - .amux = 1, - }, { - .type = EM28XX_VMUX_SVIDEO, - .vmux = SAA7115_SVIDEO3, - .amux = 1, - } }, - }, - [EM2820_BOARD_PROLINK_PLAYTV_USB2] = { - .name = "Pixelview Prolink PlayTV USB 2.0", - .vchannels = 3, - .tda9887_conf = TDA9887_PRESENT, - .tuner_type = TUNER_YMEC_TVF_5533MF, - .decoder = EM28XX_SAA7113, - .input = { { - .type = EM28XX_VMUX_TELEVISION, - .vmux = SAA7115_COMPOSITE2, - .amux = EM28XX_AMUX_LINE_IN, - }, { - .type = EM28XX_VMUX_COMPOSITE1, - .vmux = SAA7115_COMPOSITE0, - .amux = EM28XX_AMUX_LINE_IN, - }, { - .type = EM28XX_VMUX_SVIDEO, - .vmux = SAA7115_SVIDEO3, - .amux = EM28XX_AMUX_LINE_IN, - } }, - }, - [EM2860_BOARD_POINTNIX_INTRAORAL_CAMERA] = { - .name = "PointNix Intra-Oral Camera", - .has_snapshot_button = 1, - .vchannels = 1, - .tda9887_conf = TDA9887_PRESENT, - .tuner_type = TUNER_ABSENT, - .decoder = EM28XX_SAA7113, - .input = { { - .type = EM28XX_VMUX_SVIDEO, - .vmux = SAA7115_SVIDEO3, - .amux = 0, - } }, - }, - [EM2880_BOARD_MSI_DIGIVOX_AD] = { - .name = "MSI DigiVox A/D", - .valid = EM28XX_BOARD_NOT_VALIDATED, - .vchannels = 3, - .tuner_type = TUNER_XC2028, - .decoder = EM28XX_TVP5150, + .has_dvb = 1, + .decoder = EM28XX_TVP5150, .input = { { .type = EM28XX_VMUX_TELEVISION, .vmux = TVP5150_COMPOSITE0, @@ -910,12 +217,15 @@ struct em28xx_board em28xx_boards[] = { .amux = 1, } }, }, - [EM2880_BOARD_MSI_DIGIVOX_AD_II] = { - .name = "MSI DigiVox A/D II", - .valid = EM28XX_BOARD_NOT_VALIDATED, - .vchannels = 3, - .tuner_type = TUNER_XC2028, - .decoder = EM28XX_TVP5150, + [EM2880_BOARD_PINNACLE_PCTV_HD_PRO] = { + .name = "Pinnacle PCTV HD Pro Stick", + .vchannels = 3, + .tda9887_conf = TDA9887_PRESENT, + .tuner_type = TUNER_XC2028, + .mts_firmware = 1, + .has_12mhz_i2s = 1, + .has_dvb = 1, + .decoder = EM28XX_TVP5150, .input = { { .type = EM28XX_VMUX_TELEVISION, .vmux = TVP5150_COMPOSITE0, @@ -930,10 +240,10 @@ struct em28xx_board em28xx_boards[] = { .amux = 1, } }, }, - [EM2880_BOARD_KWORLD_DVB_305U] = { - .name = "KWorld DVB-T 305U", - .valid = EM28XX_BOARD_NOT_VALIDATED, + [EM2880_BOARD_TERRATEC_HYBRID_XS] = { + .name = "Terratec Hybrid XS", .vchannels = 3, + .tda9887_conf = TDA9887_PRESENT, .tuner_type = TUNER_XC2028, .decoder = EM28XX_TVP5150, .input = { { @@ -950,10 +260,13 @@ struct em28xx_board em28xx_boards[] = { .amux = 1, } }, }, - [EM2880_BOARD_KWORLD_DVB_310U] = { - .name = "KWorld DVB-T 310U", - .valid = EM28XX_BOARD_NOT_VALIDATED, + /* maybe there's a reason behind it why Terratec sells the Hybrid XS + as Prodigy XS with a different PID, let's keep it separated for now + maybe we'll need it lateron */ + [EM2880_BOARD_TERRATEC_PRODIGY_XS] = { + .name = "Terratec Prodigy XS", .vchannels = 3, + .tda9887_conf = TDA9887_PRESENT, .tuner_type = TUNER_XC2028, .decoder = EM28XX_TVP5150, .input = { { @@ -970,141 +283,160 @@ struct em28xx_board em28xx_boards[] = { .amux = 1, } }, }, - [EM2881_BOARD_DNT_DA2_HYBRID] = { - .name = "DNT DA2 Hybrid", - .valid = EM28XX_BOARD_NOT_VALIDATED, + [EM2820_BOARD_MSI_VOX_USB_2] = { + .name = "MSI VOX USB 2.0", + .vchannels = 3, + .tuner_type = TUNER_LG_PAL_NEW_TAPC, + .tda9887_conf = TDA9887_PRESENT | + TDA9887_PORT1_ACTIVE | + TDA9887_PORT2_ACTIVE, + .max_range_640_480 = 1, + + .decoder = EM28XX_SAA7114, + .input = { { + .type = EM28XX_VMUX_TELEVISION, + .vmux = SAA7115_COMPOSITE4, + .amux = 0, + }, { + .type = EM28XX_VMUX_COMPOSITE1, + .vmux = SAA7115_COMPOSITE0, + .amux = 1, + }, { + .type = EM28XX_VMUX_SVIDEO, + .vmux = SAA7115_SVIDEO3, + .amux = 1, + } }, + }, + [EM2800_BOARD_TERRATEC_CINERGY_200] = { + .name = "Terratec Cinergy 200 USB", + .is_em2800 = 1, .vchannels = 3, - .tuner_type = TUNER_XC2028, - .decoder = EM28XX_TVP5150, + .tuner_type = TUNER_LG_PAL_NEW_TAPC, + .tda9887_conf = TDA9887_PRESENT, + .decoder = EM28XX_SAA7113, .input = { { .type = EM28XX_VMUX_TELEVISION, - .vmux = TVP5150_COMPOSITE0, + .vmux = SAA7115_COMPOSITE2, .amux = 0, }, { .type = EM28XX_VMUX_COMPOSITE1, - .vmux = TVP5150_COMPOSITE1, + .vmux = SAA7115_COMPOSITE0, .amux = 1, }, { .type = EM28XX_VMUX_SVIDEO, - .vmux = TVP5150_SVIDEO, + .vmux = SAA7115_SVIDEO3, .amux = 1, } }, }, - [EM2881_BOARD_PINNACLE_HYBRID_PRO] = { - .name = "Pinnacle Hybrid Pro", - .valid = EM28XX_BOARD_NOT_VALIDATED, + [EM2800_BOARD_LEADTEK_WINFAST_USBII] = { + .name = "Leadtek Winfast USB II", + .is_em2800 = 1, .vchannels = 3, - .tuner_type = TUNER_XC2028, - .decoder = EM28XX_TVP5150, + .tuner_type = TUNER_LG_PAL_NEW_TAPC, + .tda9887_conf = TDA9887_PRESENT, + .decoder = EM28XX_SAA7113, .input = { { .type = EM28XX_VMUX_TELEVISION, - .vmux = TVP5150_COMPOSITE0, + .vmux = SAA7115_COMPOSITE2, .amux = 0, }, { .type = EM28XX_VMUX_COMPOSITE1, - .vmux = TVP5150_COMPOSITE1, + .vmux = SAA7115_COMPOSITE0, .amux = 1, }, { .type = EM28XX_VMUX_SVIDEO, - .vmux = TVP5150_SVIDEO, + .vmux = SAA7115_SVIDEO3, .amux = 1, } }, }, - [EM2882_BOARD_PINNACLE_HYBRID_PRO] = { - .name = "Pinnacle Hybrid Pro (2)", - .valid = EM28XX_BOARD_NOT_VALIDATED, + [EM2800_BOARD_KWORLD_USB2800] = { + .name = "Kworld USB2800", + .is_em2800 = 1, .vchannels = 3, - .tuner_type = TUNER_XC2028, - .decoder = EM28XX_TVP5150, + .tuner_type = TUNER_PHILIPS_FCV1236D, + .tda9887_conf = TDA9887_PRESENT, + .decoder = EM28XX_SAA7113, .input = { { .type = EM28XX_VMUX_TELEVISION, - .vmux = TVP5150_COMPOSITE0, + .vmux = SAA7115_COMPOSITE2, .amux = 0, }, { .type = EM28XX_VMUX_COMPOSITE1, - .vmux = TVP5150_COMPOSITE1, + .vmux = SAA7115_COMPOSITE0, .amux = 1, }, { .type = EM28XX_VMUX_SVIDEO, - .vmux = TVP5150_SVIDEO, + .vmux = SAA7115_SVIDEO3, .amux = 1, } }, }, - [EM2882_BOARD_KWORLD_VS_DVBT] = { - .name = "Kworld VS-DVB-T 323UR", - .valid = EM28XX_BOARD_NOT_VALIDATED, + [EM2820_BOARD_PINNACLE_DVC_90] = { + .name = "Pinnacle Dazzle DVC 90/DVC 100", .vchannels = 3, - .tuner_type = TUNER_XC2028, - .decoder = EM28XX_TVP5150, + .tuner_type = TUNER_ABSENT, + .decoder = EM28XX_SAA7113, .input = { { - .type = EM28XX_VMUX_TELEVISION, - .vmux = TVP5150_COMPOSITE0, - .amux = 0, - }, { .type = EM28XX_VMUX_COMPOSITE1, - .vmux = TVP5150_COMPOSITE1, + .vmux = SAA7115_COMPOSITE0, .amux = 1, }, { .type = EM28XX_VMUX_SVIDEO, - .vmux = TVP5150_SVIDEO, + .vmux = SAA7115_SVIDEO3, .amux = 1, } }, }, - [EM2882_BOARD_TERRATEC_HYBRID_XS] = { - .name = "Terratec Hybrid XS (em2882)", - .valid = EM28XX_BOARD_NOT_VALIDATED, + [EM2800_BOARD_VGEAR_POCKETTV] = { + .name = "V-Gear PocketTV", + .is_em2800 = 1, .vchannels = 3, - .tuner_type = TUNER_XC2028, - .decoder = EM28XX_TVP5150, + .tuner_type = TUNER_LG_PAL_NEW_TAPC, + .tda9887_conf = TDA9887_PRESENT, + .decoder = EM28XX_SAA7113, .input = { { .type = EM28XX_VMUX_TELEVISION, - .vmux = TVP5150_COMPOSITE0, + .vmux = SAA7115_COMPOSITE2, .amux = 0, }, { .type = EM28XX_VMUX_COMPOSITE1, - .vmux = TVP5150_COMPOSITE1, + .vmux = SAA7115_COMPOSITE0, .amux = 1, }, { .type = EM28XX_VMUX_SVIDEO, - .vmux = TVP5150_SVIDEO, + .vmux = SAA7115_SVIDEO3, .amux = 1, } }, }, - [EM2883_BOARD_KWORLD_HYBRID_A316] = { - .name = "Kworld PlusTV HD Hybrid 330", - .valid = EM28XX_BOARD_NOT_VALIDATED, + [EM2820_BOARD_PROLINK_PLAYTV_USB2] = { + .name = "Pixelview Prolink PlayTV USB 2.0", .vchannels = 3, - .is_em2800 = 0, - .tuner_type = TUNER_XC2028, - .decoder = EM28XX_TVP5150, + .tda9887_conf = TDA9887_PRESENT, + .tuner_type = TUNER_YMEC_TVF_5533MF, + .decoder = EM28XX_SAA7113, .input = { { .type = EM28XX_VMUX_TELEVISION, - .vmux = TVP5150_COMPOSITE0, - .amux = 0, + .vmux = SAA7115_COMPOSITE2, + .amux = EM28XX_AMUX_LINE_IN, }, { .type = EM28XX_VMUX_COMPOSITE1, - .vmux = TVP5150_COMPOSITE1, - .amux = 1, + .vmux = SAA7115_COMPOSITE0, + .amux = EM28XX_AMUX_LINE_IN, }, { .type = EM28XX_VMUX_SVIDEO, - .vmux = TVP5150_SVIDEO, - .amux = 1, + .vmux = SAA7115_SVIDEO3, + .amux = EM28XX_AMUX_LINE_IN, } }, }, - [EM2820_BOARD_COMPRO_VIDEOMATE_FORYOU] = { - .name = "Compro VideoMate ForYou/Stereo", - .vchannels = 2, - .tuner_type = TUNER_LG_PAL_NEW_TAPC, + [EM2860_BOARD_POINTNIX_INTRAORAL_CAMERA] = { + .name = "PointNix Intra-Oral Camera", + .has_snapshot_button = 1, + .vchannels = 1, .tda9887_conf = TDA9887_PRESENT, - .decoder = EM28XX_TVP5150, + .tuner_type = TUNER_ABSENT, + .decoder = EM28XX_SAA7113, .input = { { - .type = EM28XX_VMUX_TELEVISION, - .vmux = TVP5150_COMPOSITE0, - .amux = EM28XX_AMUX_LINE_IN, - }, { .type = EM28XX_VMUX_SVIDEO, - .vmux = TVP5150_SVIDEO, - .amux = EM28XX_AMUX_LINE_IN, + .vmux = SAA7115_SVIDEO3, + .amux = 0, } }, }, }; @@ -1113,9 +445,7 @@ const unsigned int em28xx_bcount = ARRAY_SIZE(em28xx_boards); /* table of devices that work with this driver */ struct usb_device_id em28xx_id_table [] = { { USB_DEVICE(0xeb1a, 0x2750), - .driver_info = EM2750_BOARD_UNKNOWN }, - { USB_DEVICE(0xeb1a, 0x2751), - .driver_info = EM2750_BOARD_UNKNOWN }, + .driver_info = EM2820_BOARD_UNKNOWN }, { USB_DEVICE(0xeb1a, 0x2800), .driver_info = EM2800_BOARD_UNKNOWN }, { USB_DEVICE(0xeb1a, 0x2820), @@ -1132,78 +462,36 @@ struct usb_device_id em28xx_id_table [] = { .driver_info = EM2820_BOARD_UNKNOWN }, { USB_DEVICE(0xeb1a, 0x2883), .driver_info = EM2820_BOARD_UNKNOWN }, - { USB_DEVICE(0xeb1a, 0xe300), - .driver_info = EM2861_BOARD_KWORLD_PVRTV_300U }, - { USB_DEVICE(0xeb1a, 0xe305), - .driver_info = EM2880_BOARD_KWORLD_DVB_305U }, - { USB_DEVICE(0xeb1a, 0xe310), - .driver_info = EM2880_BOARD_MSI_DIGIVOX_AD }, - { USB_DEVICE(0xeb1a, 0xa316), - .driver_info = EM2883_BOARD_KWORLD_HYBRID_A316 }, - { USB_DEVICE(0xeb1a, 0xe320), - .driver_info = EM2880_BOARD_MSI_DIGIVOX_AD_II }, - { USB_DEVICE(0xeb1a, 0xe323), - .driver_info = EM2882_BOARD_KWORLD_VS_DVBT }, - { USB_DEVICE(0xeb1a, 0xe350), - .driver_info = EM2870_BOARD_KWORLD_350U }, - { USB_DEVICE(0xeb1a, 0xe355), - .driver_info = EM2870_BOARD_KWORLD_355U }, - { USB_DEVICE(0xeb1a, 0x2801), - .driver_info = EM2800_BOARD_GRABBEEX_USB2800 }, - { USB_DEVICE(0xeb1a, 0xe357), - .driver_info = EM2870_BOARD_KWORLD_355U }, { USB_DEVICE(0x0ccd, 0x0036), .driver_info = EM2820_BOARD_TERRATEC_CINERGY_250 }, - { USB_DEVICE(0x0ccd, 0x004c), - .driver_info = EM2880_BOARD_TERRATEC_HYBRID_XS_FR }, - { USB_DEVICE(0x0ccd, 0x004f), - .driver_info = EM2860_BOARD_TERRATEC_HYBRID_XS }, - { USB_DEVICE(0x0ccd, 0x005e), - .driver_info = EM2882_BOARD_TERRATEC_HYBRID_XS }, - { USB_DEVICE(0x0ccd, 0x0042), - .driver_info = EM2880_BOARD_TERRATEC_HYBRID_XS }, - { USB_DEVICE(0x0ccd, 0x0043), - .driver_info = EM2870_BOARD_TERRATEC_XS }, - { USB_DEVICE(0x0ccd, 0x0047), - .driver_info = EM2880_BOARD_TERRATEC_PRODIGY_XS }, - { USB_DEVICE(0x185b, 0x2870), - .driver_info = EM2870_BOARD_COMPRO_VIDEOMATE }, - { USB_DEVICE(0x185b, 0x2041), - .driver_info = EM2820_BOARD_COMPRO_VIDEOMATE_FORYOU }, + { USB_DEVICE(0x2304, 0x0208), + .driver_info = EM2820_BOARD_PINNACLE_USB_2 }, { USB_DEVICE(0x2040, 0x4200), .driver_info = EM2820_BOARD_HAUPPAUGE_WINTV_USB_2 }, { USB_DEVICE(0x2040, 0x4201), .driver_info = EM2820_BOARD_HAUPPAUGE_WINTV_USB_2 }, + { USB_DEVICE(0x2304, 0x0207), + .driver_info = EM2820_BOARD_PINNACLE_DVC_90 }, + { USB_DEVICE(0x2304, 0x021a), + .driver_info = EM2820_BOARD_PINNACLE_DVC_90 }, + { USB_DEVICE(0x2304, 0x0227), + .driver_info = EM2880_BOARD_PINNACLE_PCTV_HD_PRO }, { USB_DEVICE(0x2040, 0x6500), .driver_info = EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900 }, { USB_DEVICE(0x2040, 0x6502), .driver_info = EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900_R2 }, { USB_DEVICE(0x2040, 0x6513), /* HCW HVR-980 */ - .driver_info = EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950 }, + .driver_info = EM2880_BOARD_HAUPPAUGE_WINTV_HVR_950 }, { USB_DEVICE(0x2040, 0x6517), /* HP HVR-950 */ - .driver_info = EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950 }, + .driver_info = EM2880_BOARD_HAUPPAUGE_WINTV_HVR_950 }, { USB_DEVICE(0x2040, 0x651b), /* RP HVR-950 */ - .driver_info = EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950 }, + .driver_info = EM2880_BOARD_HAUPPAUGE_WINTV_HVR_950 }, { USB_DEVICE(0x2040, 0x651f), /* HCW HVR-850 */ - .driver_info = EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950 }, - { USB_DEVICE(0x0438, 0xb002), - .driver_info = EM2880_BOARD_AMD_ATI_TV_WONDER_HD_600 }, - { USB_DEVICE(0x2001, 0xf112), - .driver_info = EM2820_BOARD_DLINK_USB_TV }, - { USB_DEVICE(0x2304, 0x0207), - .driver_info = EM2820_BOARD_PINNACLE_DVC_90 }, - { USB_DEVICE(0x2304, 0x0208), - .driver_info = EM2820_BOARD_PINNACLE_USB_2 }, - { USB_DEVICE(0x2304, 0x021a), - .driver_info = EM2820_BOARD_PINNACLE_DVC_90 }, - { USB_DEVICE(0x2304, 0x0226), - .driver_info = EM2882_BOARD_PINNACLE_HYBRID_PRO }, - { USB_DEVICE(0x2304, 0x0227), - .driver_info = EM2880_BOARD_PINNACLE_PCTV_HD_PRO }, - { USB_DEVICE(0x0413, 0x6023), - .driver_info = EM2800_BOARD_LEADTEK_WINFAST_USBII }, - { USB_DEVICE(0x093b, 0xa005), - .driver_info = EM2861_BOARD_PLEXTOR_PX_TV100U }, + .driver_info = EM2880_BOARD_HAUPPAUGE_WINTV_HVR_950 }, + { USB_DEVICE(0x0ccd, 0x0042), + .driver_info = EM2880_BOARD_TERRATEC_HYBRID_XS }, + { USB_DEVICE(0x0ccd, 0x0047), + .driver_info = EM2880_BOARD_TERRATEC_PRODIGY_XS }, { }, }; MODULE_DEVICE_TABLE(usb, em28xx_id_table); @@ -1212,18 +500,6 @@ MODULE_DEVICE_TABLE(usb, em28xx_id_table); * Reset sequences for analog/digital modes */ -/* Reset for the most [analog] boards */ -static struct em28xx_reg_seq default_analog[] = { - {EM28XX_R08_GPIO, 0x6d, ~EM_GPIO_4, 10}, - { -1, -1, -1, -1}, -}; - -/* Reset for the most [digital] boards */ -static struct em28xx_reg_seq default_digital[] = { - {EM28XX_R08_GPIO, 0x6e, ~EM_GPIO_4, 10}, - { -1, -1, -1, -1}, -}; - /* Board Hauppauge WinTV HVR 900 analog */ static struct em28xx_reg_seq hauppauge_wintv_hvr_900_analog[] = { {EM28XX_R08_GPIO, 0x2d, ~EM_GPIO_4, 10}, @@ -1239,42 +515,14 @@ static struct em28xx_reg_seq hauppauge_wintv_hvr_900_digital[] = { { -1, -1, -1, -1}, }; -/* Boards - EM2880 MSI DIGIVOX AD and EM2880_BOARD_MSI_DIGIVOX_AD_II */ -static struct em28xx_reg_seq em2880_msi_digivox_ad_analog[] = { - {EM28XX_R08_GPIO, 0x69, ~EM_GPIO_4, 10}, - { -1, -1, -1, -1}, -}; - -/* Boards - EM2880 MSI DIGIVOX AD and EM2880_BOARD_MSI_DIGIVOX_AD_II */ -static struct em28xx_reg_seq em2880_msi_digivox_ad_digital[] = { - {EM28XX_R08_GPIO, 0x6a, ~EM_GPIO_4, 10}, - { -1, -1, -1, -1}, -}; - -/* Board - EM2870 Kworld 355u - Analog - No input analog */ -static struct em28xx_reg_seq em2870_kworld_355u_digital[] = { - {EM2880_R04_GPO, 0x01, 0xff, 10}, - { -1, -1, -1, -1}, -}; - -/* Callback for the most boards */ -static struct em28xx_reg_seq default_callback[] = { +/* Board Hauppauge WinTV HVR 900 tuner_callback */ +static struct em28xx_reg_seq hauppauge_wintv_hvr_900_tuner_callback[] = { {EM28XX_R08_GPIO, EM_GPIO_4, EM_GPIO_4, 10}, {EM28XX_R08_GPIO, 0, EM_GPIO_4, 10}, {EM28XX_R08_GPIO, EM_GPIO_4, EM_GPIO_4, 10}, { -1, -1, -1, -1}, }; -/* Callback for EM2882 TERRATEC HYBRID XS */ -static struct em28xx_reg_seq em2882_terratec_hybrid_xs_digital[] = { - {EM28XX_R08_GPIO, 0x2e, 0xff, 6}, - {EM28XX_R08_GPIO, 0x3e, ~EM_GPIO_4, 6}, - {EM2880_R04_GPO, 0x04, 0xff, 10}, - {EM2880_R04_GPO, 0x0c, 0xff, 10}, - { -1, -1, -1, -1}, -}; - /* * EEPROM hash table for devices with generic USB IDs */ @@ -1321,7 +569,6 @@ static void em28xx_set_model(struct em28xx *dev) dev->max_range_640_480 = em28xx_boards[dev->model].max_range_640_480; dev->has_dvb = em28xx_boards[dev->model].has_dvb; dev->has_snapshot_button = em28xx_boards[dev->model].has_snapshot_button; - dev->valid = em28xx_boards[dev->model].valid; } /* Since em28xx_pre_card_setup() requires a proper dev->model, @@ -1357,171 +604,19 @@ void em28xx_pre_card_setup(struct em28xx *dev) case EM2880_BOARD_TERRATEC_PRODIGY_XS: case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900: case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900_R2: - case EM2860_BOARD_TERRATEC_HYBRID_XS: - case EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950: + case EM2880_BOARD_TERRATEC_HYBRID_XS: + case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_950: case EM2880_BOARD_PINNACLE_PCTV_HD_PRO: - case EM2882_BOARD_PINNACLE_HYBRID_PRO: - case EM2883_BOARD_KWORLD_HYBRID_A316: - case EM2880_BOARD_AMD_ATI_TV_WONDER_HD_600: - em28xx_write_regs(dev, EM28XX_R0F_XCLK, "\x27", 1); - em28xx_write_regs(dev, EM28XX_R06_I2C_CLK, "\x40", 1); - msleep(50); - - /* Sets GPO/GPIO sequences for this device */ - dev->analog_gpio = hauppauge_wintv_hvr_900_analog; - dev->digital_gpio = hauppauge_wintv_hvr_900_digital; - dev->tun_analog_gpio = default_callback; - dev->tun_digital_gpio = default_callback; - break; - - case EM2882_BOARD_TERRATEC_HYBRID_XS: em28xx_write_regs(dev, EM28XX_R0F_XCLK, "\x27", 1); em28xx_write_regs(dev, EM28XX_R06_I2C_CLK, "\x40", 1); msleep(50); - /* should be added ir_codes here */ - /* Sets GPO/GPIO sequences for this device */ dev->analog_gpio = hauppauge_wintv_hvr_900_analog; dev->digital_gpio = hauppauge_wintv_hvr_900_digital; - dev->tun_analog_gpio = default_callback; - dev->tun_digital_gpio = em2882_terratec_hybrid_xs_digital; - break; - - case EM2880_BOARD_TERRATEC_HYBRID_XS_FR: - case EM2880_BOARD_TERRATEC_HYBRID_XS: - case EM2870_BOARD_TERRATEC_XS: - case EM2881_BOARD_PINNACLE_HYBRID_PRO: - case EM2880_BOARD_KWORLD_DVB_310U: - case EM2870_BOARD_KWORLD_350U: - case EM2881_BOARD_DNT_DA2_HYBRID: - em28xx_write_regs(dev, EM28XX_R0F_XCLK, "\x27", 1); - em28xx_write_regs(dev, EM28XX_R06_I2C_CLK, "\x40", 1); - msleep(50); - - /* NOTE: EM2881_DNT_DA2_HYBRID spend 140 msleep for digital - and analog commands. If this commands doesn't work, - add this timer. */ - - /* Sets GPO/GPIO sequences for this device */ - dev->analog_gpio = default_analog; - dev->digital_gpio = default_digital; - dev->tun_analog_gpio = default_callback; - dev->tun_digital_gpio = default_callback; - break; - - case EM2880_BOARD_MSI_DIGIVOX_AD: - case EM2880_BOARD_MSI_DIGIVOX_AD_II: - em28xx_write_regs(dev, EM28XX_R0F_XCLK, "\x27", 1); - em28xx_write_regs(dev, EM28XX_R06_I2C_CLK, "\x40", 1); - msleep(50); - - /* Sets GPO/GPIO sequences for this device */ - dev->analog_gpio = em2880_msi_digivox_ad_analog; - dev->digital_gpio = em2880_msi_digivox_ad_digital; - dev->tun_analog_gpio = default_callback; - dev->tun_digital_gpio = default_callback; - break; - - case EM2750_BOARD_UNKNOWN: - case EM2750_BOARD_DLCW_130: - em28xx_write_regs(dev, EM28XX_R0F_XCLK, "\x0a", 1); - break; - - case EM2861_BOARD_PLEXTOR_PX_TV100U: - em28xx_write_regs(dev, EM28XX_R0F_XCLK, "\x27", 1); - em28xx_write_regs(dev, EM28XX_R06_I2C_CLK, "\x40", 1); - /* FIXME guess */ - /* Turn on analog audio output */ - em28xx_write_regs_req(dev, 0x00, 0x08, "\xfd", 1); - break; - - case EM2861_BOARD_KWORLD_PVRTV_300U: - case EM2880_BOARD_KWORLD_DVB_305U: - em28xx_write_regs(dev, EM28XX_R0F_XCLK, "\x27", 1); - em28xx_write_regs(dev, EM28XX_R06_I2C_CLK, "\x4c", 1); - msleep(10); - em28xx_write_regs(dev, 0x08, "\x6d", 1); - msleep(10); - em28xx_write_regs(dev, 0x08, "\x7d", 1); - msleep(10); - break; - - case EM2870_BOARD_KWORLD_355U: - em28xx_write_regs(dev, EM28XX_R0F_XCLK, "\x27", 1); - em28xx_write_regs(dev, EM28XX_R06_I2C_CLK, "\x40", 1); - msleep(50); - - /* Sets GPO/GPIO sequences for this device */ - dev->digital_gpio = em2870_kworld_355u_digital; - break; - - case EM2870_BOARD_COMPRO_VIDEOMATE: - em28xx_write_regs(dev, EM28XX_R0F_XCLK, "\x27", 1); - em28xx_write_regs(dev, EM28XX_R06_I2C_CLK, "\x40", 1); - /* TODO: someone can do some cleanup here... - not everything's needed */ - em28xx_write_regs(dev, 0x04, "\x00", 1); - msleep(10); - em28xx_write_regs(dev, 0x04, "\x01", 1); - msleep(10); - em28xx_write_regs(dev, 0x08, "\xfd", 1); - mdelay(70); - em28xx_write_regs(dev, 0x08, "\xfc", 1); - mdelay(70); - em28xx_write_regs(dev, 0x08, "\xdc", 1); - mdelay(70); - em28xx_write_regs(dev, 0x08, "\xfc", 1); - mdelay(70); - break; - - case EM2870_BOARD_TERRATEC_XS_MT2060: - em28xx_write_regs(dev, EM28XX_R0F_XCLK, "\x27", 1); - em28xx_write_regs(dev, EM28XX_R06_I2C_CLK, "\x40", 1); - /* this device needs some gpio writes to get the DVB-T - demod work */ - em28xx_write_regs(dev, 0x08, "\xfe", 1); - mdelay(70); - em28xx_write_regs(dev, 0x08, "\xde", 1); - mdelay(70); - dev->em28xx_write_regs(dev, 0x08, "\xfe", 1); - mdelay(70); - break; - - case EM2870_BOARD_PINNACLE_PCTV_DVB: - em28xx_write_regs(dev, EM28XX_R06_I2C_CLK, "\x40", 1); - /* this device needs some gpio writes to get the - DVB-T demod work */ - em28xx_write_regs(dev, 0x08, "\xfe", 1); - mdelay(70); - em28xx_write_regs(dev, 0x08, "\xde", 1); - mdelay(70); - em28xx_write_regs(dev, 0x08, "\xfe", 1); - mdelay(70); - /* switch em2880 rc protocol */ - em28xx_write_regs(dev, EM28XX_R0F_XCLK, "\x22", 1); - /* should be added ir_codes here */ - break; - - case EM2820_BOARD_GADMEI_UTV310: - em28xx_write_regs(dev, EM28XX_R0F_XCLK, "\x27", 1); - em28xx_write_regs(dev, EM28XX_R06_I2C_CLK, "\x40", 1); - /* Turn on analog audio output */ - em28xx_write_regs_req(dev, 0x00, 0x08, "\xfd", 1); - break; - - case EM2860_BOARD_GADMEI_UTV330: - /* Turn on IR */ - em28xx_write_regs(dev, EM28XX_R0F_XCLK, "\x07", 1); - em28xx_write_regs(dev, EM28XX_R06_I2C_CLK, "\x40", 1); - /* should be added ir_codes here */ - break; + dev->tun_analog_gpio = hauppauge_wintv_hvr_900_tuner_callback; + dev->tun_digital_gpio = hauppauge_wintv_hvr_900_tuner_callback; - case EM2820_BOARD_MSI_VOX_USB_2: - em28xx_write_regs(dev, EM28XX_R0F_XCLK, "\x27", 1); - em28xx_write_regs(dev, EM28XX_R06_I2C_CLK, "\x40", 1); - /* enables audio for that device */ - em28xx_write_regs_req(dev, 0x00, 0x08, "\xfd", 1); break; } @@ -1544,16 +639,12 @@ static void em28xx_setup_xc3028(struct em28xx *dev, struct xc2028_ctrl *ctl) case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900: ctl->demod = XC3028_FE_ZARLINK456; break; - case EM2880_BOARD_TERRATEC_HYBRID_XS: - ctl->demod = XC3028_FE_ZARLINK456; - break; case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900_R2: /* djh - Not sure which demod we need here */ ctl->demod = XC3028_FE_DEFAULT; break; - case EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950: + case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_950: case EM2880_BOARD_PINNACLE_PCTV_HD_PRO: - case EM2880_BOARD_AMD_ATI_TV_WONDER_HD_600: /* FIXME: Better to specify the needed IF */ ctl->demod = XC3028_FE_DEFAULT; break; @@ -1718,8 +809,6 @@ void em28xx_set_ir(struct em28xx *dev, struct IR_i2c *ir) break; case (EM2800_BOARD_KWORLD_USB2800): break; - case (EM2800_BOARD_GRABBEEX_USB2800): - break; } } @@ -1734,7 +823,7 @@ void em28xx_card_setup(struct em28xx *dev) case EM2820_BOARD_HAUPPAUGE_WINTV_USB_2: case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900: case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900_R2: - case EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950: + case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_950: { struct tveeprom tv; #ifdef CONFIG_MODULES @@ -1747,7 +836,7 @@ void em28xx_card_setup(struct em28xx *dev) dev->tuner_type = tv.tuner_type; - if (tv.audio_processor == V4L2_IDENT_MSPX4XX) { + if (tv.audio_processor == AUDIO_CHIP_MSP34XX) { dev->i2s_speed = 2048000; dev->has_msp34xx = 1; } @@ -1765,21 +854,11 @@ void em28xx_card_setup(struct em28xx *dev) case EM2800_BOARD_UNKNOWN: if (!em28xx_hint_board(dev)) em28xx_set_model(dev); - break; } if (dev->has_snapshot_button) em28xx_register_snapshot_button(dev); - if (dev->valid == EM28XX_BOARD_NOT_VALIDATED) { - em28xx_errdev("\n\n"); - em28xx_errdev("The support for this board weren't " - "valid yet.\n"); - em28xx_errdev("Please send a report of having this working\n"); - em28xx_errdev("not to V4L mailing list (and/or to other " - "addresses)\n\n"); - } - /* Allow override tuner type by a module parameter */ if (tuner >= 0) dev->tuner_type = tuner; diff --git a/trunk/drivers/media/video/em28xx/em28xx-dvb.c b/trunk/drivers/media/video/em28xx/em28xx-dvb.c index 4b992bc0083c..cc61cfb23a4a 100644 --- a/trunk/drivers/media/video/em28xx/em28xx-dvb.c +++ b/trunk/drivers/media/video/em28xx/em28xx-dvb.c @@ -6,7 +6,6 @@ (c) 2008 Devin Heitmueller - Fixes for the driver to properly work with HVR-950 - Fixes for the driver to properly work with Pinnacle PCTV HD Pro Stick - - Fixes for the driver to properly work with AMD ATI TV Wonder HD 600 (c) 2008 Aidan Thornton @@ -410,9 +409,8 @@ static int dvb_init(struct em28xx *dev) em28xx_set_mode(dev, EM28XX_DIGITAL_MODE); /* init frontend */ switch (dev->model) { - case EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950: + case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_950: case EM2880_BOARD_PINNACLE_PCTV_HD_PRO: - case EM2880_BOARD_AMD_ATI_TV_WONDER_HD_600: dvb->frontend = dvb_attach(lgdt330x_attach, &em2880_lgdt3303_dev, &dev->i2c_adap); @@ -443,15 +441,6 @@ static int dvb_init(struct em28xx *dev) } break; #endif - case EM2880_BOARD_TERRATEC_HYBRID_XS: - dvb->frontend = dvb_attach(zl10353_attach, - &em28xx_zl10353_with_xc3028, - &dev->i2c_adap); - if (attach_xc3028(0x61, dev) < 0) { - result = -EINVAL; - goto out_free; - } - break; default: printk(KERN_ERR "%s/2: The frontend of your DVB/ATSC card" " isn't supported yet\n", diff --git a/trunk/drivers/media/video/em28xx/em28xx-video.c b/trunk/drivers/media/video/em28xx/em28xx-video.c index 49ab0629702e..2d9f14d2a00b 100644 --- a/trunk/drivers/media/video/em28xx/em28xx-video.c +++ b/trunk/drivers/media/video/em28xx/em28xx-video.c @@ -38,7 +38,6 @@ #include "em28xx.h" #include -#include #include #include @@ -1764,7 +1763,20 @@ static const struct file_operations em28xx_v4l_fops = { .compat_ioctl = v4l_compat_ioctl32, }; -static const struct v4l2_ioctl_ops video_ioctl_ops = { +static const struct file_operations radio_fops = { + .owner = THIS_MODULE, + .open = em28xx_v4l2_open, + .release = em28xx_v4l2_close, + .ioctl = video_ioctl2, + .compat_ioctl = v4l_compat_ioctl32, + .llseek = no_llseek, +}; + +static const struct video_device em28xx_video_template = { + .fops = &em28xx_v4l_fops, + .release = video_device_release, + + .minor = -1, .vidioc_querycap = vidioc_querycap, .vidioc_enum_fmt_vid_cap = vidioc_enum_fmt_vid_cap, .vidioc_g_fmt_vid_cap = vidioc_g_fmt_vid_cap, @@ -1802,29 +1814,16 @@ static const struct v4l2_ioctl_ops video_ioctl_ops = { #ifdef CONFIG_VIDEO_V4L1_COMPAT .vidiocgmbuf = vidiocgmbuf, #endif -}; - -static const struct video_device em28xx_video_template = { - .fops = &em28xx_v4l_fops, - .release = video_device_release, - .ioctl_ops = &video_ioctl_ops, - - .minor = -1, .tvnorms = V4L2_STD_ALL, .current_norm = V4L2_STD_PAL, }; -static const struct file_operations radio_fops = { - .owner = THIS_MODULE, - .open = em28xx_v4l2_open, - .release = em28xx_v4l2_close, - .ioctl = video_ioctl2, - .compat_ioctl = v4l_compat_ioctl32, - .llseek = no_llseek, -}; - -static const struct v4l2_ioctl_ops radio_ioctl_ops = { +static struct video_device em28xx_radio_template = { + .name = "em28xx-radio", + .type = VID_TYPE_TUNER, + .fops = &radio_fops, + .minor = -1, .vidioc_querycap = radio_querycap, .vidioc_g_tuner = radio_g_tuner, .vidioc_enum_input = radio_enum_input, @@ -1843,13 +1842,6 @@ static const struct v4l2_ioctl_ops radio_ioctl_ops = { #endif }; -static struct video_device em28xx_radio_template = { - .name = "em28xx-radio", - .fops = &radio_fops, - .ioctl_ops = &radio_ioctl_ops, - .minor = -1, -}; - /******************************** usb interface ******************************/ @@ -1890,6 +1882,7 @@ EXPORT_SYMBOL(em28xx_unregister_extension); static struct video_device *em28xx_vdev_init(struct em28xx *dev, const struct video_device *template, + const int type, const char *type_name) { struct video_device *vfd; @@ -1899,8 +1892,9 @@ static struct video_device *em28xx_vdev_init(struct em28xx *dev, return NULL; *vfd = *template; vfd->minor = -1; - vfd->parent = &dev->udev->dev; + vfd->dev = &dev->udev->dev; vfd->release = video_device_release; + vfd->type = type; vfd->debug = video_debug; snprintf(vfd->name, sizeof(vfd->name), "%s %s", @@ -1978,11 +1972,14 @@ static int em28xx_init_dev(struct em28xx **devhandle, struct usb_device *udev, list_add_tail(&dev->devlist, &em28xx_devlist); /* allocate and fill video video_device struct */ - dev->vdev = em28xx_vdev_init(dev, &em28xx_video_template, "video"); + dev->vdev = em28xx_vdev_init(dev, &em28xx_video_template, + VID_TYPE_CAPTURE, "video"); if (NULL == dev->vdev) { em28xx_errdev("cannot allocate video_device.\n"); goto fail_unreg; } + if (dev->tuner_type != TUNER_ABSENT) + dev->vdev->type |= VID_TYPE_TUNER; /* register v4l2 video video_device */ retval = video_register_device(dev->vdev, VFL_TYPE_GRABBER, @@ -1994,7 +1991,8 @@ static int em28xx_init_dev(struct em28xx **devhandle, struct usb_device *udev, } /* Allocate and fill vbi video_device struct */ - dev->vbi_dev = em28xx_vdev_init(dev, &em28xx_video_template, "vbi"); + dev->vbi_dev = em28xx_vdev_init(dev, &em28xx_video_template, + VFL_TYPE_VBI, "vbi"); /* register v4l2 vbi video_device */ if (video_register_device(dev->vbi_dev, VFL_TYPE_VBI, vbi_nr[dev->devno]) < 0) { @@ -2004,7 +2002,8 @@ static int em28xx_init_dev(struct em28xx **devhandle, struct usb_device *udev, } if (em28xx_boards[dev->model].radio.type == EM28XX_RADIO) { - dev->radio_dev = em28xx_vdev_init(dev, &em28xx_radio_template, "radio"); + dev->radio_dev = em28xx_vdev_init(dev, &em28xx_radio_template, + VFL_TYPE_RADIO, "radio"); if (NULL == dev->radio_dev) { em28xx_errdev("cannot allocate video_device.\n"); goto fail_unreg; diff --git a/trunk/drivers/media/video/em28xx/em28xx.h b/trunk/drivers/media/video/em28xx/em28xx.h index 9a3310748685..89842c5d64a1 100644 --- a/trunk/drivers/media/video/em28xx/em28xx.h +++ b/trunk/drivers/media/video/em28xx/em28xx.h @@ -54,58 +54,15 @@ #define EM2880_BOARD_TERRATEC_PRODIGY_XS 13 #define EM2820_BOARD_PROLINK_PLAYTV_USB2 14 #define EM2800_BOARD_VGEAR_POCKETTV 15 -#define EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950 16 +#define EM2880_BOARD_HAUPPAUGE_WINTV_HVR_950 16 #define EM2880_BOARD_PINNACLE_PCTV_HD_PRO 17 #define EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900_R2 18 #define EM2860_BOARD_POINTNIX_INTRAORAL_CAMERA 19 -#define EM2880_BOARD_AMD_ATI_TV_WONDER_HD_600 20 -#define EM2800_BOARD_GRABBEEX_USB2800 21 -#define EM2750_BOARD_UNKNOWN 22 -#define EM2750_BOARD_DLCW_130 23 -#define EM2820_BOARD_DLINK_USB_TV 24 -#define EM2820_BOARD_GADMEI_UTV310 25 -#define EM2820_BOARD_HERCULES_SMART_TV_USB2 26 -#define EM2820_BOARD_PINNACLE_USB_2_FM1216ME 27 -#define EM2820_BOARD_LEADTEK_WINFAST_USBII_DELUXE 28 -#define EM2820_BOARD_PINNACLE_DVC_100 29 -#define EM2820_BOARD_VIDEOLOGY_20K14XUSB 30 -#define EM2821_BOARD_USBGEAR_VD204 31 -#define EM2821_BOARD_SUPERCOMP_USB_2 32 -#define EM2821_BOARD_PROLINK_PLAYTV_USB2 33 -#define EM2860_BOARD_TERRATEC_HYBRID_XS 34 -#define EM2860_BOARD_TYPHOON_DVD_MAKER 35 -#define EM2860_BOARD_NETGMBH_CAM 36 -#define EM2860_BOARD_GADMEI_UTV330 37 -#define EM2861_BOARD_YAKUMO_MOVIE_MIXER 38 -#define EM2861_BOARD_KWORLD_PVRTV_300U 39 -#define EM2861_BOARD_PLEXTOR_PX_TV100U 40 -#define EM2870_BOARD_KWORLD_350U 41 -#define EM2870_BOARD_KWORLD_355U 42 -#define EM2870_BOARD_TERRATEC_XS 43 -#define EM2870_BOARD_TERRATEC_XS_MT2060 44 -#define EM2870_BOARD_PINNACLE_PCTV_DVB 45 -#define EM2870_BOARD_COMPRO_VIDEOMATE 46 -#define EM2880_BOARD_KWORLD_DVB_305U 47 -#define EM2880_BOARD_KWORLD_DVB_310U 48 -#define EM2880_BOARD_MSI_DIGIVOX_AD 49 -#define EM2880_BOARD_MSI_DIGIVOX_AD_II 50 -#define EM2880_BOARD_TERRATEC_HYBRID_XS_FR 51 -#define EM2881_BOARD_DNT_DA2_HYBRID 52 -#define EM2881_BOARD_PINNACLE_HYBRID_PRO 53 -#define EM2882_BOARD_KWORLD_VS_DVBT 54 -#define EM2882_BOARD_TERRATEC_HYBRID_XS 55 -#define EM2882_BOARD_PINNACLE_HYBRID_PRO 56 -#define EM2883_BOARD_KWORLD_HYBRID_A316 57 -#define EM2820_BOARD_COMPRO_VIDEOMATE_FORYOU 58 /* Limits minimum and default number of buffers */ #define EM28XX_MIN_BUF 4 #define EM28XX_DEF_BUF 8 -/* Params for validated field */ -#define EM28XX_BOARD_NOT_VALIDATED 1 -#define EM28XX_BOARD_VALIDATED 0 - /* maximum number of em28xx boards */ #define EM28XX_MAXBOARDS 4 /*FIXME: should be bigger */ @@ -294,7 +251,6 @@ struct em28xx_board { unsigned int max_range_640_480:1; unsigned int has_dvb:1; unsigned int has_snapshot_button:1; - unsigned int valid:1; enum em28xx_decoder decoder; @@ -375,7 +331,6 @@ struct em28xx { unsigned int max_range_640_480:1; unsigned int has_dvb:1; unsigned int has_snapshot_button:1; - unsigned int valid:1; /* report for validated boards */ /* Some older em28xx chips needs a waiting time after writing */ unsigned int wait_after_write; @@ -405,7 +360,7 @@ struct em28xx { v4l2_std_id norm; /* selected tv norm */ int ctl_freq; /* selected frequency */ unsigned int ctl_input; /* selected input */ - unsigned int ctl_ainput;/* selected audio input */ + unsigned int ctl_ainput; /* slected audio input */ int mute; int volume; /* frame properties */ diff --git a/trunk/drivers/media/video/et61x251/et61x251_core.c b/trunk/drivers/media/video/et61x251/et61x251_core.c index 2d170d101c21..15d037ae25c5 100644 --- a/trunk/drivers/media/video/et61x251/et61x251_core.c +++ b/trunk/drivers/media/video/et61x251/et61x251_core.c @@ -34,7 +34,6 @@ #include #include #include -#include #include #include #include @@ -986,7 +985,7 @@ static DEVICE_ATTR(i2c_val, S_IRUGO | S_IWUSR, static int et61x251_create_sysfs(struct et61x251_device* cam) { - struct device *classdev = &(cam->v4ldev->dev); + struct device *classdev = &(cam->v4ldev->class_dev); int err = 0; if ((err = device_create_file(classdev, &dev_attr_reg))) @@ -2585,6 +2584,8 @@ et61x251_usb_probe(struct usb_interface* intf, const struct usb_device_id* id) } strcpy(cam->v4ldev->name, "ET61X[12]51 PC Camera"); + cam->v4ldev->owner = THIS_MODULE; + cam->v4ldev->type = VID_TYPE_CAPTURE | VID_TYPE_SCALES; cam->v4ldev->fops = &et61x251_fops; cam->v4ldev->minor = video_nr[dev_nr]; cam->v4ldev->release = video_device_release; diff --git a/trunk/drivers/media/video/gspca/conex.c b/trunk/drivers/media/video/gspca/conex.c index 44b0bffeb20e..013d593b0c67 100644 --- a/trunk/drivers/media/video/gspca/conex.c +++ b/trunk/drivers/media/video/gspca/conex.c @@ -25,6 +25,9 @@ #define CONEX_CAM 1 /* special JPEG header */ #include "jpeg.h" +#define DRIVER_VERSION_NUMBER KERNEL_VERSION(2, 1, 7) +static const char version[] = "2.1.7"; + MODULE_AUTHOR("Michel Xhaard "); MODULE_DESCRIPTION("GSPCA USB Conexant Camera Driver"); MODULE_LICENSE("GPL"); @@ -815,6 +818,7 @@ static int sd_config(struct gspca_dev *gspca_dev, struct cam *cam; cam = &gspca_dev->cam; + cam->dev_name = (char *) id->driver_info; cam->epaddr = 0x01; cam->cam_mode = vga_mode; cam->nmodes = sizeof vga_mode / sizeof vga_mode[0]; @@ -1007,8 +1011,9 @@ static struct sd_desc sd_desc = { }; /* -- module initialisation -- */ +#define DVNM(name) .driver_info = (kernel_ulong_t) name static __devinitdata struct usb_device_id device_table[] = { - {USB_DEVICE(0x0572, 0x0041)}, + {USB_DEVICE(0x0572, 0x0041), DVNM("Creative Notebook cx11646")}, {} }; MODULE_DEVICE_TABLE(usb, device_table); @@ -1033,7 +1038,7 @@ static int __init sd_mod_init(void) { if (usb_register(&sd_driver) < 0) return -1; - PDEBUG(D_PROBE, "registered"); + PDEBUG(D_PROBE, "v%s registered", version); return 0; } static void __exit sd_mod_exit(void) diff --git a/trunk/drivers/media/video/gspca/etoms.c b/trunk/drivers/media/video/gspca/etoms.c index c8c2f02fcf00..8ab4ea7201a9 100644 --- a/trunk/drivers/media/video/gspca/etoms.c +++ b/trunk/drivers/media/video/gspca/etoms.c @@ -22,6 +22,9 @@ #include "gspca.h" +#define DRIVER_VERSION_NUMBER KERNEL_VERSION(2, 1, 7) +static const char version[] = "2.1.7"; + MODULE_AUTHOR("Michel Xhaard "); MODULE_DESCRIPTION("Etoms USB Camera Driver"); MODULE_LICENSE("GPL"); @@ -599,10 +602,26 @@ static int sd_config(struct gspca_dev *gspca_dev, { struct sd *sd = (struct sd *) gspca_dev; struct cam *cam; - + __u16 vendor; + __u16 product; + + vendor = id->idVendor; + product = id->idProduct; +/* switch (vendor) { */ +/* case 0x102c: * Etoms */ + switch (product) { + case 0x6151: + sd->sensor = SENSOR_PAS106; /* Etoms61x151 */ + break; + case 0x6251: + sd->sensor = SENSOR_TAS5130CXX; /* Etoms61x251 */ + break; +/* } */ +/* break; */ + } cam = &gspca_dev->cam; + cam->dev_name = (char *) id->driver_info; cam->epaddr = 1; - sd->sensor = id->driver_info; if (sd->sensor == SENSOR_PAS106) { cam->cam_mode = sif_mode; cam->nmodes = sizeof sif_mode / sizeof sif_mode[0]; @@ -892,11 +911,12 @@ static struct sd_desc sd_desc = { }; /* -- module initialisation -- */ +#define DVNM(name) .driver_info = (kernel_ulong_t) name static __devinitdata struct usb_device_id device_table[] = { #ifndef CONFIG_USB_ET61X251 - {USB_DEVICE(0x102c, 0x6151), .driver_info = SENSOR_PAS106}, + {USB_DEVICE(0x102c, 0x6151), DVNM("Qcam Sangha CIF")}, #endif - {USB_DEVICE(0x102c, 0x6251), .driver_info = SENSOR_TAS5130CXX}, + {USB_DEVICE(0x102c, 0x6251), DVNM("Qcam xxxxxx VGA")}, {} }; @@ -922,7 +942,7 @@ static int __init sd_mod_init(void) { if (usb_register(&sd_driver) < 0) return -1; - PDEBUG(D_PROBE, "registered"); + PDEBUG(D_PROBE, "v%s registered", version); return 0; } diff --git a/trunk/drivers/media/video/gspca/gspca.c b/trunk/drivers/media/video/gspca/gspca.c index 3a051c925ff6..16e367cec760 100644 --- a/trunk/drivers/media/video/gspca/gspca.c +++ b/trunk/drivers/media/video/gspca/gspca.c @@ -32,7 +32,6 @@ #include #include #include -#include #include "gspca.h" @@ -43,7 +42,8 @@ MODULE_AUTHOR("Jean-Francois Moine "); MODULE_DESCRIPTION("GSPCA USB Camera Driver"); MODULE_LICENSE("GPL"); -#define DRIVER_VERSION_NUMBER KERNEL_VERSION(2, 2, 0) +#define DRIVER_VERSION_NUMBER KERNEL_VERSION(2, 1, 7) +static const char version[] = "2.1.7"; static int video_nr = -1; @@ -209,8 +209,6 @@ struct gspca_frame *gspca_frame_add(struct gspca_dev *gspca_dev, &frame->v4l2_buf.timestamp); frame->v4l2_buf.sequence = ++gspca_dev->sequence; } else if (gspca_dev->last_packet_type == DISCARD_PACKET) { - if (packet_type == LAST_PACKET) - gspca_dev->last_packet_type = packet_type; return frame; } @@ -401,7 +399,7 @@ static struct usb_host_endpoint *alt_isoc(struct usb_host_interface *alt, * This routine may be called many times when the bandwidth is too small * (the bandwidth is checked on urb submit). */ -static struct usb_host_endpoint *get_isoc_ep(struct gspca_dev *gspca_dev) +struct usb_host_endpoint *get_isoc_ep(struct gspca_dev *gspca_dev) { struct usb_interface *intf; struct usb_host_endpoint *ep; @@ -834,16 +832,7 @@ static int vidioc_querycap(struct file *file, void *priv, memset(cap, 0, sizeof *cap); strncpy(cap->driver, gspca_dev->sd_desc->name, sizeof cap->driver); -/* strncpy(cap->card, gspca_dev->cam.dev_name, sizeof cap->card); */ - if (gspca_dev->dev->product != NULL) { - strncpy(cap->card, gspca_dev->dev->product, - sizeof cap->card); - } else { - snprintf(cap->card, sizeof cap->card, - "USB Camera (%04x:%04x)", - le16_to_cpu(gspca_dev->dev->descriptor.idVendor), - le16_to_cpu(gspca_dev->dev->descriptor.idProduct)); - } + strncpy(cap->card, gspca_dev->cam.dev_name, sizeof cap->card); strncpy(cap->bus_info, gspca_dev->dev->bus->bus_name, sizeof cap->bus_info); cap->version = DRIVER_VERSION_NUMBER; @@ -1660,7 +1649,12 @@ static struct file_operations dev_fops = { .poll = dev_poll, }; -static const struct v4l2_ioctl_ops dev_ioctl_ops = { +static struct video_device gspca_template = { + .name = "gspca main driver", + .type = VID_TYPE_CAPTURE, + .fops = &dev_fops, + .release = dev_release, /* mandatory */ + .minor = -1, .vidioc_querycap = vidioc_querycap, .vidioc_dqbuf = vidioc_dqbuf, .vidioc_qbuf = vidioc_qbuf, @@ -1689,14 +1683,6 @@ static const struct v4l2_ioctl_ops dev_ioctl_ops = { #endif }; -static struct video_device gspca_template = { - .name = "gspca main driver", - .fops = &dev_fops, - .ioctl_ops = &dev_ioctl_ops, - .release = dev_release, /* mandatory */ - .minor = -1, -}; - /* * probe and create a new gspca device * @@ -1754,11 +1740,10 @@ int gspca_dev_probe(struct usb_interface *intf, /* init video stuff */ memcpy(&gspca_dev->vdev, &gspca_template, sizeof gspca_template); - gspca_dev->vdev.parent = &dev->dev; + gspca_dev->vdev.dev = &dev->dev; memcpy(&gspca_dev->fops, &dev_fops, sizeof gspca_dev->fops); gspca_dev->vdev.fops = &gspca_dev->fops; gspca_dev->fops.owner = module; /* module protection */ - gspca_dev->present = 1; ret = video_register_device(&gspca_dev->vdev, VFL_TYPE_GRABBER, video_nr); @@ -1767,6 +1752,7 @@ int gspca_dev_probe(struct usb_interface *intf, goto out; } + gspca_dev->present = 1; usb_set_intfdata(intf, gspca_dev); PDEBUG(D_PROBE, "probe ok"); return 0; @@ -1899,10 +1885,7 @@ EXPORT_SYMBOL(gspca_auto_gain_n_exposure); /* -- module insert / remove -- */ static int __init gspca_init(void) { - info("main v%d.%d.%d registered", - (DRIVER_VERSION_NUMBER >> 16) & 0xff, - (DRIVER_VERSION_NUMBER >> 8) & 0xff, - DRIVER_VERSION_NUMBER & 0xff); + info("main v%s registered", version); return 0; } static void __exit gspca_exit(void) diff --git a/trunk/drivers/media/video/gspca/mars.c b/trunk/drivers/media/video/gspca/mars.c index 21c4ee56a10a..88c2b02f380a 100644 --- a/trunk/drivers/media/video/gspca/mars.c +++ b/trunk/drivers/media/video/gspca/mars.c @@ -24,6 +24,9 @@ #include "gspca.h" #include "jpeg.h" +#define DRIVER_VERSION_NUMBER KERNEL_VERSION(2, 1, 7) +static const char version[] = "2.1.7"; + MODULE_AUTHOR("Michel Xhaard "); MODULE_DESCRIPTION("GSPCA/Mars USB Camera Driver"); MODULE_LICENSE("GPL"); @@ -137,6 +140,7 @@ static int sd_config(struct gspca_dev *gspca_dev, struct cam *cam; cam = &gspca_dev->cam; + cam->dev_name = (char *) id->driver_info; cam->epaddr = 0x01; cam->cam_mode = vga_mode; cam->nmodes = sizeof vga_mode / sizeof vga_mode[0]; @@ -420,8 +424,9 @@ static const struct sd_desc sd_desc = { }; /* -- module initialisation -- */ +#define DVNM(name) .driver_info = (kernel_ulong_t) name static const __devinitdata struct usb_device_id device_table[] = { - {USB_DEVICE(0x093a, 0x050f)}, + {USB_DEVICE(0x093a, 0x050f), DVNM("Mars-Semi Pc-Camera")}, {} }; MODULE_DEVICE_TABLE(usb, device_table); @@ -446,7 +451,7 @@ static int __init sd_mod_init(void) { if (usb_register(&sd_driver) < 0) return -1; - PDEBUG(D_PROBE, "registered"); + PDEBUG(D_PROBE, "v%s registered", version); return 0; } static void __exit sd_mod_exit(void) diff --git a/trunk/drivers/media/video/gspca/ov519.c b/trunk/drivers/media/video/gspca/ov519.c index 83139efc4629..08d99c3b78e2 100644 --- a/trunk/drivers/media/video/gspca/ov519.c +++ b/trunk/drivers/media/video/gspca/ov519.c @@ -24,6 +24,9 @@ #include "gspca.h" +#define DRIVER_VERSION_NUMBER KERNEL_VERSION(2, 1, 7) +static const char version[] = "2.1.7"; + MODULE_AUTHOR("Jean-Francois Moine "); MODULE_DESCRIPTION("OV519 USB Camera Driver"); MODULE_LICENSE("GPL"); @@ -1372,6 +1375,7 @@ static int sd_config(struct gspca_dev *gspca_dev, cam->cam_mode = sif_mode; cam->nmodes = sizeof sif_mode / sizeof sif_mode[0]; } + cam->dev_name = (char *) id->driver_info; sd->brightness = sd_ctrls[SD_BRIGHTNESS].qctrl.default_value; sd->contrast = sd_ctrls[SD_CONTRAST].qctrl.default_value; sd->colors = sd_ctrls[SD_COLOR].qctrl.default_value; @@ -2125,20 +2129,21 @@ static const struct sd_desc sd_desc = { }; /* -- module initialisation -- */ +#define DVNM(name) .driver_info = (kernel_ulong_t) name static const __devinitdata struct usb_device_id device_table[] = { - {USB_DEVICE(0x041e, 0x4052)}, - {USB_DEVICE(0x041e, 0x405f)}, - {USB_DEVICE(0x041e, 0x4060)}, - {USB_DEVICE(0x041e, 0x4061)}, - {USB_DEVICE(0x041e, 0x4064)}, - {USB_DEVICE(0x041e, 0x4068)}, - {USB_DEVICE(0x045e, 0x028c)}, - {USB_DEVICE(0x054c, 0x0154)}, - {USB_DEVICE(0x054c, 0x0155)}, - {USB_DEVICE(0x05a9, 0x0519)}, - {USB_DEVICE(0x05a9, 0x0530)}, - {USB_DEVICE(0x05a9, 0x4519)}, - {USB_DEVICE(0x05a9, 0x8519)}, + {USB_DEVICE(0x041e, 0x4052), DVNM("Creative Live! VISTA IM")}, + {USB_DEVICE(0x041e, 0x405f), DVNM("Creative Live! VISTA VF0330")}, + {USB_DEVICE(0x041e, 0x4060), DVNM("Creative Live! VISTA VF0350")}, + {USB_DEVICE(0x041e, 0x4061), DVNM("Creative Live! VISTA VF0400")}, + {USB_DEVICE(0x041e, 0x4064), DVNM("Creative Live! VISTA VF0420")}, + {USB_DEVICE(0x041e, 0x4068), DVNM("Creative Live! VISTA VF0470")}, + {USB_DEVICE(0x045e, 0x028c), DVNM("Microsoft xbox cam")}, + {USB_DEVICE(0x054c, 0x0154), DVNM("Sonny toy4")}, + {USB_DEVICE(0x054c, 0x0155), DVNM("Sonny toy5")}, + {USB_DEVICE(0x05a9, 0x0519), DVNM("OmniVision")}, + {USB_DEVICE(0x05a9, 0x0530), DVNM("OmniVision")}, + {USB_DEVICE(0x05a9, 0x4519), DVNM("OmniVision")}, + {USB_DEVICE(0x05a9, 0x8519), DVNM("OmniVision")}, {} }; #undef DVNAME @@ -2164,7 +2169,7 @@ static int __init sd_mod_init(void) { if (usb_register(&sd_driver) < 0) return -1; - PDEBUG(D_PROBE, "registered"); + PDEBUG(D_PROBE, "v%s registered", version); return 0; } static void __exit sd_mod_exit(void) diff --git a/trunk/drivers/media/video/gspca/pac207.c b/trunk/drivers/media/video/gspca/pac207.c index 7ef18d578811..fa7abc411090 100644 --- a/trunk/drivers/media/video/gspca/pac207.c +++ b/trunk/drivers/media/video/gspca/pac207.c @@ -27,6 +27,9 @@ #include "gspca.h" +#define DRIVER_VERSION_NUMBER KERNEL_VERSION(2, 1, 7) +static const char version[] = "2.1.7"; + MODULE_AUTHOR("Hans de Goede "); MODULE_DESCRIPTION("Pixart PAC207"); MODULE_LICENSE("GPL"); @@ -205,7 +208,7 @@ static int pac207_write_regs(struct gspca_dev *gspca_dev, u16 index, } -static int pac207_write_reg(struct gspca_dev *gspca_dev, u16 index, u16 value) +int pac207_write_reg(struct gspca_dev *gspca_dev, u16 index, u16 value) { struct usb_device *udev = gspca_dev->dev; int err; @@ -220,7 +223,8 @@ static int pac207_write_reg(struct gspca_dev *gspca_dev, u16 index, u16 value) return err; } -static int pac207_read_reg(struct gspca_dev *gspca_dev, u16 index) + +int pac207_read_reg(struct gspca_dev *gspca_dev, u16 index) { struct usb_device *udev = gspca_dev->dev; int res; @@ -570,16 +574,17 @@ static const struct sd_desc sd_desc = { }; /* -- module initialisation -- */ +#define DVNM(name) .driver_info = (kernel_ulong_t) name static const __devinitdata struct usb_device_id device_table[] = { - {USB_DEVICE(0x041e, 0x4028)}, - {USB_DEVICE(0x093a, 0x2460)}, - {USB_DEVICE(0x093a, 0x2463)}, - {USB_DEVICE(0x093a, 0x2464)}, - {USB_DEVICE(0x093a, 0x2468)}, - {USB_DEVICE(0x093a, 0x2470)}, - {USB_DEVICE(0x093a, 0x2471)}, - {USB_DEVICE(0x093a, 0x2472)}, - {USB_DEVICE(0x2001, 0xf115)}, + {USB_DEVICE(0x041e, 0x4028), DVNM("Creative Webcam Vista Plus")}, + {USB_DEVICE(0x093a, 0x2460), DVNM("Q-Tec Webcam 100")}, + {USB_DEVICE(0x093a, 0x2463), DVNM("Philips spc200nc pac207")}, + {USB_DEVICE(0x093a, 0x2464), DVNM("Labtec Webcam 1200")}, + {USB_DEVICE(0x093a, 0x2468), DVNM("PAC207")}, + {USB_DEVICE(0x093a, 0x2470), DVNM("Genius GF112")}, + {USB_DEVICE(0x093a, 0x2471), DVNM("Genius VideoCam GE111")}, + {USB_DEVICE(0x093a, 0x2472), DVNM("Genius VideoCam GE110")}, + {USB_DEVICE(0x2001, 0xf115), DVNM("D-Link DSB-C120")}, {} }; MODULE_DEVICE_TABLE(usb, device_table); @@ -604,7 +609,7 @@ static int __init sd_mod_init(void) { if (usb_register(&sd_driver) < 0) return -1; - PDEBUG(D_PROBE, "registered"); + PDEBUG(D_PROBE, "v%s registered", version); return 0; } static void __exit sd_mod_exit(void) diff --git a/trunk/drivers/media/video/gspca/pac7311.c b/trunk/drivers/media/video/gspca/pac7311.c index ea3d7021f401..5c052e31be4a 100644 --- a/trunk/drivers/media/video/gspca/pac7311.c +++ b/trunk/drivers/media/video/gspca/pac7311.c @@ -23,6 +23,9 @@ #include "gspca.h" +#define DRIVER_VERSION_NUMBER KERNEL_VERSION(2, 1, 7) +static const char version[] = "2.1.7"; + MODULE_AUTHOR("Thomas Kaiser thomas@kaiser-linux.li"); MODULE_DESCRIPTION("Pixart PAC7311"); MODULE_LICENSE("GPL"); @@ -263,6 +266,7 @@ static int sd_config(struct gspca_dev *gspca_dev, reg_w(gspca_dev, 0x3e, 0x20); cam = &gspca_dev->cam; + cam->dev_name = (char *) id->driver_info; cam->epaddr = 0x05; cam->cam_mode = vga_mode; cam->nmodes = ARRAY_SIZE(vga_mode); @@ -709,14 +713,16 @@ static struct sd_desc sd_desc = { }; /* -- module initialisation -- */ +#define DVNM(name) .driver_info = (kernel_ulong_t) name static __devinitdata struct usb_device_id device_table[] = { - {USB_DEVICE(0x093a, 0x2600)}, - {USB_DEVICE(0x093a, 0x2601)}, - {USB_DEVICE(0x093a, 0x2603)}, - {USB_DEVICE(0x093a, 0x2608)}, - {USB_DEVICE(0x093a, 0x260e)}, - {USB_DEVICE(0x093a, 0x260f)}, - {USB_DEVICE(0x093a, 0x2621)}, + {USB_DEVICE(0x093a, 0x2600), DVNM("Typhoon")}, + {USB_DEVICE(0x093a, 0x2601), DVNM("Philips SPC610NC")}, + {USB_DEVICE(0x093a, 0x2603), DVNM("PAC7312")}, + {USB_DEVICE(0x093a, 0x2608), DVNM("Trust WB-3300p")}, + {USB_DEVICE(0x093a, 0x260e), DVNM("Gigaware VGA PC Camera")}, + /* and also ', Trust WB-3350p, SIGMA cam 2350' */ + {USB_DEVICE(0x093a, 0x260f), DVNM("SnakeCam")}, + {USB_DEVICE(0x093a, 0x2621), DVNM("PAC731x")}, {} }; MODULE_DEVICE_TABLE(usb, device_table); @@ -741,7 +747,7 @@ static int __init sd_mod_init(void) { if (usb_register(&sd_driver) < 0) return -1; - PDEBUG(D_PROBE, "registered"); + PDEBUG(D_PROBE, "v%s registered", version); return 0; } static void __exit sd_mod_exit(void) diff --git a/trunk/drivers/media/video/gspca/sonixb.c b/trunk/drivers/media/video/gspca/sonixb.c index e18748c5a14d..dbeebe8625c5 100644 --- a/trunk/drivers/media/video/gspca/sonixb.c +++ b/trunk/drivers/media/video/gspca/sonixb.c @@ -24,6 +24,9 @@ #include "gspca.h" +#define DRIVER_VERSION_NUMBER KERNEL_VERSION(2, 1, 8) +static const char version[] = "2.1.8"; + MODULE_AUTHOR("Michel Xhaard "); MODULE_DESCRIPTION("GSPCA/SN9C102 USB Camera Driver"); MODULE_LICENSE("GPL"); @@ -41,29 +44,25 @@ struct sd { unsigned char brightness; unsigned char autogain; unsigned char autogain_ignore_frames; - unsigned char frames_to_drop; unsigned char freq; /* light freq filter setting */ + unsigned char saturation; + unsigned char hue; + unsigned char contrast; unsigned char fr_h_sz; /* size of frame header */ char sensor; /* Type of image sensor chip */ #define SENSOR_HV7131R 0 #define SENSOR_OV6650 1 #define SENSOR_OV7630 2 -#define SENSOR_PAS106 3 -#define SENSOR_PAS202 4 -#define SENSOR_TAS5110 5 -#define SENSOR_TAS5130CXX 6 +#define SENSOR_OV7630_3 3 +#define SENSOR_PAS106 4 +#define SENSOR_PAS202 5 +#define SENSOR_TAS5110 6 +#define SENSOR_TAS5130CXX 7 char sensor_has_gain; __u8 sensor_addr; - __u8 reg11; }; -/* flags used in the device id table */ -#define F_GAIN 0x01 /* has gain */ -#define F_AUTO 0x02 /* has autogain */ -#define F_SIF 0x04 /* sif or vga */ -#define F_H18 0x08 /* long (18 b) or short (12 b) frame header */ - #define COMP2 0x8f #define COMP 0xc7 /* 0x87 //0x07 */ #define COMP1 0xc9 /* 0x89 //0x09 */ @@ -93,6 +92,12 @@ static int sd_setautogain(struct gspca_dev *gspca_dev, __s32 val); static int sd_getautogain(struct gspca_dev *gspca_dev, __s32 *val); static int sd_setfreq(struct gspca_dev *gspca_dev, __s32 val); static int sd_getfreq(struct gspca_dev *gspca_dev, __s32 *val); +static int sd_setsaturation(struct gspca_dev *gspca_dev, __s32 val); +static int sd_getsaturation(struct gspca_dev *gspca_dev, __s32 *val); +static int sd_sethue(struct gspca_dev *gspca_dev, __s32 val); +static int sd_gethue(struct gspca_dev *gspca_dev, __s32 *val); +static int sd_setcontrast(struct gspca_dev *gspca_dev, __s32 val); +static int sd_getcontrast(struct gspca_dev *gspca_dev, __s32 *val); static struct ctrl sd_ctrls[] = { { @@ -169,6 +174,48 @@ static struct ctrl sd_ctrls[] = { .set = sd_setfreq, .get = sd_getfreq, }, + { + { + .id = V4L2_CID_SATURATION, + .type = V4L2_CTRL_TYPE_INTEGER, + .name = "Saturation", + .minimum = 0, + .maximum = 255, + .step = 1, +#define SATURATION_DEF 127 + .default_value = SATURATION_DEF, + }, + .set = sd_setsaturation, + .get = sd_getsaturation, + }, + { + { + .id = V4L2_CID_HUE, + .type = V4L2_CTRL_TYPE_INTEGER, + .name = "Hue", + .minimum = 0, + .maximum = 255, + .step = 1, +#define HUE_DEF 127 + .default_value = HUE_DEF, + }, + .set = sd_sethue, + .get = sd_gethue, + }, + { + { + .id = V4L2_CID_CONTRAST, + .type = V4L2_CTRL_TYPE_INTEGER, + .name = "Contrast", + .minimum = 0, + .maximum = 255, + .step = 1, +#define CONTRAST_DEF 127 + .default_value = CONTRAST_DEF, + }, + .set = sd_setcontrast, + .get = sd_getcontrast, + }, }; static struct v4l2_pix_format vga_mode[] = { @@ -201,6 +248,8 @@ static struct v4l2_pix_format sif_mode[] = { .priv = 0}, }; +static const __u8 probe_ov7630[] = {0x08, 0x44}; + static const __u8 initHv7131[] = { 0x46, 0x77, 0x00, 0x04, 0x00, 0x00, 0x00, 0x80, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -272,7 +321,7 @@ static const __u8 initOv7630_3[] = { 0x10, 0x20, 0x30, 0x40, 0x50, 0x60, 0x70, 0x80, /* r21 .. r28 */ 0x90, 0xa0, 0xb0, 0xc0, 0xd0, 0xe0, 0xf0, 0xff /* r29 .. r30 */ }; -static const __u8 ov7630_sensor_init[][8] = { +static const __u8 ov7630_sensor_init_com[][8] = { {0xa0, 0x21, 0x12, 0x80, 0x00, 0x00, 0x00, 0x10}, {0xb0, 0x21, 0x01, 0x77, 0x3a, 0x00, 0x00, 0x10}, /* {0xd0, 0x21, 0x12, 0x7c, 0x01, 0x80, 0x34, 0x10}, jfm */ @@ -293,6 +342,17 @@ static const __u8 ov7630_sensor_init[][8] = { {0xa0, 0x21, 0x7d, 0xf7, 0x8e, 0x00, 0x30, 0x10}, {0xd0, 0x21, 0x17, 0x1c, 0xbd, 0x06, 0xf6, 0x10}, }; +static const __u8 ov7630_sensor_init[][8] = { + {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* delay 200ms */ + {0xa0, 0x21, 0x11, 0x01, 0xbd, 0x06, 0xf6, 0x10}, /* jfm */ + {0xa0, 0x21, 0x10, 0x57, 0xbd, 0x06, 0xf6, 0x16}, + {0xa0, 0x21, 0x76, 0x02, 0xbd, 0x06, 0xf6, 0x16}, + {0xa0, 0x21, 0x00, 0x10, 0xbd, 0x06, 0xf6, 0x15}, /* gain */ +}; +static const __u8 ov7630_sensor_init_3[][8] = { + {0xa0, 0x21, 0x2a, 0xa0, 0x00, 0x00, 0x00, 0x10}, + {0xa0, 0x21, 0x2a, 0x80, 0x00, 0x00, 0x00, 0x10}, +}; static const __u8 initPas106[] = { 0x04, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x81, 0x40, 0x00, 0x00, 0x00, @@ -482,6 +542,7 @@ static void setbrightness(struct gspca_dev *gspca_dev) switch (sd->sensor) { case SENSOR_OV6650: + case SENSOR_OV7630_3: case SENSOR_OV7630: { __u8 i2cOV[] = {0xa0, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x10}; @@ -574,7 +635,7 @@ static void setsensorgain(struct gspca_dev *gspca_dev) case SENSOR_OV6650: gain >>= 1; /* fall thru */ - case SENSOR_OV7630: { + case SENSOR_OV7630_3: { __u8 i2c[] = {0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10}; i2c[1] = sd->sensor_addr; @@ -629,7 +690,7 @@ static void setexposure(struct gspca_dev *gspca_dev) break; } case SENSOR_OV6650: - case SENSOR_OV7630: { + case SENSOR_OV7630_3: { /* The ov6650 / ov7630 have 2 registers which both influence exposure, register 11, whose low nibble sets the nr off fps according to: fps = 30 / (low_nibble + 1) @@ -644,20 +705,16 @@ static void setexposure(struct gspca_dev *gspca_dev) The code maps our 0 - 510 ms exposure ctrl to these 2 registers, trying to keep fps as high as possible. */ - __u8 i2c[] = {0xb0, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x10}; - int reg10, reg11, reg10_max; - + __u8 i2c[] = {0xb0, 0x00, 0x10, 0x00, 0xc0, 0x00, 0x00, 0x10}; + int reg10, reg11; /* ov6645 datasheet says reg10_max is 9a, but that uses tline * 2 * reg10 as formula for calculating texpo, the ov6650 probably uses the same formula as the 7730 which uses tline * 4 * reg10, which explains why the reg10max we've found experimentally for the ov6650 is exactly half that of the ov6645. The ov7630 datasheet says the max is 0x41. */ - if (sd->sensor == SENSOR_OV6650) { - reg10_max = 0x4d; - i2c[4] = 0xc0; /* OV6650 needs non default vsync pol */ - } else - reg10_max = 0x41; + const int reg10_max = (sd->sensor == SENSOR_OV6650) + ? 0x4d : 0x41; reg11 = (60 * sd->exposure + 999) / 1000; if (reg11 < 1) @@ -678,23 +735,20 @@ static void setexposure(struct gspca_dev *gspca_dev) else if (reg10 > reg10_max) reg10 = reg10_max; - /* In 640x480, if the reg11 has less than 3, the image is - unstable (not enough bandwidth). */ - if (gspca_dev->width == 640 && reg11 < 3) - reg11 = 3; - /* Write reg 10 and reg11 low nibble */ i2c[1] = sd->sensor_addr; i2c[3] = reg10; i2c[4] |= reg11 - 1; - - /* If register 11 didn't change, don't change it */ - if (sd->reg11 == reg11 ) - i2c[0] = 0xa0; - - if (i2c_w(gspca_dev, i2c) == 0) - sd->reg11 = reg11; - else + if (sd->sensor == SENSOR_OV7630_3) { + __u8 reg76 = reg10 & 0x03; + __u8 i2c_reg76[] = {0xa0, 0x21, 0x76, 0x00, + 0x00, 0x00, 0x00, 0x10}; + reg10 >>= 2; + i2c_reg76[3] = reg76; + if (i2c_w(gspca_dev, i2c_reg76) < 0) + PDEBUG(D_ERR, "i2c error exposure"); + } + if (i2c_w(gspca_dev, i2c) < 0) PDEBUG(D_ERR, "i2c error exposure"); break; } @@ -707,11 +761,11 @@ static void setfreq(struct gspca_dev *gspca_dev) switch (sd->sensor) { case SENSOR_OV6650: - case SENSOR_OV7630: { + case SENSOR_OV7630_3: { /* Framerate adjust register for artificial light 50 hz flicker - compensation, for the ov6650 this is identical to ov6630 - 0x2b register, see ov6630 datasheet. - 0x4f / 0x8a -> (30 fps -> 25 fps), 0x00 -> no adjustment */ + compensation, identical to ov6630 0x2b register, see ov6630 + datasheet. + 0x4f -> (30 fps -> 25 fps), 0x00 -> no adjustment */ __u8 i2c[] = {0xa0, 0x00, 0x2b, 0x00, 0x00, 0x00, 0x00, 0x10}; switch (sd->freq) { default: @@ -732,6 +786,69 @@ static void setfreq(struct gspca_dev *gspca_dev) } } +static void setsaturation(struct gspca_dev *gspca_dev) +{ + struct sd *sd = (struct sd *) gspca_dev; + + switch (sd->sensor) { +/* case SENSOR_OV6650: */ + case SENSOR_OV7630_3: + case SENSOR_OV7630: { + __u8 i2c[] = {0xa0, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x10}; + i2c[1] = sd->sensor_addr; + i2c[3] = sd->saturation & 0xf0; + if (i2c_w(gspca_dev, i2c) < 0) + PDEBUG(D_ERR, "i2c error setsaturation"); + else + PDEBUG(D_CONF, "saturation set to: %d", + (int)sd->saturation); + break; + } + } +} + +static void sethue(struct gspca_dev *gspca_dev) +{ + struct sd *sd = (struct sd *) gspca_dev; + + switch (sd->sensor) { +/* case SENSOR_OV6650: */ + case SENSOR_OV7630_3: + case SENSOR_OV7630: { + __u8 i2c[] = {0xa0, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x10}; + i2c[1] = sd->sensor_addr; + i2c[3] = 0x20 | (sd->hue >> 3); + if (i2c_w(gspca_dev, i2c) < 0) + PDEBUG(D_ERR, "i2c error setsaturation"); + else + PDEBUG(D_CONF, "hue set to: %d", (int)sd->hue); + break; + } + } +} + +static void setcontrast(struct gspca_dev *gspca_dev) +{ + struct sd *sd = (struct sd *) gspca_dev; + + switch (sd->sensor) { +/* case SENSOR_OV6650: */ + case SENSOR_OV7630_3: + case SENSOR_OV7630: { + __u8 i2c[] = {0xa0, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x10}; + i2c[1] = sd->sensor_addr; + i2c[3] = 0x20 | (sd->contrast >> 3); + if (i2c_w(gspca_dev, i2c) < 0) + PDEBUG(D_ERR, "i2c error setcontrast"); + else + PDEBUG(D_CONF, "contrast set to: %d", + (int)sd->contrast); + break; + } + } +} + + static void do_autogain(struct gspca_dev *gspca_dev) { struct sd *sd = (struct sd *) gspca_dev; @@ -757,32 +874,88 @@ static int sd_config(struct gspca_dev *gspca_dev, { struct sd *sd = (struct sd *) gspca_dev; struct cam *cam; + __u16 product; int sif = 0; /* nctrls depends upon the sensor, so we use a per cam copy */ memcpy(&sd->sd_desc, gspca_dev->sd_desc, sizeof(struct sd_desc)); gspca_dev->sd_desc = &sd->sd_desc; - /* copy the webcam info from the device id */ - sd->sensor = (id->driver_info >> 24) & 0xff; - if (id->driver_info & (F_GAIN << 16)) - sd->sensor_has_gain = 1; - if (id->driver_info & (F_AUTO << 16)) - sd->sd_desc.dq_callback = do_autogain; - if (id->driver_info & (F_SIF << 16)) - sif = 1; - if (id->driver_info & (F_H18 << 16)) - sd->fr_h_sz = 18; /* size of frame header */ - else - sd->fr_h_sz = 12; - sd->sd_desc.nctrls = (id->driver_info >> 8) & 0xff; - sd->sensor_addr = id->driver_info & 0xff; + sd->fr_h_sz = 12; /* default size of the frame header */ + sd->sd_desc.nctrls = 2; /* default nb of ctrls */ + sd->autogain = AUTOGAIN_DEF; /* default is autogain active */ + + product = id->idProduct; +/* switch (id->idVendor) { */ +/* case 0x0c45: * Sonix */ + switch (product) { + case 0x6001: /* SN9C102 */ + case 0x6005: /* SN9C101 */ + case 0x6007: /* SN9C101 */ + sd->sensor = SENSOR_TAS5110; + sd->sensor_has_gain = 1; + sd->sd_desc.nctrls = 4; + sd->sd_desc.dq_callback = do_autogain; + sif = 1; + break; + case 0x6009: /* SN9C101 */ + case 0x600d: /* SN9C101 */ + case 0x6029: /* SN9C101 */ + sd->sensor = SENSOR_PAS106; + sif = 1; + break; + case 0x6011: /* SN9C101 - SN9C101G */ + sd->sensor = SENSOR_OV6650; + sd->sensor_has_gain = 1; + sd->sensor_addr = 0x60; + sd->sd_desc.nctrls = 5; + sd->sd_desc.dq_callback = do_autogain; + sif = 1; + break; + case 0x6019: /* SN9C101 */ + case 0x602c: /* SN9C102 */ + case 0x602e: /* SN9C102 */ + sd->sensor = SENSOR_OV7630; + sd->sensor_addr = 0x21; + break; + case 0x60b0: /* SN9C103 */ + sd->sensor = SENSOR_OV7630_3; + sd->sensor_addr = 0x21; + sd->fr_h_sz = 18; /* size of frame header */ + sd->sensor_has_gain = 1; + sd->sd_desc.nctrls = 8; + sd->sd_desc.dq_callback = do_autogain; + sd->autogain = 0; + break; + case 0x6024: /* SN9C102 */ + case 0x6025: /* SN9C102 */ + sd->sensor = SENSOR_TAS5130CXX; + break; + case 0x6028: /* SN9C102 */ + sd->sensor = SENSOR_PAS202; + break; + case 0x602d: /* SN9C102 */ + sd->sensor = SENSOR_HV7131R; + break; + case 0x60af: /* SN9C103 */ + sd->sensor = SENSOR_PAS202; + sd->fr_h_sz = 18; /* size of frame header (?) */ + break; + } +/* break; */ +/* } */ cam = &gspca_dev->cam; + cam->dev_name = (char *) id->driver_info; cam->epaddr = 0x01; if (!sif) { cam->cam_mode = vga_mode; cam->nmodes = ARRAY_SIZE(vga_mode); + if (sd->sensor == SENSOR_OV7630_3) { + /* We only have 320x240 & 640x480 */ + cam->cam_mode++; + cam->nmodes--; + } } else { cam->cam_mode = sif_mode; cam->nmodes = ARRAY_SIZE(sif_mode); @@ -790,9 +963,12 @@ static int sd_config(struct gspca_dev *gspca_dev, sd->brightness = BRIGHTNESS_DEF; sd->gain = GAIN_DEF; sd->exposure = EXPOSURE_DEF; - sd->autogain = AUTOGAIN_DEF; sd->freq = FREQ_DEF; - + sd->contrast = CONTRAST_DEF; + sd->saturation = SATURATION_DEF; + sd->hue = HUE_DEF; + if (sd->sensor == SENSOR_OV7630_3) /* jfm: from win trace */ + reg_w(gspca_dev, 0x01, probe_ov7630, sizeof probe_ov7630); return 0; } @@ -826,8 +1002,9 @@ static void pas106_i2cinit(struct gspca_dev *gspca_dev) static void sd_start(struct gspca_dev *gspca_dev) { struct sd *sd = (struct sd *) gspca_dev; - int mode, l = 0x1f; + int mode, l; const __u8 *sn9c10x; + __u8 reg01, reg17; __u8 reg17_19[3]; mode = gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].priv; @@ -845,11 +1022,13 @@ static void sd_start(struct gspca_dev *gspca_dev) reg17_19[2] = 0x20; break; case SENSOR_OV7630: - if (sd->fr_h_sz == 18) { /* SN9C103 */ - sn9c10x = initOv7630_3; - l = sizeof initOv7630_3; - } else - sn9c10x = initOv7630; + sn9c10x = initOv7630; + reg17_19[0] = 0x68; + reg17_19[1] = (mode << 4) | COMP2; + reg17_19[2] = MCK_INIT1; + break; + case SENSOR_OV7630_3: + sn9c10x = initOv7630_3; reg17_19[0] = 0x68; reg17_19[1] = (mode << 4) | COMP2; reg17_19[2] = MCK_INIT1; @@ -880,11 +1059,30 @@ static void sd_start(struct gspca_dev *gspca_dev) reg17_19[2] = mode ? 0x23 : 0x43; break; } + switch (sd->sensor) { + case SENSOR_OV7630: + reg01 = 0x06; + reg17 = 0x29; + l = sizeof initOv7630; + break; + case SENSOR_OV7630_3: + reg01 = 0x44; + reg17 = 0x68; + l = sizeof initOv7630_3; + break; + default: + reg01 = sn9c10x[0]; + reg17 = sn9c10x[0x17 - 1]; + l = 0x1f; + break; + } /* reg 0x01 bit 2 video transfert on */ - reg_w(gspca_dev, 0x01, &sn9c10x[0x01 - 1], 1); + reg_w(gspca_dev, 0x01, ®01, 1); /* reg 0x17 SensorClk enable inv Clk 0x60 */ - reg_w(gspca_dev, 0x17, &sn9c10x[0x17 - 1], 1); + reg_w(gspca_dev, 0x17, ®17, 1); +/*fixme: for ov7630 102 + reg_w(gspca_dev, 0x01, {0x06, sn9c10x[1]}, 2); */ /* Set the registers from the template */ reg_w_big(gspca_dev, 0x01, sn9c10x, l); switch (sd->sensor) { @@ -897,13 +1095,17 @@ static void sd_start(struct gspca_dev *gspca_dev) sizeof ov6650_sensor_init); break; case SENSOR_OV7630: + i2c_w_vector(gspca_dev, ov7630_sensor_init_com, + sizeof ov7630_sensor_init_com); + msleep(200); i2c_w_vector(gspca_dev, ov7630_sensor_init, sizeof ov7630_sensor_init); - if (sd->fr_h_sz == 18) { /* SN9C103 */ - const __u8 i2c[] = { 0xa0, 0x21, 0x13, 0x80, 0x00, - 0x00, 0x00, 0x10 }; - i2c_w(gspca_dev, i2c); - } + break; + case SENSOR_OV7630_3: + i2c_w_vector(gspca_dev, ov7630_sensor_init_com, + sizeof ov7630_sensor_init_com); + msleep(200); + i2c_w(gspca_dev, ov7630_sensor_init_3[mode]); break; case SENSOR_PAS106: pas106_i2cinit(gspca_dev); @@ -943,14 +1145,14 @@ static void sd_start(struct gspca_dev *gspca_dev) reg_w(gspca_dev, 0x18, ®17_19[1], 2); msleep(20); - sd->reg11 = -1; - setgain(gspca_dev); setbrightness(gspca_dev); setexposure(gspca_dev); setfreq(gspca_dev); + setsaturation(gspca_dev); + sethue(gspca_dev); + setcontrast(gspca_dev); - sd->frames_to_drop = 0; sd->autogain_ignore_frames = 0; atomic_set(&sd->avg_lum, -1); } @@ -996,31 +1198,21 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev, && data[3 + i] == 0xc4 && data[4 + i] == 0xc4 && data[5 + i] == 0x96) { /* start of frame */ - int lum = -1; - int pkt_type = LAST_PACKET; - + frame = gspca_frame_add(gspca_dev, LAST_PACKET, + frame, data, 0); if (len - i < sd->fr_h_sz) { + atomic_set(&sd->avg_lum, -1); PDEBUG(D_STREAM, "packet too short to" " get avg brightness"); } else if (sd->fr_h_sz == 12) { - lum = data[i + 8] + (data[i + 9] << 8); + atomic_set(&sd->avg_lum, + data[i + 8] + + (data[i + 9] << 8)); } else { - lum = data[i + 9] + - (data[i + 10] << 8); - } - if (lum == 0) { - lum = -1; - sd->frames_to_drop = 2; - } - atomic_set(&sd->avg_lum, lum); - - if (sd->frames_to_drop) { - sd->frames_to_drop--; - pkt_type = DISCARD_PACKET; + atomic_set(&sd->avg_lum, + data[i + 9] + + (data[i + 10] << 8)); } - - frame = gspca_frame_add(gspca_dev, pkt_type, - frame, data, 0); data += i + sd->fr_h_sz; len -= i + sd->fr_h_sz; gspca_frame_add(gspca_dev, FIRST_PACKET, @@ -1135,6 +1327,60 @@ static int sd_getfreq(struct gspca_dev *gspca_dev, __s32 *val) return 0; } +static int sd_setsaturation(struct gspca_dev *gspca_dev, __s32 val) +{ + struct sd *sd = (struct sd *) gspca_dev; + + sd->saturation = val; + if (gspca_dev->streaming) + setsaturation(gspca_dev); + return 0; +} + +static int sd_getsaturation(struct gspca_dev *gspca_dev, __s32 *val) +{ + struct sd *sd = (struct sd *) gspca_dev; + + *val = sd->saturation; + return 0; +} + +static int sd_sethue(struct gspca_dev *gspca_dev, __s32 val) +{ + struct sd *sd = (struct sd *) gspca_dev; + + sd->hue = val; + if (gspca_dev->streaming) + sethue(gspca_dev); + return 0; +} + +static int sd_gethue(struct gspca_dev *gspca_dev, __s32 *val) +{ + struct sd *sd = (struct sd *) gspca_dev; + + *val = sd->hue; + return 0; +} + +static int sd_setcontrast(struct gspca_dev *gspca_dev, __s32 val) +{ + struct sd *sd = (struct sd *) gspca_dev; + + sd->contrast = val; + if (gspca_dev->streaming) + setcontrast(gspca_dev); + return 0; +} + +static int sd_getcontrast(struct gspca_dev *gspca_dev, __s32 *val) +{ + struct sd *sd = (struct sd *) gspca_dev; + + *val = sd->contrast; + return 0; +} + static int sd_querymenu(struct gspca_dev *gspca_dev, struct v4l2_querymenu *menu) { @@ -1172,47 +1418,27 @@ static const struct sd_desc sd_desc = { }; /* -- module initialisation -- */ -#define SFCI(sensor, flags, nctrls, i2c_addr) \ - .driver_info = (SENSOR_ ## sensor << 24) \ - | ((flags) << 16) \ - | ((nctrls) << 8) \ - | (i2c_addr) +#define DVNM(name) .driver_info = (kernel_ulong_t) name static __devinitdata struct usb_device_id device_table[] = { #ifndef CONFIG_USB_SN9C102 - {USB_DEVICE(0x0c45, 0x6001), /* SN9C102 */ - SFCI(TAS5110, F_GAIN|F_AUTO|F_SIF, 4, 0)}, - {USB_DEVICE(0x0c45, 0x6005), /* SN9C101 */ - SFCI(TAS5110, F_GAIN|F_AUTO|F_SIF, 4, 0)}, - {USB_DEVICE(0x0c45, 0x6007), /* SN9C101 */ - SFCI(TAS5110, F_GAIN|F_AUTO|F_SIF, 4, 0)}, - {USB_DEVICE(0x0c45, 0x6009), /* SN9C101 */ - SFCI(PAS106, F_SIF, 2, 0)}, - {USB_DEVICE(0x0c45, 0x600d), /* SN9C101 */ - SFCI(PAS106, F_SIF, 2, 0)}, + {USB_DEVICE(0x0c45, 0x6001), DVNM("Genius VideoCAM NB")}, + {USB_DEVICE(0x0c45, 0x6005), DVNM("Sweex Tas5110")}, + {USB_DEVICE(0x0c45, 0x6007), DVNM("Sonix sn9c101 + Tas5110D")}, + {USB_DEVICE(0x0c45, 0x6009), DVNM("spcaCam@120")}, + {USB_DEVICE(0x0c45, 0x600d), DVNM("spcaCam@120")}, #endif - {USB_DEVICE(0x0c45, 0x6011), /* SN9C101 - SN9C101G */ - SFCI(OV6650, F_GAIN|F_AUTO|F_SIF, 5, 0x60)}, + {USB_DEVICE(0x0c45, 0x6011), DVNM("MAX Webcam Microdia")}, #ifndef CONFIG_USB_SN9C102 - {USB_DEVICE(0x0c45, 0x6019), /* SN9C101 */ - SFCI(OV7630, F_GAIN|F_AUTO, 5, 0x21)}, - {USB_DEVICE(0x0c45, 0x6024), /* SN9C102 */ - SFCI(TAS5130CXX, 0, 2, 0)}, - {USB_DEVICE(0x0c45, 0x6025), /* SN9C102 */ - SFCI(TAS5130CXX, 0, 2, 0)}, - {USB_DEVICE(0x0c45, 0x6028), /* SN9C102 */ - SFCI(PAS202, 0, 2, 0)}, - {USB_DEVICE(0x0c45, 0x6029), /* SN9C101 */ - SFCI(PAS106, F_SIF, 2, 0)}, - {USB_DEVICE(0x0c45, 0x602c), /* SN9C102 */ - SFCI(OV7630, F_GAIN|F_AUTO, 5, 0x21)}, - {USB_DEVICE(0x0c45, 0x602d), /* SN9C102 */ - SFCI(HV7131R, 0, 2, 0)}, - {USB_DEVICE(0x0c45, 0x602e), /* SN9C102 */ - SFCI(OV7630, F_GAIN|F_AUTO, 5, 0x21)}, - {USB_DEVICE(0x0c45, 0x60af), /* SN9C103 */ - SFCI(PAS202, F_H18, 2, 0)}, - {USB_DEVICE(0x0c45, 0x60b0), /* SN9C103 */ - SFCI(OV7630, F_GAIN|F_AUTO|F_H18, 5, 0x21)}, + {USB_DEVICE(0x0c45, 0x6019), DVNM("Generic Sonix OV7630")}, + {USB_DEVICE(0x0c45, 0x6024), DVNM("Generic Sonix Tas5130c")}, + {USB_DEVICE(0x0c45, 0x6025), DVNM("Xcam Shanga")}, + {USB_DEVICE(0x0c45, 0x6028), DVNM("Sonix Btc Pc380")}, + {USB_DEVICE(0x0c45, 0x6029), DVNM("spcaCam@150")}, + {USB_DEVICE(0x0c45, 0x602c), DVNM("Generic Sonix OV7630")}, + {USB_DEVICE(0x0c45, 0x602d), DVNM("LIC-200 LG")}, + {USB_DEVICE(0x0c45, 0x602e), DVNM("Genius VideoCam Messenger")}, + {USB_DEVICE(0x0c45, 0x60af), DVNM("Trust WB3100P")}, + {USB_DEVICE(0x0c45, 0x60b0), DVNM("Genius VideoCam Look")}, #endif {} }; @@ -1238,7 +1464,7 @@ static int __init sd_mod_init(void) { if (usb_register(&sd_driver) < 0) return -1; - PDEBUG(D_PROBE, "registered"); + PDEBUG(D_PROBE, "v%s registered", version); return 0; } static void __exit sd_mod_exit(void) diff --git a/trunk/drivers/media/video/gspca/sonixj.c b/trunk/drivers/media/video/gspca/sonixj.c index 33a3df1f6915..3e68b9926956 100644 --- a/trunk/drivers/media/video/gspca/sonixj.c +++ b/trunk/drivers/media/video/gspca/sonixj.c @@ -24,6 +24,9 @@ #include "gspca.h" #include "jpeg.h" +#define DRIVER_VERSION_NUMBER KERNEL_VERSION(2, 1, 7) +static const char version[] = "2.1.7"; + MODULE_AUTHOR("Michel Xhaard "); MODULE_DESCRIPTION("GSPCA/SONIX JPEG USB Camera Driver"); MODULE_LICENSE("GPL"); @@ -358,7 +361,6 @@ static const __u8 mo4000_sensor_init[][8] = { }; static const __u8 ov7660_sensor_init[][8] = { {0xa1, 0x21, 0x12, 0x80, 0x00, 0x00, 0x00, 0x10}, /* reset SCCB */ -/* (delay 20ms) */ {0xa1, 0x21, 0x12, 0x05, 0x00, 0x00, 0x00, 0x10}, /* Outformat ?? rawRGB */ {0xa1, 0x21, 0x13, 0xb8, 0x00, 0x00, 0x00, 0x10}, /* init COM8 */ @@ -537,31 +539,13 @@ static void reg_r(struct gspca_dev *gspca_dev, value, 0, gspca_dev->usb_buf, len, 500); - PDEBUG(D_USBI, "reg_r [%02x] -> %02x", value, gspca_dev->usb_buf[0]); } -static void reg_w1(struct gspca_dev *gspca_dev, - __u16 value, - __u8 data) -{ - PDEBUG(D_USBO, "reg_w1 [%02x] = %02x", value, data); - gspca_dev->usb_buf[0] = data; - usb_control_msg(gspca_dev->dev, - usb_sndctrlpipe(gspca_dev->dev, 0), - 0x08, - USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_INTERFACE, - value, - 0, - gspca_dev->usb_buf, 1, - 500); -} static void reg_w(struct gspca_dev *gspca_dev, __u16 value, const __u8 *buffer, int len) { - PDEBUG(D_USBO, "reg_w [%02x] = %02x %02x ..", - value, buffer[0], buffer[1]); if (len <= sizeof gspca_dev->usb_buf) { memcpy(gspca_dev->usb_buf, buffer, len); usb_control_msg(gspca_dev->dev, @@ -587,42 +571,31 @@ static void reg_w(struct gspca_dev *gspca_dev, } } -/* I2C write 1 byte */ -static void i2c_w1(struct gspca_dev *gspca_dev, __u8 reg, __u8 val) +/* I2C write 2 bytes */ +static void i2c_w2(struct gspca_dev *gspca_dev, + const __u8 *buffer) { struct sd *sd = (struct sd *) gspca_dev; + __u8 mode[8]; - PDEBUG(D_USBO, "i2c_w2 [%02x] = %02x", reg, val); - gspca_dev->usb_buf[0] = 0x81 | (2 << 4); /* = a1 */ - gspca_dev->usb_buf[1] = sd->i2c_base; - gspca_dev->usb_buf[2] = reg; - gspca_dev->usb_buf[3] = val; - gspca_dev->usb_buf[4] = 0; - gspca_dev->usb_buf[5] = 0; - gspca_dev->usb_buf[6] = 0; - gspca_dev->usb_buf[7] = 0x10; - usb_control_msg(gspca_dev->dev, - usb_sndctrlpipe(gspca_dev->dev, 0), - 0x08, - USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_INTERFACE, - 0x08, /* value = i2c */ - 0, - gspca_dev->usb_buf, 8, - 500); + /* is i2c ready */ + mode[0] = 0x81 | (2 << 4); + mode[1] = sd->i2c_base; + mode[2] = buffer[0]; + mode[3] = buffer[1]; + mode[4] = 0; + mode[5] = 0; + mode[6] = 0; + mode[7] = 0x10; + reg_w(gspca_dev, 0x08, mode, 8); } /* I2C write 8 bytes */ static void i2c_w8(struct gspca_dev *gspca_dev, const __u8 *buffer) { - memcpy(gspca_dev->usb_buf, buffer, 8); - usb_control_msg(gspca_dev->dev, - usb_sndctrlpipe(gspca_dev->dev, 0), - 0x08, - USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_INTERFACE, - 0x08, 0, /* value, index */ - gspca_dev->usb_buf, 8, - 500); + reg_w(gspca_dev, 0x08, buffer, 8); + msleep(1); } /* read 5 bytes in gspca_dev->usb_buf */ @@ -640,21 +613,24 @@ static void i2c_r5(struct gspca_dev *gspca_dev, __u8 reg) mode[6] = 0; mode[7] = 0x10; i2c_w8(gspca_dev, mode); - msleep(2); mode[0] = 0x81 | (5 << 4) | 0x02; mode[2] = 0; i2c_w8(gspca_dev, mode); - msleep(2); reg_r(gspca_dev, 0x0a, 5); } static int probesensor(struct gspca_dev *gspca_dev) { struct sd *sd = (struct sd *) gspca_dev; + __u8 reg02; + static const __u8 datasend[] = { 2, 0 }; + /* reg val1 val2 val3 val4 */ - i2c_w1(gspca_dev, 0x02, 0); /* sensor wakeup */ + i2c_w2(gspca_dev, datasend); +/* should write 0xa1 0x11 0x02 0x00 0x00 0x00 0x00 the 0x10 is add by i2cw */ msleep(10); - reg_w1(gspca_dev, 0x02, 0x66); /* Gpio on */ + reg02 = 0x66; + reg_w(gspca_dev, 0x02, ®02, 1); /* Gpio on */ msleep(10); i2c_r5(gspca_dev, 0); /* read sensor id */ if (gspca_dev->usb_buf[0] == 0x02 @@ -666,7 +642,7 @@ static int probesensor(struct gspca_dev *gspca_dev) sd->sensor = SENSOR_HV7131R; return SENSOR_HV7131R; } - PDEBUG(D_PROBE, "Find Sensor 0x%02x 0x%02x 0x%02x", + PDEBUG(D_PROBE, "Find Sensor %d %d %d", gspca_dev->usb_buf[0], gspca_dev->usb_buf[1], gspca_dev->usb_buf[2]); PDEBUG(D_PROBE, "Sensor sn9c102P Not found"); @@ -677,6 +653,8 @@ static int configure_gpio(struct gspca_dev *gspca_dev, const __u8 *sn9c1xx) { struct sd *sd = (struct sd *) gspca_dev; + __u8 data; + __u8 regF1; const __u8 *reg9a; static const __u8 reg9a_def[] = {0x08, 0x40, 0x20, 0x10, 0x00, 0x04}; @@ -685,13 +663,15 @@ static int configure_gpio(struct gspca_dev *gspca_dev, static const __u8 reg9a_sn9c325[] = {0x0a, 0x40, 0x38, 0x30, 0x00, 0x20}; - reg_w1(gspca_dev, 0xf1, 0x00); - reg_w1(gspca_dev, 0x01, sn9c1xx[0]); /*fixme:jfm was [1] en v1*/ + + regF1 = 0x00; + reg_w(gspca_dev, 0xf1, ®F1, 1); + reg_w(gspca_dev, 0x01, &sn9c1xx[0], 1); /*fixme:jfm was [1] en v1*/ /* configure gpio */ reg_w(gspca_dev, 0x01, &sn9c1xx[1], 2); reg_w(gspca_dev, 0x08, &sn9c1xx[8], 2); - reg_w(gspca_dev, 0x17, &sn9c1xx[0x17], 5); /* jfm len was 3 */ + reg_w(gspca_dev, 0x17, &sn9c1xx[0x17], 5); /* jfm was 3 */ switch (sd->bridge) { case BRIDGE_SN9C325: reg9a = reg9a_sn9c325; @@ -705,25 +685,35 @@ static int configure_gpio(struct gspca_dev *gspca_dev, } reg_w(gspca_dev, 0x9a, reg9a, 6); - reg_w1(gspca_dev, 0xd4, 0x60); /*fixme:jfm 60 00 00 (3) ? */ + data = 0x60; /*fixme:jfm 60 00 00 (3) */ + reg_w(gspca_dev, 0xd4, &data, 1); reg_w(gspca_dev, 0x03, &sn9c1xx[3], 0x0f); switch (sd->bridge) { case BRIDGE_SN9C120: /* from win trace */ - reg_w1(gspca_dev, 0x01, 0x61); - reg_w1(gspca_dev, 0x17, 0x20); - reg_w1(gspca_dev, 0x01, 0x60); + data = 0x61; + reg_w(gspca_dev, 0x01, &data, 1); + data = 0x20; + reg_w(gspca_dev, 0x17, &data, 1); + data = 0x60; + reg_w(gspca_dev, 0x01, &data, 1); break; case BRIDGE_SN9C325: - reg_w1(gspca_dev, 0x01, 0x43); - reg_w1(gspca_dev, 0x17, 0xae); - reg_w1(gspca_dev, 0x01, 0x42); + data = 0x43; + reg_w(gspca_dev, 0x01, &data, 1); + data = 0xae; + reg_w(gspca_dev, 0x17, &data, 1); + data = 0x42; + reg_w(gspca_dev, 0x01, &data, 1); break; default: - reg_w1(gspca_dev, 0x01, 0x43); - reg_w1(gspca_dev, 0x17, 0x61); - reg_w1(gspca_dev, 0x01, 0x42); + data = 0x43; + reg_w(gspca_dev, 0x01, &data, 1); + data = 0x61; + reg_w(gspca_dev, 0x17, &data, 1); + data = 0x42; + reg_w(gspca_dev, 0x01, &data, 1); } if (sd->sensor == SENSOR_HV7131R) { @@ -780,9 +770,6 @@ static void ov7660_InitSensor(struct gspca_dev *gspca_dev) { int i = 0; - i2c_w8(gspca_dev, ov7660_sensor_init[i]); /* reset SCCB */ - i++; - msleep(20); while (ov7660_sensor_init[i][0]) { i2c_w8(gspca_dev, ov7660_sensor_init[i]); i++; @@ -795,16 +782,194 @@ static int sd_config(struct gspca_dev *gspca_dev, { struct sd *sd = (struct sd *) gspca_dev; struct cam *cam; + __u16 vendor; + __u16 product; + + vendor = id->idVendor; + product = id->idProduct; + sd->sensor = -1; + switch (vendor) { + case 0x0458: /* Genius */ +/* switch (product) { + case 0x7025: */ + sd->bridge = BRIDGE_SN9C120; + sd->sensor = SENSOR_MI0360; + sd->i2c_base = 0x5d; +/* break; + } */ + break; + case 0x045e: +/* switch (product) { + case 0x00f5: + case 0x00f7: */ + sd->bridge = BRIDGE_SN9C105; + sd->sensor = SENSOR_OV7660; + sd->i2c_base = 0x21; +/* break; + } */ + break; + case 0x0471: /* Philips */ +/* switch (product) { + case 0x0327: + case 0x0328: + case 0x0330: */ + sd->bridge = BRIDGE_SN9C105; + sd->sensor = SENSOR_MI0360; + sd->i2c_base = 0x5d; +/* break; + } */ + break; + case 0x0c45: /* Sonix */ + switch (product) { + case 0x6040: + sd->bridge = BRIDGE_SN9C102P; +/* sd->sensor = SENSOR_MI0360; * from BW600.inf */ +/*fixme: MI0360 base=5d ? */ + sd->sensor = SENSOR_HV7131R; /* gspcav1 value */ + sd->i2c_base = 0x11; + break; +/* case 0x607a: * from BW600.inf + sd->bridge = BRIDGE_SN9C102P; + sd->sensor = SENSOR_OV7648; + sd->i2c_base = 0x??; + break; */ + case 0x607c: + sd->bridge = BRIDGE_SN9C102P; + sd->sensor = SENSOR_HV7131R; + sd->i2c_base = 0x11; + break; +/* case 0x607e: * from BW600.inf + sd->bridge = BRIDGE_SN9C102P; + sd->sensor = SENSOR_OV7630; + sd->i2c_base = 0x??; + break; */ + case 0x60c0: + sd->bridge = BRIDGE_SN9C105; + sd->sensor = SENSOR_MI0360; + sd->i2c_base = 0x5d; + break; +/* case 0x60c8: * from BW600.inf + sd->bridge = BRIDGE_SN9C105; + sd->sensor = SENSOR_OM6801; + sd->i2c_base = 0x??; + break; */ +/* case 0x60cc: * from BW600.inf + sd->bridge = BRIDGE_SN9C105; + sd->sensor = SENSOR_HV7131GP; + sd->i2c_base = 0x??; + break; */ + case 0x60ec: + sd->bridge = BRIDGE_SN9C105; + sd->sensor = SENSOR_MO4000; + sd->i2c_base = 0x21; + break; +/* case 0x60ef: * from BW600.inf + sd->bridge = BRIDGE_SN9C105; + sd->sensor = SENSOR_ICM105C; + sd->i2c_base = 0x??; + break; */ +/* case 0x60fa: * from BW600.inf + sd->bridge = BRIDGE_SN9C105; + sd->sensor = SENSOR_OV7648; + sd->i2c_base = 0x??; + break; */ + case 0x60fb: + sd->bridge = BRIDGE_SN9C105; + sd->sensor = SENSOR_OV7660; + sd->i2c_base = 0x21; + break; + case 0x60fc: + sd->bridge = BRIDGE_SN9C105; + sd->sensor = SENSOR_HV7131R; + sd->i2c_base = 0x11; + break; +/* case 0x60fe: * from BW600.inf + sd->bridge = BRIDGE_SN9C105; + sd->sensor = SENSOR_OV7630; + sd->i2c_base = 0x??; + break; */ +/* case 0x6108: * from BW600.inf + sd->bridge = BRIDGE_SN9C120; + sd->sensor = SENSOR_OM6801; + sd->i2c_base = 0x??; + break; */ +/* case 0x6122: * from BW600.inf + sd->bridge = BRIDGE_SN9C110; + sd->sensor = SENSOR_ICM105C; + sd->i2c_base = 0x??; + break; */ + case 0x612a: +/* sd->bridge = BRIDGE_SN9C110; * in BW600.inf */ + sd->bridge = BRIDGE_SN9C325; + sd->sensor = SENSOR_OV7648; + sd->i2c_base = 0x21; +/*fixme: sensor_init has base = 00 et 6e!*/ + break; +/* case 0x6123: * from BW600.inf + sd->bridge = BRIDGE_SN9C110; + sd->sensor = SENSOR_SanyoCCD; + sd->i2c_base = 0x??; + break; */ + case 0x612c: + sd->bridge = BRIDGE_SN9C110; + sd->sensor = SENSOR_MO4000; + sd->i2c_base = 0x21; + break; +/* case 0x612e: * from BW600.inf + sd->bridge = BRIDGE_SN9C110; + sd->sensor = SENSOR_OV7630; + sd->i2c_base = 0x??; + break; */ +/* case 0x612f: * from BW600.inf + sd->bridge = BRIDGE_SN9C110; + sd->sensor = SENSOR_ICM105C; + sd->i2c_base = 0x??; + break; */ + case 0x6130: + sd->bridge = BRIDGE_SN9C120; + sd->sensor = SENSOR_MI0360; + sd->i2c_base = 0x5d; + break; + case 0x6138: + sd->bridge = BRIDGE_SN9C120; + sd->sensor = SENSOR_MO4000; + sd->i2c_base = 0x21; + break; +/* case 0x613a: * from BW600.inf + sd->bridge = BRIDGE_SN9C120; + sd->sensor = SENSOR_OV7648; + sd->i2c_base = 0x??; + break; */ + case 0x613b: + sd->bridge = BRIDGE_SN9C120; + sd->sensor = SENSOR_OV7660; + sd->i2c_base = 0x21; + break; + case 0x613c: + sd->bridge = BRIDGE_SN9C120; + sd->sensor = SENSOR_HV7131R; + sd->i2c_base = 0x11; + break; +/* case 0x613e: * from BW600.inf + sd->bridge = BRIDGE_SN9C120; + sd->sensor = SENSOR_OV7630; + sd->i2c_base = 0x??; + break; */ + } + break; + } + if (sd->sensor < 0) { + PDEBUG(D_ERR, "Invalid vendor/product %04x:%04x", + vendor, product); + return -EINVAL; + } cam = &gspca_dev->cam; + cam->dev_name = (char *) id->driver_info; cam->epaddr = 0x01; cam->cam_mode = vga_mode; cam->nmodes = ARRAY_SIZE(vga_mode); - sd->bridge = id->driver_info >> 16; - sd->sensor = id->driver_info >> 8; - sd->i2c_base = id->driver_info; - sd->qindex = 4; /* set the quantization table */ sd->brightness = BRIGHTNESS_DEF; sd->contrast = CONTRAST_DEF; @@ -818,26 +983,34 @@ static int sd_open(struct gspca_dev *gspca_dev) { struct sd *sd = (struct sd *) gspca_dev; /* const __u8 *sn9c1xx; */ - __u8 regGpio[] = { 0x29, 0x74 }; __u8 regF1; + __u8 regGpio[] = { 0x29, 0x74 }; /* setup a selector by bridge */ - reg_w1(gspca_dev, 0xf1, 0x01); + regF1 = 0x01; + reg_w(gspca_dev, 0xf1, ®F1, 1); reg_r(gspca_dev, 0x00, 1); /* -> regF1 = 0x00 */ - reg_w1(gspca_dev, 0xf1, gspca_dev->usb_buf[0]); + regF1 = gspca_dev->usb_buf[0]; + reg_w(gspca_dev, 0xf1, ®F1, 1); reg_r(gspca_dev, 0x00, 1); regF1 = gspca_dev->usb_buf[0]; switch (sd->bridge) { case BRIDGE_SN9C102P: if (regF1 != 0x11) return -ENODEV; - reg_w1(gspca_dev, 0x02, regGpio[1]); + reg_w(gspca_dev, 0x02, ®Gpio[1], 1); break; case BRIDGE_SN9C105: if (regF1 != 0x11) return -ENODEV; reg_w(gspca_dev, 0x02, regGpio, 2); break; + case BRIDGE_SN9C110: + if (regF1 != 0x12) + return -ENODEV; + regGpio[1] = 0x62; + reg_w(gspca_dev, 0x02, ®Gpio[1], 1); + break; case BRIDGE_SN9C120: if (regF1 != 0x12) return -ENODEV; @@ -845,15 +1018,16 @@ static int sd_open(struct gspca_dev *gspca_dev) reg_w(gspca_dev, 0x02, regGpio, 2); break; default: -/* case BRIDGE_SN9C110: */ /* case BRIDGE_SN9C325: */ if (regF1 != 0x12) return -ENODEV; - reg_w1(gspca_dev, 0x02, 0x62); + regGpio[1] = 0x62; + reg_w(gspca_dev, 0x02, ®Gpio[1], 1); break; } - reg_w1(gspca_dev, 0xf1, 0x01); + regF1 = 0x01; + reg_w(gspca_dev, 0xf1, ®F1, 1); return 0; } @@ -949,7 +1123,7 @@ static void setbrightness(struct gspca_dev *gspca_dev) } k2 = sd->brightness >> 10; - reg_w1(gspca_dev, 0x96, k2); + reg_w(gspca_dev, 0x96, &k2, 1); } static void setcontrast(struct gspca_dev *gspca_dev) @@ -978,7 +1152,7 @@ static void setcolors(struct gspca_dev *gspca_dev) data = (colour + 32) & 0x7f; /* blue */ else data = (-colour + 32) & 0x7f; /* red */ - reg_w1(gspca_dev, 0x05, data); + reg_w(gspca_dev, 0x05, &data, 1); } /* -- start the camera -- */ @@ -991,6 +1165,7 @@ static void sd_start(struct gspca_dev *gspca_dev) __u8 reg17; const __u8 *sn9c1xx; int mode; + static const __u8 DC29[] = { 0x6a, 0x50, 0x00, 0x00, 0x50, 0x3c }; static const __u8 C0[] = { 0x2d, 0x2d, 0x3a, 0x05, 0x04, 0x3f }; static const __u8 CA[] = { 0x28, 0xd8, 0x14, 0xec }; static const __u8 CA_sn9c120[] = @@ -1004,20 +1179,21 @@ static void sd_start(struct gspca_dev *gspca_dev) /*fixme:jfm this sequence should appear at end of sd_start */ /* with - reg_w1(gspca_dev, 0x01, 0x44); */ - reg_w1(gspca_dev, 0x15, sn9c1xx[0x15]); - reg_w1(gspca_dev, 0x16, sn9c1xx[0x16]); - reg_w1(gspca_dev, 0x12, sn9c1xx[0x12]); - reg_w1(gspca_dev, 0x13, sn9c1xx[0x13]); - reg_w1(gspca_dev, 0x18, sn9c1xx[0x18]); - reg_w1(gspca_dev, 0xd2, 0x6a); /* DC29 */ - reg_w1(gspca_dev, 0xd3, 0x50); - reg_w1(gspca_dev, 0xc6, 0x00); - reg_w1(gspca_dev, 0xc7, 0x00); - reg_w1(gspca_dev, 0xc8, 0x50); - reg_w1(gspca_dev, 0xc9, 0x3c); + data = 0x44; + reg_w(gspca_dev, 0x01, &data, 1); */ + reg_w(gspca_dev, 0x15, &sn9c1xx[0x15], 1); + reg_w(gspca_dev, 0x16, &sn9c1xx[0x16], 1); + reg_w(gspca_dev, 0x12, &sn9c1xx[0x12], 1); + reg_w(gspca_dev, 0x13, &sn9c1xx[0x13], 1); + reg_w(gspca_dev, 0x18, &sn9c1xx[0x18], 1); + reg_w(gspca_dev, 0xd2, &DC29[0], 1); + reg_w(gspca_dev, 0xd3, &DC29[1], 1); + reg_w(gspca_dev, 0xc6, &DC29[2], 1); + reg_w(gspca_dev, 0xc7, &DC29[3], 1); + reg_w(gspca_dev, 0xc8, &DC29[4], 1); + reg_w(gspca_dev, 0xc9, &DC29[5], 1); /*fixme:jfm end of ending sequence */ - reg_w1(gspca_dev, 0x18, sn9c1xx[0x18]); + reg_w(gspca_dev, 0x18, &sn9c1xx[0x18], 1); switch (sd->bridge) { case BRIDGE_SN9C325: data = 0xae; @@ -1029,11 +1205,11 @@ static void sd_start(struct gspca_dev *gspca_dev) data = 0x60; break; } - reg_w1(gspca_dev, 0x17, data); - reg_w1(gspca_dev, 0x05, sn9c1xx[5]); - reg_w1(gspca_dev, 0x07, sn9c1xx[7]); - reg_w1(gspca_dev, 0x06, sn9c1xx[6]); - reg_w1(gspca_dev, 0x14, sn9c1xx[0x14]); + reg_w(gspca_dev, 0x17, &data, 1); + reg_w(gspca_dev, 0x05, &sn9c1xx[5], 1); + reg_w(gspca_dev, 0x07, &sn9c1xx[7], 1); + reg_w(gspca_dev, 0x06, &sn9c1xx[6], 1); + reg_w(gspca_dev, 0x14, &sn9c1xx[0x14], 1); switch (sd->bridge) { case BRIDGE_SN9C325: reg_w(gspca_dev, 0x20, regsn20_sn9c325, @@ -1041,8 +1217,10 @@ static void sd_start(struct gspca_dev *gspca_dev) for (i = 0; i < 8; i++) reg_w(gspca_dev, 0x84, reg84_sn9c325, sizeof reg84_sn9c325); - reg_w1(gspca_dev, 0x9a, 0x0a); - reg_w1(gspca_dev, 0x99, 0x60); + data = 0x0a; + reg_w(gspca_dev, 0x9a, &data, 1); + data = 0x60; + reg_w(gspca_dev, 0x99, &data, 1); break; case BRIDGE_SN9C120: reg_w(gspca_dev, 0x20, regsn20_sn9c120, @@ -1055,30 +1233,39 @@ static void sd_start(struct gspca_dev *gspca_dev) sizeof reg84_sn9c120_2); reg_w(gspca_dev, 0x84, reg84_sn9c120_3, sizeof reg84_sn9c120_3); - reg_w1(gspca_dev, 0x9a, 0x05); - reg_w1(gspca_dev, 0x99, 0x5b); + data = 0x05; + reg_w(gspca_dev, 0x9a, &data, 1); + data = 0x5b; + reg_w(gspca_dev, 0x99, &data, 1); break; default: reg_w(gspca_dev, 0x20, regsn20, sizeof regsn20); for (i = 0; i < 8; i++) reg_w(gspca_dev, 0x84, reg84, sizeof reg84); - reg_w1(gspca_dev, 0x9a, 0x08); - reg_w1(gspca_dev, 0x99, 0x59); + data = 0x08; + reg_w(gspca_dev, 0x9a, &data, 1); + data = 0x59; + reg_w(gspca_dev, 0x99, &data, 1); break; } mode = gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].priv; - if (mode) - reg1 = 0x46; /* 320 clk 48Mhz */ - else - reg1 = 0x06; /* 640 clk 24Mz */ + reg1 = 0x02; reg17 = 0x61; switch (sd->sensor) { case SENSOR_HV7131R: hv7131R_InitSensor(gspca_dev); + if (mode) + reg1 = 0x46; /* 320 clk 48Mhz */ + else + reg1 = 0x06; /* 640 clk 24Mz */ break; case SENSOR_MI0360: mi0360_InitSensor(gspca_dev); + if (mode) + reg1 = 0x46; /* 320 clk 48Mhz */ + else + reg1 = 0x06; /* 640 clk 24Mz */ break; case SENSOR_MO4000: mo4000_InitSensor(gspca_dev); @@ -1087,13 +1274,13 @@ static void sd_start(struct gspca_dev *gspca_dev) reg1 = 0x06; /* clk 24Mz */ } else { reg17 = 0x22; /* 640 MCKSIZE */ -/* reg1 = 0x06; * 640 clk 24Mz (done) */ + reg1 = 0x06; /* 640 clk 24Mz */ } break; case SENSOR_OV7648: - ov7648_InitSensor(gspca_dev); reg17 = 0xa2; reg1 = 0x44; + ov7648_InitSensor(gspca_dev); /* if (mode) ; * 320x2... else @@ -1105,7 +1292,7 @@ static void sd_start(struct gspca_dev *gspca_dev) if (mode) { /* reg17 = 0x21; * 320 */ /* reg1 = 0x44; */ -/* reg1 = 0x46; (done) */ + reg1 = 0x46; } else { reg17 = 0xa2; /* 640 */ reg1 = 0x40; @@ -1134,16 +1321,16 @@ static void sd_start(struct gspca_dev *gspca_dev) /* here change size mode 0 -> VGA; 1 -> CIF */ data = 0x40 | sn9c1xx[0x18] | (mode << 4); - reg_w1(gspca_dev, 0x18, data); + reg_w(gspca_dev, 0x18, &data, 1); reg_w(gspca_dev, 0x100, qtable4, 0x40); reg_w(gspca_dev, 0x140, qtable4 + 0x40, 0x40); data = sn9c1xx[0x18] | (mode << 4); - reg_w1(gspca_dev, 0x18, data); + reg_w(gspca_dev, 0x18, &data, 1); - reg_w1(gspca_dev, 0x17, reg17); - reg_w1(gspca_dev, 0x01, reg1); + reg_w(gspca_dev, 0x17, ®17, 1); + reg_w(gspca_dev, 0x01, ®1, 1); setbrightness(gspca_dev); setcontrast(gspca_dev); } @@ -1155,6 +1342,7 @@ static void sd_stopN(struct gspca_dev *gspca_dev) { 0xa1, 0x11, 0x02, 0x09, 0x00, 0x00, 0x00, 0x10 }; static const __u8 stopmi0360[] = { 0xb1, 0x5d, 0x07, 0x00, 0x00, 0x00, 0x00, 0x10 }; + __u8 regF1; __u8 data; const __u8 *sn9c1xx; @@ -1178,11 +1366,12 @@ static void sd_stopN(struct gspca_dev *gspca_dev) break; } sn9c1xx = sn_tb[(int) sd->sensor]; - reg_w1(gspca_dev, 0x01, sn9c1xx[1]); - reg_w1(gspca_dev, 0x17, sn9c1xx[0x17]); - reg_w1(gspca_dev, 0x01, sn9c1xx[1]); - reg_w1(gspca_dev, 0x01, data); - reg_w1(gspca_dev, 0xf1, 0x01); + reg_w(gspca_dev, 0x01, &sn9c1xx[1], 1); + reg_w(gspca_dev, 0x17, &sn9c1xx[0x17], 1); + reg_w(gspca_dev, 0x01, &sn9c1xx[1], 1); + reg_w(gspca_dev, 0x01, &data, 1); + regF1 = 0x01; + reg_w(gspca_dev, 0xf1, ®F1, 1); } static void sd_stop0(struct gspca_dev *gspca_dev) @@ -1421,53 +1610,30 @@ static const struct sd_desc sd_desc = { }; /* -- module initialisation -- */ -#define BSI(bridge, sensor, i2c_addr) \ - .driver_info = (BRIDGE_ ## bridge << 16) \ - | (SENSOR_ ## sensor << 8) \ - | (i2c_addr) +#define DVNM(name) .driver_info = (kernel_ulong_t) name static const __devinitdata struct usb_device_id device_table[] = { #ifndef CONFIG_USB_SN9C102 - {USB_DEVICE(0x0458, 0x7025), BSI(SN9C120, MI0360, 0x5d)}, - {USB_DEVICE(0x045e, 0x00f5), BSI(SN9C105, OV7660, 0x21)}, - {USB_DEVICE(0x045e, 0x00f7), BSI(SN9C105, OV7660, 0x21)}, - {USB_DEVICE(0x0471, 0x0327), BSI(SN9C105, MI0360, 0x5d)}, - {USB_DEVICE(0x0471, 0x0328), BSI(SN9C105, MI0360, 0x5d)}, + {USB_DEVICE(0x0458, 0x7025), DVNM("Genius Eye 311Q")}, + {USB_DEVICE(0x045e, 0x00f5), DVNM("MicroSoft VX3000")}, + {USB_DEVICE(0x045e, 0x00f7), DVNM("MicroSoft VX1000")}, + {USB_DEVICE(0x0471, 0x0327), DVNM("Philips SPC 600 NC")}, + {USB_DEVICE(0x0471, 0x0328), DVNM("Philips SPC 700 NC")}, #endif - {USB_DEVICE(0x0471, 0x0330), BSI(SN9C105, MI0360, 0x5d)}, - {USB_DEVICE(0x0c45, 0x6040), BSI(SN9C102P, HV7131R, 0x11)}, -/* bw600.inf: - {USB_DEVICE(0x0c45, 0x6040), BSI(SN9C102P, MI0360, 0x5d)}, */ -/* {USB_DEVICE(0x0c45, 0x603a), BSI(SN9C102P, OV7648, 0x??)}, */ -/* {USB_DEVICE(0x0c45, 0x607a), BSI(SN9C102P, OV7648, 0x??)}, */ - {USB_DEVICE(0x0c45, 0x607c), BSI(SN9C102P, HV7131R, 0x11)}, -/* {USB_DEVICE(0x0c45, 0x607e), BSI(SN9C102P, OV7630, 0x??)}, */ - {USB_DEVICE(0x0c45, 0x60c0), BSI(SN9C105, MI0360, 0x5d)}, -/* {USB_DEVICE(0x0c45, 0x60c8), BSI(SN9C105, OM6801, 0x??)}, */ -/* {USB_DEVICE(0x0c45, 0x60cc), BSI(SN9C105, HV7131GP, 0x??)}, */ - {USB_DEVICE(0x0c45, 0x60ec), BSI(SN9C105, MO4000, 0x21)}, -/* {USB_DEVICE(0x0c45, 0x60ef), BSI(SN9C105, ICM105C, 0x??)}, */ -/* {USB_DEVICE(0x0c45, 0x60fa), BSI(SN9C105, OV7648, 0x??)}, */ - {USB_DEVICE(0x0c45, 0x60fb), BSI(SN9C105, OV7660, 0x21)}, - {USB_DEVICE(0x0c45, 0x60fc), BSI(SN9C105, HV7131R, 0x11)}, -/* {USB_DEVICE(0x0c45, 0x60fe), BSI(SN9C105, OV7630, 0x??)}, */ -/* {USB_DEVICE(0x0c45, 0x6108), BSI(SN9C120, OM6801, 0x??)}, */ -/* {USB_DEVICE(0x0c45, 0x6122), BSI(SN9C110, ICM105C, 0x??)}, */ -/* {USB_DEVICE(0x0c45, 0x6123), BSI(SN9C110, SanyoCCD, 0x??)}, */ - {USB_DEVICE(0x0c45, 0x612a), BSI(SN9C325, OV7648, 0x21)}, -/* bw600.inf: - {USB_DEVICE(0x0c45, 0x612a), BSI(SN9C110, OV7648, 0x21)}, */ - {USB_DEVICE(0x0c45, 0x612c), BSI(SN9C110, MO4000, 0x21)}, -/* {USB_DEVICE(0x0c45, 0x612e), BSI(SN9C110, OV7630, 0x??)}, */ -/* {USB_DEVICE(0x0c45, 0x612f), BSI(SN9C110, ICM105C, 0x??)}, */ + {USB_DEVICE(0x0471, 0x0330), DVNM("Philips SPC 710NC")}, + {USB_DEVICE(0x0c45, 0x6040), DVNM("Speed NVC 350K")}, + {USB_DEVICE(0x0c45, 0x607c), DVNM("Sonix sn9c102p Hv7131R")}, + {USB_DEVICE(0x0c45, 0x60c0), DVNM("Sangha Sn535")}, + {USB_DEVICE(0x0c45, 0x60ec), DVNM("SN9C105+MO4000")}, + {USB_DEVICE(0x0c45, 0x60fb), DVNM("Surfer NoName")}, + {USB_DEVICE(0x0c45, 0x60fc), DVNM("LG-LIC300")}, + {USB_DEVICE(0x0c45, 0x612a), DVNM("Avant Camera")}, + {USB_DEVICE(0x0c45, 0x612c), DVNM("Typhoon Rasy Cam 1.3MPix")}, #ifndef CONFIG_USB_SN9C102 - {USB_DEVICE(0x0c45, 0x6130), BSI(SN9C120, MI0360, 0x5d)}, - {USB_DEVICE(0x0c45, 0x6138), BSI(SN9C120, MO4000, 0x21)}, -/* {USB_DEVICE(0x0c45, 0x613a), BSI(SN9C120, OV7648, 0x??)}, */ - {USB_DEVICE(0x0c45, 0x613b), BSI(SN9C120, OV7660, 0x21)}, - {USB_DEVICE(0x0c45, 0x613c), BSI(SN9C120, HV7131R, 0x11)}, -/* {USB_DEVICE(0x0c45, 0x613e), BSI(SN9C120, OV7630, 0x??)}, */ + {USB_DEVICE(0x0c45, 0x6130), DVNM("Sonix Pccam")}, + {USB_DEVICE(0x0c45, 0x6138), DVNM("Sn9c120 Mo4000")}, + {USB_DEVICE(0x0c45, 0x613b), DVNM("Surfer SN-206")}, + {USB_DEVICE(0x0c45, 0x613c), DVNM("Sonix Pccam168")}, #endif - {USB_DEVICE(0x0c45, 0x6143), BSI(SN9C120, MI0360, 0x5d)}, {} }; MODULE_DEVICE_TABLE(usb, device_table); @@ -1492,7 +1658,7 @@ static int __init sd_mod_init(void) { if (usb_register(&sd_driver) < 0) return -1; - info("registered"); + info("v%s registered", version); return 0; } static void __exit sd_mod_exit(void) diff --git a/trunk/drivers/media/video/gspca/spca500.c b/trunk/drivers/media/video/gspca/spca500.c index 17fe2c2a440d..156206118795 100644 --- a/trunk/drivers/media/video/gspca/spca500.c +++ b/trunk/drivers/media/video/gspca/spca500.c @@ -24,6 +24,9 @@ #include "gspca.h" #include "jpeg.h" +#define DRIVER_VERSION_NUMBER KERNEL_VERSION(2, 1, 7) +static const char version[] = "2.1.7"; + MODULE_AUTHOR("Michel Xhaard "); MODULE_DESCRIPTION("GSPCA/SPCA500 USB Camera Driver"); MODULE_LICENSE("GPL"); @@ -627,10 +630,109 @@ static int sd_config(struct gspca_dev *gspca_dev, { struct sd *sd = (struct sd *) gspca_dev; struct cam *cam; - + __u16 vendor; + __u16 product; + + vendor = id->idVendor; + product = id->idProduct; + switch (vendor) { + case 0x040a: /* Kodak cameras */ +/* switch (product) { */ +/* case 0x0300: */ + sd->subtype = KodakEZ200; +/* break; */ +/* } */ + break; + case 0x041e: /* Creative cameras */ +/* switch (product) { */ +/* case 0x400a: */ + sd->subtype = CreativePCCam300; +/* break; */ +/* } */ + break; + case 0x046d: /* Logitech Labtec */ + switch (product) { + case 0x0890: + sd->subtype = LogitechTraveler; + break; + case 0x0900: + sd->subtype = LogitechClickSmart310; + break; + case 0x0901: + sd->subtype = LogitechClickSmart510; + break; + } + break; + case 0x04a5: /* Benq */ +/* switch (product) { */ +/* case 0x300c: */ + sd->subtype = BenqDC1016; +/* break; */ +/* } */ + break; + case 0x04fc: /* SunPlus */ +/* switch (product) { */ +/* case 0x7333: */ + sd->subtype = PalmPixDC85; +/* break; */ +/* } */ + break; + case 0x055f: /* Mustek cameras */ + switch (product) { + case 0xc200: + sd->subtype = MustekGsmart300; + break; + case 0xc220: + sd->subtype = Gsmartmini; + break; + } + break; + case 0x06bd: /* Agfa Cl20 */ +/* switch (product) { */ +/* case 0x0404: */ + sd->subtype = AgfaCl20; +/* break; */ +/* } */ + break; + case 0x06be: /* Optimedia */ +/* switch (product) { */ +/* case 0x0800: */ + sd->subtype = Optimedia; +/* break; */ +/* } */ + break; + case 0x084d: /* D-Link / Minton */ +/* switch (product) { */ +/* case 0x0003: * DSC-350 / S-Cam F5 */ + sd->subtype = DLinkDSC350; +/* break; */ +/* } */ + break; + case 0x08ca: /* Aiptek */ +/* switch (product) { */ +/* case 0x0103: */ + sd->subtype = AiptekPocketDV; +/* break; */ +/* } */ + break; + case 0x2899: /* ToptroIndustrial */ +/* switch (product) { */ +/* case 0x012c: */ + sd->subtype = ToptroIndus; +/* break; */ +/* } */ + break; + case 0x8086: /* Intel */ +/* switch (product) { */ +/* case 0x0630: * Pocket PC Camera */ + sd->subtype = IntelPocketPCCamera; +/* break; */ +/* } */ + break; + } cam = &gspca_dev->cam; + cam->dev_name = (char *) id->driver_info; cam->epaddr = 0x01; - sd->subtype = id->driver_info; if (sd->subtype != LogitechClickSmart310) { cam->cam_mode = vga_mode; cam->nmodes = sizeof vga_mode / sizeof vga_mode[0]; @@ -1060,22 +1162,23 @@ static struct sd_desc sd_desc = { }; /* -- module initialisation -- */ +#define DVNM(name) .driver_info = (kernel_ulong_t) name static const __devinitdata struct usb_device_id device_table[] = { - {USB_DEVICE(0x040a, 0x0300), .driver_info = KodakEZ200}, - {USB_DEVICE(0x041e, 0x400a), .driver_info = CreativePCCam300}, - {USB_DEVICE(0x046d, 0x0890), .driver_info = LogitechTraveler}, - {USB_DEVICE(0x046d, 0x0900), .driver_info = LogitechClickSmart310}, - {USB_DEVICE(0x046d, 0x0901), .driver_info = LogitechClickSmart510}, - {USB_DEVICE(0x04a5, 0x300c), .driver_info = BenqDC1016}, - {USB_DEVICE(0x04fc, 0x7333), .driver_info = PalmPixDC85}, - {USB_DEVICE(0x055f, 0xc200), .driver_info = MustekGsmart300}, - {USB_DEVICE(0x055f, 0xc220), .driver_info = Gsmartmini}, - {USB_DEVICE(0x06bd, 0x0404), .driver_info = AgfaCl20}, - {USB_DEVICE(0x06be, 0x0800), .driver_info = Optimedia}, - {USB_DEVICE(0x084d, 0x0003), .driver_info = DLinkDSC350}, - {USB_DEVICE(0x08ca, 0x0103), .driver_info = AiptekPocketDV}, - {USB_DEVICE(0x2899, 0x012c), .driver_info = ToptroIndus}, - {USB_DEVICE(0x8086, 0x0630), .driver_info = IntelPocketPCCamera}, + {USB_DEVICE(0x040a, 0x0300), DVNM("Kodak EZ200")}, + {USB_DEVICE(0x041e, 0x400a), DVNM("Creative PC-CAM 300")}, + {USB_DEVICE(0x046d, 0x0890), DVNM("Logitech QuickCam traveler")}, + {USB_DEVICE(0x046d, 0x0900), DVNM("Logitech Inc. ClickSmart 310")}, + {USB_DEVICE(0x046d, 0x0901), DVNM("Logitech Inc. ClickSmart 510")}, + {USB_DEVICE(0x04a5, 0x300c), DVNM("Benq DC1016")}, + {USB_DEVICE(0x04fc, 0x7333), DVNM("PalmPixDC85")}, + {USB_DEVICE(0x055f, 0xc200), DVNM("Mustek Gsmart 300")}, + {USB_DEVICE(0x055f, 0xc220), DVNM("Gsmart Mini")}, + {USB_DEVICE(0x06bd, 0x0404), DVNM("Agfa CL20")}, + {USB_DEVICE(0x06be, 0x0800), DVNM("Optimedia")}, + {USB_DEVICE(0x084d, 0x0003), DVNM("D-Link DSC-350")}, + {USB_DEVICE(0x08ca, 0x0103), DVNM("Aiptek PocketDV")}, + {USB_DEVICE(0x2899, 0x012c), DVNM("Toptro Industrial")}, + {USB_DEVICE(0x8086, 0x0630), DVNM("Intel Pocket PC Camera")}, {} }; MODULE_DEVICE_TABLE(usb, device_table); @@ -1100,7 +1203,7 @@ static int __init sd_mod_init(void) { if (usb_register(&sd_driver) < 0) return -1; - PDEBUG(D_PROBE, "registered"); + PDEBUG(D_PROBE, "v%s registered", version); return 0; } static void __exit sd_mod_exit(void) diff --git a/trunk/drivers/media/video/gspca/spca501.c b/trunk/drivers/media/video/gspca/spca501.c index 51a3c3429ef0..50e929de0203 100644 --- a/trunk/drivers/media/video/gspca/spca501.c +++ b/trunk/drivers/media/video/gspca/spca501.c @@ -23,6 +23,9 @@ #include "gspca.h" +#define DRIVER_VERSION_NUMBER KERNEL_VERSION(2, 1, 7) +static const char version[] = "2.1.7"; + MODULE_AUTHOR("Michel Xhaard "); MODULE_DESCRIPTION("GSPCA/SPCA501 USB Camera Driver"); MODULE_LICENSE("GPL"); @@ -1920,12 +1923,63 @@ static int sd_config(struct gspca_dev *gspca_dev, { struct sd *sd = (struct sd *) gspca_dev; struct cam *cam; - + __u16 vendor; + __u16 product; + + vendor = id->idVendor; + product = id->idProduct; + switch (vendor) { + case 0x0000: /* Unknow Camera */ +/* switch (product) { */ +/* case 0x0000: */ + sd->subtype = MystFromOriUnknownCamera; +/* break; */ +/* } */ + break; + case 0x040a: /* Kodak cameras */ +/* switch (product) { */ +/* case 0x0002: */ + sd->subtype = KodakDVC325; +/* break; */ +/* } */ + break; + case 0x0497: /* Smile International */ +/* switch (product) { */ +/* case 0xc001: */ + sd->subtype = SmileIntlCamera; +/* break; */ +/* } */ + break; + case 0x0506: /* 3COM cameras */ +/* switch (product) { */ +/* case 0x00df: */ + sd->subtype = ThreeComHomeConnectLite; +/* break; */ +/* } */ + break; + case 0x0733: /* Rebadged ViewQuest (Intel) and ViewQuest cameras */ + switch (product) { + case 0x0401: + sd->subtype = IntelCreateAndShare; + break; + case 0x0402: + sd->subtype = ViewQuestM318B; + break; + } + break; + case 0x1776: /* Arowana */ +/* switch (product) { */ +/* case 0x501c: */ + sd->subtype = Arowana300KCMOSCamera; +/* break; */ +/* } */ + break; + } cam = &gspca_dev->cam; + cam->dev_name = (char *) id->driver_info; cam->epaddr = 0x01; cam->cam_mode = vga_mode; cam->nmodes = sizeof vga_mode / sizeof vga_mode[0]; - sd->subtype = id->driver_info; sd->brightness = sd_ctrls[MY_BRIGHTNESS].qctrl.default_value; sd->contrast = sd_ctrls[MY_CONTRAST].qctrl.default_value; sd->colors = sd_ctrls[MY_COLOR].qctrl.default_value; @@ -2129,14 +2183,15 @@ static const struct sd_desc sd_desc = { }; /* -- module initialisation -- */ +#define DVNM(name) .driver_info = (kernel_ulong_t) name static const __devinitdata struct usb_device_id device_table[] = { - {USB_DEVICE(0x040a, 0x0002), .driver_info = KodakDVC325}, - {USB_DEVICE(0x0497, 0xc001), .driver_info = SmileIntlCamera}, - {USB_DEVICE(0x0506, 0x00df), .driver_info = ThreeComHomeConnectLite}, - {USB_DEVICE(0x0733, 0x0401), .driver_info = IntelCreateAndShare}, - {USB_DEVICE(0x0733, 0x0402), .driver_info = ViewQuestM318B}, - {USB_DEVICE(0x1776, 0x501c), .driver_info = Arowana300KCMOSCamera}, - {USB_DEVICE(0x0000, 0x0000), .driver_info = MystFromOriUnknownCamera}, + {USB_DEVICE(0x040a, 0x0002), DVNM("Kodak DVC-325")}, + {USB_DEVICE(0x0497, 0xc001), DVNM("Smile International")}, + {USB_DEVICE(0x0506, 0x00df), DVNM("3Com HomeConnect Lite")}, + {USB_DEVICE(0x0733, 0x0401), DVNM("Intel Create and Share")}, + {USB_DEVICE(0x0733, 0x0402), DVNM("ViewQuest M318B")}, + {USB_DEVICE(0x1776, 0x501c), DVNM("Arowana 300K CMOS Camera")}, + {USB_DEVICE(0x0000, 0x0000), DVNM("MystFromOri Unknow Camera")}, {} }; MODULE_DEVICE_TABLE(usb, device_table); @@ -2161,7 +2216,7 @@ static int __init sd_mod_init(void) { if (usb_register(&sd_driver) < 0) return -1; - PDEBUG(D_PROBE, "registered"); + PDEBUG(D_PROBE, "v%s registered", version); return 0; } static void __exit sd_mod_exit(void) diff --git a/trunk/drivers/media/video/gspca/spca505.c b/trunk/drivers/media/video/gspca/spca505.c index 3c2be80cbd65..ddea6e140aa8 100644 --- a/trunk/drivers/media/video/gspca/spca505.c +++ b/trunk/drivers/media/video/gspca/spca505.c @@ -23,6 +23,9 @@ #include "gspca.h" +#define DRIVER_VERSION_NUMBER KERNEL_VERSION(2, 1, 7) +static const char version[] = "2.1.7"; + MODULE_AUTHOR("Michel Xhaard "); MODULE_DESCRIPTION("GSPCA/SPCA505 USB Camera Driver"); MODULE_LICENSE("GPL"); @@ -31,6 +34,10 @@ MODULE_LICENSE("GPL"); struct sd { struct gspca_dev gspca_dev; /* !! must be the first item */ + int buflen; + unsigned char tmpbuf[640 * 480 * 3 / 2]; /* YYUV per line */ + unsigned char tmpbuf2[640 * 480 * 2]; /* YUYV */ + unsigned char brightness; char subtype; @@ -60,29 +67,29 @@ static struct ctrl sd_ctrls[] = { }; static struct v4l2_pix_format vga_mode[] = { - {160, 120, V4L2_PIX_FMT_SPCA505, V4L2_FIELD_NONE, - .bytesperline = 160 * 3, - .sizeimage = 160 * 120 * 3 / 2, + {160, 120, V4L2_PIX_FMT_YUYV, V4L2_FIELD_NONE, + .bytesperline = 160 * 2, + .sizeimage = 160 * 120 * 2, .colorspace = V4L2_COLORSPACE_SRGB, .priv = 5}, - {176, 144, V4L2_PIX_FMT_SPCA505, V4L2_FIELD_NONE, - .bytesperline = 176 * 3, - .sizeimage = 176 * 144 * 3 / 2, + {176, 144, V4L2_PIX_FMT_YUYV, V4L2_FIELD_NONE, + .bytesperline = 176 * 2, + .sizeimage = 176 * 144 * 2, .colorspace = V4L2_COLORSPACE_SRGB, .priv = 4}, - {320, 240, V4L2_PIX_FMT_SPCA505, V4L2_FIELD_NONE, - .bytesperline = 320 * 3, - .sizeimage = 320 * 240 * 3 / 2, + {320, 240, V4L2_PIX_FMT_YUYV, V4L2_FIELD_NONE, + .bytesperline = 320 * 2, + .sizeimage = 320 * 240 * 2, .colorspace = V4L2_COLORSPACE_SRGB, .priv = 2}, - {352, 288, V4L2_PIX_FMT_SPCA505, V4L2_FIELD_NONE, - .bytesperline = 352 * 3, - .sizeimage = 352 * 288 * 3 / 2, + {352, 288, V4L2_PIX_FMT_YUYV, V4L2_FIELD_NONE, + .bytesperline = 352 * 2, + .sizeimage = 352 * 288 * 2, .colorspace = V4L2_COLORSPACE_SRGB, .priv = 1}, - {640, 480, V4L2_PIX_FMT_SPCA505, V4L2_FIELD_NONE, - .bytesperline = 640 * 3, - .sizeimage = 640 * 480 * 3 / 2, + {640, 480, V4L2_PIX_FMT_YUYV, V4L2_FIELD_NONE, + .bytesperline = 640 * 2, + .sizeimage = 640 * 480 * 2, .colorspace = V4L2_COLORSPACE_SRGB, .priv = 0}, }; @@ -634,11 +641,33 @@ static int sd_config(struct gspca_dev *gspca_dev, { struct sd *sd = (struct sd *) gspca_dev; struct cam *cam; + __u16 vendor; + __u16 product; + + vendor = id->idVendor; + product = id->idProduct; + switch (vendor) { + case 0x041e: /* Creative cameras */ +/* switch (product) { */ +/* case 0x401d: * here505b */ + sd->subtype = Nxultra; +/* break; */ +/* } */ + break; + case 0x0733: /* Rebadged ViewQuest (Intel) and ViewQuest cameras */ +/* switch (product) { */ +/* case 0x0430: */ +/* fixme: may be UsbGrabberPV321 BRIDGE_SPCA506 SENSOR_SAA7113 */ + sd->subtype = IntelPCCameraPro; +/* break; */ +/* } */ + break; + } cam = &gspca_dev->cam; + cam->dev_name = (char *) id->driver_info; cam->epaddr = 0x01; cam->cam_mode = vga_mode; - sd->subtype = id->driver_info; if (sd->subtype != IntelPCCameraPro) cam->nmodes = sizeof vga_mode / sizeof vga_mode[0]; else /* no 640x480 for IntelPCCameraPro */ @@ -756,30 +785,77 @@ static void sd_close(struct gspca_dev *gspca_dev) reg_write(gspca_dev->dev, 0x05, 0x11, 0xf); } +/* convert YYUV per line to YUYV (YUV 4:2:2) */ +static void yyuv_decode(unsigned char *out, + unsigned char *in, + int width, + int height) +{ + unsigned char *Ui, *Vi, *yi, *yi1; + unsigned char *out1; + int i, j; + + yi = in; + for (i = height / 2; --i >= 0; ) { + out1 = out + width * 2; /* next line */ + yi1 = yi + width; + Ui = yi1 + width; + Vi = Ui + width / 2; + for (j = width / 2; --j >= 0; ) { + *out++ = 128 + *yi++; + *out++ = 128 + *Ui; + *out++ = 128 + *yi++; + *out++ = 128 + *Vi; + + *out1++ = 128 + *yi1++; + *out1++ = 128 + *Ui++; + *out1++ = 128 + *yi1++; + *out1++ = 128 + *Vi++; + } + yi += width * 2; + out = out1; + } +} + static void sd_pkt_scan(struct gspca_dev *gspca_dev, struct gspca_frame *frame, /* target */ __u8 *data, /* isoc packet */ int len) /* iso packet length */ { + struct sd *sd = (struct sd *) gspca_dev; + switch (data[0]) { case 0: /* start of frame */ - frame = gspca_frame_add(gspca_dev, LAST_PACKET, frame, - data, 0); + if (gspca_dev->last_packet_type == FIRST_PACKET) { + yyuv_decode(sd->tmpbuf2, sd->tmpbuf, + gspca_dev->width, + gspca_dev->height); + frame = gspca_frame_add(gspca_dev, + LAST_PACKET, + frame, + sd->tmpbuf2, + gspca_dev->width + * gspca_dev->height + * 2); + } + gspca_frame_add(gspca_dev, FIRST_PACKET, frame, + data, 0); data += SPCA50X_OFFSET_DATA; len -= SPCA50X_OFFSET_DATA; - gspca_frame_add(gspca_dev, FIRST_PACKET, frame, - data, len); - break; + if (len > 0) + memcpy(sd->tmpbuf, data, len); + else + len = 0; + sd->buflen = len; + return; case 0xff: /* drop */ /* gspca_dev->last_packet_type = DISCARD_PACKET; */ - break; - default: - data += 1; - len -= 1; - gspca_frame_add(gspca_dev, FIRST_PACKET, frame, - data, len); - break; + return; } + data += 1; + len -= 1; + memcpy(&sd->tmpbuf[sd->buflen], data, len); + sd->buflen += len; } static void setbrightness(struct gspca_dev *gspca_dev) @@ -834,10 +910,10 @@ static const struct sd_desc sd_desc = { }; /* -- module initialisation -- */ +#define DVNM(name) .driver_info = (kernel_ulong_t) name static const __devinitdata struct usb_device_id device_table[] = { - {USB_DEVICE(0x041e, 0x401d), .driver_info = Nxultra}, - {USB_DEVICE(0x0733, 0x0430), .driver_info = IntelPCCameraPro}, -/*fixme: may be UsbGrabberPV321 BRIDGE_SPCA506 SENSOR_SAA7113 */ + {USB_DEVICE(0x041e, 0x401d), DVNM("Creative Webcam NX ULTRA")}, + {USB_DEVICE(0x0733, 0x0430), DVNM("Intel PC Camera Pro")}, {} }; MODULE_DEVICE_TABLE(usb, device_table); @@ -862,7 +938,7 @@ static int __init sd_mod_init(void) { if (usb_register(&sd_driver) < 0) return -1; - PDEBUG(D_PROBE, "registered"); + PDEBUG(D_PROBE, "v%s registered", version); return 0; } static void __exit sd_mod_exit(void) diff --git a/trunk/drivers/media/video/gspca/spca506.c b/trunk/drivers/media/video/gspca/spca506.c index 6fe715c80ad2..143203c1fd9f 100644 --- a/trunk/drivers/media/video/gspca/spca506.c +++ b/trunk/drivers/media/video/gspca/spca506.c @@ -25,6 +25,9 @@ #include "gspca.h" +#define DRIVER_VERSION_NUMBER KERNEL_VERSION(2, 1, 7) +static const char version[] = "2.1.7"; + MODULE_AUTHOR("Michel Xhaard "); MODULE_DESCRIPTION("GSPCA/SPCA506 USB Camera Driver"); MODULE_LICENSE("GPL"); @@ -33,6 +36,10 @@ MODULE_LICENSE("GPL"); struct sd { struct gspca_dev gspca_dev; /* !! must be the first item */ + int buflen; + __u8 tmpbuf[640 * 480 * 3]; /* YYUV per line */ + __u8 tmpbuf2[640 * 480 * 2]; /* YUYV */ + unsigned char brightness; unsigned char contrast; unsigned char colors; @@ -111,29 +118,29 @@ static struct ctrl sd_ctrls[] = { }; static struct v4l2_pix_format vga_mode[] = { - {160, 120, V4L2_PIX_FMT_SPCA505, V4L2_FIELD_NONE, - .bytesperline = 160 * 3, - .sizeimage = 160 * 120 * 3 / 2, + {160, 120, V4L2_PIX_FMT_YUYV, V4L2_FIELD_NONE, + .bytesperline = 160 * 2, + .sizeimage = 160 * 120 * 2, .colorspace = V4L2_COLORSPACE_SRGB, .priv = 5}, - {176, 144, V4L2_PIX_FMT_SPCA505, V4L2_FIELD_NONE, - .bytesperline = 176 * 3, - .sizeimage = 176 * 144 * 3 / 2, + {176, 144, V4L2_PIX_FMT_YUYV, V4L2_FIELD_NONE, + .bytesperline = 176 * 2, + .sizeimage = 176 * 144 * 2, .colorspace = V4L2_COLORSPACE_SRGB, .priv = 4}, - {320, 240, V4L2_PIX_FMT_SPCA505, V4L2_FIELD_NONE, - .bytesperline = 320 * 3, - .sizeimage = 320 * 240 * 3 / 2, + {320, 240, V4L2_PIX_FMT_YUYV, V4L2_FIELD_NONE, + .bytesperline = 320 * 2, + .sizeimage = 320 * 240 * 2, .colorspace = V4L2_COLORSPACE_SRGB, .priv = 2}, - {352, 288, V4L2_PIX_FMT_SPCA505, V4L2_FIELD_NONE, - .bytesperline = 352 * 3, - .sizeimage = 352 * 288 * 3 / 2, + {352, 288, V4L2_PIX_FMT_YUYV, V4L2_FIELD_NONE, + .bytesperline = 352 * 2, + .sizeimage = 352 * 288 * 2, .colorspace = V4L2_COLORSPACE_SRGB, .priv = 1}, - {640, 480, V4L2_PIX_FMT_SPCA505, V4L2_FIELD_NONE, - .bytesperline = 640 * 3, - .sizeimage = 640 * 480 * 3 / 2, + {640, 480, V4L2_PIX_FMT_YUYV, V4L2_FIELD_NONE, + .bytesperline = 640 * 2, + .sizeimage = 640 * 480 * 2, .colorspace = V4L2_COLORSPACE_SRGB, .priv = 0}, }; @@ -303,6 +310,7 @@ static int sd_config(struct gspca_dev *gspca_dev, struct cam *cam; cam = &gspca_dev->cam; + cam->dev_name = (char *) id->driver_info; cam->epaddr = 0x01; cam->cam_mode = vga_mode; cam->nmodes = sizeof vga_mode / sizeof vga_mode[0]; @@ -568,30 +576,77 @@ static void sd_close(struct gspca_dev *gspca_dev) { } +/* convert YYUV per line to YUYV (YUV 4:2:2) */ +static void yyuv_decode(unsigned char *out, + unsigned char *in, + int width, + int height) +{ + unsigned char *Ui, *Vi, *yi, *yi1; + unsigned char *out1; + int i, j; + + yi = in; + for (i = height / 2; --i >= 0; ) { + out1 = out + width * 2; /* next line */ + yi1 = yi + width; + Ui = yi1 + width; + Vi = Ui + width / 2; + for (j = width / 2; --j >= 0; ) { + *out++ = 128 + *yi++; + *out++ = 128 + *Ui; + *out++ = 128 + *yi++; + *out++ = 128 + *Vi; + + *out1++ = 128 + *yi1++; + *out1++ = 128 + *Ui++; + *out1++ = 128 + *yi1++; + *out1++ = 128 + *Vi++; + } + yi += width * 2; + out = out1; + } +} + static void sd_pkt_scan(struct gspca_dev *gspca_dev, struct gspca_frame *frame, /* target */ __u8 *data, /* isoc packet */ int len) /* iso packet length */ { + struct sd *sd = (struct sd *) gspca_dev; + switch (data[0]) { case 0: /* start of frame */ - frame = gspca_frame_add(gspca_dev, LAST_PACKET, frame, - data, 0); + if (gspca_dev->last_packet_type == FIRST_PACKET) { + yyuv_decode(sd->tmpbuf2, sd->tmpbuf, + gspca_dev->width, + gspca_dev->height); + frame = gspca_frame_add(gspca_dev, + LAST_PACKET, + frame, + sd->tmpbuf2, + gspca_dev->width + * gspca_dev->height + * 2); + } + gspca_frame_add(gspca_dev, FIRST_PACKET, frame, + data, 0); data += SPCA50X_OFFSET_DATA; len -= SPCA50X_OFFSET_DATA; - gspca_frame_add(gspca_dev, FIRST_PACKET, frame, - data, len); - break; + if (len > 0) + memcpy(sd->tmpbuf, data, len); + else + len = 0; + sd->buflen = len; + return; case 0xff: /* drop */ /* gspca_dev->last_packet_type = DISCARD_PACKET; */ - break; - default: - data += 1; - len -= 1; - gspca_frame_add(gspca_dev, FIRST_PACKET, frame, - data, len); - break; + return; } + data += 1; + len -= 1; + memcpy(&sd->tmpbuf[sd->buflen], data, len); + sd->buflen += len; } static void setbrightness(struct gspca_dev *gspca_dev) @@ -749,12 +804,12 @@ static struct sd_desc sd_desc = { }; /* -- module initialisation -- */ +#define DVNM(name) .driver_info = (kernel_ulong_t) name static __devinitdata struct usb_device_id device_table[] = { - {USB_DEVICE(0x06e1, 0xa190)}, -/*fixme: may be IntelPCCameraPro BRIDGE_SPCA505 - {USB_DEVICE(0x0733, 0x0430)}, */ - {USB_DEVICE(0x0734, 0x043b)}, - {USB_DEVICE(0x99fa, 0x8988)}, + {USB_DEVICE(0x06e1, 0xa190), DVNM("ADS Instant VCD")}, +/* {USB_DEVICE(0x0733, 0x0430), DVNM("UsbGrabber PV321c")}, */ + {USB_DEVICE(0x0734, 0x043b), DVNM("3DeMon USB Capture aka")}, + {USB_DEVICE(0x99fa, 0x8988), DVNM("Grandtec V.cap")}, {} }; MODULE_DEVICE_TABLE(usb, device_table); @@ -779,7 +834,7 @@ static int __init sd_mod_init(void) { if (usb_register(&sd_driver) < 0) return -1; - PDEBUG(D_PROBE, "registered"); + PDEBUG(D_PROBE, "v%s registered", version); return 0; } static void __exit sd_mod_exit(void) diff --git a/trunk/drivers/media/video/gspca/spca508.c b/trunk/drivers/media/video/gspca/spca508.c index b608a27ad115..d8cd93866a4a 100644 --- a/trunk/drivers/media/video/gspca/spca508.c +++ b/trunk/drivers/media/video/gspca/spca508.c @@ -22,6 +22,9 @@ #include "gspca.h" +#define DRIVER_VERSION_NUMBER KERNEL_VERSION(2, 1, 7) +static const char version[] = "2.1.7"; + MODULE_AUTHOR("Michel Xhaard "); MODULE_DESCRIPTION("GSPCA/SPCA508 USB Camera Driver"); MODULE_LICENSE("GPL"); @@ -30,6 +33,10 @@ MODULE_LICENSE("GPL"); struct sd { struct gspca_dev gspca_dev; /* !! must be the first item */ + int buflen; + unsigned char tmpbuf[352 * 288 * 3 / 2]; /* YUVY per line */ + unsigned char tmpbuf2[352 * 288 * 2]; /* YUYV */ + unsigned char brightness; char subtype; @@ -64,23 +71,23 @@ static struct ctrl sd_ctrls[] = { static struct v4l2_pix_format sif_mode[] = { {160, 120, V4L2_PIX_FMT_YUYV, V4L2_FIELD_NONE, - .bytesperline = 160 * 3, - .sizeimage = 160 * 120 * 3 / 2, + .bytesperline = 160 * 2, + .sizeimage = 160 * 120 * 2, .colorspace = V4L2_COLORSPACE_SRGB, .priv = 3}, {176, 144, V4L2_PIX_FMT_YUYV, V4L2_FIELD_NONE, - .bytesperline = 176 * 3, - .sizeimage = 176 * 144 * 3 / 2, + .bytesperline = 176 * 2, + .sizeimage = 176 * 144 * 2, .colorspace = V4L2_COLORSPACE_SRGB, .priv = 2}, {320, 240, V4L2_PIX_FMT_YUYV, V4L2_FIELD_NONE, - .bytesperline = 320 * 3, - .sizeimage = 320 * 240 * 3 / 2, + .bytesperline = 320 * 2, + .sizeimage = 320 * 240 * 2, .colorspace = V4L2_COLORSPACE_SRGB, .priv = 1}, {352, 288, V4L2_PIX_FMT_YUYV, V4L2_FIELD_NONE, - .bytesperline = 352 * 3, - .sizeimage = 352 * 288 * 3 / 2, + .bytesperline = 352 * 2, + .sizeimage = 352 * 288 * 2, .colorspace = V4L2_COLORSPACE_SRGB, .priv = 0}, }; @@ -1469,8 +1476,58 @@ static int sd_config(struct gspca_dev *gspca_dev, { struct sd *sd = (struct sd *) gspca_dev; struct cam *cam; + __u16 product; int data1, data2; + product = id->idProduct; + switch (id->idVendor) { + case 0x0130: /* Clone webcam */ +/* switch (product) { */ +/* case 0x0130: */ + sd->subtype = HamaUSBSightcam; /* same as Hama 0010 */ +/* break; */ +/* } */ + break; + case 0x041e: /* Creative cameras */ +/* switch (product) { */ +/* case 0x4018: */ + sd->subtype = CreativeVista; +/* break; */ +/* } */ + break; + case 0x0461: /* MicroInnovation */ +/* switch (product) { */ +/* case 0x0815: */ + sd->subtype = MicroInnovationIC200; +/* break; */ +/* } */ + break; + case 0x0733: /* Rebadged ViewQuest (Intel) and ViewQuest cameras */ +/* switch (product) { */ +/* case 0x110: */ + sd->subtype = ViewQuestVQ110; +/* break; */ +/* } */ + break; + case 0x0af9: /* Hama cameras */ + switch (product) { + case 0x0010: + sd->subtype = HamaUSBSightcam; + break; + case 0x0011: + sd->subtype = HamaUSBSightcam2; + break; + } + break; + case 0x8086: /* Intel */ +/* switch (product) { */ +/* case 0x0110: */ + sd->subtype = IntelEasyPCCamera; +/* break; */ +/* } */ + break; + } + /* Read from global register the USB product and vendor IDs, just to * prove that we can communicate with the device. This works, which * confirms at we are communicating properly and that the device @@ -1487,11 +1544,10 @@ static int sd_config(struct gspca_dev *gspca_dev, PDEBUG(D_PROBE, "Window 1 average luminance: %d", data1); cam = &gspca_dev->cam; + cam->dev_name = (char *) id->driver_info; cam->epaddr = 0x01; cam->cam_mode = sif_mode; cam->nmodes = ARRAY_SIZE(sif_mode); - - sd->subtype = id->driver_info; sd->brightness = BRIGHTNESS_DEF; switch (sd->subtype) { @@ -1563,30 +1619,77 @@ static void sd_close(struct gspca_dev *gspca_dev) { } +/* convert YUVY per line to YUYV (YUV 4:2:2) */ +static void yuvy_decode(unsigned char *out, + unsigned char *in, + int width, + int height) +{ + unsigned char *Ui, *Vi, *yi, *yi1; + unsigned char *out1; + int i, j; + + yi = in; + for (i = height / 2; --i >= 0; ) { + out1 = out + width * 2; /* next line */ + Ui = yi + width; + Vi = Ui + width / 2; + yi1 = Vi + width / 2; + for (j = width / 2; --j >= 0; ) { + *out++ = 128 + *yi++; + *out++ = 128 + *Ui; + *out++ = 128 + *yi++; + *out++ = 128 + *Vi; + + *out1++ = 128 + *yi1++; + *out1++ = 128 + *Ui++; + *out1++ = 128 + *yi1++; + *out1++ = 128 + *Vi++; + } + yi += width * 2; + out = out1; + } +} + static void sd_pkt_scan(struct gspca_dev *gspca_dev, struct gspca_frame *frame, /* target */ __u8 *data, /* isoc packet */ int len) /* iso packet length */ { + struct sd *sd = (struct sd *) gspca_dev; + switch (data[0]) { case 0: /* start of frame */ - frame = gspca_frame_add(gspca_dev, LAST_PACKET, frame, - data, 0); + if (gspca_dev->last_packet_type == FIRST_PACKET) { + yuvy_decode(sd->tmpbuf2, sd->tmpbuf, + gspca_dev->width, + gspca_dev->height); + frame = gspca_frame_add(gspca_dev, + LAST_PACKET, + frame, + sd->tmpbuf2, + gspca_dev->width + * gspca_dev->height + * 2); + } + gspca_frame_add(gspca_dev, FIRST_PACKET, frame, + data, 0); data += SPCA508_OFFSET_DATA; len -= SPCA508_OFFSET_DATA; - gspca_frame_add(gspca_dev, FIRST_PACKET, frame, - data, len); - break; + if (len > 0) + memcpy(sd->tmpbuf, data, len); + else + len = 0; + sd->buflen = len; + return; case 0xff: /* drop */ /* gspca_dev->last_packet_type = DISCARD_PACKET; */ - break; - default: - data += 1; - len -= 1; - gspca_frame_add(gspca_dev, FIRST_PACKET, frame, - data, len); - break; + return; } + data += 1; + len -= 1; + memcpy(&sd->tmpbuf[sd->buflen], data, len); + sd->buflen += len; } static void setbrightness(struct gspca_dev *gspca_dev) @@ -1642,14 +1745,15 @@ static const struct sd_desc sd_desc = { }; /* -- module initialisation -- */ +#define DVNM(name) .driver_info = (kernel_ulong_t) name static const __devinitdata struct usb_device_id device_table[] = { - {USB_DEVICE(0x0130, 0x0130), .driver_info = HamaUSBSightcam}, - {USB_DEVICE(0x041e, 0x4018), .driver_info = CreativeVista}, - {USB_DEVICE(0x0461, 0x0815), .driver_info = MicroInnovationIC200}, - {USB_DEVICE(0x0733, 0x0110), .driver_info = ViewQuestVQ110}, - {USB_DEVICE(0x0af9, 0x0010), .driver_info = HamaUSBSightcam}, - {USB_DEVICE(0x0af9, 0x0011), .driver_info = HamaUSBSightcam2}, - {USB_DEVICE(0x8086, 0x0110), .driver_info = IntelEasyPCCamera}, + {USB_DEVICE(0x0130, 0x0130), DVNM("Clone Digital Webcam 11043")}, + {USB_DEVICE(0x041e, 0x4018), DVNM("Creative Webcam Vista (PD1100)")}, + {USB_DEVICE(0x0461, 0x0815), DVNM("Micro Innovation IC200")}, + {USB_DEVICE(0x0733, 0x0110), DVNM("ViewQuest VQ110")}, + {USB_DEVICE(0x0af9, 0x0010), DVNM("Hama USB Sightcam 100")}, + {USB_DEVICE(0x0af9, 0x0011), DVNM("Hama USB Sightcam 100")}, + {USB_DEVICE(0x8086, 0x0110), DVNM("Intel Easy PC Camera")}, {} }; MODULE_DEVICE_TABLE(usb, device_table); @@ -1674,7 +1778,7 @@ static int __init sd_mod_init(void) { if (usb_register(&sd_driver) < 0) return -1; - PDEBUG(D_PROBE, "registered"); + PDEBUG(D_PROBE, "v%s registered", version); return 0; } static void __exit sd_mod_exit(void) diff --git a/trunk/drivers/media/video/gspca/spca561.c b/trunk/drivers/media/video/gspca/spca561.c index a26174508cb9..b659bd0f788d 100644 --- a/trunk/drivers/media/video/gspca/spca561.c +++ b/trunk/drivers/media/video/gspca/spca561.c @@ -24,6 +24,9 @@ #include "gspca.h" +#define DRIVER_VERSION_NUMBER KERNEL_VERSION(2, 1, 7) +static const char version[] = "2.1.7"; + MODULE_AUTHOR("Michel Xhaard "); MODULE_DESCRIPTION("GSPCA/SPCA561 USB Camera Driver"); MODULE_LICENSE("GPL"); @@ -579,15 +582,35 @@ static int sd_config(struct gspca_dev *gspca_dev, PDEBUG(D_PROBE, "Bad vendor / product from device"); return -EINVAL; } - + switch (product) { + case 0x0928: + case 0x0929: + case 0x092a: + case 0x092b: + case 0x092c: + case 0x092d: + case 0x092e: + case 0x092f: + case 0x403b: + sd->chip_revision = Rev012A; + break; + default: +/* case 0x0561: + case 0x0815: * ?? in spca508.c + case 0x401a: + case 0x7004: + case 0x7e50: + case 0xa001: + case 0xcdee: */ + sd->chip_revision = Rev072A; + break; + } cam = &gspca_dev->cam; cam->dev_name = (char *) id->driver_info; cam->epaddr = 0x01; gspca_dev->nbalt = 7 + 1; /* choose alternate 7 first */ cam->cam_mode = sif_mode; cam->nmodes = sizeof sif_mode / sizeof sif_mode[0]; - - sd->chip_revision = id->driver_info; sd->brightness = sd_ctrls[SD_BRIGHTNESS].qctrl.default_value; sd->contrast = sd_ctrls[SD_CONTRAST].qctrl.default_value; sd->autogain = sd_ctrls[SD_AUTOGAIN].qctrl.default_value; @@ -974,22 +997,23 @@ static const struct sd_desc sd_desc = { }; /* -- module initialisation -- */ +#define DVNM(name) .driver_info = (kernel_ulong_t) name static const __devinitdata struct usb_device_id device_table[] = { - {USB_DEVICE(0x041e, 0x401a), .driver_info = Rev072A}, - {USB_DEVICE(0x041e, 0x403b), .driver_info = Rev012A}, - {USB_DEVICE(0x0458, 0x7004), .driver_info = Rev072A}, - {USB_DEVICE(0x046d, 0x0928), .driver_info = Rev012A}, - {USB_DEVICE(0x046d, 0x0929), .driver_info = Rev012A}, - {USB_DEVICE(0x046d, 0x092a), .driver_info = Rev012A}, - {USB_DEVICE(0x046d, 0x092b), .driver_info = Rev012A}, - {USB_DEVICE(0x046d, 0x092c), .driver_info = Rev012A}, - {USB_DEVICE(0x046d, 0x092d), .driver_info = Rev012A}, - {USB_DEVICE(0x046d, 0x092e), .driver_info = Rev012A}, - {USB_DEVICE(0x046d, 0x092f), .driver_info = Rev012A}, - {USB_DEVICE(0x04fc, 0x0561), .driver_info = Rev072A}, - {USB_DEVICE(0x060b, 0xa001), .driver_info = Rev072A}, - {USB_DEVICE(0x10fd, 0x7e50), .driver_info = Rev072A}, - {USB_DEVICE(0xabcd, 0xcdee), .driver_info = Rev072A}, + {USB_DEVICE(0x041e, 0x401a), DVNM("Creative Webcam Vista (PD1100)")}, + {USB_DEVICE(0x041e, 0x403b), DVNM("Creative Webcam Vista (VF0010)")}, + {USB_DEVICE(0x0458, 0x7004), DVNM("Genius VideoCAM Express V2")}, + {USB_DEVICE(0x046d, 0x0928), DVNM("Logitech QC Express Etch2")}, + {USB_DEVICE(0x046d, 0x0929), DVNM("Labtec Webcam Elch2")}, + {USB_DEVICE(0x046d, 0x092a), DVNM("Logitech QC for Notebook")}, + {USB_DEVICE(0x046d, 0x092b), DVNM("Labtec Webcam Plus")}, + {USB_DEVICE(0x046d, 0x092c), DVNM("Logitech QC chat Elch2")}, + {USB_DEVICE(0x046d, 0x092d), DVNM("Logitech QC Elch2")}, + {USB_DEVICE(0x046d, 0x092e), DVNM("Logitech QC Elch2")}, + {USB_DEVICE(0x046d, 0x092f), DVNM("Logitech QC Elch2")}, + {USB_DEVICE(0x04fc, 0x0561), DVNM("Flexcam 100")}, + {USB_DEVICE(0x060b, 0xa001), DVNM("Maxell Compact Pc PM3")}, + {USB_DEVICE(0x10fd, 0x7e50), DVNM("FlyCam Usb 100")}, + {USB_DEVICE(0xabcd, 0xcdee), DVNM("Petcam")}, {} }; @@ -1015,7 +1039,7 @@ static int __init sd_mod_init(void) { if (usb_register(&sd_driver) < 0) return -1; - PDEBUG(D_PROBE, "registered"); + PDEBUG(D_PROBE, "v%s registered", version); return 0; } static void __exit sd_mod_exit(void) diff --git a/trunk/drivers/media/video/gspca/stk014.c b/trunk/drivers/media/video/gspca/stk014.c index 16219cf6a6d5..c78ee0d3e59b 100644 --- a/trunk/drivers/media/video/gspca/stk014.c +++ b/trunk/drivers/media/video/gspca/stk014.c @@ -23,6 +23,9 @@ #include "gspca.h" #include "jpeg.h" +#define DRIVER_VERSION_NUMBER KERNEL_VERSION(2, 1, 7) +static const char version[] = "2.1.7"; + MODULE_AUTHOR("Jean-Francois Moine "); MODULE_DESCRIPTION("Syntek DV4000 (STK014) USB Camera Driver"); MODULE_LICENSE("GPL"); @@ -296,6 +299,7 @@ static int sd_config(struct gspca_dev *gspca_dev, struct sd *sd = (struct sd *) gspca_dev; struct cam *cam = &gspca_dev->cam; + cam->dev_name = (char *) id->driver_info; cam->epaddr = 0x02; gspca_dev->cam.cam_mode = vga_mode; gspca_dev->cam.nmodes = ARRAY_SIZE(vga_mode); @@ -545,8 +549,9 @@ static const struct sd_desc sd_desc = { }; /* -- module initialisation -- */ +#define DVNM(name) .driver_info = (kernel_ulong_t) name static const __devinitdata struct usb_device_id device_table[] = { - {USB_DEVICE(0x05e1, 0x0893)}, + {USB_DEVICE(0x05e1, 0x0893), DVNM("Syntek DV4000")}, {} }; MODULE_DEVICE_TABLE(usb, device_table); @@ -571,7 +576,7 @@ static int __init sd_mod_init(void) { if (usb_register(&sd_driver) < 0) return -1; - info("registered"); + info("v%s registered", version); return 0; } static void __exit sd_mod_exit(void) diff --git a/trunk/drivers/media/video/gspca/sunplus.c b/trunk/drivers/media/video/gspca/sunplus.c index 54efa48bee01..abd7bef9b3d1 100644 --- a/trunk/drivers/media/video/gspca/sunplus.c +++ b/trunk/drivers/media/video/gspca/sunplus.c @@ -24,6 +24,9 @@ #include "gspca.h" #include "jpeg.h" +#define DRIVER_VERSION_NUMBER KERNEL_VERSION(2, 1, 8) +static const char version[] = "2.1.8"; + MODULE_AUTHOR("Michel Xhaard "); MODULE_DESCRIPTION("GSPCA/SPCA5xx USB Camera Driver"); MODULE_LICENSE("GPL"); @@ -801,29 +804,229 @@ static int sd_config(struct gspca_dev *gspca_dev, struct sd *sd = (struct sd *) gspca_dev; struct usb_device *dev = gspca_dev->dev; struct cam *cam; - - cam = &gspca_dev->cam; - cam->epaddr = 0x01; - - sd->bridge = id->driver_info >> 8; - sd->subtype = id->driver_info; - - if (sd->subtype == AiptekMiniPenCam13) { + __u16 vendor; + __u16 product; + __u8 fw; + + vendor = id->idVendor; + product = id->idProduct; + switch (vendor) { + case 0x041e: /* Creative cameras */ +/* switch (product) { */ +/* case 0x400b: */ +/* case 0x4012: */ +/* case 0x4013: */ +/* sd->bridge = BRIDGE_SPCA504C; */ +/* break; */ +/* } */ + break; + case 0x0458: /* Genius KYE cameras */ +/* switch (product) { */ +/* case 0x7006: */ + sd->bridge = BRIDGE_SPCA504B; +/* break; */ +/* } */ + break; + case 0x0461: /* MicroInnovation */ +/* switch (product) { */ +/* case 0x0821: */ + sd->bridge = BRIDGE_SPCA533; +/* break; */ +/* } */ + break; + case 0x046d: /* Logitech Labtec */ + switch (product) { + case 0x0905: + sd->subtype = LogitechClickSmart820; + sd->bridge = BRIDGE_SPCA533; + break; + case 0x0960: + sd->subtype = LogitechClickSmart420; + sd->bridge = BRIDGE_SPCA504C; + break; + } + break; + case 0x0471: /* Philips */ +/* switch (product) { */ +/* case 0x0322: */ + sd->bridge = BRIDGE_SPCA504B; +/* break; */ +/* } */ + break; + case 0x04a5: /* Benq */ + switch (product) { + case 0x3003: + sd->bridge = BRIDGE_SPCA504B; + break; + case 0x3008: + case 0x300a: + sd->bridge = BRIDGE_SPCA533; + break; + } + break; + case 0x04f1: /* JVC */ +/* switch (product) { */ +/* case 0x1001: */ + sd->bridge = BRIDGE_SPCA504B; +/* break; */ +/* } */ + break; + case 0x04fc: /* SunPlus */ + switch (product) { + case 0x500c: + sd->bridge = BRIDGE_SPCA504B; + break; + case 0x504a: /* try to get the firmware as some cam answer 2.0.1.2.2 * and should be a spca504b then overwrite that setting */ - reg_r(dev, 0x20, 0, gspca_dev->usb_buf, 1); - switch (gspca_dev->usb_buf[0]) { - case 1: - break; /* (right bridge/subtype) */ - case 2: + reg_r(dev, 0x20, 0, gspca_dev->usb_buf, 1); + fw = gspca_dev->usb_buf[0]; + if (fw == 1) { + sd->subtype = AiptekMiniPenCam13; + sd->bridge = BRIDGE_SPCA504; + } else if (fw == 2) { + sd->bridge = BRIDGE_SPCA504B; + } else + return -ENODEV; + break; + case 0x504b: sd->bridge = BRIDGE_SPCA504B; - sd->subtype = 0; break; - default: - return -ENODEV; + case 0x5330: + sd->bridge = BRIDGE_SPCA533; + break; + case 0x5360: + sd->bridge = BRIDGE_SPCA536; + break; + case 0xffff: + sd->bridge = BRIDGE_SPCA504B; + break; + } + break; + case 0x052b: /* ?? Megapix */ +/* switch (product) { */ +/* case 0x1513: */ + sd->subtype = MegapixV4; + sd->bridge = BRIDGE_SPCA533; +/* break; */ +/* } */ + break; + case 0x0546: /* Polaroid */ + switch (product) { + case 0x3155: + sd->bridge = BRIDGE_SPCA533; + break; + case 0x3191: + case 0x3273: + sd->bridge = BRIDGE_SPCA504B; + break; + } + break; + case 0x055f: /* Mustek cameras */ + switch (product) { + case 0xc211: + sd->bridge = BRIDGE_SPCA536; + break; + case 0xc230: + case 0xc232: + sd->bridge = BRIDGE_SPCA533; + break; + case 0xc360: + sd->bridge = BRIDGE_SPCA536; + break; + case 0xc420: + sd->bridge = BRIDGE_SPCA504; + break; + case 0xc430: + case 0xc440: + sd->bridge = BRIDGE_SPCA533; + break; + case 0xc520: + sd->bridge = BRIDGE_SPCA504; + break; + case 0xc530: + case 0xc540: + case 0xc630: + case 0xc650: + sd->bridge = BRIDGE_SPCA533; + break; + } + break; + case 0x05da: /* Digital Dream cameras */ +/* switch (product) { */ +/* case 0x1018: */ + sd->bridge = BRIDGE_SPCA504B; +/* break; */ +/* } */ + break; + case 0x06d6: /* Trust */ +/* switch (product) { */ +/* case 0x0031: */ + sd->bridge = BRIDGE_SPCA533; /* SPCA533A */ +/* break; */ +/* } */ + break; + case 0x0733: /* Rebadged ViewQuest (Intel) and ViewQuest cameras */ + switch (product) { + case 0x1311: + case 0x1314: + case 0x2211: + case 0x2221: + sd->bridge = BRIDGE_SPCA533; + break; + case 0x3261: + case 0x3281: + sd->bridge = BRIDGE_SPCA536; + break; } + break; + case 0x08ca: /* Aiptek */ + switch (product) { + case 0x0104: + case 0x0106: + sd->bridge = BRIDGE_SPCA533; + break; + case 0x2008: + sd->bridge = BRIDGE_SPCA504B; + break; + case 0x2010: + sd->bridge = BRIDGE_SPCA533; + break; + case 0x2016: + case 0x2018: + sd->bridge = BRIDGE_SPCA504B; + break; + case 0x2020: + case 0x2022: + sd->bridge = BRIDGE_SPCA533; + break; + case 0x2024: + sd->bridge = BRIDGE_SPCA536; + break; + case 0x2028: + sd->bridge = BRIDGE_SPCA533; + break; + case 0x2040: + case 0x2042: + case 0x2050: + case 0x2060: + sd->bridge = BRIDGE_SPCA536; + break; + } + break; + case 0x0d64: /* SunPlus */ +/* switch (product) { */ +/* case 0x0303: */ + sd->bridge = BRIDGE_SPCA536; +/* break; */ +/* } */ + break; } + cam = &gspca_dev->cam; + cam->dev_name = (char *) id->driver_info; + cam->epaddr = 0x01; + switch (sd->bridge) { default: /* case BRIDGE_SPCA504B: */ @@ -1378,67 +1581,65 @@ static const struct sd_desc sd_desc = { }; /* -- module initialisation -- */ -#define BS(bridge, subtype) \ - .driver_info = (BRIDGE_ ## bridge << 8) \ - | (subtype) +#define DVNM(name) .driver_info = (kernel_ulong_t) name static const __devinitdata struct usb_device_id device_table[] = { - {USB_DEVICE(0x041e, 0x400b), BS(SPCA504C, 0)}, - {USB_DEVICE(0x041e, 0x4012), BS(SPCA504C, 0)}, - {USB_DEVICE(0x041e, 0x4013), BS(SPCA504C, 0)}, - {USB_DEVICE(0x0458, 0x7006), BS(SPCA504B, 0)}, - {USB_DEVICE(0x0461, 0x0821), BS(SPCA533, 0)}, - {USB_DEVICE(0x046d, 0x0905), BS(SPCA533, LogitechClickSmart820)}, - {USB_DEVICE(0x046d, 0x0960), BS(SPCA504C, LogitechClickSmart420)}, - {USB_DEVICE(0x0471, 0x0322), BS(SPCA504B, 0)}, - {USB_DEVICE(0x04a5, 0x3003), BS(SPCA504B, 0)}, - {USB_DEVICE(0x04a5, 0x3008), BS(SPCA533, 0)}, - {USB_DEVICE(0x04a5, 0x300a), BS(SPCA533, 0)}, - {USB_DEVICE(0x04f1, 0x1001), BS(SPCA504B, 0)}, - {USB_DEVICE(0x04fc, 0x500c), BS(SPCA504B, 0)}, - {USB_DEVICE(0x04fc, 0x504a), BS(SPCA504, AiptekMiniPenCam13)}, - {USB_DEVICE(0x04fc, 0x504b), BS(SPCA504B, 0)}, - {USB_DEVICE(0x04fc, 0x5330), BS(SPCA533, 0)}, - {USB_DEVICE(0x04fc, 0x5360), BS(SPCA536, 0)}, - {USB_DEVICE(0x04fc, 0xffff), BS(SPCA504B, 0)}, - {USB_DEVICE(0x052b, 0x1513), BS(SPCA533, MegapixV4)}, - {USB_DEVICE(0x0546, 0x3155), BS(SPCA533, 0)}, - {USB_DEVICE(0x0546, 0x3191), BS(SPCA504B, 0)}, - {USB_DEVICE(0x0546, 0x3273), BS(SPCA504B, 0)}, - {USB_DEVICE(0x055f, 0xc211), BS(SPCA536, 0)}, - {USB_DEVICE(0x055f, 0xc230), BS(SPCA533, 0)}, - {USB_DEVICE(0x055f, 0xc232), BS(SPCA533, 0)}, - {USB_DEVICE(0x055f, 0xc360), BS(SPCA536, 0)}, - {USB_DEVICE(0x055f, 0xc420), BS(SPCA504, 0)}, - {USB_DEVICE(0x055f, 0xc430), BS(SPCA533, 0)}, - {USB_DEVICE(0x055f, 0xc440), BS(SPCA533, 0)}, - {USB_DEVICE(0x055f, 0xc520), BS(SPCA504, 0)}, - {USB_DEVICE(0x055f, 0xc530), BS(SPCA533, 0)}, - {USB_DEVICE(0x055f, 0xc540), BS(SPCA533, 0)}, - {USB_DEVICE(0x055f, 0xc630), BS(SPCA533, 0)}, - {USB_DEVICE(0x055f, 0xc650), BS(SPCA533, 0)}, - {USB_DEVICE(0x05da, 0x1018), BS(SPCA504B, 0)}, - {USB_DEVICE(0x06d6, 0x0031), BS(SPCA533, 0)}, - {USB_DEVICE(0x0733, 0x1311), BS(SPCA533, 0)}, - {USB_DEVICE(0x0733, 0x1314), BS(SPCA533, 0)}, - {USB_DEVICE(0x0733, 0x2211), BS(SPCA533, 0)}, - {USB_DEVICE(0x0733, 0x2221), BS(SPCA533, 0)}, - {USB_DEVICE(0x0733, 0x3261), BS(SPCA536, 0)}, - {USB_DEVICE(0x0733, 0x3281), BS(SPCA536, 0)}, - {USB_DEVICE(0x08ca, 0x0104), BS(SPCA533, 0)}, - {USB_DEVICE(0x08ca, 0x0106), BS(SPCA533, 0)}, - {USB_DEVICE(0x08ca, 0x2008), BS(SPCA504B, 0)}, - {USB_DEVICE(0x08ca, 0x2010), BS(SPCA533, 0)}, - {USB_DEVICE(0x08ca, 0x2016), BS(SPCA504B, 0)}, - {USB_DEVICE(0x08ca, 0x2018), BS(SPCA504B, 0)}, - {USB_DEVICE(0x08ca, 0x2020), BS(SPCA533, 0)}, - {USB_DEVICE(0x08ca, 0x2022), BS(SPCA533, 0)}, - {USB_DEVICE(0x08ca, 0x2024), BS(SPCA536, 0)}, - {USB_DEVICE(0x08ca, 0x2028), BS(SPCA533, 0)}, - {USB_DEVICE(0x08ca, 0x2040), BS(SPCA536, 0)}, - {USB_DEVICE(0x08ca, 0x2042), BS(SPCA536, 0)}, - {USB_DEVICE(0x08ca, 0x2050), BS(SPCA536, 0)}, - {USB_DEVICE(0x08ca, 0x2060), BS(SPCA536, 0)}, - {USB_DEVICE(0x0d64, 0x0303), BS(SPCA536, 0)}, + {USB_DEVICE(0x041e, 0x400b), DVNM("Creative PC-CAM 600")}, + {USB_DEVICE(0x041e, 0x4012), DVNM("PC-Cam350")}, + {USB_DEVICE(0x041e, 0x4013), DVNM("Creative Pccam750")}, + {USB_DEVICE(0x0458, 0x7006), DVNM("Genius Dsc 1.3 Smart")}, + {USB_DEVICE(0x0461, 0x0821), DVNM("Fujifilm MV-1")}, + {USB_DEVICE(0x046d, 0x0905), DVNM("Logitech ClickSmart 820")}, + {USB_DEVICE(0x046d, 0x0960), DVNM("Logitech ClickSmart 420")}, + {USB_DEVICE(0x0471, 0x0322), DVNM("Philips DMVC1300K")}, + {USB_DEVICE(0x04a5, 0x3003), DVNM("Benq DC 1300")}, + {USB_DEVICE(0x04a5, 0x3008), DVNM("Benq DC 1500")}, + {USB_DEVICE(0x04a5, 0x300a), DVNM("Benq DC3410")}, + {USB_DEVICE(0x04f1, 0x1001), DVNM("JVC GC A50")}, + {USB_DEVICE(0x04fc, 0x500c), DVNM("Sunplus CA500C")}, + {USB_DEVICE(0x04fc, 0x504a), DVNM("Aiptek Mini PenCam 1.3")}, + {USB_DEVICE(0x04fc, 0x504b), DVNM("Maxell MaxPocket LE 1.3")}, + {USB_DEVICE(0x04fc, 0x5330), DVNM("Digitrex 2110")}, + {USB_DEVICE(0x04fc, 0x5360), DVNM("Sunplus Generic")}, + {USB_DEVICE(0x04fc, 0xffff), DVNM("Pure DigitalDakota")}, + {USB_DEVICE(0x052b, 0x1513), DVNM("Megapix V4")}, + {USB_DEVICE(0x0546, 0x3155), DVNM("Polaroid PDC3070")}, + {USB_DEVICE(0x0546, 0x3191), DVNM("Polaroid Ion 80")}, + {USB_DEVICE(0x0546, 0x3273), DVNM("Polaroid PDC2030")}, + {USB_DEVICE(0x055f, 0xc211), DVNM("Kowa Bs888e Microcamera")}, + {USB_DEVICE(0x055f, 0xc230), DVNM("Mustek Digicam 330K")}, + {USB_DEVICE(0x055f, 0xc232), DVNM("Mustek MDC3500")}, + {USB_DEVICE(0x055f, 0xc360), DVNM("Mustek DV4000 Mpeg4 ")}, + {USB_DEVICE(0x055f, 0xc420), DVNM("Mustek gSmart Mini 2")}, + {USB_DEVICE(0x055f, 0xc430), DVNM("Mustek Gsmart LCD 2")}, + {USB_DEVICE(0x055f, 0xc440), DVNM("Mustek DV 3000")}, + {USB_DEVICE(0x055f, 0xc520), DVNM("Mustek gSmart Mini 3")}, + {USB_DEVICE(0x055f, 0xc530), DVNM("Mustek Gsmart LCD 3")}, + {USB_DEVICE(0x055f, 0xc540), DVNM("Gsmart D30")}, + {USB_DEVICE(0x055f, 0xc630), DVNM("Mustek MDC4000")}, + {USB_DEVICE(0x055f, 0xc650), DVNM("Mustek MDC5500Z")}, + {USB_DEVICE(0x05da, 0x1018), DVNM("Digital Dream Enigma 1.3")}, + {USB_DEVICE(0x06d6, 0x0031), DVNM("Trust 610 LCD PowerC@m Zoom")}, + {USB_DEVICE(0x0733, 0x1311), DVNM("Digital Dream Epsilon 1.3")}, + {USB_DEVICE(0x0733, 0x1314), DVNM("Mercury 2.1MEG Deluxe Classic Cam")}, + {USB_DEVICE(0x0733, 0x2211), DVNM("Jenoptik jdc 21 LCD")}, + {USB_DEVICE(0x0733, 0x2221), DVNM("Mercury Digital Pro 3.1p")}, + {USB_DEVICE(0x0733, 0x3261), DVNM("Concord 3045 spca536a")}, + {USB_DEVICE(0x0733, 0x3281), DVNM("Cyberpix S550V")}, + {USB_DEVICE(0x08ca, 0x0104), DVNM("Aiptek PocketDVII 1.3")}, + {USB_DEVICE(0x08ca, 0x0106), DVNM("Aiptek Pocket DV3100+")}, + {USB_DEVICE(0x08ca, 0x2008), DVNM("Aiptek Mini PenCam 2 M")}, + {USB_DEVICE(0x08ca, 0x2010), DVNM("Aiptek PocketCam 3M")}, + {USB_DEVICE(0x08ca, 0x2016), DVNM("Aiptek PocketCam 2 Mega")}, + {USB_DEVICE(0x08ca, 0x2018), DVNM("Aiptek Pencam SD 2M")}, + {USB_DEVICE(0x08ca, 0x2020), DVNM("Aiptek Slim 3000F")}, + {USB_DEVICE(0x08ca, 0x2022), DVNM("Aiptek Slim 3200")}, + {USB_DEVICE(0x08ca, 0x2024), DVNM("Aiptek DV3500 Mpeg4 ")}, + {USB_DEVICE(0x08ca, 0x2028), DVNM("Aiptek PocketCam4M")}, + {USB_DEVICE(0x08ca, 0x2040), DVNM("Aiptek PocketDV4100M")}, + {USB_DEVICE(0x08ca, 0x2042), DVNM("Aiptek PocketDV5100")}, + {USB_DEVICE(0x08ca, 0x2050), DVNM("Medion MD 41437")}, + {USB_DEVICE(0x08ca, 0x2060), DVNM("Aiptek PocketDV5300")}, + {USB_DEVICE(0x0d64, 0x0303), DVNM("Sunplus FashionCam DXG")}, {} }; MODULE_DEVICE_TABLE(usb, device_table); @@ -1463,7 +1664,7 @@ static int __init sd_mod_init(void) { if (usb_register(&sd_driver) < 0) return -1; - PDEBUG(D_PROBE, "registered"); + PDEBUG(D_PROBE, "v%s registered", version); return 0; } static void __exit sd_mod_exit(void) diff --git a/trunk/drivers/media/video/gspca/t613.c b/trunk/drivers/media/video/gspca/t613.c index 91b555c34c68..00f47e463a05 100644 --- a/trunk/drivers/media/video/gspca/t613.c +++ b/trunk/drivers/media/video/gspca/t613.c @@ -1,4 +1,12 @@ /* + *Notes: * t613 + tas5130A + * * Focus to light do not balance well as in win. + * Quality in win is not good, but its kinda better. + * * Fix some "extraneous bytes", most of apps will show the image anyway + * * Gamma table, is there, but its really doing something? + * * 7~8 Fps, its ok, max on win its 10. + * Costantino Leandro + * * V4L2 by Jean-Francois Moine * * This program is free software; you can redistribute it and/or modify @@ -14,22 +22,16 @@ * You should have received a copy of the GNU 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 - * - *Notes: * t613 + tas5130A - * * Focus to light do not balance well as in win. - * Quality in win is not good, but its kinda better. - * * Fix some "extraneous bytes", most of apps will show the image anyway - * * Gamma table, is there, but its really doing something? - * * 7~8 Fps, its ok, max on win its 10. - * Costantino Leandro */ #define MODULE_NAME "t613" - #include "gspca.h" +#define DRIVER_VERSION_NUMBER KERNEL_VERSION(2, 1, 7) +static const char version[] = "2.1.7"; #define MAX_GAMMA 0x10 /* 0 to 15 */ +/* From LUVCVIEW */ #define V4L2_CID_EFFECTS (V4L2_CID_PRIVATE_BASE + 3) MODULE_AUTHOR("Leandro Costantino "); @@ -422,6 +424,7 @@ static int sd_config(struct gspca_dev *gspca_dev, struct cam *cam; cam = &gspca_dev->cam; + cam->dev_name = (char *) id->driver_info; cam->epaddr = 0x01; cam->cam_mode = vga_mode_t16; @@ -995,8 +998,9 @@ static const struct sd_desc sd_desc = { }; /* -- module initialisation -- */ +#define DVNM(name) .driver_info = (kernel_ulong_t) name static const __devinitdata struct usb_device_id device_table[] = { - {USB_DEVICE(0x17a1, 0x0128)}, + {USB_DEVICE(0x17a1, 0x0128), DVNM("XPX Webcam")}, {} }; MODULE_DEVICE_TABLE(usb, device_table); @@ -1021,7 +1025,7 @@ static int __init sd_mod_init(void) { if (usb_register(&sd_driver) < 0) return -1; - PDEBUG(D_PROBE, "registered"); + PDEBUG(D_PROBE, "v%s registered", version); return 0; } static void __exit sd_mod_exit(void) diff --git a/trunk/drivers/media/video/gspca/tv8532.c b/trunk/drivers/media/video/gspca/tv8532.c index 1ff8ba2f7fe5..0b793899095f 100644 --- a/trunk/drivers/media/video/gspca/tv8532.c +++ b/trunk/drivers/media/video/gspca/tv8532.c @@ -22,6 +22,9 @@ #include "gspca.h" +#define DRIVER_VERSION_NUMBER KERNEL_VERSION(2, 1, 7) +static const char version[] = "2.1.7"; + MODULE_AUTHOR("Michel Xhaard "); MODULE_DESCRIPTION("TV8532 USB Camera Driver"); MODULE_LICENSE("GPL"); @@ -246,6 +249,7 @@ static int sd_config(struct gspca_dev *gspca_dev, tv_8532WriteEEprom(gspca_dev); cam = &gspca_dev->cam; + cam->dev_name = (char *) id->driver_info; cam->epaddr = 1; cam->cam_mode = sif_mode; cam->nmodes = sizeof sif_mode / sizeof sif_mode[0]; @@ -620,12 +624,13 @@ static const struct sd_desc sd_desc = { }; /* -- module initialisation -- */ +#define DVNM(name) .driver_info = (kernel_ulong_t) name static const __devinitdata struct usb_device_id device_table[] = { - {USB_DEVICE(0x046d, 0x0920)}, - {USB_DEVICE(0x046d, 0x0921)}, - {USB_DEVICE(0x0545, 0x808b)}, - {USB_DEVICE(0x0545, 0x8333)}, - {USB_DEVICE(0x0923, 0x010f)}, + {USB_DEVICE(0x046d, 0x0920), DVNM("QC Express")}, + {USB_DEVICE(0x046d, 0x0921), DVNM("Labtec Webcam")}, + {USB_DEVICE(0x0545, 0x808b), DVNM("Veo Stingray")}, + {USB_DEVICE(0x0545, 0x8333), DVNM("Veo Stingray")}, + {USB_DEVICE(0x0923, 0x010f), DVNM("ICM532 cams")}, {} }; @@ -651,7 +656,7 @@ static int __init sd_mod_init(void) { if (usb_register(&sd_driver) < 0) return -1; - PDEBUG(D_PROBE, "registered"); + PDEBUG(D_PROBE, "v%s registered", version); return 0; } diff --git a/trunk/drivers/media/video/gspca/vc032x.c b/trunk/drivers/media/video/gspca/vc032x.c index a4221753e1bf..fcf2c9e32573 100644 --- a/trunk/drivers/media/video/gspca/vc032x.c +++ b/trunk/drivers/media/video/gspca/vc032x.c @@ -24,6 +24,9 @@ #include "gspca.h" +#define DRIVER_VERSION_NUMBER KERNEL_VERSION(2, 1, 7) +static const char version[] = "2.1.7"; + MODULE_AUTHOR("Michel Xhaard "); MODULE_DESCRIPTION("GSPCA/VC032X USB Camera Driver"); MODULE_LICENSE("GPL"); @@ -1416,10 +1419,30 @@ static int sd_config(struct gspca_dev *gspca_dev, struct usb_device *dev = gspca_dev->dev; struct cam *cam; int sensor; + __u16 product; + + product = id->idProduct; + sd->bridge = BRIDGE_VC0321; + switch (id->idVendor) { + case 0x0ac8: /* Vimicro z-star */ + switch (product) { + case 0x0323: + sd->bridge = BRIDGE_VC0323; + break; + } + break; + case 0x17ef: /* Lenovo */ +/* switch (product) { */ +/* case 0x4802: * Lenovo MI1310_SOC */ + sd->bridge = BRIDGE_VC0323; +/* break; */ +/* } */ + break; + } cam = &gspca_dev->cam; + cam->dev_name = (char *) id->driver_info; cam->epaddr = 0x02; - sd->bridge = id->driver_info; if (sd->bridge == BRIDGE_VC0321) { cam->cam_mode = vc0321_mode; cam->nmodes = ARRAY_SIZE(vc0321_mode); @@ -1748,15 +1771,16 @@ static const struct sd_desc sd_desc = { }; /* -- module initialisation -- */ +#define DVNM(name) .driver_info = (kernel_ulong_t) name static const __devinitdata struct usb_device_id device_table[] = { - {USB_DEVICE(0x046d, 0x0892), .driver_info = BRIDGE_VC0321}, - {USB_DEVICE(0x046d, 0x0896), .driver_info = BRIDGE_VC0321}, - {USB_DEVICE(0x0ac8, 0x0321), .driver_info = BRIDGE_VC0321}, - {USB_DEVICE(0x0ac8, 0x0323), .driver_info = BRIDGE_VC0323}, - {USB_DEVICE(0x0ac8, 0x0328), .driver_info = BRIDGE_VC0321}, - {USB_DEVICE(0x0ac8, 0xc001), .driver_info = BRIDGE_VC0321}, - {USB_DEVICE(0x0ac8, 0xc002), .driver_info = BRIDGE_VC0321}, - {USB_DEVICE(0x17ef, 0x4802), .driver_info = BRIDGE_VC0323}, + {USB_DEVICE(0x046d, 0x0892), DVNM("Logitech Orbicam")}, + {USB_DEVICE(0x046d, 0x0896), DVNM("Logitech Orbicam")}, + {USB_DEVICE(0x0ac8, 0x0321), DVNM("Vimicro generic vc0321")}, + {USB_DEVICE(0x0ac8, 0x0323), DVNM("Vimicro Vc0323")}, + {USB_DEVICE(0x0ac8, 0x0328), DVNM("A4Tech PK-130MG")}, + {USB_DEVICE(0x0ac8, 0xc001), DVNM("Sony embedded vimicro")}, + {USB_DEVICE(0x0ac8, 0xc002), DVNM("Sony embedded vimicro")}, + {USB_DEVICE(0x17ef, 0x4802), DVNM("Lenovo Vc0323+MI1310_SOC")}, {} }; MODULE_DEVICE_TABLE(usb, device_table); @@ -1781,7 +1805,7 @@ static int __init sd_mod_init(void) { if (usb_register(&sd_driver) < 0) return -1; - PDEBUG(D_PROBE, "registered"); + PDEBUG(D_PROBE, "v%s registered", version); return 0; } static void __exit sd_mod_exit(void) diff --git a/trunk/drivers/media/video/gspca/zc3xx.c b/trunk/drivers/media/video/gspca/zc3xx.c index 22a994ccb1d5..b761b11c5c6a 100644 --- a/trunk/drivers/media/video/gspca/zc3xx.c +++ b/trunk/drivers/media/video/gspca/zc3xx.c @@ -24,6 +24,9 @@ #include "gspca.h" +#define DRIVER_VERSION_NUMBER KERNEL_VERSION(2, 1, 7) +static const char version[] = "2.1.7"; + MODULE_AUTHOR("Michel Xhaard , " "Serge A. Suchkov "); MODULE_DESCRIPTION("GSPCA ZC03xx/VC3xx USB Camera Driver"); @@ -46,7 +49,7 @@ struct sd { __u8 sharpness; char qindex; - signed char sensor; /* Type of image sensor chip */ + char sensor; /* Type of image sensor chip */ /* !! values used in different tables */ #define SENSOR_CS2102 0 #define SENSOR_CS2102K 1 @@ -2202,10 +2205,10 @@ static const struct usb_action hdcs2020xb_InitialScale[] = { }; static const struct usb_action hdcs2020b_50HZ[] = { {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */ - {0xaa, 0x13, 0x0018}, /* 00,13,18,aa */ - {0xaa, 0x14, 0x0001}, /* 00,14,01,aa */ - {0xaa, 0x0e, 0x0005}, /* 00,0e,05,aa */ - {0xaa, 0x19, 0x001f}, /* 00,19,1f,aa */ + {0xaa, 0x13, 0x0018}, /* 00,13,18,aa */ + {0xaa, 0x14, 0x0001}, /* 00,14,01,aa */ + {0xaa, 0x0e, 0x0005}, /* 00,0e,05,aa */ + {0xaa, 0x19, 0x001f}, /* 00,19,1f,aa */ {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */ {0xa0, 0x02, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,02,cc */ {0xa0, 0x76, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,76,cc */ @@ -2223,10 +2226,10 @@ static const struct usb_action hdcs2020b_50HZ[] = { }; static const struct usb_action hdcs2020b_60HZ[] = { {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */ - {0xaa, 0x13, 0x0031}, /* 00,13,31,aa */ - {0xaa, 0x14, 0x0001}, /* 00,14,01,aa */ - {0xaa, 0x0e, 0x0004}, /* 00,0e,04,aa */ - {0xaa, 0x19, 0x00cd}, /* 00,19,cd,aa */ + {0xaa, 0x13, 0x0031}, /* 00,13,31,aa */ + {0xaa, 0x14, 0x0001}, /* 00,14,01,aa */ + {0xaa, 0x0e, 0x0004}, /* 00,0e,04,aa */ + {0xaa, 0x19, 0x00cd}, /* 00,19,cd,aa */ {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */ {0xa0, 0x02, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,02,cc */ {0xa0, 0x62, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,62,cc */ @@ -2244,10 +2247,10 @@ static const struct usb_action hdcs2020b_60HZ[] = { }; static const struct usb_action hdcs2020b_NoFliker[] = { {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */ - {0xaa, 0x13, 0x0010}, /* 00,13,10,aa */ - {0xaa, 0x14, 0x0001}, /* 00,14,01,aa */ - {0xaa, 0x0e, 0x0004}, /* 00,0e,04,aa */ - {0xaa, 0x19, 0x0000}, /* 00,19,00,aa */ + {0xaa, 0x13, 0x0010}, /* 00,13,10,aa */ + {0xaa, 0x14, 0x0001}, /* 00,14,01,aa */ + {0xaa, 0x0e, 0x0004}, /* 00,0e,04,aa */ + {0xaa, 0x19, 0x0000}, /* 00,19,00,aa */ {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */ {0xa0, 0x02, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,02,cc */ {0xa0, 0x70, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,70,cc */ @@ -4099,27 +4102,27 @@ static const struct usb_action pas106b_Initial_com[] = { static const struct usb_action pas106b_Initial[] = { /* 176x144 */ /* JPEG control */ - {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, + {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* ClockSetting */ /* Sream and Sensor specific */ - {0xa0, 0x0f, ZC3XX_R010_CMOSSENSORSELECT}, + {0xa0, 0x0f, ZC3XX_R010_CMOSSENSORSELECT}, /* CMOSSensorSelect */ /* Picture size */ - {0xa0, 0x00, ZC3XX_R003_FRAMEWIDTHHIGH}, - {0xa0, 0xb0, ZC3XX_R004_FRAMEWIDTHLOW}, - {0xa0, 0x00, ZC3XX_R005_FRAMEHEIGHTHIGH}, - {0xa0, 0x90, ZC3XX_R006_FRAMEHEIGHTLOW}, + {0xa0, 0x00, ZC3XX_R003_FRAMEWIDTHHIGH}, /* FrameWidthHigh 00 */ + {0xa0, 0xb0, ZC3XX_R004_FRAMEWIDTHLOW}, /* FrameWidthLow B0 */ + {0xa0, 0x00, ZC3XX_R005_FRAMEHEIGHTHIGH}, /* FrameHeightHigh 00 */ + {0xa0, 0x90, ZC3XX_R006_FRAMEHEIGHTLOW}, /* FrameHightLow 90 */ /* System */ - {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING}, + {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING}, /* SystemOperating */ /* Sream and Sensor specific */ - {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC}, - {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC}, + {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC}, /* VideoControlFunction */ + {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC}, /* VideoControlFunction */ /* Sensor Interface */ - {0xa0, 0x08, ZC3XX_R08D_COMPABILITYMODE}, + {0xa0, 0x08, ZC3XX_R08D_COMPABILITYMODE}, /* Compatibily Mode */ /* Window inside sensor array */ - {0xa0, 0x03, ZC3XX_R09A_WINXSTARTLOW}, - {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW}, - {0xa0, 0x03, ZC3XX_R11C_FIRSTXLOW}, - {0xa0, 0x28, ZC3XX_R09C_WINHEIGHTLOW}, - {0xa0, 0x68, ZC3XX_R09E_WINWIDTHLOW}, + {0xa0, 0x03, ZC3XX_R09A_WINXSTARTLOW}, /* WinXStartLow */ + {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW}, /* FirstYLow */ + {0xa0, 0x03, ZC3XX_R11C_FIRSTXLOW}, /* FirstxLow */ + {0xa0, 0x28, ZC3XX_R09C_WINHEIGHTLOW}, /* WinHeightLow */ + {0xa0, 0x68, ZC3XX_R09E_WINWIDTHLOW}, /* WinWidthLow */ /* Init the sensor */ {0xaa, 0x02, 0x0004}, {0xaa, 0x08, 0x0000}, @@ -4132,40 +4135,40 @@ static const struct usb_action pas106b_Initial[] = { /* 176x144 */ {0xaa, 0x14, 0x0081}, /* Other registors */ - {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION}, + {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION}, /* SensorCorrection */ /* Frame retreiving */ - {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, + {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* AutoAdjustFPS */ /* Gains */ - {0xa0, 0xa0, ZC3XX_R1A8_DIGITALGAIN}, + {0xa0, 0xa0, ZC3XX_R1A8_DIGITALGAIN}, /* DigitalGain */ /* Unknown */ {0xa0, 0x00, 0x01ad}, /* Sharpness */ - {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, - {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05}, + {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, /* SharpnessMode */ + {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05}, /* Sharpness05 */ /* Other registors */ - {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, + {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* OperationMode */ /* Auto exposure and white balance */ - {0xa0, 0x06, ZC3XX_R189_AWBSTATUS}, + {0xa0, 0x06, ZC3XX_R189_AWBSTATUS}, /* AWBStatus */ /*Dead pixels */ - {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE}, + {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE}, /* DeadPixelsMode */ /* EEPROM */ - {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS}, + {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS}, /* EEPROMAccess */ /* JPEG control */ - {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, - {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00}, - {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05}, + {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* ClockSetting */ + {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00}, /* sharpness+ */ + {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05}, /* sharpness- */ /* Other registers */ - {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, + {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* OperationMode */ /* Auto exposure and white balance */ - {0xa0, 0x06, ZC3XX_R189_AWBSTATUS}, + {0xa0, 0x06, ZC3XX_R189_AWBSTATUS}, /* AWBStatus */ /*Dead pixels */ - {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE}, + {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE}, /* DeadPixelsMode */ /* EEPROM */ - {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS}, + {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS}, /* EEPROMAccess */ /* JPEG control */ - {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, - {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00}, - {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05}, + {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* ClockSetting */ + {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00}, /* sharpness+ */ + {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05}, /* sharpness- */ {0xa0, 0x58, ZC3XX_R10A_RGB00}, /* matrix */ {0xa0, 0xf4, ZC3XX_R10B_RGB01}, @@ -4177,67 +4180,67 @@ static const struct usb_action pas106b_Initial[] = { /* 176x144 */ {0xa0, 0xf4, ZC3XX_R111_RGB21}, {0xa0, 0x58, ZC3XX_R112_RGB22}, /* Auto correction */ - {0xa0, 0x03, ZC3XX_R181_WINXSTART}, - {0xa0, 0x08, ZC3XX_R182_WINXWIDTH}, - {0xa0, 0x16, ZC3XX_R183_WINXCENTER}, - {0xa0, 0x03, ZC3XX_R184_WINYSTART}, - {0xa0, 0x05, ZC3XX_R185_WINYWIDTH}, - {0xa0, 0x14, ZC3XX_R186_WINYCENTER}, - {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE}, + {0xa0, 0x03, ZC3XX_R181_WINXSTART}, /* WinXstart */ + {0xa0, 0x08, ZC3XX_R182_WINXWIDTH}, /* WinXWidth */ + {0xa0, 0x16, ZC3XX_R183_WINXCENTER}, /* WinXCenter */ + {0xa0, 0x03, ZC3XX_R184_WINYSTART}, /* WinYStart */ + {0xa0, 0x05, ZC3XX_R185_WINYWIDTH}, /* WinYWidth */ + {0xa0, 0x14, ZC3XX_R186_WINYCENTER}, /* WinYCenter */ + {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE}, /* AutoCorrectEnable */ /* Auto exposure and white balance */ - {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, - {0xa0, 0x03, ZC3XX_R191_EXPOSURELIMITMID}, - {0xa0, 0xb1, ZC3XX_R192_EXPOSURELIMITLOW}, - {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, - {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, - {0xa0, 0x87, ZC3XX_R197_ANTIFLICKERLOW}, - {0xa0, 0x0c, ZC3XX_R18C_AEFREEZE}, - {0xa0, 0x18, ZC3XX_R18F_AEUNFREEZE}, + {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* ExposureLimitHigh */ + {0xa0, 0x03, ZC3XX_R191_EXPOSURELIMITMID}, /* ExposureLimitMid */ + {0xa0, 0xb1, ZC3XX_R192_EXPOSURELIMITLOW}, /* ExposureLimitLow */ + {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* AntiFlickerHigh */ + {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* AntiFlickerLow */ + {0xa0, 0x87, ZC3XX_R197_ANTIFLICKERLOW}, /* AntiFlickerLow */ + {0xa0, 0x0c, ZC3XX_R18C_AEFREEZE}, /* AEBFreeze */ + {0xa0, 0x18, ZC3XX_R18F_AEUNFREEZE}, /* AEBUnfreeze */ /* sensor on */ {0xaa, 0x07, 0x00b1}, {0xaa, 0x05, 0x0003}, {0xaa, 0x04, 0x0001}, {0xaa, 0x03, 0x003b}, /* Gains */ - {0xa0, 0x20, ZC3XX_R1A9_DIGITALLIMITDIFF}, - {0xa0, 0x26, ZC3XX_R1AA_DIGITALGAINSTEP}, - {0xa0, 0xa0, ZC3XX_R11D_GLOBALGAIN}, - {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN}, + {0xa0, 0x20, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* DigitalLimitDiff */ + {0xa0, 0x26, ZC3XX_R1AA_DIGITALGAINSTEP}, /* DigitalGainStep */ + {0xa0, 0xa0, ZC3XX_R11D_GLOBALGAIN}, /* GlobalGain */ + {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN}, /* GlobalGain */ /* Auto correction */ - {0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE}, + {0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE}, /* AutoCorrectEnable */ {0xa1, 0x01, 0x0180}, /* AutoCorrectEnable */ - {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE}, + {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE}, /* AutoCorrectEnable */ /* Gains */ - {0xa0, 0x40, ZC3XX_R116_RGAIN}, - {0xa0, 0x40, ZC3XX_R117_GGAIN}, - {0xa0, 0x40, ZC3XX_R118_BGAIN}, + {0xa0, 0x40, ZC3XX_R116_RGAIN}, /* RGain */ + {0xa0, 0x40, ZC3XX_R117_GGAIN}, /* GGain */ + {0xa0, 0x40, ZC3XX_R118_BGAIN}, /* BGain */ {} }; static const struct usb_action pas106b_InitialScale[] = { /* 352x288 */ /* JPEG control */ - {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, + {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* ClockSetting */ /* Sream and Sensor specific */ - {0xa0, 0x0f, ZC3XX_R010_CMOSSENSORSELECT}, + {0xa0, 0x0f, ZC3XX_R010_CMOSSENSORSELECT}, /* CMOSSensorSelect */ /* Picture size */ - {0xa0, 0x01, ZC3XX_R003_FRAMEWIDTHHIGH}, - {0xa0, 0x60, ZC3XX_R004_FRAMEWIDTHLOW}, - {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH}, - {0xa0, 0x20, ZC3XX_R006_FRAMEHEIGHTLOW}, + {0xa0, 0x01, ZC3XX_R003_FRAMEWIDTHHIGH}, /* FrameWidthHigh */ + {0xa0, 0x60, ZC3XX_R004_FRAMEWIDTHLOW}, /* FrameWidthLow */ + {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH}, /* FrameHeightHigh */ + {0xa0, 0x20, ZC3XX_R006_FRAMEHEIGHTLOW}, /* FrameHightLow */ /* System */ - {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING}, + {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING}, /* SystemOperating */ /* Sream and Sensor specific */ - {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC}, - {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC}, + {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC}, /* VideoControlFunction */ + {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC}, /* VideoControlFunction */ /* Sensor Interface */ - {0xa0, 0x08, ZC3XX_R08D_COMPABILITYMODE}, + {0xa0, 0x08, ZC3XX_R08D_COMPABILITYMODE}, /* Compatibily Mode */ /* Window inside sensor array */ - {0xa0, 0x03, ZC3XX_R09A_WINXSTARTLOW}, - {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW}, - {0xa0, 0x03, ZC3XX_R11C_FIRSTXLOW}, - {0xa0, 0x28, ZC3XX_R09C_WINHEIGHTLOW}, - {0xa0, 0x68, ZC3XX_R09E_WINWIDTHLOW}, + {0xa0, 0x03, ZC3XX_R09A_WINXSTARTLOW}, /* WinXStartLow */ + {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW}, /* FirstYLow */ + {0xa0, 0x03, ZC3XX_R11C_FIRSTXLOW}, /* FirstxLow */ + {0xa0, 0x28, ZC3XX_R09C_WINHEIGHTLOW}, /* WinHeightLow */ + {0xa0, 0x68, ZC3XX_R09E_WINWIDTHLOW}, /* WinWidthLow */ /* Init the sensor */ {0xaa, 0x02, 0x0004}, {0xaa, 0x08, 0x0000}, @@ -4250,41 +4253,41 @@ static const struct usb_action pas106b_InitialScale[] = { /* 352x288 */ {0xaa, 0x14, 0x0081}, /* Other registors */ - {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION}, + {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION}, /* SensorCorrection */ /* Frame retreiving */ - {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, + {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* AutoAdjustFPS */ /* Gains */ - {0xa0, 0xa0, ZC3XX_R1A8_DIGITALGAIN}, + {0xa0, 0xa0, ZC3XX_R1A8_DIGITALGAIN}, /* DigitalGain */ /* Unknown */ {0xa0, 0x00, 0x01ad}, /* Sharpness */ - {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, - {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05}, + {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, /* SharpnessMode */ + {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05}, /* Sharpness05 */ /* Other registors */ - {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, + {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* OperationMode */ /* Auto exposure and white balance */ - {0xa0, 0x06, ZC3XX_R189_AWBSTATUS}, - {0xa0, 0x80, ZC3XX_R18D_YTARGET}, + {0xa0, 0x06, ZC3XX_R189_AWBSTATUS}, /* AWBStatus */ + {0xa0, 0x80, ZC3XX_R18D_YTARGET}, /* ????????? */ /*Dead pixels */ - {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE}, + {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE}, /* DeadPixelsMode */ /* EEPROM */ - {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS}, + {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS}, /* EEPROMAccess */ /* JPEG control */ - {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, - {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00}, - {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05}, + {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* ClockSetting */ + {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00}, /* sharpness+ */ + {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05}, /* sharpness- */ /* Other registers */ - {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, + {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* OperationMode */ /* Auto exposure and white balance */ - {0xa0, 0x06, ZC3XX_R189_AWBSTATUS}, + {0xa0, 0x06, ZC3XX_R189_AWBSTATUS}, /* AWBStatus */ /*Dead pixels */ - {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE}, + {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE}, /* DeadPixelsMode */ /* EEPROM */ - {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS}, + {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS}, /* EEPROMAccess */ /* JPEG control */ - {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, - {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00}, - {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05}, + {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* ClockSetting */ + {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00}, /* sharpness+ */ + {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05}, /* sharpness- */ {0xa0, 0x58, ZC3XX_R10A_RGB00}, /* matrix */ {0xa0, 0xf4, ZC3XX_R10B_RGB01}, @@ -4296,43 +4299,43 @@ static const struct usb_action pas106b_InitialScale[] = { /* 352x288 */ {0xa0, 0xf4, ZC3XX_R111_RGB21}, {0xa0, 0x58, ZC3XX_R112_RGB22}, /* Auto correction */ - {0xa0, 0x03, ZC3XX_R181_WINXSTART}, - {0xa0, 0x08, ZC3XX_R182_WINXWIDTH}, - {0xa0, 0x16, ZC3XX_R183_WINXCENTER}, - {0xa0, 0x03, ZC3XX_R184_WINYSTART}, - {0xa0, 0x05, ZC3XX_R185_WINYWIDTH}, - {0xa0, 0x14, ZC3XX_R186_WINYCENTER}, - {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE}, + {0xa0, 0x03, ZC3XX_R181_WINXSTART}, /* WinXstart */ + {0xa0, 0x08, ZC3XX_R182_WINXWIDTH}, /* WinXWidth */ + {0xa0, 0x16, ZC3XX_R183_WINXCENTER}, /* WinXCenter */ + {0xa0, 0x03, ZC3XX_R184_WINYSTART}, /* WinYStart */ + {0xa0, 0x05, ZC3XX_R185_WINYWIDTH}, /* WinYWidth */ + {0xa0, 0x14, ZC3XX_R186_WINYCENTER}, /* WinYCenter */ + {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE}, /* AutoCorrectEnable */ /* Auto exposure and white balance */ - {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, - {0xa0, 0x03, ZC3XX_R191_EXPOSURELIMITMID}, - {0xa0, 0xb1, ZC3XX_R192_EXPOSURELIMITLOW}, + {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* ExposureLimitHigh 0 */ + {0xa0, 0x03, ZC3XX_R191_EXPOSURELIMITMID}, /* ExposureLimitMid */ + {0xa0, 0xb1, ZC3XX_R192_EXPOSURELIMITLOW}, /* ExposureLimitLow 0xb1 */ - {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, - {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, - {0xa0, 0x87, ZC3XX_R197_ANTIFLICKERLOW}, + {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* AntiFlickerHigh 0x00 */ + {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* AntiFlickerLow 0x00 */ + {0xa0, 0x87, ZC3XX_R197_ANTIFLICKERLOW}, /* AntiFlickerLow 0x87 */ - {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, - {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, + {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* AEBFreeze 0x10 0x0c */ + {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* AEBUnfreeze 0x30 0x18 */ /* sensor on */ {0xaa, 0x07, 0x00b1}, {0xaa, 0x05, 0x0003}, {0xaa, 0x04, 0x0001}, {0xaa, 0x03, 0x003b}, /* Gains */ - {0xa0, 0x20, ZC3XX_R1A9_DIGITALLIMITDIFF}, - {0xa0, 0x26, ZC3XX_R1AA_DIGITALGAINSTEP}, - {0xa0, 0xa0, ZC3XX_R11D_GLOBALGAIN}, - {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN}, + {0xa0, 0x20, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* DigitalLimitDiff */ + {0xa0, 0x26, ZC3XX_R1AA_DIGITALGAINSTEP}, /* DigitalGainStep */ + {0xa0, 0xa0, ZC3XX_R11D_GLOBALGAIN}, /* GlobalGain */ + {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN}, /* GlobalGain */ /* Auto correction */ - {0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE}, + {0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE}, /* AutoCorrectEnable */ {0xa1, 0x01, 0x0180}, /* AutoCorrectEnable */ - {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE}, + {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE}, /* AutoCorrectEnable */ /* Gains */ - {0xa0, 0x40, ZC3XX_R116_RGAIN}, - {0xa0, 0x40, ZC3XX_R117_GGAIN}, - {0xa0, 0x40, ZC3XX_R118_BGAIN}, + {0xa0, 0x40, ZC3XX_R116_RGAIN}, /* RGain */ + {0xa0, 0x40, ZC3XX_R117_GGAIN}, /* GGain */ + {0xa0, 0x40, ZC3XX_R118_BGAIN}, /* BGain */ {0xa0, 0x00, 0x0007}, /* AutoCorrectEnable */ {0xa0, 0xff, ZC3XX_R018_FRAMELOST}, /* Frame adjust */ @@ -4456,8 +4459,8 @@ static const struct usb_action pb03303x_Initial[] = { {0xa0, 0x50, ZC3XX_R112_RGB22}, {0xa1, 0x01, 0x0008}, - {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, - {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00}, + {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* clock ? */ + {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00}, /* sharpness+ */ {0xa1, 0x01, 0x01c8}, {0xa1, 0x01, 0x01c9}, {0xa1, 0x01, 0x01ca}, @@ -5981,7 +5984,7 @@ static const struct usb_action tas5130c_vf0250_Initial[] = { {0xaa, 0x1b, 0x0000}, /* 00,1b,00,aa, */ {0xaa, 0x13, 0x0002}, /* 00,13,02,aa, */ {0xaa, 0x15, 0x0004}, /* 00,15,04,aa */ -/*?? {0xaa, 0x01, 0x0000}, */ + {0xaa, 0x01, 0x0000}, {0xaa, 0x01, 0x0000}, {0xaa, 0x1a, 0x0000}, /* 00,1a,00,aa, */ {0xaa, 0x1c, 0x0017}, /* 00,1c,17,aa, */ @@ -5997,8 +6000,8 @@ static const struct usb_action tas5130c_vf0250_Initial[] = { {0xaa, 0x0f, 0x00a0}, /* 00,0f,a0,aa, */ {0xaa, 0x10, 0x0000}, /* 00,10,00,aa, */ {0xaa, 0x11, 0x00a0}, /* 00,11,a0,aa, */ -/*?? {0xa0, 0x00, 0x0039}, - {0xa1, 0x01, 0x0037}, */ + {0xa0, 0x00, 0x0039}, + {0xa1, 0x01, 0x0037}, {0xaa, 0x16, 0x0001}, /* 00,16,01,aa, */ {0xaa, 0x17, 0x00e8}, /* 00,17,e6,aa, (e6 -> e8) */ {0xaa, 0x18, 0x0002}, /* 00,18,02,aa, */ @@ -6269,7 +6272,7 @@ static void reg_w(struct usb_device *dev, __u8 value, __u16 index) { - PDEBUG(D_USBO, "reg w [%04x] = %02x", index, value); + PDEBUG(D_USBO, "reg w %02x -> [%04x]", value, index); reg_w_i(dev, value, index); } @@ -6277,17 +6280,17 @@ static __u16 i2c_read(struct gspca_dev *gspca_dev, __u8 reg) { __u8 retbyte; - __u16 retval; + __u8 retval[2]; reg_w_i(gspca_dev->dev, reg, 0x92); reg_w_i(gspca_dev->dev, 0x02, 0x90); /* <- read command */ msleep(25); retbyte = reg_r_i(gspca_dev, 0x0091); /* read status */ - retval = reg_r_i(gspca_dev, 0x0095); /* read Lowbyte */ - retval |= reg_r_i(gspca_dev, 0x0096) << 8; /* read Hightbyte */ - PDEBUG(D_USBO, "i2c r [%02x] -> %04x (%02x)", - reg, retval, retbyte); - return retval; + retval[0] = reg_r_i(gspca_dev, 0x0095); /* read Lowbyte */ + retval[1] = reg_r_i(gspca_dev, 0x0096); /* read Hightbyte */ + PDEBUG(D_USBO, "i2c r [%02x] -> (%02x) %02x%02x", + reg, retbyte, retval[1], retval[0]); + return (retval[1] << 8) | retval[0]; } static __u8 i2c_write(struct gspca_dev *gspca_dev, @@ -6303,7 +6306,7 @@ static __u8 i2c_write(struct gspca_dev *gspca_dev, reg_w_i(gspca_dev->dev, 0x01, 0x90); /* <- write command */ msleep(5); retbyte = reg_r_i(gspca_dev, 0x0091); /* read status */ - PDEBUG(D_USBO, "i2c w [%02x] = %02x%02x (%02x)", + PDEBUG(D_USBO, "i2c w [%02x] %02x%02x (%02x)", reg, valH, valL, retbyte); return retbyte; } @@ -6346,8 +6349,6 @@ static void setmatrix(struct gspca_dev *gspca_dev) {0x58, 0xf4, 0xf4, 0xf4, 0x58, 0xf4, 0xf4, 0xf4, 0x58}; static const __u8 po2030_matrix[9] = {0x60, 0xf0, 0xf0, 0xf0, 0x60, 0xf0, 0xf0, 0xf0, 0x60}; - static const __u8 vf0250_matrix[9] = - {0x7b, 0xea, 0xea, 0xea, 0x7b, 0xea, 0xea, 0xea, 0x7b}; switch (sd->sensor) { case SENSOR_GC0305: @@ -6362,9 +6363,8 @@ static void setmatrix(struct gspca_dev *gspca_dev) case SENSOR_PO2030: matrix = po2030_matrix; break; - case SENSOR_TAS5130C_VF0250: - matrix = vf0250_matrix; - break; + case SENSOR_TAS5130C_VF0250: /* no matrix? */ + return; default: /* matrix already loaded */ return; } @@ -6744,7 +6744,7 @@ static int vga_2wr_probe(struct gspca_dev *gspca_dev) return 0x04; /* CS2102 */ start_2wr_probe(dev, 0x06); /* OmniVision */ - reg_w(dev, 0x08, 0x008d); + reg_w(dev, 0x08, 0x8d); i2c_write(gspca_dev, 0x11, 0xaa, 0x00); retbyte = i2c_read(gspca_dev, 0x11); if (retbyte != 0) { @@ -6778,7 +6778,7 @@ static int vga_2wr_probe(struct gspca_dev *gspca_dev) return 0x0c; /* ICM105A */ start_2wr_probe(dev, 0x0e); /* PAS202BCB */ - reg_w(dev, 0x08, 0x008d); + reg_w(dev, 0x08, 0x8d); i2c_write(gspca_dev, 0x03, 0xaa, 0x00); msleep(500); retbyte = i2c_read(gspca_dev, 0x03); @@ -6830,6 +6830,7 @@ static const struct sensor_by_chipset_revision chipset_revision_sensor[] = { {0x8001, 0x13}, {0x8000, 0x14}, /* CS2102K */ {0x8400, 0x15}, /* TAS5130K */ + {0, 0} }; static int vga_3wr_probe(struct gspca_dev *gspca_dev) @@ -6842,7 +6843,7 @@ static int vga_3wr_probe(struct gspca_dev *gspca_dev) /*fixme: lack of 8b=b3 (11,12)-> 10, 8b=e0 (14,15,16)-> 12 found in gspcav1*/ reg_w(dev, 0x02, 0x0010); - reg_r(gspca_dev, 0x0010); + reg_r(gspca_dev, 0x10); reg_w(dev, 0x01, 0x0000); reg_w(dev, 0x00, 0x0010); reg_w(dev, 0x01, 0x0001); @@ -6868,15 +6869,17 @@ static int vga_3wr_probe(struct gspca_dev *gspca_dev) PDEBUG(D_PROBE, "probe 3wr vga 1 0x%04x", checkword); reg_r(gspca_dev, 0x0010); /* this is tested only once anyway */ - for (i = 0; i < ARRAY_SIZE(chipset_revision_sensor); i++) { + i = 0; + while (chipset_revision_sensor[i].revision) { if (chipset_revision_sensor[i].revision == checkword) { sd->chip_revision = checkword; send_unknown(dev, SENSOR_PB0330); return chipset_revision_sensor[i].internal_sensor_id; } + i++; } - reg_w(dev, 0x01, 0x0000); /* check ?? */ + reg_w(dev, 0x01, 0x0000); reg_w(dev, 0x01, 0x0001); reg_w(dev, 0xdd, 0x008b); reg_w(dev, 0x0a, 0x0010); @@ -6898,11 +6901,8 @@ static int vga_3wr_probe(struct gspca_dev *gspca_dev) retbyte = i2c_read(gspca_dev, 0x00); if (retbyte != 0) { PDEBUG(D_PROBE, "probe 3wr vga type %02x", retbyte); - if (retbyte == 0x11) /* VF0250 */ - return 0x0250; - if (retbyte == 0x29) /* gc0305 */ - send_unknown(dev, SENSOR_GC0305); - return retbyte; + send_unknown(dev, SENSOR_GC0305); + return retbyte; /* 0x29 = gc0305 - should continue? */ } reg_w(dev, 0x01, 0x0000); /* check OmniVision */ @@ -6918,18 +6918,18 @@ static int vga_3wr_probe(struct gspca_dev *gspca_dev) return 0x06; /* OmniVision confirm ? */ } - reg_w(dev, 0x01, 0x0000); - reg_w(dev, 0x00, 0x0002); - reg_w(dev, 0x01, 0x0010); - reg_w(dev, 0x01, 0x0001); - reg_w(dev, 0xee, 0x008b); - reg_w(dev, 0x03, 0x0012); + reg_w(dev, 0x01, 0x00); + reg_w(dev, 0x00, 0x02); + reg_w(dev, 0x01, 0x10); + reg_w(dev, 0x01, 0x01); + reg_w(dev, 0xee, 0x8b); + reg_w(dev, 0x03, 0x12); /* msleep(150); */ - reg_w(dev, 0x01, 0x0012); - reg_w(dev, 0x05, 0x0012); - retbyte = i2c_read(gspca_dev, 0x0000); /* ID 0 */ + reg_w(dev, 0x01, 0x12); + reg_w(dev, 0x05, 0x12); + retbyte = i2c_read(gspca_dev, 0x00); /* ID 0 */ checkword = retbyte << 8; - retbyte = i2c_read(gspca_dev, 0x0001); /* ID 1 */ + retbyte = i2c_read(gspca_dev, 0x01); /* ID 1 */ checkword |= retbyte; PDEBUG(D_PROBE, "probe 3wr vga 2 0x%04x", checkword); if (checkword == 0x2030) { @@ -6939,14 +6939,14 @@ static int vga_3wr_probe(struct gspca_dev *gspca_dev) return checkword; } - reg_w(dev, 0x01, 0x0000); - reg_w(dev, 0x0a, 0x0010); - reg_w(dev, 0xd3, 0x008b); - reg_w(dev, 0x01, 0x0001); - reg_w(dev, 0x03, 0x0012); - reg_w(dev, 0x01, 0x0012); - reg_w(dev, 0x05, 0x0001); - reg_w(dev, 0xd3, 0x008b); + reg_w(dev, 0x01, 0x00); + reg_w(dev, 0x0a, 0x10); + reg_w(dev, 0xd3, 0x8b); + reg_w(dev, 0x01, 0x01); + reg_w(dev, 0x03, 0x12); + reg_w(dev, 0x01, 0x12); + reg_w(dev, 0x05, 0x01); + reg_w(dev, 0xd3, 0x8b); retbyte = i2c_read(gspca_dev, 0x01); if (retbyte != 0) { PDEBUG(D_PROBE, "probe 3wr vga type 0a ?"); @@ -6962,9 +6962,7 @@ static int zcxx_probeSensor(struct gspca_dev *gspca_dev) switch (sd->sensor) { case SENSOR_MC501CB: - return -1; /* don't probe */ case SENSOR_TAS5130C_VF0250: - /* may probe but with write in reg 0x0010 */ return -1; /* don't probe */ } sensor = vga_2wr_probe(gspca_dev); @@ -7012,7 +7010,30 @@ static int sd_config(struct gspca_dev *gspca_dev, /* define some sensors from the vendor/product */ sd->sharpness = 2; - sd->sensor = id->driver_info; + switch (id->idVendor) { + case 0x041e: /* Creative */ + switch (id->idProduct) { + case 0x4051: /* zc301 chips */ + case 0x4053: + sd->sensor = SENSOR_TAS5130C_VF0250; + break; + } + break; + case 0x046d: /* Logitech Labtec */ + switch (id->idProduct) { + case 0x08dd: + sd->sensor = SENSOR_MC501CB; + break; + } + break; + case 0x0ac8: /* Vimicro z-star */ + switch (id->idProduct) { + case 0x305b: + sd->sensor = SENSOR_TAS5130C_VF0250; + break; + } + break; + } sensor = zcxx_probeSensor(gspca_dev); if (sensor >= 0) PDEBUG(D_PROBE, "probe sensor -> %02x", sensor); @@ -7098,10 +7119,6 @@ static int sd_config(struct gspca_dev *gspca_dev, PDEBUG(D_PROBE, "Find Sensor GC0305"); sd->sensor = SENSOR_GC0305; break; - case 0x0250: - PDEBUG(D_PROBE, "Sensor Tas5130 (VF0250)"); - sd->sensor = SENSOR_TAS5130C_VF0250; - break; case 0x2030: PDEBUG(D_PROBE, "Find Sensor PO2030"); sd->sensor = SENSOR_PO2030; @@ -7129,6 +7146,7 @@ static int sd_config(struct gspca_dev *gspca_dev, } cam = &gspca_dev->cam; + cam->dev_name = (char *) id->driver_info; cam->epaddr = 0x01; /*fixme:test*/ gspca_dev->nbalt--; @@ -7217,7 +7235,6 @@ static void sd_start(struct gspca_dev *gspca_dev) case SENSOR_GC0305: case SENSOR_OV7620: case SENSOR_PO2030: - case SENSOR_TAS5130C_VF0250: msleep(100); /* ?? */ reg_r(gspca_dev, 0x0002); /* --> 0x40 */ reg_w(dev, 0x09, 0x01ad); /* (from win traces) */ @@ -7498,69 +7515,70 @@ static const struct sd_desc sd_desc = { .querymenu = sd_querymenu, }; +#define DVNM(name) .driver_info = (kernel_ulong_t) name static const __devinitdata struct usb_device_id device_table[] = { - {USB_DEVICE(0x041e, 0x041e)}, + {USB_DEVICE(0x041e, 0x041e), DVNM("Creative WebCam Live!")}, #ifndef CONFIG_USB_ZC0301 - {USB_DEVICE(0x041e, 0x4017)}, - {USB_DEVICE(0x041e, 0x401c)}, - {USB_DEVICE(0x041e, 0x401e)}, - {USB_DEVICE(0x041e, 0x401f)}, + {USB_DEVICE(0x041e, 0x4017), DVNM("Creative Webcam Mobile PD1090")}, + {USB_DEVICE(0x041e, 0x401c), DVNM("Creative NX")}, + {USB_DEVICE(0x041e, 0x401e), DVNM("Creative Nx Pro")}, + {USB_DEVICE(0x041e, 0x401f), DVNM("Creative Webcam Notebook PD1171")}, #endif - {USB_DEVICE(0x041e, 0x4029)}, + {USB_DEVICE(0x041e, 0x4029), DVNM("Creative WebCam Vista Pro")}, #ifndef CONFIG_USB_ZC0301 - {USB_DEVICE(0x041e, 0x4034)}, - {USB_DEVICE(0x041e, 0x4035)}, - {USB_DEVICE(0x041e, 0x4036)}, - {USB_DEVICE(0x041e, 0x403a)}, + {USB_DEVICE(0x041e, 0x4034), DVNM("Creative Instant P0620")}, + {USB_DEVICE(0x041e, 0x4035), DVNM("Creative Instant P0620D")}, + {USB_DEVICE(0x041e, 0x4036), DVNM("Creative Live !")}, + {USB_DEVICE(0x041e, 0x403a), DVNM("Creative Nx Pro 2")}, #endif - {USB_DEVICE(0x041e, 0x4051), .driver_info = SENSOR_TAS5130C_VF0250}, - {USB_DEVICE(0x041e, 0x4053), .driver_info = SENSOR_TAS5130C_VF0250}, + {USB_DEVICE(0x041e, 0x4051), DVNM("Creative Notebook Pro (VF0250)")}, + {USB_DEVICE(0x041e, 0x4053), DVNM("Creative Live!Cam Video IM")}, #ifndef CONFIG_USB_ZC0301 - {USB_DEVICE(0x0458, 0x7007)}, - {USB_DEVICE(0x0458, 0x700c)}, - {USB_DEVICE(0x0458, 0x700f)}, + {USB_DEVICE(0x0458, 0x7007), DVNM("Genius VideoCam V2")}, + {USB_DEVICE(0x0458, 0x700c), DVNM("Genius VideoCam V3")}, + {USB_DEVICE(0x0458, 0x700f), DVNM("Genius VideoCam Web V2")}, #endif - {USB_DEVICE(0x0461, 0x0a00)}, - {USB_DEVICE(0x046d, 0x08a0)}, - {USB_DEVICE(0x046d, 0x08a1)}, - {USB_DEVICE(0x046d, 0x08a2)}, - {USB_DEVICE(0x046d, 0x08a3)}, - {USB_DEVICE(0x046d, 0x08a6)}, - {USB_DEVICE(0x046d, 0x08a7)}, - {USB_DEVICE(0x046d, 0x08a9)}, - {USB_DEVICE(0x046d, 0x08aa)}, - {USB_DEVICE(0x046d, 0x08ac)}, - {USB_DEVICE(0x046d, 0x08ad)}, + {USB_DEVICE(0x0461, 0x0a00), DVNM("MicroInnovation WebCam320")}, + {USB_DEVICE(0x046d, 0x08a0), DVNM("Logitech QC IM")}, + {USB_DEVICE(0x046d, 0x08a1), DVNM("Logitech QC IM 0x08A1 +sound")}, + {USB_DEVICE(0x046d, 0x08a2), DVNM("Labtec Webcam Pro")}, + {USB_DEVICE(0x046d, 0x08a3), DVNM("Logitech QC Chat")}, + {USB_DEVICE(0x046d, 0x08a6), DVNM("Logitech QCim")}, + {USB_DEVICE(0x046d, 0x08a7), DVNM("Logitech QuickCam Image")}, + {USB_DEVICE(0x046d, 0x08a9), DVNM("Logitech Notebook Deluxe")}, + {USB_DEVICE(0x046d, 0x08aa), DVNM("Labtec Webcam Notebook")}, + {USB_DEVICE(0x046d, 0x08ac), DVNM("Logitech QuickCam Cool")}, + {USB_DEVICE(0x046d, 0x08ad), DVNM("Logitech QCCommunicate STX")}, #ifndef CONFIG_USB_ZC0301 - {USB_DEVICE(0x046d, 0x08ae)}, + {USB_DEVICE(0x046d, 0x08ae), DVNM("Logitech QuickCam for Notebooks")}, #endif - {USB_DEVICE(0x046d, 0x08af)}, - {USB_DEVICE(0x046d, 0x08b9)}, - {USB_DEVICE(0x046d, 0x08d7)}, - {USB_DEVICE(0x046d, 0x08d9)}, - {USB_DEVICE(0x046d, 0x08d8)}, - {USB_DEVICE(0x046d, 0x08da)}, - {USB_DEVICE(0x046d, 0x08dd), .driver_info = SENSOR_MC501CB}, - {USB_DEVICE(0x0471, 0x0325)}, - {USB_DEVICE(0x0471, 0x0326)}, - {USB_DEVICE(0x0471, 0x032d)}, - {USB_DEVICE(0x0471, 0x032e)}, - {USB_DEVICE(0x055f, 0xc005)}, + {USB_DEVICE(0x046d, 0x08af), DVNM("Logitech QuickCam Cool")}, + {USB_DEVICE(0x046d, 0x08b9), DVNM("Logitech QC IM ???")}, + {USB_DEVICE(0x046d, 0x08d7), DVNM("Logitech QCam STX")}, + {USB_DEVICE(0x046d, 0x08d9), DVNM("Logitech QuickCam IM/Connect")}, + {USB_DEVICE(0x046d, 0x08d8), DVNM("Logitech Notebook Deluxe")}, + {USB_DEVICE(0x046d, 0x08da), DVNM("Logitech QuickCam Messenger")}, + {USB_DEVICE(0x046d, 0x08dd), DVNM("Logitech QuickCam for Notebooks")}, + {USB_DEVICE(0x0471, 0x0325), DVNM("Philips SPC 200 NC")}, + {USB_DEVICE(0x0471, 0x0326), DVNM("Philips SPC 300 NC")}, + {USB_DEVICE(0x0471, 0x032d), DVNM("Philips spc210nc")}, + {USB_DEVICE(0x0471, 0x032e), DVNM("Philips spc315nc")}, + {USB_DEVICE(0x055f, 0xc005), DVNM("Mustek Wcam300A")}, #ifndef CONFIG_USB_ZC0301 - {USB_DEVICE(0x055f, 0xd003)}, - {USB_DEVICE(0x055f, 0xd004)}, + {USB_DEVICE(0x055f, 0xd003), DVNM("Mustek WCam300A")}, + {USB_DEVICE(0x055f, 0xd004), DVNM("Mustek WCam300 AN")}, #endif - {USB_DEVICE(0x0698, 0x2003)}, - {USB_DEVICE(0x0ac8, 0x0302)}, + {USB_DEVICE(0x0698, 0x2003), DVNM("CTX M730V built in")}, + {USB_DEVICE(0x0ac8, 0x0302), DVNM("Z-star Vimicro zc0302")}, #ifndef CONFIG_USB_ZC0301 - {USB_DEVICE(0x0ac8, 0x301b)}, - {USB_DEVICE(0x0ac8, 0x303b)}, + {USB_DEVICE(0x0ac8, 0x301b), DVNM("Z-Star zc301b")}, + {USB_DEVICE(0x0ac8, 0x303b), DVNM("Vimicro 0x303b")}, #endif - {USB_DEVICE(0x0ac8, 0x305b), .driver_info = SENSOR_TAS5130C_VF0250}, + {USB_DEVICE(0x0ac8, 0x305b), DVNM("Z-star Vimicro zc0305b")}, #ifndef CONFIG_USB_ZC0301 - {USB_DEVICE(0x0ac8, 0x307b)}, - {USB_DEVICE(0x10fd, 0x0128)}, - {USB_DEVICE(0x10fd, 0x8050)}, + {USB_DEVICE(0x0ac8, 0x307b), DVNM("Z-Star 307b")}, + {USB_DEVICE(0x10fd, 0x0128), DVNM("Typhoon Webshot II 300k 0x0128")}, + {USB_DEVICE(0x10fd, 0x8050), DVNM("Typhoon Webshot II USB 300k")}, #endif {} /* end of entry */ }; @@ -7587,7 +7605,7 @@ static int __init sd_mod_init(void) { if (usb_register(&sd_driver) < 0) return -1; - PDEBUG(D_PROBE, "registered"); + PDEBUG(D_PROBE, "v%s registered", version); return 0; } diff --git a/trunk/drivers/media/video/ivtv/Kconfig b/trunk/drivers/media/video/ivtv/Kconfig index 0069898bddab..5d7ee8fcdd50 100644 --- a/trunk/drivers/media/video/ivtv/Kconfig +++ b/trunk/drivers/media/video/ivtv/Kconfig @@ -2,7 +2,9 @@ config VIDEO_IVTV tristate "Conexant cx23416/cx23415 MPEG encoder/decoder support" depends on VIDEO_V4L1 && VIDEO_V4L2 && PCI && I2C && EXPERIMENTAL depends on INPUT # due to VIDEO_IR + depends on HOTPLUG # due to FW_LOADER select I2C_ALGOBIT + select FW_LOADER select VIDEO_IR select VIDEO_TUNER select VIDEO_TVEEPROM diff --git a/trunk/drivers/media/video/ivtv/ivtv-driver.c b/trunk/drivers/media/video/ivtv/ivtv-driver.c index aea1664948ce..41fd79279bb5 100644 --- a/trunk/drivers/media/video/ivtv/ivtv-driver.c +++ b/trunk/drivers/media/video/ivtv/ivtv-driver.c @@ -465,8 +465,9 @@ static void ivtv_process_eeprom(struct ivtv *itv) if (itv->options.radio == -1) itv->options.radio = (tv.has_radio != 0); /* only enable newi2c if an IR blaster is present */ - if (itv->options.newi2c == -1 && tv.has_ir) { - itv->options.newi2c = (tv.has_ir & 4) ? 1 : 0; + /* FIXME: for 2.6.20 the test against 2 should be removed */ + if (itv->options.newi2c == -1 && tv.has_ir != -1 && tv.has_ir != 2) { + itv->options.newi2c = (tv.has_ir & 2) ? 1 : 0; if (itv->options.newi2c) { IVTV_INFO("Reopen i2c bus for IR-blaster support\n"); exit_ivtv_i2c(itv); diff --git a/trunk/drivers/media/video/ivtv/ivtv-driver.h b/trunk/drivers/media/video/ivtv/ivtv-driver.h index ab287b48fc2b..a08bb3331cfb 100644 --- a/trunk/drivers/media/video/ivtv/ivtv-driver.h +++ b/trunk/drivers/media/video/ivtv/ivtv-driver.h @@ -60,7 +60,6 @@ #include #include #include -#include #include #include diff --git a/trunk/drivers/media/video/ivtv/ivtv-ioctl.c b/trunk/drivers/media/video/ivtv/ivtv-ioctl.c index 61030309d0ad..52e00a7f3110 100644 --- a/trunk/drivers/media/video/ivtv/ivtv-ioctl.c +++ b/trunk/drivers/media/video/ivtv/ivtv-ioctl.c @@ -1842,73 +1842,69 @@ int ivtv_v4l2_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, return res; } -static const struct v4l2_ioctl_ops ivtv_ioctl_ops = { - .vidioc_querycap = ivtv_querycap, - .vidioc_g_priority = ivtv_g_priority, - .vidioc_s_priority = ivtv_s_priority, - .vidioc_s_audio = ivtv_s_audio, - .vidioc_g_audio = ivtv_g_audio, - .vidioc_enumaudio = ivtv_enumaudio, - .vidioc_s_audout = ivtv_s_audout, - .vidioc_g_audout = ivtv_g_audout, - .vidioc_enum_input = ivtv_enum_input, - .vidioc_enum_output = ivtv_enum_output, - .vidioc_enumaudout = ivtv_enumaudout, - .vidioc_cropcap = ivtv_cropcap, - .vidioc_s_crop = ivtv_s_crop, - .vidioc_g_crop = ivtv_g_crop, - .vidioc_g_input = ivtv_g_input, - .vidioc_s_input = ivtv_s_input, - .vidioc_g_output = ivtv_g_output, - .vidioc_s_output = ivtv_s_output, - .vidioc_g_frequency = ivtv_g_frequency, - .vidioc_s_frequency = ivtv_s_frequency, - .vidioc_s_tuner = ivtv_s_tuner, - .vidioc_g_tuner = ivtv_g_tuner, - .vidioc_g_enc_index = ivtv_g_enc_index, - .vidioc_g_fbuf = ivtv_g_fbuf, - .vidioc_s_fbuf = ivtv_s_fbuf, - .vidioc_g_std = ivtv_g_std, - .vidioc_s_std = ivtv_s_std, - .vidioc_overlay = ivtv_overlay, - .vidioc_log_status = ivtv_log_status, - .vidioc_enum_fmt_vid_cap = ivtv_enum_fmt_vid_cap, - .vidioc_encoder_cmd = ivtv_encoder_cmd, - .vidioc_try_encoder_cmd = ivtv_try_encoder_cmd, - .vidioc_enum_fmt_vid_out = ivtv_enum_fmt_vid_out, - .vidioc_g_fmt_vid_cap = ivtv_g_fmt_vid_cap, - .vidioc_g_fmt_vbi_cap = ivtv_g_fmt_vbi_cap, - .vidioc_g_fmt_sliced_vbi_cap = ivtv_g_fmt_sliced_vbi_cap, - .vidioc_g_fmt_vid_out = ivtv_g_fmt_vid_out, - .vidioc_g_fmt_vid_out_overlay = ivtv_g_fmt_vid_out_overlay, - .vidioc_g_fmt_sliced_vbi_out = ivtv_g_fmt_sliced_vbi_out, - .vidioc_s_fmt_vid_cap = ivtv_s_fmt_vid_cap, - .vidioc_s_fmt_vbi_cap = ivtv_s_fmt_vbi_cap, - .vidioc_s_fmt_sliced_vbi_cap = ivtv_s_fmt_sliced_vbi_cap, - .vidioc_s_fmt_vid_out = ivtv_s_fmt_vid_out, - .vidioc_s_fmt_vid_out_overlay = ivtv_s_fmt_vid_out_overlay, - .vidioc_s_fmt_sliced_vbi_out = ivtv_s_fmt_sliced_vbi_out, - .vidioc_try_fmt_vid_cap = ivtv_try_fmt_vid_cap, - .vidioc_try_fmt_vbi_cap = ivtv_try_fmt_vbi_cap, - .vidioc_try_fmt_sliced_vbi_cap = ivtv_try_fmt_sliced_vbi_cap, - .vidioc_try_fmt_vid_out = ivtv_try_fmt_vid_out, - .vidioc_try_fmt_vid_out_overlay = ivtv_try_fmt_vid_out_overlay, - .vidioc_try_fmt_sliced_vbi_out = ivtv_try_fmt_sliced_vbi_out, - .vidioc_g_sliced_vbi_cap = ivtv_g_sliced_vbi_cap, - .vidioc_g_chip_ident = ivtv_g_chip_ident, -#ifdef CONFIG_VIDEO_ADV_DEBUG - .vidioc_g_register = ivtv_g_register, - .vidioc_s_register = ivtv_s_register, -#endif - .vidioc_default = ivtv_default, - .vidioc_queryctrl = ivtv_queryctrl, - .vidioc_querymenu = ivtv_querymenu, - .vidioc_g_ext_ctrls = ivtv_g_ext_ctrls, - .vidioc_s_ext_ctrls = ivtv_s_ext_ctrls, - .vidioc_try_ext_ctrls = ivtv_try_ext_ctrls, -}; - void ivtv_set_funcs(struct video_device *vdev) { - vdev->ioctl_ops = &ivtv_ioctl_ops; + vdev->vidioc_querycap = ivtv_querycap; + vdev->vidioc_g_priority = ivtv_g_priority; + vdev->vidioc_s_priority = ivtv_s_priority; + vdev->vidioc_s_audio = ivtv_s_audio; + vdev->vidioc_g_audio = ivtv_g_audio; + vdev->vidioc_enumaudio = ivtv_enumaudio; + vdev->vidioc_s_audout = ivtv_s_audout; + vdev->vidioc_g_audout = ivtv_g_audout; + vdev->vidioc_enum_input = ivtv_enum_input; + vdev->vidioc_enum_output = ivtv_enum_output; + vdev->vidioc_enumaudout = ivtv_enumaudout; + vdev->vidioc_cropcap = ivtv_cropcap; + vdev->vidioc_s_crop = ivtv_s_crop; + vdev->vidioc_g_crop = ivtv_g_crop; + vdev->vidioc_g_input = ivtv_g_input; + vdev->vidioc_s_input = ivtv_s_input; + vdev->vidioc_g_output = ivtv_g_output; + vdev->vidioc_s_output = ivtv_s_output; + vdev->vidioc_g_frequency = ivtv_g_frequency; + vdev->vidioc_s_frequency = ivtv_s_frequency; + vdev->vidioc_s_tuner = ivtv_s_tuner; + vdev->vidioc_g_tuner = ivtv_g_tuner; + vdev->vidioc_g_enc_index = ivtv_g_enc_index; + vdev->vidioc_g_fbuf = ivtv_g_fbuf; + vdev->vidioc_s_fbuf = ivtv_s_fbuf; + vdev->vidioc_g_std = ivtv_g_std; + vdev->vidioc_s_std = ivtv_s_std; + vdev->vidioc_overlay = ivtv_overlay; + vdev->vidioc_log_status = ivtv_log_status; + vdev->vidioc_enum_fmt_vid_cap = ivtv_enum_fmt_vid_cap; + vdev->vidioc_encoder_cmd = ivtv_encoder_cmd; + vdev->vidioc_try_encoder_cmd = ivtv_try_encoder_cmd; + vdev->vidioc_enum_fmt_vid_out = ivtv_enum_fmt_vid_out; + vdev->vidioc_g_fmt_vid_cap = ivtv_g_fmt_vid_cap; + vdev->vidioc_g_fmt_vbi_cap = ivtv_g_fmt_vbi_cap; + vdev->vidioc_g_fmt_sliced_vbi_cap = ivtv_g_fmt_sliced_vbi_cap; + vdev->vidioc_g_fmt_vid_out = ivtv_g_fmt_vid_out; + vdev->vidioc_g_fmt_vid_out_overlay = ivtv_g_fmt_vid_out_overlay; + vdev->vidioc_g_fmt_sliced_vbi_out = ivtv_g_fmt_sliced_vbi_out; + vdev->vidioc_s_fmt_vid_cap = ivtv_s_fmt_vid_cap; + vdev->vidioc_s_fmt_vbi_cap = ivtv_s_fmt_vbi_cap; + vdev->vidioc_s_fmt_sliced_vbi_cap = ivtv_s_fmt_sliced_vbi_cap; + vdev->vidioc_s_fmt_vid_out = ivtv_s_fmt_vid_out; + vdev->vidioc_s_fmt_vid_out_overlay = ivtv_s_fmt_vid_out_overlay; + vdev->vidioc_s_fmt_sliced_vbi_out = ivtv_s_fmt_sliced_vbi_out; + vdev->vidioc_try_fmt_vid_cap = ivtv_try_fmt_vid_cap; + vdev->vidioc_try_fmt_vbi_cap = ivtv_try_fmt_vbi_cap; + vdev->vidioc_try_fmt_sliced_vbi_cap = ivtv_try_fmt_sliced_vbi_cap; + vdev->vidioc_try_fmt_vid_out = ivtv_try_fmt_vid_out; + vdev->vidioc_try_fmt_vid_out_overlay = ivtv_try_fmt_vid_out_overlay; + vdev->vidioc_try_fmt_sliced_vbi_out = ivtv_try_fmt_sliced_vbi_out; + vdev->vidioc_g_sliced_vbi_cap = ivtv_g_sliced_vbi_cap; + vdev->vidioc_g_chip_ident = ivtv_g_chip_ident; +#ifdef CONFIG_VIDEO_ADV_DEBUG + vdev->vidioc_g_register = ivtv_g_register; + vdev->vidioc_s_register = ivtv_s_register; +#endif + vdev->vidioc_default = ivtv_default; + vdev->vidioc_queryctrl = ivtv_queryctrl; + vdev->vidioc_querymenu = ivtv_querymenu; + vdev->vidioc_g_ext_ctrls = ivtv_g_ext_ctrls; + vdev->vidioc_s_ext_ctrls = ivtv_s_ext_ctrls; + vdev->vidioc_try_ext_ctrls = ivtv_try_ext_ctrls; } diff --git a/trunk/drivers/media/video/ivtv/ivtv-streams.c b/trunk/drivers/media/video/ivtv/ivtv-streams.c index 54d2023b26c4..f8883b487f4a 100644 --- a/trunk/drivers/media/video/ivtv/ivtv-streams.c +++ b/trunk/drivers/media/video/ivtv/ivtv-streams.c @@ -208,11 +208,16 @@ static int ivtv_prep_dev(struct ivtv *itv, int type) return -ENOMEM; } + s->v4l2dev->type = VID_TYPE_CAPTURE | VID_TYPE_TUNER | VID_TYPE_TELETEXT | + VID_TYPE_CLIPPING | VID_TYPE_SCALES | VID_TYPE_MPEG_ENCODER; + if (itv->v4l2_cap & V4L2_CAP_VIDEO_OUTPUT) { + s->v4l2dev->type |= VID_TYPE_MPEG_DECODER; + } snprintf(s->v4l2dev->name, sizeof(s->v4l2dev->name), "ivtv%d %s", itv->num, s->name); s->v4l2dev->minor = minor; - s->v4l2dev->parent = &itv->dev->dev; + s->v4l2dev->dev = &itv->dev->dev; s->v4l2dev->fops = ivtv_stream_info[type].fops; s->v4l2dev->release = video_device_release; s->v4l2dev->tvnorms = V4L2_STD_ALL; diff --git a/trunk/drivers/media/video/m52790.c b/trunk/drivers/media/video/m52790.c index 89a781c6929d..39bf6b114d50 100644 --- a/trunk/drivers/media/video/m52790.c +++ b/trunk/drivers/media/video/m52790.c @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/trunk/drivers/media/video/meye.c b/trunk/drivers/media/video/meye.c index 7c8ef6ac6c39..2fb5854cf6f0 100644 --- a/trunk/drivers/media/video/meye.c +++ b/trunk/drivers/media/video/meye.c @@ -31,7 +31,6 @@ #include #include #include -#include #include #include #include @@ -1698,7 +1697,13 @@ static const struct file_operations meye_fops = { .llseek = no_llseek, }; -static const struct v4l2_ioctl_ops meye_ioctl_ops = { +static struct video_device meye_template = { + .owner = THIS_MODULE, + .name = "meye", + .type = VID_TYPE_CAPTURE, + .fops = &meye_fops, + .release = video_device_release, + .minor = -1, .vidioc_querycap = vidioc_querycap, .vidioc_enum_input = vidioc_enum_input, .vidioc_g_input = vidioc_g_input, @@ -1719,14 +1724,6 @@ static const struct v4l2_ioctl_ops meye_ioctl_ops = { .vidioc_default = vidioc_default, }; -static struct video_device meye_template = { - .name = "meye", - .fops = &meye_fops, - .ioctl_ops = &meye_ioctl_ops, - .release = video_device_release, - .minor = -1, -}; - #ifdef CONFIG_PM static int meye_suspend(struct pci_dev *pdev, pm_message_t state) { @@ -1804,7 +1801,7 @@ static int __devinit meye_probe(struct pci_dev *pcidev, } memcpy(meye.video_dev, &meye_template, sizeof(meye_template)); - meye.video_dev->parent = &meye.mchip_dev->dev; + meye.video_dev->dev = &meye.mchip_dev->dev; if ((ret = sony_pic_camera_command(SONY_PIC_COMMAND_SETCAMERA, 1))) { printk(KERN_ERR "meye: unable to power on the camera\n"); diff --git a/trunk/drivers/media/video/msp3400-driver.c b/trunk/drivers/media/video/msp3400-driver.c index 3da74dcee902..5691e019d195 100644 --- a/trunk/drivers/media/video/msp3400-driver.c +++ b/trunk/drivers/media/video/msp3400-driver.c @@ -51,9 +51,9 @@ #include #include #include +#include #include #include -#include #include #include #include diff --git a/trunk/drivers/media/video/msp3400-kthreads.c b/trunk/drivers/media/video/msp3400-kthreads.c index 846a14a61fd1..1622f70e4dd0 100644 --- a/trunk/drivers/media/video/msp3400-kthreads.c +++ b/trunk/drivers/media/video/msp3400-kthreads.c @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include diff --git a/trunk/drivers/media/video/mt9m001.c b/trunk/drivers/media/video/mt9m001.c index 554d2295484e..ee43499544c1 100644 --- a/trunk/drivers/media/video/mt9m001.c +++ b/trunk/drivers/media/video/mt9m001.c @@ -120,7 +120,7 @@ static int mt9m001_init(struct soc_camera_device *icd) int ret; /* Disable chip, synchronous option update */ - dev_dbg(icd->vdev->parent, "%s\n", __func__); + dev_dbg(icd->vdev->dev, "%s\n", __func__); ret = reg_write(icd, MT9M001_RESET, 1); if (ret >= 0) diff --git a/trunk/drivers/media/video/ov511.c b/trunk/drivers/media/video/ov511.c index 9edaca4371d7..eafb0c7736e6 100644 --- a/trunk/drivers/media/video/ov511.c +++ b/trunk/drivers/media/video/ov511.c @@ -4666,7 +4666,9 @@ static const struct file_operations ov511_fops = { }; static struct video_device vdev_template = { + .owner = THIS_MODULE, .name = "OV511 USB Camera", + .type = VID_TYPE_CAPTURE, .fops = &ov511_fops, .release = video_device_release, .minor = -1, @@ -5659,43 +5661,43 @@ static int ov_create_sysfs(struct video_device *vdev) { int rc; - rc = device_create_file(&vdev->dev, &dev_attr_custom_id); + rc = video_device_create_file(vdev, &dev_attr_custom_id); if (rc) goto err; - rc = device_create_file(&vdev->dev, &dev_attr_model); + rc = video_device_create_file(vdev, &dev_attr_model); if (rc) goto err_id; - rc = device_create_file(&vdev->dev, &dev_attr_bridge); + rc = video_device_create_file(vdev, &dev_attr_bridge); if (rc) goto err_model; - rc = device_create_file(&vdev->dev, &dev_attr_sensor); + rc = video_device_create_file(vdev, &dev_attr_sensor); if (rc) goto err_bridge; - rc = device_create_file(&vdev->dev, &dev_attr_brightness); + rc = video_device_create_file(vdev, &dev_attr_brightness); if (rc) goto err_sensor; - rc = device_create_file(&vdev->dev, &dev_attr_saturation); + rc = video_device_create_file(vdev, &dev_attr_saturation); if (rc) goto err_bright; - rc = device_create_file(&vdev->dev, &dev_attr_contrast); + rc = video_device_create_file(vdev, &dev_attr_contrast); if (rc) goto err_sat; - rc = device_create_file(&vdev->dev, &dev_attr_hue); + rc = video_device_create_file(vdev, &dev_attr_hue); if (rc) goto err_contrast; - rc = device_create_file(&vdev->dev, &dev_attr_exposure); + rc = video_device_create_file(vdev, &dev_attr_exposure); if (rc) goto err_hue; return 0; err_hue: - device_remove_file(&vdev->dev, &dev_attr_hue); + video_device_remove_file(vdev, &dev_attr_hue); err_contrast: - device_remove_file(&vdev->dev, &dev_attr_contrast); + video_device_remove_file(vdev, &dev_attr_contrast); err_sat: - device_remove_file(&vdev->dev, &dev_attr_saturation); + video_device_remove_file(vdev, &dev_attr_saturation); err_bright: - device_remove_file(&vdev->dev, &dev_attr_brightness); + video_device_remove_file(vdev, &dev_attr_brightness); err_sensor: - device_remove_file(&vdev->dev, &dev_attr_sensor); + video_device_remove_file(vdev, &dev_attr_sensor); err_bridge: - device_remove_file(&vdev->dev, &dev_attr_bridge); + video_device_remove_file(vdev, &dev_attr_bridge); err_model: - device_remove_file(&vdev->dev, &dev_attr_model); + video_device_remove_file(vdev, &dev_attr_model); err_id: - device_remove_file(&vdev->dev, &dev_attr_custom_id); + video_device_remove_file(vdev, &dev_attr_custom_id); err: return rc; } @@ -5831,7 +5833,7 @@ ov51x_probe(struct usb_interface *intf, const struct usb_device_id *id) goto error; memcpy(ov->vdev, &vdev_template, sizeof(*ov->vdev)); - ov->vdev->parent = &intf->dev; + ov->vdev->dev = &intf->dev; video_set_drvdata(ov->vdev, ov); for (i = 0; i < OV511_MAX_UNIT_VIDEO; i++) { diff --git a/trunk/drivers/media/video/ov511.h b/trunk/drivers/media/video/ov511.h index baded1262ca9..1010e51189b7 100644 --- a/trunk/drivers/media/video/ov511.h +++ b/trunk/drivers/media/video/ov511.h @@ -4,7 +4,6 @@ #include #include #include -#include #include #include diff --git a/trunk/drivers/media/video/planb.c b/trunk/drivers/media/video/planb.c index e69de29bb2d1..36047d4e70f6 100644 --- a/trunk/drivers/media/video/planb.c +++ b/trunk/drivers/media/video/planb.c @@ -0,0 +1,2309 @@ +/* + planb - PlanB frame grabber driver + + PlanB is used in the 7x00/8x00 series of PowerMacintosh + Computers as video input DMA controller. + + Copyright (C) 1998 Michel Lanners (mlan@cpu.lu) + + Based largely on the bttv driver by Ralph Metzler (rjkm@thp.uni-koeln.de) + + Additional debugging and coding by Takashi Oe (toe@unlserve.unl.edu) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +/* $Id: planb.c,v 1.18 1999/05/02 17:36:34 mlan Exp $ */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "planb.h" +#include "saa7196.h" + +/* Would you mind for some ugly debugging? */ +#if 0 +#define DEBUG(x...) printk(KERN_DEBUG ## x) /* Debug driver */ +#else +#define DEBUG(x...) /* Don't debug driver */ +#endif + +#if 0 +#define IDEBUG(x...) printk(KERN_DEBUG ## x) /* Debug interrupt part */ +#else +#define IDEBUG(x...) /* Don't debug interrupt part */ +#endif + +/* Ever seen a Mac with more than 1 of these? */ +#define PLANB_MAX 1 + +static int planb_num; +static struct planb planbs[PLANB_MAX]; +static volatile struct planb_registers *planb_regs; + +static int def_norm = PLANB_DEF_NORM; /* default norm */ +static int video_nr = -1; + +module_param(def_norm, int, 0); +MODULE_PARM_DESC(def_norm, "Default startup norm (0=PAL, 1=NTSC, 2=SECAM)"); +module_param(video_nr, int, 0); +MODULE_LICENSE("GPL"); + + +/* ------------------ PlanB Exported Functions ------------------ */ +static long planb_write(struct video_device *, const char *, unsigned long, int); +static long planb_read(struct video_device *, char *, unsigned long, int); +static int planb_open(struct video_device *, int); +static void planb_close(struct video_device *); +static int planb_ioctl(struct video_device *, unsigned int, void *); +static int planb_init_done(struct video_device *); +static int planb_mmap(struct video_device *, const char *, unsigned long); +static void release_planb(void); +int init_planbs(struct video_init *); + +/* ------------------ PlanB Internal Functions ------------------ */ +static int planb_prepare_open(struct planb *); +static void planb_prepare_close(struct planb *); +static void saa_write_reg(unsigned char, unsigned char); +static unsigned char saa_status(int, struct planb *); +static void saa_set(unsigned char, unsigned char, struct planb *); +static void saa_init_regs(struct planb *); +static int grabbuf_alloc(struct planb *); +static int vgrab(struct planb *, struct video_mmap *); +static void add_clip(struct planb *, struct video_clip *); +static void fill_cmd_buff(struct planb *); +static void cmd_buff(struct planb *); +static volatile struct dbdma_cmd *setup_grab_cmd(int, struct planb *); +static void overlay_start(struct planb *); +static void overlay_stop(struct planb *); +static inline void tab_cmd_dbdma(volatile struct dbdma_cmd *, unsigned short, + unsigned int); +static inline void tab_cmd_store(volatile struct dbdma_cmd *, unsigned int, + unsigned int); +static inline void tab_cmd_gen(volatile struct dbdma_cmd *, unsigned short, + unsigned short, unsigned int, unsigned int); +static int init_planb(struct planb *); +static int find_planb(void); +static void planb_pre_capture(int, int, struct planb *); +static volatile struct dbdma_cmd *cmd_geo_setup(volatile struct dbdma_cmd *, + int, int, int, int, int, struct planb *); +static inline void planb_dbdma_stop(volatile struct dbdma_regs *); +static unsigned int saa_geo_setup(int, int, int, int, struct planb *); +static inline int overlay_is_active(struct planb *); + +/*******************************/ +/* Memory management functions */ +/*******************************/ + +static int grabbuf_alloc(struct planb *pb) +{ + int i, npage; + + npage = MAX_GBUFFERS * ((PLANB_MAX_FBUF / PAGE_SIZE + 1) +#ifndef PLANB_GSCANLINE + + MAX_LNUM +#endif /* PLANB_GSCANLINE */ + ); + if ((pb->rawbuf = kmalloc(npage + * sizeof(unsigned long), GFP_KERNEL)) == 0) + return -ENOMEM; + for (i = 0; i < npage; i++) { + pb->rawbuf[i] = (unsigned char *)__get_free_pages(GFP_KERNEL + |GFP_DMA, 0); + if (!pb->rawbuf[i]) + break; + SetPageReserved(virt_to_page(pb->rawbuf[i])); + } + if (i-- < npage) { + printk(KERN_DEBUG "PlanB: init_grab: grab buffer not allocated\n"); + for (; i > 0; i--) { + ClearPageReserved(virt_to_page(pb->rawbuf[i])); + free_pages((unsigned long)pb->rawbuf[i], 0); + } + kfree(pb->rawbuf); + return -ENOBUFS; + } + pb->rawbuf_size = npage; + return 0; +} + +/*****************************/ +/* Hardware access functions */ +/*****************************/ + +static void saa_write_reg(unsigned char addr, unsigned char val) +{ + planb_regs->saa_addr = addr; eieio(); + planb_regs->saa_regval = val; eieio(); + return; +} + +/* return status byte 0 or 1: */ +static unsigned char saa_status(int byte, struct planb *pb) +{ + saa_regs[pb->win.norm][SAA7196_STDC] = + (saa_regs[pb->win.norm][SAA7196_STDC] & ~2) | ((byte & 1) << 1); + saa_write_reg (SAA7196_STDC, saa_regs[pb->win.norm][SAA7196_STDC]); + + /* Let's wait 30msec for this one */ + msleep_interruptible(30); + + return (unsigned char)in_8 (&planb_regs->saa_status); +} + +static void saa_set(unsigned char addr, unsigned char val, struct planb *pb) +{ + if(saa_regs[pb->win.norm][addr] != val) { + saa_regs[pb->win.norm][addr] = val; + saa_write_reg (addr, val); + } + return; +} + +static void saa_init_regs(struct planb *pb) +{ + int i; + + for (i = 0; i < SAA7196_NUMREGS; i++) + saa_write_reg (i, saa_regs[pb->win.norm][i]); +} + +static unsigned int saa_geo_setup(int width, int height, int interlace, int bpp, + struct planb *pb) +{ + int ht, norm = pb->win.norm; + + switch(bpp) { + case 2: + /* RGB555+a 1x16-bit + 16-bit transparent */ + saa_regs[norm][SAA7196_FMTS] &= ~0x3; + break; + case 1: + case 4: + /* RGB888 1x24-bit + 8-bit transparent */ + saa_regs[norm][SAA7196_FMTS] &= ~0x1; + saa_regs[norm][SAA7196_FMTS] |= 0x2; + break; + default: + return -EINVAL; + } + ht = (interlace ? height / 2 : height); + saa_regs[norm][SAA7196_OUTPIX] = (unsigned char) (width & 0x00ff); + saa_regs[norm][SAA7196_HFILT] = (saa_regs[norm][SAA7196_HFILT] & ~0x3) + | (width >> 8 & 0x3); + saa_regs[norm][SAA7196_OUTLINE] = (unsigned char) (ht & 0xff); + saa_regs[norm][SAA7196_VYP] = (saa_regs[norm][SAA7196_VYP] & ~0x3) + | (ht >> 8 & 0x3); + /* feed both fields if interlaced, or else feed only even fields */ + saa_regs[norm][SAA7196_FMTS] = (interlace) ? + (saa_regs[norm][SAA7196_FMTS] & ~0x60) + : (saa_regs[norm][SAA7196_FMTS] | 0x60); + /* transparent mode; extended format enabled */ + saa_regs[norm][SAA7196_DPATH] |= 0x3; + + return 0; +} + +/***************************/ +/* DBDMA support functions */ +/***************************/ + +static inline void planb_dbdma_restart(volatile struct dbdma_regs *ch) +{ + out_le32(&ch->control, PLANB_CLR(RUN)); + out_le32(&ch->control, PLANB_SET(RUN|WAKE) | PLANB_CLR(PAUSE)); +} + +static inline void planb_dbdma_stop(volatile struct dbdma_regs *ch) +{ + int i = 0; + + out_le32(&ch->control, PLANB_CLR(RUN) | PLANB_SET(FLUSH)); + while((in_le32(&ch->status) == (ACTIVE | FLUSH)) && (i < 999)) { + IDEBUG("PlanB: waiting for DMA to stop\n"); + i++; + } +} + +static inline void tab_cmd_dbdma(volatile struct dbdma_cmd *ch, + unsigned short command, unsigned int cmd_dep) +{ + st_le16(&ch->command, command); + st_le32(&ch->cmd_dep, cmd_dep); +} + +static inline void tab_cmd_store(volatile struct dbdma_cmd *ch, + unsigned int phy_addr, unsigned int cmd_dep) +{ + st_le16(&ch->command, STORE_WORD | KEY_SYSTEM); + st_le16(&ch->req_count, 4); + st_le32(&ch->phy_addr, phy_addr); + st_le32(&ch->cmd_dep, cmd_dep); +} + +static inline void tab_cmd_gen(volatile struct dbdma_cmd *ch, + unsigned short command, unsigned short req_count, + unsigned int phy_addr, unsigned int cmd_dep) +{ + st_le16(&ch->command, command); + st_le16(&ch->req_count, req_count); + st_le32(&ch->phy_addr, phy_addr); + st_le32(&ch->cmd_dep, cmd_dep); +} + +static volatile struct dbdma_cmd *cmd_geo_setup( + volatile struct dbdma_cmd *c1, int width, int height, int interlace, + int bpp, int clip, struct planb *pb) +{ + int norm = pb->win.norm; + + if((saa_geo_setup(width, height, interlace, bpp, pb)) != 0) + return (volatile struct dbdma_cmd *)NULL; + tab_cmd_store(c1++, (unsigned)(&pb->planb_base_phys->saa_addr), + SAA7196_FMTS); + tab_cmd_store(c1++, (unsigned)(&pb->planb_base_phys->saa_regval), + saa_regs[norm][SAA7196_FMTS]); + tab_cmd_store(c1++, (unsigned)(&pb->planb_base_phys->saa_addr), + SAA7196_DPATH); + tab_cmd_store(c1++, (unsigned)(&pb->planb_base_phys->saa_regval), + saa_regs[norm][SAA7196_DPATH]); + tab_cmd_store(c1++, (unsigned)(&pb->planb_base_phys->even), + bpp | ((clip)? PLANB_CLIPMASK: 0)); + tab_cmd_store(c1++, (unsigned)(&pb->planb_base_phys->odd), + bpp | ((clip)? PLANB_CLIPMASK: 0)); + tab_cmd_store(c1++, (unsigned)(&pb->planb_base_phys->saa_addr), + SAA7196_OUTPIX); + tab_cmd_store(c1++, (unsigned)(&pb->planb_base_phys->saa_regval), + saa_regs[norm][SAA7196_OUTPIX]); + tab_cmd_store(c1++, (unsigned)(&pb->planb_base_phys->saa_addr), + SAA7196_HFILT); + tab_cmd_store(c1++, (unsigned)(&pb->planb_base_phys->saa_regval), + saa_regs[norm][SAA7196_HFILT]); + tab_cmd_store(c1++, (unsigned)(&pb->planb_base_phys->saa_addr), + SAA7196_OUTLINE); + tab_cmd_store(c1++, (unsigned)(&pb->planb_base_phys->saa_regval), + saa_regs[norm][SAA7196_OUTLINE]); + tab_cmd_store(c1++, (unsigned)(&pb->planb_base_phys->saa_addr), + SAA7196_VYP); + tab_cmd_store(c1++, (unsigned)(&pb->planb_base_phys->saa_regval), + saa_regs[norm][SAA7196_VYP]); + return c1; +} + +/******************************/ +/* misc. supporting functions */ +/******************************/ + +static inline void planb_lock(struct planb *pb) +{ + mutex_lock(&pb->lock); +} + +static inline void planb_unlock(struct planb *pb) +{ + mutex_unlock(&pb->lock); +} + +/***************/ +/* Driver Core */ +/***************/ + +static int planb_prepare_open(struct planb *pb) +{ + int i, size; + + /* allocate memory for two plus alpha command buffers (size: max lines, + plus 40 commands handling, plus 1 alignment), plus dummy command buf, + plus clipmask buffer, plus frame grabbing status */ + size = (pb->tab_size*(2+MAX_GBUFFERS*TAB_FACTOR)+1+MAX_GBUFFERS + * PLANB_DUMMY)*sizeof(struct dbdma_cmd) + +(PLANB_MAXLINES*((PLANB_MAXPIXELS+7)& ~7))/8 + +MAX_GBUFFERS*sizeof(unsigned int); + if ((pb->priv_space = kzalloc (size, GFP_KERNEL)) == 0) + return -ENOMEM; + pb->overlay_last1 = pb->ch1_cmd = (volatile struct dbdma_cmd *) + DBDMA_ALIGN (pb->priv_space); + pb->overlay_last2 = pb->ch2_cmd = pb->ch1_cmd + pb->tab_size; + pb->ch1_cmd_phys = virt_to_bus(pb->ch1_cmd); + pb->cap_cmd[0] = pb->ch2_cmd + pb->tab_size; + pb->pre_cmd[0] = pb->cap_cmd[0] + pb->tab_size * TAB_FACTOR; + for (i = 1; i < MAX_GBUFFERS; i++) { + pb->cap_cmd[i] = pb->pre_cmd[i-1] + PLANB_DUMMY; + pb->pre_cmd[i] = pb->cap_cmd[i] + pb->tab_size * TAB_FACTOR; + } + pb->frame_stat=(volatile unsigned int *)(pb->pre_cmd[MAX_GBUFFERS-1] + + PLANB_DUMMY); + pb->mask = (unsigned char *)(pb->frame_stat+MAX_GBUFFERS); + + pb->rawbuf = NULL; + pb->rawbuf_size = 0; + pb->grabbing = 0; + for (i = 0; i < MAX_GBUFFERS; i++) { + pb->frame_stat[i] = GBUFFER_UNUSED; + pb->gwidth[i] = 0; + pb->gheight[i] = 0; + pb->gfmt[i] = 0; + pb->gnorm_switch[i] = 0; +#ifndef PLANB_GSCANLINE + pb->lsize[i] = 0; + pb->lnum[i] = 0; +#endif /* PLANB_GSCANLINE */ + } + pb->gcount = 0; + pb->suspend = 0; + pb->last_fr = -999; + pb->prev_last_fr = -999; + + /* Reset DMA controllers */ + planb_dbdma_stop(&pb->planb_base->ch2); + planb_dbdma_stop(&pb->planb_base->ch1); + + return 0; +} + +static void planb_prepare_close(struct planb *pb) +{ + int i; + + /* make sure the dma's are idle */ + planb_dbdma_stop(&pb->planb_base->ch2); + planb_dbdma_stop(&pb->planb_base->ch1); + /* free kernel memory of command buffers */ + if(pb->priv_space != 0) { + kfree (pb->priv_space); + pb->priv_space = 0; + pb->cmd_buff_inited = 0; + } + if(pb->rawbuf) { + for (i = 0; i < pb->rawbuf_size; i++) { + ClearPageReserved(virt_to_page(pb->rawbuf[i])); + free_pages((unsigned long)pb->rawbuf[i], 0); + } + kfree(pb->rawbuf); + } + pb->rawbuf = NULL; +} + +/*****************************/ +/* overlay support functions */ +/*****************************/ + +static inline int overlay_is_active(struct planb *pb) +{ + unsigned int size = pb->tab_size * sizeof(struct dbdma_cmd); + unsigned int caddr = (unsigned)in_le32(&pb->planb_base->ch1.cmdptr); + + return (in_le32(&pb->overlay_last1->cmd_dep) == pb->ch1_cmd_phys) + && (caddr < (pb->ch1_cmd_phys + size)) + && (caddr >= (unsigned)pb->ch1_cmd_phys); +} + +static void overlay_start(struct planb *pb) +{ + + DEBUG("PlanB: overlay_start()\n"); + + if(ACTIVE & in_le32(&pb->planb_base->ch1.status)) { + + DEBUG("PlanB: presumably, grabbing is in progress...\n"); + + planb_dbdma_stop(&pb->planb_base->ch2); + out_le32 (&pb->planb_base->ch2.cmdptr, + virt_to_bus(pb->ch2_cmd)); + planb_dbdma_restart(&pb->planb_base->ch2); + st_le16 (&pb->ch1_cmd->command, DBDMA_NOP); + tab_cmd_dbdma(pb->last_cmd[pb->last_fr], + DBDMA_NOP | BR_ALWAYS, + virt_to_bus(pb->ch1_cmd)); + eieio(); + pb->prev_last_fr = pb->last_fr; + pb->last_fr = -2; + if(!(ACTIVE & in_le32(&pb->planb_base->ch1.status))) { + IDEBUG("PlanB: became inactive " + "in the mean time... reactivating\n"); + planb_dbdma_stop(&pb->planb_base->ch1); + out_le32 (&pb->planb_base->ch1.cmdptr, + virt_to_bus(pb->ch1_cmd)); + planb_dbdma_restart(&pb->planb_base->ch1); + } + } else { + + DEBUG("PlanB: currently idle, so can do whatever\n"); + + planb_dbdma_stop(&pb->planb_base->ch2); + planb_dbdma_stop(&pb->planb_base->ch1); + st_le32 (&pb->planb_base->ch2.cmdptr, + virt_to_bus(pb->ch2_cmd)); + st_le32 (&pb->planb_base->ch1.cmdptr, + virt_to_bus(pb->ch1_cmd)); + out_le16 (&pb->ch1_cmd->command, DBDMA_NOP); + planb_dbdma_restart(&pb->planb_base->ch2); + planb_dbdma_restart(&pb->planb_base->ch1); + pb->last_fr = -1; + } + return; +} + +static void overlay_stop(struct planb *pb) +{ + DEBUG("PlanB: overlay_stop()\n"); + + if(pb->last_fr == -1) { + + DEBUG("PlanB: no grabbing, it seems...\n"); + + planb_dbdma_stop(&pb->planb_base->ch2); + planb_dbdma_stop(&pb->planb_base->ch1); + pb->last_fr = -999; + } else if(pb->last_fr == -2) { + unsigned int cmd_dep; + tab_cmd_dbdma(pb->cap_cmd[pb->prev_last_fr], DBDMA_STOP, 0); + eieio(); + cmd_dep = (unsigned int)in_le32(&pb->overlay_last1->cmd_dep); + if(overlay_is_active(pb)) { + + DEBUG("PlanB: overlay is currently active\n"); + + planb_dbdma_stop(&pb->planb_base->ch2); + planb_dbdma_stop(&pb->planb_base->ch1); + if(cmd_dep != pb->ch1_cmd_phys) { + out_le32(&pb->planb_base->ch1.cmdptr, + virt_to_bus(pb->overlay_last1)); + planb_dbdma_restart(&pb->planb_base->ch1); + } + } + pb->last_fr = pb->prev_last_fr; + pb->prev_last_fr = -999; + } + return; +} + +static void suspend_overlay(struct planb *pb) +{ + int fr = -1; + struct dbdma_cmd last; + + DEBUG("PlanB: suspend_overlay: %d\n", pb->suspend); + + if(pb->suspend++) + return; + if(ACTIVE & in_le32(&pb->planb_base->ch1.status)) { + if(pb->last_fr == -2) { + fr = pb->prev_last_fr; + memcpy(&last, (void*)pb->last_cmd[fr], sizeof(last)); + tab_cmd_dbdma(pb->last_cmd[fr], DBDMA_STOP, 0); + } + if(overlay_is_active(pb)) { + planb_dbdma_stop(&pb->planb_base->ch2); + planb_dbdma_stop(&pb->planb_base->ch1); + pb->suspended.overlay = 1; + pb->suspended.frame = fr; + memcpy(&pb->suspended.cmd, &last, sizeof(last)); + return; + } + } + pb->suspended.overlay = 0; + pb->suspended.frame = fr; + memcpy(&pb->suspended.cmd, &last, sizeof(last)); + return; +} + +static void resume_overlay(struct planb *pb) +{ + + DEBUG("PlanB: resume_overlay: %d\n", pb->suspend); + + if(pb->suspend > 1) + return; + if(pb->suspended.frame != -1) { + memcpy((void*)pb->last_cmd[pb->suspended.frame], + &pb->suspended.cmd, sizeof(pb->suspended.cmd)); + } + if(ACTIVE & in_le32(&pb->planb_base->ch1.status)) { + goto finish; + } + if(pb->suspended.overlay) { + + DEBUG("PlanB: overlay being resumed\n"); + + st_le16 (&pb->ch1_cmd->command, DBDMA_NOP); + st_le16 (&pb->ch2_cmd->command, DBDMA_NOP); + /* Set command buffer addresses */ + st_le32(&pb->planb_base->ch1.cmdptr, + virt_to_bus(pb->overlay_last1)); + out_le32(&pb->planb_base->ch2.cmdptr, + virt_to_bus(pb->overlay_last2)); + /* Start the DMA controller */ + out_le32 (&pb->planb_base->ch2.control, + PLANB_CLR(PAUSE) | PLANB_SET(RUN|WAKE)); + out_le32 (&pb->planb_base->ch1.control, + PLANB_CLR(PAUSE) | PLANB_SET(RUN|WAKE)); + } else if(pb->suspended.frame != -1) { + out_le32(&pb->planb_base->ch1.cmdptr, + virt_to_bus(pb->last_cmd[pb->suspended.frame])); + out_le32 (&pb->planb_base->ch1.control, + PLANB_CLR(PAUSE) | PLANB_SET(RUN|WAKE)); + } + +finish: + pb->suspend--; + wake_up_interruptible(&pb->suspendq); +} + +static void add_clip(struct planb *pb, struct video_clip *clip) +{ + volatile unsigned char *base; + int xc = clip->x, yc = clip->y; + int wc = clip->width, hc = clip->height; + int ww = pb->win.width, hw = pb->win.height; + int x, y, xtmp1, xtmp2; + + DEBUG("PlanB: clip %dx%d+%d+%d\n", wc, hc, xc, yc); + + if(xc < 0) { + wc += xc; + xc = 0; + } + if(yc < 0) { + hc += yc; + yc = 0; + } + if(xc + wc > ww) + wc = ww - xc; + if(wc <= 0) /* Nothing to do */ + return; + if(yc + hc > hw) + hc = hw - yc; + + for (y = yc; y < yc+hc; y++) { + xtmp1=xc>>3; + xtmp2=(xc+wc)>>3; + base = pb->mask + y*96; + if(xc != 0 || wc >= 8) + *(base + xtmp1) &= (unsigned char)(0x00ff & + (0xff00 >> (xc&7))); + for (x = xtmp1 + 1; x < xtmp2; x++) { + *(base + x) = 0; + } + if(xc < (ww & ~0x7)) + *(base + xtmp2) &= (unsigned char)(0x00ff >> + ((xc+wc) & 7)); + } + + return; +} + +static void fill_cmd_buff(struct planb *pb) +{ + int restore = 0; + volatile struct dbdma_cmd last; + + DEBUG("PlanB: fill_cmd_buff()\n"); + + if(pb->overlay_last1 != pb->ch1_cmd) { + restore = 1; + last = *(pb->overlay_last1); + } + memset ((void *) pb->ch1_cmd, 0, 2 * pb->tab_size + * sizeof(struct dbdma_cmd)); + cmd_buff (pb); + if(restore) + *(pb->overlay_last1) = last; + if(pb->suspended.overlay) { + unsigned long jump_addr = in_le32(&pb->overlay_last1->cmd_dep); + if(jump_addr != pb->ch1_cmd_phys) { + int i; + + DEBUG("PlanB: adjusting ch1's jump address\n"); + + for(i = 0; i < MAX_GBUFFERS; i++) { + if(pb->need_pre_capture[i]) { + if(jump_addr == virt_to_bus(pb->pre_cmd[i])) + goto found; + } else { + if(jump_addr == virt_to_bus(pb->cap_cmd[i])) + goto found; + } + } + + DEBUG("PlanB: not found...\n"); + + goto out; +found: + if(pb->need_pre_capture[i]) + out_le32(&pb->pre_cmd[i]->phy_addr, + virt_to_bus(pb->overlay_last1)); + else + out_le32(&pb->cap_cmd[i]->phy_addr, + virt_to_bus(pb->overlay_last1)); + } + } +out: + pb->cmd_buff_inited = 1; + + return; +} + +static void cmd_buff(struct planb *pb) +{ + int i, bpp, count, nlines, stepsize, interlace; + unsigned long base, jump, addr_com, addr_dep; + volatile struct dbdma_cmd *c1 = pb->ch1_cmd; + volatile struct dbdma_cmd *c2 = pb->ch2_cmd; + + interlace = pb->win.interlace; + bpp = pb->win.bpp; + count = (bpp * ((pb->win.x + pb->win.width > pb->win.swidth) ? + (pb->win.swidth - pb->win.x) : pb->win.width)); + nlines = ((pb->win.y + pb->win.height > pb->win.sheight) ? + (pb->win.sheight - pb->win.y) : pb->win.height); + + /* Do video in: */ + + /* Preamble commands: */ + addr_com = virt_to_bus(c1); + addr_dep = virt_to_bus(&c1->cmd_dep); + tab_cmd_dbdma(c1++, DBDMA_NOP, 0); + jump = virt_to_bus(c1+16); /* 14 by cmd_geo_setup() and 2 for padding */ + if((c1 = cmd_geo_setup(c1, pb->win.width, pb->win.height, interlace, + bpp, 1, pb)) == NULL) { + printk(KERN_WARNING "PlanB: encountered serious problems\n"); + tab_cmd_dbdma(pb->ch1_cmd + 1, DBDMA_STOP, 0); + tab_cmd_dbdma(pb->ch2_cmd + 1, DBDMA_STOP, 0); + return; + } + tab_cmd_store(c1++, addr_com, (unsigned)(DBDMA_NOP | BR_ALWAYS) << 16); + tab_cmd_store(c1++, addr_dep, jump); + tab_cmd_store(c1++, (unsigned)(&pb->planb_base_phys->ch1.wait_sel), + PLANB_SET(FIELD_SYNC)); + /* (1) wait for field sync to be set */ + tab_cmd_dbdma(c1++, DBDMA_NOP | WAIT_IFCLR, 0); + tab_cmd_store(c1++, (unsigned)(&pb->planb_base_phys->ch1.br_sel), + PLANB_SET(ODD_FIELD)); + /* wait for field sync to be cleared */ + tab_cmd_dbdma(c1++, DBDMA_NOP | WAIT_IFSET, 0); + /* if not odd field, wait until field sync is set again */ + tab_cmd_dbdma(c1, DBDMA_NOP | BR_IFSET, virt_to_bus(c1-3)); c1++; + /* assert ch_sync to ch2 */ + tab_cmd_store(c1++, (unsigned)(&pb->planb_base_phys->ch2.control), + PLANB_SET(CH_SYNC)); + tab_cmd_store(c1++, (unsigned)(&pb->planb_base_phys->ch1.br_sel), + PLANB_SET(DMA_ABORT)); + + base = (pb->frame_buffer_phys + pb->offset + pb->win.y * (pb->win.bpl + + pb->win.pad) + pb->win.x * bpp); + + if (interlace) { + stepsize = 2; + jump = virt_to_bus(c1 + (nlines + 1) / 2); + } else { + stepsize = 1; + jump = virt_to_bus(c1 + nlines); + } + + /* even field data: */ + for (i=0; i < nlines; i += stepsize, c1++) + tab_cmd_gen(c1, INPUT_MORE | KEY_STREAM0 | BR_IFSET, + count, base + i * (pb->win.bpl + pb->win.pad), jump); + + /* For non-interlaced, we use even fields only */ + if (!interlace) + goto cmd_tab_data_end; + + /* Resync to odd field */ + /* (2) wait for field sync to be set */ + tab_cmd_dbdma(c1++, DBDMA_NOP | WAIT_IFCLR, 0); + tab_cmd_store(c1++, (unsigned)(&pb->planb_base_phys->ch1.br_sel), + PLANB_SET(ODD_FIELD)); + /* wait for field sync to be cleared */ + tab_cmd_dbdma(c1++, DBDMA_NOP | WAIT_IFSET, 0); + /* if not odd field, wait until field sync is set again */ + tab_cmd_dbdma(c1, DBDMA_NOP | BR_IFCLR, virt_to_bus(c1-3)); c1++; + /* assert ch_sync to ch2 */ + tab_cmd_store(c1++, (unsigned)(&pb->planb_base_phys->ch2.control), + PLANB_SET(CH_SYNC)); + tab_cmd_store(c1++, (unsigned)(&pb->planb_base_phys->ch1.br_sel), + PLANB_SET(DMA_ABORT)); + + /* odd field data: */ + jump = virt_to_bus(c1 + nlines / 2); + for (i=1; i < nlines; i += stepsize, c1++) + tab_cmd_gen(c1, INPUT_MORE | KEY_STREAM0 | BR_IFSET, count, + base + i * (pb->win.bpl + pb->win.pad), jump); + + /* And jump back to the start */ +cmd_tab_data_end: + pb->overlay_last1 = c1; /* keep a pointer to the last command */ + tab_cmd_dbdma(c1, DBDMA_NOP | BR_ALWAYS, virt_to_bus(pb->ch1_cmd)); + + /* Clipmask command buffer */ + + /* Preamble commands: */ + tab_cmd_dbdma(c2++, DBDMA_NOP, 0); + tab_cmd_store(c2++, (unsigned)(&pb->planb_base_phys->ch2.wait_sel), + PLANB_SET(CH_SYNC)); + /* wait until ch1 asserts ch_sync */ + tab_cmd_dbdma(c2++, DBDMA_NOP | WAIT_IFCLR, 0); + /* clear ch_sync asserted by ch1 */ + tab_cmd_store(c2++, (unsigned)(&pb->planb_base_phys->ch2.control), + PLANB_CLR(CH_SYNC)); + tab_cmd_store(c2++, (unsigned)(&pb->planb_base_phys->ch2.wait_sel), + PLANB_SET(FIELD_SYNC)); + tab_cmd_store(c2++, (unsigned)(&pb->planb_base_phys->ch2.br_sel), + PLANB_SET(ODD_FIELD)); + + /* jump to end of even field if appropriate */ + /* this points to (interlace)? pos. C: pos. B */ + jump = (interlace) ? virt_to_bus(c2 + (nlines + 1) / 2 + 2): + virt_to_bus(c2 + nlines + 2); + /* if odd field, skip over to odd field clipmasking */ + tab_cmd_dbdma(c2++, DBDMA_NOP | BR_IFSET, jump); + + /* even field mask: */ + tab_cmd_store(c2++, (unsigned)(&pb->planb_base_phys->ch2.br_sel), + PLANB_SET(DMA_ABORT)); + /* this points to pos. B */ + jump = (interlace) ? virt_to_bus(c2 + nlines + 1): + virt_to_bus(c2 + nlines); + base = virt_to_bus(pb->mask); + for (i=0; i < nlines; i += stepsize, c2++) + tab_cmd_gen(c2, OUTPUT_MORE | KEY_STREAM0 | BR_IFSET, 96, + base + i * 96, jump); + + /* For non-interlaced, we use only even fields */ + if(!interlace) + goto cmd_tab_mask_end; + + /* odd field mask: */ +/* C */ tab_cmd_store(c2++, (unsigned)(&pb->planb_base_phys->ch2.br_sel), + PLANB_SET(DMA_ABORT)); + /* this points to pos. B */ + jump = virt_to_bus(c2 + nlines / 2); + base = virt_to_bus(pb->mask); + for (i=1; i < nlines; i += 2, c2++) /* abort if set */ + tab_cmd_gen(c2, OUTPUT_MORE | KEY_STREAM0 | BR_IFSET, 96, + base + i * 96, jump); + + /* Inform channel 1 and jump back to start */ +cmd_tab_mask_end: + /* ok, I just realized this is kind of flawed. */ + /* this part is reached only after odd field clipmasking. */ + /* wanna clean up? */ + /* wait for field sync to be set */ + /* corresponds to fsync (1) of ch1 */ +/* B */ tab_cmd_dbdma(c2++, DBDMA_NOP | WAIT_IFCLR, 0); + /* restart ch1, meant to clear any dead bit or something */ + tab_cmd_store(c2++, (unsigned)(&pb->planb_base_phys->ch1.control), + PLANB_CLR(RUN)); + tab_cmd_store(c2++, (unsigned)(&pb->planb_base_phys->ch1.control), + PLANB_SET(RUN)); + pb->overlay_last2 = c2; /* keep a pointer to the last command */ + /* start over even field clipmasking */ + tab_cmd_dbdma(c2, DBDMA_NOP | BR_ALWAYS, virt_to_bus(pb->ch2_cmd)); + + eieio(); + return; +} + +/*********************************/ +/* grabdisplay support functions */ +/*********************************/ + +static int palette2fmt[] = { + 0, + PLANB_GRAY, + 0, + 0, + 0, + PLANB_COLOUR32, + PLANB_COLOUR15, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, +}; + +#define PLANB_PALETTE_MAX 15 + +static int vgrab(struct planb *pb, struct video_mmap *mp) +{ + unsigned int fr = mp->frame; + unsigned int format; + + if(pb->rawbuf==NULL) { + int err; + if((err=grabbuf_alloc(pb))) + return err; + } + + IDEBUG("PlanB: grab %d: %dx%d(%u)\n", pb->grabbing, + mp->width, mp->height, fr); + + if(pb->grabbing >= MAX_GBUFFERS) + return -ENOBUFS; + if(fr > (MAX_GBUFFERS - 1) || fr < 0) + return -EINVAL; + if(mp->height <= 0 || mp->width <= 0) + return -EINVAL; + if(mp->format < 0 || mp->format >= PLANB_PALETTE_MAX) + return -EINVAL; + if((format = palette2fmt[mp->format]) == 0) + return -EINVAL; + if (mp->height * mp->width * format > PLANB_MAX_FBUF) /* format = bpp */ + return -EINVAL; + + planb_lock(pb); + if(mp->width != pb->gwidth[fr] || mp->height != pb->gheight[fr] || + format != pb->gfmt[fr] || (pb->gnorm_switch[fr])) { + int i; +#ifndef PLANB_GSCANLINE + unsigned int osize = pb->gwidth[fr] * pb->gheight[fr] + * pb->gfmt[fr]; + unsigned int nsize = mp->width * mp->height * format; +#endif + + IDEBUG("PlanB: gwidth = %d, gheight = %d, mp->format = %u\n", + mp->width, mp->height, mp->format); + +#ifndef PLANB_GSCANLINE + if(pb->gnorm_switch[fr]) + nsize = 0; + if (nsize < osize) { + for(i = pb->gbuf_idx[fr]; osize > 0; i++) { + memset((void *)pb->rawbuf[i], 0, PAGE_SIZE); + osize -= PAGE_SIZE; + } + } + for(i = pb->l_fr_addr_idx[fr]; i < pb->l_fr_addr_idx[fr] + + pb->lnum[fr]; i++) + memset((void *)pb->rawbuf[i], 0, PAGE_SIZE); +#else +/* XXX TODO */ +/* + if(pb->gnorm_switch[fr]) + memset((void *)pb->gbuffer[fr], 0, + pb->gbytes_per_line * pb->gheight[fr]); + else { + if(mp-> + for(i = 0; i < pb->gheight[fr]; i++) { + memset((void *)(pb->gbuffer[fr] + + pb->gbytes_per_line * i + } + } +*/ +#endif + pb->gwidth[fr] = mp->width; + pb->gheight[fr] = mp->height; + pb->gfmt[fr] = format; + pb->last_cmd[fr] = setup_grab_cmd(fr, pb); + planb_pre_capture(fr, pb->gfmt[fr], pb); /* gfmt = bpp */ + pb->need_pre_capture[fr] = 1; + pb->gnorm_switch[fr] = 0; + } else + pb->need_pre_capture[fr] = 0; + pb->frame_stat[fr] = GBUFFER_GRABBING; + if(!(ACTIVE & in_le32(&pb->planb_base->ch1.status))) { + + IDEBUG("PlanB: ch1 inactive, initiating grabbing\n"); + + planb_dbdma_stop(&pb->planb_base->ch1); + if(pb->need_pre_capture[fr]) { + + IDEBUG("PlanB: padding pre-capture sequence\n"); + + out_le32 (&pb->planb_base->ch1.cmdptr, + virt_to_bus(pb->pre_cmd[fr])); + } else { + tab_cmd_dbdma(pb->last_cmd[fr], DBDMA_STOP, 0); + tab_cmd_dbdma(pb->cap_cmd[fr], DBDMA_NOP, 0); + /* let's be on the safe side. here is not timing critical. */ + tab_cmd_dbdma((pb->cap_cmd[fr] + 1), DBDMA_NOP, 0); + out_le32 (&pb->planb_base->ch1.cmdptr, + virt_to_bus(pb->cap_cmd[fr])); + } + planb_dbdma_restart(&pb->planb_base->ch1); + pb->last_fr = fr; + } else { + int i; + + IDEBUG("PlanB: ch1 active, grabbing being queued\n"); + + if((pb->last_fr == -1) || ((pb->last_fr == -2) && + overlay_is_active(pb))) { + + IDEBUG("PlanB: overlay is active, grabbing defered\n"); + + tab_cmd_dbdma(pb->last_cmd[fr], + DBDMA_NOP | BR_ALWAYS, + virt_to_bus(pb->ch1_cmd)); + if(pb->need_pre_capture[fr]) { + + IDEBUG("PlanB: padding pre-capture sequence\n"); + + tab_cmd_store(pb->pre_cmd[fr], + virt_to_bus(&pb->overlay_last1->cmd_dep), + virt_to_bus(pb->ch1_cmd)); + eieio(); + out_le32 (&pb->overlay_last1->cmd_dep, + virt_to_bus(pb->pre_cmd[fr])); + } else { + tab_cmd_store(pb->cap_cmd[fr], + virt_to_bus(&pb->overlay_last1->cmd_dep), + virt_to_bus(pb->ch1_cmd)); + tab_cmd_dbdma((pb->cap_cmd[fr] + 1), + DBDMA_NOP, 0); + eieio(); + out_le32 (&pb->overlay_last1->cmd_dep, + virt_to_bus(pb->cap_cmd[fr])); + } + for(i = 0; overlay_is_active(pb) && i < 999; i++) + IDEBUG("PlanB: waiting for overlay done\n"); + tab_cmd_dbdma(pb->ch1_cmd, DBDMA_NOP, 0); + pb->prev_last_fr = fr; + pb->last_fr = -2; + } else if(pb->last_fr == -2) { + + IDEBUG("PlanB: mixed mode detected, grabbing" + " will be done before activating overlay\n"); + + tab_cmd_dbdma(pb->ch1_cmd, DBDMA_NOP, 0); + if(pb->need_pre_capture[fr]) { + + IDEBUG("PlanB: padding pre-capture sequence\n"); + + tab_cmd_dbdma(pb->last_cmd[pb->prev_last_fr], + DBDMA_NOP | BR_ALWAYS, + virt_to_bus(pb->pre_cmd[fr])); + eieio(); + } else { + tab_cmd_dbdma(pb->cap_cmd[fr], DBDMA_NOP, 0); + if(pb->gwidth[pb->prev_last_fr] != + pb->gwidth[fr] + || pb->gheight[pb->prev_last_fr] != + pb->gheight[fr] + || pb->gfmt[pb->prev_last_fr] != + pb->gfmt[fr]) + tab_cmd_dbdma((pb->cap_cmd[fr] + 1), + DBDMA_NOP, 0); + else + tab_cmd_dbdma((pb->cap_cmd[fr] + 1), + DBDMA_NOP | BR_ALWAYS, + virt_to_bus(pb->cap_cmd[fr] + 16)); + tab_cmd_dbdma(pb->last_cmd[pb->prev_last_fr], + DBDMA_NOP | BR_ALWAYS, + virt_to_bus(pb->cap_cmd[fr])); + eieio(); + } + tab_cmd_dbdma(pb->last_cmd[fr], + DBDMA_NOP | BR_ALWAYS, + virt_to_bus(pb->ch1_cmd)); + eieio(); + pb->prev_last_fr = fr; + pb->last_fr = -2; + } else { + + IDEBUG("PlanB: active grabbing session detected\n"); + + if(pb->need_pre_capture[fr]) { + + IDEBUG("PlanB: padding pre-capture sequence\n"); + + tab_cmd_dbdma(pb->last_cmd[pb->last_fr], + DBDMA_NOP | BR_ALWAYS, + virt_to_bus(pb->pre_cmd[fr])); + eieio(); + } else { + tab_cmd_dbdma(pb->last_cmd[fr], DBDMA_STOP, 0); + tab_cmd_dbdma(pb->cap_cmd[fr], DBDMA_NOP, 0); + if(pb->gwidth[pb->last_fr] != pb->gwidth[fr] + || pb->gheight[pb->last_fr] != + pb->gheight[fr] + || pb->gfmt[pb->last_fr] != + pb->gfmt[fr]) + tab_cmd_dbdma((pb->cap_cmd[fr] + 1), + DBDMA_NOP, 0); + else + tab_cmd_dbdma((pb->cap_cmd[fr] + 1), + DBDMA_NOP | BR_ALWAYS, + virt_to_bus(pb->cap_cmd[fr] + 16)); + tab_cmd_dbdma(pb->last_cmd[pb->last_fr], + DBDMA_NOP | BR_ALWAYS, + virt_to_bus(pb->cap_cmd[fr])); + eieio(); + } + pb->last_fr = fr; + } + if(!(ACTIVE & in_le32(&pb->planb_base->ch1.status))) { + + IDEBUG("PlanB: became inactive in the mean time..." + "reactivating\n"); + + planb_dbdma_stop(&pb->planb_base->ch1); + out_le32 (&pb->planb_base->ch1.cmdptr, + virt_to_bus(pb->cap_cmd[fr])); + planb_dbdma_restart(&pb->planb_base->ch1); + } + } + pb->grabbing++; + planb_unlock(pb); + + return 0; +} + +static void planb_pre_capture(int fr, int bpp, struct planb *pb) +{ + volatile struct dbdma_cmd *c1 = pb->pre_cmd[fr]; + int interlace = (pb->gheight[fr] > pb->maxlines/2)? 1: 0; + + tab_cmd_dbdma(c1++, DBDMA_NOP, 0); + if((c1 = cmd_geo_setup(c1, pb->gwidth[fr], pb->gheight[fr], interlace, + bpp, 0, pb)) == NULL) { + printk(KERN_WARNING "PlanB: encountered some problems\n"); + tab_cmd_dbdma(pb->pre_cmd[fr] + 1, DBDMA_STOP, 0); + return; + } + /* Sync to even field */ + tab_cmd_store(c1++, (unsigned)(&pb->planb_base_phys->ch1.wait_sel), + PLANB_SET(FIELD_SYNC)); + tab_cmd_dbdma(c1++, DBDMA_NOP | WAIT_IFCLR, 0); + tab_cmd_store(c1++, (unsigned)(&pb->planb_base_phys->ch1.br_sel), + PLANB_SET(ODD_FIELD)); + tab_cmd_dbdma(c1++, DBDMA_NOP | WAIT_IFSET, 0); + tab_cmd_dbdma(c1, DBDMA_NOP | BR_IFSET, virt_to_bus(c1-3)); c1++; + tab_cmd_dbdma(c1++, DBDMA_NOP | INTR_ALWAYS, 0); + tab_cmd_store(c1++, (unsigned)(&pb->planb_base_phys->ch1.br_sel), + PLANB_SET(DMA_ABORT)); + /* For non-interlaced, we use even fields only */ + if (pb->gheight[fr] <= pb->maxlines/2) + goto cmd_tab_data_end; + /* Sync to odd field */ + tab_cmd_dbdma(c1++, DBDMA_NOP | WAIT_IFCLR, 0); + tab_cmd_store(c1++, (unsigned)(&pb->planb_base_phys->ch1.br_sel), + PLANB_SET(ODD_FIELD)); + tab_cmd_dbdma(c1++, DBDMA_NOP | WAIT_IFSET, 0); + tab_cmd_dbdma(c1, DBDMA_NOP | BR_IFCLR, virt_to_bus(c1-3)); c1++; + tab_cmd_store(c1++, (unsigned)(&pb->planb_base_phys->ch1.br_sel), + PLANB_SET(DMA_ABORT)); +cmd_tab_data_end: + tab_cmd_dbdma(c1, DBDMA_NOP | BR_ALWAYS, virt_to_bus(pb->cap_cmd[fr])); + + eieio(); +} + +static volatile struct dbdma_cmd *setup_grab_cmd(int fr, struct planb *pb) +{ + int i, bpp, count, nlines, stepsize, interlace; +#ifdef PLANB_GSCANLINE + int scanline; +#else + int nlpp, leftover1; + unsigned long base; +#endif + unsigned long jump; + int pagei; + volatile struct dbdma_cmd *c1; + volatile struct dbdma_cmd *jump_addr; + + c1 = pb->cap_cmd[fr]; + interlace = (pb->gheight[fr] > pb->maxlines/2)? 1: 0; + bpp = pb->gfmt[fr]; /* gfmt = bpp */ + count = bpp * pb->gwidth[fr]; + nlines = pb->gheight[fr]; +#ifdef PLANB_GSCANLINE + scanline = pb->gbytes_per_line; +#else + pb->lsize[fr] = count; + pb->lnum[fr] = 0; +#endif + + /* Do video in: */ + + /* Preamble commands: */ + tab_cmd_dbdma(c1++, DBDMA_NOP, 0); + tab_cmd_dbdma(c1, DBDMA_NOP | BR_ALWAYS, virt_to_bus(c1 + 16)); c1++; + if((c1 = cmd_geo_setup(c1, pb->gwidth[fr], pb->gheight[fr], interlace, + bpp, 0, pb)) == NULL) { + printk(KERN_WARNING "PlanB: encountered serious problems\n"); + tab_cmd_dbdma(pb->cap_cmd[fr] + 1, DBDMA_STOP, 0); + return (pb->cap_cmd[fr] + 2); + } + tab_cmd_store(c1++, (unsigned)(&pb->planb_base_phys->ch1.wait_sel), + PLANB_SET(FIELD_SYNC)); + tab_cmd_dbdma(c1++, DBDMA_NOP | WAIT_IFCLR, 0); + tab_cmd_store(c1++, (unsigned)(&pb->planb_base_phys->ch1.br_sel), + PLANB_SET(ODD_FIELD)); + tab_cmd_dbdma(c1++, DBDMA_NOP | WAIT_IFSET, 0); + tab_cmd_dbdma(c1, DBDMA_NOP | BR_IFSET, virt_to_bus(c1-3)); c1++; + tab_cmd_dbdma(c1++, DBDMA_NOP | INTR_ALWAYS, 0); + tab_cmd_store(c1++, (unsigned)(&pb->planb_base_phys->ch1.br_sel), + PLANB_SET(DMA_ABORT)); + + if (interlace) { + stepsize = 2; + jump_addr = c1 + TAB_FACTOR * (nlines + 1) / 2; + } else { + stepsize = 1; + jump_addr = c1 + TAB_FACTOR * nlines; + } + jump = virt_to_bus(jump_addr); + + /* even field data: */ + + pagei = pb->gbuf_idx[fr]; +#ifdef PLANB_GSCANLINE + for (i = 0; i < nlines; i += stepsize) { + tab_cmd_gen(c1++, INPUT_MORE | BR_IFSET, count, + virt_to_bus(pb->rawbuf[pagei + + i * scanline / PAGE_SIZE]), jump); + } +#else + i = 0; + leftover1 = 0; + do { + int j; + + base = virt_to_bus(pb->rawbuf[pagei]); + nlpp = (PAGE_SIZE - leftover1) / count / stepsize; + for(j = 0; j < nlpp && i < nlines; j++, i += stepsize, c1++) + tab_cmd_gen(c1, INPUT_MORE | KEY_STREAM0 | BR_IFSET, + count, base + count * j * stepsize + leftover1, jump); + if(i < nlines) { + int lov0 = PAGE_SIZE - count * nlpp * stepsize - leftover1; + + if(lov0 == 0) + leftover1 = 0; + else { + if(lov0 >= count) { + tab_cmd_gen(c1++, INPUT_MORE | BR_IFSET, count, base + + count * nlpp * stepsize + leftover1, jump); + } else { + pb->l_to_addr[fr][pb->lnum[fr]] = pb->rawbuf[pagei] + + count * nlpp * stepsize + leftover1; + pb->l_to_next_idx[fr][pb->lnum[fr]] = pagei + 1; + pb->l_to_next_size[fr][pb->lnum[fr]] = count - lov0; + tab_cmd_gen(c1++, INPUT_MORE | BR_IFSET, count, + virt_to_bus(pb->rawbuf[pb->l_fr_addr_idx[fr] + + pb->lnum[fr]]), jump); + if(++pb->lnum[fr] > MAX_LNUM) + pb->lnum[fr]--; + } + leftover1 = count * stepsize - lov0; + i += stepsize; + } + } + pagei++; + } while(i < nlines); + tab_cmd_dbdma(c1, DBDMA_NOP | BR_ALWAYS, jump); + c1 = jump_addr; +#endif /* PLANB_GSCANLINE */ + + /* For non-interlaced, we use even fields only */ + if (!interlace) + goto cmd_tab_data_end; + + /* Sync to odd field */ + tab_cmd_dbdma(c1++, DBDMA_NOP | WAIT_IFCLR, 0); + tab_cmd_store(c1++, (unsigned)(&pb->planb_base_phys->ch1.br_sel), + PLANB_SET(ODD_FIELD)); + tab_cmd_dbdma(c1++, DBDMA_NOP | WAIT_IFSET, 0); + tab_cmd_dbdma(c1, DBDMA_NOP | BR_IFCLR, virt_to_bus(c1-3)); c1++; + tab_cmd_store(c1++, (unsigned)(&pb->planb_base_phys->ch1.br_sel), + PLANB_SET(DMA_ABORT)); + + /* odd field data: */ + jump_addr = c1 + TAB_FACTOR * nlines / 2; + jump = virt_to_bus(jump_addr); +#ifdef PLANB_GSCANLINE + for (i = 1; i < nlines; i += stepsize) { + tab_cmd_gen(c1++, INPUT_MORE | BR_IFSET, count, + virt_to_bus(pb->rawbuf[pagei + + i * scanline / PAGE_SIZE]), jump); + } +#else + i = 1; + leftover1 = 0; + pagei = pb->gbuf_idx[fr]; + if(nlines <= 1) + goto skip; + do { + int j; + + base = virt_to_bus(pb->rawbuf[pagei]); + nlpp = (PAGE_SIZE - leftover1) / count / stepsize; + if(leftover1 >= count) { + tab_cmd_gen(c1++, INPUT_MORE | KEY_STREAM0 | BR_IFSET, count, + base + leftover1 - count, jump); + i += stepsize; + } + for(j = 0; j < nlpp && i < nlines; j++, i += stepsize, c1++) + tab_cmd_gen(c1, INPUT_MORE | KEY_STREAM0 | BR_IFSET, count, + base + count * (j * stepsize + 1) + leftover1, jump); + if(i < nlines) { + int lov0 = PAGE_SIZE - count * nlpp * stepsize - leftover1; + + if(lov0 == 0) + leftover1 = 0; + else { + if(lov0 > count) { + pb->l_to_addr[fr][pb->lnum[fr]] = pb->rawbuf[pagei] + + count * (nlpp * stepsize + 1) + leftover1; + pb->l_to_next_idx[fr][pb->lnum[fr]] = pagei + 1; + pb->l_to_next_size[fr][pb->lnum[fr]] = count * stepsize + - lov0; + tab_cmd_gen(c1++, INPUT_MORE | BR_IFSET, count, + virt_to_bus(pb->rawbuf[pb->l_fr_addr_idx[fr] + + pb->lnum[fr]]), jump); + if(++pb->lnum[fr] > MAX_LNUM) + pb->lnum[fr]--; + i += stepsize; + } + leftover1 = count * stepsize - lov0; + } + } + pagei++; + } while(i < nlines); +skip: + tab_cmd_dbdma(c1, DBDMA_NOP | BR_ALWAYS, jump); + c1 = jump_addr; +#endif /* PLANB_GSCANLINE */ + +cmd_tab_data_end: + tab_cmd_store(c1++, (unsigned)(&pb->planb_base_phys->intr_stat), + (fr << 9) | PLANB_FRM_IRQ | PLANB_GEN_IRQ); + /* stop it */ + tab_cmd_dbdma(c1, DBDMA_STOP, 0); + + eieio(); + return c1; +} + +static irqreturn_t planb_irq(int irq, void *dev_id) +{ + unsigned int stat, astat; + struct planb *pb = (struct planb *)dev_id; + + IDEBUG("PlanB: planb_irq()\n"); + + /* get/clear interrupt status bits */ + eieio(); + stat = in_le32(&pb->planb_base->intr_stat); + astat = stat & pb->intr_mask; + out_le32(&pb->planb_base->intr_stat, PLANB_FRM_IRQ + & ~astat & stat & ~PLANB_GEN_IRQ); + IDEBUG("PlanB: stat = %X, astat = %X\n", stat, astat); + + if(astat & PLANB_FRM_IRQ) { + unsigned int fr = stat >> 9; +#ifndef PLANB_GSCANLINE + int i; +#endif + IDEBUG("PlanB: PLANB_FRM_IRQ\n"); + + pb->gcount++; + + IDEBUG("PlanB: grab %d: fr = %d, gcount = %d\n", + pb->grabbing, fr, pb->gcount); +#ifndef PLANB_GSCANLINE + IDEBUG("PlanB: %d * %d bytes are being copied over\n", + pb->lnum[fr], pb->lsize[fr]); + for(i = 0; i < pb->lnum[fr]; i++) { + int first = pb->lsize[fr] - pb->l_to_next_size[fr][i]; + + memcpy(pb->l_to_addr[fr][i], + pb->rawbuf[pb->l_fr_addr_idx[fr] + i], + first); + memcpy(pb->rawbuf[pb->l_to_next_idx[fr][i]], + pb->rawbuf[pb->l_fr_addr_idx[fr] + i] + first, + pb->l_to_next_size[fr][i]); + } +#endif + pb->frame_stat[fr] = GBUFFER_DONE; + pb->grabbing--; + wake_up_interruptible(&pb->capq); + return IRQ_HANDLED; + } + /* incorrect interrupts? */ + pb->intr_mask = PLANB_CLR_IRQ; + out_le32(&pb->planb_base->intr_stat, PLANB_CLR_IRQ); + printk(KERN_ERR "PlanB: IRQ lockup, cleared intrrupts" + " unconditionally\n"); + return IRQ_HANDLED; +} + +/******************************* + * Device Operations functions * + *******************************/ + +static int planb_open(struct video_device *dev, int mode) +{ + struct planb *pb = (struct planb *)dev; + + if (pb->user == 0) { + int err; + if((err = planb_prepare_open(pb)) != 0) + return err; + } + pb->user++; + + DEBUG("PlanB: device opened\n"); + return 0; +} + +static void planb_close(struct video_device *dev) +{ + struct planb *pb = (struct planb *)dev; + + if(pb->user < 1) /* ??? */ + return; + planb_lock(pb); + if (pb->user == 1) { + if (pb->overlay) { + planb_dbdma_stop(&pb->planb_base->ch2); + planb_dbdma_stop(&pb->planb_base->ch1); + pb->overlay = 0; + } + planb_prepare_close(pb); + } + pb->user--; + planb_unlock(pb); + + DEBUG("PlanB: device closed\n"); +} + +static long planb_read(struct video_device *v, char *buf, unsigned long count, + int nonblock) +{ + DEBUG("planb: read request\n"); + return -EINVAL; +} + +static long planb_write(struct video_device *v, const char *buf, + unsigned long count, int nonblock) +{ + DEBUG("planb: write request\n"); + return -EINVAL; +} + +static int planb_ioctl(struct video_device *dev, unsigned int cmd, void *arg) +{ + struct planb *pb=(struct planb *)dev; + + switch (cmd) + { + case VIDIOCGCAP: + { + struct video_capability b; + + DEBUG("PlanB: IOCTL VIDIOCGCAP\n"); + + strcpy (b.name, pb->video_dev.name); + b.type = VID_TYPE_OVERLAY | VID_TYPE_CLIPPING | + VID_TYPE_FRAMERAM | VID_TYPE_SCALES | + VID_TYPE_CAPTURE; + b.channels = 2; /* composite & svhs */ + b.audios = 0; + b.maxwidth = PLANB_MAXPIXELS; + b.maxheight = PLANB_MAXLINES; + b.minwidth = 32; /* wild guess */ + b.minheight = 32; + if (copy_to_user(arg,&b,sizeof(b))) + return -EFAULT; + return 0; + } + case VIDIOCSFBUF: + { + struct video_buffer v; + unsigned short bpp; + unsigned int fmt; + + DEBUG("PlanB: IOCTL VIDIOCSFBUF\n"); + + if (!capable(CAP_SYS_ADMIN) + || !capable(CAP_SYS_RAWIO)) + return -EPERM; + if (copy_from_user(&v, arg,sizeof(v))) + return -EFAULT; + planb_lock(pb); + switch(v.depth) { + case 8: + bpp = 1; + fmt = PLANB_GRAY; + break; + case 15: + case 16: + bpp = 2; + fmt = PLANB_COLOUR15; + break; + case 24: + case 32: + bpp = 4; + fmt = PLANB_COLOUR32; + break; + default: + planb_unlock(pb); + return -EINVAL; + } + if (bpp * v.width > v.bytesperline) { + planb_unlock(pb); + return -EINVAL; + } + pb->win.bpp = bpp; + pb->win.color_fmt = fmt; + pb->frame_buffer_phys = (unsigned long) v.base; + pb->win.sheight = v.height; + pb->win.swidth = v.width; + pb->picture.depth = pb->win.depth = v.depth; + pb->win.bpl = pb->win.bpp * pb->win.swidth; + pb->win.pad = v.bytesperline - pb->win.bpl; + + DEBUG("PlanB: Display at %p is %d by %d, bytedepth %d," + " bpl %d (+ %d)\n", v.base, v.width,v.height, + pb->win.bpp, pb->win.bpl, pb->win.pad); + + pb->cmd_buff_inited = 0; + if(pb->overlay) { + suspend_overlay(pb); + fill_cmd_buff(pb); + resume_overlay(pb); + } + planb_unlock(pb); + return 0; + } + case VIDIOCGFBUF: + { + struct video_buffer v; + + DEBUG("PlanB: IOCTL VIDIOCGFBUF\n"); + + v.base = (void *)pb->frame_buffer_phys; + v.height = pb->win.sheight; + v.width = pb->win.swidth; + v.depth = pb->win.depth; + v.bytesperline = pb->win.bpl + pb->win.pad; + if (copy_to_user(arg, &v, sizeof(v))) + return -EFAULT; + return 0; + } + case VIDIOCCAPTURE: + { + int i; + + if(copy_from_user(&i, arg, sizeof(i))) + return -EFAULT; + if(i==0) { + DEBUG("PlanB: IOCTL VIDIOCCAPTURE Stop\n"); + + if (!(pb->overlay)) + return 0; + planb_lock(pb); + pb->overlay = 0; + overlay_stop(pb); + planb_unlock(pb); + } else { + DEBUG("PlanB: IOCTL VIDIOCCAPTURE Start\n"); + + if (pb->frame_buffer_phys == 0 || + pb->win.width == 0 || + pb->win.height == 0) + return -EINVAL; + if (pb->overlay) + return 0; + planb_lock(pb); + pb->overlay = 1; + if(!(pb->cmd_buff_inited)) + fill_cmd_buff(pb); + overlay_start(pb); + planb_unlock(pb); + } + return 0; + } + case VIDIOCGCHAN: + { + struct video_channel v; + + DEBUG("PlanB: IOCTL VIDIOCGCHAN\n"); + + if(copy_from_user(&v, arg,sizeof(v))) + return -EFAULT; + v.flags = 0; + v.tuners = 0; + v.type = VIDEO_TYPE_CAMERA; + v.norm = pb->win.norm; + switch(v.channel) + { + case 0: + strcpy(v.name,"Composite"); + break; + case 1: + strcpy(v.name,"SVHS"); + break; + default: + return -EINVAL; + break; + } + if(copy_to_user(arg,&v,sizeof(v))) + return -EFAULT; + + return 0; + } + case VIDIOCSCHAN: + { + struct video_channel v; + + DEBUG("PlanB: IOCTL VIDIOCSCHAN\n"); + + if(copy_from_user(&v, arg, sizeof(v))) + return -EFAULT; + + if (v.norm != pb->win.norm) { + int i, maxlines; + + switch (v.norm) + { + case VIDEO_MODE_PAL: + case VIDEO_MODE_SECAM: + maxlines = PLANB_MAXLINES; + break; + case VIDEO_MODE_NTSC: + maxlines = PLANB_NTSC_MAXLINES; + break; + default: + return -EINVAL; + break; + } + planb_lock(pb); + /* empty the grabbing queue */ + wait_event(pb->capq, !pb->grabbing); + pb->maxlines = maxlines; + pb->win.norm = v.norm; + /* Stop overlay if running */ + suspend_overlay(pb); + for(i = 0; i < MAX_GBUFFERS; i++) + pb->gnorm_switch[i] = 1; + /* I know it's an overkill, but.... */ + fill_cmd_buff(pb); + /* ok, now init it accordingly */ + saa_init_regs (pb); + /* restart overlay if it was running */ + resume_overlay(pb); + planb_unlock(pb); + } + + switch(v.channel) + { + case 0: /* Composite */ + saa_set (SAA7196_IOCC, + ((saa_regs[pb->win.norm][SAA7196_IOCC] & + ~7) | 3), pb); + break; + case 1: /* SVHS */ + saa_set (SAA7196_IOCC, + ((saa_regs[pb->win.norm][SAA7196_IOCC] & + ~7) | 4), pb); + break; + default: + return -EINVAL; + break; + } + + return 0; + } + case VIDIOCGPICT: + { + struct video_picture vp = pb->picture; + + DEBUG("PlanB: IOCTL VIDIOCGPICT\n"); + + switch(pb->win.color_fmt) { + case PLANB_GRAY: + vp.palette = VIDEO_PALETTE_GREY; + case PLANB_COLOUR15: + vp.palette = VIDEO_PALETTE_RGB555; + break; + case PLANB_COLOUR32: + vp.palette = VIDEO_PALETTE_RGB32; + break; + default: + vp.palette = 0; + break; + } + + if(copy_to_user(arg,&vp,sizeof(vp))) + return -EFAULT; + return 0; + } + case VIDIOCSPICT: + { + struct video_picture vp; + + DEBUG("PlanB: IOCTL VIDIOCSPICT\n"); + + if(copy_from_user(&vp,arg,sizeof(vp))) + return -EFAULT; + pb->picture = vp; + /* Should we do sanity checks here? */ + saa_set (SAA7196_BRIG, (unsigned char) + ((pb->picture.brightness) >> 8), pb); + saa_set (SAA7196_HUEC, (unsigned char) + ((pb->picture.hue) >> 8) ^ 0x80, pb); + saa_set (SAA7196_CSAT, (unsigned char) + ((pb->picture.colour) >> 9), pb); + saa_set (SAA7196_CONT, (unsigned char) + ((pb->picture.contrast) >> 9), pb); + + return 0; + } + case VIDIOCSWIN: + { + struct video_window vw; + struct video_clip clip; + int i; + + DEBUG("PlanB: IOCTL VIDIOCSWIN\n"); + + if(copy_from_user(&vw,arg,sizeof(vw))) + return -EFAULT; + + planb_lock(pb); + /* Stop overlay if running */ + suspend_overlay(pb); + pb->win.interlace = (vw.height > pb->maxlines/2)? 1: 0; + if (pb->win.x != vw.x || + pb->win.y != vw.y || + pb->win.width != vw.width || + pb->win.height != vw.height || + !pb->cmd_buff_inited) { + pb->win.x = vw.x; + pb->win.y = vw.y; + pb->win.width = vw.width; + pb->win.height = vw.height; + fill_cmd_buff(pb); + } + /* Reset clip mask */ + memset ((void *) pb->mask, 0xff, (pb->maxlines + * ((PLANB_MAXPIXELS + 7) & ~7)) / 8); + /* Add any clip rects */ + for (i = 0; i < vw.clipcount; i++) { + if (copy_from_user(&clip, vw.clips + i, + sizeof(struct video_clip))) + return -EFAULT; + add_clip(pb, &clip); + } + /* restart overlay if it was running */ + resume_overlay(pb); + planb_unlock(pb); + return 0; + } + case VIDIOCGWIN: + { + struct video_window vw; + + DEBUG("PlanB: IOCTL VIDIOCGWIN\n"); + + vw.x=pb->win.x; + vw.y=pb->win.y; + vw.width=pb->win.width; + vw.height=pb->win.height; + vw.chromakey=0; + vw.flags=0; + if(pb->win.interlace) + vw.flags|=VIDEO_WINDOW_INTERLACE; + if(copy_to_user(arg,&vw,sizeof(vw))) + return -EFAULT; + return 0; + } + case VIDIOCSYNC: { + int i; + + IDEBUG("PlanB: IOCTL VIDIOCSYNC\n"); + + if(copy_from_user((void *)&i,arg,sizeof(int))) + return -EFAULT; + + IDEBUG("PlanB: sync to frame %d\n", i); + + if(i > (MAX_GBUFFERS - 1) || i < 0) + return -EINVAL; +chk_grab: + switch (pb->frame_stat[i]) { + case GBUFFER_UNUSED: + return -EINVAL; + case GBUFFER_GRABBING: + IDEBUG("PlanB: waiting for grab" + " done (%d)\n", i); + interruptible_sleep_on(&pb->capq); + if(signal_pending(current)) + return -EINTR; + goto chk_grab; + case GBUFFER_DONE: + pb->frame_stat[i] = GBUFFER_UNUSED; + break; + } + return 0; + } + + case VIDIOCMCAPTURE: + { + struct video_mmap vm; + volatile unsigned int status; + + IDEBUG("PlanB: IOCTL VIDIOCMCAPTURE\n"); + + if(copy_from_user((void *) &vm,(void *)arg,sizeof(vm))) + return -EFAULT; + status = pb->frame_stat[vm.frame]; + if (status != GBUFFER_UNUSED) + return -EBUSY; + + return vgrab(pb, &vm); + } + + case VIDIOCGMBUF: + { + int i; + struct video_mbuf vm; + + DEBUG("PlanB: IOCTL VIDIOCGMBUF\n"); + + memset(&vm, 0 , sizeof(vm)); + vm.size = PLANB_MAX_FBUF * MAX_GBUFFERS; + vm.frames = MAX_GBUFFERS; + for(i = 0; i= SAA7196_NUMREGS) + return -EINVAL; + preg.val = saa_regs[pb->win.norm][preg.addr]; + if(copy_to_user((void *)arg, (void *)&preg, + sizeof(preg))) + return -EFAULT; + return 0; + } + + case PLANBIOCSSAAREGS: + { + struct planb_saa_regs preg; + + DEBUG("PlanB: IOCTL PLANBIOCSSAAREGS\n"); + + if(copy_from_user(&preg, arg, sizeof(preg))) + return -EFAULT; + if(preg.addr >= SAA7196_NUMREGS) + return -EINVAL; + saa_set (preg.addr, preg.val, pb); + return 0; + } + + case PLANBIOCGSTAT: + { + struct planb_stat_regs pstat; + + DEBUG("PlanB: IOCTL PLANBIOCGSTAT\n"); + + pstat.ch1_stat = in_le32(&pb->planb_base->ch1.status); + pstat.ch2_stat = in_le32(&pb->planb_base->ch2.status); + pstat.saa_stat0 = saa_status(0, pb); + pstat.saa_stat1 = saa_status(1, pb); + + if(copy_to_user((void *)arg, (void *)&pstat, + sizeof(pstat))) + return -EFAULT; + return 0; + } + + case PLANBIOCSMODE: { + int v; + + DEBUG("PlanB: IOCTL PLANBIOCSMODE\n"); + + if(copy_from_user(&v, arg, sizeof(v))) + return -EFAULT; + + switch(v) + { + case PLANB_TV_MODE: + saa_set (SAA7196_STDC, + (saa_regs[pb->win.norm][SAA7196_STDC] & + 0x7f), pb); + break; + case PLANB_VTR_MODE: + saa_set (SAA7196_STDC, + (saa_regs[pb->win.norm][SAA7196_STDC] | + 0x80), pb); + break; + default: + return -EINVAL; + break; + } + pb->win.mode = v; + return 0; + } + case PLANBIOCGMODE: { + int v=pb->win.mode; + + DEBUG("PlanB: IOCTL PLANBIOCGMODE\n"); + + if(copy_to_user(arg,&v,sizeof(v))) + return -EFAULT; + return 0; + } +#ifdef PLANB_GSCANLINE + case PLANBG_GRAB_BPL: { + int v=pb->gbytes_per_line; + + DEBUG("PlanB: IOCTL PLANBG_GRAB_BPL\n"); + + if(copy_to_user(arg,&v,sizeof(v))) + return -EFAULT; + return 0; + } +#endif /* PLANB_GSCANLINE */ + case PLANB_INTR_DEBUG: { + int i; + + DEBUG("PlanB: IOCTL PLANB_INTR_DEBUG\n"); + + if(copy_from_user(&i, arg, sizeof(i))) + return -EFAULT; + + /* avoid hang ups all together */ + for (i = 0; i < MAX_GBUFFERS; i++) { + if(pb->frame_stat[i] == GBUFFER_GRABBING) { + pb->frame_stat[i] = GBUFFER_DONE; + } + } + if(pb->grabbing) + pb->grabbing--; + wake_up_interruptible(&pb->capq); + return 0; + } + case PLANB_INV_REGS: { + int i; + struct planb_any_regs any; + + DEBUG("PlanB: IOCTL PLANB_INV_REGS\n"); + + if(copy_from_user(&any, arg, sizeof(any))) + return -EFAULT; + if(any.offset < 0 || any.offset + any.bytes > 0x400) + return -EINVAL; + if(any.bytes > 128) + return -EINVAL; + for (i = 0; i < any.bytes; i++) { + any.data[i] = + in_8((unsigned char *)pb->planb_base + + any.offset + i); + } + if(copy_to_user(arg,&any,sizeof(any))) + return -EFAULT; + return 0; + } + default: + { + DEBUG("PlanB: Unimplemented IOCTL\n"); + return -ENOIOCTLCMD; + } + /* Some IOCTLs are currently unsupported on PlanB */ + case VIDIOCGTUNER: { + DEBUG("PlanB: IOCTL VIDIOCGTUNER\n"); + goto unimplemented; } + case VIDIOCSTUNER: { + DEBUG("PlanB: IOCTL VIDIOCSTUNER\n"); + goto unimplemented; } + case VIDIOCSFREQ: { + DEBUG("PlanB: IOCTL VIDIOCSFREQ\n"); + goto unimplemented; } + case VIDIOCGFREQ: { + DEBUG("PlanB: IOCTL VIDIOCGFREQ\n"); + goto unimplemented; } + case VIDIOCKEY: { + DEBUG("PlanB: IOCTL VIDIOCKEY\n"); + goto unimplemented; } + case VIDIOCSAUDIO: { + DEBUG("PlanB: IOCTL VIDIOCSAUDIO\n"); + goto unimplemented; } + case VIDIOCGAUDIO: { + DEBUG("PlanB: IOCTL VIDIOCGAUDIO\n"); + goto unimplemented; } +unimplemented: + DEBUG(" Unimplemented\n"); + return -ENOIOCTLCMD; + } + return 0; +} + +static int planb_mmap(struct vm_area_struct *vma, struct video_device *dev, const char *adr, unsigned long size) +{ + int i; + struct planb *pb = (struct planb *)dev; + unsigned long start = (unsigned long)adr; + + if (size > MAX_GBUFFERS * PLANB_MAX_FBUF) + return -EINVAL; + if (!pb->rawbuf) { + int err; + if((err=grabbuf_alloc(pb))) + return err; + } + for (i = 0; i < pb->rawbuf_size; i++) { + unsigned long pfn; + + pfn = virt_to_phys((void *)pb->rawbuf[i]) >> PAGE_SHIFT; + if (remap_pfn_range(vma, start, pfn, PAGE_SIZE, PAGE_SHARED)) + return -EAGAIN; + start += PAGE_SIZE; + if (size <= PAGE_SIZE) + break; + size -= PAGE_SIZE; + } + return 0; +} + +static struct video_device planb_template= +{ + .owner = THIS_MODULE, + .name = PLANB_DEVICE_NAME, + .type = VID_TYPE_OVERLAY, + .open = planb_open, + .close = planb_close, + .read = planb_read, + .write = planb_write, + .ioctl = planb_ioctl, + .mmap = planb_mmap, /* mmap? */ +}; + +static int init_planb(struct planb *pb) +{ + unsigned char saa_rev; + int i, result; + + memset ((void *) &pb->win, 0, sizeof (struct planb_window)); + /* Simple sanity check */ + if(def_norm >= NUM_SUPPORTED_NORM || def_norm < 0) { + printk(KERN_ERR "PlanB: Option(s) invalid\n"); + return -2; + } + pb->win.norm = def_norm; + pb->win.mode = PLANB_TV_MODE; /* TV mode */ + pb->win.interlace=1; + pb->win.x=0; + pb->win.y=0; + pb->win.width=768; /* 640 */ + pb->win.height=576; /* 480 */ + pb->maxlines=576; +#if 0 + btv->win.cropwidth=768; /* 640 */ + btv->win.cropheight=576; /* 480 */ + btv->win.cropx=0; + btv->win.cropy=0; +#endif + pb->win.pad=0; + pb->win.bpp=4; + pb->win.depth=32; + pb->win.color_fmt=PLANB_COLOUR32; + pb->win.bpl=1024*pb->win.bpp; + pb->win.swidth=1024; + pb->win.sheight=768; +#ifdef PLANB_GSCANLINE + if((pb->gbytes_per_line = PLANB_MAXPIXELS * 4) > PAGE_SIZE + || (pb->gbytes_per_line <= 0)) + return -3; + else { + /* page align pb->gbytes_per_line for DMA purpose */ + for(i = PAGE_SIZE; pb->gbytes_per_line < (i>>1);) + i>>=1; + pb->gbytes_per_line = i; + } +#endif + pb->tab_size = PLANB_MAXLINES + 40; + pb->suspend = 0; + mutex_init(&pb->lock); + pb->ch1_cmd = 0; + pb->ch2_cmd = 0; + pb->mask = 0; + pb->priv_space = 0; + pb->offset = 0; + pb->user = 0; + pb->overlay = 0; + init_waitqueue_head(&pb->suspendq); + pb->cmd_buff_inited = 0; + pb->frame_buffer_phys = 0; + + /* Reset DMA controllers */ + planb_dbdma_stop(&pb->planb_base->ch2); + planb_dbdma_stop(&pb->planb_base->ch1); + + saa_rev = (saa_status(0, pb) & 0xf0) >> 4; + printk(KERN_INFO "PlanB: SAA7196 video processor rev. %d\n", saa_rev); + /* Initialize the SAA registers in memory and on chip */ + saa_init_regs (pb); + + /* clear interrupt mask */ + pb->intr_mask = PLANB_CLR_IRQ; + + result = request_irq(pb->irq, planb_irq, 0, "PlanB", pb); + if (result < 0) { + if (result==-EINVAL) + printk(KERN_ERR "PlanB: Bad irq number (%d) " + "or handler\n", (int)pb->irq); + else if (result==-EBUSY) + printk(KERN_ERR "PlanB: I don't know why, " + "but IRQ %d is busy\n", (int)pb->irq); + return result; + } + disable_irq(pb->irq); + + /* Now add the template and register the device unit. */ + memcpy(&pb->video_dev,&planb_template,sizeof(planb_template)); + + pb->picture.brightness=0x90<<8; + pb->picture.contrast = 0x70 << 8; + pb->picture.colour = 0x70<<8; + pb->picture.hue = 0x8000; + pb->picture.whiteness = 0; + pb->picture.depth = pb->win.depth; + + pb->frame_stat=NULL; + init_waitqueue_head(&pb->capq); + for(i=0; igbuf_idx[i] = PLANB_MAX_FBUF * i / PAGE_SIZE; + pb->gwidth[i]=0; + pb->gheight[i]=0; + pb->gfmt[i]=0; + pb->cap_cmd[i]=NULL; +#ifndef PLANB_GSCANLINE + pb->l_fr_addr_idx[i] = MAX_GBUFFERS * (PLANB_MAX_FBUF + / PAGE_SIZE + 1) + MAX_LNUM * i; + pb->lsize[i] = 0; + pb->lnum[i] = 0; +#endif + } + pb->rawbuf=NULL; + pb->grabbing=0; + + /* enable interrupts */ + out_le32(&pb->planb_base->intr_stat, PLANB_CLR_IRQ); + pb->intr_mask = PLANB_FRM_IRQ; + enable_irq(pb->irq); + + if(video_register_device(&pb->video_dev, VFL_TYPE_GRABBER, video_nr)<0) + return -1; + + return 0; +} + +/* + * Scan for a PlanB controller, request the irq and map the io memory + */ + +static int find_planb(void) +{ + struct planb *pb; + struct device_node *planb_devices; + unsigned char dev_fn, confreg, bus; + unsigned int old_base, new_base; + unsigned int irq; + struct pci_dev *pdev; + int rc; + + if (!machine_is(powermac)) + return 0; + + planb_devices = of_find_node_by_name(NULL, "planb"); + if (planb_devices == 0) { + planb_num=0; + printk(KERN_WARNING "PlanB: no device found!\n"); + return planb_num; + } + + if (planb_devices->next != NULL) + printk(KERN_ERR "Warning: only using first PlanB device!\n"); + pb = &planbs[0]; + planb_num = 1; + + if (planb_devices->n_addrs != 1) { + printk (KERN_WARNING "PlanB: expecting 1 address for planb " + "(got %d)", planb_devices->n_addrs); + of_node_put(planb_devices); + return 0; + } + + if (planb_devices->n_intrs == 0) { + printk(KERN_WARNING "PlanB: no intrs for device %s\n", + planb_devices->full_name); + of_node_put(planb_devices); + return 0; + } else { + irq = planb_devices->intrs[0].line; + } + + /* Initialize PlanB's PCI registers */ + + /* There is a bug with the way OF assigns addresses + to the devices behind the chaos bridge. + control needs only 0x1000 of space, but decodes only + the upper 16 bits. It therefore occupies a full 64K. + OF assigns the planb controller memory within this space; + so we need to change that here in order to access planb. */ + + /* We remap to 0xf1000000 in hope that nobody uses it ! */ + + bus = (planb_devices->addrs[0].space >> 16) & 0xff; + dev_fn = (planb_devices->addrs[0].space >> 8) & 0xff; + confreg = planb_devices->addrs[0].space & 0xff; + old_base = planb_devices->addrs[0].address; + new_base = 0xf1000000; + of_node_put(planb_devices); + + DEBUG("PlanB: Found on bus %d, dev %d, func %d, " + "membase 0x%x (base reg. 0x%x)\n", + bus, PCI_SLOT(dev_fn), PCI_FUNC(dev_fn), old_base, confreg); + + pdev = pci_get_bus_and_slot(bus, dev_fn); + if (!pdev) { + printk(KERN_ERR "planb: cannot find slot\n"); + goto err_out; + } + + /* Enable response in memory space, bus mastering, + use memory write and invalidate */ + rc = pci_enable_device(pdev); + if (rc) { + printk(KERN_ERR "planb: cannot enable PCI device %s\n", + pci_name(pdev)); + goto err_out; + } + rc = pci_set_mwi(pdev); + if (rc) { + printk(KERN_ERR "planb: cannot enable MWI on PCI device %s\n", + pci_name(pdev)); + goto err_out_disable; + } + pci_set_master(pdev); + + /* Set the new base address */ + pci_write_config_dword (pdev, confreg, new_base); + + planb_regs = (volatile struct planb_registers *) + ioremap (new_base, 0x400); + pb->planb_base = planb_regs; + pb->planb_base_phys = (struct planb_registers *)new_base; + pb->irq = irq; + pb->dev = pdev; + + return planb_num; + +err_out_disable: + pci_disable_device(pdev); +err_out: + /* FIXME handle error */ /* comment moved from pci_find_slot, above */ + pci_dev_put(pdev); + return 0; +} + +static void release_planb(void) +{ + int i; + struct planb *pb; + + for (i=0;iplanb_base->ch2); + planb_dbdma_stop(&pb->planb_base->ch1); + + /* clear and free interrupts */ + pb->intr_mask = PLANB_CLR_IRQ; + out_le32 (&pb->planb_base->intr_stat, PLANB_CLR_IRQ); + free_irq(pb->irq, pb); + + /* make sure all allocated memory are freed */ + planb_prepare_close(pb); + + printk(KERN_INFO "PlanB: unregistering with v4l\n"); + video_unregister_device(&pb->video_dev); + + pci_dev_put(pb->dev); + + /* note that iounmap() does nothing on the PPC right now */ + iounmap ((void *)pb->planb_base); + } +} + +static int __init init_planbs(void) +{ + int i; + + if (find_planb()<=0) + return -EIO; + + for (i=0; i +#include "saa7196.h" +#endif /* __KERNEL__ */ + +#define PLANB_DEVICE_NAME "Apple PlanB Video-In" +#define PLANB_REV "1.0" + +#ifdef __KERNEL__ +//#define PLANB_GSCANLINE /* use this if apps have the notion of */ + /* grab buffer scanline */ +/* This should be safe for both PAL and NTSC */ +#define PLANB_MAXPIXELS 768 +#define PLANB_MAXLINES 576 +#define PLANB_NTSC_MAXLINES 480 + +/* Uncomment your preferred norm ;-) */ +#define PLANB_DEF_NORM VIDEO_MODE_PAL +//#define PLANB_DEF_NORM VIDEO_MODE_NTSC +//#define PLANB_DEF_NORM VIDEO_MODE_SECAM + +/* fields settings */ +#define PLANB_GRAY 0x1 /* 8-bit mono? */ +#define PLANB_COLOUR15 0x2 /* 16-bit mode */ +#define PLANB_COLOUR32 0x4 /* 32-bit mode */ +#define PLANB_CLIPMASK 0x8 /* hardware clipmasking */ + +/* misc. flags for PlanB DMA operation */ +#define CH_SYNC 0x1 /* synchronize channels (set by ch1; + cleared by ch2) */ +#define FIELD_SYNC 0x2 /* used for the start of each field + (0 -> 1 -> 0 for ch1; 0 -> 1 for ch2) */ +#define EVEN_FIELD 0x0 /* even field is detected if unset */ +#define DMA_ABORT 0x2 /* error or just out of sync if set */ +#define ODD_FIELD 0x4 /* odd field is detected if set */ + +/* for capture operations */ +#define MAX_GBUFFERS 2 +/* note PLANB_MAX_FBUF must be divisible by PAGE_SIZE */ +#ifdef PLANB_GSCANLINE +#define PLANB_MAX_FBUF 0x240000 /* 576 * 1024 * 4 */ +#define TAB_FACTOR (1) +#else +#define PLANB_MAX_FBUF 0x1b0000 /* 576 * 768 * 4 */ +#define TAB_FACTOR (2) +#endif +#endif /* __KERNEL__ */ + +struct planb_saa_regs { + unsigned char addr; + unsigned char val; +}; + +struct planb_stat_regs { + unsigned int ch1_stat; + unsigned int ch2_stat; + unsigned char saa_stat0; + unsigned char saa_stat1; +}; + +struct planb_any_regs { + unsigned int offset; + unsigned int bytes; + unsigned char data[128]; +}; + +/* planb private ioctls */ +#define PLANBIOCGSAAREGS _IOWR('v', BASE_VIDIOCPRIVATE, struct planb_saa_regs) /* Read a saa7196 reg value */ +#define PLANBIOCSSAAREGS _IOW('v', BASE_VIDIOCPRIVATE + 1, struct planb_saa_regs) /* Set a saa7196 reg value */ +#define PLANBIOCGSTAT _IOR('v', BASE_VIDIOCPRIVATE + 2, struct planb_stat_regs) /* Read planb status */ +#define PLANB_TV_MODE 1 +#define PLANB_VTR_MODE 2 +#define PLANBIOCGMODE _IOR('v', BASE_VIDIOCPRIVATE + 3, int) /* Get TV/VTR mode */ +#define PLANBIOCSMODE _IOW('v', BASE_VIDIOCPRIVATE + 4, int) /* Set TV/VTR mode */ + +#ifdef PLANB_GSCANLINE +#define PLANBG_GRAB_BPL _IOR('v', BASE_VIDIOCPRIVATE + 5, int) /* # of bytes per scanline in grab buffer */ +#endif + +/* call wake_up_interruptible() with appropriate actions */ +#define PLANB_INTR_DEBUG _IOW('v', BASE_VIDIOCPRIVATE + 20, int) +/* investigate which reg does what */ +#define PLANB_INV_REGS _IOWR('v', BASE_VIDIOCPRIVATE + 21, struct planb_any_regs) + +#ifdef __KERNEL__ + +/* Potentially useful macros */ +#define PLANB_SET(x) ((x) << 16 | (x)) +#define PLANB_CLR(x) ((x) << 16) + +/* This represents the physical register layout */ +struct planb_registers { + volatile struct dbdma_regs ch1; /* 0x00: video in */ + volatile unsigned int even; /* 0x40: even field setting */ + volatile unsigned int odd; /* 0x44; odd field setting */ + unsigned int pad1[14]; /* empty? */ + volatile struct dbdma_regs ch2; /* 0x80: clipmask out */ + unsigned int pad2[16]; /* 0xc0: empty? */ + volatile unsigned int reg3; /* 0x100: ???? */ + volatile unsigned int intr_stat; /* 0x104: irq status */ +#define PLANB_CLR_IRQ 0x00 /* clear Plan B interrupt */ +#define PLANB_GEN_IRQ 0x01 /* assert Plan B interrupt */ +#define PLANB_FRM_IRQ 0x0100 /* end of frame */ + unsigned int pad3[1]; /* empty? */ + volatile unsigned int reg5; /* 0x10c: ??? */ + unsigned int pad4[60]; /* empty? */ + volatile unsigned char saa_addr; /* 0x200: SAA subadr */ + char pad5[3]; + volatile unsigned char saa_regval; /* SAA7196 write reg. val */ + char pad6[3]; + volatile unsigned char saa_status; /* SAA7196 status byte */ + /* There is more unused stuff here */ +}; + +struct planb_window { + int x, y; + ushort width, height; + ushort bpp, bpl, depth, pad; + ushort swidth, sheight; + int norm; + int interlace; + u32 color_fmt; + int chromakey; + int mode; /* used to switch between TV/VTR modes */ +}; + +struct planb_suspend { + int overlay; + int frame; + struct dbdma_cmd cmd; +}; + +struct planb { + struct video_device video_dev; + struct video_picture picture; /* Current picture params */ + struct video_audio audio_dev; /* Current audio params */ + + volatile struct planb_registers *planb_base; /* virt base of planb */ + struct planb_registers *planb_base_phys; /* phys base of planb */ + void *priv_space; /* Org. alloc. mem for kfree */ + int user; + unsigned int tab_size; + int maxlines; + struct mutex lock; + unsigned int irq; /* interrupt number */ + volatile unsigned int intr_mask; + struct pci_dev *dev; /* Our PCI device */ + + int overlay; /* overlay running? */ + struct planb_window win; + unsigned long frame_buffer_phys; /* We need phys for DMA */ + int offset; /* offset of pixel 1 */ + volatile struct dbdma_cmd *ch1_cmd; /* Video In DMA cmd buffer */ + volatile struct dbdma_cmd *ch2_cmd; /* Clip Out DMA cmd buffer */ + volatile struct dbdma_cmd *overlay_last1; + volatile struct dbdma_cmd *overlay_last2; + unsigned long ch1_cmd_phys; + volatile unsigned char *mask; /* Clipmask buffer */ + int suspend; + wait_queue_head_t suspendq; + struct planb_suspend suspended; + int cmd_buff_inited; /* cmd buffer inited? */ + + int grabbing; + unsigned int gcount; + wait_queue_head_t capq; + int last_fr; + int prev_last_fr; + unsigned char **rawbuf; + int rawbuf_size; + int gbuf_idx[MAX_GBUFFERS]; + volatile struct dbdma_cmd *cap_cmd[MAX_GBUFFERS]; + volatile struct dbdma_cmd *last_cmd[MAX_GBUFFERS]; + volatile struct dbdma_cmd *pre_cmd[MAX_GBUFFERS]; + int need_pre_capture[MAX_GBUFFERS]; +#define PLANB_DUMMY 40 /* # of command buf's allocated for pre-capture seq. */ + int gwidth[MAX_GBUFFERS], gheight[MAX_GBUFFERS]; + unsigned int gfmt[MAX_GBUFFERS]; + int gnorm_switch[MAX_GBUFFERS]; + volatile unsigned int *frame_stat; +#define GBUFFER_UNUSED 0x00U +#define GBUFFER_GRABBING 0x01U +#define GBUFFER_DONE 0x02U +#ifdef PLANB_GSCANLINE + int gbytes_per_line; +#else +#define MAX_LNUM 431 /* change this if PLANB_MAXLINES or */ + /* PLANB_MAXPIXELS changes */ + int l_fr_addr_idx[MAX_GBUFFERS]; + unsigned char *l_to_addr[MAX_GBUFFERS][MAX_LNUM]; + int l_to_next_idx[MAX_GBUFFERS][MAX_LNUM]; + int l_to_next_size[MAX_GBUFFERS][MAX_LNUM]; + int lsize[MAX_GBUFFERS], lnum[MAX_GBUFFERS]; +#endif +}; + +#endif /* __KERNEL__ */ + +#endif /* _PLANB_H_ */ diff --git a/trunk/drivers/media/video/pms.c b/trunk/drivers/media/video/pms.c index 00425d743656..51b1461d8fb6 100644 --- a/trunk/drivers/media/video/pms.c +++ b/trunk/drivers/media/video/pms.c @@ -30,7 +30,6 @@ #include #include #include -#include #include #include @@ -895,7 +894,9 @@ static const struct file_operations pms_fops = { static struct video_device pms_template= { + .owner = THIS_MODULE, .name = "Mediavision PMS", + .type = VID_TYPE_CAPTURE, .fops = &pms_fops, }; diff --git a/trunk/drivers/media/video/pvrusb2/Kconfig b/trunk/drivers/media/video/pvrusb2/Kconfig index 19eb274c9cd0..4482b2c72ced 100644 --- a/trunk/drivers/media/video/pvrusb2/Kconfig +++ b/trunk/drivers/media/video/pvrusb2/Kconfig @@ -2,6 +2,8 @@ config VIDEO_PVRUSB2 tristate "Hauppauge WinTV-PVR USB2 support" depends on VIDEO_V4L2 && I2C depends on VIDEO_MEDIA # Avoids pvrusb = Y / DVB = M + depends on HOTPLUG # due to FW_LOADER + select FW_LOADER select VIDEO_TUNER select VIDEO_TVEEPROM select VIDEO_CX2341X diff --git a/trunk/drivers/media/video/pvrusb2/pvrusb2-context.h b/trunk/drivers/media/video/pvrusb2/pvrusb2-context.h index d657e53bbfa3..61801291c2af 100644 --- a/trunk/drivers/media/video/pvrusb2/pvrusb2-context.h +++ b/trunk/drivers/media/video/pvrusb2/pvrusb2-context.h @@ -16,8 +16,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ -#ifndef __PVRUSB2_CONTEXT_H -#define __PVRUSB2_CONTEXT_H +#ifndef __PVRUSB2_BASE_H +#define __PVRUSB2_BASE_H #include #include diff --git a/trunk/drivers/media/video/pvrusb2/pvrusb2-devattr.c b/trunk/drivers/media/video/pvrusb2/pvrusb2-devattr.c index 88e175168438..5d036e7e3f07 100644 --- a/trunk/drivers/media/video/pvrusb2/pvrusb2-devattr.c +++ b/trunk/drivers/media/video/pvrusb2/pvrusb2-devattr.c @@ -97,13 +97,13 @@ static const struct pvr2_device_desc pvr2_device_24xxx = { .flag_has_cx25840 = !0, .flag_has_wm8775 = !0, .flag_has_hauppauge_rom = !0, + .flag_has_hauppauge_custom_ir = !0, .flag_has_analogtuner = !0, .flag_has_fmradio = !0, .flag_has_composite = !0, .flag_has_svideo = !0, .signal_routing_scheme = PVR2_ROUTING_SCHEME_HAUPPAUGE, .led_scheme = PVR2_LED_SCHEME_HAUPPAUGE, - .ir_scheme = PVR2_IR_SCHEME_24XXX, }; @@ -330,7 +330,7 @@ static const char *pvr2_fw1_names_73xxx[] = { }; static const struct pvr2_device_desc pvr2_device_73xxx = { - .description = "WinTV HVR-1900 Model Category 73xxx", + .description = "WinTV PVR USB2 Model Category 73xxx", .shortname = "73xxx", .client_modules.lst = pvr2_client_73xxx, .client_modules.cnt = ARRAY_SIZE(pvr2_client_73xxx), @@ -344,7 +344,6 @@ static const struct pvr2_device_desc pvr2_device_73xxx = { .signal_routing_scheme = PVR2_ROUTING_SCHEME_HAUPPAUGE, .digital_control_scheme = PVR2_DIGITAL_SCHEME_HAUPPAUGE, .led_scheme = PVR2_LED_SCHEME_HAUPPAUGE, - .ir_scheme = PVR2_IR_SCHEME_ZILOG, #ifdef CONFIG_VIDEO_PVRUSB2_DVB .dvb_props = &pvr2_73xxx_dvb_props, #endif @@ -439,7 +438,7 @@ static const char *pvr2_fw1_names_75xxx[] = { }; static const struct pvr2_device_desc pvr2_device_750xx = { - .description = "WinTV HVR-1950 Model Category 750xx", + .description = "WinTV PVR USB2 Model Category 750xx", .shortname = "750xx", .client_modules.lst = pvr2_client_75xxx, .client_modules.cnt = ARRAY_SIZE(pvr2_client_75xxx), @@ -454,14 +453,13 @@ static const struct pvr2_device_desc pvr2_device_750xx = { .digital_control_scheme = PVR2_DIGITAL_SCHEME_HAUPPAUGE, .default_std_mask = V4L2_STD_NTSC_M, .led_scheme = PVR2_LED_SCHEME_HAUPPAUGE, - .ir_scheme = PVR2_IR_SCHEME_ZILOG, #ifdef CONFIG_VIDEO_PVRUSB2_DVB .dvb_props = &pvr2_750xx_dvb_props, #endif }; static const struct pvr2_device_desc pvr2_device_751xx = { - .description = "WinTV HVR-1950 Model Category 751xx", + .description = "WinTV PVR USB2 Model Category 751xx", .shortname = "751xx", .client_modules.lst = pvr2_client_75xxx, .client_modules.cnt = ARRAY_SIZE(pvr2_client_75xxx), @@ -476,7 +474,6 @@ static const struct pvr2_device_desc pvr2_device_751xx = { .digital_control_scheme = PVR2_DIGITAL_SCHEME_HAUPPAUGE, .default_std_mask = V4L2_STD_NTSC_M, .led_scheme = PVR2_LED_SCHEME_HAUPPAUGE, - .ir_scheme = PVR2_IR_SCHEME_ZILOG, #ifdef CONFIG_VIDEO_PVRUSB2_DVB .dvb_props = &pvr2_751xx_dvb_props, #endif diff --git a/trunk/drivers/media/video/pvrusb2/pvrusb2-devattr.h b/trunk/drivers/media/video/pvrusb2/pvrusb2-devattr.h index cb3a33eb0276..e23ce1d2edd7 100644 --- a/trunk/drivers/media/video/pvrusb2/pvrusb2-devattr.h +++ b/trunk/drivers/media/video/pvrusb2/pvrusb2-devattr.h @@ -48,10 +48,6 @@ struct pvr2_string_table { #define PVR2_LED_SCHEME_NONE 0 #define PVR2_LED_SCHEME_HAUPPAUGE 1 -#define PVR2_IR_SCHEME_NONE 0 -#define PVR2_IR_SCHEME_24XXX 1 -#define PVR2_IR_SCHEME_ZILOG 2 - /* This describes a particular hardware type (except for the USB device ID which must live in a separate structure due to environmental constraints). See the top of pvrusb2-hdw.c for where this is @@ -130,19 +126,15 @@ struct pvr2_device_desc { ensure that it is found. */ unsigned int flag_has_wm8775:1; - /* Indicate any specialized IR scheme that might need to be - supported by this driver. If not set, then it is assumed that - IR can work without help from the driver (which is frequently - the case). This is otherwise set to one of - PVR2_IR_SCHEME_xxxx. For "xxxx", the value "24XXX" indicates a - Hauppauge 24xxx class device which has an FPGA-hosted IR - receiver that can only be reached via FX2 command codes. In - that case the pvrusb2 driver will emulate the behavior of the - older 29xxx device's IR receiver (a "virtual" I2C chip) in terms - of those command codes. For the value "ZILOG", we're dealing - with an IR chip that must be taken out of reset via another FX2 - command code (which is the case for HVR-1950 devices). */ - unsigned int ir_scheme:2; + /* Device has IR hardware that can be faked into looking like a + normal Hauppauge i2c IR receiver. This is currently very + specific to the 24xxx device, where Hauppauge had replaced their + 'standard' I2C IR receiver with a bunch of FPGA logic controlled + directly via the FX2. Turning this on tells the pvrusb2 driver + to virtualize the presence of the non-existant IR receiver chip and + implement the virtual receiver in terms of appropriate FX2 + commands. */ + unsigned int flag_has_hauppauge_custom_ir:1; /* These bits define which kinds of sources the device can handle. Note: Digital tuner presence is inferred by the diff --git a/trunk/drivers/media/video/pvrusb2/pvrusb2-fx2-cmd.h b/trunk/drivers/media/video/pvrusb2/pvrusb2-fx2-cmd.h index 614755ea2ea3..b58369e7f30b 100644 --- a/trunk/drivers/media/video/pvrusb2/pvrusb2-fx2-cmd.h +++ b/trunk/drivers/media/video/pvrusb2/pvrusb2-fx2-cmd.h @@ -24,8 +24,6 @@ #define FX2CMD_MEM_WRITE_DWORD 0x01u #define FX2CMD_MEM_READ_DWORD 0x02u -#define FX2CMD_HCW_ZILOG_RESET 0x10u /* 1=reset 0=release */ - #define FX2CMD_MEM_READ_64BYTES 0x28u #define FX2CMD_REG_WRITE 0x04u diff --git a/trunk/drivers/media/video/pvrusb2/pvrusb2-hdw.c b/trunk/drivers/media/video/pvrusb2/pvrusb2-hdw.c index f051c6aa7f1f..a5217a2cf4c0 100644 --- a/trunk/drivers/media/video/pvrusb2/pvrusb2-hdw.c +++ b/trunk/drivers/media/video/pvrusb2/pvrusb2-hdw.c @@ -250,7 +250,6 @@ struct pvr2_fx2cmd_descdef { static const struct pvr2_fx2cmd_descdef pvr2_fx2cmd_desc[] = { {FX2CMD_MEM_WRITE_DWORD, "write encoder dword"}, {FX2CMD_MEM_READ_DWORD, "read encoder dword"}, - {FX2CMD_HCW_ZILOG_RESET, "zilog IR reset control"}, {FX2CMD_MEM_READ_64BYTES, "read encoder 64bytes"}, {FX2CMD_REG_WRITE, "write encoder register"}, {FX2CMD_REG_READ, "read encoder register"}, @@ -1712,14 +1711,6 @@ static void pvr2_hdw_setup_low(struct pvr2_hdw *hdw) if (!pvr2_hdw_dev_ok(hdw)) return; } - /* Take the IR chip out of reset, if appropriate */ - if (hdw->hdw_desc->ir_scheme == PVR2_IR_SCHEME_ZILOG) { - pvr2_issue_simple_cmd(hdw, - FX2CMD_HCW_ZILOG_RESET | - (1 << 8) | - ((0) << 16)); - } - // This step MUST happen after the earlier powerup step. pvr2_i2c_core_init(hdw); if (!pvr2_hdw_dev_ok(hdw)) return; diff --git a/trunk/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c b/trunk/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c index e600576a6c4b..9d3c18b24744 100644 --- a/trunk/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c +++ b/trunk/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c @@ -979,9 +979,7 @@ void pvr2_i2c_core_init(struct pvr2_hdw *hdw) printk(KERN_INFO "%s: IR disabled\n",hdw->name); hdw->i2c_func[0x18] = i2c_black_hole; } else if (ir_mode[hdw->unit_number] == 1) { - if (hdw->hdw_desc->ir_scheme == PVR2_IR_SCHEME_24XXX) { - /* This comment is present PURELY to get - checkpatch.pl to STFU. Lovely, eh? */ + if (hdw->hdw_desc->flag_has_hauppauge_custom_ir) { hdw->i2c_func[0x18] = i2c_24xxx_ir; } } diff --git a/trunk/drivers/media/video/pvrusb2/pvrusb2-v4l2.c b/trunk/drivers/media/video/pvrusb2/pvrusb2-v4l2.c index 00306faeac01..0d72dc470fef 100644 --- a/trunk/drivers/media/video/pvrusb2/pvrusb2-v4l2.c +++ b/trunk/drivers/media/video/pvrusb2/pvrusb2-v4l2.c @@ -30,7 +30,6 @@ #include #include #include -#include struct pvr2_v4l2_dev; struct pvr2_v4l2_fh; @@ -1161,6 +1160,11 @@ static const struct file_operations vdev_fops = { static struct video_device vdev_template = { + .owner = THIS_MODULE, + .type = VID_TYPE_CAPTURE | VID_TYPE_TUNER, + .type2 = (V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_VBI_CAPTURE + | V4L2_CAP_TUNER | V4L2_CAP_AUDIO + | V4L2_CAP_READWRITE), .fops = &vdev_fops, }; diff --git a/trunk/drivers/media/video/pwc/pwc-if.c b/trunk/drivers/media/video/pwc/pwc-if.c index 9aee7cb6f79a..423fa7c2d0c9 100644 --- a/trunk/drivers/media/video/pwc/pwc-if.c +++ b/trunk/drivers/media/video/pwc/pwc-if.c @@ -165,7 +165,9 @@ static const struct file_operations pwc_fops = { .llseek = no_llseek, }; static struct video_device pwc_template = { + .owner = THIS_MODULE, .name = "Philips Webcam", /* Filled in later */ + .type = VID_TYPE_CAPTURE, .release = video_device_release, .fops = &pwc_fops, .minor = -1, @@ -1046,20 +1048,19 @@ static int pwc_create_sysfs_files(struct video_device *vdev) struct pwc_device *pdev = video_get_drvdata(vdev); int rc; - rc = device_create_file(&vdev->dev, &dev_attr_button); + rc = video_device_create_file(vdev, &dev_attr_button); if (rc) goto err; if (pdev->features & FEATURE_MOTOR_PANTILT) { - rc = device_create_file(&vdev->dev, &dev_attr_pan_tilt); + rc = video_device_create_file(vdev, &dev_attr_pan_tilt); if (rc) goto err_button; } return 0; err_button: - device_remove_file(&vdev->dev, &dev_attr_button); + video_device_remove_file(vdev, &dev_attr_button); err: - PWC_ERROR("Could not create sysfs files.\n"); return rc; } @@ -1067,8 +1068,8 @@ static void pwc_remove_sysfs_files(struct video_device *vdev) { struct pwc_device *pdev = video_get_drvdata(vdev); if (pdev->features & FEATURE_MOTOR_PANTILT) - device_remove_file(&vdev->dev, &dev_attr_pan_tilt); - device_remove_file(&vdev->dev, &dev_attr_button); + video_device_remove_file(vdev, &dev_attr_pan_tilt); + video_device_remove_file(vdev, &dev_attr_button); } #ifdef CONFIG_USB_PWC_DEBUG @@ -1766,8 +1767,9 @@ static int usb_pwc_probe(struct usb_interface *intf, const struct usb_device_id return -ENOMEM; } memcpy(pdev->vdev, &pwc_template, sizeof(pwc_template)); - pdev->vdev->parent = &(udev->dev); + pdev->vdev->dev = &(udev->dev); strcpy(pdev->vdev->name, name); + pdev->vdev->owner = THIS_MODULE; video_set_drvdata(pdev->vdev, pdev); pdev->release = le16_to_cpu(udev->descriptor.bcdDevice); diff --git a/trunk/drivers/media/video/pwc/pwc.h b/trunk/drivers/media/video/pwc/pwc.h index 74178754b39b..8e8e5b27e77e 100644 --- a/trunk/drivers/media/video/pwc/pwc.h +++ b/trunk/drivers/media/video/pwc/pwc.h @@ -32,11 +32,9 @@ #include #include #include -#include #include #include #include -#include #include "pwc-uncompress.h" #include diff --git a/trunk/drivers/media/video/s2255drv.c b/trunk/drivers/media/video/s2255drv.c index b1d09d8e2b85..04eb2c3fabd8 100644 --- a/trunk/drivers/media/video/s2255drv.c +++ b/trunk/drivers/media/video/s2255drv.c @@ -47,10 +47,8 @@ #include #include #include -#include #include #include -#include #include #include @@ -186,7 +184,6 @@ struct s2255_dmaqueue { #define S2255_FW_LOADED_DSPWAIT 1 #define S2255_FW_SUCCESS 2 #define S2255_FW_FAILED 3 -#define S2255_FW_DISCONNECTING 4 struct s2255_fw { int fw_loaded; @@ -266,6 +263,7 @@ struct s2255_buffer { struct s2255_fh { struct s2255_dev *dev; + unsigned int resources; const struct s2255_fmt *fmt; unsigned int width; unsigned int height; @@ -275,9 +273,14 @@ struct s2255_fh { /* mode below is the desired mode. mode in s2255_dev is the current mode that was last set */ struct s2255_mode mode; - int resources[MAX_CHANNELS]; }; +/* + * TODO: fixme S2255_MAX_USERS. Do not limit open driver handles. + * Limit V4L to one stream at a time. + */ +#define S2255_MAX_USERS 1 + #define CUR_USB_FWVER 774 /* current cypress EEPROM firmware version */ #define S2255_MAJOR_VERSION 1 #define S2255_MINOR_VERSION 13 @@ -473,9 +476,10 @@ static void s2255_timer(unsigned long user_data) dprintk(100, "s2255 timer\n"); if (usb_submit_urb(data->fw_urb, GFP_ATOMIC) < 0) { printk(KERN_ERR "s2255: can't submit urb\n"); - atomic_set(&data->fw_state, S2255_FW_FAILED); - /* wake up anything waiting for the firmware */ - wake_up(&data->wait_fw); + if (data->fw) { + release_firmware(data->fw); + data->fw = NULL; + } return; } } @@ -505,18 +509,13 @@ static void s2255_fwchunk_complete(struct urb *urb) struct usb_device *udev = urb->dev; int len; dprintk(100, "udev %p urb %p", udev, urb); + /* TODO: fixme. reflect change in status */ if (urb->status) { dev_err(&udev->dev, "URB failed with status %d", urb->status); - atomic_set(&data->fw_state, S2255_FW_FAILED); - /* wake up anything waiting for the firmware */ - wake_up(&data->wait_fw); return; } if (data->fw_urb == NULL) { - dev_err(&udev->dev, "s2255 disconnected\n"); - atomic_set(&data->fw_state, S2255_FW_FAILED); - /* wake up anything waiting for the firmware */ - wake_up(&data->wait_fw); + dev_err(&udev->dev, "early disconncect\n"); return; } #define CHUNK_SIZE 512 @@ -790,8 +789,7 @@ static int res_get(struct s2255_dev *dev, struct s2255_fh *fh) } /* it's free, grab it */ dev->resources[fh->channel] = 1; - fh->resources[fh->channel] = 1; - dprintk(1, "s2255: res: get\n"); + dprintk(1, "res: get\n"); mutex_unlock(&dev->lock); return 1; } @@ -801,18 +799,9 @@ static int res_locked(struct s2255_dev *dev, struct s2255_fh *fh) return dev->resources[fh->channel]; } -static int res_check(struct s2255_fh *fh) -{ - return fh->resources[fh->channel]; -} - - static void res_free(struct s2255_dev *dev, struct s2255_fh *fh) { - mutex_lock(&dev->lock); dev->resources[fh->channel] = 0; - fh->resources[fh->channel] = 0; - mutex_unlock(&dev->lock); dprintk(1, "res: put\n"); } @@ -1243,7 +1232,7 @@ static int vidioc_streamon(struct file *file, void *priv, enum v4l2_buf_type i) } if (!res_get(dev, fh)) { - dev_err(&dev->udev->dev, "s2255: stream busy\n"); + dev_err(&dev->udev->dev, "res get busy\n"); return -EBUSY; } @@ -1299,10 +1288,8 @@ static int vidioc_streamoff(struct file *file, void *priv, enum v4l2_buf_type i) } s2255_stop_acquire(dev, fh->channel); res = videobuf_streamoff(&fh->vb_vidq); - if (res < 0) - return res; res_free(dev, fh); - return 0; + return res; } static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id *i) @@ -1475,7 +1462,12 @@ static int s2255_open(struct inode *inode, struct file *file) mutex_lock(&dev->open_lock); dev->users[cur_channel]++; - dprintk(4, "s2255: open_handles %d\n", dev->users[cur_channel]); + if (dev->users[cur_channel] > S2255_MAX_USERS) { + dev->users[cur_channel]--; + mutex_unlock(&dev->open_lock); + printk(KERN_INFO "s2255drv: too many open handles!\n"); + return -EBUSY; + } if (atomic_read(&dev->fw_data->fw_state) == S2255_FW_FAILED) { err("2255 firmware load failed. retrying.\n"); @@ -1486,8 +1478,7 @@ static int s2255_open(struct inode *inode, struct file *file) msecs_to_jiffies(S2255_LOAD_TIMEOUT)); if (atomic_read(&dev->fw_data->fw_state) != S2255_FW_SUCCESS) { - printk(KERN_INFO "2255 FW load failed.\n"); - dev->users[cur_channel]--; + printk(KERN_INFO "2255 FW load failed after 2 tries\n"); mutex_unlock(&dev->open_lock); return -EFAULT; } @@ -1503,7 +1494,6 @@ static int s2255_open(struct inode *inode, struct file *file) != S2255_FW_SUCCESS) { printk(KERN_INFO "2255 firmware not loaded" "try again\n"); - dev->users[cur_channel]--; mutex_unlock(&dev->open_lock); return -EBUSY; } @@ -1512,7 +1502,6 @@ static int s2255_open(struct inode *inode, struct file *file) /* allocate + initialize per filehandle data */ fh = kzalloc(sizeof(*fh), GFP_KERNEL); if (NULL == fh) { - dev->users[cur_channel]--; mutex_unlock(&dev->open_lock); return -ENOMEM; } @@ -1572,48 +1561,44 @@ static void s2255_destroy(struct kref *kref) printk(KERN_ERR "s2255drv: kref problem\n"); return; } - - /* - * Wake up any firmware load waiting (only done in .open, - * which holds the open_lock mutex) - */ - atomic_set(&dev->fw_data->fw_state, S2255_FW_DISCONNECTING); - wake_up(&dev->fw_data->wait_fw); - /* prevent s2255_disconnect from racing s2255_open */ mutex_lock(&dev->open_lock); s2255_exit_v4l(dev); - /* - * device unregistered so no longer possible to open. open_mutex - * can be unlocked and timers deleted afterwards. - */ + /* device unregistered so no longer possible to open. open_mutex + can be unlocked */ mutex_unlock(&dev->open_lock); /* board shutdown stops the read pipe if it is running */ s2255_board_shutdown(dev); /* make sure firmware still not trying to load */ - del_timer(&dev->timer); /* only started in .probe and .open */ - if (dev->fw_data->fw_urb) { dprintk(2, "kill fw_urb\n"); usb_kill_urb(dev->fw_data->fw_urb); usb_free_urb(dev->fw_data->fw_urb); dev->fw_data->fw_urb = NULL; } - /* - * delete the dsp_wait timer, which sets the firmware - * state on completion. This is done before fw_data - * is freed below. + * TODO: fixme(above, below): potentially leaving timers alive. + * do not ignore timeout below if + * it occurs. */ - del_timer(&dev->fw_data->dsp_wait); /* only started in .open */ + /* make sure we aren't waiting for the DSP */ + if (atomic_read(&dev->fw_data->fw_state) == S2255_FW_LOADED_DSPWAIT) { + /* if we are, wait for the wakeup for fw_success or timeout */ + wait_event_timeout(dev->fw_data->wait_fw, + (atomic_read(&dev->fw_data->fw_state) + == S2255_FW_SUCCESS), + msecs_to_jiffies(S2255_LOAD_TIMEOUT)); + } - if (dev->fw_data->fw) - release_firmware(dev->fw_data->fw); - kfree(dev->fw_data->pfw_data); - kfree(dev->fw_data); + if (dev->fw_data) { + if (dev->fw_data->fw) + release_firmware(dev->fw_data->fw); + kfree(dev->fw_data->pfw_data); + kfree(dev->fw_data); + } usb_put_dev(dev->udev); dprintk(1, "%s", __func__); @@ -1630,23 +1615,17 @@ static int s2255_close(struct inode *inode, struct file *file) mutex_lock(&dev->open_lock); - /* turn off stream */ - if (res_check(fh)) { - if (dev->b_acquire[fh->channel]) - s2255_stop_acquire(dev, fh->channel); - videobuf_streamoff(&fh->vb_vidq); - res_free(dev, fh); - } - + if (dev->b_acquire[fh->channel]) + s2255_stop_acquire(dev, fh->channel); + res_free(dev, fh); videobuf_mmap_free(&fh->vb_vidq); + kfree(fh); dev->users[fh->channel]--; - mutex_unlock(&dev->open_lock); kref_put(&dev->kref, s2255_destroy); dprintk(1, "s2255: close called (minor=%d, users=%d)\n", minor, dev->users[fh->channel]); - kfree(fh); return 0; } @@ -1679,7 +1658,12 @@ static const struct file_operations s2255_fops_v4l = { .llseek = no_llseek, }; -static const struct v4l2_ioctl_ops s2255_ioctl_ops = { +static struct video_device template = { + .name = "s2255v", + .type = VID_TYPE_CAPTURE, + .fops = &s2255_fops_v4l, + .minor = -1, + .release = video_device_release, .vidioc_querycap = vidioc_querycap, .vidioc_enum_fmt_vid_cap = vidioc_enum_fmt_vid_cap, .vidioc_g_fmt_vid_cap = vidioc_g_fmt_vid_cap, @@ -1701,14 +1685,6 @@ static const struct v4l2_ioctl_ops s2255_ioctl_ops = { #ifdef CONFIG_VIDEO_V4L1_COMPAT .vidiocgmbuf = vidioc_cgmbuf, #endif -}; - -static struct video_device template = { - .name = "s2255v", - .fops = &s2255_fops_v4l, - .ioctl_ops = &s2255_ioctl_ops, - .minor = -1, - .release = video_device_release, .tvnorms = S2255_NORMS, .current_norm = V4L2_STD_NTSC_M, }; @@ -1730,7 +1706,7 @@ static int s2255_probe_v4l(struct s2255_dev *dev) /* register 4 video devices */ dev->vdev[i] = video_device_alloc(); memcpy(dev->vdev[i], &template, sizeof(struct video_device)); - dev->vdev[i]->parent = &dev->interface->dev; + dev->vdev[i]->dev = &dev->interface->dev; if (video_nr == -1) ret = video_register_device(dev->vdev[i], VFL_TYPE_GRABBER, diff --git a/trunk/drivers/media/video/saa5246a.c b/trunk/drivers/media/video/saa5246a.c index 6ee63e69b36c..03e772130b55 100644 --- a/trunk/drivers/media/video/saa5246a.c +++ b/trunk/drivers/media/video/saa5246a.c @@ -46,7 +46,6 @@ #include #include #include -#include #include #include "saa5246a.h" @@ -830,7 +829,9 @@ static const struct file_operations saa_fops = { static struct video_device saa_template = { + .owner = THIS_MODULE, .name = IF_NAME, + .type = VID_TYPE_TELETEXT, .fops = &saa_fops, .release = video_device_release, .minor = -1, diff --git a/trunk/drivers/media/video/saa5249.c b/trunk/drivers/media/video/saa5249.c index 0d639738d4e6..fde99d9ee71f 100644 --- a/trunk/drivers/media/video/saa5249.c +++ b/trunk/drivers/media/video/saa5249.c @@ -57,7 +57,6 @@ #include #include #include -#include #include @@ -711,7 +710,9 @@ static const struct file_operations saa_fops = { static struct video_device saa_template = { + .owner = THIS_MODULE, .name = IF_NAME, + .type = VID_TYPE_TELETEXT, /*| VID_TYPE_TUNER ?? */ .fops = &saa_fops, }; diff --git a/trunk/drivers/media/video/saa7134/Kconfig b/trunk/drivers/media/video/saa7134/Kconfig index 7021bbf5897b..83f076abce35 100644 --- a/trunk/drivers/media/video/saa7134/Kconfig +++ b/trunk/drivers/media/video/saa7134/Kconfig @@ -27,7 +27,9 @@ config VIDEO_SAA7134_ALSA config VIDEO_SAA7134_DVB tristate "DVB/ATSC Support for saa7134 based TV cards" depends on VIDEO_SAA7134 && DVB_CORE + depends on HOTPLUG # due to FW_LOADER select VIDEOBUF_DVB + select FW_LOADER select DVB_PLL if !DVB_FE_CUSTOMISE select DVB_MT352 if !DVB_FE_CUSTOMISE select DVB_TDA1004X if !DVB_FE_CUSTOMISE diff --git a/trunk/drivers/media/video/saa7134/saa7134-cards.c b/trunk/drivers/media/video/saa7134/saa7134-cards.c index 98364d171def..6893f998d292 100644 --- a/trunk/drivers/media/video/saa7134/saa7134-cards.c +++ b/trunk/drivers/media/video/saa7134/saa7134-cards.c @@ -5853,6 +5853,9 @@ int saa7134_board_init2(struct saa7134_dev *dev) unsigned char buf; int board; + dev->tuner_type = saa7134_boards[dev->board].tuner_type; + dev->tuner_addr = saa7134_boards[dev->board].tuner_addr; + switch (dev->board) { case SAA7134_BOARD_BMK_MPEX_NOTUNER: case SAA7134_BOARD_BMK_MPEX_TUNER: diff --git a/trunk/drivers/media/video/saa7134/saa7134-core.c b/trunk/drivers/media/video/saa7134/saa7134-core.c index 75d618415f4f..cfee84ee7a88 100644 --- a/trunk/drivers/media/video/saa7134/saa7134-core.c +++ b/trunk/drivers/media/video/saa7134/saa7134-core.c @@ -798,7 +798,7 @@ static struct video_device *vdev_init(struct saa7134_dev *dev, return NULL; *vfd = *template; vfd->minor = -1; - vfd->parent = &dev->pci->dev; + vfd->dev = &dev->pci->dev; vfd->release = video_device_release; vfd->debug = video_debug; snprintf(vfd->name, sizeof(vfd->name), "%s %s (%s)", @@ -945,12 +945,11 @@ static int __devinit saa7134_initdev(struct pci_dev *pci_dev, dev->board = SAA7134_BOARD_UNKNOWN; } dev->autodetected = card[dev->nr] != dev->board; - dev->tuner_type = saa7134_boards[dev->board].tuner_type; - dev->tuner_addr = saa7134_boards[dev->board].tuner_addr; + dev->tuner_type = saa7134_boards[dev->board].tuner_type; dev->tda9887_conf = saa7134_boards[dev->board].tda9887_conf; if (UNSET != tuner[dev->nr]) dev->tuner_type = tuner[dev->nr]; - printk(KERN_INFO "%s: subsystem: %04x:%04x, board: %s [card=%d,%s]\n", + printk(KERN_INFO "%s: subsystem: %04x:%04x, board: %s [card=%d,%s]\n", dev->name,pci_dev->subsystem_vendor, pci_dev->subsystem_device,saa7134_boards[dev->board].name, dev->board, dev->autodetected ? @@ -1008,9 +1007,11 @@ static int __devinit saa7134_initdev(struct pci_dev *pci_dev, v4l2_prio_init(&dev->prio); /* register v4l devices */ - if (saa7134_no_overlay > 0) - printk(KERN_INFO "%s: Overlay support disabled.\n", dev->name); - + if (saa7134_no_overlay <= 0) { + saa7134_video_template.type |= VID_TYPE_OVERLAY; + } else { + printk("%s: Overlay support disabled.\n",dev->name); + } dev->video_dev = vdev_init(dev,&saa7134_video_template,"video"); err = video_register_device(dev->video_dev,VFL_TYPE_GRABBER, video_nr[dev->nr]); @@ -1023,6 +1024,7 @@ static int __devinit saa7134_initdev(struct pci_dev *pci_dev, dev->name,dev->video_dev->minor & 0x1f); dev->vbi_dev = vdev_init(dev, &saa7134_video_template, "vbi"); + dev->vbi_dev->type = VID_TYPE_TUNER | VID_TYPE_TELETEXT; err = video_register_device(dev->vbi_dev,VFL_TYPE_VBI, vbi_nr[dev->nr]); diff --git a/trunk/drivers/media/video/saa7134/saa7134-empress.c b/trunk/drivers/media/video/saa7134/saa7134-empress.c index c0c5d7509c25..2a5ab957542d 100644 --- a/trunk/drivers/media/video/saa7134/saa7134-empress.c +++ b/trunk/drivers/media/video/saa7134/saa7134-empress.c @@ -89,14 +89,14 @@ static int ts_open(struct inode *inode, struct file *file) err = -EBUSY; if (!mutex_trylock(&dev->empress_tsq.vb_lock)) goto done; - if (atomic_read(&dev->empress_users)) + if (dev->empress_users) goto done_up; /* Unmute audio */ saa_writeb(SAA7134_AUDIO_MUTE_CTRL, saa_readb(SAA7134_AUDIO_MUTE_CTRL) & ~(1 << 6)); - atomic_inc(&dev->empress_users); + dev->empress_users++; file->private_data = dev; err = 0; @@ -110,6 +110,8 @@ static int ts_release(struct inode *inode, struct file *file) { struct saa7134_dev *dev = file->private_data; + mutex_lock(&dev->empress_tsq.vb_lock); + videobuf_stop(&dev->empress_tsq); videobuf_mmap_free(&dev->empress_tsq); @@ -120,7 +122,9 @@ static int ts_release(struct inode *inode, struct file *file) saa_writeb(SAA7134_AUDIO_MUTE_CTRL, saa_readb(SAA7134_AUDIO_MUTE_CTRL) | (1 << 6)); - atomic_dec(&dev->empress_users); + dev->empress_users--; + + mutex_unlock(&dev->empress_tsq.vb_lock); return 0; } @@ -329,22 +333,6 @@ static int empress_g_ext_ctrls(struct file *file, void *priv, return saa7134_i2c_call_saa6752(dev, VIDIOC_G_EXT_CTRLS, ctrls); } -static int empress_g_ctrl(struct file *file, void *priv, - struct v4l2_control *c) -{ - struct saa7134_dev *dev = file->private_data; - - return saa7134_g_ctrl_internal(dev, NULL, c); -} - -static int empress_s_ctrl(struct file *file, void *priv, - struct v4l2_control *c) -{ - struct saa7134_dev *dev = file->private_data; - - return saa7134_s_ctrl_internal(dev, NULL, c); -} - static int empress_queryctrl(struct file *file, void *priv, struct v4l2_queryctrl *c) { @@ -412,7 +400,16 @@ static const struct file_operations ts_fops = .llseek = no_llseek, }; -static const struct v4l2_ioctl_ops ts_ioctl_ops = { +/* ----------------------------------------------------------- */ + +static struct video_device saa7134_empress_template = +{ + .name = "saa7134-empress", + .type = 0 /* FIXME */, + .type2 = 0 /* FIXME */, + .fops = &ts_fops, + .minor = -1, + .vidioc_querycap = empress_querycap, .vidioc_enum_fmt_vid_cap = empress_enum_fmt_vid_cap, .vidioc_s_fmt_vid_cap = empress_s_fmt_vid_cap, @@ -431,17 +428,8 @@ static const struct v4l2_ioctl_ops ts_ioctl_ops = { .vidioc_queryctrl = empress_queryctrl, .vidioc_querymenu = empress_querymenu, - .vidioc_g_ctrl = empress_g_ctrl, - .vidioc_s_ctrl = empress_s_ctrl, -}; - -/* ----------------------------------------------------------- */ - -static struct video_device saa7134_empress_template = { - .name = "saa7134-empress", - .fops = &ts_fops, - .minor = -1, - .ioctl_ops = &ts_ioctl_ops, + .vidioc_g_ctrl = saa7134_g_ctrl, + .vidioc_s_ctrl = saa7134_s_ctrl, .tvnorms = SAA7134_NORMS, .current_norm = V4L2_STD_PAL, @@ -457,7 +445,7 @@ static void empress_signal_update(struct work_struct *work) ts_reset_encoder(dev); } else { dprintk("video signal acquired\n"); - if (atomic_read(&dev->empress_users)) + if (dev->empress_users) ts_init_encoder(dev); } } @@ -477,7 +465,7 @@ static int empress_init(struct saa7134_dev *dev) if (NULL == dev->empress_dev) return -ENOMEM; *(dev->empress_dev) = saa7134_empress_template; - dev->empress_dev->parent = &dev->pci->dev; + dev->empress_dev->dev = &dev->pci->dev; dev->empress_dev->release = video_device_release; snprintf(dev->empress_dev->name, sizeof(dev->empress_dev->name), "%s empress (%s)", dev->name, diff --git a/trunk/drivers/media/video/saa7134/saa7134-video.c b/trunk/drivers/media/video/saa7134/saa7134-video.c index 68c268981861..1a5137550e7a 100644 --- a/trunk/drivers/media/video/saa7134/saa7134-video.c +++ b/trunk/drivers/media/video/saa7134/saa7134-video.c @@ -1112,8 +1112,10 @@ static struct videobuf_queue_ops video_qops = { /* ------------------------------------------------------------------ */ -int saa7134_g_ctrl_internal(struct saa7134_dev *dev, struct saa7134_fh *fh, struct v4l2_control *c) +int saa7134_g_ctrl(struct file *file, void *priv, struct v4l2_control *c) { + struct saa7134_fh *fh = priv; + struct saa7134_dev *dev = fh->dev; const struct v4l2_queryctrl* ctrl; ctrl = ctrl_by_id(c->id); @@ -1158,31 +1160,20 @@ int saa7134_g_ctrl_internal(struct saa7134_dev *dev, struct saa7134_fh *fh, stru } return 0; } -EXPORT_SYMBOL_GPL(saa7134_g_ctrl_internal); - -static int saa7134_g_ctrl(struct file *file, void *priv, struct v4l2_control *c) -{ - struct saa7134_fh *fh = priv; - - return saa7134_g_ctrl_internal(fh->dev, fh, c); -} +EXPORT_SYMBOL_GPL(saa7134_g_ctrl); -int saa7134_s_ctrl_internal(struct saa7134_dev *dev, struct saa7134_fh *fh, struct v4l2_control *c) +int saa7134_s_ctrl(struct file *file, void *f, struct v4l2_control *c) { const struct v4l2_queryctrl* ctrl; + struct saa7134_fh *fh = f; + struct saa7134_dev *dev = fh->dev; unsigned long flags; int restart_overlay = 0; - int err; + int err = -EINVAL; - /* When called from the empress code fh == NULL. - That needs to be fixed somehow, but for now this is - good enough. */ - if (fh) { - err = v4l2_prio_check(&dev->prio, &fh->prio); - if (0 != err) - return err; - } - err = -EINVAL; + err = v4l2_prio_check(&dev->prio, &fh->prio); + if (0 != err) + return err; mutex_lock(&dev->lock); @@ -1283,14 +1274,7 @@ int saa7134_s_ctrl_internal(struct saa7134_dev *dev, struct saa7134_fh *fh, str mutex_unlock(&dev->lock); return err; } -EXPORT_SYMBOL_GPL(saa7134_s_ctrl_internal); - -static int saa7134_s_ctrl(struct file *file, void *f, struct v4l2_control *c) -{ - struct saa7134_fh *fh = f; - - return saa7134_s_ctrl_internal(fh->dev, fh, c); -} +EXPORT_SYMBOL_GPL(saa7134_s_ctrl); /* ------------------------------------------------------------------ */ @@ -2369,7 +2353,26 @@ static const struct file_operations video_fops = .llseek = no_llseek, }; -static const struct v4l2_ioctl_ops video_ioctl_ops = { +static const struct file_operations radio_fops = +{ + .owner = THIS_MODULE, + .open = video_open, + .release = video_release, + .ioctl = video_ioctl2, + .compat_ioctl = v4l_compat_ioctl32, + .llseek = no_llseek, +}; + +/* ----------------------------------------------------------- */ +/* exported stuff */ + +struct video_device saa7134_video_template = +{ + .name = "saa7134-video", + .type = VID_TYPE_CAPTURE|VID_TYPE_TUNER | + VID_TYPE_CLIPPING|VID_TYPE_SCALES, + .fops = &video_fops, + .minor = -1, .vidioc_querycap = saa7134_querycap, .vidioc_enum_fmt_vid_cap = saa7134_enum_fmt_vid_cap, .vidioc_g_fmt_vid_cap = saa7134_g_fmt_vid_cap, @@ -2418,18 +2421,16 @@ static const struct v4l2_ioctl_ops video_ioctl_ops = { .vidioc_g_register = vidioc_g_register, .vidioc_s_register = vidioc_s_register, #endif + .tvnorms = SAA7134_NORMS, + .current_norm = V4L2_STD_PAL, }; -static const struct file_operations radio_fops = { - .owner = THIS_MODULE, - .open = video_open, - .release = video_release, - .ioctl = video_ioctl2, - .compat_ioctl = v4l_compat_ioctl32, - .llseek = no_llseek, -}; - -static const struct v4l2_ioctl_ops radio_ioctl_ops = { +struct video_device saa7134_radio_template = +{ + .name = "saa7134-radio", + .type = VID_TYPE_TUNER, + .fops = &radio_fops, + .minor = -1, .vidioc_querycap = radio_querycap, .vidioc_g_tuner = radio_g_tuner, .vidioc_enum_input = radio_enum_input, @@ -2446,25 +2447,6 @@ static const struct v4l2_ioctl_ops radio_ioctl_ops = { .vidioc_s_frequency = saa7134_s_frequency, }; -/* ----------------------------------------------------------- */ -/* exported stuff */ - -struct video_device saa7134_video_template = { - .name = "saa7134-video", - .fops = &video_fops, - .ioctl_ops = &video_ioctl_ops, - .minor = -1, - .tvnorms = SAA7134_NORMS, - .current_norm = V4L2_STD_PAL, -}; - -struct video_device saa7134_radio_template = { - .name = "saa7134-radio", - .fops = &radio_fops, - .ioctl_ops = &radio_ioctl_ops, - .minor = -1, -}; - int saa7134_video_init1(struct saa7134_dev *dev) { /* sanitycheck insmod options */ diff --git a/trunk/drivers/media/video/saa7134/saa7134.h b/trunk/drivers/media/video/saa7134/saa7134.h index a0884f639f65..6927cbea8624 100644 --- a/trunk/drivers/media/video/saa7134/saa7134.h +++ b/trunk/drivers/media/video/saa7134/saa7134.h @@ -34,7 +34,6 @@ #include #include -#include #include #include #include @@ -561,7 +560,7 @@ struct saa7134_dev { /* SAA7134_MPEG_EMPRESS only */ struct video_device *empress_dev; struct videobuf_queue empress_tsq; - atomic_t empress_users; + unsigned int empress_users; struct work_struct empress_workqueue; int empress_started; @@ -663,8 +662,8 @@ extern unsigned int video_debug; extern struct video_device saa7134_video_template; extern struct video_device saa7134_radio_template; -int saa7134_s_ctrl_internal(struct saa7134_dev *dev, struct saa7134_fh *fh, struct v4l2_control *c); -int saa7134_g_ctrl_internal(struct saa7134_dev *dev, struct saa7134_fh *fh, struct v4l2_control *c); +int saa7134_g_ctrl(struct file *file, void *priv, struct v4l2_control *c); +int saa7134_s_ctrl(struct file *file, void *f, struct v4l2_control *c); int saa7134_queryctrl(struct file *file, void *priv, struct v4l2_queryctrl *c); int saa7134_videoport_init(struct saa7134_dev *dev); diff --git a/trunk/drivers/media/video/saa717x.c b/trunk/drivers/media/video/saa717x.c index af60ede5310d..2220f9569941 100644 --- a/trunk/drivers/media/video/saa717x.c +++ b/trunk/drivers/media/video/saa717x.c @@ -35,6 +35,7 @@ #include #include +#include #include #include #include diff --git a/trunk/drivers/media/video/saa7196.h b/trunk/drivers/media/video/saa7196.h index e69de29bb2d1..cd4b6354a7b3 100644 --- a/trunk/drivers/media/video/saa7196.h +++ b/trunk/drivers/media/video/saa7196.h @@ -0,0 +1,117 @@ +/* + Definitions for the Philips SAA7196 digital video decoder, + scaler, and clock generator circuit (DESCpro), as used in + the PlanB video input of the Powermac 7x00/8x00 series. + + Copyright (C) 1998 Michel Lanners (mlan@cpu.lu) + + The register defines are shamelessly copied from the meteor + driver out of NetBSD (with permission), + and are copyrighted (c) 1995 Mark Tinguely and Jim Lowe + (Thanks !) + + Additional debugging and coding by Takashi Oe (toe@unlinfo.unl.edu) + + The default values used for PlanB are my mistakes. +*/ + +/* $Id: saa7196.h,v 1.5 1999/03/26 23:28:47 mlan Exp $ */ + +#ifndef _SAA7196_H_ +#define _SAA7196_H_ + +#define SAA7196_NUMREGS 0x31 /* Number of registers (used)*/ +#define NUM_SUPPORTED_NORM 3 /* Number of supported norms by PlanB */ + +/* Decoder part: */ +#define SAA7196_IDEL 0x00 /* Increment delay */ +#define SAA7196_HSB5 0x01 /* H-sync begin; 50 hz */ +#define SAA7196_HSS5 0x02 /* H-sync stop; 50 hz */ +#define SAA7196_HCB5 0x03 /* H-clamp begin; 50 hz */ +#define SAA7196_HCS5 0x04 /* H-clamp stop; 50 hz */ +#define SAA7196_HSP5 0x05 /* H-sync after PHI1; 50 hz */ +#define SAA7196_LUMC 0x06 /* Luminance control */ +#define SAA7196_HUEC 0x07 /* Hue control */ +#define SAA7196_CKTQ 0x08 /* Colour Killer Threshold QAM (PAL, NTSC) */ +#define SAA7196_CKTS 0x09 /* Colour Killer Threshold SECAM */ +#define SAA7196_PALS 0x0a /* PAL switch sensitivity */ +#define SAA7196_SECAMS 0x0b /* SECAM switch sensitivity */ +#define SAA7196_CGAINC 0x0c /* Chroma gain control */ +#define SAA7196_STDC 0x0d /* Standard/Mode control */ +#define SAA7196_IOCC 0x0e /* I/O and Clock Control */ +#define SAA7196_CTRL1 0x0f /* Control #1 */ +#define SAA7196_CTRL2 0x10 /* Control #2 */ +#define SAA7196_CGAINR 0x11 /* Chroma Gain Reference */ +#define SAA7196_CSAT 0x12 /* Chroma Saturation */ +#define SAA7196_CONT 0x13 /* Luminance Contrast */ +#define SAA7196_HSB6 0x14 /* H-sync begin; 60 hz */ +#define SAA7196_HSS6 0x15 /* H-sync stop; 60 hz */ +#define SAA7196_HCB6 0x16 /* H-clamp begin; 60 hz */ +#define SAA7196_HCS6 0x17 /* H-clamp stop; 60 hz */ +#define SAA7196_HSP6 0x18 /* H-sync after PHI1; 60 hz */ +#define SAA7196_BRIG 0x19 /* Luminance Brightness */ + +/* Scaler part: */ +#define SAA7196_FMTS 0x20 /* Formats and sequence */ +#define SAA7196_OUTPIX 0x21 /* Output data pixel/line */ +#define SAA7196_INPIX 0x22 /* Input data pixel/line */ +#define SAA7196_HWS 0x23 /* Horiz. window start */ +#define SAA7196_HFILT 0x24 /* Horiz. filter */ +#define SAA7196_OUTLINE 0x25 /* Output data lines/field */ +#define SAA7196_INLINE 0x26 /* Input data lines/field */ +#define SAA7196_VWS 0x27 /* Vertical window start */ +#define SAA7196_VYP 0x28 /* AFS/vertical Y processing */ +#define SAA7196_VBS 0x29 /* Vertical Bypass start */ +#define SAA7196_VBCNT 0x2a /* Vertical Bypass count */ +#define SAA7196_VBP 0x2b /* veritcal Bypass Polarity */ +#define SAA7196_VLOW 0x2c /* Colour-keying lower V limit */ +#define SAA7196_VHIGH 0x2d /* Colour-keying upper V limit */ +#define SAA7196_ULOW 0x2e /* Colour-keying lower U limit */ +#define SAA7196_UHIGH 0x2f /* Colour-keying upper U limit */ +#define SAA7196_DPATH 0x30 /* Data path setting */ + +/* Initialization default values: */ + +unsigned char saa_regs[NUM_SUPPORTED_NORM][SAA7196_NUMREGS] = { + +/* PAL, 768x576 (no scaling), composite video-in */ +/* Decoder: */ + { 0x50, 0x30, 0x00, 0xe8, 0xb6, 0xe5, 0x63, 0xff, + 0xfe, 0xf0, 0xfe, 0xe0, 0x20, 0x06, 0x3b, 0x98, + 0x00, 0x59, 0x41, 0x45, 0x34, 0x0a, 0xf4, 0xd2, + 0xe9, 0xa2, +/* Padding */ + 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* Scaler: */ + 0x72, 0x80, 0x00, 0x03, 0x8d, 0x20, 0x20, 0x12, + 0xa5, 0x12, 0x00, 0x00, 0x04, 0x00, 0x04, 0x00, + 0x87 }, + +/* NTSC, 640x480? (no scaling), composite video-in */ +/* Decoder: */ + { 0x50, 0x30, 0x00, 0xe8, 0xb6, 0xe5, 0x50, 0x00, + 0xf8, 0xf0, 0xfe, 0xe0, 0x00, 0x06, 0x3b, 0x98, + 0x00, 0x2c, 0x3d, 0x40, 0x34, 0x0a, 0xf4, 0xd2, + 0xe9, 0x98, +/* Padding */ + 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* Scaler: */ + 0x72, 0x80, 0x80, 0x03, 0x89, 0xf0, 0xf0, 0x0d, + 0xa0, 0x0d, 0x00, 0x00, 0x04, 0x00, 0x04, 0x00, + 0x87 }, + +/* SECAM, 768x576 (no scaling), composite video-in */ +/* Decoder: */ + { 0x50, 0x30, 0x00, 0xe8, 0xb6, 0xe5, 0x63, 0xff, + 0xfe, 0xf0, 0xfe, 0xe0, 0x20, 0x07, 0x3b, 0x98, + 0x00, 0x59, 0x41, 0x45, 0x34, 0x0a, 0xf4, 0xd2, + 0xe9, 0xa2, +/* Padding */ + 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* Scaler: */ + 0x72, 0x80, 0x00, 0x03, 0x8d, 0x20, 0x20, 0x12, + 0xa5, 0x12, 0x00, 0x00, 0x04, 0x00, 0x04, 0x00, + 0x87 } + }; + +#endif /* _SAA7196_H_ */ diff --git a/trunk/drivers/media/video/se401.c b/trunk/drivers/media/video/se401.c index f481277892da..1cd629380f71 100644 --- a/trunk/drivers/media/video/se401.c +++ b/trunk/drivers/media/video/se401.c @@ -1230,7 +1230,9 @@ static const struct file_operations se401_fops = { .llseek = no_llseek, }; static struct video_device se401_template = { + .owner = THIS_MODULE, .name = "se401 USB camera", + .type = VID_TYPE_CAPTURE, .fops = &se401_fops, }; diff --git a/trunk/drivers/media/video/se401.h b/trunk/drivers/media/video/se401.h index 2ce685db5d8b..835ef872e803 100644 --- a/trunk/drivers/media/video/se401.h +++ b/trunk/drivers/media/video/se401.h @@ -5,7 +5,6 @@ #include #include #include -#include #include #define se401_DEBUG /* Turn on debug messages */ diff --git a/trunk/drivers/media/video/sh_mobile_ceu_camera.c b/trunk/drivers/media/video/sh_mobile_ceu_camera.c index f7ca3cb9340a..012005e1a77b 100644 --- a/trunk/drivers/media/video/sh_mobile_ceu_camera.c +++ b/trunk/drivers/media/video/sh_mobile_ceu_camera.c @@ -91,7 +91,6 @@ struct sh_mobile_ceu_dev { void __iomem *base; unsigned long video_limit; - /* lock used to protect videobuf */ spinlock_t lock; struct list_head capture; struct videobuf_buffer *active; diff --git a/trunk/drivers/media/video/sn9c102/sn9c102.h b/trunk/drivers/media/video/sn9c102/sn9c102.h index cbfc44433b99..0c8d87d8d18d 100644 --- a/trunk/drivers/media/video/sn9c102/sn9c102.h +++ b/trunk/drivers/media/video/sn9c102/sn9c102.h @@ -25,7 +25,6 @@ #include #include #include -#include #include #include #include diff --git a/trunk/drivers/media/video/sn9c102/sn9c102_core.c b/trunk/drivers/media/video/sn9c102/sn9c102_core.c index 23408764d0ef..7f9c7bcf3c85 100644 --- a/trunk/drivers/media/video/sn9c102/sn9c102_core.c +++ b/trunk/drivers/media/video/sn9c102/sn9c102_core.c @@ -1038,7 +1038,8 @@ static ssize_t sn9c102_show_reg(struct device* cd, if (mutex_lock_interruptible(&sn9c102_sysfs_lock)) return -ERESTARTSYS; - cam = video_get_drvdata(container_of(cd, struct video_device, dev)); + cam = video_get_drvdata(container_of(cd, struct video_device, + class_dev)); if (!cam) { mutex_unlock(&sn9c102_sysfs_lock); return -ENODEV; @@ -1063,7 +1064,8 @@ sn9c102_store_reg(struct device* cd, struct device_attribute *attr, if (mutex_lock_interruptible(&sn9c102_sysfs_lock)) return -ERESTARTSYS; - cam = video_get_drvdata(container_of(cd, struct video_device, dev)); + cam = video_get_drvdata(container_of(cd, struct video_device, + class_dev)); if (!cam) { mutex_unlock(&sn9c102_sysfs_lock); return -ENODEV; @@ -1096,7 +1098,8 @@ static ssize_t sn9c102_show_val(struct device* cd, if (mutex_lock_interruptible(&sn9c102_sysfs_lock)) return -ERESTARTSYS; - cam = video_get_drvdata(container_of(cd, struct video_device, dev)); + cam = video_get_drvdata(container_of(cd, struct video_device, + class_dev)); if (!cam) { mutex_unlock(&sn9c102_sysfs_lock); return -ENODEV; @@ -1129,7 +1132,8 @@ sn9c102_store_val(struct device* cd, struct device_attribute *attr, if (mutex_lock_interruptible(&sn9c102_sysfs_lock)) return -ERESTARTSYS; - cam = video_get_drvdata(container_of(cd, struct video_device, dev)); + cam = video_get_drvdata(container_of(cd, struct video_device, + class_dev)); if (!cam) { mutex_unlock(&sn9c102_sysfs_lock); return -ENODEV; @@ -1166,7 +1170,8 @@ static ssize_t sn9c102_show_i2c_reg(struct device* cd, if (mutex_lock_interruptible(&sn9c102_sysfs_lock)) return -ERESTARTSYS; - cam = video_get_drvdata(container_of(cd, struct video_device, dev)); + cam = video_get_drvdata(container_of(cd, struct video_device, + class_dev)); if (!cam) { mutex_unlock(&sn9c102_sysfs_lock); return -ENODEV; @@ -1193,7 +1198,8 @@ sn9c102_store_i2c_reg(struct device* cd, struct device_attribute *attr, if (mutex_lock_interruptible(&sn9c102_sysfs_lock)) return -ERESTARTSYS; - cam = video_get_drvdata(container_of(cd, struct video_device, dev)); + cam = video_get_drvdata(container_of(cd, struct video_device, + class_dev)); if (!cam) { mutex_unlock(&sn9c102_sysfs_lock); return -ENODEV; @@ -1226,7 +1232,8 @@ static ssize_t sn9c102_show_i2c_val(struct device* cd, if (mutex_lock_interruptible(&sn9c102_sysfs_lock)) return -ERESTARTSYS; - cam = video_get_drvdata(container_of(cd, struct video_device, dev)); + cam = video_get_drvdata(container_of(cd, struct video_device, + class_dev)); if (!cam) { mutex_unlock(&sn9c102_sysfs_lock); return -ENODEV; @@ -1264,7 +1271,8 @@ sn9c102_store_i2c_val(struct device* cd, struct device_attribute *attr, if (mutex_lock_interruptible(&sn9c102_sysfs_lock)) return -ERESTARTSYS; - cam = video_get_drvdata(container_of(cd, struct video_device, dev)); + cam = video_get_drvdata(container_of(cd, struct video_device, + class_dev)); if (!cam) { mutex_unlock(&sn9c102_sysfs_lock); return -ENODEV; @@ -1310,7 +1318,8 @@ sn9c102_store_green(struct device* cd, struct device_attribute *attr, if (mutex_lock_interruptible(&sn9c102_sysfs_lock)) return -ERESTARTSYS; - cam = video_get_drvdata(container_of(cd, struct video_device, dev)); + cam = video_get_drvdata(container_of(cd, struct video_device, + class_dev)); if (!cam) { mutex_unlock(&sn9c102_sysfs_lock); return -ENODEV; @@ -1391,7 +1400,8 @@ static ssize_t sn9c102_show_frame_header(struct device* cd, struct sn9c102_device* cam; ssize_t count; - cam = video_get_drvdata(container_of(cd, struct video_device, dev)); + cam = video_get_drvdata(container_of(cd, struct video_device, + class_dev)); if (!cam) return -ENODEV; @@ -1418,49 +1428,49 @@ static DEVICE_ATTR(frame_header, S_IRUGO, sn9c102_show_frame_header, NULL); static int sn9c102_create_sysfs(struct sn9c102_device* cam) { - struct device *dev = &(cam->v4ldev->dev); + struct device *classdev = &(cam->v4ldev->class_dev); int err = 0; - if ((err = device_create_file(dev, &dev_attr_reg))) + if ((err = device_create_file(classdev, &dev_attr_reg))) goto err_out; - if ((err = device_create_file(dev, &dev_attr_val))) + if ((err = device_create_file(classdev, &dev_attr_val))) goto err_reg; - if ((err = device_create_file(dev, &dev_attr_frame_header))) + if ((err = device_create_file(classdev, &dev_attr_frame_header))) goto err_val; if (cam->sensor.sysfs_ops) { - if ((err = device_create_file(dev, &dev_attr_i2c_reg))) + if ((err = device_create_file(classdev, &dev_attr_i2c_reg))) goto err_frame_header; - if ((err = device_create_file(dev, &dev_attr_i2c_val))) + if ((err = device_create_file(classdev, &dev_attr_i2c_val))) goto err_i2c_reg; } if (cam->bridge == BRIDGE_SN9C101 || cam->bridge == BRIDGE_SN9C102) { - if ((err = device_create_file(dev, &dev_attr_green))) + if ((err = device_create_file(classdev, &dev_attr_green))) goto err_i2c_val; } else { - if ((err = device_create_file(dev, &dev_attr_blue))) + if ((err = device_create_file(classdev, &dev_attr_blue))) goto err_i2c_val; - if ((err = device_create_file(dev, &dev_attr_red))) + if ((err = device_create_file(classdev, &dev_attr_red))) goto err_blue; } return 0; err_blue: - device_remove_file(dev, &dev_attr_blue); + device_remove_file(classdev, &dev_attr_blue); err_i2c_val: if (cam->sensor.sysfs_ops) - device_remove_file(dev, &dev_attr_i2c_val); + device_remove_file(classdev, &dev_attr_i2c_val); err_i2c_reg: if (cam->sensor.sysfs_ops) - device_remove_file(dev, &dev_attr_i2c_reg); + device_remove_file(classdev, &dev_attr_i2c_reg); err_frame_header: - device_remove_file(dev, &dev_attr_frame_header); + device_remove_file(classdev, &dev_attr_frame_header); err_val: - device_remove_file(dev, &dev_attr_val); + device_remove_file(classdev, &dev_attr_val); err_reg: - device_remove_file(dev, &dev_attr_reg); + device_remove_file(classdev, &dev_attr_reg); err_out: return err; } @@ -3309,6 +3319,8 @@ sn9c102_usb_probe(struct usb_interface* intf, const struct usb_device_id* id) } strcpy(cam->v4ldev->name, "SN9C1xx PC Camera"); + cam->v4ldev->owner = THIS_MODULE; + cam->v4ldev->type = VID_TYPE_CAPTURE | VID_TYPE_SCALES; cam->v4ldev->fops = &sn9c102_fops; cam->v4ldev->minor = video_nr[dev_nr]; cam->v4ldev->release = video_device_release; diff --git a/trunk/drivers/media/video/soc_camera.c b/trunk/drivers/media/video/soc_camera.c index b6be5ee678b6..e39b98f1eca4 100644 --- a/trunk/drivers/media/video/soc_camera.c +++ b/trunk/drivers/media/video/soc_camera.c @@ -25,7 +25,6 @@ #include #include -#include #include #include #include @@ -194,7 +193,7 @@ static int soc_camera_open(struct inode *inode, struct file *file) mutex_lock(&video_lock); vdev = video_devdata(file); - icd = container_of(vdev->parent, struct soc_camera_device, dev); + icd = container_of(vdev->dev, struct soc_camera_device, dev); ici = to_soc_camera_host(icd->dev.parent); if (!try_module_get(icd->ops->owner)) { @@ -259,7 +258,7 @@ static int soc_camera_close(struct inode *inode, struct file *file) vfree(icf); - dev_dbg(vdev->parent, "camera device close\n"); + dev_dbg(vdev->dev, "camera device close\n"); return 0; } @@ -272,7 +271,7 @@ static ssize_t soc_camera_read(struct file *file, char __user *buf, struct video_device *vdev = icd->vdev; int err = -EINVAL; - dev_err(vdev->parent, "camera device read not implemented\n"); + dev_err(vdev->dev, "camera device read not implemented\n"); return err; } @@ -862,35 +861,6 @@ void soc_camera_device_unregister(struct soc_camera_device *icd) } EXPORT_SYMBOL(soc_camera_device_unregister); -static const struct v4l2_ioctl_ops soc_camera_ioctl_ops = { - .vidioc_querycap = soc_camera_querycap, - .vidioc_g_fmt_vid_cap = soc_camera_g_fmt_vid_cap, - .vidioc_enum_fmt_vid_cap = soc_camera_enum_fmt_vid_cap, - .vidioc_s_fmt_vid_cap = soc_camera_s_fmt_vid_cap, - .vidioc_enum_input = soc_camera_enum_input, - .vidioc_g_input = soc_camera_g_input, - .vidioc_s_input = soc_camera_s_input, - .vidioc_s_std = soc_camera_s_std, - .vidioc_reqbufs = soc_camera_reqbufs, - .vidioc_try_fmt_vid_cap = soc_camera_try_fmt_vid_cap, - .vidioc_querybuf = soc_camera_querybuf, - .vidioc_qbuf = soc_camera_qbuf, - .vidioc_dqbuf = soc_camera_dqbuf, - .vidioc_streamon = soc_camera_streamon, - .vidioc_streamoff = soc_camera_streamoff, - .vidioc_queryctrl = soc_camera_queryctrl, - .vidioc_g_ctrl = soc_camera_g_ctrl, - .vidioc_s_ctrl = soc_camera_s_ctrl, - .vidioc_cropcap = soc_camera_cropcap, - .vidioc_g_crop = soc_camera_g_crop, - .vidioc_s_crop = soc_camera_s_crop, - .vidioc_g_chip_ident = soc_camera_g_chip_ident, -#ifdef CONFIG_VIDEO_ADV_DEBUG - .vidioc_g_register = soc_camera_g_register, - .vidioc_s_register = soc_camera_s_register, -#endif -}; - int soc_camera_video_start(struct soc_camera_device *icd) { struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent); @@ -907,19 +877,45 @@ int soc_camera_video_start(struct soc_camera_device *icd) strlcpy(vdev->name, ici->drv_name, sizeof(vdev->name)); /* Maybe better &ici->dev */ - vdev->parent = &icd->dev; + vdev->dev = &icd->dev; + vdev->type = VID_TYPE_CAPTURE; vdev->current_norm = V4L2_STD_UNKNOWN; vdev->fops = &soc_camera_fops; - vdev->ioctl_ops = &soc_camera_ioctl_ops; vdev->release = video_device_release; vdev->minor = -1; vdev->tvnorms = V4L2_STD_UNKNOWN, + vdev->vidioc_querycap = soc_camera_querycap; + vdev->vidioc_g_fmt_vid_cap = soc_camera_g_fmt_vid_cap; + vdev->vidioc_enum_fmt_vid_cap = soc_camera_enum_fmt_vid_cap; + vdev->vidioc_s_fmt_vid_cap = soc_camera_s_fmt_vid_cap; + vdev->vidioc_enum_input = soc_camera_enum_input; + vdev->vidioc_g_input = soc_camera_g_input; + vdev->vidioc_s_input = soc_camera_s_input; + vdev->vidioc_s_std = soc_camera_s_std; + vdev->vidioc_reqbufs = soc_camera_reqbufs; + vdev->vidioc_try_fmt_vid_cap = soc_camera_try_fmt_vid_cap; + vdev->vidioc_querybuf = soc_camera_querybuf; + vdev->vidioc_qbuf = soc_camera_qbuf; + vdev->vidioc_dqbuf = soc_camera_dqbuf; + vdev->vidioc_streamon = soc_camera_streamon; + vdev->vidioc_streamoff = soc_camera_streamoff; + vdev->vidioc_queryctrl = soc_camera_queryctrl; + vdev->vidioc_g_ctrl = soc_camera_g_ctrl; + vdev->vidioc_s_ctrl = soc_camera_s_ctrl; + vdev->vidioc_cropcap = soc_camera_cropcap; + vdev->vidioc_g_crop = soc_camera_g_crop; + vdev->vidioc_s_crop = soc_camera_s_crop; + vdev->vidioc_g_chip_ident = soc_camera_g_chip_ident; +#ifdef CONFIG_VIDEO_ADV_DEBUG + vdev->vidioc_g_register = soc_camera_g_register; + vdev->vidioc_s_register = soc_camera_s_register; +#endif icd->current_fmt = &icd->formats[0]; err = video_register_device(vdev, VFL_TYPE_GRABBER, vdev->minor); if (err < 0) { - dev_err(vdev->parent, "video_register_device failed\n"); + dev_err(vdev->dev, "video_register_device failed\n"); goto evidregd; } icd->vdev = vdev; diff --git a/trunk/drivers/media/video/stk-webcam.c b/trunk/drivers/media/video/stk-webcam.c index ad36af30e099..f308c38d744f 100644 --- a/trunk/drivers/media/video/stk-webcam.c +++ b/trunk/drivers/media/video/stk-webcam.c @@ -34,7 +34,6 @@ #include #include #include -#include #include "stk-webcam.h" @@ -341,19 +340,17 @@ static int stk_create_sysfs_files(struct video_device *vdev) { int ret; - ret = device_create_file(&vdev->dev, &dev_attr_brightness); - ret += device_create_file(&vdev->dev, &dev_attr_hflip); - ret += device_create_file(&vdev->dev, &dev_attr_vflip); - if (ret) - STK_WARNING("Could not create sysfs files\n"); + ret = video_device_create_file(vdev, &dev_attr_brightness); + ret += video_device_create_file(vdev, &dev_attr_hflip); + ret += video_device_create_file(vdev, &dev_attr_vflip); return ret; } static void stk_remove_sysfs_files(struct video_device *vdev) { - device_remove_file(&vdev->dev, &dev_attr_brightness); - device_remove_file(&vdev->dev, &dev_attr_hflip); - device_remove_file(&vdev->dev, &dev_attr_vflip); + video_device_remove_file(vdev, &dev_attr_brightness); + video_device_remove_file(vdev, &dev_attr_hflip); + video_device_remove_file(vdev, &dev_attr_vflip); } #else @@ -445,19 +442,18 @@ static void stk_isoc_handler(struct urb *urb) fb->v4lbuf.bytesused = 0; fill = fb->buffer; } else if (fb->v4lbuf.bytesused == dev->frame_size) { - if (list_is_singular(&dev->sio_avail)) { - /* Always reuse the last buffer */ - fb->v4lbuf.bytesused = 0; - fill = fb->buffer; - } else { - list_move_tail(dev->sio_avail.next, - &dev->sio_full); - wake_up(&dev->wait_frame); - fb = list_first_entry(&dev->sio_avail, - struct stk_sio_buffer, list); - fb->v4lbuf.bytesused = 0; - fill = fb->buffer; + list_move_tail(dev->sio_avail.next, + &dev->sio_full); + wake_up(&dev->wait_frame); + if (list_empty(&dev->sio_avail)) { + (void) (printk_ratelimit() && + STK_ERROR("No buffer available\n")); + goto resubmit; } + fb = list_first_entry(&dev->sio_avail, + struct stk_sio_buffer, list); + fb->v4lbuf.bytesused = 0; + fill = fb->buffer; } } else { framelen -= 4; @@ -1331,7 +1327,20 @@ static struct file_operations v4l_stk_fops = { .llseek = no_llseek }; -static const struct v4l2_ioctl_ops v4l_stk_ioctl_ops = { +static void stk_v4l_dev_release(struct video_device *vd) +{ +} + +static struct video_device stk_v4l_data = { + .name = "stkwebcam", + .type = VFL_TYPE_GRABBER, + .type2 = VID_TYPE_CAPTURE, + .minor = -1, + .tvnorms = V4L2_STD_UNKNOWN, + .current_norm = V4L2_STD_UNKNOWN, + .fops = &v4l_stk_fops, + .release = stk_v4l_dev_release, + .vidioc_querycap = stk_vidioc_querycap, .vidioc_enum_fmt_vid_cap = stk_vidioc_enum_fmt_vid_cap, .vidioc_try_fmt_vid_cap = stk_vidioc_try_fmt_vid_cap, @@ -1353,20 +1362,6 @@ static const struct v4l2_ioctl_ops v4l_stk_ioctl_ops = { .vidioc_g_parm = stk_vidioc_g_parm, }; -static void stk_v4l_dev_release(struct video_device *vd) -{ -} - -static struct video_device stk_v4l_data = { - .name = "stkwebcam", - .minor = -1, - .tvnorms = V4L2_STD_UNKNOWN, - .current_norm = V4L2_STD_UNKNOWN, - .fops = &v4l_stk_fops, - .ioctl_ops = &v4l_stk_ioctl_ops, - .release = stk_v4l_dev_release, -}; - static int stk_register_video_device(struct stk_camera *dev) { @@ -1374,7 +1369,7 @@ static int stk_register_video_device(struct stk_camera *dev) dev->vdev = stk_v4l_data; dev->vdev.debug = debug; - dev->vdev.parent = &dev->interface->dev; + dev->vdev.dev = &dev->interface->dev; dev->vdev.priv = dev; err = video_register_device(&dev->vdev, VFL_TYPE_GRABBER, -1); if (err) diff --git a/trunk/drivers/media/video/stradis.c b/trunk/drivers/media/video/stradis.c index 276bded06ab3..c109511f21ea 100644 --- a/trunk/drivers/media/video/stradis.c +++ b/trunk/drivers/media/video/stradis.c @@ -43,7 +43,6 @@ #include #include #include -#include #include "saa7146.h" #include "saa7146reg.h" @@ -1919,6 +1918,7 @@ static const struct file_operations saa_fops = { /* template for video_device-structure */ static struct video_device saa_template = { .name = "SAA7146A", + .type = VID_TYPE_CAPTURE | VID_TYPE_OVERLAY, .fops = &saa_fops, .minor = -1, }; diff --git a/trunk/drivers/media/video/stv680.c b/trunk/drivers/media/video/stv680.c index 56dc3d6b5b29..d7f130bedb5f 100644 --- a/trunk/drivers/media/video/stv680.c +++ b/trunk/drivers/media/video/stv680.c @@ -66,7 +66,6 @@ #include #include #include -#include #include #include @@ -525,54 +524,53 @@ static int stv680_create_sysfs_files(struct video_device *vdev) { int rc; - rc = device_create_file(&vdev->dev, &dev_attr_model); + rc = video_device_create_file(vdev, &dev_attr_model); if (rc) goto err; - rc = device_create_file(&vdev->dev, &dev_attr_in_use); + rc = video_device_create_file(vdev, &dev_attr_in_use); if (rc) goto err_model; - rc = device_create_file(&vdev->dev, &dev_attr_streaming); + rc = video_device_create_file(vdev, &dev_attr_streaming); if (rc) goto err_inuse; - rc = device_create_file(&vdev->dev, &dev_attr_palette); + rc = video_device_create_file(vdev, &dev_attr_palette); if (rc) goto err_stream; - rc = device_create_file(&vdev->dev, &dev_attr_frames_total); + rc = video_device_create_file(vdev, &dev_attr_frames_total); if (rc) goto err_pal; - rc = device_create_file(&vdev->dev, &dev_attr_frames_read); + rc = video_device_create_file(vdev, &dev_attr_frames_read); if (rc) goto err_framtot; - rc = device_create_file(&vdev->dev, &dev_attr_packets_dropped); + rc = video_device_create_file(vdev, &dev_attr_packets_dropped); if (rc) goto err_framread; - rc = device_create_file(&vdev->dev, &dev_attr_decoding_errors); + rc = video_device_create_file(vdev, &dev_attr_decoding_errors); if (rc) goto err_dropped; return 0; err_dropped: - device_remove_file(&vdev->dev, &dev_attr_packets_dropped); + video_device_remove_file(vdev, &dev_attr_packets_dropped); err_framread: - device_remove_file(&vdev->dev, &dev_attr_frames_read); + video_device_remove_file(vdev, &dev_attr_frames_read); err_framtot: - device_remove_file(&vdev->dev, &dev_attr_frames_total); + video_device_remove_file(vdev, &dev_attr_frames_total); err_pal: - device_remove_file(&vdev->dev, &dev_attr_palette); + video_device_remove_file(vdev, &dev_attr_palette); err_stream: - device_remove_file(&vdev->dev, &dev_attr_streaming); + video_device_remove_file(vdev, &dev_attr_streaming); err_inuse: - device_remove_file(&vdev->dev, &dev_attr_in_use); + video_device_remove_file(vdev, &dev_attr_in_use); err_model: - device_remove_file(&vdev->dev, &dev_attr_model); + video_device_remove_file(vdev, &dev_attr_model); err: - PDEBUG(0, "STV(e): Could not create sysfs files"); return rc; } static void stv680_remove_sysfs_files(struct video_device *vdev) { - device_remove_file(&vdev->dev, &dev_attr_model); - device_remove_file(&vdev->dev, &dev_attr_in_use); - device_remove_file(&vdev->dev, &dev_attr_streaming); - device_remove_file(&vdev->dev, &dev_attr_palette); - device_remove_file(&vdev->dev, &dev_attr_frames_total); - device_remove_file(&vdev->dev, &dev_attr_frames_read); - device_remove_file(&vdev->dev, &dev_attr_packets_dropped); - device_remove_file(&vdev->dev, &dev_attr_decoding_errors); + video_device_remove_file(vdev, &dev_attr_model); + video_device_remove_file(vdev, &dev_attr_in_use); + video_device_remove_file(vdev, &dev_attr_streaming); + video_device_remove_file(vdev, &dev_attr_palette); + video_device_remove_file(vdev, &dev_attr_frames_total); + video_device_remove_file(vdev, &dev_attr_frames_read); + video_device_remove_file(vdev, &dev_attr_packets_dropped); + video_device_remove_file(vdev, &dev_attr_decoding_errors); } /******************************************************************** @@ -1402,7 +1400,9 @@ static const struct file_operations stv680_fops = { .llseek = no_llseek, }; static struct video_device stv680_template = { + .owner = THIS_MODULE, .name = "STV0680 USB camera", + .type = VID_TYPE_CAPTURE, .fops = &stv680_fops, .release = video_device_release, .minor = -1, @@ -1454,7 +1454,7 @@ static int stv680_probe (struct usb_interface *intf, const struct usb_device_id goto error; } memcpy(stv680->vdev, &stv680_template, sizeof(stv680_template)); - stv680->vdev->parent = &intf->dev; + stv680->vdev->dev = &intf->dev; video_set_drvdata(stv680->vdev, stv680); memcpy (stv680->vdev->name, stv680->camera_name, strlen (stv680->camera_name)); diff --git a/trunk/drivers/media/video/tda7432.c b/trunk/drivers/media/video/tda7432.c index 4963d4264880..ae75c187da79 100644 --- a/trunk/drivers/media/video/tda7432.c +++ b/trunk/drivers/media/video/tda7432.c @@ -44,11 +44,10 @@ #include #include #include -#include +#include #include #include -#include #include #ifndef VIDEO_AUDIO_BALANCE diff --git a/trunk/drivers/media/video/tda9875.c b/trunk/drivers/media/video/tda9875.c index 792f0b079909..7a8ce8fb46dc 100644 --- a/trunk/drivers/media/video/tda9875.c +++ b/trunk/drivers/media/video/tda9875.c @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/trunk/drivers/media/video/tlv320aic23b.c b/trunk/drivers/media/video/tlv320aic23b.c index 281065b9dd2d..9220378a5637 100644 --- a/trunk/drivers/media/video/tlv320aic23b.c +++ b/trunk/drivers/media/video/tlv320aic23b.c @@ -29,7 +29,7 @@ #include #include #include -#include +#include #include #include diff --git a/trunk/drivers/media/video/tuner-core.c b/trunk/drivers/media/video/tuner-core.c index d806a3556eed..93d879dc510f 100644 --- a/trunk/drivers/media/video/tuner-core.c +++ b/trunk/drivers/media/video/tuner-core.c @@ -19,7 +19,6 @@ #include #include #include -#include #include #include "mt20xx.h" #include "tda8290.h" diff --git a/trunk/drivers/media/video/tveeprom.c b/trunk/drivers/media/video/tveeprom.c index bcc32fa92a81..9da0e1807ffb 100644 --- a/trunk/drivers/media/video/tveeprom.c +++ b/trunk/drivers/media/video/tveeprom.c @@ -34,13 +34,13 @@ #include #include #include -#include +#include #include #include #include #include -#include +#include MODULE_DESCRIPTION("i2c Hauppauge eeprom decoder driver"); MODULE_AUTHOR("John Klar"); @@ -261,72 +261,70 @@ hauppauge_tuner[] = { TUNER_ABSENT, "MaxLinear MXL5005_v2"}, { TUNER_PHILIPS_TDA8290, "Philips 18271_8295"}, /* 150-159 */ - { TUNER_ABSENT, "Xceive XC5000"}, + { TUNER_ABSENT, "Xceive XC5000"}, }; -/* Use V4L2_IDENT_AMBIGUOUS for those audio 'chips' that are - * internal to a video chip, i.e. not a separate audio chip. */ static struct HAUPPAUGE_AUDIOIC { - u32 id; + enum audiochip id; char *name; } audioIC[] = { /* 0-4 */ - { V4L2_IDENT_NONE, "None" }, - { V4L2_IDENT_UNKNOWN, "TEA6300" }, - { V4L2_IDENT_UNKNOWN, "TEA6320" }, - { V4L2_IDENT_UNKNOWN, "TDA9850" }, - { V4L2_IDENT_MSPX4XX, "MSP3400C" }, + {AUDIO_CHIP_NONE, "None"}, + {AUDIO_CHIP_TEA6300, "TEA6300"}, + {AUDIO_CHIP_TEA6300, "TEA6320"}, + {AUDIO_CHIP_TDA985X, "TDA9850"}, + {AUDIO_CHIP_MSP34XX, "MSP3400C"}, /* 5-9 */ - { V4L2_IDENT_MSPX4XX, "MSP3410D" }, - { V4L2_IDENT_MSPX4XX, "MSP3415" }, - { V4L2_IDENT_MSPX4XX, "MSP3430" }, - { V4L2_IDENT_MSPX4XX, "MSP3438" }, - { V4L2_IDENT_UNKNOWN, "CS5331" }, + {AUDIO_CHIP_MSP34XX, "MSP3410D"}, + {AUDIO_CHIP_MSP34XX, "MSP3415"}, + {AUDIO_CHIP_MSP34XX, "MSP3430"}, + {AUDIO_CHIP_MSP34XX, "MSP3438"}, + {AUDIO_CHIP_UNKNOWN, "CS5331"}, /* 10-14 */ - { V4L2_IDENT_MSPX4XX, "MSP3435" }, - { V4L2_IDENT_MSPX4XX, "MSP3440" }, - { V4L2_IDENT_MSPX4XX, "MSP3445" }, - { V4L2_IDENT_MSPX4XX, "MSP3411" }, - { V4L2_IDENT_MSPX4XX, "MSP3416" }, + {AUDIO_CHIP_MSP34XX, "MSP3435"}, + {AUDIO_CHIP_MSP34XX, "MSP3440"}, + {AUDIO_CHIP_MSP34XX, "MSP3445"}, + {AUDIO_CHIP_MSP34XX, "MSP3411"}, + {AUDIO_CHIP_MSP34XX, "MSP3416"}, /* 15-19 */ - { V4L2_IDENT_MSPX4XX, "MSP3425" }, - { V4L2_IDENT_MSPX4XX, "MSP3451" }, - { V4L2_IDENT_MSPX4XX, "MSP3418" }, - { V4L2_IDENT_UNKNOWN, "Type 0x12" }, - { V4L2_IDENT_UNKNOWN, "OKI7716" }, + {AUDIO_CHIP_MSP34XX, "MSP3425"}, + {AUDIO_CHIP_MSP34XX, "MSP3451"}, + {AUDIO_CHIP_MSP34XX, "MSP3418"}, + {AUDIO_CHIP_UNKNOWN, "Type 0x12"}, + {AUDIO_CHIP_UNKNOWN, "OKI7716"}, /* 20-24 */ - { V4L2_IDENT_MSPX4XX, "MSP4410" }, - { V4L2_IDENT_MSPX4XX, "MSP4420" }, - { V4L2_IDENT_MSPX4XX, "MSP4440" }, - { V4L2_IDENT_MSPX4XX, "MSP4450" }, - { V4L2_IDENT_MSPX4XX, "MSP4408" }, + {AUDIO_CHIP_MSP34XX, "MSP4410"}, + {AUDIO_CHIP_MSP34XX, "MSP4420"}, + {AUDIO_CHIP_MSP34XX, "MSP4440"}, + {AUDIO_CHIP_MSP34XX, "MSP4450"}, + {AUDIO_CHIP_MSP34XX, "MSP4408"}, /* 25-29 */ - { V4L2_IDENT_MSPX4XX, "MSP4418" }, - { V4L2_IDENT_MSPX4XX, "MSP4428" }, - { V4L2_IDENT_MSPX4XX, "MSP4448" }, - { V4L2_IDENT_MSPX4XX, "MSP4458" }, - { V4L2_IDENT_MSPX4XX, "Type 0x1d" }, + {AUDIO_CHIP_MSP34XX, "MSP4418"}, + {AUDIO_CHIP_MSP34XX, "MSP4428"}, + {AUDIO_CHIP_MSP34XX, "MSP4448"}, + {AUDIO_CHIP_MSP34XX, "MSP4458"}, + {AUDIO_CHIP_MSP34XX, "Type 0x1d"}, /* 30-34 */ - { V4L2_IDENT_AMBIGUOUS, "CX880" }, - { V4L2_IDENT_AMBIGUOUS, "CX881" }, - { V4L2_IDENT_AMBIGUOUS, "CX883" }, - { V4L2_IDENT_AMBIGUOUS, "CX882" }, - { V4L2_IDENT_AMBIGUOUS, "CX25840" }, + {AUDIO_CHIP_INTERNAL, "CX880"}, + {AUDIO_CHIP_INTERNAL, "CX881"}, + {AUDIO_CHIP_INTERNAL, "CX883"}, + {AUDIO_CHIP_INTERNAL, "CX882"}, + {AUDIO_CHIP_INTERNAL, "CX25840"}, /* 35-39 */ - { V4L2_IDENT_AMBIGUOUS, "CX25841" }, - { V4L2_IDENT_AMBIGUOUS, "CX25842" }, - { V4L2_IDENT_AMBIGUOUS, "CX25843" }, - { V4L2_IDENT_AMBIGUOUS, "CX23418" }, - { V4L2_IDENT_AMBIGUOUS, "CX23885" }, + {AUDIO_CHIP_INTERNAL, "CX25841"}, + {AUDIO_CHIP_INTERNAL, "CX25842"}, + {AUDIO_CHIP_INTERNAL, "CX25843"}, + {AUDIO_CHIP_INTERNAL, "CX23418"}, + {AUDIO_CHIP_INTERNAL, "CX23885"}, /* 40-44 */ - { V4L2_IDENT_AMBIGUOUS, "CX23888" }, - { V4L2_IDENT_AMBIGUOUS, "SAA7131" }, - { V4L2_IDENT_AMBIGUOUS, "CX23887" }, - { V4L2_IDENT_AMBIGUOUS, "SAA7164" }, - { V4L2_IDENT_AMBIGUOUS, "AU8522" }, + {AUDIO_CHIP_INTERNAL, "CX23888"}, + {AUDIO_CHIP_INTERNAL, "SAA7131"}, + {AUDIO_CHIP_INTERNAL, "CX23887"}, + {AUDIO_CHIP_INTERNAL, "SAA7164"}, + {AUDIO_CHIP_INTERNAL, "AU8522"}, }; /* This list is supplied by Hauppauge. Thanks! */ @@ -485,7 +483,7 @@ void tveeprom_hauppauge_analog(struct i2c_client *c, struct tveeprom *tvee, tvee->has_radio = eeprom_data[i+len-1]; /* old style tag, don't know how to detect IR presence, mark as unknown. */ - tvee->has_ir = 0; + tvee->has_ir = -1; tvee->model = eeprom_data[i+8] + (eeprom_data[i+9] << 8); @@ -511,7 +509,7 @@ void tveeprom_hauppauge_analog(struct i2c_client *c, struct tveeprom *tvee, if (audioic < ARRAY_SIZE(audioIC)) tvee->audio_processor = audioIC[audioic].id; else - tvee->audio_processor = V4L2_IDENT_UNKNOWN; + tvee->audio_processor = AUDIO_CHIP_UNKNOWN; break; /* case 0x03: tag 'EEInfo' */ @@ -544,7 +542,7 @@ void tveeprom_hauppauge_analog(struct i2c_client *c, struct tveeprom *tvee, if (audioic < ARRAY_SIZE(audioIC)) tvee->audio_processor = audioIC[audioic].id; else - tvee->audio_processor = V4L2_IDENT_UNKNOWN; + tvee->audio_processor = AUDIO_CHIP_UNKNOWN; break; @@ -605,7 +603,7 @@ void tveeprom_hauppauge_analog(struct i2c_client *c, struct tveeprom *tvee, case 0x0f: /* tag 'IRInfo' */ - tvee->has_ir = 1 | (eeprom_data[i+1] << 1); + tvee->has_ir = eeprom_data[i+1]; break; /* case 0x10: tag 'VBIInfo' */ @@ -692,7 +690,7 @@ void tveeprom_hauppauge_analog(struct i2c_client *c, struct tveeprom *tvee, t_fmt_name2[6], t_fmt_name2[7], t_format2); if (audioic < 0) { tveeprom_info("audio processor is unknown (no idx)\n"); - tvee->audio_processor = V4L2_IDENT_UNKNOWN; + tvee->audio_processor = AUDIO_CHIP_UNKNOWN; } else { if (audioic < ARRAY_SIZE(audioIC)) tveeprom_info("audio processor is %s (idx %d)\n", @@ -705,14 +703,14 @@ void tveeprom_hauppauge_analog(struct i2c_client *c, struct tveeprom *tvee, tveeprom_info("decoder processor is %s (idx %d)\n", STRM(decoderIC, tvee->decoder_processor), tvee->decoder_processor); - if (tvee->has_ir) - tveeprom_info("has %sradio, has %sIR receiver, has %sIR transmitter\n", - tvee->has_radio ? "" : "no ", - (tvee->has_ir & 2) ? "" : "no ", - (tvee->has_ir & 4) ? "" : "no "); - else + if (tvee->has_ir == -1) tveeprom_info("has %sradio\n", tvee->has_radio ? "" : "no "); + else + tveeprom_info("has %sradio, has %sIR receiver, has %sIR transmitter\n", + tvee->has_radio ? "" : "no ", + (tvee->has_ir & 1) ? "" : "no ", + (tvee->has_ir & 2) ? "" : "no "); } EXPORT_SYMBOL(tveeprom_hauppauge_analog); diff --git a/trunk/drivers/media/video/tvp5150.c b/trunk/drivers/media/video/tvp5150.c index 28af5ce5560d..6a3af1005f03 100644 --- a/trunk/drivers/media/video/tvp5150.c +++ b/trunk/drivers/media/video/tvp5150.c @@ -6,7 +6,7 @@ */ #include -#include +#include #include #include #include diff --git a/trunk/drivers/media/video/usbvideo/usbvideo.c b/trunk/drivers/media/video/usbvideo/usbvideo.c index bf1bc2f69b02..4128ee20b64e 100644 --- a/trunk/drivers/media/video/usbvideo/usbvideo.c +++ b/trunk/drivers/media/video/usbvideo/usbvideo.c @@ -952,6 +952,8 @@ static const struct file_operations usbvideo_fops = { .llseek = no_llseek, }; static const struct video_device usbvideo_template = { + .owner = THIS_MODULE, + .type = VID_TYPE_CAPTURE, .fops = &usbvideo_fops, }; @@ -1038,7 +1040,7 @@ int usbvideo_RegisterVideoDevice(struct uvd *uvd) err("%s: uvd->dev == NULL", __func__); return -EINVAL; } - uvd->vdev.parent = &uvd->dev->dev; + uvd->vdev.dev = &uvd->dev->dev; if (video_register_device(&uvd->vdev, VFL_TYPE_GRABBER, video_nr) == -1) { err("%s: video_register_device failed", __func__); return -EPIPE; diff --git a/trunk/drivers/media/video/usbvideo/usbvideo.h b/trunk/drivers/media/video/usbvideo/usbvideo.h index c66985beb8c9..051775d4c726 100644 --- a/trunk/drivers/media/video/usbvideo/usbvideo.h +++ b/trunk/drivers/media/video/usbvideo/usbvideo.h @@ -18,7 +18,6 @@ #include #include -#include #include #include diff --git a/trunk/drivers/media/video/usbvideo/vicam.c b/trunk/drivers/media/video/usbvideo/vicam.c index b7792451a299..40d053e0d5bf 100644 --- a/trunk/drivers/media/video/usbvideo/vicam.c +++ b/trunk/drivers/media/video/usbvideo/vicam.c @@ -41,7 +41,6 @@ #include #include #include -#include #include #include #include @@ -792,7 +791,9 @@ static const struct file_operations vicam_fops = { }; static struct video_device vicam_template = { + .owner = THIS_MODULE, .name = "ViCam-based USB Camera", + .type = VID_TYPE_CAPTURE, .fops = &vicam_fops, .minor = -1, }; diff --git a/trunk/drivers/media/video/usbvision/usbvision-core.c b/trunk/drivers/media/video/usbvision/usbvision-core.c index c317ed7a8482..abf685464b7c 100644 --- a/trunk/drivers/media/video/usbvision/usbvision-core.c +++ b/trunk/drivers/media/video/usbvision/usbvision-core.c @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #include @@ -42,6 +43,7 @@ #include #include #include +#include #include diff --git a/trunk/drivers/media/video/usbvision/usbvision-video.c b/trunk/drivers/media/video/usbvision/usbvision-video.c index b977116a0dd9..cd6c41d67899 100644 --- a/trunk/drivers/media/video/usbvision/usbvision-video.c +++ b/trunk/drivers/media/video/usbvision/usbvision-video.c @@ -53,6 +53,7 @@ #include #include #include +#include #include #include #include @@ -64,8 +65,8 @@ #include #include -#include #include +#include #include @@ -183,7 +184,7 @@ MODULE_ALIAS(DRIVER_ALIAS); static inline struct usb_usbvision *cd_to_usbvision(struct device *cd) { struct video_device *vdev = - container_of(cd, struct video_device, dev); + container_of(cd, struct video_device, class_dev); return video_get_drvdata(vdev); } @@ -198,7 +199,7 @@ static ssize_t show_model(struct device *cd, struct device_attribute *attr, char *buf) { struct video_device *vdev = - container_of(cd, struct video_device, dev); + container_of(cd, struct video_device, class_dev); struct usb_usbvision *usbvision = video_get_drvdata(vdev); return sprintf(buf, "%s\n", usbvision_device_data[usbvision->DevModel].ModelString); @@ -209,7 +210,7 @@ static ssize_t show_hue(struct device *cd, struct device_attribute *attr, char *buf) { struct video_device *vdev = - container_of(cd, struct video_device, dev); + container_of(cd, struct video_device, class_dev); struct usb_usbvision *usbvision = video_get_drvdata(vdev); struct v4l2_control ctrl; ctrl.id = V4L2_CID_HUE; @@ -224,7 +225,7 @@ static ssize_t show_contrast(struct device *cd, struct device_attribute *attr, char *buf) { struct video_device *vdev = - container_of(cd, struct video_device, dev); + container_of(cd, struct video_device, class_dev); struct usb_usbvision *usbvision = video_get_drvdata(vdev); struct v4l2_control ctrl; ctrl.id = V4L2_CID_CONTRAST; @@ -239,7 +240,7 @@ static ssize_t show_brightness(struct device *cd, struct device_attribute *attr, char *buf) { struct video_device *vdev = - container_of(cd, struct video_device, dev); + container_of(cd, struct video_device, class_dev); struct usb_usbvision *usbvision = video_get_drvdata(vdev); struct v4l2_control ctrl; ctrl.id = V4L2_CID_BRIGHTNESS; @@ -254,7 +255,7 @@ static ssize_t show_saturation(struct device *cd, struct device_attribute *attr, char *buf) { struct video_device *vdev = - container_of(cd, struct video_device, dev); + container_of(cd, struct video_device, class_dev); struct usb_usbvision *usbvision = video_get_drvdata(vdev); struct v4l2_control ctrl; ctrl.id = V4L2_CID_SATURATION; @@ -269,7 +270,7 @@ static ssize_t show_streaming(struct device *cd, struct device_attribute *attr, char *buf) { struct video_device *vdev = - container_of(cd, struct video_device, dev); + container_of(cd, struct video_device, class_dev); struct usb_usbvision *usbvision = video_get_drvdata(vdev); return sprintf(buf, "%s\n", YES_NO(usbvision->streaming==Stream_On?1:0)); @@ -280,7 +281,7 @@ static ssize_t show_compression(struct device *cd, struct device_attribute *attr, char *buf) { struct video_device *vdev = - container_of(cd, struct video_device, dev); + container_of(cd, struct video_device, class_dev); struct usb_usbvision *usbvision = video_get_drvdata(vdev); return sprintf(buf, "%s\n", YES_NO(usbvision->isocMode==ISOC_MODE_COMPRESS)); @@ -291,7 +292,7 @@ static ssize_t show_device_bridge(struct device *cd, struct device_attribute *attr, char *buf) { struct video_device *vdev = - container_of(cd, struct video_device, dev); + container_of(cd, struct video_device, class_dev); struct usb_usbvision *usbvision = video_get_drvdata(vdev); return sprintf(buf, "%d\n", usbvision->bridgeType); } @@ -303,31 +304,40 @@ static void usbvision_create_sysfs(struct video_device *vdev) if (!vdev) return; do { - res = device_create_file(&vdev->dev, &dev_attr_version); + res = device_create_file(&vdev->class_dev, + &dev_attr_version); if (res<0) break; - res = device_create_file(&vdev->dev, &dev_attr_model); + res = device_create_file(&vdev->class_dev, + &dev_attr_model); if (res<0) break; - res = device_create_file(&vdev->dev, &dev_attr_hue); + res = device_create_file(&vdev->class_dev, + &dev_attr_hue); if (res<0) break; - res = device_create_file(&vdev->dev, &dev_attr_contrast); + res = device_create_file(&vdev->class_dev, + &dev_attr_contrast); if (res<0) break; - res = device_create_file(&vdev->dev, &dev_attr_brightness); + res = device_create_file(&vdev->class_dev, + &dev_attr_brightness); if (res<0) break; - res = device_create_file(&vdev->dev, &dev_attr_saturation); + res = device_create_file(&vdev->class_dev, + &dev_attr_saturation); if (res<0) break; - res = device_create_file(&vdev->dev, &dev_attr_streaming); + res = device_create_file(&vdev->class_dev, + &dev_attr_streaming); if (res<0) break; - res = device_create_file(&vdev->dev, &dev_attr_compression); + res = device_create_file(&vdev->class_dev, + &dev_attr_compression); if (res<0) break; - res = device_create_file(&vdev->dev, &dev_attr_bridge); + res = device_create_file(&vdev->class_dev, + &dev_attr_bridge); if (res>=0) return; } while (0); @@ -338,15 +348,24 @@ static void usbvision_create_sysfs(struct video_device *vdev) static void usbvision_remove_sysfs(struct video_device *vdev) { if (vdev) { - device_remove_file(&vdev->dev, &dev_attr_version); - device_remove_file(&vdev->dev, &dev_attr_model); - device_remove_file(&vdev->dev, &dev_attr_hue); - device_remove_file(&vdev->dev, &dev_attr_contrast); - device_remove_file(&vdev->dev, &dev_attr_brightness); - device_remove_file(&vdev->dev, &dev_attr_saturation); - device_remove_file(&vdev->dev, &dev_attr_streaming); - device_remove_file(&vdev->dev, &dev_attr_compression); - device_remove_file(&vdev->dev, &dev_attr_bridge); + device_remove_file(&vdev->class_dev, + &dev_attr_version); + device_remove_file(&vdev->class_dev, + &dev_attr_model); + device_remove_file(&vdev->class_dev, + &dev_attr_hue); + device_remove_file(&vdev->class_dev, + &dev_attr_contrast); + device_remove_file(&vdev->class_dev, + &dev_attr_brightness); + device_remove_file(&vdev->class_dev, + &dev_attr_saturation); + device_remove_file(&vdev->class_dev, + &dev_attr_streaming); + device_remove_file(&vdev->class_dev, + &dev_attr_compression); + device_remove_file(&vdev->class_dev, + &dev_attr_bridge); } } @@ -1369,8 +1388,13 @@ static const struct file_operations usbvision_fops = { /* .poll = video_poll, */ .compat_ioctl = v4l_compat_ioctl32, }; - -static const struct v4l2_ioctl_ops usbvision_ioctl_ops = { +static struct video_device usbvision_video_template = { + .owner = THIS_MODULE, + .type = VID_TYPE_TUNER | VID_TYPE_CAPTURE, + .fops = &usbvision_fops, + .name = "usbvision-video", + .release = video_device_release, + .minor = -1, .vidioc_querycap = vidioc_querycap, .vidioc_enum_fmt_vid_cap = vidioc_enum_fmt_vid_cap, .vidioc_g_fmt_vid_cap = vidioc_g_fmt_vid_cap, @@ -1402,14 +1426,6 @@ static const struct v4l2_ioctl_ops usbvision_ioctl_ops = { .vidioc_g_register = vidioc_g_register, .vidioc_s_register = vidioc_s_register, #endif -}; - -static struct video_device usbvision_video_template = { - .fops = &usbvision_fops, - .ioctl_ops = &usbvision_ioctl_ops, - .name = "usbvision-video", - .release = video_device_release, - .minor = -1, .tvnorms = USBVISION_NORMS, .current_norm = V4L2_STD_PAL }; @@ -1425,7 +1441,14 @@ static const struct file_operations usbvision_radio_fops = { .compat_ioctl = v4l_compat_ioctl32, }; -static const struct v4l2_ioctl_ops usbvision_radio_ioctl_ops = { +static struct video_device usbvision_radio_template= +{ + .owner = THIS_MODULE, + .type = VID_TYPE_TUNER, + .fops = &usbvision_radio_fops, + .name = "usbvision-radio", + .release = video_device_release, + .minor = -1, .vidioc_querycap = vidioc_querycap, .vidioc_enum_input = vidioc_enum_input, .vidioc_g_input = vidioc_g_input, @@ -1439,14 +1462,6 @@ static const struct v4l2_ioctl_ops usbvision_radio_ioctl_ops = { .vidioc_s_tuner = vidioc_s_tuner, .vidioc_g_frequency = vidioc_g_frequency, .vidioc_s_frequency = vidioc_s_frequency, -}; - -static struct video_device usbvision_radio_template = { - .fops = &usbvision_radio_fops, - .name = "usbvision-radio", - .release = video_device_release, - .minor = -1, - .ioctl_ops = &usbvision_radio_ioctl_ops, .tvnorms = USBVISION_NORMS, .current_norm = V4L2_STD_PAL @@ -1464,6 +1479,8 @@ static const struct file_operations usbvision_vbi_fops = { static struct video_device usbvision_vbi_template= { + .owner = THIS_MODULE, + .type = VID_TYPE_TUNER, .fops = &usbvision_vbi_fops, .release = video_device_release, .name = "usbvision-vbi", @@ -1489,7 +1506,7 @@ static struct video_device *usbvision_vdev_init(struct usb_usbvision *usbvision, } *vdev = *vdev_template; // vdev->minor = -1; - vdev->parent = &usb_dev->dev; + vdev->dev = &usb_dev->dev; snprintf(vdev->name, sizeof(vdev->name), "%s", name); video_set_drvdata(vdev, usbvision); return vdev; diff --git a/trunk/drivers/media/video/uvc/uvc_ctrl.c b/trunk/drivers/media/video/uvc/uvc_ctrl.c index 626f4ad7e876..3ae95512666f 100644 --- a/trunk/drivers/media/video/uvc/uvc_ctrl.c +++ b/trunk/drivers/media/video/uvc/uvc_ctrl.c @@ -195,8 +195,8 @@ static struct uvc_menu_info power_line_frequency_controls[] = { }; static struct uvc_menu_info exposure_auto_controls[] = { - { 2, "Auto Mode" }, { 1, "Manual Mode" }, + { 2, "Auto Mode" }, { 4, "Shutter Priority Mode" }, { 8, "Aperture Priority Mode" }, }; @@ -592,7 +592,6 @@ int uvc_query_v4l2_ctrl(struct uvc_video_device *video, if (ctrl == NULL) return -EINVAL; - memset(v4l2_ctrl, 0, sizeof *v4l2_ctrl); v4l2_ctrl->id = mapping->id; v4l2_ctrl->type = mapping->v4l2_type; strncpy(v4l2_ctrl->name, mapping->name, sizeof v4l2_ctrl->name); @@ -609,8 +608,7 @@ int uvc_query_v4l2_ctrl(struct uvc_video_device *video, v4l2_ctrl->default_value = uvc_get_le_value(data, mapping); } - switch (mapping->v4l2_type) { - case V4L2_CTRL_TYPE_MENU: + if (mapping->v4l2_type == V4L2_CTRL_TYPE_MENU) { v4l2_ctrl->minimum = 0; v4l2_ctrl->maximum = mapping->menu_count - 1; v4l2_ctrl->step = 1; @@ -624,15 +622,6 @@ int uvc_query_v4l2_ctrl(struct uvc_video_device *video, } return 0; - - case V4L2_CTRL_TYPE_BOOLEAN: - v4l2_ctrl->minimum = 0; - v4l2_ctrl->maximum = 1; - v4l2_ctrl->step = 1; - return 0; - - default: - break; } if (ctrl->info->flags & UVC_CONTROL_GET_MIN) { diff --git a/trunk/drivers/media/video/uvc/uvc_driver.c b/trunk/drivers/media/video/uvc/uvc_driver.c index b3c4d75e8490..f2b2983fe062 100644 --- a/trunk/drivers/media/video/uvc/uvc_driver.c +++ b/trunk/drivers/media/video/uvc/uvc_driver.c @@ -1458,7 +1458,9 @@ static int uvc_register_video(struct uvc_device *dev) * unregistered before the reference is released, so we don't need to * get another one. */ - vdev->parent = &dev->intf->dev; + vdev->dev = &dev->intf->dev; + vdev->type = 0; + vdev->type2 = 0; vdev->minor = -1; vdev->fops = &uvc_fops; vdev->release = video_device_release; diff --git a/trunk/drivers/media/video/uvc/uvc_v4l2.c b/trunk/drivers/media/video/uvc/uvc_v4l2.c index d7bd71be40a9..b5a11eb8f9fa 100644 --- a/trunk/drivers/media/video/uvc/uvc_v4l2.c +++ b/trunk/drivers/media/video/uvc/uvc_v4l2.c @@ -23,7 +23,6 @@ #include #include -#include #include "uvcvideo.h" diff --git a/trunk/drivers/media/video/v4l1-compat.c b/trunk/drivers/media/video/v4l1-compat.c index 79937d1031fc..a0f6c60279ec 100644 --- a/trunk/drivers/media/video/v4l1-compat.c +++ b/trunk/drivers/media/video/v4l1-compat.c @@ -30,7 +30,6 @@ #include #include #include -#include #include #include diff --git a/trunk/drivers/media/video/v4l2-common.c b/trunk/drivers/media/video/v4l2-common.c index 88ca13104417..e9dd996fd5df 100644 --- a/trunk/drivers/media/video/v4l2-common.c +++ b/trunk/drivers/media/video/v4l2-common.c @@ -64,7 +64,7 @@ #include #endif -#include +#include MODULE_AUTHOR("Bill Dirks, Justin Schoeman, Gerd Knorr"); MODULE_DESCRIPTION("misc helper functions for v4l2 device drivers"); diff --git a/trunk/drivers/media/video/v4l2-dev.c b/trunk/drivers/media/video/v4l2-dev.c deleted file mode 100644 index 556615fe93de..000000000000 --- a/trunk/drivers/media/video/v4l2-dev.c +++ /dev/null @@ -1,422 +0,0 @@ -/* - * Video capture interface for Linux version 2 - * - * A generic video device interface for the LINUX operating system - * using a set of device structures/vectors for low level operations. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * - * Authors: Alan Cox, (version 1) - * Mauro Carvalho Chehab (version 2) - * - * Fixes: 20000516 Claudio Matsuoka - * - Added procfs support - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#define VIDEO_NUM_DEVICES 256 -#define VIDEO_NAME "video4linux" - -/* - * sysfs stuff - */ - -static ssize_t show_index(struct device *cd, - struct device_attribute *attr, char *buf) -{ - struct video_device *vfd = container_of(cd, struct video_device, dev); - return sprintf(buf, "%i\n", vfd->index); -} - -static ssize_t show_name(struct device *cd, - struct device_attribute *attr, char *buf) -{ - struct video_device *vfd = container_of(cd, struct video_device, dev); - return sprintf(buf, "%.*s\n", (int)sizeof(vfd->name), vfd->name); -} - -static struct device_attribute video_device_attrs[] = { - __ATTR(name, S_IRUGO, show_name, NULL), - __ATTR(index, S_IRUGO, show_index, NULL), - __ATTR_NULL -}; - -struct video_device *video_device_alloc(void) -{ - struct video_device *vfd; - - vfd = kzalloc(sizeof(*vfd), GFP_KERNEL); - return vfd; -} -EXPORT_SYMBOL(video_device_alloc); - -void video_device_release(struct video_device *vfd) -{ - kfree(vfd); -} -EXPORT_SYMBOL(video_device_release); - -static void video_release(struct device *cd) -{ - struct video_device *vfd = container_of(cd, struct video_device, dev); - -#if 1 - /* needed until all drivers are fixed */ - if (!vfd->release) - return; -#endif - vfd->release(vfd); -} - -static struct class video_class = { - .name = VIDEO_NAME, - .dev_attrs = video_device_attrs, - .dev_release = video_release, -}; - -/* - * Active devices - */ - -static struct video_device *video_device[VIDEO_NUM_DEVICES]; -static DEFINE_MUTEX(videodev_lock); - -struct video_device *video_devdata(struct file *file) -{ - return video_device[iminor(file->f_path.dentry->d_inode)]; -} -EXPORT_SYMBOL(video_devdata); - -/* - * Open a video device - FIXME: Obsoleted - */ -static int video_open(struct inode *inode, struct file *file) -{ - unsigned int minor = iminor(inode); - int err = 0; - struct video_device *vfl; - const struct file_operations *old_fops; - - if (minor >= VIDEO_NUM_DEVICES) - return -ENODEV; - lock_kernel(); - mutex_lock(&videodev_lock); - vfl = video_device[minor]; - if (vfl == NULL) { - mutex_unlock(&videodev_lock); - request_module("char-major-%d-%d", VIDEO_MAJOR, minor); - mutex_lock(&videodev_lock); - vfl = video_device[minor]; - if (vfl == NULL) { - mutex_unlock(&videodev_lock); - unlock_kernel(); - return -ENODEV; - } - } - old_fops = file->f_op; - file->f_op = fops_get(vfl->fops); - if (file->f_op->open) - err = file->f_op->open(inode, file); - if (err) { - fops_put(file->f_op); - file->f_op = fops_get(old_fops); - } - fops_put(old_fops); - mutex_unlock(&videodev_lock); - unlock_kernel(); - return err; -} - -/* - * open/release helper functions -- handle exclusive opens - * Should be removed soon - */ -int video_exclusive_open(struct inode *inode, struct file *file) -{ - struct video_device *vfl = video_devdata(file); - int retval = 0; - - mutex_lock(&vfl->lock); - if (vfl->users) - retval = -EBUSY; - else - vfl->users++; - mutex_unlock(&vfl->lock); - return retval; -} -EXPORT_SYMBOL(video_exclusive_open); - -int video_exclusive_release(struct inode *inode, struct file *file) -{ - struct video_device *vfl = video_devdata(file); - - vfl->users--; - return 0; -} -EXPORT_SYMBOL(video_exclusive_release); - -/** - * get_index - assign stream number based on parent device - * @vdev: video_device to assign index number to, vdev->dev should be assigned - * @num: -1 if auto assign, requested number otherwise - * - * - * returns -ENFILE if num is already in use, a free index number if - * successful. - */ -static int get_index(struct video_device *vdev, int num) -{ - u32 used = 0; - const int max_index = sizeof(used) * 8 - 1; - int i; - - /* Currently a single v4l driver instance cannot create more than - 32 devices. - Increase to u64 or an array of u32 if more are needed. */ - if (num > max_index) { - printk(KERN_ERR "videodev: %s num is too large\n", __func__); - return -EINVAL; - } - - for (i = 0; i < VIDEO_NUM_DEVICES; i++) { - if (video_device[i] != NULL && - video_device[i] != vdev && - video_device[i]->parent == vdev->parent) { - used |= 1 << video_device[i]->index; - } - } - - if (num >= 0) { - if (used & (1 << num)) - return -ENFILE; - return num; - } - - i = ffz(used); - return i > max_index ? -ENFILE : i; -} - -static const struct file_operations video_fops; - -int video_register_device(struct video_device *vfd, int type, int nr) -{ - return video_register_device_index(vfd, type, nr, -1); -} -EXPORT_SYMBOL(video_register_device); - -/** - * video_register_device - register video4linux devices - * @vfd: video device structure we want to register - * @type: type of device to register - * @nr: which device number (0 == /dev/video0, 1 == /dev/video1, ... - * -1 == first free) - * - * The registration code assigns minor numbers based on the type - * requested. -ENFILE is returned in all the device slots for this - * category are full. If not then the minor field is set and the - * driver initialize function is called (if non %NULL). - * - * Zero is returned on success. - * - * Valid types are - * - * %VFL_TYPE_GRABBER - A frame grabber - * - * %VFL_TYPE_VTX - A teletext device - * - * %VFL_TYPE_VBI - Vertical blank data (undecoded) - * - * %VFL_TYPE_RADIO - A radio card - */ - -int video_register_device_index(struct video_device *vfd, int type, int nr, - int index) -{ - int i = 0; - int base; - int end; - int ret; - char *name_base; - - switch (type) { - case VFL_TYPE_GRABBER: - base = MINOR_VFL_TYPE_GRABBER_MIN; - end = MINOR_VFL_TYPE_GRABBER_MAX+1; - name_base = "video"; - break; - case VFL_TYPE_VTX: - base = MINOR_VFL_TYPE_VTX_MIN; - end = MINOR_VFL_TYPE_VTX_MAX+1; - name_base = "vtx"; - break; - case VFL_TYPE_VBI: - base = MINOR_VFL_TYPE_VBI_MIN; - end = MINOR_VFL_TYPE_VBI_MAX+1; - name_base = "vbi"; - break; - case VFL_TYPE_RADIO: - base = MINOR_VFL_TYPE_RADIO_MIN; - end = MINOR_VFL_TYPE_RADIO_MAX+1; - name_base = "radio"; - break; - default: - printk(KERN_ERR "%s called with unknown type: %d\n", - __func__, type); - return -1; - } - - /* pick a minor number */ - mutex_lock(&videodev_lock); - if (nr >= 0 && nr < end-base) { - /* use the one the driver asked for */ - i = base + nr; - if (NULL != video_device[i]) { - mutex_unlock(&videodev_lock); - return -ENFILE; - } - } else { - /* use first free */ - for (i = base; i < end; i++) - if (NULL == video_device[i]) - break; - if (i == end) { - mutex_unlock(&videodev_lock); - return -ENFILE; - } - } - video_device[i] = vfd; - vfd->vfl_type = type; - vfd->minor = i; - - ret = get_index(vfd, index); - vfd->index = ret; - - mutex_unlock(&videodev_lock); - - if (ret < 0) { - printk(KERN_ERR "%s: get_index failed\n", __func__); - goto fail_minor; - } - - mutex_init(&vfd->lock); - - /* sysfs class */ - memset(&vfd->dev, 0x00, sizeof(vfd->dev)); - vfd->dev.class = &video_class; - vfd->dev.devt = MKDEV(VIDEO_MAJOR, vfd->minor); - if (vfd->parent) - vfd->dev.parent = vfd->parent; - sprintf(vfd->dev.bus_id, "%s%d", name_base, i - base); - ret = device_register(&vfd->dev); - if (ret < 0) { - printk(KERN_ERR "%s: device_register failed\n", __func__); - goto fail_minor; - } - -#if 1 - /* needed until all drivers are fixed */ - if (!vfd->release) - printk(KERN_WARNING "videodev: \"%s\" has no release callback. " - "Please fix your driver for proper sysfs support, see " - "http://lwn.net/Articles/36850/\n", vfd->name); -#endif - return 0; - -fail_minor: - mutex_lock(&videodev_lock); - video_device[vfd->minor] = NULL; - vfd->minor = -1; - mutex_unlock(&videodev_lock); - return ret; -} -EXPORT_SYMBOL(video_register_device_index); - -/** - * video_unregister_device - unregister a video4linux device - * @vfd: the device to unregister - * - * This unregisters the passed device and deassigns the minor - * number. Future open calls will be met with errors. - */ - -void video_unregister_device(struct video_device *vfd) -{ - mutex_lock(&videodev_lock); - if (video_device[vfd->minor] != vfd) - panic("videodev: bad unregister"); - - video_device[vfd->minor] = NULL; - device_unregister(&vfd->dev); - mutex_unlock(&videodev_lock); -} -EXPORT_SYMBOL(video_unregister_device); - -/* - * Video fs operations - */ -static const struct file_operations video_fops = { - .owner = THIS_MODULE, - .llseek = no_llseek, - .open = video_open, -}; - -/* - * Initialise video for linux - */ - -static int __init videodev_init(void) -{ - int ret; - - printk(KERN_INFO "Linux video capture interface: v2.00\n"); - if (register_chrdev(VIDEO_MAJOR, VIDEO_NAME, &video_fops)) { - printk(KERN_WARNING "video_dev: unable to get major %d\n", VIDEO_MAJOR); - return -EIO; - } - - ret = class_register(&video_class); - if (ret < 0) { - unregister_chrdev(VIDEO_MAJOR, VIDEO_NAME); - printk(KERN_WARNING "video_dev: class_register failed\n"); - return -EIO; - } - - return 0; -} - -static void __exit videodev_exit(void) -{ - class_unregister(&video_class); - unregister_chrdev(VIDEO_MAJOR, VIDEO_NAME); -} - -module_init(videodev_init) -module_exit(videodev_exit) - -MODULE_AUTHOR("Alan Cox, Mauro Carvalho Chehab "); -MODULE_DESCRIPTION("Device registrar for Video4Linux drivers v2"); -MODULE_LICENSE("GPL"); - - -/* - * Local variables: - * c-basic-offset: 8 - * End: - */ diff --git a/trunk/drivers/media/video/v4l2-ioctl.c b/trunk/drivers/media/video/v4l2-ioctl.c deleted file mode 100644 index fdfe7739c96e..000000000000 --- a/trunk/drivers/media/video/v4l2-ioctl.c +++ /dev/null @@ -1,1875 +0,0 @@ -/* - * Video capture interface for Linux version 2 - * - * A generic framework to process V4L2 ioctl commands. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * - * Authors: Alan Cox, (version 1) - * Mauro Carvalho Chehab (version 2) - */ - -#include -#include -#include - -#define __OLD_VIDIOC_ /* To allow fixing old calls */ -#include - -#ifdef CONFIG_VIDEO_V4L1 -#include -#endif -#include -#include -#include - -#define dbgarg(cmd, fmt, arg...) \ - do { \ - if (vfd->debug & V4L2_DEBUG_IOCTL_ARG) { \ - printk(KERN_DEBUG "%s: ", vfd->name); \ - v4l_printk_ioctl(cmd); \ - printk(" " fmt, ## arg); \ - } \ - } while (0) - -#define dbgarg2(fmt, arg...) \ - do { \ - if (vfd->debug & V4L2_DEBUG_IOCTL_ARG) \ - printk(KERN_DEBUG "%s: " fmt, vfd->name, ## arg);\ - } while (0) - -struct std_descr { - v4l2_std_id std; - const char *descr; -}; - -static const struct std_descr standards[] = { - { V4L2_STD_NTSC, "NTSC" }, - { V4L2_STD_NTSC_M, "NTSC-M" }, - { V4L2_STD_NTSC_M_JP, "NTSC-M-JP" }, - { V4L2_STD_NTSC_M_KR, "NTSC-M-KR" }, - { V4L2_STD_NTSC_443, "NTSC-443" }, - { V4L2_STD_PAL, "PAL" }, - { V4L2_STD_PAL_BG, "PAL-BG" }, - { V4L2_STD_PAL_B, "PAL-B" }, - { V4L2_STD_PAL_B1, "PAL-B1" }, - { V4L2_STD_PAL_G, "PAL-G" }, - { V4L2_STD_PAL_H, "PAL-H" }, - { V4L2_STD_PAL_I, "PAL-I" }, - { V4L2_STD_PAL_DK, "PAL-DK" }, - { V4L2_STD_PAL_D, "PAL-D" }, - { V4L2_STD_PAL_D1, "PAL-D1" }, - { V4L2_STD_PAL_K, "PAL-K" }, - { V4L2_STD_PAL_M, "PAL-M" }, - { V4L2_STD_PAL_N, "PAL-N" }, - { V4L2_STD_PAL_Nc, "PAL-Nc" }, - { V4L2_STD_PAL_60, "PAL-60" }, - { V4L2_STD_SECAM, "SECAM" }, - { V4L2_STD_SECAM_B, "SECAM-B" }, - { V4L2_STD_SECAM_G, "SECAM-G" }, - { V4L2_STD_SECAM_H, "SECAM-H" }, - { V4L2_STD_SECAM_DK, "SECAM-DK" }, - { V4L2_STD_SECAM_D, "SECAM-D" }, - { V4L2_STD_SECAM_K, "SECAM-K" }, - { V4L2_STD_SECAM_K1, "SECAM-K1" }, - { V4L2_STD_SECAM_L, "SECAM-L" }, - { V4L2_STD_SECAM_LC, "SECAM-Lc" }, - { 0, "Unknown" } -}; - -/* video4linux standard ID conversion to standard name - */ -const char *v4l2_norm_to_name(v4l2_std_id id) -{ - u32 myid = id; - int i; - - /* HACK: ppc32 architecture doesn't have __ucmpdi2 function to handle - 64 bit comparations. So, on that architecture, with some gcc - variants, compilation fails. Currently, the max value is 30bit wide. - */ - BUG_ON(myid != id); - - for (i = 0; standards[i].std; i++) - if (myid == standards[i].std) - break; - return standards[i].descr; -} -EXPORT_SYMBOL(v4l2_norm_to_name); - -/* Fill in the fields of a v4l2_standard structure according to the - 'id' and 'transmission' parameters. Returns negative on error. */ -int v4l2_video_std_construct(struct v4l2_standard *vs, - int id, const char *name) -{ - u32 index = vs->index; - - memset(vs, 0, sizeof(struct v4l2_standard)); - vs->index = index; - vs->id = id; - if (id & V4L2_STD_525_60) { - vs->frameperiod.numerator = 1001; - vs->frameperiod.denominator = 30000; - vs->framelines = 525; - } else { - vs->frameperiod.numerator = 1; - vs->frameperiod.denominator = 25; - vs->framelines = 625; - } - strlcpy(vs->name, name, sizeof(vs->name)); - return 0; -} -EXPORT_SYMBOL(v4l2_video_std_construct); - -/* ----------------------------------------------------------------- */ -/* some arrays for pretty-printing debug messages of enum types */ - -const char *v4l2_field_names[] = { - [V4L2_FIELD_ANY] = "any", - [V4L2_FIELD_NONE] = "none", - [V4L2_FIELD_TOP] = "top", - [V4L2_FIELD_BOTTOM] = "bottom", - [V4L2_FIELD_INTERLACED] = "interlaced", - [V4L2_FIELD_SEQ_TB] = "seq-tb", - [V4L2_FIELD_SEQ_BT] = "seq-bt", - [V4L2_FIELD_ALTERNATE] = "alternate", - [V4L2_FIELD_INTERLACED_TB] = "interlaced-tb", - [V4L2_FIELD_INTERLACED_BT] = "interlaced-bt", -}; -EXPORT_SYMBOL(v4l2_field_names); - -const char *v4l2_type_names[] = { - [V4L2_BUF_TYPE_VIDEO_CAPTURE] = "vid-cap", - [V4L2_BUF_TYPE_VIDEO_OVERLAY] = "vid-overlay", - [V4L2_BUF_TYPE_VIDEO_OUTPUT] = "vid-out", - [V4L2_BUF_TYPE_VBI_CAPTURE] = "vbi-cap", - [V4L2_BUF_TYPE_VBI_OUTPUT] = "vbi-out", - [V4L2_BUF_TYPE_SLICED_VBI_CAPTURE] = "sliced-vbi-cap", - [V4L2_BUF_TYPE_SLICED_VBI_OUTPUT] = "sliced-vbi-out", - [V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY] = "vid-out-overlay", -}; -EXPORT_SYMBOL(v4l2_type_names); - -static const char *v4l2_memory_names[] = { - [V4L2_MEMORY_MMAP] = "mmap", - [V4L2_MEMORY_USERPTR] = "userptr", - [V4L2_MEMORY_OVERLAY] = "overlay", -}; - -#define prt_names(a, arr) ((((a) >= 0) && ((a) < ARRAY_SIZE(arr))) ? \ - arr[a] : "unknown") - -/* ------------------------------------------------------------------ */ -/* debug help functions */ - -#ifdef CONFIG_VIDEO_V4L1_COMPAT -static const char *v4l1_ioctls[] = { - [_IOC_NR(VIDIOCGCAP)] = "VIDIOCGCAP", - [_IOC_NR(VIDIOCGCHAN)] = "VIDIOCGCHAN", - [_IOC_NR(VIDIOCSCHAN)] = "VIDIOCSCHAN", - [_IOC_NR(VIDIOCGTUNER)] = "VIDIOCGTUNER", - [_IOC_NR(VIDIOCSTUNER)] = "VIDIOCSTUNER", - [_IOC_NR(VIDIOCGPICT)] = "VIDIOCGPICT", - [_IOC_NR(VIDIOCSPICT)] = "VIDIOCSPICT", - [_IOC_NR(VIDIOCCAPTURE)] = "VIDIOCCAPTURE", - [_IOC_NR(VIDIOCGWIN)] = "VIDIOCGWIN", - [_IOC_NR(VIDIOCSWIN)] = "VIDIOCSWIN", - [_IOC_NR(VIDIOCGFBUF)] = "VIDIOCGFBUF", - [_IOC_NR(VIDIOCSFBUF)] = "VIDIOCSFBUF", - [_IOC_NR(VIDIOCKEY)] = "VIDIOCKEY", - [_IOC_NR(VIDIOCGFREQ)] = "VIDIOCGFREQ", - [_IOC_NR(VIDIOCSFREQ)] = "VIDIOCSFREQ", - [_IOC_NR(VIDIOCGAUDIO)] = "VIDIOCGAUDIO", - [_IOC_NR(VIDIOCSAUDIO)] = "VIDIOCSAUDIO", - [_IOC_NR(VIDIOCSYNC)] = "VIDIOCSYNC", - [_IOC_NR(VIDIOCMCAPTURE)] = "VIDIOCMCAPTURE", - [_IOC_NR(VIDIOCGMBUF)] = "VIDIOCGMBUF", - [_IOC_NR(VIDIOCGUNIT)] = "VIDIOCGUNIT", - [_IOC_NR(VIDIOCGCAPTURE)] = "VIDIOCGCAPTURE", - [_IOC_NR(VIDIOCSCAPTURE)] = "VIDIOCSCAPTURE", - [_IOC_NR(VIDIOCSPLAYMODE)] = "VIDIOCSPLAYMODE", - [_IOC_NR(VIDIOCSWRITEMODE)] = "VIDIOCSWRITEMODE", - [_IOC_NR(VIDIOCGPLAYINFO)] = "VIDIOCGPLAYINFO", - [_IOC_NR(VIDIOCSMICROCODE)] = "VIDIOCSMICROCODE", - [_IOC_NR(VIDIOCGVBIFMT)] = "VIDIOCGVBIFMT", - [_IOC_NR(VIDIOCSVBIFMT)] = "VIDIOCSVBIFMT" -}; -#define V4L1_IOCTLS ARRAY_SIZE(v4l1_ioctls) -#endif - -static const char *v4l2_ioctls[] = { - [_IOC_NR(VIDIOC_QUERYCAP)] = "VIDIOC_QUERYCAP", - [_IOC_NR(VIDIOC_RESERVED)] = "VIDIOC_RESERVED", - [_IOC_NR(VIDIOC_ENUM_FMT)] = "VIDIOC_ENUM_FMT", - [_IOC_NR(VIDIOC_G_FMT)] = "VIDIOC_G_FMT", - [_IOC_NR(VIDIOC_S_FMT)] = "VIDIOC_S_FMT", - [_IOC_NR(VIDIOC_REQBUFS)] = "VIDIOC_REQBUFS", - [_IOC_NR(VIDIOC_QUERYBUF)] = "VIDIOC_QUERYBUF", - [_IOC_NR(VIDIOC_G_FBUF)] = "VIDIOC_G_FBUF", - [_IOC_NR(VIDIOC_S_FBUF)] = "VIDIOC_S_FBUF", - [_IOC_NR(VIDIOC_OVERLAY)] = "VIDIOC_OVERLAY", - [_IOC_NR(VIDIOC_QBUF)] = "VIDIOC_QBUF", - [_IOC_NR(VIDIOC_DQBUF)] = "VIDIOC_DQBUF", - [_IOC_NR(VIDIOC_STREAMON)] = "VIDIOC_STREAMON", - [_IOC_NR(VIDIOC_STREAMOFF)] = "VIDIOC_STREAMOFF", - [_IOC_NR(VIDIOC_G_PARM)] = "VIDIOC_G_PARM", - [_IOC_NR(VIDIOC_S_PARM)] = "VIDIOC_S_PARM", - [_IOC_NR(VIDIOC_G_STD)] = "VIDIOC_G_STD", - [_IOC_NR(VIDIOC_S_STD)] = "VIDIOC_S_STD", - [_IOC_NR(VIDIOC_ENUMSTD)] = "VIDIOC_ENUMSTD", - [_IOC_NR(VIDIOC_ENUMINPUT)] = "VIDIOC_ENUMINPUT", - [_IOC_NR(VIDIOC_G_CTRL)] = "VIDIOC_G_CTRL", - [_IOC_NR(VIDIOC_S_CTRL)] = "VIDIOC_S_CTRL", - [_IOC_NR(VIDIOC_G_TUNER)] = "VIDIOC_G_TUNER", - [_IOC_NR(VIDIOC_S_TUNER)] = "VIDIOC_S_TUNER", - [_IOC_NR(VIDIOC_G_AUDIO)] = "VIDIOC_G_AUDIO", - [_IOC_NR(VIDIOC_S_AUDIO)] = "VIDIOC_S_AUDIO", - [_IOC_NR(VIDIOC_QUERYCTRL)] = "VIDIOC_QUERYCTRL", - [_IOC_NR(VIDIOC_QUERYMENU)] = "VIDIOC_QUERYMENU", - [_IOC_NR(VIDIOC_G_INPUT)] = "VIDIOC_G_INPUT", - [_IOC_NR(VIDIOC_S_INPUT)] = "VIDIOC_S_INPUT", - [_IOC_NR(VIDIOC_G_OUTPUT)] = "VIDIOC_G_OUTPUT", - [_IOC_NR(VIDIOC_S_OUTPUT)] = "VIDIOC_S_OUTPUT", - [_IOC_NR(VIDIOC_ENUMOUTPUT)] = "VIDIOC_ENUMOUTPUT", - [_IOC_NR(VIDIOC_G_AUDOUT)] = "VIDIOC_G_AUDOUT", - [_IOC_NR(VIDIOC_S_AUDOUT)] = "VIDIOC_S_AUDOUT", - [_IOC_NR(VIDIOC_G_MODULATOR)] = "VIDIOC_G_MODULATOR", - [_IOC_NR(VIDIOC_S_MODULATOR)] = "VIDIOC_S_MODULATOR", - [_IOC_NR(VIDIOC_G_FREQUENCY)] = "VIDIOC_G_FREQUENCY", - [_IOC_NR(VIDIOC_S_FREQUENCY)] = "VIDIOC_S_FREQUENCY", - [_IOC_NR(VIDIOC_CROPCAP)] = "VIDIOC_CROPCAP", - [_IOC_NR(VIDIOC_G_CROP)] = "VIDIOC_G_CROP", - [_IOC_NR(VIDIOC_S_CROP)] = "VIDIOC_S_CROP", - [_IOC_NR(VIDIOC_G_JPEGCOMP)] = "VIDIOC_G_JPEGCOMP", - [_IOC_NR(VIDIOC_S_JPEGCOMP)] = "VIDIOC_S_JPEGCOMP", - [_IOC_NR(VIDIOC_QUERYSTD)] = "VIDIOC_QUERYSTD", - [_IOC_NR(VIDIOC_TRY_FMT)] = "VIDIOC_TRY_FMT", - [_IOC_NR(VIDIOC_ENUMAUDIO)] = "VIDIOC_ENUMAUDIO", - [_IOC_NR(VIDIOC_ENUMAUDOUT)] = "VIDIOC_ENUMAUDOUT", - [_IOC_NR(VIDIOC_G_PRIORITY)] = "VIDIOC_G_PRIORITY", - [_IOC_NR(VIDIOC_S_PRIORITY)] = "VIDIOC_S_PRIORITY", - [_IOC_NR(VIDIOC_G_SLICED_VBI_CAP)] = "VIDIOC_G_SLICED_VBI_CAP", - [_IOC_NR(VIDIOC_LOG_STATUS)] = "VIDIOC_LOG_STATUS", - [_IOC_NR(VIDIOC_G_EXT_CTRLS)] = "VIDIOC_G_EXT_CTRLS", - [_IOC_NR(VIDIOC_S_EXT_CTRLS)] = "VIDIOC_S_EXT_CTRLS", - [_IOC_NR(VIDIOC_TRY_EXT_CTRLS)] = "VIDIOC_TRY_EXT_CTRLS", -#if 1 - [_IOC_NR(VIDIOC_ENUM_FRAMESIZES)] = "VIDIOC_ENUM_FRAMESIZES", - [_IOC_NR(VIDIOC_ENUM_FRAMEINTERVALS)] = "VIDIOC_ENUM_FRAMEINTERVALS", - [_IOC_NR(VIDIOC_G_ENC_INDEX)] = "VIDIOC_G_ENC_INDEX", - [_IOC_NR(VIDIOC_ENCODER_CMD)] = "VIDIOC_ENCODER_CMD", - [_IOC_NR(VIDIOC_TRY_ENCODER_CMD)] = "VIDIOC_TRY_ENCODER_CMD", - - [_IOC_NR(VIDIOC_DBG_S_REGISTER)] = "VIDIOC_DBG_S_REGISTER", - [_IOC_NR(VIDIOC_DBG_G_REGISTER)] = "VIDIOC_DBG_G_REGISTER", - - [_IOC_NR(VIDIOC_G_CHIP_IDENT)] = "VIDIOC_G_CHIP_IDENT", - [_IOC_NR(VIDIOC_S_HW_FREQ_SEEK)] = "VIDIOC_S_HW_FREQ_SEEK", -#endif -}; -#define V4L2_IOCTLS ARRAY_SIZE(v4l2_ioctls) - -static const char *v4l2_int_ioctls[] = { -#ifdef CONFIG_VIDEO_V4L1_COMPAT - [_IOC_NR(DECODER_GET_CAPABILITIES)] = "DECODER_GET_CAPABILITIES", - [_IOC_NR(DECODER_GET_STATUS)] = "DECODER_GET_STATUS", - [_IOC_NR(DECODER_SET_NORM)] = "DECODER_SET_NORM", - [_IOC_NR(DECODER_SET_INPUT)] = "DECODER_SET_INPUT", - [_IOC_NR(DECODER_SET_OUTPUT)] = "DECODER_SET_OUTPUT", - [_IOC_NR(DECODER_ENABLE_OUTPUT)] = "DECODER_ENABLE_OUTPUT", - [_IOC_NR(DECODER_SET_PICTURE)] = "DECODER_SET_PICTURE", - [_IOC_NR(DECODER_SET_GPIO)] = "DECODER_SET_GPIO", - [_IOC_NR(DECODER_INIT)] = "DECODER_INIT", - [_IOC_NR(DECODER_SET_VBI_BYPASS)] = "DECODER_SET_VBI_BYPASS", - [_IOC_NR(DECODER_DUMP)] = "DECODER_DUMP", -#endif - [_IOC_NR(AUDC_SET_RADIO)] = "AUDC_SET_RADIO", - - [_IOC_NR(TUNER_SET_TYPE_ADDR)] = "TUNER_SET_TYPE_ADDR", - [_IOC_NR(TUNER_SET_STANDBY)] = "TUNER_SET_STANDBY", - [_IOC_NR(TUNER_SET_CONFIG)] = "TUNER_SET_CONFIG", - - [_IOC_NR(VIDIOC_INT_S_TUNER_MODE)] = "VIDIOC_INT_S_TUNER_MODE", - [_IOC_NR(VIDIOC_INT_RESET)] = "VIDIOC_INT_RESET", - [_IOC_NR(VIDIOC_INT_AUDIO_CLOCK_FREQ)] = "VIDIOC_INT_AUDIO_CLOCK_FREQ", - [_IOC_NR(VIDIOC_INT_DECODE_VBI_LINE)] = "VIDIOC_INT_DECODE_VBI_LINE", - [_IOC_NR(VIDIOC_INT_S_VBI_DATA)] = "VIDIOC_INT_S_VBI_DATA", - [_IOC_NR(VIDIOC_INT_G_VBI_DATA)] = "VIDIOC_INT_G_VBI_DATA", - [_IOC_NR(VIDIOC_INT_I2S_CLOCK_FREQ)] = "VIDIOC_INT_I2S_CLOCK_FREQ", - [_IOC_NR(VIDIOC_INT_S_STANDBY)] = "VIDIOC_INT_S_STANDBY", - [_IOC_NR(VIDIOC_INT_S_AUDIO_ROUTING)] = "VIDIOC_INT_S_AUDIO_ROUTING", - [_IOC_NR(VIDIOC_INT_G_AUDIO_ROUTING)] = "VIDIOC_INT_G_AUDIO_ROUTING", - [_IOC_NR(VIDIOC_INT_S_VIDEO_ROUTING)] = "VIDIOC_INT_S_VIDEO_ROUTING", - [_IOC_NR(VIDIOC_INT_G_VIDEO_ROUTING)] = "VIDIOC_INT_G_VIDEO_ROUTING", - [_IOC_NR(VIDIOC_INT_S_CRYSTAL_FREQ)] = "VIDIOC_INT_S_CRYSTAL_FREQ", - [_IOC_NR(VIDIOC_INT_INIT)] = "VIDIOC_INT_INIT", - [_IOC_NR(VIDIOC_INT_G_STD_OUTPUT)] = "VIDIOC_INT_G_STD_OUTPUT", - [_IOC_NR(VIDIOC_INT_S_STD_OUTPUT)] = "VIDIOC_INT_S_STD_OUTPUT", -}; -#define V4L2_INT_IOCTLS ARRAY_SIZE(v4l2_int_ioctls) - -/* Common ioctl debug function. This function can be used by - external ioctl messages as well as internal V4L ioctl */ -void v4l_printk_ioctl(unsigned int cmd) -{ - char *dir, *type; - - switch (_IOC_TYPE(cmd)) { - case 'd': - if (_IOC_NR(cmd) >= V4L2_INT_IOCTLS) { - type = "v4l2_int"; - break; - } - printk("%s", v4l2_int_ioctls[_IOC_NR(cmd)]); - return; -#ifdef CONFIG_VIDEO_V4L1_COMPAT - case 'v': - if (_IOC_NR(cmd) >= V4L1_IOCTLS) { - type = "v4l1"; - break; - } - printk("%s", v4l1_ioctls[_IOC_NR(cmd)]); - return; -#endif - case 'V': - if (_IOC_NR(cmd) >= V4L2_IOCTLS) { - type = "v4l2"; - break; - } - printk("%s", v4l2_ioctls[_IOC_NR(cmd)]); - return; - default: - type = "unknown"; - } - - switch (_IOC_DIR(cmd)) { - case _IOC_NONE: dir = "--"; break; - case _IOC_READ: dir = "r-"; break; - case _IOC_WRITE: dir = "-w"; break; - case _IOC_READ | _IOC_WRITE: dir = "rw"; break; - default: dir = "*ERR*"; break; - } - printk("%s ioctl '%c', dir=%s, #%d (0x%08x)", - type, _IOC_TYPE(cmd), dir, _IOC_NR(cmd), cmd); -} -EXPORT_SYMBOL(v4l_printk_ioctl); - -/* - * helper function -- handles userspace copying for ioctl arguments - */ - -#ifdef __OLD_VIDIOC_ -static unsigned int -video_fix_command(unsigned int cmd) -{ - switch (cmd) { - case VIDIOC_OVERLAY_OLD: - cmd = VIDIOC_OVERLAY; - break; - case VIDIOC_S_PARM_OLD: - cmd = VIDIOC_S_PARM; - break; - case VIDIOC_S_CTRL_OLD: - cmd = VIDIOC_S_CTRL; - break; - case VIDIOC_G_AUDIO_OLD: - cmd = VIDIOC_G_AUDIO; - break; - case VIDIOC_G_AUDOUT_OLD: - cmd = VIDIOC_G_AUDOUT; - break; - case VIDIOC_CROPCAP_OLD: - cmd = VIDIOC_CROPCAP; - break; - } - return cmd; -} -#endif - -/* - * Obsolete usercopy function - Should be removed soon - */ -int -video_usercopy(struct inode *inode, struct file *file, - unsigned int cmd, unsigned long arg, - int (*func)(struct inode *inode, struct file *file, - unsigned int cmd, void *arg)) -{ - char sbuf[128]; - void *mbuf = NULL; - void *parg = NULL; - int err = -EINVAL; - int is_ext_ctrl; - size_t ctrls_size = 0; - void __user *user_ptr = NULL; - -#ifdef __OLD_VIDIOC_ - cmd = video_fix_command(cmd); -#endif - is_ext_ctrl = (cmd == VIDIOC_S_EXT_CTRLS || cmd == VIDIOC_G_EXT_CTRLS || - cmd == VIDIOC_TRY_EXT_CTRLS); - - /* Copy arguments into temp kernel buffer */ - switch (_IOC_DIR(cmd)) { - case _IOC_NONE: - parg = NULL; - break; - case _IOC_READ: - case _IOC_WRITE: - case (_IOC_WRITE | _IOC_READ): - if (_IOC_SIZE(cmd) <= sizeof(sbuf)) { - parg = sbuf; - } else { - /* too big to allocate from stack */ - mbuf = kmalloc(_IOC_SIZE(cmd), GFP_KERNEL); - if (NULL == mbuf) - return -ENOMEM; - parg = mbuf; - } - - err = -EFAULT; - if (_IOC_DIR(cmd) & _IOC_WRITE) - if (copy_from_user(parg, (void __user *)arg, _IOC_SIZE(cmd))) - goto out; - break; - } - if (is_ext_ctrl) { - struct v4l2_ext_controls *p = parg; - - /* In case of an error, tell the caller that it wasn't - a specific control that caused it. */ - p->error_idx = p->count; - user_ptr = (void __user *)p->controls; - if (p->count) { - ctrls_size = sizeof(struct v4l2_ext_control) * p->count; - /* Note: v4l2_ext_controls fits in sbuf[] so mbuf is still NULL. */ - mbuf = kmalloc(ctrls_size, GFP_KERNEL); - err = -ENOMEM; - if (NULL == mbuf) - goto out_ext_ctrl; - err = -EFAULT; - if (copy_from_user(mbuf, user_ptr, ctrls_size)) - goto out_ext_ctrl; - p->controls = mbuf; - } - } - - /* call driver */ - err = func(inode, file, cmd, parg); - if (err == -ENOIOCTLCMD) - err = -EINVAL; - if (is_ext_ctrl) { - struct v4l2_ext_controls *p = parg; - - p->controls = (void *)user_ptr; - if (p->count && err == 0 && copy_to_user(user_ptr, mbuf, ctrls_size)) - err = -EFAULT; - goto out_ext_ctrl; - } - if (err < 0) - goto out; - -out_ext_ctrl: - /* Copy results into user buffer */ - switch (_IOC_DIR(cmd)) { - case _IOC_READ: - case (_IOC_WRITE | _IOC_READ): - if (copy_to_user((void __user *)arg, parg, _IOC_SIZE(cmd))) - err = -EFAULT; - break; - } - -out: - kfree(mbuf); - return err; -} -EXPORT_SYMBOL(video_usercopy); - -static void dbgbuf(unsigned int cmd, struct video_device *vfd, - struct v4l2_buffer *p) -{ - struct v4l2_timecode *tc = &p->timecode; - - dbgarg(cmd, "%02ld:%02d:%02d.%08ld index=%d, type=%s, " - "bytesused=%d, flags=0x%08d, " - "field=%0d, sequence=%d, memory=%s, offset/userptr=0x%08lx, length=%d\n", - p->timestamp.tv_sec / 3600, - (int)(p->timestamp.tv_sec / 60) % 60, - (int)(p->timestamp.tv_sec % 60), - p->timestamp.tv_usec, - p->index, - prt_names(p->type, v4l2_type_names), - p->bytesused, p->flags, - p->field, p->sequence, - prt_names(p->memory, v4l2_memory_names), - p->m.userptr, p->length); - dbgarg2("timecode=%02d:%02d:%02d type=%d, " - "flags=0x%08d, frames=%d, userbits=0x%08x\n", - tc->hours, tc->minutes, tc->seconds, - tc->type, tc->flags, tc->frames, *(__u32 *)tc->userbits); -} - -static inline void dbgrect(struct video_device *vfd, char *s, - struct v4l2_rect *r) -{ - dbgarg2("%sRect start at %dx%d, size=%dx%d\n", s, r->left, r->top, - r->width, r->height); -}; - -static inline void v4l_print_pix_fmt(struct video_device *vfd, - struct v4l2_pix_format *fmt) -{ - dbgarg2("width=%d, height=%d, format=%c%c%c%c, field=%s, " - "bytesperline=%d sizeimage=%d, colorspace=%d\n", - fmt->width, fmt->height, - (fmt->pixelformat & 0xff), - (fmt->pixelformat >> 8) & 0xff, - (fmt->pixelformat >> 16) & 0xff, - (fmt->pixelformat >> 24) & 0xff, - prt_names(fmt->field, v4l2_field_names), - fmt->bytesperline, fmt->sizeimage, fmt->colorspace); -}; - -static inline void v4l_print_ext_ctrls(unsigned int cmd, - struct video_device *vfd, struct v4l2_ext_controls *c, int show_vals) -{ - __u32 i; - - if (!(vfd->debug & V4L2_DEBUG_IOCTL_ARG)) - return; - dbgarg(cmd, ""); - printk(KERN_CONT "class=0x%x", c->ctrl_class); - for (i = 0; i < c->count; i++) { - if (show_vals) - printk(KERN_CONT " id/val=0x%x/0x%x", - c->controls[i].id, c->controls[i].value); - else - printk(KERN_CONT " id=0x%x", c->controls[i].id); - } - printk(KERN_CONT "\n"); -}; - -static inline int check_ext_ctrls(struct v4l2_ext_controls *c, int allow_priv) -{ - __u32 i; - - /* zero the reserved fields */ - c->reserved[0] = c->reserved[1] = 0; - for (i = 0; i < c->count; i++) { - c->controls[i].reserved2[0] = 0; - c->controls[i].reserved2[1] = 0; - } - /* V4L2_CID_PRIVATE_BASE cannot be used as control class - when using extended controls. - Only when passed in through VIDIOC_G_CTRL and VIDIOC_S_CTRL - is it allowed for backwards compatibility. - */ - if (!allow_priv && c->ctrl_class == V4L2_CID_PRIVATE_BASE) - return 0; - /* Check that all controls are from the same control class. */ - for (i = 0; i < c->count; i++) { - if (V4L2_CTRL_ID2CLASS(c->controls[i].id) != c->ctrl_class) { - c->error_idx = i; - return 0; - } - } - return 1; -} - -static int check_fmt(const struct v4l2_ioctl_ops *ops, enum v4l2_buf_type type) -{ - if (ops == NULL) - return -EINVAL; - - switch (type) { - case V4L2_BUF_TYPE_VIDEO_CAPTURE: - if (ops->vidioc_try_fmt_vid_cap) - return 0; - break; - case V4L2_BUF_TYPE_VIDEO_OVERLAY: - if (ops->vidioc_try_fmt_vid_overlay) - return 0; - break; - case V4L2_BUF_TYPE_VIDEO_OUTPUT: - if (ops->vidioc_try_fmt_vid_out) - return 0; - break; - case V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY: - if (ops->vidioc_try_fmt_vid_out_overlay) - return 0; - break; - case V4L2_BUF_TYPE_VBI_CAPTURE: - if (ops->vidioc_try_fmt_vbi_cap) - return 0; - break; - case V4L2_BUF_TYPE_VBI_OUTPUT: - if (ops->vidioc_try_fmt_vbi_out) - return 0; - break; - case V4L2_BUF_TYPE_SLICED_VBI_CAPTURE: - if (ops->vidioc_try_fmt_sliced_vbi_cap) - return 0; - break; - case V4L2_BUF_TYPE_SLICED_VBI_OUTPUT: - if (ops->vidioc_try_fmt_sliced_vbi_out) - return 0; - break; - case V4L2_BUF_TYPE_PRIVATE: - if (ops->vidioc_try_fmt_type_private) - return 0; - break; - } - return -EINVAL; -} - -static int __video_do_ioctl(struct inode *inode, struct file *file, - unsigned int cmd, void *arg) -{ - struct video_device *vfd = video_devdata(file); - const struct v4l2_ioctl_ops *ops = vfd->ioctl_ops; - void *fh = file->private_data; - int ret = -EINVAL; - - if ((vfd->debug & V4L2_DEBUG_IOCTL) && - !(vfd->debug & V4L2_DEBUG_IOCTL_ARG)) { - v4l_print_ioctl(vfd->name, cmd); - printk(KERN_CONT "\n"); - } - - if (ops == NULL) { - printk(KERN_WARNING "videodev: \"%s\" has no ioctl_ops.\n", - vfd->name); - return -EINVAL; - } - -#ifdef CONFIG_VIDEO_V4L1_COMPAT - /*********************************************************** - Handles calls to the obsoleted V4L1 API - Due to the nature of VIDIOCGMBUF, each driver that supports - V4L1 should implement its own handler for this ioctl. - ***********************************************************/ - - /* --- streaming capture ------------------------------------- */ - if (cmd == VIDIOCGMBUF) { - struct video_mbuf *p = arg; - - memset(p, 0, sizeof(*p)); - - if (!ops->vidiocgmbuf) - return ret; - ret = ops->vidiocgmbuf(file, fh, p); - if (!ret) - dbgarg(cmd, "size=%d, frames=%d, offsets=0x%08lx\n", - p->size, p->frames, - (unsigned long)p->offsets); - return ret; - } - - /******************************************************** - All other V4L1 calls are handled by v4l1_compat module. - Those calls will be translated into V4L2 calls, and - __video_do_ioctl will be called again, with one or more - V4L2 ioctls. - ********************************************************/ - if (_IOC_TYPE(cmd) == 'v') - return v4l_compat_translate_ioctl(inode, file, cmd, arg, - __video_do_ioctl); -#endif - - switch (cmd) { - /* --- capabilities ------------------------------------------ */ - case VIDIOC_QUERYCAP: - { - struct v4l2_capability *cap = (struct v4l2_capability *)arg; - memset(cap, 0, sizeof(*cap)); - - if (!ops->vidioc_querycap) - break; - - ret = ops->vidioc_querycap(file, fh, cap); - if (!ret) - dbgarg(cmd, "driver=%s, card=%s, bus=%s, " - "version=0x%08x, " - "capabilities=0x%08x\n", - cap->driver, cap->card, cap->bus_info, - cap->version, - cap->capabilities); - break; - } - - /* --- priority ------------------------------------------ */ - case VIDIOC_G_PRIORITY: - { - enum v4l2_priority *p = arg; - - if (!ops->vidioc_g_priority) - break; - ret = ops->vidioc_g_priority(file, fh, p); - if (!ret) - dbgarg(cmd, "priority is %d\n", *p); - break; - } - case VIDIOC_S_PRIORITY: - { - enum v4l2_priority *p = arg; - - if (!ops->vidioc_s_priority) - break; - dbgarg(cmd, "setting priority to %d\n", *p); - ret = ops->vidioc_s_priority(file, fh, *p); - break; - } - - /* --- capture ioctls ---------------------------------------- */ - case VIDIOC_ENUM_FMT: - { - struct v4l2_fmtdesc *f = arg; - enum v4l2_buf_type type; - unsigned int index; - - index = f->index; - type = f->type; - memset(f, 0, sizeof(*f)); - f->index = index; - f->type = type; - - switch (type) { - case V4L2_BUF_TYPE_VIDEO_CAPTURE: - if (ops->vidioc_enum_fmt_vid_cap) - ret = ops->vidioc_enum_fmt_vid_cap(file, fh, f); - break; - case V4L2_BUF_TYPE_VIDEO_OVERLAY: - if (ops->vidioc_enum_fmt_vid_overlay) - ret = ops->vidioc_enum_fmt_vid_overlay(file, - fh, f); - break; -#if 1 - /* V4L2_BUF_TYPE_VBI_CAPTURE should not support VIDIOC_ENUM_FMT - * according to the spec. The bttv and saa7134 drivers support - * it though, so just warn that this is deprecated and will be - * removed in the near future. */ - case V4L2_BUF_TYPE_VBI_CAPTURE: - if (ops->vidioc_enum_fmt_vbi_cap) { - printk(KERN_WARNING "vidioc_enum_fmt_vbi_cap will be removed in 2.6.28!\n"); - ret = ops->vidioc_enum_fmt_vbi_cap(file, fh, f); - } - break; -#endif - case V4L2_BUF_TYPE_VIDEO_OUTPUT: - if (ops->vidioc_enum_fmt_vid_out) - ret = ops->vidioc_enum_fmt_vid_out(file, fh, f); - break; - case V4L2_BUF_TYPE_PRIVATE: - if (ops->vidioc_enum_fmt_type_private) - ret = ops->vidioc_enum_fmt_type_private(file, - fh, f); - break; - default: - break; - } - if (!ret) - dbgarg(cmd, "index=%d, type=%d, flags=%d, " - "pixelformat=%c%c%c%c, description='%s'\n", - f->index, f->type, f->flags, - (f->pixelformat & 0xff), - (f->pixelformat >> 8) & 0xff, - (f->pixelformat >> 16) & 0xff, - (f->pixelformat >> 24) & 0xff, - f->description); - break; - } - case VIDIOC_G_FMT: - { - struct v4l2_format *f = (struct v4l2_format *)arg; - - memset(f->fmt.raw_data, 0, sizeof(f->fmt.raw_data)); - - /* FIXME: Should be one dump per type */ - dbgarg(cmd, "type=%s\n", prt_names(f->type, v4l2_type_names)); - - switch (f->type) { - case V4L2_BUF_TYPE_VIDEO_CAPTURE: - if (ops->vidioc_g_fmt_vid_cap) - ret = ops->vidioc_g_fmt_vid_cap(file, fh, f); - if (!ret) - v4l_print_pix_fmt(vfd, &f->fmt.pix); - break; - case V4L2_BUF_TYPE_VIDEO_OVERLAY: - if (ops->vidioc_g_fmt_vid_overlay) - ret = ops->vidioc_g_fmt_vid_overlay(file, - fh, f); - break; - case V4L2_BUF_TYPE_VIDEO_OUTPUT: - if (ops->vidioc_g_fmt_vid_out) - ret = ops->vidioc_g_fmt_vid_out(file, fh, f); - if (!ret) - v4l_print_pix_fmt(vfd, &f->fmt.pix); - break; - case V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY: - if (ops->vidioc_g_fmt_vid_out_overlay) - ret = ops->vidioc_g_fmt_vid_out_overlay(file, - fh, f); - break; - case V4L2_BUF_TYPE_VBI_CAPTURE: - if (ops->vidioc_g_fmt_vbi_cap) - ret = ops->vidioc_g_fmt_vbi_cap(file, fh, f); - break; - case V4L2_BUF_TYPE_VBI_OUTPUT: - if (ops->vidioc_g_fmt_vbi_out) - ret = ops->vidioc_g_fmt_vbi_out(file, fh, f); - break; - case V4L2_BUF_TYPE_SLICED_VBI_CAPTURE: - if (ops->vidioc_g_fmt_sliced_vbi_cap) - ret = ops->vidioc_g_fmt_sliced_vbi_cap(file, - fh, f); - break; - case V4L2_BUF_TYPE_SLICED_VBI_OUTPUT: - if (ops->vidioc_g_fmt_sliced_vbi_out) - ret = ops->vidioc_g_fmt_sliced_vbi_out(file, - fh, f); - break; - case V4L2_BUF_TYPE_PRIVATE: - if (ops->vidioc_g_fmt_type_private) - ret = ops->vidioc_g_fmt_type_private(file, - fh, f); - break; - } - - break; - } - case VIDIOC_S_FMT: - { - struct v4l2_format *f = (struct v4l2_format *)arg; - - /* FIXME: Should be one dump per type */ - dbgarg(cmd, "type=%s\n", prt_names(f->type, v4l2_type_names)); - - switch (f->type) { - case V4L2_BUF_TYPE_VIDEO_CAPTURE: - v4l_print_pix_fmt(vfd, &f->fmt.pix); - if (ops->vidioc_s_fmt_vid_cap) - ret = ops->vidioc_s_fmt_vid_cap(file, fh, f); - break; - case V4L2_BUF_TYPE_VIDEO_OVERLAY: - if (ops->vidioc_s_fmt_vid_overlay) - ret = ops->vidioc_s_fmt_vid_overlay(file, - fh, f); - break; - case V4L2_BUF_TYPE_VIDEO_OUTPUT: - v4l_print_pix_fmt(vfd, &f->fmt.pix); - if (ops->vidioc_s_fmt_vid_out) - ret = ops->vidioc_s_fmt_vid_out(file, fh, f); - break; - case V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY: - if (ops->vidioc_s_fmt_vid_out_overlay) - ret = ops->vidioc_s_fmt_vid_out_overlay(file, - fh, f); - break; - case V4L2_BUF_TYPE_VBI_CAPTURE: - if (ops->vidioc_s_fmt_vbi_cap) - ret = ops->vidioc_s_fmt_vbi_cap(file, fh, f); - break; - case V4L2_BUF_TYPE_VBI_OUTPUT: - if (ops->vidioc_s_fmt_vbi_out) - ret = ops->vidioc_s_fmt_vbi_out(file, fh, f); - break; - case V4L2_BUF_TYPE_SLICED_VBI_CAPTURE: - if (ops->vidioc_s_fmt_sliced_vbi_cap) - ret = ops->vidioc_s_fmt_sliced_vbi_cap(file, - fh, f); - break; - case V4L2_BUF_TYPE_SLICED_VBI_OUTPUT: - if (ops->vidioc_s_fmt_sliced_vbi_out) - ret = ops->vidioc_s_fmt_sliced_vbi_out(file, - fh, f); - break; - case V4L2_BUF_TYPE_PRIVATE: - if (ops->vidioc_s_fmt_type_private) - ret = ops->vidioc_s_fmt_type_private(file, - fh, f); - break; - } - break; - } - case VIDIOC_TRY_FMT: - { - struct v4l2_format *f = (struct v4l2_format *)arg; - - /* FIXME: Should be one dump per type */ - dbgarg(cmd, "type=%s\n", prt_names(f->type, - v4l2_type_names)); - switch (f->type) { - case V4L2_BUF_TYPE_VIDEO_CAPTURE: - if (ops->vidioc_try_fmt_vid_cap) - ret = ops->vidioc_try_fmt_vid_cap(file, fh, f); - if (!ret) - v4l_print_pix_fmt(vfd, &f->fmt.pix); - break; - case V4L2_BUF_TYPE_VIDEO_OVERLAY: - if (ops->vidioc_try_fmt_vid_overlay) - ret = ops->vidioc_try_fmt_vid_overlay(file, - fh, f); - break; - case V4L2_BUF_TYPE_VIDEO_OUTPUT: - if (ops->vidioc_try_fmt_vid_out) - ret = ops->vidioc_try_fmt_vid_out(file, fh, f); - if (!ret) - v4l_print_pix_fmt(vfd, &f->fmt.pix); - break; - case V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY: - if (ops->vidioc_try_fmt_vid_out_overlay) - ret = ops->vidioc_try_fmt_vid_out_overlay(file, - fh, f); - break; - case V4L2_BUF_TYPE_VBI_CAPTURE: - if (ops->vidioc_try_fmt_vbi_cap) - ret = ops->vidioc_try_fmt_vbi_cap(file, fh, f); - break; - case V4L2_BUF_TYPE_VBI_OUTPUT: - if (ops->vidioc_try_fmt_vbi_out) - ret = ops->vidioc_try_fmt_vbi_out(file, fh, f); - break; - case V4L2_BUF_TYPE_SLICED_VBI_CAPTURE: - if (ops->vidioc_try_fmt_sliced_vbi_cap) - ret = ops->vidioc_try_fmt_sliced_vbi_cap(file, - fh, f); - break; - case V4L2_BUF_TYPE_SLICED_VBI_OUTPUT: - if (ops->vidioc_try_fmt_sliced_vbi_out) - ret = ops->vidioc_try_fmt_sliced_vbi_out(file, - fh, f); - break; - case V4L2_BUF_TYPE_PRIVATE: - if (ops->vidioc_try_fmt_type_private) - ret = ops->vidioc_try_fmt_type_private(file, - fh, f); - break; - } - - break; - } - /* FIXME: Those buf reqs could be handled here, - with some changes on videobuf to allow its header to be included at - videodev2.h or being merged at videodev2. - */ - case VIDIOC_REQBUFS: - { - struct v4l2_requestbuffers *p = arg; - - if (!ops->vidioc_reqbufs) - break; - ret = check_fmt(ops, p->type); - if (ret) - break; - - ret = ops->vidioc_reqbufs(file, fh, p); - dbgarg(cmd, "count=%d, type=%s, memory=%s\n", - p->count, - prt_names(p->type, v4l2_type_names), - prt_names(p->memory, v4l2_memory_names)); - break; - } - case VIDIOC_QUERYBUF: - { - struct v4l2_buffer *p = arg; - - if (!ops->vidioc_querybuf) - break; - ret = check_fmt(ops, p->type); - if (ret) - break; - - ret = ops->vidioc_querybuf(file, fh, p); - if (!ret) - dbgbuf(cmd, vfd, p); - break; - } - case VIDIOC_QBUF: - { - struct v4l2_buffer *p = arg; - - if (!ops->vidioc_qbuf) - break; - ret = check_fmt(ops, p->type); - if (ret) - break; - - ret = ops->vidioc_qbuf(file, fh, p); - if (!ret) - dbgbuf(cmd, vfd, p); - break; - } - case VIDIOC_DQBUF: - { - struct v4l2_buffer *p = arg; - - if (!ops->vidioc_dqbuf) - break; - ret = check_fmt(ops, p->type); - if (ret) - break; - - ret = ops->vidioc_dqbuf(file, fh, p); - if (!ret) - dbgbuf(cmd, vfd, p); - break; - } - case VIDIOC_OVERLAY: - { - int *i = arg; - - if (!ops->vidioc_overlay) - break; - dbgarg(cmd, "value=%d\n", *i); - ret = ops->vidioc_overlay(file, fh, *i); - break; - } - case VIDIOC_G_FBUF: - { - struct v4l2_framebuffer *p = arg; - - if (!ops->vidioc_g_fbuf) - break; - ret = ops->vidioc_g_fbuf(file, fh, arg); - if (!ret) { - dbgarg(cmd, "capability=0x%x, flags=%d, base=0x%08lx\n", - p->capability, p->flags, - (unsigned long)p->base); - v4l_print_pix_fmt(vfd, &p->fmt); - } - break; - } - case VIDIOC_S_FBUF: - { - struct v4l2_framebuffer *p = arg; - - if (!ops->vidioc_s_fbuf) - break; - dbgarg(cmd, "capability=0x%x, flags=%d, base=0x%08lx\n", - p->capability, p->flags, (unsigned long)p->base); - v4l_print_pix_fmt(vfd, &p->fmt); - ret = ops->vidioc_s_fbuf(file, fh, arg); - break; - } - case VIDIOC_STREAMON: - { - enum v4l2_buf_type i = *(int *)arg; - - if (!ops->vidioc_streamon) - break; - dbgarg(cmd, "type=%s\n", prt_names(i, v4l2_type_names)); - ret = ops->vidioc_streamon(file, fh, i); - break; - } - case VIDIOC_STREAMOFF: - { - enum v4l2_buf_type i = *(int *)arg; - - if (!ops->vidioc_streamoff) - break; - dbgarg(cmd, "type=%s\n", prt_names(i, v4l2_type_names)); - ret = ops->vidioc_streamoff(file, fh, i); - break; - } - /* ---------- tv norms ---------- */ - case VIDIOC_ENUMSTD: - { - struct v4l2_standard *p = arg; - v4l2_std_id id = vfd->tvnorms, curr_id = 0; - unsigned int index = p->index, i, j = 0; - const char *descr = ""; - - /* Return norm array in a canonical way */ - for (i = 0; i <= index && id; i++) { - /* last std value in the standards array is 0, so this - while always ends there since (id & 0) == 0. */ - while ((id & standards[j].std) != standards[j].std) - j++; - curr_id = standards[j].std; - descr = standards[j].descr; - j++; - if (curr_id == 0) - break; - if (curr_id != V4L2_STD_PAL && - curr_id != V4L2_STD_SECAM && - curr_id != V4L2_STD_NTSC) - id &= ~curr_id; - } - if (i <= index) - return -EINVAL; - - v4l2_video_std_construct(p, curr_id, descr); - p->index = index; - - dbgarg(cmd, "index=%d, id=0x%Lx, name=%s, fps=%d/%d, " - "framelines=%d\n", p->index, - (unsigned long long)p->id, p->name, - p->frameperiod.numerator, - p->frameperiod.denominator, - p->framelines); - - ret = 0; - break; - } - case VIDIOC_G_STD: - { - v4l2_std_id *id = arg; - - ret = 0; - /* Calls the specific handler */ - if (ops->vidioc_g_std) - ret = ops->vidioc_g_std(file, fh, id); - else - *id = vfd->current_norm; - - if (!ret) - dbgarg(cmd, "std=0x%08Lx\n", (long long unsigned)*id); - break; - } - case VIDIOC_S_STD: - { - v4l2_std_id *id = arg, norm; - - dbgarg(cmd, "std=%08Lx\n", (long long unsigned)*id); - - norm = (*id) & vfd->tvnorms; - if (vfd->tvnorms && !norm) /* Check if std is supported */ - break; - - /* Calls the specific handler */ - if (ops->vidioc_s_std) - ret = ops->vidioc_s_std(file, fh, &norm); - else - ret = -EINVAL; - - /* Updates standard information */ - if (ret >= 0) - vfd->current_norm = norm; - break; - } - case VIDIOC_QUERYSTD: - { - v4l2_std_id *p = arg; - - if (!ops->vidioc_querystd) - break; - ret = ops->vidioc_querystd(file, fh, arg); - if (!ret) - dbgarg(cmd, "detected std=%08Lx\n", - (unsigned long long)*p); - break; - } - /* ------ input switching ---------- */ - /* FIXME: Inputs can be handled inside videodev2 */ - case VIDIOC_ENUMINPUT: - { - struct v4l2_input *p = arg; - int i = p->index; - - if (!ops->vidioc_enum_input) - break; - memset(p, 0, sizeof(*p)); - p->index = i; - - ret = ops->vidioc_enum_input(file, fh, p); - if (!ret) - dbgarg(cmd, "index=%d, name=%s, type=%d, " - "audioset=%d, " - "tuner=%d, std=%08Lx, status=%d\n", - p->index, p->name, p->type, p->audioset, - p->tuner, - (unsigned long long)p->std, - p->status); - break; - } - case VIDIOC_G_INPUT: - { - unsigned int *i = arg; - - if (!ops->vidioc_g_input) - break; - ret = ops->vidioc_g_input(file, fh, i); - if (!ret) - dbgarg(cmd, "value=%d\n", *i); - break; - } - case VIDIOC_S_INPUT: - { - unsigned int *i = arg; - - if (!ops->vidioc_s_input) - break; - dbgarg(cmd, "value=%d\n", *i); - ret = ops->vidioc_s_input(file, fh, *i); - break; - } - - /* ------ output switching ---------- */ - case VIDIOC_ENUMOUTPUT: - { - struct v4l2_output *p = arg; - int i = p->index; - - if (!ops->vidioc_enum_output) - break; - memset(p, 0, sizeof(*p)); - p->index = i; - - ret = ops->vidioc_enum_output(file, fh, p); - if (!ret) - dbgarg(cmd, "index=%d, name=%s, type=%d, " - "audioset=0x%x, " - "modulator=%d, std=0x%08Lx\n", - p->index, p->name, p->type, p->audioset, - p->modulator, (unsigned long long)p->std); - break; - } - case VIDIOC_G_OUTPUT: - { - unsigned int *i = arg; - - if (!ops->vidioc_g_output) - break; - ret = ops->vidioc_g_output(file, fh, i); - if (!ret) - dbgarg(cmd, "value=%d\n", *i); - break; - } - case VIDIOC_S_OUTPUT: - { - unsigned int *i = arg; - - if (!ops->vidioc_s_output) - break; - dbgarg(cmd, "value=%d\n", *i); - ret = ops->vidioc_s_output(file, fh, *i); - break; - } - - /* --- controls ---------------------------------------------- */ - case VIDIOC_QUERYCTRL: - { - struct v4l2_queryctrl *p = arg; - - if (!ops->vidioc_queryctrl) - break; - ret = ops->vidioc_queryctrl(file, fh, p); - if (!ret) - dbgarg(cmd, "id=0x%x, type=%d, name=%s, min/max=%d/%d, " - "step=%d, default=%d, flags=0x%08x\n", - p->id, p->type, p->name, - p->minimum, p->maximum, - p->step, p->default_value, p->flags); - else - dbgarg(cmd, "id=0x%x\n", p->id); - break; - } - case VIDIOC_G_CTRL: - { - struct v4l2_control *p = arg; - - if (ops->vidioc_g_ctrl) - ret = ops->vidioc_g_ctrl(file, fh, p); - else if (ops->vidioc_g_ext_ctrls) { - struct v4l2_ext_controls ctrls; - struct v4l2_ext_control ctrl; - - ctrls.ctrl_class = V4L2_CTRL_ID2CLASS(p->id); - ctrls.count = 1; - ctrls.controls = &ctrl; - ctrl.id = p->id; - ctrl.value = p->value; - if (check_ext_ctrls(&ctrls, 1)) { - ret = ops->vidioc_g_ext_ctrls(file, fh, &ctrls); - if (ret == 0) - p->value = ctrl.value; - } - } else - break; - if (!ret) - dbgarg(cmd, "id=0x%x, value=%d\n", p->id, p->value); - else - dbgarg(cmd, "id=0x%x\n", p->id); - break; - } - case VIDIOC_S_CTRL: - { - struct v4l2_control *p = arg; - struct v4l2_ext_controls ctrls; - struct v4l2_ext_control ctrl; - - if (!ops->vidioc_s_ctrl && !ops->vidioc_s_ext_ctrls) - break; - - dbgarg(cmd, "id=0x%x, value=%d\n", p->id, p->value); - - if (ops->vidioc_s_ctrl) { - ret = ops->vidioc_s_ctrl(file, fh, p); - break; - } - if (!ops->vidioc_s_ext_ctrls) - break; - - ctrls.ctrl_class = V4L2_CTRL_ID2CLASS(p->id); - ctrls.count = 1; - ctrls.controls = &ctrl; - ctrl.id = p->id; - ctrl.value = p->value; - if (check_ext_ctrls(&ctrls, 1)) - ret = ops->vidioc_s_ext_ctrls(file, fh, &ctrls); - break; - } - case VIDIOC_G_EXT_CTRLS: - { - struct v4l2_ext_controls *p = arg; - - p->error_idx = p->count; - if (!ops->vidioc_g_ext_ctrls) - break; - if (check_ext_ctrls(p, 0)) - ret = ops->vidioc_g_ext_ctrls(file, fh, p); - v4l_print_ext_ctrls(cmd, vfd, p, !ret); - break; - } - case VIDIOC_S_EXT_CTRLS: - { - struct v4l2_ext_controls *p = arg; - - p->error_idx = p->count; - if (!ops->vidioc_s_ext_ctrls) - break; - v4l_print_ext_ctrls(cmd, vfd, p, 1); - if (check_ext_ctrls(p, 0)) - ret = ops->vidioc_s_ext_ctrls(file, fh, p); - break; - } - case VIDIOC_TRY_EXT_CTRLS: - { - struct v4l2_ext_controls *p = arg; - - p->error_idx = p->count; - if (!ops->vidioc_try_ext_ctrls) - break; - v4l_print_ext_ctrls(cmd, vfd, p, 1); - if (check_ext_ctrls(p, 0)) - ret = ops->vidioc_try_ext_ctrls(file, fh, p); - break; - } - case VIDIOC_QUERYMENU: - { - struct v4l2_querymenu *p = arg; - - if (!ops->vidioc_querymenu) - break; - ret = ops->vidioc_querymenu(file, fh, p); - if (!ret) - dbgarg(cmd, "id=0x%x, index=%d, name=%s\n", - p->id, p->index, p->name); - else - dbgarg(cmd, "id=0x%x, index=%d\n", - p->id, p->index); - break; - } - /* --- audio ---------------------------------------------- */ - case VIDIOC_ENUMAUDIO: - { - struct v4l2_audio *p = arg; - - if (!ops->vidioc_enumaudio) - break; - ret = ops->vidioc_enumaudio(file, fh, p); - if (!ret) - dbgarg(cmd, "index=%d, name=%s, capability=0x%x, " - "mode=0x%x\n", p->index, p->name, - p->capability, p->mode); - else - dbgarg(cmd, "index=%d\n", p->index); - break; - } - case VIDIOC_G_AUDIO: - { - struct v4l2_audio *p = arg; - __u32 index = p->index; - - if (!ops->vidioc_g_audio) - break; - - memset(p, 0, sizeof(*p)); - p->index = index; - ret = ops->vidioc_g_audio(file, fh, p); - if (!ret) - dbgarg(cmd, "index=%d, name=%s, capability=0x%x, " - "mode=0x%x\n", p->index, - p->name, p->capability, p->mode); - else - dbgarg(cmd, "index=%d\n", p->index); - break; - } - case VIDIOC_S_AUDIO: - { - struct v4l2_audio *p = arg; - - if (!ops->vidioc_s_audio) - break; - dbgarg(cmd, "index=%d, name=%s, capability=0x%x, " - "mode=0x%x\n", p->index, p->name, - p->capability, p->mode); - ret = ops->vidioc_s_audio(file, fh, p); - break; - } - case VIDIOC_ENUMAUDOUT: - { - struct v4l2_audioout *p = arg; - - if (!ops->vidioc_enumaudout) - break; - dbgarg(cmd, "Enum for index=%d\n", p->index); - ret = ops->vidioc_enumaudout(file, fh, p); - if (!ret) - dbgarg2("index=%d, name=%s, capability=%d, " - "mode=%d\n", p->index, p->name, - p->capability, p->mode); - break; - } - case VIDIOC_G_AUDOUT: - { - struct v4l2_audioout *p = arg; - - if (!ops->vidioc_g_audout) - break; - dbgarg(cmd, "Enum for index=%d\n", p->index); - ret = ops->vidioc_g_audout(file, fh, p); - if (!ret) - dbgarg2("index=%d, name=%s, capability=%d, " - "mode=%d\n", p->index, p->name, - p->capability, p->mode); - break; - } - case VIDIOC_S_AUDOUT: - { - struct v4l2_audioout *p = arg; - - if (!ops->vidioc_s_audout) - break; - dbgarg(cmd, "index=%d, name=%s, capability=%d, " - "mode=%d\n", p->index, p->name, - p->capability, p->mode); - - ret = ops->vidioc_s_audout(file, fh, p); - break; - } - case VIDIOC_G_MODULATOR: - { - struct v4l2_modulator *p = arg; - - if (!ops->vidioc_g_modulator) - break; - ret = ops->vidioc_g_modulator(file, fh, p); - if (!ret) - dbgarg(cmd, "index=%d, name=%s, " - "capability=%d, rangelow=%d," - " rangehigh=%d, txsubchans=%d\n", - p->index, p->name, p->capability, - p->rangelow, p->rangehigh, - p->txsubchans); - break; - } - case VIDIOC_S_MODULATOR: - { - struct v4l2_modulator *p = arg; - - if (!ops->vidioc_s_modulator) - break; - dbgarg(cmd, "index=%d, name=%s, capability=%d, " - "rangelow=%d, rangehigh=%d, txsubchans=%d\n", - p->index, p->name, p->capability, p->rangelow, - p->rangehigh, p->txsubchans); - ret = ops->vidioc_s_modulator(file, fh, p); - break; - } - case VIDIOC_G_CROP: - { - struct v4l2_crop *p = arg; - - if (!ops->vidioc_g_crop) - break; - dbgarg(cmd, "type=%s\n", prt_names(p->type, v4l2_type_names)); - ret = ops->vidioc_g_crop(file, fh, p); - if (!ret) - dbgrect(vfd, "", &p->c); - break; - } - case VIDIOC_S_CROP: - { - struct v4l2_crop *p = arg; - - if (!ops->vidioc_s_crop) - break; - dbgarg(cmd, "type=%s\n", prt_names(p->type, v4l2_type_names)); - dbgrect(vfd, "", &p->c); - ret = ops->vidioc_s_crop(file, fh, p); - break; - } - case VIDIOC_CROPCAP: - { - struct v4l2_cropcap *p = arg; - - /*FIXME: Should also show v4l2_fract pixelaspect */ - if (!ops->vidioc_cropcap) - break; - dbgarg(cmd, "type=%s\n", prt_names(p->type, v4l2_type_names)); - ret = ops->vidioc_cropcap(file, fh, p); - if (!ret) { - dbgrect(vfd, "bounds ", &p->bounds); - dbgrect(vfd, "defrect ", &p->defrect); - } - break; - } - case VIDIOC_G_JPEGCOMP: - { - struct v4l2_jpegcompression *p = arg; - - if (!ops->vidioc_g_jpegcomp) - break; - ret = ops->vidioc_g_jpegcomp(file, fh, p); - if (!ret) - dbgarg(cmd, "quality=%d, APPn=%d, " - "APP_len=%d, COM_len=%d, " - "jpeg_markers=%d\n", - p->quality, p->APPn, p->APP_len, - p->COM_len, p->jpeg_markers); - break; - } - case VIDIOC_S_JPEGCOMP: - { - struct v4l2_jpegcompression *p = arg; - - if (!ops->vidioc_g_jpegcomp) - break; - dbgarg(cmd, "quality=%d, APPn=%d, APP_len=%d, " - "COM_len=%d, jpeg_markers=%d\n", - p->quality, p->APPn, p->APP_len, - p->COM_len, p->jpeg_markers); - ret = ops->vidioc_s_jpegcomp(file, fh, p); - break; - } - case VIDIOC_G_ENC_INDEX: - { - struct v4l2_enc_idx *p = arg; - - if (!ops->vidioc_g_enc_index) - break; - ret = ops->vidioc_g_enc_index(file, fh, p); - if (!ret) - dbgarg(cmd, "entries=%d, entries_cap=%d\n", - p->entries, p->entries_cap); - break; - } - case VIDIOC_ENCODER_CMD: - { - struct v4l2_encoder_cmd *p = arg; - - if (!ops->vidioc_encoder_cmd) - break; - memset(&p->raw, 0, sizeof(p->raw)); - ret = ops->vidioc_encoder_cmd(file, fh, p); - if (!ret) - dbgarg(cmd, "cmd=%d, flags=%x\n", p->cmd, p->flags); - break; - } - case VIDIOC_TRY_ENCODER_CMD: - { - struct v4l2_encoder_cmd *p = arg; - - if (!ops->vidioc_try_encoder_cmd) - break; - memset(&p->raw, 0, sizeof(p->raw)); - ret = ops->vidioc_try_encoder_cmd(file, fh, p); - if (!ret) - dbgarg(cmd, "cmd=%d, flags=%x\n", p->cmd, p->flags); - break; - } - case VIDIOC_G_PARM: - { - struct v4l2_streamparm *p = arg; - __u32 type = p->type; - - memset(p, 0, sizeof(*p)); - p->type = type; - - if (ops->vidioc_g_parm) { - ret = ops->vidioc_g_parm(file, fh, p); - } else { - struct v4l2_standard s; - - if (p->type != V4L2_BUF_TYPE_VIDEO_CAPTURE) - return -EINVAL; - - v4l2_video_std_construct(&s, vfd->current_norm, - v4l2_norm_to_name(vfd->current_norm)); - - p->parm.capture.timeperframe = s.frameperiod; - ret = 0; - } - - dbgarg(cmd, "type=%d\n", p->type); - break; - } - case VIDIOC_S_PARM: - { - struct v4l2_streamparm *p = arg; - - if (!ops->vidioc_s_parm) - break; - dbgarg(cmd, "type=%d\n", p->type); - ret = ops->vidioc_s_parm(file, fh, p); - break; - } - case VIDIOC_G_TUNER: - { - struct v4l2_tuner *p = arg; - __u32 index = p->index; - - if (!ops->vidioc_g_tuner) - break; - - memset(p, 0, sizeof(*p)); - p->index = index; - - ret = ops->vidioc_g_tuner(file, fh, p); - if (!ret) - dbgarg(cmd, "index=%d, name=%s, type=%d, " - "capability=0x%x, rangelow=%d, " - "rangehigh=%d, signal=%d, afc=%d, " - "rxsubchans=0x%x, audmode=%d\n", - p->index, p->name, p->type, - p->capability, p->rangelow, - p->rangehigh, p->signal, p->afc, - p->rxsubchans, p->audmode); - break; - } - case VIDIOC_S_TUNER: - { - struct v4l2_tuner *p = arg; - - if (!ops->vidioc_s_tuner) - break; - dbgarg(cmd, "index=%d, name=%s, type=%d, " - "capability=0x%x, rangelow=%d, " - "rangehigh=%d, signal=%d, afc=%d, " - "rxsubchans=0x%x, audmode=%d\n", - p->index, p->name, p->type, - p->capability, p->rangelow, - p->rangehigh, p->signal, p->afc, - p->rxsubchans, p->audmode); - ret = ops->vidioc_s_tuner(file, fh, p); - break; - } - case VIDIOC_G_FREQUENCY: - { - struct v4l2_frequency *p = arg; - - if (!ops->vidioc_g_frequency) - break; - - memset(p->reserved, 0, sizeof(p->reserved)); - - ret = ops->vidioc_g_frequency(file, fh, p); - if (!ret) - dbgarg(cmd, "tuner=%d, type=%d, frequency=%d\n", - p->tuner, p->type, p->frequency); - break; - } - case VIDIOC_S_FREQUENCY: - { - struct v4l2_frequency *p = arg; - - if (!ops->vidioc_s_frequency) - break; - dbgarg(cmd, "tuner=%d, type=%d, frequency=%d\n", - p->tuner, p->type, p->frequency); - ret = ops->vidioc_s_frequency(file, fh, p); - break; - } - case VIDIOC_G_SLICED_VBI_CAP: - { - struct v4l2_sliced_vbi_cap *p = arg; - __u32 type = p->type; - - if (!ops->vidioc_g_sliced_vbi_cap) - break; - memset(p, 0, sizeof(*p)); - p->type = type; - dbgarg(cmd, "type=%s\n", prt_names(p->type, v4l2_type_names)); - ret = ops->vidioc_g_sliced_vbi_cap(file, fh, p); - if (!ret) - dbgarg2("service_set=%d\n", p->service_set); - break; - } - case VIDIOC_LOG_STATUS: - { - if (!ops->vidioc_log_status) - break; - ret = ops->vidioc_log_status(file, fh); - break; - } -#ifdef CONFIG_VIDEO_ADV_DEBUG - case VIDIOC_DBG_G_REGISTER: - { - struct v4l2_register *p = arg; - - if (!capable(CAP_SYS_ADMIN)) - ret = -EPERM; - else if (ops->vidioc_g_register) - ret = ops->vidioc_g_register(file, fh, p); - break; - } - case VIDIOC_DBG_S_REGISTER: - { - struct v4l2_register *p = arg; - - if (!capable(CAP_SYS_ADMIN)) - ret = -EPERM; - else if (ops->vidioc_s_register) - ret = ops->vidioc_s_register(file, fh, p); - break; - } -#endif - case VIDIOC_G_CHIP_IDENT: - { - struct v4l2_chip_ident *p = arg; - - if (!ops->vidioc_g_chip_ident) - break; - ret = ops->vidioc_g_chip_ident(file, fh, p); - if (!ret) - dbgarg(cmd, "chip_ident=%u, revision=0x%x\n", p->ident, p->revision); - break; - } - case VIDIOC_S_HW_FREQ_SEEK: - { - struct v4l2_hw_freq_seek *p = arg; - - if (!ops->vidioc_s_hw_freq_seek) - break; - dbgarg(cmd, - "tuner=%d, type=%d, seek_upward=%d, wrap_around=%d\n", - p->tuner, p->type, p->seek_upward, p->wrap_around); - ret = ops->vidioc_s_hw_freq_seek(file, fh, p); - break; - } - default: - { - if (!ops->vidioc_default) - break; - ret = ops->vidioc_default(file, fh, cmd, arg); - break; - } - } /* switch */ - - if (vfd->debug & V4L2_DEBUG_IOCTL_ARG) { - if (ret < 0) { - v4l_print_ioctl(vfd->name, cmd); - printk(KERN_CONT " error %d\n", ret); - } - } - - return ret; -} - -int video_ioctl2(struct inode *inode, struct file *file, - unsigned int cmd, unsigned long arg) -{ - char sbuf[128]; - void *mbuf = NULL; - void *parg = NULL; - int err = -EINVAL; - int is_ext_ctrl; - size_t ctrls_size = 0; - void __user *user_ptr = NULL; - -#ifdef __OLD_VIDIOC_ - cmd = video_fix_command(cmd); -#endif - is_ext_ctrl = (cmd == VIDIOC_S_EXT_CTRLS || cmd == VIDIOC_G_EXT_CTRLS || - cmd == VIDIOC_TRY_EXT_CTRLS); - - /* Copy arguments into temp kernel buffer */ - switch (_IOC_DIR(cmd)) { - case _IOC_NONE: - parg = NULL; - break; - case _IOC_READ: - case _IOC_WRITE: - case (_IOC_WRITE | _IOC_READ): - if (_IOC_SIZE(cmd) <= sizeof(sbuf)) { - parg = sbuf; - } else { - /* too big to allocate from stack */ - mbuf = kmalloc(_IOC_SIZE(cmd), GFP_KERNEL); - if (NULL == mbuf) - return -ENOMEM; - parg = mbuf; - } - - err = -EFAULT; - if (_IOC_DIR(cmd) & _IOC_WRITE) - if (copy_from_user(parg, (void __user *)arg, _IOC_SIZE(cmd))) - goto out; - break; - } - - if (is_ext_ctrl) { - struct v4l2_ext_controls *p = parg; - - /* In case of an error, tell the caller that it wasn't - a specific control that caused it. */ - p->error_idx = p->count; - user_ptr = (void __user *)p->controls; - if (p->count) { - ctrls_size = sizeof(struct v4l2_ext_control) * p->count; - /* Note: v4l2_ext_controls fits in sbuf[] so mbuf is still NULL. */ - mbuf = kmalloc(ctrls_size, GFP_KERNEL); - err = -ENOMEM; - if (NULL == mbuf) - goto out_ext_ctrl; - err = -EFAULT; - if (copy_from_user(mbuf, user_ptr, ctrls_size)) - goto out_ext_ctrl; - p->controls = mbuf; - } - } - - /* Handles IOCTL */ - err = __video_do_ioctl(inode, file, cmd, parg); - if (err == -ENOIOCTLCMD) - err = -EINVAL; - if (is_ext_ctrl) { - struct v4l2_ext_controls *p = parg; - - p->controls = (void *)user_ptr; - if (p->count && err == 0 && copy_to_user(user_ptr, mbuf, ctrls_size)) - err = -EFAULT; - goto out_ext_ctrl; - } - if (err < 0) - goto out; - -out_ext_ctrl: - /* Copy results into user buffer */ - switch (_IOC_DIR(cmd)) { - case _IOC_READ: - case (_IOC_WRITE | _IOC_READ): - if (copy_to_user((void __user *)arg, parg, _IOC_SIZE(cmd))) - err = -EFAULT; - break; - } - -out: - kfree(mbuf); - return err; -} -EXPORT_SYMBOL(video_ioctl2); diff --git a/trunk/drivers/media/video/videobuf-dma-contig.c b/trunk/drivers/media/video/videobuf-dma-contig.c index 31944b11e6ea..03f20acb668c 100644 --- a/trunk/drivers/media/video/videobuf-dma-contig.c +++ b/trunk/drivers/media/video/videobuf-dma-contig.c @@ -28,10 +28,10 @@ struct videobuf_dma_contig_memory { }; #define MAGIC_DC_MEM 0x0733ac61 -#define MAGIC_CHECK(is, should) \ - if (unlikely((is) != (should))) { \ - pr_err("magic mismatch: %x expected %x\n", (is), (should)); \ - BUG(); \ +#define MAGIC_CHECK(is, should) \ + if (unlikely((is) != (should))) { \ + pr_err("magic mismatch: %x expected %x\n", is, should); \ + BUG(); \ } static void diff --git a/trunk/drivers/media/video/videobuf-vmalloc.c b/trunk/drivers/media/video/videobuf-vmalloc.c index be65a2fb3976..a868b7ed75ff 100644 --- a/trunk/drivers/media/video/videobuf-vmalloc.c +++ b/trunk/drivers/media/video/videobuf-vmalloc.c @@ -203,7 +203,7 @@ static int __videobuf_iolock (struct videobuf_queue* q, return 0; /* FIXME: to properly support USERPTR, remap should occur. - The code below won't work, since mem->vma = NULL + The code bellow won't work, since mem->vma = NULL */ /* Try to remap memory */ rc = remap_vmalloc_range(mem->vma, (void *)vb->baddr, 0); diff --git a/trunk/drivers/media/video/videodev.c b/trunk/drivers/media/video/videodev.c index e69de29bb2d1..6616e6570557 100644 --- a/trunk/drivers/media/video/videodev.c +++ b/trunk/drivers/media/video/videodev.c @@ -0,0 +1,2262 @@ +/* + * Video capture interface for Linux version 2 + * + * A generic video device interface for the LINUX operating system + * using a set of device structures/vectors for low level operations. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version + * 2 of the License, or (at your option) any later version. + * + * Authors: Alan Cox, (version 1) + * Mauro Carvalho Chehab (version 2) + * + * Fixes: 20000516 Claudio Matsuoka + * - Added procfs support + */ + +#define dbgarg(cmd, fmt, arg...) \ + do { \ + if (vfd->debug & V4L2_DEBUG_IOCTL_ARG) { \ + printk(KERN_DEBUG "%s: ", vfd->name); \ + v4l_printk_ioctl(cmd); \ + printk(" " fmt, ## arg); \ + } \ + } while (0) + +#define dbgarg2(fmt, arg...) \ + do { \ + if (vfd->debug & V4L2_DEBUG_IOCTL_ARG) \ + printk(KERN_DEBUG "%s: " fmt, vfd->name, ## arg);\ + } while (0) + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define __OLD_VIDIOC_ /* To allow fixing old calls*/ +#include + +#ifdef CONFIG_VIDEO_V4L1 +#include +#endif +#include +#include + +#define VIDEO_NUM_DEVICES 256 +#define VIDEO_NAME "video4linux" + +struct std_descr { + v4l2_std_id std; + const char *descr; +}; + +static const struct std_descr standards[] = { + { V4L2_STD_NTSC, "NTSC" }, + { V4L2_STD_NTSC_M, "NTSC-M" }, + { V4L2_STD_NTSC_M_JP, "NTSC-M-JP" }, + { V4L2_STD_NTSC_M_KR, "NTSC-M-KR" }, + { V4L2_STD_NTSC_443, "NTSC-443" }, + { V4L2_STD_PAL, "PAL" }, + { V4L2_STD_PAL_BG, "PAL-BG" }, + { V4L2_STD_PAL_B, "PAL-B" }, + { V4L2_STD_PAL_B1, "PAL-B1" }, + { V4L2_STD_PAL_G, "PAL-G" }, + { V4L2_STD_PAL_H, "PAL-H" }, + { V4L2_STD_PAL_I, "PAL-I" }, + { V4L2_STD_PAL_DK, "PAL-DK" }, + { V4L2_STD_PAL_D, "PAL-D" }, + { V4L2_STD_PAL_D1, "PAL-D1" }, + { V4L2_STD_PAL_K, "PAL-K" }, + { V4L2_STD_PAL_M, "PAL-M" }, + { V4L2_STD_PAL_N, "PAL-N" }, + { V4L2_STD_PAL_Nc, "PAL-Nc" }, + { V4L2_STD_PAL_60, "PAL-60" }, + { V4L2_STD_SECAM, "SECAM" }, + { V4L2_STD_SECAM_B, "SECAM-B" }, + { V4L2_STD_SECAM_G, "SECAM-G" }, + { V4L2_STD_SECAM_H, "SECAM-H" }, + { V4L2_STD_SECAM_DK, "SECAM-DK" }, + { V4L2_STD_SECAM_D, "SECAM-D" }, + { V4L2_STD_SECAM_K, "SECAM-K" }, + { V4L2_STD_SECAM_K1, "SECAM-K1" }, + { V4L2_STD_SECAM_L, "SECAM-L" }, + { V4L2_STD_SECAM_LC, "SECAM-Lc" }, + { 0, "Unknown" } +}; + +/* video4linux standard ID conversion to standard name + */ +const char *v4l2_norm_to_name(v4l2_std_id id) +{ + u32 myid = id; + int i; + + /* HACK: ppc32 architecture doesn't have __ucmpdi2 function to handle + 64 bit comparations. So, on that architecture, with some gcc + variants, compilation fails. Currently, the max value is 30bit wide. + */ + BUG_ON(myid != id); + + for (i = 0; standards[i].std; i++) + if (myid == standards[i].std) + break; + return standards[i].descr; +} +EXPORT_SYMBOL(v4l2_norm_to_name); + +/* Fill in the fields of a v4l2_standard structure according to the + 'id' and 'transmission' parameters. Returns negative on error. */ +int v4l2_video_std_construct(struct v4l2_standard *vs, + int id, const char *name) +{ + u32 index = vs->index; + + memset(vs, 0, sizeof(struct v4l2_standard)); + vs->index = index; + vs->id = id; + if (id & V4L2_STD_525_60) { + vs->frameperiod.numerator = 1001; + vs->frameperiod.denominator = 30000; + vs->framelines = 525; + } else { + vs->frameperiod.numerator = 1; + vs->frameperiod.denominator = 25; + vs->framelines = 625; + } + strlcpy(vs->name, name, sizeof(vs->name)); + return 0; +} +EXPORT_SYMBOL(v4l2_video_std_construct); + +/* ----------------------------------------------------------------- */ +/* some arrays for pretty-printing debug messages of enum types */ + +const char *v4l2_field_names[] = { + [V4L2_FIELD_ANY] = "any", + [V4L2_FIELD_NONE] = "none", + [V4L2_FIELD_TOP] = "top", + [V4L2_FIELD_BOTTOM] = "bottom", + [V4L2_FIELD_INTERLACED] = "interlaced", + [V4L2_FIELD_SEQ_TB] = "seq-tb", + [V4L2_FIELD_SEQ_BT] = "seq-bt", + [V4L2_FIELD_ALTERNATE] = "alternate", + [V4L2_FIELD_INTERLACED_TB] = "interlaced-tb", + [V4L2_FIELD_INTERLACED_BT] = "interlaced-bt", +}; +EXPORT_SYMBOL(v4l2_field_names); + +const char *v4l2_type_names[] = { + [V4L2_BUF_TYPE_VIDEO_CAPTURE] = "vid-cap", + [V4L2_BUF_TYPE_VIDEO_OVERLAY] = "vid-overlay", + [V4L2_BUF_TYPE_VIDEO_OUTPUT] = "vid-out", + [V4L2_BUF_TYPE_VBI_CAPTURE] = "vbi-cap", + [V4L2_BUF_TYPE_VBI_OUTPUT] = "vbi-out", + [V4L2_BUF_TYPE_SLICED_VBI_CAPTURE] = "sliced-vbi-cap", + [V4L2_BUF_TYPE_SLICED_VBI_OUTPUT] = "sliced-vbi-out", + [V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY] = "vid-out-overlay", +}; +EXPORT_SYMBOL(v4l2_type_names); + +static const char *v4l2_memory_names[] = { + [V4L2_MEMORY_MMAP] = "mmap", + [V4L2_MEMORY_USERPTR] = "userptr", + [V4L2_MEMORY_OVERLAY] = "overlay", +}; + +#define prt_names(a, arr) ((((a) >= 0) && ((a) < ARRAY_SIZE(arr))) ? \ + arr[a] : "unknown") + +/* ------------------------------------------------------------------ */ +/* debug help functions */ + +#ifdef CONFIG_VIDEO_V4L1_COMPAT +static const char *v4l1_ioctls[] = { + [_IOC_NR(VIDIOCGCAP)] = "VIDIOCGCAP", + [_IOC_NR(VIDIOCGCHAN)] = "VIDIOCGCHAN", + [_IOC_NR(VIDIOCSCHAN)] = "VIDIOCSCHAN", + [_IOC_NR(VIDIOCGTUNER)] = "VIDIOCGTUNER", + [_IOC_NR(VIDIOCSTUNER)] = "VIDIOCSTUNER", + [_IOC_NR(VIDIOCGPICT)] = "VIDIOCGPICT", + [_IOC_NR(VIDIOCSPICT)] = "VIDIOCSPICT", + [_IOC_NR(VIDIOCCAPTURE)] = "VIDIOCCAPTURE", + [_IOC_NR(VIDIOCGWIN)] = "VIDIOCGWIN", + [_IOC_NR(VIDIOCSWIN)] = "VIDIOCSWIN", + [_IOC_NR(VIDIOCGFBUF)] = "VIDIOCGFBUF", + [_IOC_NR(VIDIOCSFBUF)] = "VIDIOCSFBUF", + [_IOC_NR(VIDIOCKEY)] = "VIDIOCKEY", + [_IOC_NR(VIDIOCGFREQ)] = "VIDIOCGFREQ", + [_IOC_NR(VIDIOCSFREQ)] = "VIDIOCSFREQ", + [_IOC_NR(VIDIOCGAUDIO)] = "VIDIOCGAUDIO", + [_IOC_NR(VIDIOCSAUDIO)] = "VIDIOCSAUDIO", + [_IOC_NR(VIDIOCSYNC)] = "VIDIOCSYNC", + [_IOC_NR(VIDIOCMCAPTURE)] = "VIDIOCMCAPTURE", + [_IOC_NR(VIDIOCGMBUF)] = "VIDIOCGMBUF", + [_IOC_NR(VIDIOCGUNIT)] = "VIDIOCGUNIT", + [_IOC_NR(VIDIOCGCAPTURE)] = "VIDIOCGCAPTURE", + [_IOC_NR(VIDIOCSCAPTURE)] = "VIDIOCSCAPTURE", + [_IOC_NR(VIDIOCSPLAYMODE)] = "VIDIOCSPLAYMODE", + [_IOC_NR(VIDIOCSWRITEMODE)] = "VIDIOCSWRITEMODE", + [_IOC_NR(VIDIOCGPLAYINFO)] = "VIDIOCGPLAYINFO", + [_IOC_NR(VIDIOCSMICROCODE)] = "VIDIOCSMICROCODE", + [_IOC_NR(VIDIOCGVBIFMT)] = "VIDIOCGVBIFMT", + [_IOC_NR(VIDIOCSVBIFMT)] = "VIDIOCSVBIFMT" +}; +#define V4L1_IOCTLS ARRAY_SIZE(v4l1_ioctls) +#endif + +static const char *v4l2_ioctls[] = { + [_IOC_NR(VIDIOC_QUERYCAP)] = "VIDIOC_QUERYCAP", + [_IOC_NR(VIDIOC_RESERVED)] = "VIDIOC_RESERVED", + [_IOC_NR(VIDIOC_ENUM_FMT)] = "VIDIOC_ENUM_FMT", + [_IOC_NR(VIDIOC_G_FMT)] = "VIDIOC_G_FMT", + [_IOC_NR(VIDIOC_S_FMT)] = "VIDIOC_S_FMT", + [_IOC_NR(VIDIOC_REQBUFS)] = "VIDIOC_REQBUFS", + [_IOC_NR(VIDIOC_QUERYBUF)] = "VIDIOC_QUERYBUF", + [_IOC_NR(VIDIOC_G_FBUF)] = "VIDIOC_G_FBUF", + [_IOC_NR(VIDIOC_S_FBUF)] = "VIDIOC_S_FBUF", + [_IOC_NR(VIDIOC_OVERLAY)] = "VIDIOC_OVERLAY", + [_IOC_NR(VIDIOC_QBUF)] = "VIDIOC_QBUF", + [_IOC_NR(VIDIOC_DQBUF)] = "VIDIOC_DQBUF", + [_IOC_NR(VIDIOC_STREAMON)] = "VIDIOC_STREAMON", + [_IOC_NR(VIDIOC_STREAMOFF)] = "VIDIOC_STREAMOFF", + [_IOC_NR(VIDIOC_G_PARM)] = "VIDIOC_G_PARM", + [_IOC_NR(VIDIOC_S_PARM)] = "VIDIOC_S_PARM", + [_IOC_NR(VIDIOC_G_STD)] = "VIDIOC_G_STD", + [_IOC_NR(VIDIOC_S_STD)] = "VIDIOC_S_STD", + [_IOC_NR(VIDIOC_ENUMSTD)] = "VIDIOC_ENUMSTD", + [_IOC_NR(VIDIOC_ENUMINPUT)] = "VIDIOC_ENUMINPUT", + [_IOC_NR(VIDIOC_G_CTRL)] = "VIDIOC_G_CTRL", + [_IOC_NR(VIDIOC_S_CTRL)] = "VIDIOC_S_CTRL", + [_IOC_NR(VIDIOC_G_TUNER)] = "VIDIOC_G_TUNER", + [_IOC_NR(VIDIOC_S_TUNER)] = "VIDIOC_S_TUNER", + [_IOC_NR(VIDIOC_G_AUDIO)] = "VIDIOC_G_AUDIO", + [_IOC_NR(VIDIOC_S_AUDIO)] = "VIDIOC_S_AUDIO", + [_IOC_NR(VIDIOC_QUERYCTRL)] = "VIDIOC_QUERYCTRL", + [_IOC_NR(VIDIOC_QUERYMENU)] = "VIDIOC_QUERYMENU", + [_IOC_NR(VIDIOC_G_INPUT)] = "VIDIOC_G_INPUT", + [_IOC_NR(VIDIOC_S_INPUT)] = "VIDIOC_S_INPUT", + [_IOC_NR(VIDIOC_G_OUTPUT)] = "VIDIOC_G_OUTPUT", + [_IOC_NR(VIDIOC_S_OUTPUT)] = "VIDIOC_S_OUTPUT", + [_IOC_NR(VIDIOC_ENUMOUTPUT)] = "VIDIOC_ENUMOUTPUT", + [_IOC_NR(VIDIOC_G_AUDOUT)] = "VIDIOC_G_AUDOUT", + [_IOC_NR(VIDIOC_S_AUDOUT)] = "VIDIOC_S_AUDOUT", + [_IOC_NR(VIDIOC_G_MODULATOR)] = "VIDIOC_G_MODULATOR", + [_IOC_NR(VIDIOC_S_MODULATOR)] = "VIDIOC_S_MODULATOR", + [_IOC_NR(VIDIOC_G_FREQUENCY)] = "VIDIOC_G_FREQUENCY", + [_IOC_NR(VIDIOC_S_FREQUENCY)] = "VIDIOC_S_FREQUENCY", + [_IOC_NR(VIDIOC_CROPCAP)] = "VIDIOC_CROPCAP", + [_IOC_NR(VIDIOC_G_CROP)] = "VIDIOC_G_CROP", + [_IOC_NR(VIDIOC_S_CROP)] = "VIDIOC_S_CROP", + [_IOC_NR(VIDIOC_G_JPEGCOMP)] = "VIDIOC_G_JPEGCOMP", + [_IOC_NR(VIDIOC_S_JPEGCOMP)] = "VIDIOC_S_JPEGCOMP", + [_IOC_NR(VIDIOC_QUERYSTD)] = "VIDIOC_QUERYSTD", + [_IOC_NR(VIDIOC_TRY_FMT)] = "VIDIOC_TRY_FMT", + [_IOC_NR(VIDIOC_ENUMAUDIO)] = "VIDIOC_ENUMAUDIO", + [_IOC_NR(VIDIOC_ENUMAUDOUT)] = "VIDIOC_ENUMAUDOUT", + [_IOC_NR(VIDIOC_G_PRIORITY)] = "VIDIOC_G_PRIORITY", + [_IOC_NR(VIDIOC_S_PRIORITY)] = "VIDIOC_S_PRIORITY", + [_IOC_NR(VIDIOC_G_SLICED_VBI_CAP)] = "VIDIOC_G_SLICED_VBI_CAP", + [_IOC_NR(VIDIOC_LOG_STATUS)] = "VIDIOC_LOG_STATUS", + [_IOC_NR(VIDIOC_G_EXT_CTRLS)] = "VIDIOC_G_EXT_CTRLS", + [_IOC_NR(VIDIOC_S_EXT_CTRLS)] = "VIDIOC_S_EXT_CTRLS", + [_IOC_NR(VIDIOC_TRY_EXT_CTRLS)] = "VIDIOC_TRY_EXT_CTRLS", +#if 1 + [_IOC_NR(VIDIOC_ENUM_FRAMESIZES)] = "VIDIOC_ENUM_FRAMESIZES", + [_IOC_NR(VIDIOC_ENUM_FRAMEINTERVALS)] = "VIDIOC_ENUM_FRAMEINTERVALS", + [_IOC_NR(VIDIOC_G_ENC_INDEX)] = "VIDIOC_G_ENC_INDEX", + [_IOC_NR(VIDIOC_ENCODER_CMD)] = "VIDIOC_ENCODER_CMD", + [_IOC_NR(VIDIOC_TRY_ENCODER_CMD)] = "VIDIOC_TRY_ENCODER_CMD", + + [_IOC_NR(VIDIOC_DBG_S_REGISTER)] = "VIDIOC_DBG_S_REGISTER", + [_IOC_NR(VIDIOC_DBG_G_REGISTER)] = "VIDIOC_DBG_G_REGISTER", + + [_IOC_NR(VIDIOC_G_CHIP_IDENT)] = "VIDIOC_G_CHIP_IDENT", + [_IOC_NR(VIDIOC_S_HW_FREQ_SEEK)] = "VIDIOC_S_HW_FREQ_SEEK", +#endif +}; +#define V4L2_IOCTLS ARRAY_SIZE(v4l2_ioctls) + +static const char *v4l2_int_ioctls[] = { +#ifdef CONFIG_VIDEO_V4L1_COMPAT + [_IOC_NR(DECODER_GET_CAPABILITIES)] = "DECODER_GET_CAPABILITIES", + [_IOC_NR(DECODER_GET_STATUS)] = "DECODER_GET_STATUS", + [_IOC_NR(DECODER_SET_NORM)] = "DECODER_SET_NORM", + [_IOC_NR(DECODER_SET_INPUT)] = "DECODER_SET_INPUT", + [_IOC_NR(DECODER_SET_OUTPUT)] = "DECODER_SET_OUTPUT", + [_IOC_NR(DECODER_ENABLE_OUTPUT)] = "DECODER_ENABLE_OUTPUT", + [_IOC_NR(DECODER_SET_PICTURE)] = "DECODER_SET_PICTURE", + [_IOC_NR(DECODER_SET_GPIO)] = "DECODER_SET_GPIO", + [_IOC_NR(DECODER_INIT)] = "DECODER_INIT", + [_IOC_NR(DECODER_SET_VBI_BYPASS)] = "DECODER_SET_VBI_BYPASS", + [_IOC_NR(DECODER_DUMP)] = "DECODER_DUMP", +#endif + [_IOC_NR(AUDC_SET_RADIO)] = "AUDC_SET_RADIO", + + [_IOC_NR(TUNER_SET_TYPE_ADDR)] = "TUNER_SET_TYPE_ADDR", + [_IOC_NR(TUNER_SET_STANDBY)] = "TUNER_SET_STANDBY", + [_IOC_NR(TUNER_SET_CONFIG)] = "TUNER_SET_CONFIG", + + [_IOC_NR(VIDIOC_INT_S_TUNER_MODE)] = "VIDIOC_INT_S_TUNER_MODE", + [_IOC_NR(VIDIOC_INT_RESET)] = "VIDIOC_INT_RESET", + [_IOC_NR(VIDIOC_INT_AUDIO_CLOCK_FREQ)] = "VIDIOC_INT_AUDIO_CLOCK_FREQ", + [_IOC_NR(VIDIOC_INT_DECODE_VBI_LINE)] = "VIDIOC_INT_DECODE_VBI_LINE", + [_IOC_NR(VIDIOC_INT_S_VBI_DATA)] = "VIDIOC_INT_S_VBI_DATA", + [_IOC_NR(VIDIOC_INT_G_VBI_DATA)] = "VIDIOC_INT_G_VBI_DATA", + [_IOC_NR(VIDIOC_INT_I2S_CLOCK_FREQ)] = "VIDIOC_INT_I2S_CLOCK_FREQ", + [_IOC_NR(VIDIOC_INT_S_STANDBY)] = "VIDIOC_INT_S_STANDBY", + [_IOC_NR(VIDIOC_INT_S_AUDIO_ROUTING)] = "VIDIOC_INT_S_AUDIO_ROUTING", + [_IOC_NR(VIDIOC_INT_G_AUDIO_ROUTING)] = "VIDIOC_INT_G_AUDIO_ROUTING", + [_IOC_NR(VIDIOC_INT_S_VIDEO_ROUTING)] = "VIDIOC_INT_S_VIDEO_ROUTING", + [_IOC_NR(VIDIOC_INT_G_VIDEO_ROUTING)] = "VIDIOC_INT_G_VIDEO_ROUTING", + [_IOC_NR(VIDIOC_INT_S_CRYSTAL_FREQ)] = "VIDIOC_INT_S_CRYSTAL_FREQ", + [_IOC_NR(VIDIOC_INT_INIT)] = "VIDIOC_INT_INIT", + [_IOC_NR(VIDIOC_INT_G_STD_OUTPUT)] = "VIDIOC_INT_G_STD_OUTPUT", + [_IOC_NR(VIDIOC_INT_S_STD_OUTPUT)] = "VIDIOC_INT_S_STD_OUTPUT", +}; +#define V4L2_INT_IOCTLS ARRAY_SIZE(v4l2_int_ioctls) + +/* Common ioctl debug function. This function can be used by + external ioctl messages as well as internal V4L ioctl */ +void v4l_printk_ioctl(unsigned int cmd) +{ + char *dir, *type; + + switch (_IOC_TYPE(cmd)) { + case 'd': + if (_IOC_NR(cmd) >= V4L2_INT_IOCTLS) { + type = "v4l2_int"; + break; + } + printk("%s", v4l2_int_ioctls[_IOC_NR(cmd)]); + return; +#ifdef CONFIG_VIDEO_V4L1_COMPAT + case 'v': + if (_IOC_NR(cmd) >= V4L1_IOCTLS) { + type = "v4l1"; + break; + } + printk("%s", v4l1_ioctls[_IOC_NR(cmd)]); + return; +#endif + case 'V': + if (_IOC_NR(cmd) >= V4L2_IOCTLS) { + type = "v4l2"; + break; + } + printk("%s", v4l2_ioctls[_IOC_NR(cmd)]); + return; + default: + type = "unknown"; + } + + switch (_IOC_DIR(cmd)) { + case _IOC_NONE: dir = "--"; break; + case _IOC_READ: dir = "r-"; break; + case _IOC_WRITE: dir = "-w"; break; + case _IOC_READ | _IOC_WRITE: dir = "rw"; break; + default: dir = "*ERR*"; break; + } + printk("%s ioctl '%c', dir=%s, #%d (0x%08x)", + type, _IOC_TYPE(cmd), dir, _IOC_NR(cmd), cmd); +} +EXPORT_SYMBOL(v4l_printk_ioctl); + +/* + * sysfs stuff + */ + +static ssize_t show_index(struct device *cd, + struct device_attribute *attr, char *buf) +{ + struct video_device *vfd = container_of(cd, struct video_device, + class_dev); + return sprintf(buf, "%i\n", vfd->index); +} + +static ssize_t show_name(struct device *cd, + struct device_attribute *attr, char *buf) +{ + struct video_device *vfd = container_of(cd, struct video_device, + class_dev); + return sprintf(buf, "%.*s\n", (int)sizeof(vfd->name), vfd->name); +} + +static struct device_attribute video_device_attrs[] = { + __ATTR(name, S_IRUGO, show_name, NULL), + __ATTR(index, S_IRUGO, show_index, NULL), + __ATTR_NULL +}; + +struct video_device *video_device_alloc(void) +{ + struct video_device *vfd; + + vfd = kzalloc(sizeof(*vfd),GFP_KERNEL); + return vfd; +} +EXPORT_SYMBOL(video_device_alloc); + +void video_device_release(struct video_device *vfd) +{ + kfree(vfd); +} +EXPORT_SYMBOL(video_device_release); + +static void video_release(struct device *cd) +{ + struct video_device *vfd = container_of(cd, struct video_device, + class_dev); + +#if 1 + /* needed until all drivers are fixed */ + if (!vfd->release) + return; +#endif + vfd->release(vfd); +} + +static struct class video_class = { + .name = VIDEO_NAME, + .dev_attrs = video_device_attrs, + .dev_release = video_release, +}; + +/* + * Active devices + */ + +static struct video_device *video_device[VIDEO_NUM_DEVICES]; +static DEFINE_MUTEX(videodev_lock); + +struct video_device* video_devdata(struct file *file) +{ + return video_device[iminor(file->f_path.dentry->d_inode)]; +} +EXPORT_SYMBOL(video_devdata); + +/* + * Open a video device - FIXME: Obsoleted + */ +static int video_open(struct inode *inode, struct file *file) +{ + unsigned int minor = iminor(inode); + int err = 0; + struct video_device *vfl; + const struct file_operations *old_fops; + + if(minor>=VIDEO_NUM_DEVICES) + return -ENODEV; + lock_kernel(); + mutex_lock(&videodev_lock); + vfl=video_device[minor]; + if(vfl==NULL) { + mutex_unlock(&videodev_lock); + request_module("char-major-%d-%d", VIDEO_MAJOR, minor); + mutex_lock(&videodev_lock); + vfl=video_device[minor]; + if (vfl==NULL) { + mutex_unlock(&videodev_lock); + unlock_kernel(); + return -ENODEV; + } + } + old_fops = file->f_op; + file->f_op = fops_get(vfl->fops); + if(file->f_op->open) + err = file->f_op->open(inode,file); + if (err) { + fops_put(file->f_op); + file->f_op = fops_get(old_fops); + } + fops_put(old_fops); + mutex_unlock(&videodev_lock); + unlock_kernel(); + return err; +} + +/* + * helper function -- handles userspace copying for ioctl arguments + */ + +#ifdef __OLD_VIDIOC_ +static unsigned int +video_fix_command(unsigned int cmd) +{ + switch (cmd) { + case VIDIOC_OVERLAY_OLD: + cmd = VIDIOC_OVERLAY; + break; + case VIDIOC_S_PARM_OLD: + cmd = VIDIOC_S_PARM; + break; + case VIDIOC_S_CTRL_OLD: + cmd = VIDIOC_S_CTRL; + break; + case VIDIOC_G_AUDIO_OLD: + cmd = VIDIOC_G_AUDIO; + break; + case VIDIOC_G_AUDOUT_OLD: + cmd = VIDIOC_G_AUDOUT; + break; + case VIDIOC_CROPCAP_OLD: + cmd = VIDIOC_CROPCAP; + break; + } + return cmd; +} +#endif + +/* + * Obsolete usercopy function - Should be removed soon + */ +int +video_usercopy(struct inode *inode, struct file *file, + unsigned int cmd, unsigned long arg, + int (*func)(struct inode *inode, struct file *file, + unsigned int cmd, void *arg)) +{ + char sbuf[128]; + void *mbuf = NULL; + void *parg = NULL; + int err = -EINVAL; + int is_ext_ctrl; + size_t ctrls_size = 0; + void __user *user_ptr = NULL; + +#ifdef __OLD_VIDIOC_ + cmd = video_fix_command(cmd); +#endif + is_ext_ctrl = (cmd == VIDIOC_S_EXT_CTRLS || cmd == VIDIOC_G_EXT_CTRLS || + cmd == VIDIOC_TRY_EXT_CTRLS); + + /* Copy arguments into temp kernel buffer */ + switch (_IOC_DIR(cmd)) { + case _IOC_NONE: + parg = NULL; + break; + case _IOC_READ: + case _IOC_WRITE: + case (_IOC_WRITE | _IOC_READ): + if (_IOC_SIZE(cmd) <= sizeof(sbuf)) { + parg = sbuf; + } else { + /* too big to allocate from stack */ + mbuf = kmalloc(_IOC_SIZE(cmd),GFP_KERNEL); + if (NULL == mbuf) + return -ENOMEM; + parg = mbuf; + } + + err = -EFAULT; + if (_IOC_DIR(cmd) & _IOC_WRITE) + if (copy_from_user(parg, (void __user *)arg, _IOC_SIZE(cmd))) + goto out; + break; + } + if (is_ext_ctrl) { + struct v4l2_ext_controls *p = parg; + + /* In case of an error, tell the caller that it wasn't + a specific control that caused it. */ + p->error_idx = p->count; + user_ptr = (void __user *)p->controls; + if (p->count) { + ctrls_size = sizeof(struct v4l2_ext_control) * p->count; + /* Note: v4l2_ext_controls fits in sbuf[] so mbuf is still NULL. */ + mbuf = kmalloc(ctrls_size, GFP_KERNEL); + err = -ENOMEM; + if (NULL == mbuf) + goto out_ext_ctrl; + err = -EFAULT; + if (copy_from_user(mbuf, user_ptr, ctrls_size)) + goto out_ext_ctrl; + p->controls = mbuf; + } + } + + /* call driver */ + err = func(inode, file, cmd, parg); + if (err == -ENOIOCTLCMD) + err = -EINVAL; + if (is_ext_ctrl) { + struct v4l2_ext_controls *p = parg; + + p->controls = (void *)user_ptr; + if (p->count && err == 0 && copy_to_user(user_ptr, mbuf, ctrls_size)) + err = -EFAULT; + goto out_ext_ctrl; + } + if (err < 0) + goto out; + +out_ext_ctrl: + /* Copy results into user buffer */ + switch (_IOC_DIR(cmd)) + { + case _IOC_READ: + case (_IOC_WRITE | _IOC_READ): + if (copy_to_user((void __user *)arg, parg, _IOC_SIZE(cmd))) + err = -EFAULT; + break; + } + +out: + kfree(mbuf); + return err; +} +EXPORT_SYMBOL(video_usercopy); + +/* + * open/release helper functions -- handle exclusive opens + * Should be removed soon + */ +int video_exclusive_open(struct inode *inode, struct file *file) +{ + struct video_device *vfl = video_devdata(file); + int retval = 0; + + mutex_lock(&vfl->lock); + if (vfl->users) { + retval = -EBUSY; + } else { + vfl->users++; + } + mutex_unlock(&vfl->lock); + return retval; +} +EXPORT_SYMBOL(video_exclusive_open); + +int video_exclusive_release(struct inode *inode, struct file *file) +{ + struct video_device *vfl = video_devdata(file); + + vfl->users--; + return 0; +} +EXPORT_SYMBOL(video_exclusive_release); + +static void dbgbuf(unsigned int cmd, struct video_device *vfd, + struct v4l2_buffer *p) +{ + struct v4l2_timecode *tc=&p->timecode; + + dbgarg (cmd, "%02ld:%02d:%02d.%08ld index=%d, type=%s, " + "bytesused=%d, flags=0x%08d, " + "field=%0d, sequence=%d, memory=%s, offset/userptr=0x%08lx, length=%d\n", + (p->timestamp.tv_sec/3600), + (int)(p->timestamp.tv_sec/60)%60, + (int)(p->timestamp.tv_sec%60), + p->timestamp.tv_usec, + p->index, + prt_names(p->type, v4l2_type_names), + p->bytesused, p->flags, + p->field, p->sequence, + prt_names(p->memory, v4l2_memory_names), + p->m.userptr, p->length); + dbgarg2("timecode=%02d:%02d:%02d type=%d, " + "flags=0x%08d, frames=%d, userbits=0x%08x\n", + tc->hours,tc->minutes,tc->seconds, + tc->type, tc->flags, tc->frames, *(__u32 *) tc->userbits); +} + +static inline void dbgrect(struct video_device *vfd, char *s, + struct v4l2_rect *r) +{ + dbgarg2("%sRect start at %dx%d, size=%dx%d\n", s, r->left, r->top, + r->width, r->height); +}; + +static inline void v4l_print_pix_fmt (struct video_device *vfd, + struct v4l2_pix_format *fmt) +{ + dbgarg2 ("width=%d, height=%d, format=%c%c%c%c, field=%s, " + "bytesperline=%d sizeimage=%d, colorspace=%d\n", + fmt->width,fmt->height, + (fmt->pixelformat & 0xff), + (fmt->pixelformat >> 8) & 0xff, + (fmt->pixelformat >> 16) & 0xff, + (fmt->pixelformat >> 24) & 0xff, + prt_names(fmt->field, v4l2_field_names), + fmt->bytesperline, fmt->sizeimage, fmt->colorspace); +}; + +static inline void v4l_print_ext_ctrls(unsigned int cmd, + struct video_device *vfd, struct v4l2_ext_controls *c, int show_vals) +{ + __u32 i; + + if (!(vfd->debug & V4L2_DEBUG_IOCTL_ARG)) + return; + dbgarg(cmd, ""); + printk(KERN_CONT "class=0x%x", c->ctrl_class); + for (i = 0; i < c->count; i++) { + if (show_vals) + printk(KERN_CONT " id/val=0x%x/0x%x", + c->controls[i].id, c->controls[i].value); + else + printk(KERN_CONT " id=0x%x", c->controls[i].id); + } + printk(KERN_CONT "\n"); +}; + +static inline int check_ext_ctrls(struct v4l2_ext_controls *c, int allow_priv) +{ + __u32 i; + + /* zero the reserved fields */ + c->reserved[0] = c->reserved[1] = 0; + for (i = 0; i < c->count; i++) { + c->controls[i].reserved2[0] = 0; + c->controls[i].reserved2[1] = 0; + } + /* V4L2_CID_PRIVATE_BASE cannot be used as control class + when using extended controls. + Only when passed in through VIDIOC_G_CTRL and VIDIOC_S_CTRL + is it allowed for backwards compatibility. + */ + if (!allow_priv && c->ctrl_class == V4L2_CID_PRIVATE_BASE) + return 0; + /* Check that all controls are from the same control class. */ + for (i = 0; i < c->count; i++) { + if (V4L2_CTRL_ID2CLASS(c->controls[i].id) != c->ctrl_class) { + c->error_idx = i; + return 0; + } + } + return 1; +} + +static int check_fmt (struct video_device *vfd, enum v4l2_buf_type type) +{ + switch (type) { + case V4L2_BUF_TYPE_VIDEO_CAPTURE: + if (vfd->vidioc_try_fmt_vid_cap) + return (0); + break; + case V4L2_BUF_TYPE_VIDEO_OVERLAY: + if (vfd->vidioc_try_fmt_vid_overlay) + return (0); + break; + case V4L2_BUF_TYPE_VIDEO_OUTPUT: + if (vfd->vidioc_try_fmt_vid_out) + return (0); + break; + case V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY: + if (vfd->vidioc_try_fmt_vid_out_overlay) + return (0); + break; + case V4L2_BUF_TYPE_VBI_CAPTURE: + if (vfd->vidioc_try_fmt_vbi_cap) + return (0); + break; + case V4L2_BUF_TYPE_VBI_OUTPUT: + if (vfd->vidioc_try_fmt_vbi_out) + return (0); + break; + case V4L2_BUF_TYPE_SLICED_VBI_CAPTURE: + if (vfd->vidioc_try_fmt_sliced_vbi_cap) + return (0); + break; + case V4L2_BUF_TYPE_SLICED_VBI_OUTPUT: + if (vfd->vidioc_try_fmt_sliced_vbi_out) + return (0); + break; + case V4L2_BUF_TYPE_PRIVATE: + if (vfd->vidioc_try_fmt_type_private) + return (0); + break; + } + return (-EINVAL); +} + +static int __video_do_ioctl(struct inode *inode, struct file *file, + unsigned int cmd, void *arg) +{ + struct video_device *vfd = video_devdata(file); + void *fh = file->private_data; + int ret = -EINVAL; + + if ( (vfd->debug & V4L2_DEBUG_IOCTL) && + !(vfd->debug & V4L2_DEBUG_IOCTL_ARG)) { + v4l_print_ioctl(vfd->name, cmd); + printk("\n"); + } + +#ifdef CONFIG_VIDEO_V4L1_COMPAT + /*********************************************************** + Handles calls to the obsoleted V4L1 API + Due to the nature of VIDIOCGMBUF, each driver that supports + V4L1 should implement its own handler for this ioctl. + ***********************************************************/ + + /* --- streaming capture ------------------------------------- */ + if (cmd == VIDIOCGMBUF) { + struct video_mbuf *p=arg; + + memset(p, 0, sizeof(*p)); + + if (!vfd->vidiocgmbuf) + return ret; + ret=vfd->vidiocgmbuf(file, fh, p); + if (!ret) + dbgarg (cmd, "size=%d, frames=%d, offsets=0x%08lx\n", + p->size, p->frames, + (unsigned long)p->offsets); + return ret; + } + + /******************************************************** + All other V4L1 calls are handled by v4l1_compat module. + Those calls will be translated into V4L2 calls, and + __video_do_ioctl will be called again, with one or more + V4L2 ioctls. + ********************************************************/ + if (_IOC_TYPE(cmd)=='v') + return v4l_compat_translate_ioctl(inode,file,cmd,arg, + __video_do_ioctl); +#endif + + switch(cmd) { + /* --- capabilities ------------------------------------------ */ + case VIDIOC_QUERYCAP: + { + struct v4l2_capability *cap = (struct v4l2_capability*)arg; + memset(cap, 0, sizeof(*cap)); + + if (!vfd->vidioc_querycap) + break; + + ret=vfd->vidioc_querycap(file, fh, cap); + if (!ret) + dbgarg (cmd, "driver=%s, card=%s, bus=%s, " + "version=0x%08x, " + "capabilities=0x%08x\n", + cap->driver,cap->card,cap->bus_info, + cap->version, + cap->capabilities); + break; + } + + /* --- priority ------------------------------------------ */ + case VIDIOC_G_PRIORITY: + { + enum v4l2_priority *p=arg; + + if (!vfd->vidioc_g_priority) + break; + ret=vfd->vidioc_g_priority(file, fh, p); + if (!ret) + dbgarg(cmd, "priority is %d\n", *p); + break; + } + case VIDIOC_S_PRIORITY: + { + enum v4l2_priority *p=arg; + + if (!vfd->vidioc_s_priority) + break; + dbgarg(cmd, "setting priority to %d\n", *p); + ret=vfd->vidioc_s_priority(file, fh, *p); + break; + } + + /* --- capture ioctls ---------------------------------------- */ + case VIDIOC_ENUM_FMT: + { + struct v4l2_fmtdesc *f = arg; + enum v4l2_buf_type type; + unsigned int index; + + index = f->index; + type = f->type; + memset(f,0,sizeof(*f)); + f->index = index; + f->type = type; + + switch (type) { + case V4L2_BUF_TYPE_VIDEO_CAPTURE: + if (vfd->vidioc_enum_fmt_vid_cap) + ret = vfd->vidioc_enum_fmt_vid_cap(file, fh, f); + break; + case V4L2_BUF_TYPE_VIDEO_OVERLAY: + if (vfd->vidioc_enum_fmt_vid_overlay) + ret = vfd->vidioc_enum_fmt_vid_overlay(file, + fh, f); + break; +#if 1 + /* V4L2_BUF_TYPE_VBI_CAPTURE should not support VIDIOC_ENUM_FMT + * according to the spec. The bttv and saa7134 drivers support + * it though, so just warn that this is deprecated and will be + * removed in the near future. */ + case V4L2_BUF_TYPE_VBI_CAPTURE: + if (vfd->vidioc_enum_fmt_vbi_cap) { + printk(KERN_WARNING "vidioc_enum_fmt_vbi_cap will be removed in 2.6.28!\n"); + ret = vfd->vidioc_enum_fmt_vbi_cap(file, fh, f); + } + break; +#endif + case V4L2_BUF_TYPE_VIDEO_OUTPUT: + if (vfd->vidioc_enum_fmt_vid_out) + ret = vfd->vidioc_enum_fmt_vid_out(file, fh, f); + break; + case V4L2_BUF_TYPE_PRIVATE: + if (vfd->vidioc_enum_fmt_type_private) + ret = vfd->vidioc_enum_fmt_type_private(file, + fh, f); + break; + default: + break; + } + if (!ret) + dbgarg (cmd, "index=%d, type=%d, flags=%d, " + "pixelformat=%c%c%c%c, description='%s'\n", + f->index, f->type, f->flags, + (f->pixelformat & 0xff), + (f->pixelformat >> 8) & 0xff, + (f->pixelformat >> 16) & 0xff, + (f->pixelformat >> 24) & 0xff, + f->description); + break; + } + case VIDIOC_G_FMT: + { + struct v4l2_format *f = (struct v4l2_format *)arg; + + memset(f->fmt.raw_data, 0, sizeof(f->fmt.raw_data)); + + /* FIXME: Should be one dump per type */ + dbgarg(cmd, "type=%s\n", prt_names(f->type, v4l2_type_names)); + + switch (f->type) { + case V4L2_BUF_TYPE_VIDEO_CAPTURE: + if (vfd->vidioc_g_fmt_vid_cap) + ret = vfd->vidioc_g_fmt_vid_cap(file, fh, f); + if (!ret) + v4l_print_pix_fmt(vfd, &f->fmt.pix); + break; + case V4L2_BUF_TYPE_VIDEO_OVERLAY: + if (vfd->vidioc_g_fmt_vid_overlay) + ret = vfd->vidioc_g_fmt_vid_overlay(file, + fh, f); + break; + case V4L2_BUF_TYPE_VIDEO_OUTPUT: + if (vfd->vidioc_g_fmt_vid_out) + ret = vfd->vidioc_g_fmt_vid_out(file, fh, f); + if (!ret) + v4l_print_pix_fmt(vfd, &f->fmt.pix); + break; + case V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY: + if (vfd->vidioc_g_fmt_vid_out_overlay) + ret = vfd->vidioc_g_fmt_vid_out_overlay(file, + fh, f); + break; + case V4L2_BUF_TYPE_VBI_CAPTURE: + if (vfd->vidioc_g_fmt_vbi_cap) + ret = vfd->vidioc_g_fmt_vbi_cap(file, fh, f); + break; + case V4L2_BUF_TYPE_VBI_OUTPUT: + if (vfd->vidioc_g_fmt_vbi_out) + ret = vfd->vidioc_g_fmt_vbi_out(file, fh, f); + break; + case V4L2_BUF_TYPE_SLICED_VBI_CAPTURE: + if (vfd->vidioc_g_fmt_sliced_vbi_cap) + ret = vfd->vidioc_g_fmt_sliced_vbi_cap(file, + fh, f); + break; + case V4L2_BUF_TYPE_SLICED_VBI_OUTPUT: + if (vfd->vidioc_g_fmt_sliced_vbi_out) + ret = vfd->vidioc_g_fmt_sliced_vbi_out(file, + fh, f); + break; + case V4L2_BUF_TYPE_PRIVATE: + if (vfd->vidioc_g_fmt_type_private) + ret = vfd->vidioc_g_fmt_type_private(file, + fh, f); + break; + } + + break; + } + case VIDIOC_S_FMT: + { + struct v4l2_format *f = (struct v4l2_format *)arg; + + /* FIXME: Should be one dump per type */ + dbgarg(cmd, "type=%s\n", prt_names(f->type, v4l2_type_names)); + + switch (f->type) { + case V4L2_BUF_TYPE_VIDEO_CAPTURE: + v4l_print_pix_fmt(vfd, &f->fmt.pix); + if (vfd->vidioc_s_fmt_vid_cap) + ret = vfd->vidioc_s_fmt_vid_cap(file, fh, f); + break; + case V4L2_BUF_TYPE_VIDEO_OVERLAY: + if (vfd->vidioc_s_fmt_vid_overlay) + ret = vfd->vidioc_s_fmt_vid_overlay(file, + fh, f); + break; + case V4L2_BUF_TYPE_VIDEO_OUTPUT: + v4l_print_pix_fmt(vfd, &f->fmt.pix); + if (vfd->vidioc_s_fmt_vid_out) + ret = vfd->vidioc_s_fmt_vid_out(file, fh, f); + break; + case V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY: + if (vfd->vidioc_s_fmt_vid_out_overlay) + ret = vfd->vidioc_s_fmt_vid_out_overlay(file, + fh, f); + break; + case V4L2_BUF_TYPE_VBI_CAPTURE: + if (vfd->vidioc_s_fmt_vbi_cap) + ret = vfd->vidioc_s_fmt_vbi_cap(file, fh, f); + break; + case V4L2_BUF_TYPE_VBI_OUTPUT: + if (vfd->vidioc_s_fmt_vbi_out) + ret = vfd->vidioc_s_fmt_vbi_out(file, fh, f); + break; + case V4L2_BUF_TYPE_SLICED_VBI_CAPTURE: + if (vfd->vidioc_s_fmt_sliced_vbi_cap) + ret = vfd->vidioc_s_fmt_sliced_vbi_cap(file, + fh, f); + break; + case V4L2_BUF_TYPE_SLICED_VBI_OUTPUT: + if (vfd->vidioc_s_fmt_sliced_vbi_out) + ret = vfd->vidioc_s_fmt_sliced_vbi_out(file, + fh, f); + break; + case V4L2_BUF_TYPE_PRIVATE: + if (vfd->vidioc_s_fmt_type_private) + ret = vfd->vidioc_s_fmt_type_private(file, + fh, f); + break; + } + break; + } + case VIDIOC_TRY_FMT: + { + struct v4l2_format *f = (struct v4l2_format *)arg; + + /* FIXME: Should be one dump per type */ + dbgarg (cmd, "type=%s\n", prt_names(f->type, + v4l2_type_names)); + switch (f->type) { + case V4L2_BUF_TYPE_VIDEO_CAPTURE: + if (vfd->vidioc_try_fmt_vid_cap) + ret = vfd->vidioc_try_fmt_vid_cap(file, fh, f); + if (!ret) + v4l_print_pix_fmt(vfd, &f->fmt.pix); + break; + case V4L2_BUF_TYPE_VIDEO_OVERLAY: + if (vfd->vidioc_try_fmt_vid_overlay) + ret = vfd->vidioc_try_fmt_vid_overlay(file, + fh, f); + break; + case V4L2_BUF_TYPE_VIDEO_OUTPUT: + if (vfd->vidioc_try_fmt_vid_out) + ret = vfd->vidioc_try_fmt_vid_out(file, fh, f); + if (!ret) + v4l_print_pix_fmt(vfd, &f->fmt.pix); + break; + case V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY: + if (vfd->vidioc_try_fmt_vid_out_overlay) + ret = vfd->vidioc_try_fmt_vid_out_overlay(file, + fh, f); + break; + case V4L2_BUF_TYPE_VBI_CAPTURE: + if (vfd->vidioc_try_fmt_vbi_cap) + ret = vfd->vidioc_try_fmt_vbi_cap(file, fh, f); + break; + case V4L2_BUF_TYPE_VBI_OUTPUT: + if (vfd->vidioc_try_fmt_vbi_out) + ret = vfd->vidioc_try_fmt_vbi_out(file, fh, f); + break; + case V4L2_BUF_TYPE_SLICED_VBI_CAPTURE: + if (vfd->vidioc_try_fmt_sliced_vbi_cap) + ret = vfd->vidioc_try_fmt_sliced_vbi_cap(file, + fh, f); + break; + case V4L2_BUF_TYPE_SLICED_VBI_OUTPUT: + if (vfd->vidioc_try_fmt_sliced_vbi_out) + ret = vfd->vidioc_try_fmt_sliced_vbi_out(file, + fh, f); + break; + case V4L2_BUF_TYPE_PRIVATE: + if (vfd->vidioc_try_fmt_type_private) + ret = vfd->vidioc_try_fmt_type_private(file, + fh, f); + break; + } + + break; + } + /* FIXME: Those buf reqs could be handled here, + with some changes on videobuf to allow its header to be included at + videodev2.h or being merged at videodev2. + */ + case VIDIOC_REQBUFS: + { + struct v4l2_requestbuffers *p=arg; + + if (!vfd->vidioc_reqbufs) + break; + ret = check_fmt (vfd, p->type); + if (ret) + break; + + ret=vfd->vidioc_reqbufs(file, fh, p); + dbgarg (cmd, "count=%d, type=%s, memory=%s\n", + p->count, + prt_names(p->type, v4l2_type_names), + prt_names(p->memory, v4l2_memory_names)); + break; + } + case VIDIOC_QUERYBUF: + { + struct v4l2_buffer *p=arg; + + if (!vfd->vidioc_querybuf) + break; + ret = check_fmt (vfd, p->type); + if (ret) + break; + + ret=vfd->vidioc_querybuf(file, fh, p); + if (!ret) + dbgbuf(cmd,vfd,p); + break; + } + case VIDIOC_QBUF: + { + struct v4l2_buffer *p=arg; + + if (!vfd->vidioc_qbuf) + break; + ret = check_fmt (vfd, p->type); + if (ret) + break; + + ret=vfd->vidioc_qbuf(file, fh, p); + if (!ret) + dbgbuf(cmd,vfd,p); + break; + } + case VIDIOC_DQBUF: + { + struct v4l2_buffer *p=arg; + if (!vfd->vidioc_dqbuf) + break; + ret = check_fmt (vfd, p->type); + if (ret) + break; + + ret=vfd->vidioc_dqbuf(file, fh, p); + if (!ret) + dbgbuf(cmd,vfd,p); + break; + } + case VIDIOC_OVERLAY: + { + int *i = arg; + + if (!vfd->vidioc_overlay) + break; + dbgarg (cmd, "value=%d\n",*i); + ret=vfd->vidioc_overlay(file, fh, *i); + break; + } + case VIDIOC_G_FBUF: + { + struct v4l2_framebuffer *p = arg; + + if (!vfd->vidioc_g_fbuf) + break; + ret = vfd->vidioc_g_fbuf(file, fh, arg); + if (!ret) { + dbgarg(cmd, "capability=0x%x, flags=%d, base=0x%08lx\n", + p->capability, p->flags, + (unsigned long)p->base); + v4l_print_pix_fmt(vfd, &p->fmt); + } + break; + } + case VIDIOC_S_FBUF: + { + struct v4l2_framebuffer *p = arg; + + if (!vfd->vidioc_s_fbuf) + break; + dbgarg(cmd, "capability=0x%x, flags=%d, base=0x%08lx\n", + p->capability, p->flags, (unsigned long)p->base); + v4l_print_pix_fmt(vfd, &p->fmt); + ret = vfd->vidioc_s_fbuf(file, fh, arg); + break; + } + case VIDIOC_STREAMON: + { + enum v4l2_buf_type i = *(int *)arg; + if (!vfd->vidioc_streamon) + break; + dbgarg(cmd, "type=%s\n", prt_names(i, v4l2_type_names)); + ret=vfd->vidioc_streamon(file, fh,i); + break; + } + case VIDIOC_STREAMOFF: + { + enum v4l2_buf_type i = *(int *)arg; + + if (!vfd->vidioc_streamoff) + break; + dbgarg(cmd, "type=%s\n", prt_names(i, v4l2_type_names)); + ret=vfd->vidioc_streamoff(file, fh, i); + break; + } + /* ---------- tv norms ---------- */ + case VIDIOC_ENUMSTD: + { + struct v4l2_standard *p = arg; + v4l2_std_id id = vfd->tvnorms, curr_id = 0; + unsigned int index = p->index, i, j = 0; + const char *descr = ""; + + /* Return norm array in a canonical way */ + for (i = 0; i <= index && id; i++) { + /* last std value in the standards array is 0, so this + while always ends there since (id & 0) == 0. */ + while ((id & standards[j].std) != standards[j].std) + j++; + curr_id = standards[j].std; + descr = standards[j].descr; + j++; + if (curr_id == 0) + break; + if (curr_id != V4L2_STD_PAL && + curr_id != V4L2_STD_SECAM && + curr_id != V4L2_STD_NTSC) + id &= ~curr_id; + } + if (i <= index) + return -EINVAL; + + v4l2_video_std_construct(p, curr_id, descr); + p->index = index; + + dbgarg(cmd, "index=%d, id=0x%Lx, name=%s, fps=%d/%d, " + "framelines=%d\n", p->index, + (unsigned long long)p->id, p->name, + p->frameperiod.numerator, + p->frameperiod.denominator, + p->framelines); + + ret = 0; + break; + } + case VIDIOC_G_STD: + { + v4l2_std_id *id = arg; + + ret = 0; + /* Calls the specific handler */ + if (vfd->vidioc_g_std) + ret = vfd->vidioc_g_std(file, fh, id); + else + *id = vfd->current_norm; + + if (!ret) + dbgarg(cmd, "std=0x%08Lx\n", (long long unsigned)*id); + break; + } + case VIDIOC_S_STD: + { + v4l2_std_id *id = arg,norm; + + dbgarg(cmd, "std=%08Lx\n", (long long unsigned)*id); + + norm = (*id) & vfd->tvnorms; + if ( vfd->tvnorms && !norm) /* Check if std is supported */ + break; + + /* Calls the specific handler */ + if (vfd->vidioc_s_std) + ret=vfd->vidioc_s_std(file, fh, &norm); + else + ret=-EINVAL; + + /* Updates standard information */ + if (ret>=0) + vfd->current_norm=norm; + + break; + } + case VIDIOC_QUERYSTD: + { + v4l2_std_id *p=arg; + + if (!vfd->vidioc_querystd) + break; + ret=vfd->vidioc_querystd(file, fh, arg); + if (!ret) + dbgarg (cmd, "detected std=%08Lx\n", + (unsigned long long)*p); + break; + } + /* ------ input switching ---------- */ + /* FIXME: Inputs can be handled inside videodev2 */ + case VIDIOC_ENUMINPUT: + { + struct v4l2_input *p=arg; + int i=p->index; + + if (!vfd->vidioc_enum_input) + break; + memset(p, 0, sizeof(*p)); + p->index=i; + + ret=vfd->vidioc_enum_input(file, fh, p); + if (!ret) + dbgarg (cmd, "index=%d, name=%s, type=%d, " + "audioset=%d, " + "tuner=%d, std=%08Lx, status=%d\n", + p->index,p->name,p->type,p->audioset, + p->tuner, + (unsigned long long)p->std, + p->status); + break; + } + case VIDIOC_G_INPUT: + { + unsigned int *i = arg; + + if (!vfd->vidioc_g_input) + break; + ret=vfd->vidioc_g_input(file, fh, i); + if (!ret) + dbgarg (cmd, "value=%d\n",*i); + break; + } + case VIDIOC_S_INPUT: + { + unsigned int *i = arg; + + if (!vfd->vidioc_s_input) + break; + dbgarg (cmd, "value=%d\n",*i); + ret=vfd->vidioc_s_input(file, fh, *i); + break; + } + + /* ------ output switching ---------- */ + case VIDIOC_ENUMOUTPUT: + { + struct v4l2_output *p = arg; + int i = p->index; + + if (!vfd->vidioc_enum_output) + break; + memset(p, 0, sizeof(*p)); + p->index = i; + + ret = vfd->vidioc_enum_output(file, fh, p); + if (!ret) + dbgarg(cmd, "index=%d, name=%s, type=%d, " + "audioset=0x%x, " + "modulator=%d, std=0x%08Lx\n", + p->index, p->name, p->type, p->audioset, + p->modulator, (unsigned long long)p->std); + break; + } + case VIDIOC_G_OUTPUT: + { + unsigned int *i = arg; + + if (!vfd->vidioc_g_output) + break; + ret=vfd->vidioc_g_output(file, fh, i); + if (!ret) + dbgarg (cmd, "value=%d\n",*i); + break; + } + case VIDIOC_S_OUTPUT: + { + unsigned int *i = arg; + + if (!vfd->vidioc_s_output) + break; + dbgarg (cmd, "value=%d\n",*i); + ret=vfd->vidioc_s_output(file, fh, *i); + break; + } + + /* --- controls ---------------------------------------------- */ + case VIDIOC_QUERYCTRL: + { + struct v4l2_queryctrl *p = arg; + + if (!vfd->vidioc_queryctrl) + break; + ret = vfd->vidioc_queryctrl(file, fh, p); + if (!ret) + dbgarg(cmd, "id=0x%x, type=%d, name=%s, min/max=%d/%d, " + "step=%d, default=%d, flags=0x%08x\n", + p->id, p->type, p->name, + p->minimum, p->maximum, + p->step, p->default_value, p->flags); + else + dbgarg(cmd, "id=0x%x\n", p->id); + break; + } + case VIDIOC_G_CTRL: + { + struct v4l2_control *p = arg; + + if (vfd->vidioc_g_ctrl) + ret = vfd->vidioc_g_ctrl(file, fh, p); + else if (vfd->vidioc_g_ext_ctrls) { + struct v4l2_ext_controls ctrls; + struct v4l2_ext_control ctrl; + + ctrls.ctrl_class = V4L2_CTRL_ID2CLASS(p->id); + ctrls.count = 1; + ctrls.controls = &ctrl; + ctrl.id = p->id; + ctrl.value = p->value; + if (check_ext_ctrls(&ctrls, 1)) { + ret = vfd->vidioc_g_ext_ctrls(file, fh, &ctrls); + if (ret == 0) + p->value = ctrl.value; + } + } else + break; + if (!ret) + dbgarg(cmd, "id=0x%x, value=%d\n", p->id, p->value); + else + dbgarg(cmd, "id=0x%x\n", p->id); + break; + } + case VIDIOC_S_CTRL: + { + struct v4l2_control *p = arg; + struct v4l2_ext_controls ctrls; + struct v4l2_ext_control ctrl; + + if (!vfd->vidioc_s_ctrl && !vfd->vidioc_s_ext_ctrls) + break; + + dbgarg(cmd, "id=0x%x, value=%d\n", p->id, p->value); + + if (vfd->vidioc_s_ctrl) { + ret = vfd->vidioc_s_ctrl(file, fh, p); + break; + } + if (!vfd->vidioc_s_ext_ctrls) + break; + + ctrls.ctrl_class = V4L2_CTRL_ID2CLASS(p->id); + ctrls.count = 1; + ctrls.controls = &ctrl; + ctrl.id = p->id; + ctrl.value = p->value; + if (check_ext_ctrls(&ctrls, 1)) + ret = vfd->vidioc_s_ext_ctrls(file, fh, &ctrls); + break; + } + case VIDIOC_G_EXT_CTRLS: + { + struct v4l2_ext_controls *p = arg; + + p->error_idx = p->count; + if (!vfd->vidioc_g_ext_ctrls) + break; + if (check_ext_ctrls(p, 0)) + ret = vfd->vidioc_g_ext_ctrls(file, fh, p); + v4l_print_ext_ctrls(cmd, vfd, p, !ret); + break; + } + case VIDIOC_S_EXT_CTRLS: + { + struct v4l2_ext_controls *p = arg; + + p->error_idx = p->count; + if (!vfd->vidioc_s_ext_ctrls) + break; + v4l_print_ext_ctrls(cmd, vfd, p, 1); + if (check_ext_ctrls(p, 0)) + ret = vfd->vidioc_s_ext_ctrls(file, fh, p); + break; + } + case VIDIOC_TRY_EXT_CTRLS: + { + struct v4l2_ext_controls *p = arg; + + p->error_idx = p->count; + if (!vfd->vidioc_try_ext_ctrls) + break; + v4l_print_ext_ctrls(cmd, vfd, p, 1); + if (check_ext_ctrls(p, 0)) + ret = vfd->vidioc_try_ext_ctrls(file, fh, p); + break; + } + case VIDIOC_QUERYMENU: + { + struct v4l2_querymenu *p = arg; + + if (!vfd->vidioc_querymenu) + break; + ret = vfd->vidioc_querymenu(file, fh, p); + if (!ret) + dbgarg(cmd, "id=0x%x, index=%d, name=%s\n", + p->id, p->index, p->name); + else + dbgarg(cmd, "id=0x%x, index=%d\n", + p->id, p->index); + break; + } + /* --- audio ---------------------------------------------- */ + case VIDIOC_ENUMAUDIO: + { + struct v4l2_audio *p = arg; + + if (!vfd->vidioc_enumaudio) + break; + ret = vfd->vidioc_enumaudio(file, fh, p); + if (!ret) + dbgarg(cmd, "index=%d, name=%s, capability=0x%x, " + "mode=0x%x\n", p->index, p->name, + p->capability, p->mode); + else + dbgarg(cmd, "index=%d\n", p->index); + break; + } + case VIDIOC_G_AUDIO: + { + struct v4l2_audio *p = arg; + __u32 index = p->index; + + if (!vfd->vidioc_g_audio) + break; + + memset(p, 0, sizeof(*p)); + p->index = index; + ret = vfd->vidioc_g_audio(file, fh, p); + if (!ret) + dbgarg(cmd, "index=%d, name=%s, capability=0x%x, " + "mode=0x%x\n", p->index, + p->name, p->capability, p->mode); + else + dbgarg(cmd, "index=%d\n", p->index); + break; + } + case VIDIOC_S_AUDIO: + { + struct v4l2_audio *p = arg; + + if (!vfd->vidioc_s_audio) + break; + dbgarg(cmd, "index=%d, name=%s, capability=0x%x, " + "mode=0x%x\n", p->index, p->name, + p->capability, p->mode); + ret = vfd->vidioc_s_audio(file, fh, p); + break; + } + case VIDIOC_ENUMAUDOUT: + { + struct v4l2_audioout *p=arg; + + if (!vfd->vidioc_enumaudout) + break; + dbgarg(cmd, "Enum for index=%d\n", p->index); + ret=vfd->vidioc_enumaudout(file, fh, p); + if (!ret) + dbgarg2("index=%d, name=%s, capability=%d, " + "mode=%d\n", p->index, p->name, + p->capability,p->mode); + break; + } + case VIDIOC_G_AUDOUT: + { + struct v4l2_audioout *p=arg; + + if (!vfd->vidioc_g_audout) + break; + dbgarg(cmd, "Enum for index=%d\n", p->index); + ret=vfd->vidioc_g_audout(file, fh, p); + if (!ret) + dbgarg2("index=%d, name=%s, capability=%d, " + "mode=%d\n", p->index, p->name, + p->capability,p->mode); + break; + } + case VIDIOC_S_AUDOUT: + { + struct v4l2_audioout *p=arg; + + if (!vfd->vidioc_s_audout) + break; + dbgarg(cmd, "index=%d, name=%s, capability=%d, " + "mode=%d\n", p->index, p->name, + p->capability,p->mode); + + ret=vfd->vidioc_s_audout(file, fh, p); + break; + } + case VIDIOC_G_MODULATOR: + { + struct v4l2_modulator *p=arg; + if (!vfd->vidioc_g_modulator) + break; + ret=vfd->vidioc_g_modulator(file, fh, p); + if (!ret) + dbgarg(cmd, "index=%d, name=%s, " + "capability=%d, rangelow=%d," + " rangehigh=%d, txsubchans=%d\n", + p->index, p->name,p->capability, + p->rangelow, p->rangehigh, + p->txsubchans); + break; + } + case VIDIOC_S_MODULATOR: + { + struct v4l2_modulator *p=arg; + if (!vfd->vidioc_s_modulator) + break; + dbgarg(cmd, "index=%d, name=%s, capability=%d, " + "rangelow=%d, rangehigh=%d, txsubchans=%d\n", + p->index, p->name,p->capability,p->rangelow, + p->rangehigh,p->txsubchans); + ret=vfd->vidioc_s_modulator(file, fh, p); + break; + } + case VIDIOC_G_CROP: + { + struct v4l2_crop *p=arg; + if (!vfd->vidioc_g_crop) + break; + dbgarg(cmd, "type=%s\n", prt_names(p->type, v4l2_type_names)); + ret=vfd->vidioc_g_crop(file, fh, p); + if (!ret) { + dbgrect(vfd, "", &p->c); + } + break; + } + case VIDIOC_S_CROP: + { + struct v4l2_crop *p=arg; + if (!vfd->vidioc_s_crop) + break; + dbgarg(cmd, "type=%s\n", prt_names(p->type, v4l2_type_names)); + dbgrect(vfd, "", &p->c); + ret=vfd->vidioc_s_crop(file, fh, p); + break; + } + case VIDIOC_CROPCAP: + { + struct v4l2_cropcap *p = arg; + + /*FIXME: Should also show v4l2_fract pixelaspect */ + if (!vfd->vidioc_cropcap) + break; + dbgarg(cmd, "type=%s\n", prt_names(p->type, v4l2_type_names)); + ret = vfd->vidioc_cropcap(file, fh, p); + if (!ret) { + dbgrect(vfd, "bounds ", &p->bounds); + dbgrect(vfd, "defrect ", &p->defrect); + } + break; + } + case VIDIOC_G_JPEGCOMP: + { + struct v4l2_jpegcompression *p=arg; + if (!vfd->vidioc_g_jpegcomp) + break; + ret=vfd->vidioc_g_jpegcomp(file, fh, p); + if (!ret) + dbgarg (cmd, "quality=%d, APPn=%d, " + "APP_len=%d, COM_len=%d, " + "jpeg_markers=%d\n", + p->quality,p->APPn,p->APP_len, + p->COM_len,p->jpeg_markers); + break; + } + case VIDIOC_S_JPEGCOMP: + { + struct v4l2_jpegcompression *p=arg; + if (!vfd->vidioc_g_jpegcomp) + break; + dbgarg (cmd, "quality=%d, APPn=%d, APP_len=%d, " + "COM_len=%d, jpeg_markers=%d\n", + p->quality,p->APPn,p->APP_len, + p->COM_len,p->jpeg_markers); + ret=vfd->vidioc_s_jpegcomp(file, fh, p); + break; + } + case VIDIOC_G_ENC_INDEX: + { + struct v4l2_enc_idx *p=arg; + + if (!vfd->vidioc_g_enc_index) + break; + ret=vfd->vidioc_g_enc_index(file, fh, p); + if (!ret) + dbgarg (cmd, "entries=%d, entries_cap=%d\n", + p->entries,p->entries_cap); + break; + } + case VIDIOC_ENCODER_CMD: + { + struct v4l2_encoder_cmd *p = arg; + + if (!vfd->vidioc_encoder_cmd) + break; + memset(&p->raw, 0, sizeof(p->raw)); + ret = vfd->vidioc_encoder_cmd(file, fh, p); + if (!ret) + dbgarg(cmd, "cmd=%d, flags=%x\n", p->cmd, p->flags); + break; + } + case VIDIOC_TRY_ENCODER_CMD: + { + struct v4l2_encoder_cmd *p = arg; + + if (!vfd->vidioc_try_encoder_cmd) + break; + memset(&p->raw, 0, sizeof(p->raw)); + ret = vfd->vidioc_try_encoder_cmd(file, fh, p); + if (!ret) + dbgarg(cmd, "cmd=%d, flags=%x\n", p->cmd, p->flags); + break; + } + case VIDIOC_G_PARM: + { + struct v4l2_streamparm *p=arg; + __u32 type=p->type; + + memset(p,0,sizeof(*p)); + p->type=type; + + if (vfd->vidioc_g_parm) { + ret=vfd->vidioc_g_parm(file, fh, p); + } else { + struct v4l2_standard s; + + if (p->type != V4L2_BUF_TYPE_VIDEO_CAPTURE) + return -EINVAL; + + v4l2_video_std_construct(&s, vfd->current_norm, + v4l2_norm_to_name(vfd->current_norm)); + + p->parm.capture.timeperframe = s.frameperiod; + ret=0; + } + + dbgarg (cmd, "type=%d\n", p->type); + break; + } + case VIDIOC_S_PARM: + { + struct v4l2_streamparm *p=arg; + if (!vfd->vidioc_s_parm) + break; + dbgarg (cmd, "type=%d\n", p->type); + ret=vfd->vidioc_s_parm(file, fh, p); + break; + } + case VIDIOC_G_TUNER: + { + struct v4l2_tuner *p = arg; + __u32 index = p->index; + + if (!vfd->vidioc_g_tuner) + break; + + memset(p, 0, sizeof(*p)); + p->index = index; + + ret = vfd->vidioc_g_tuner(file, fh, p); + if (!ret) + dbgarg(cmd, "index=%d, name=%s, type=%d, " + "capability=0x%x, rangelow=%d, " + "rangehigh=%d, signal=%d, afc=%d, " + "rxsubchans=0x%x, audmode=%d\n", + p->index, p->name, p->type, + p->capability, p->rangelow, + p->rangehigh, p->signal, p->afc, + p->rxsubchans, p->audmode); + break; + } + case VIDIOC_S_TUNER: + { + struct v4l2_tuner *p = arg; + + if (!vfd->vidioc_s_tuner) + break; + dbgarg(cmd, "index=%d, name=%s, type=%d, " + "capability=0x%x, rangelow=%d, " + "rangehigh=%d, signal=%d, afc=%d, " + "rxsubchans=0x%x, audmode=%d\n", + p->index, p->name, p->type, + p->capability, p->rangelow, + p->rangehigh, p->signal, p->afc, + p->rxsubchans, p->audmode); + ret = vfd->vidioc_s_tuner(file, fh, p); + break; + } + case VIDIOC_G_FREQUENCY: + { + struct v4l2_frequency *p = arg; + + if (!vfd->vidioc_g_frequency) + break; + + memset(p->reserved, 0, sizeof(p->reserved)); + + ret = vfd->vidioc_g_frequency(file, fh, p); + if (!ret) + dbgarg(cmd, "tuner=%d, type=%d, frequency=%d\n", + p->tuner, p->type, p->frequency); + break; + } + case VIDIOC_S_FREQUENCY: + { + struct v4l2_frequency *p=arg; + if (!vfd->vidioc_s_frequency) + break; + dbgarg (cmd, "tuner=%d, type=%d, frequency=%d\n", + p->tuner,p->type,p->frequency); + ret=vfd->vidioc_s_frequency(file, fh, p); + break; + } + case VIDIOC_G_SLICED_VBI_CAP: + { + struct v4l2_sliced_vbi_cap *p = arg; + __u32 type = p->type; + + if (!vfd->vidioc_g_sliced_vbi_cap) + break; + memset(p, 0, sizeof(*p)); + p->type = type; + dbgarg(cmd, "type=%s\n", prt_names(p->type, v4l2_type_names)); + ret = vfd->vidioc_g_sliced_vbi_cap(file, fh, p); + if (!ret) + dbgarg2("service_set=%d\n", p->service_set); + break; + } + case VIDIOC_LOG_STATUS: + { + if (!vfd->vidioc_log_status) + break; + ret=vfd->vidioc_log_status(file, fh); + break; + } +#ifdef CONFIG_VIDEO_ADV_DEBUG + case VIDIOC_DBG_G_REGISTER: + { + struct v4l2_register *p=arg; + if (!capable(CAP_SYS_ADMIN)) + ret=-EPERM; + else if (vfd->vidioc_g_register) + ret=vfd->vidioc_g_register(file, fh, p); + break; + } + case VIDIOC_DBG_S_REGISTER: + { + struct v4l2_register *p=arg; + if (!capable(CAP_SYS_ADMIN)) + ret=-EPERM; + else if (vfd->vidioc_s_register) + ret=vfd->vidioc_s_register(file, fh, p); + break; + } +#endif + case VIDIOC_G_CHIP_IDENT: + { + struct v4l2_chip_ident *p=arg; + if (!vfd->vidioc_g_chip_ident) + break; + ret=vfd->vidioc_g_chip_ident(file, fh, p); + if (!ret) + dbgarg (cmd, "chip_ident=%u, revision=0x%x\n", p->ident, p->revision); + break; + } + default: + { + if (!vfd->vidioc_default) + break; + ret = vfd->vidioc_default(file, fh, cmd, arg); + break; + } + case VIDIOC_S_HW_FREQ_SEEK: + { + struct v4l2_hw_freq_seek *p = arg; + if (!vfd->vidioc_s_hw_freq_seek) + break; + dbgarg(cmd, + "tuner=%d, type=%d, seek_upward=%d, wrap_around=%d\n", + p->tuner, p->type, p->seek_upward, p->wrap_around); + ret = vfd->vidioc_s_hw_freq_seek(file, fh, p); + break; + } + } /* switch */ + + if (vfd->debug & V4L2_DEBUG_IOCTL_ARG) { + if (ret < 0) { + v4l_print_ioctl(vfd->name, cmd); + printk(KERN_CONT " error %d\n", ret); + } + } + + return ret; +} + +int video_ioctl2 (struct inode *inode, struct file *file, + unsigned int cmd, unsigned long arg) +{ + char sbuf[128]; + void *mbuf = NULL; + void *parg = NULL; + int err = -EINVAL; + int is_ext_ctrl; + size_t ctrls_size = 0; + void __user *user_ptr = NULL; + +#ifdef __OLD_VIDIOC_ + cmd = video_fix_command(cmd); +#endif + is_ext_ctrl = (cmd == VIDIOC_S_EXT_CTRLS || cmd == VIDIOC_G_EXT_CTRLS || + cmd == VIDIOC_TRY_EXT_CTRLS); + + /* Copy arguments into temp kernel buffer */ + switch (_IOC_DIR(cmd)) { + case _IOC_NONE: + parg = NULL; + break; + case _IOC_READ: + case _IOC_WRITE: + case (_IOC_WRITE | _IOC_READ): + if (_IOC_SIZE(cmd) <= sizeof(sbuf)) { + parg = sbuf; + } else { + /* too big to allocate from stack */ + mbuf = kmalloc(_IOC_SIZE(cmd),GFP_KERNEL); + if (NULL == mbuf) + return -ENOMEM; + parg = mbuf; + } + + err = -EFAULT; + if (_IOC_DIR(cmd) & _IOC_WRITE) + if (copy_from_user(parg, (void __user *)arg, _IOC_SIZE(cmd))) + goto out; + break; + } + + if (is_ext_ctrl) { + struct v4l2_ext_controls *p = parg; + + /* In case of an error, tell the caller that it wasn't + a specific control that caused it. */ + p->error_idx = p->count; + user_ptr = (void __user *)p->controls; + if (p->count) { + ctrls_size = sizeof(struct v4l2_ext_control) * p->count; + /* Note: v4l2_ext_controls fits in sbuf[] so mbuf is still NULL. */ + mbuf = kmalloc(ctrls_size, GFP_KERNEL); + err = -ENOMEM; + if (NULL == mbuf) + goto out_ext_ctrl; + err = -EFAULT; + if (copy_from_user(mbuf, user_ptr, ctrls_size)) + goto out_ext_ctrl; + p->controls = mbuf; + } + } + + /* Handles IOCTL */ + err = __video_do_ioctl(inode, file, cmd, parg); + if (err == -ENOIOCTLCMD) + err = -EINVAL; + if (is_ext_ctrl) { + struct v4l2_ext_controls *p = parg; + + p->controls = (void *)user_ptr; + if (p->count && err == 0 && copy_to_user(user_ptr, mbuf, ctrls_size)) + err = -EFAULT; + goto out_ext_ctrl; + } + if (err < 0) + goto out; + +out_ext_ctrl: + /* Copy results into user buffer */ + switch (_IOC_DIR(cmd)) + { + case _IOC_READ: + case (_IOC_WRITE | _IOC_READ): + if (copy_to_user((void __user *)arg, parg, _IOC_SIZE(cmd))) + err = -EFAULT; + break; + } + +out: + kfree(mbuf); + return err; +} +EXPORT_SYMBOL(video_ioctl2); + +/** + * get_index - assign stream number based on parent device + * @vdev: video_device to assign index number to, vdev->dev should be assigned + * @num: -1 if auto assign, requested number otherwise + * + * + * returns -ENFILE if num is already in use, a free index number if + * successful. + */ +static int get_index(struct video_device *vdev, int num) +{ + u32 used = 0; + const int max_index = sizeof(used) * 8 - 1; + int i; + + /* Currently a single v4l driver instance cannot create more than + 32 devices. + Increase to u64 or an array of u32 if more are needed. */ + if (num > max_index) { + printk(KERN_ERR "videodev: %s num is too large\n", __func__); + return -EINVAL; + } + + for (i = 0; i < VIDEO_NUM_DEVICES; i++) { + if (video_device[i] != NULL && + video_device[i] != vdev && + video_device[i]->dev == vdev->dev) { + used |= 1 << video_device[i]->index; + } + } + + if (num >= 0) { + if (used & (1 << num)) + return -ENFILE; + return num; + } + + i = ffz(used); + return i > max_index ? -ENFILE : i; +} + +static const struct file_operations video_fops; + +int video_register_device(struct video_device *vfd, int type, int nr) +{ + return video_register_device_index(vfd, type, nr, -1); +} +EXPORT_SYMBOL(video_register_device); + +/** + * video_register_device - register video4linux devices + * @vfd: video device structure we want to register + * @type: type of device to register + * @nr: which device number (0 == /dev/video0, 1 == /dev/video1, ... + * -1 == first free) + * + * The registration code assigns minor numbers based on the type + * requested. -ENFILE is returned in all the device slots for this + * category are full. If not then the minor field is set and the + * driver initialize function is called (if non %NULL). + * + * Zero is returned on success. + * + * Valid types are + * + * %VFL_TYPE_GRABBER - A frame grabber + * + * %VFL_TYPE_VTX - A teletext device + * + * %VFL_TYPE_VBI - Vertical blank data (undecoded) + * + * %VFL_TYPE_RADIO - A radio card + */ + +int video_register_device_index(struct video_device *vfd, int type, int nr, + int index) +{ + int i=0; + int base; + int end; + int ret; + char *name_base; + + switch(type) + { + case VFL_TYPE_GRABBER: + base=MINOR_VFL_TYPE_GRABBER_MIN; + end=MINOR_VFL_TYPE_GRABBER_MAX+1; + name_base = "video"; + break; + case VFL_TYPE_VTX: + base=MINOR_VFL_TYPE_VTX_MIN; + end=MINOR_VFL_TYPE_VTX_MAX+1; + name_base = "vtx"; + break; + case VFL_TYPE_VBI: + base=MINOR_VFL_TYPE_VBI_MIN; + end=MINOR_VFL_TYPE_VBI_MAX+1; + name_base = "vbi"; + break; + case VFL_TYPE_RADIO: + base=MINOR_VFL_TYPE_RADIO_MIN; + end=MINOR_VFL_TYPE_RADIO_MAX+1; + name_base = "radio"; + break; + default: + printk(KERN_ERR "%s called with unknown type: %d\n", + __func__, type); + return -1; + } + + /* pick a minor number */ + mutex_lock(&videodev_lock); + if (nr >= 0 && nr < end-base) { + /* use the one the driver asked for */ + i = base+nr; + if (NULL != video_device[i]) { + mutex_unlock(&videodev_lock); + return -ENFILE; + } + } else { + /* use first free */ + for(i=base;iminor=i; + + ret = get_index(vfd, index); + vfd->index = ret; + + mutex_unlock(&videodev_lock); + + if (ret < 0) { + printk(KERN_ERR "%s: get_index failed\n", __func__); + goto fail_minor; + } + + mutex_init(&vfd->lock); + + /* sysfs class */ + memset(&vfd->class_dev, 0x00, sizeof(vfd->class_dev)); + vfd->class_dev.class = &video_class; + vfd->class_dev.devt = MKDEV(VIDEO_MAJOR, vfd->minor); + if (vfd->dev) + vfd->class_dev.parent = vfd->dev; + sprintf(vfd->class_dev.bus_id, "%s%d", name_base, i - base); + ret = device_register(&vfd->class_dev); + if (ret < 0) { + printk(KERN_ERR "%s: device_register failed\n", __func__); + goto fail_minor; + } + +#if 1 + /* needed until all drivers are fixed */ + if (!vfd->release) + printk(KERN_WARNING "videodev: \"%s\" has no release callback. " + "Please fix your driver for proper sysfs support, see " + "http://lwn.net/Articles/36850/\n", vfd->name); +#endif + return 0; + +fail_minor: + mutex_lock(&videodev_lock); + video_device[vfd->minor] = NULL; + vfd->minor = -1; + mutex_unlock(&videodev_lock); + return ret; +} +EXPORT_SYMBOL(video_register_device_index); + +/** + * video_unregister_device - unregister a video4linux device + * @vfd: the device to unregister + * + * This unregisters the passed device and deassigns the minor + * number. Future open calls will be met with errors. + */ + +void video_unregister_device(struct video_device *vfd) +{ + mutex_lock(&videodev_lock); + if(video_device[vfd->minor]!=vfd) + panic("videodev: bad unregister"); + + video_device[vfd->minor]=NULL; + device_unregister(&vfd->class_dev); + mutex_unlock(&videodev_lock); +} +EXPORT_SYMBOL(video_unregister_device); + +/* + * Video fs operations + */ +static const struct file_operations video_fops= +{ + .owner = THIS_MODULE, + .llseek = no_llseek, + .open = video_open, +}; + +/* + * Initialise video for linux + */ + +static int __init videodev_init(void) +{ + int ret; + + printk(KERN_INFO "Linux video capture interface: v2.00\n"); + if (register_chrdev(VIDEO_MAJOR, VIDEO_NAME, &video_fops)) { + printk(KERN_WARNING "video_dev: unable to get major %d\n", VIDEO_MAJOR); + return -EIO; + } + + ret = class_register(&video_class); + if (ret < 0) { + unregister_chrdev(VIDEO_MAJOR, VIDEO_NAME); + printk(KERN_WARNING "video_dev: class_register failed\n"); + return -EIO; + } + + return 0; +} + +static void __exit videodev_exit(void) +{ + class_unregister(&video_class); + unregister_chrdev(VIDEO_MAJOR, VIDEO_NAME); +} + +module_init(videodev_init) +module_exit(videodev_exit) + +MODULE_AUTHOR("Alan Cox, Mauro Carvalho Chehab "); +MODULE_DESCRIPTION("Device registrar for Video4Linux drivers v2"); +MODULE_LICENSE("GPL"); + + +/* + * Local variables: + * c-basic-offset: 8 + * End: + */ diff --git a/trunk/drivers/media/video/vino.c b/trunk/drivers/media/video/vino.c index 3989b0eded28..01ea99c9bc1a 100644 --- a/trunk/drivers/media/video/vino.c +++ b/trunk/drivers/media/video/vino.c @@ -38,7 +38,7 @@ #include #include -#include +#include #include #include #include @@ -4385,6 +4385,8 @@ static const struct file_operations vino_fops = { static struct video_device v4l_device_template = { .name = "NOT SET", + /*.type = VID_TYPE_CAPTURE | VID_TYPE_SUBCAPTURE | */ + /* VID_TYPE_CLIPPING | VID_TYPE_SCALES, VID_TYPE_OVERLAY */ .fops = &vino_fops, .minor = -1, }; diff --git a/trunk/drivers/media/video/vivi.c b/trunk/drivers/media/video/vivi.c index 3518af071a2e..059b01c11dc1 100644 --- a/trunk/drivers/media/video/vivi.c +++ b/trunk/drivers/media/video/vivi.c @@ -35,7 +35,6 @@ #include #include #include -#include #include #include #include @@ -1066,7 +1065,13 @@ static const struct file_operations vivi_fops = { .llseek = no_llseek, }; -static const struct v4l2_ioctl_ops vivi_ioctl_ops = { +static struct video_device vivi_template = { + .name = "vivi", + .type = VID_TYPE_CAPTURE, + .fops = &vivi_fops, + .minor = -1, + .release = video_device_release, + .vidioc_querycap = vidioc_querycap, .vidioc_enum_fmt_vid_cap = vidioc_enum_fmt_vid_cap, .vidioc_g_fmt_vid_cap = vidioc_g_fmt_vid_cap, @@ -1088,15 +1093,6 @@ static const struct v4l2_ioctl_ops vivi_ioctl_ops = { #ifdef CONFIG_VIDEO_V4L1_COMPAT .vidiocgmbuf = vidiocgmbuf, #endif -}; - -static struct video_device vivi_template = { - .name = "vivi", - .fops = &vivi_fops, - .ioctl_ops = &vivi_ioctl_ops, - .minor = -1, - .release = video_device_release, - .tvnorms = V4L2_STD_525_60, .current_norm = V4L2_STD_NTSC_M, }; diff --git a/trunk/drivers/media/video/vp27smpx.c b/trunk/drivers/media/video/vp27smpx.c index 577956c5410b..cbecb3cbbbaa 100644 --- a/trunk/drivers/media/video/vp27smpx.c +++ b/trunk/drivers/media/video/vp27smpx.c @@ -27,7 +27,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/trunk/drivers/media/video/w9966.c b/trunk/drivers/media/video/w9966.c index 9402f40095b4..33f702698a56 100644 --- a/trunk/drivers/media/video/w9966.c +++ b/trunk/drivers/media/video/w9966.c @@ -57,9 +57,8 @@ #include #include #include -#include +#include #include -#include #include /*#define DEBUG*/ /* Undef me for production */ @@ -196,7 +195,9 @@ static const struct file_operations w9966_fops = { .llseek = no_llseek, }; static struct video_device w9966_template = { + .owner = THIS_MODULE, .name = W9966_DRIVERNAME, + .type = VID_TYPE_CAPTURE | VID_TYPE_SCALES, .fops = &w9966_fops, }; diff --git a/trunk/drivers/media/video/w9968cf.c b/trunk/drivers/media/video/w9968cf.c index 168baabe4659..840522442d07 100644 --- a/trunk/drivers/media/video/w9968cf.c +++ b/trunk/drivers/media/video/w9968cf.c @@ -42,7 +42,6 @@ #include #include #include -#include #include "w9968cf.h" #include "w9968cf_decoder.h" @@ -3550,11 +3549,13 @@ w9968cf_usb_probe(struct usb_interface* intf, const struct usb_device_id* id) } strcpy(cam->v4ldev->name, symbolic(camlist, mod_id)); + cam->v4ldev->owner = THIS_MODULE; + cam->v4ldev->type = VID_TYPE_CAPTURE | VID_TYPE_SCALES; cam->v4ldev->fops = &w9968cf_fops; cam->v4ldev->minor = video_nr[dev_nr]; cam->v4ldev->release = video_device_release; video_set_drvdata(cam->v4ldev, cam); - cam->v4ldev->parent = &cam->dev; + cam->v4ldev->dev = &cam->dev; err = video_register_device(cam->v4ldev, VFL_TYPE_GRABBER, video_nr[dev_nr]); diff --git a/trunk/drivers/media/video/w9968cf.h b/trunk/drivers/media/video/w9968cf.h index 30032e15e23c..3c95316bc030 100644 --- a/trunk/drivers/media/video/w9968cf.h +++ b/trunk/drivers/media/video/w9968cf.h @@ -21,7 +21,7 @@ #ifndef _W9968CF_H_ #define _W9968CF_H_ -#include +#include #include #include #include diff --git a/trunk/drivers/media/video/wm8739.c b/trunk/drivers/media/video/wm8739.c index 95c79ad80487..7be47a255853 100644 --- a/trunk/drivers/media/video/wm8739.c +++ b/trunk/drivers/media/video/wm8739.c @@ -27,7 +27,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/trunk/drivers/media/video/wm8775.c b/trunk/drivers/media/video/wm8775.c index 48df661d4fc3..c2ab70a04a74 100644 --- a/trunk/drivers/media/video/wm8775.c +++ b/trunk/drivers/media/video/wm8775.c @@ -31,7 +31,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/trunk/drivers/media/video/zc0301/zc0301.h b/trunk/drivers/media/video/zc0301/zc0301.h index b1b5cceb4baa..7bbab541a309 100644 --- a/trunk/drivers/media/video/zc0301/zc0301.h +++ b/trunk/drivers/media/video/zc0301/zc0301.h @@ -25,7 +25,6 @@ #include #include #include -#include #include #include #include diff --git a/trunk/drivers/media/video/zc0301/zc0301_core.c b/trunk/drivers/media/video/zc0301/zc0301_core.c index 550ce7bd5c87..e5c4e9f5193f 100644 --- a/trunk/drivers/media/video/zc0301/zc0301_core.c +++ b/trunk/drivers/media/video/zc0301/zc0301_core.c @@ -1985,6 +1985,8 @@ zc0301_usb_probe(struct usb_interface* intf, const struct usb_device_id* id) } strcpy(cam->v4ldev->name, "ZC0301[P] PC Camera"); + cam->v4ldev->owner = THIS_MODULE; + cam->v4ldev->type = VID_TYPE_CAPTURE | VID_TYPE_SCALES; cam->v4ldev->fops = &zc0301_fops; cam->v4ldev->minor = video_nr[dev_nr]; cam->v4ldev->release = video_device_release; diff --git a/trunk/drivers/media/video/zoran_card.c b/trunk/drivers/media/video/zoran_card.c index d842a7cb99d2..0929edb2d4f1 100644 --- a/trunk/drivers/media/video/zoran_card.c +++ b/trunk/drivers/media/video/zoran_card.c @@ -161,7 +161,7 @@ static struct pci_device_id zr36067_pci_tbl[] = { MODULE_DEVICE_TABLE(pci, zr36067_pci_tbl); int zoran_num; /* number of Buzs in use */ -struct zoran *zoran[BUZ_MAX]; +struct zoran zoran[BUZ_MAX]; /* videocodec bus functions ZR36060 */ static u32 @@ -355,15 +355,9 @@ i2cid_to_modulename (u16 i2c_id) case I2C_DRIVERID_BT856: name = "bt856"; break; - case I2C_DRIVERID_BT866: - name = "bt866"; - break; case I2C_DRIVERID_VPX3220: name = "vpx3220"; break; - case I2C_DRIVERID_KS0127: - name = "ks0127"; - break; } return name; @@ -1170,7 +1164,7 @@ static void zoran_release (struct zoran *zr) { if (!zr->initialized) - goto exit_free; + return; /* unregister videocodec bus */ if (zr->codec) { struct videocodec_master *master = zr->codec->master_data; @@ -1198,8 +1192,6 @@ zoran_release (struct zoran *zr) iounmap(zr->zr36057_mem); pci_disable_device(zr->pci_dev); video_unregister_device(zr->video_dev); -exit_free: - kfree(zr); } void @@ -1277,14 +1269,8 @@ find_zr36057 (void) while (zoran_num < BUZ_MAX && (dev = pci_get_device(PCI_VENDOR_ID_ZORAN, PCI_DEVICE_ID_ZORAN_36057, dev)) != NULL) { card_num = card[zoran_num]; - zr = kzalloc(sizeof(struct zoran), GFP_KERNEL); - if (!zr) { - dprintk(1, - KERN_ERR - "%s: find_zr36057() - kzalloc failed\n", - ZORAN_NAME); - continue; - } + zr = &zoran[zoran_num]; + memset(zr, 0, sizeof(struct zoran)); // Just in case if previous cycle failed zr->pci_dev = dev; //zr->zr36057_mem = NULL; zr->id = zoran_num; @@ -1292,7 +1278,7 @@ find_zr36057 (void) spin_lock_init(&zr->spinlock); mutex_init(&zr->resource_lock); if (pci_enable_device(dev)) - goto zr_free_mem; + continue; zr->zr36057_adr = pci_resource_start(zr->pci_dev, 0); pci_read_config_byte(zr->pci_dev, PCI_CLASS_REVISION, &zr->revision); @@ -1308,7 +1294,7 @@ find_zr36057 (void) KERN_ERR "%s: find_zr36057() - no card specified, please use the card=X insmod option\n", ZR_DEVNAME(zr)); - goto zr_free_mem; + continue; } } else { int i; @@ -1347,7 +1333,7 @@ find_zr36057 (void) KERN_ERR "%s: find_zr36057() - unknown card\n", ZR_DEVNAME(zr)); - goto zr_free_mem; + continue; } } } @@ -1357,7 +1343,7 @@ find_zr36057 (void) KERN_ERR "%s: find_zr36057() - invalid cardnum %d\n", ZR_DEVNAME(zr), card_num); - goto zr_free_mem; + continue; } /* even though we make this a non pointer and thus @@ -1375,7 +1361,7 @@ find_zr36057 (void) KERN_ERR "%s: find_zr36057() - ioremap failed\n", ZR_DEVNAME(zr)); - goto zr_free_mem; + continue; } result = request_irq(zr->pci_dev->irq, @@ -1544,7 +1530,7 @@ find_zr36057 (void) } /* Success so keep the pci_dev referenced */ pci_dev_get(zr->pci_dev); - zoran[zoran_num++] = zr; + zoran_num++; continue; // Init errors @@ -1563,8 +1549,6 @@ find_zr36057 (void) free_irq(zr->pci_dev->irq, zr); zr_unmap: iounmap(zr->zr36057_mem); - zr_free_mem: - kfree(zr); continue; } if (dev) /* Clean up ref count on early exit */ @@ -1636,7 +1620,7 @@ init_dc10_cards (void) /* take care of Natoma chipset and a revision 1 zr36057 */ for (i = 0; i < zoran_num; i++) { - struct zoran *zr = zoran[i]; + struct zoran *zr = &zoran[i]; if ((pci_pci_problems & PCIPCI_NATOMA) && zr->revision <= 1) { zr->jpg_buffers.need_contiguous = 1; @@ -1648,7 +1632,7 @@ init_dc10_cards (void) if (zr36057_init(zr) < 0) { for (i = 0; i < zoran_num; i++) - zoran_release(zoran[i]); + zoran_release(&zoran[i]); return -EIO; } zoran_proc_init(zr); @@ -1663,7 +1647,7 @@ unload_dc10_cards (void) int i; for (i = 0; i < zoran_num; i++) - zoran_release(zoran[i]); + zoran_release(&zoran[i]); } module_init(init_dc10_cards); diff --git a/trunk/drivers/media/video/zoran_card.h b/trunk/drivers/media/video/zoran_card.h index e4dc9d29b404..1b5c4171cf9c 100644 --- a/trunk/drivers/media/video/zoran_card.h +++ b/trunk/drivers/media/video/zoran_card.h @@ -41,7 +41,7 @@ extern int zr36067_debug; /* Anybody who uses more than four? */ #define BUZ_MAX 4 extern int zoran_num; -extern struct zoran *zoran[BUZ_MAX]; +extern struct zoran zoran[BUZ_MAX]; extern struct video_device zoran_template; diff --git a/trunk/drivers/media/video/zoran_driver.c b/trunk/drivers/media/video/zoran_driver.c index ec6f59674b10..c0675921fe20 100644 --- a/trunk/drivers/media/video/zoran_driver.c +++ b/trunk/drivers/media/video/zoran_driver.c @@ -71,7 +71,6 @@ #include #include -#include #include "videocodec.h" #include @@ -1213,8 +1212,8 @@ zoran_open (struct inode *inode, /* find the device */ for (i = 0; i < zoran_num; i++) { - if (zoran[i]->video_dev->minor == minor) { - zr = zoran[i]; + if (zoran[i].video_dev->minor == minor) { + zr = &zoran[i]; break; } } @@ -4644,6 +4643,8 @@ static const struct file_operations zoran_fops = { struct video_device zoran_template __devinitdata = { .name = ZORAN_NAME, + .type = ZORAN_VID_TYPE, + .type2 = ZORAN_V4L2_VID_FLAGS, .fops = &zoran_fops, .release = &zoran_vdev_release, .minor = -1 diff --git a/trunk/drivers/media/video/zr364xx.c b/trunk/drivers/media/video/zr364xx.c index 18d1c4ba79fb..485df2e36132 100644 --- a/trunk/drivers/media/video/zr364xx.c +++ b/trunk/drivers/media/video/zr364xx.c @@ -35,7 +35,6 @@ #include #include #include -#include /* Version Information */ @@ -762,7 +761,14 @@ static const struct file_operations zr364xx_fops = { .llseek = no_llseek, }; -static const struct v4l2_ioctl_ops zr364xx_ioctl_ops = { +static struct video_device zr364xx_template = { + .owner = THIS_MODULE, + .name = DRIVER_DESC, + .type = VID_TYPE_CAPTURE, + .fops = &zr364xx_fops, + .release = video_device_release, + .minor = -1, + .vidioc_querycap = zr364xx_vidioc_querycap, .vidioc_enum_fmt_vid_cap = zr364xx_vidioc_enum_fmt_vid_cap, .vidioc_try_fmt_vid_cap = zr364xx_vidioc_try_fmt_vid_cap, @@ -778,14 +784,6 @@ static const struct v4l2_ioctl_ops zr364xx_ioctl_ops = { .vidioc_s_ctrl = zr364xx_vidioc_s_ctrl, }; -static struct video_device zr364xx_template = { - .name = DRIVER_DESC, - .fops = &zr364xx_fops, - .ioctl_ops = &zr364xx_ioctl_ops, - .release = video_device_release, - .minor = -1, -}; - /*******************/ diff --git a/trunk/drivers/mfd/asic3.c b/trunk/drivers/mfd/asic3.c index c6408a62d95e..eabf0bfccab4 100644 --- a/trunk/drivers/mfd/asic3.c +++ b/trunk/drivers/mfd/asic3.c @@ -256,28 +256,28 @@ static int asic3_gpio_irq_type(unsigned int irq, unsigned int type) bank + ASIC3_GPIO_TRIGGER_TYPE); asic->irq_bothedge[(irq - asic->irq_base) >> 4] &= ~bit; - if (type == IRQ_TYPE_EDGE_RISING) { + if (type == IRQT_RISING) { trigger |= bit; edge |= bit; - } else if (type == IRQ_TYPE_EDGE_FALLING) { + } else if (type == IRQT_FALLING) { trigger |= bit; edge &= ~bit; - } else if (type == IRQ_TYPE_EDGE_BOTH) { + } else if (type == IRQT_BOTHEDGE) { trigger |= bit; if (asic3_gpio_get(&asic->gpio, irq - asic->irq_base)) edge &= ~bit; else edge |= bit; asic->irq_bothedge[(irq - asic->irq_base) >> 4] |= bit; - } else if (type == IRQ_TYPE_LEVEL_LOW) { + } else if (type == IRQT_LOW) { trigger &= ~bit; level &= ~bit; - } else if (type == IRQ_TYPE_LEVEL_HIGH) { + } else if (type == IRQT_HIGH) { trigger &= ~bit; level |= bit; } else { /* - * if type == IRQ_TYPE_NONE, we should mask interrupts, but + * if type == IRQT_NOEDGE, we should mask interrupts, but * be careful to not unmask them if mask was also called. * Probably need internal state for mask. */ @@ -343,7 +343,7 @@ static int __init asic3_irq_probe(struct platform_device *pdev) ASIC3_INTMASK_GINTMASK); set_irq_chained_handler(asic->irq_nr, asic3_irq_demux); - set_irq_type(asic->irq_nr, IRQ_TYPE_EDGE_RISING); + set_irq_type(asic->irq_nr, IRQT_RISING); set_irq_data(asic->irq_nr, asic); return 0; diff --git a/trunk/drivers/mfd/tc6393xb.c b/trunk/drivers/mfd/tc6393xb.c index 94e55e8e7ce6..2d87501b6fd4 100644 --- a/trunk/drivers/mfd/tc6393xb.c +++ b/trunk/drivers/mfd/tc6393xb.c @@ -324,7 +324,7 @@ static void tc6393xb_attach_irq(struct platform_device *dev) set_irq_flags(irq, IRQF_VALID | IRQF_PROBE); } - set_irq_type(tc6393xb->irq, IRQ_TYPE_EDGE_FALLING); + set_irq_type(tc6393xb->irq, IRQT_FALLING); set_irq_data(tc6393xb->irq, tc6393xb); set_irq_chained_handler(tc6393xb->irq, tc6393xb_irq); } diff --git a/trunk/drivers/pcmcia/soc_common.c b/trunk/drivers/pcmcia/soc_common.c index 8c21446996f2..420a77540f41 100644 --- a/trunk/drivers/pcmcia/soc_common.c +++ b/trunk/drivers/pcmcia/soc_common.c @@ -149,10 +149,10 @@ soc_common_pcmcia_config_skt(struct soc_pcmcia_socket *skt, socket_state_t *stat */ if (skt->irq_state != 1 && state->io_irq) { skt->irq_state = 1; - set_irq_type(skt->irq, IRQ_TYPE_EDGE_FALLING); + set_irq_type(skt->irq, IRQT_FALLING); } else if (skt->irq_state == 1 && state->io_irq == 0) { skt->irq_state = 0; - set_irq_type(skt->irq, IRQ_TYPE_NONE); + set_irq_type(skt->irq, IRQT_NOEDGE); } skt->cs_state = *state; @@ -527,7 +527,7 @@ int soc_pcmcia_request_irqs(struct soc_pcmcia_socket *skt, IRQF_DISABLED, irqs[i].str, skt); if (res) break; - set_irq_type(irqs[i].irq, IRQ_TYPE_NONE); + set_irq_type(irqs[i].irq, IRQT_NOEDGE); } if (res) { @@ -560,7 +560,7 @@ void soc_pcmcia_disable_irqs(struct soc_pcmcia_socket *skt, for (i = 0; i < nr; i++) if (irqs[i].sock == skt->nr) - set_irq_type(irqs[i].irq, IRQ_TYPE_NONE); + set_irq_type(irqs[i].irq, IRQT_NOEDGE); } EXPORT_SYMBOL(soc_pcmcia_disable_irqs); @@ -571,8 +571,8 @@ void soc_pcmcia_enable_irqs(struct soc_pcmcia_socket *skt, for (i = 0; i < nr; i++) if (irqs[i].sock == skt->nr) { - set_irq_type(irqs[i].irq, IRQ_TYPE_EDGE_RISING); - set_irq_type(irqs[i].irq, IRQ_TYPE_EDGE_BOTH); + set_irq_type(irqs[i].irq, IRQT_RISING); + set_irq_type(irqs[i].irq, IRQT_BOTHEDGE); } } EXPORT_SYMBOL(soc_pcmcia_enable_irqs); diff --git a/trunk/drivers/video/am200epd.c b/trunk/drivers/video/am200epd.c index 32dd85126931..51e26c1f5e8b 100644 --- a/trunk/drivers/video/am200epd.c +++ b/trunk/drivers/video/am200epd.c @@ -221,7 +221,7 @@ static int am200_setup_irq(struct fb_info *info) return retval; } - return set_irq_type(IRQ_GPIO(RDY_GPIO_PIN), IRQ_TYPE_EDGE_FALLING); + return set_irq_type(IRQ_GPIO(RDY_GPIO_PIN), IRQT_FALLING); } static void am200_set_rst(struct metronomefb_par *par, int state) diff --git a/trunk/drivers/video/omap/sossi.c b/trunk/drivers/video/omap/sossi.c index fafd0f26b90f..81dbcf53cf0e 100644 --- a/trunk/drivers/video/omap/sossi.c +++ b/trunk/drivers/video/omap/sossi.c @@ -646,7 +646,7 @@ static int sossi_init(struct omapfb_device *fbdev) sossi_write_reg(SOSSI_INIT1_REG, l); if ((r = request_irq(INT_1610_SoSSI_MATCH, sossi_match_irq, - IRQ_TYPE_EDGE_FALLING, + IRQT_FALLING, "sossi_match", sossi.fbdev->dev)) < 0) { dev_err(sossi.fbdev->dev, "can't get SoSSI match IRQ\n"); goto err; diff --git a/trunk/drivers/video/pxafb.c b/trunk/drivers/video/pxafb.c index 69de2fed6c58..2b707a8ce5de 100644 --- a/trunk/drivers/video/pxafb.c +++ b/trunk/drivers/video/pxafb.c @@ -1336,7 +1336,7 @@ static int __devinit pxafb_map_video_memory(struct pxafb_info *fbi) fbi->dma_buff_phys = fbi->map_dma; fbi->palette_cpu = (u16 *) fbi->dma_buff->palette; - pr_debug("pxafb: palette_mem_size = 0x%08x\n", fbi->palette_size*sizeof(u16)); + pr_debug("pxafb: palette_mem_size = 0x%08lx\n", fbi->palette_size*sizeof(u16)); #ifdef CONFIG_FB_PXA_SMARTPANEL fbi->smart_cmds = (uint16_t *) fbi->dma_buff->cmd_buff; diff --git a/trunk/fs/nfs/super.c b/trunk/fs/nfs/super.c index 9abcd2b329f7..1b94e3650f5c 100644 --- a/trunk/fs/nfs/super.c +++ b/trunk/fs/nfs/super.c @@ -1718,9 +1718,9 @@ nfs_remount(struct super_block *sb, int *flags, char *raw_data) * ones were explicitly specified. Fall back to legacy behavior and * just return success. */ - if ((nfsvers == 4 && (!options4 || options4->version == 1)) || - (nfsvers <= 3 && (!options || (options->version >= 1 && - options->version <= 6)))) + if ((nfsvers == 4 && options4->version == 1) || + (nfsvers <= 3 && options->version >= 1 && + options->version <= 6)) return 0; data = kzalloc(sizeof(*data), GFP_KERNEL); diff --git a/trunk/fs/nfs/unlink.c b/trunk/fs/nfs/unlink.c index f089e5839d7d..3adf8b266461 100644 --- a/trunk/fs/nfs/unlink.c +++ b/trunk/fs/nfs/unlink.c @@ -95,11 +95,10 @@ static void nfs_async_unlink_done(struct rpc_task *task, void *calldata) static void nfs_async_unlink_release(void *calldata) { struct nfs_unlinkdata *data = calldata; - struct super_block *sb = data->dir->i_sb; nfs_dec_sillycount(data->dir); + nfs_sb_deactive(NFS_SERVER(data->dir)); nfs_free_unlinkdata(data); - nfs_sb_deactive(NFS_SB(sb)); } static const struct rpc_call_ops nfs_unlink_ops = { diff --git a/trunk/fs/proc/base.c b/trunk/fs/proc/base.c index 01ed610f9b87..3d94906c7aa8 100644 --- a/trunk/fs/proc/base.c +++ b/trunk/fs/proc/base.c @@ -2403,7 +2403,7 @@ static int proc_base_fill_cache(struct file *filp, void *dirent, #ifdef CONFIG_TASK_IO_ACCOUNTING static int do_io_accounting(struct task_struct *task, char *buffer, int whole) { - struct task_io_accounting acct = task->ioac; + struct proc_io_accounting acct = task->ioac; unsigned long flags; if (whole && lock_task_sighand(task, &flags)) { @@ -2423,10 +2423,10 @@ static int do_io_accounting(struct task_struct *task, char *buffer, int whole) "read_bytes: %llu\n" "write_bytes: %llu\n" "cancelled_write_bytes: %llu\n", - acct.rchar, acct.wchar, - acct.syscr, acct.syscw, - acct.read_bytes, acct.write_bytes, - acct.cancelled_write_bytes); + acct.chr.rchar, acct.chr.wchar, + acct.chr.syscr, acct.chr.syscw, + acct.blk.read_bytes, acct.blk.write_bytes, + acct.blk.cancelled_write_bytes); } static int proc_tid_io_accounting(struct task_struct *task, char *buffer) diff --git a/trunk/include/asm-arm/arch-pnx4008/irqs.h b/trunk/include/asm-arm/arch-pnx4008/irqs.h index a25d18f2d87a..13ec7ed0f501 100644 --- a/trunk/include/asm-arm/arch-pnx4008/irqs.h +++ b/trunk/include/asm-arm/arch-pnx4008/irqs.h @@ -135,30 +135,30 @@ #define PNX4008_IRQ_TYPES \ { /*IRQ #'s: */ \ -IRQ_TYPE_LEVEL_LOW, IRQ_TYPE_LEVEL_LOW, IRQ_TYPE_LEVEL_LOW, IRQ_TYPE_LEVEL_HIGH, /* 0, 1, 2, 3 */ \ -IRQ_TYPE_LEVEL_LOW, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, /* 4, 5, 6, 7 */ \ -IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, /* 8, 9,10,11 */ \ -IRQ_TYPE_LEVEL_LOW, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, /* 12,13,14,15 */ \ -IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, /* 16,17,18,19 */ \ -IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, /* 20,21,22,23 */ \ -IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, /* 24,25,26,27 */ \ -IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_LOW, IRQ_TYPE_LEVEL_LOW, /* 28,29,30,31 */ \ -IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_LOW, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, /* 32,33,34,35 */ \ -IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_EDGE_FALLING, IRQ_TYPE_LEVEL_HIGH, /* 36,37,38,39 */ \ -IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, /* 40,41,42,43 */ \ -IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, /* 44,45,46,47 */ \ -IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_LOW, IRQ_TYPE_LEVEL_LOW, /* 48,49,50,51 */ \ -IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, /* 52,53,54,55 */ \ -IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_LOW, IRQ_TYPE_LEVEL_HIGH, /* 56,57,58,59 */ \ -IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, /* 60,61,62,63 */ \ -IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, /* 64,65,66,67 */ \ -IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, /* 68,69,70,71 */ \ -IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, /* 72,73,74,75 */ \ -IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, /* 76,77,78,79 */ \ -IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, /* 80,81,82,83 */ \ -IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, /* 84,85,86,87 */ \ -IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, /* 88,89,90,91 */ \ -IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, /* 92,93,94,95 */ \ +IRQT_LOW, IRQT_LOW, IRQT_LOW, IRQT_HIGH, /* 0, 1, 2, 3 */ \ +IRQT_LOW, IRQT_HIGH, IRQT_HIGH, IRQT_HIGH, /* 4, 5, 6, 7 */ \ +IRQT_HIGH, IRQT_HIGH, IRQT_HIGH, IRQT_HIGH, /* 8, 9,10,11 */ \ +IRQT_LOW, IRQT_HIGH, IRQT_HIGH, IRQT_HIGH, /* 12,13,14,15 */ \ +IRQT_HIGH, IRQT_HIGH, IRQT_HIGH, IRQT_HIGH, /* 16,17,18,19 */ \ +IRQT_HIGH, IRQT_HIGH, IRQT_HIGH, IRQT_HIGH, /* 20,21,22,23 */ \ +IRQT_HIGH, IRQT_HIGH, IRQT_HIGH, IRQT_HIGH, /* 24,25,26,27 */ \ +IRQT_HIGH, IRQT_HIGH, IRQT_LOW, IRQT_LOW, /* 28,29,30,31 */ \ +IRQT_HIGH, IRQT_LOW, IRQT_HIGH, IRQT_HIGH, /* 32,33,34,35 */ \ +IRQT_HIGH, IRQT_HIGH, IRQT_FALLING, IRQT_HIGH, /* 36,37,38,39 */ \ +IRQT_HIGH, IRQT_HIGH, IRQT_HIGH, IRQT_HIGH, /* 40,41,42,43 */ \ +IRQT_HIGH, IRQT_HIGH, IRQT_HIGH, IRQT_HIGH, /* 44,45,46,47 */ \ +IRQT_HIGH, IRQT_HIGH, IRQT_LOW, IRQT_LOW, /* 48,49,50,51 */ \ +IRQT_HIGH, IRQT_HIGH, IRQT_HIGH, IRQT_HIGH, /* 52,53,54,55 */ \ +IRQT_HIGH, IRQT_HIGH, IRQT_LOW, IRQT_HIGH, /* 56,57,58,59 */ \ +IRQT_HIGH, IRQT_HIGH, IRQT_HIGH, IRQT_HIGH, /* 60,61,62,63 */ \ +IRQT_HIGH, IRQT_HIGH, IRQT_HIGH, IRQT_HIGH, /* 64,65,66,67 */ \ +IRQT_HIGH, IRQT_HIGH, IRQT_HIGH, IRQT_HIGH, /* 68,69,70,71 */ \ +IRQT_HIGH, IRQT_HIGH, IRQT_HIGH, IRQT_HIGH, /* 72,73,74,75 */ \ +IRQT_HIGH, IRQT_HIGH, IRQT_HIGH, IRQT_HIGH, /* 76,77,78,79 */ \ +IRQT_HIGH, IRQT_HIGH, IRQT_HIGH, IRQT_HIGH, /* 80,81,82,83 */ \ +IRQT_HIGH, IRQT_HIGH, IRQT_HIGH, IRQT_HIGH, /* 84,85,86,87 */ \ +IRQT_HIGH, IRQT_HIGH, IRQT_HIGH, IRQT_HIGH, /* 88,89,90,91 */ \ +IRQT_HIGH, IRQT_HIGH, IRQT_HIGH, IRQT_HIGH, /* 92,93,94,95 */ \ } /* Start Enable Pin Interrupts - table 58 page 66 */ diff --git a/trunk/include/asm-arm/arch-pxa/idp.h b/trunk/include/asm-arm/arch-pxa/idp.h index 21aa8ac35c1c..b6952534a4e1 100644 --- a/trunk/include/asm-arm/arch-pxa/idp.h +++ b/trunk/include/asm-arm/arch-pxa/idp.h @@ -138,18 +138,18 @@ #define TOUCH_PANEL_IRQ IRQ_GPIO(5) #define IDE_IRQ IRQ_GPIO(21) -#define TOUCH_PANEL_IRQ_EDGE IRQ_TYPE_EDGE_FALLING +#define TOUCH_PANEL_IRQ_EDGE IRQT_FALLING #define ETHERNET_IRQ IRQ_GPIO(4) -#define ETHERNET_IRQ_EDGE IRQ_TYPE_EDGE_RISING +#define ETHERNET_IRQ_EDGE IRQT_RISING -#define IDE_IRQ_EDGE IRQ_TYPE_EDGE_RISING +#define IDE_IRQ_EDGE IRQT_RISING #define PCMCIA_S0_CD_VALID IRQ_GPIO(7) -#define PCMCIA_S0_CD_VALID_EDGE IRQ_TYPE_EDGE_BOTH +#define PCMCIA_S0_CD_VALID_EDGE IRQT_BOTHEDGE #define PCMCIA_S1_CD_VALID IRQ_GPIO(8) -#define PCMCIA_S1_CD_VALID_EDGE IRQ_TYPE_EDGE_BOTH +#define PCMCIA_S1_CD_VALID_EDGE IRQT_BOTHEDGE #define PCMCIA_S0_RDYINT IRQ_GPIO(19) #define PCMCIA_S1_RDYINT IRQ_GPIO(22) diff --git a/trunk/include/asm-arm/arch-pxa/pcm990_baseboard.h b/trunk/include/asm-arm/arch-pxa/pcm990_baseboard.h index 2e2013179063..b699d0d7bdb2 100644 --- a/trunk/include/asm-arm/arch-pxa/pcm990_baseboard.h +++ b/trunk/include/asm-arm/arch-pxa/pcm990_baseboard.h @@ -29,14 +29,14 @@ /* CPLD's interrupt controller is connected to PCM-027 GPIO 9 */ #define PCM990_CTRL_INT_IRQ_GPIO 9 #define PCM990_CTRL_INT_IRQ IRQ_GPIO(PCM990_CTRL_INT_IRQ_GPIO) -#define PCM990_CTRL_INT_IRQ_EDGE IRQ_TYPE_EDGE_RISING +#define PCM990_CTRL_INT_IRQ_EDGE IRQT_RISING #define PCM990_CTRL_PHYS PXA_CS1_PHYS /* 16-Bit */ #define PCM990_CTRL_BASE 0xea000000 #define PCM990_CTRL_SIZE (1*1024*1024) #define PCM990_CTRL_PWR_IRQ_GPIO 14 #define PCM990_CTRL_PWR_IRQ IRQ_GPIO(PCM990_CTRL_PWR_IRQ_GPIO) -#define PCM990_CTRL_PWR_IRQ_EDGE IRQ_TYPE_EDGE_RISING +#define PCM990_CTRL_PWR_IRQ_EDGE IRQT_RISING /* visible CPLD (U7) registers */ #define PCM990_CTRL_REG0 0x0000 /* RESET REGISTER */ @@ -133,7 +133,7 @@ */ #define PCM990_IDE_IRQ_GPIO 13 #define PCM990_IDE_IRQ IRQ_GPIO(PCM990_IDE_IRQ_GPIO) -#define PCM990_IDE_IRQ_EDGE IRQ_TYPE_EDGE_RISING +#define PCM990_IDE_IRQ_EDGE IRQT_RISING #define PCM990_IDE_PLD_PHYS 0x20000000 /* 16 bit wide */ #define PCM990_IDE_PLD_BASE 0xee000000 #define PCM990_IDE_PLD_SIZE (1*1024*1024) @@ -189,11 +189,11 @@ */ #define PCM990_CF_IRQ_GPIO 11 #define PCM990_CF_IRQ IRQ_GPIO(PCM990_CF_IRQ_GPIO) -#define PCM990_CF_IRQ_EDGE IRQ_TYPE_EDGE_RISING +#define PCM990_CF_IRQ_EDGE IRQT_RISING #define PCM990_CF_CD_GPIO 12 #define PCM990_CF_CD IRQ_GPIO(PCM990_CF_CD_GPIO) -#define PCM990_CF_CD_EDGE IRQ_TYPE_EDGE_RISING +#define PCM990_CF_CD_EDGE IRQT_RISING #define PCM990_CF_PLD_PHYS 0x30000000 /* 16 bit wide */ #define PCM990_CF_PLD_BASE 0xef000000 @@ -259,14 +259,14 @@ */ #define PCM990_AC97_IRQ_GPIO 10 #define PCM990_AC97_IRQ IRQ_GPIO(PCM990_AC97_IRQ_GPIO) -#define PCM990_AC97_IRQ_EDGE IRQ_TYPE_EDGE_RISING +#define PCM990_AC97_IRQ_EDGE IRQT_RISING /* * MMC phyCORE */ #define PCM990_MMC0_IRQ_GPIO 9 #define PCM990_MMC0_IRQ IRQ_GPIO(PCM990_MMC0_IRQ_GPIO) -#define PCM990_MMC0_IRQ_EDGE IRQ_TYPE_EDGE_FALLING +#define PCM990_MMC0_IRQ_EDGE IRQT_FALLING /* * USB phyCore diff --git a/trunk/include/asm-arm/arch-pxa/pxa25x-udc.h b/trunk/include/asm-arm/arch-pxa/pxa25x-udc.h index 1b80a4805a60..840305916b6d 100644 --- a/trunk/include/asm-arm/arch-pxa/pxa25x-udc.h +++ b/trunk/include/asm-arm/arch-pxa/pxa25x-udc.h @@ -2,7 +2,7 @@ #define _ASM_ARCH_PXA25X_UDC_H #ifdef _ASM_ARCH_PXA27X_UDC_H -#error "You can't include both PXA25x and PXA27x UDC support" +#error You can't include both PXA25x and PXA27x UDC support #endif #define UDC_RES1 __REG(0x40600004) /* UDC Undocumented - Reserved1 */ diff --git a/trunk/include/asm-arm/arch-sa1100/ide.h b/trunk/include/asm-arm/arch-sa1100/ide.h index 193f6c15f4dd..b14cbda01dc3 100644 --- a/trunk/include/asm-arm/arch-sa1100/ide.h +++ b/trunk/include/asm-arm/arch-sa1100/ide.h @@ -61,7 +61,7 @@ ide_init_default_hwifs(void) /* Enable GPIO as interrupt line */ GPDR &= ~LART_GPIO_IDE; - set_irq_type(LART_IRQ_IDE, IRQ_TYPE_EDGE_RISING); + set_irq_type(LART_IRQ_IDE, IRQT_RISING); /* set PCMCIA interface timing */ MECR = 0x00060006; diff --git a/trunk/include/asm-arm/bitops.h b/trunk/include/asm-arm/bitops.h index 9a1db20e032a..5c60bfc1a84d 100644 --- a/trunk/include/asm-arm/bitops.h +++ b/trunk/include/asm-arm/bitops.h @@ -277,16 +277,9 @@ static inline int constant_fls(int x) * the clz instruction for much better code efficiency. */ -#define __fls(x) \ +#define fls(x) \ ( __builtin_constant_p(x) ? constant_fls(x) : \ ({ int __r; asm("clz\t%0, %1" : "=r"(__r) : "r"(x) : "cc"); 32-__r; }) ) - -/* Implement fls() in C so that 64-bit args are suitably truncated */ -static inline int fls(int x) -{ - return __fls(x); -} - #define ffs(x) ({ unsigned long __t = (x); fls(__t & -__t); }) #define __ffs(x) (ffs(x) - 1) #define ffz(x) __ffs( ~(x) ) diff --git a/trunk/include/asm-arm/cacheflush.h b/trunk/include/asm-arm/cacheflush.h index e68a1cbcc852..03cf1ee977b7 100644 --- a/trunk/include/asm-arm/cacheflush.h +++ b/trunk/include/asm-arm/cacheflush.h @@ -459,19 +459,15 @@ static inline void flush_ioremap_region(unsigned long phys, void __iomem *virt, #define __cacheid_vivt_asid_tagged_instr(val) (__cacheid_type_v7(val) ? ((val & (3 << 14)) == (1 << 14)) : 0) #if defined(CONFIG_CPU_CACHE_VIVT) && !defined(CONFIG_CPU_CACHE_VIPT) -/* - * VIVT caches only - */ + #define cache_is_vivt() 1 #define cache_is_vipt() 0 #define cache_is_vipt_nonaliasing() 0 #define cache_is_vipt_aliasing() 0 #define icache_is_vivt_asid_tagged() 0 -#elif !defined(CONFIG_CPU_CACHE_VIVT) && defined(CONFIG_CPU_CACHE_VIPT) -/* - * VIPT caches only - */ +#elif defined(CONFIG_CPU_CACHE_VIPT) + #define cache_is_vivt() 0 #define cache_is_vipt() 1 #define cache_is_vipt_nonaliasing() \ @@ -493,12 +489,7 @@ static inline void flush_ioremap_region(unsigned long phys, void __iomem *virt, }) #else -/* - * VIVT or VIPT caches. Note that this is unreliable since ARM926 - * and V6 CPUs satisfy the "(val & (15 << 25)) == (14 << 25)" test. - * There's no way to tell from the CacheType register what type (!) - * the cache is. - */ + #define cache_is_vivt() \ ({ \ unsigned int __val = read_cpuid(CPUID_CACHETYPE); \ diff --git a/trunk/include/asm-arm/irq.h b/trunk/include/asm-arm/irq.h index 9cb01907e43b..1b882a255e35 100644 --- a/trunk/include/asm-arm/irq.h +++ b/trunk/include/asm-arm/irq.h @@ -19,6 +19,23 @@ #define NO_IRQ ((unsigned int)(-1)) #endif + +/* + * Migration helpers + */ +#define __IRQT_FALEDGE IRQ_TYPE_EDGE_FALLING +#define __IRQT_RISEDGE IRQ_TYPE_EDGE_RISING +#define __IRQT_LOWLVL IRQ_TYPE_LEVEL_LOW +#define __IRQT_HIGHLVL IRQ_TYPE_LEVEL_HIGH + +#define IRQT_NOEDGE (0) +#define IRQT_RISING (__IRQT_RISEDGE) +#define IRQT_FALLING (__IRQT_FALEDGE) +#define IRQT_BOTHEDGE (__IRQT_RISEDGE|__IRQT_FALEDGE) +#define IRQT_LOW (__IRQT_LOWLVL) +#define IRQT_HIGH (__IRQT_HIGHLVL) +#define IRQT_PROBE IRQ_TYPE_PROBE + #ifndef __ASSEMBLY__ struct irqaction; extern void migrate_irqs(void); diff --git a/trunk/include/asm-arm/pci.h b/trunk/include/asm-arm/pci.h index 2d84792f2e12..75feb1574a69 100644 --- a/trunk/include/asm-arm/pci.h +++ b/trunk/include/asm-arm/pci.h @@ -78,14 +78,6 @@ pcibios_select_root(struct pci_dev *pdev, struct resource *res) return root; } -/* - * Dummy implementation; always return 0. - */ -static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel) -{ - return 0; -} - #endif /* __KERNEL__ */ #endif diff --git a/trunk/include/asm-arm/plat-s3c/iic.h b/trunk/include/asm-arm/plat-s3c/iic.h index d08a1f2863e4..71211c8b5384 100644 --- a/trunk/include/asm-arm/plat-s3c/iic.h +++ b/trunk/include/asm-arm/plat-s3c/iic.h @@ -21,7 +21,6 @@ */ struct s3c2410_platform_i2c { - int bus_num; /* bus number to use */ unsigned int flags; unsigned int slave_addr; /* slave address for controller */ unsigned long bus_freq; /* standard bus frequency */ diff --git a/trunk/include/asm-sparc/Kbuild b/trunk/include/asm-sparc/Kbuild new file mode 100644 index 000000000000..6cdaf9d33b38 --- /dev/null +++ b/trunk/include/asm-sparc/Kbuild @@ -0,0 +1 @@ +# dummy file to avoid breaking make headers_install diff --git a/trunk/arch/sparc/include/asm/agp.h b/trunk/include/asm-sparc/agp.h similarity index 100% rename from trunk/arch/sparc/include/asm/agp.h rename to trunk/include/asm-sparc/agp.h diff --git a/trunk/arch/sparc/include/asm/apb.h b/trunk/include/asm-sparc/apb.h similarity index 100% rename from trunk/arch/sparc/include/asm/apb.h rename to trunk/include/asm-sparc/apb.h diff --git a/trunk/arch/sparc/include/asm/apc.h b/trunk/include/asm-sparc/apc.h similarity index 100% rename from trunk/arch/sparc/include/asm/apc.h rename to trunk/include/asm-sparc/apc.h diff --git a/trunk/arch/sparc/include/asm/asi.h b/trunk/include/asm-sparc/asi.h similarity index 100% rename from trunk/arch/sparc/include/asm/asi.h rename to trunk/include/asm-sparc/asi.h diff --git a/trunk/arch/sparc/include/asm/asmmacro.h b/trunk/include/asm-sparc/asmmacro.h similarity index 100% rename from trunk/arch/sparc/include/asm/asmmacro.h rename to trunk/include/asm-sparc/asmmacro.h diff --git a/trunk/arch/sparc/include/asm/atomic.h b/trunk/include/asm-sparc/atomic.h similarity index 65% rename from trunk/arch/sparc/include/asm/atomic.h rename to trunk/include/asm-sparc/atomic.h index 8ff83d8cc33f..66d8166ec1d7 100644 --- a/trunk/arch/sparc/include/asm/atomic.h +++ b/trunk/include/asm-sparc/atomic.h @@ -1,8 +1,8 @@ #ifndef ___ASM_SPARC_ATOMIC_H #define ___ASM_SPARC_ATOMIC_H #if defined(__sparc__) && defined(__arch64__) -#include +#include #else -#include +#include #endif #endif diff --git a/trunk/arch/sparc/include/asm/atomic_32.h b/trunk/include/asm-sparc/atomic_32.h similarity index 100% rename from trunk/arch/sparc/include/asm/atomic_32.h rename to trunk/include/asm-sparc/atomic_32.h diff --git a/trunk/arch/sparc/include/asm/atomic_64.h b/trunk/include/asm-sparc/atomic_64.h similarity index 100% rename from trunk/arch/sparc/include/asm/atomic_64.h rename to trunk/include/asm-sparc/atomic_64.h diff --git a/trunk/arch/sparc/include/asm/auxio.h b/trunk/include/asm-sparc/auxio.h similarity index 65% rename from trunk/arch/sparc/include/asm/auxio.h rename to trunk/include/asm-sparc/auxio.h index 13dc67f03011..24c6f3c0f577 100644 --- a/trunk/arch/sparc/include/asm/auxio.h +++ b/trunk/include/asm-sparc/auxio.h @@ -1,8 +1,8 @@ #ifndef ___ASM_SPARC_AUXIO_H #define ___ASM_SPARC_AUXIO_H #if defined(__sparc__) && defined(__arch64__) -#include +#include #else -#include +#include #endif #endif diff --git a/trunk/arch/sparc/include/asm/auxio_32.h b/trunk/include/asm-sparc/auxio_32.h similarity index 97% rename from trunk/arch/sparc/include/asm/auxio_32.h rename to trunk/include/asm-sparc/auxio_32.h index e03e088be95f..4db8f23db20f 100644 --- a/trunk/arch/sparc/include/asm/auxio_32.h +++ b/trunk/include/asm-sparc/auxio_32.h @@ -36,7 +36,7 @@ * understand the hardware you are querying! */ extern void set_auxio(unsigned char bits_on, unsigned char bits_off); -extern unsigned char get_auxio(void); /* .../asm/floppy.h */ +extern unsigned char get_auxio(void); /* .../asm-sparc/floppy.h */ /* * The following routines are provided for driver-compatibility diff --git a/trunk/arch/sparc/include/asm/auxio_64.h b/trunk/include/asm-sparc/auxio_64.h similarity index 100% rename from trunk/arch/sparc/include/asm/auxio_64.h rename to trunk/include/asm-sparc/auxio_64.h diff --git a/trunk/arch/sparc/include/asm/auxvec.h b/trunk/include/asm-sparc/auxvec.h similarity index 100% rename from trunk/arch/sparc/include/asm/auxvec.h rename to trunk/include/asm-sparc/auxvec.h diff --git a/trunk/arch/sparc/include/asm/backoff.h b/trunk/include/asm-sparc/backoff.h similarity index 100% rename from trunk/arch/sparc/include/asm/backoff.h rename to trunk/include/asm-sparc/backoff.h diff --git a/trunk/arch/sparc/include/asm/bbc.h b/trunk/include/asm-sparc/bbc.h similarity index 100% rename from trunk/arch/sparc/include/asm/bbc.h rename to trunk/include/asm-sparc/bbc.h diff --git a/trunk/arch/sparc/include/asm/bitext.h b/trunk/include/asm-sparc/bitext.h similarity index 100% rename from trunk/arch/sparc/include/asm/bitext.h rename to trunk/include/asm-sparc/bitext.h diff --git a/trunk/arch/sparc/include/asm/bitops.h b/trunk/include/asm-sparc/bitops.h similarity index 65% rename from trunk/arch/sparc/include/asm/bitops.h rename to trunk/include/asm-sparc/bitops.h index b1edd94bd64f..1a2949d0193f 100644 --- a/trunk/arch/sparc/include/asm/bitops.h +++ b/trunk/include/asm-sparc/bitops.h @@ -1,8 +1,8 @@ #ifndef ___ASM_SPARC_BITOPS_H #define ___ASM_SPARC_BITOPS_H #if defined(__sparc__) && defined(__arch64__) -#include +#include #else -#include +#include #endif #endif diff --git a/trunk/arch/sparc/include/asm/bitops_32.h b/trunk/include/asm-sparc/bitops_32.h similarity index 100% rename from trunk/arch/sparc/include/asm/bitops_32.h rename to trunk/include/asm-sparc/bitops_32.h diff --git a/trunk/arch/sparc/include/asm/bitops_64.h b/trunk/include/asm-sparc/bitops_64.h similarity index 100% rename from trunk/arch/sparc/include/asm/bitops_64.h rename to trunk/include/asm-sparc/bitops_64.h diff --git a/trunk/arch/sparc/include/asm/bpp.h b/trunk/include/asm-sparc/bpp.h similarity index 100% rename from trunk/arch/sparc/include/asm/bpp.h rename to trunk/include/asm-sparc/bpp.h diff --git a/trunk/arch/sparc/include/asm/btfixup.h b/trunk/include/asm-sparc/btfixup.h similarity index 99% rename from trunk/arch/sparc/include/asm/btfixup.h rename to trunk/include/asm-sparc/btfixup.h index 797722cf69f2..08277e6fb4cd 100644 --- a/trunk/arch/sparc/include/asm/btfixup.h +++ b/trunk/include/asm-sparc/btfixup.h @@ -1,5 +1,5 @@ /* - * asm/btfixup.h: Macros for boot time linking. + * asm-sparc/btfixup.h: Macros for boot time linking. * * Copyright (C) 1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz) */ diff --git a/trunk/arch/sparc/include/asm/bug.h b/trunk/include/asm-sparc/bug.h similarity index 100% rename from trunk/arch/sparc/include/asm/bug.h rename to trunk/include/asm-sparc/bug.h diff --git a/trunk/arch/sparc/include/asm/bugs.h b/trunk/include/asm-sparc/bugs.h similarity index 87% rename from trunk/arch/sparc/include/asm/bugs.h rename to trunk/include/asm-sparc/bugs.h index e179bc12f64a..2dfc07bc8e54 100644 --- a/trunk/arch/sparc/include/asm/bugs.h +++ b/trunk/include/asm-sparc/bugs.h @@ -1,4 +1,4 @@ -/* include/asm/bugs.h: Sparc probes for various bugs. +/* include/asm-sparc/bugs.h: Sparc probes for various bugs. * * Copyright (C) 1996, 2007 David S. Miller (davem@davemloft.net) */ diff --git a/trunk/arch/sparc/include/asm/byteorder.h b/trunk/include/asm-sparc/byteorder.h similarity index 100% rename from trunk/arch/sparc/include/asm/byteorder.h rename to trunk/include/asm-sparc/byteorder.h diff --git a/trunk/arch/sparc/include/asm/cache.h b/trunk/include/asm-sparc/cache.h similarity index 100% rename from trunk/arch/sparc/include/asm/cache.h rename to trunk/include/asm-sparc/cache.h diff --git a/trunk/arch/sparc/include/asm/cacheflush.h b/trunk/include/asm-sparc/cacheflush.h similarity index 64% rename from trunk/arch/sparc/include/asm/cacheflush.h rename to trunk/include/asm-sparc/cacheflush.h index 049168087b19..2b6a37957c2d 100644 --- a/trunk/arch/sparc/include/asm/cacheflush.h +++ b/trunk/include/asm-sparc/cacheflush.h @@ -1,8 +1,8 @@ #ifndef ___ASM_SPARC_CACHEFLUSH_H #define ___ASM_SPARC_CACHEFLUSH_H #if defined(__sparc__) && defined(__arch64__) -#include +#include #else -#include +#include #endif #endif diff --git a/trunk/arch/sparc/include/asm/cacheflush_32.h b/trunk/include/asm-sparc/cacheflush_32.h similarity index 100% rename from trunk/arch/sparc/include/asm/cacheflush_32.h rename to trunk/include/asm-sparc/cacheflush_32.h diff --git a/trunk/arch/sparc/include/asm/cacheflush_64.h b/trunk/include/asm-sparc/cacheflush_64.h similarity index 100% rename from trunk/arch/sparc/include/asm/cacheflush_64.h rename to trunk/include/asm-sparc/cacheflush_64.h diff --git a/trunk/arch/sparc/include/asm/chafsr.h b/trunk/include/asm-sparc/chafsr.h similarity index 100% rename from trunk/arch/sparc/include/asm/chafsr.h rename to trunk/include/asm-sparc/chafsr.h diff --git a/trunk/arch/sparc/include/asm/checksum.h b/trunk/include/asm-sparc/checksum.h similarity index 65% rename from trunk/arch/sparc/include/asm/checksum.h rename to trunk/include/asm-sparc/checksum.h index 7ac0d7497bc5..4e3553d4f6e1 100644 --- a/trunk/arch/sparc/include/asm/checksum.h +++ b/trunk/include/asm-sparc/checksum.h @@ -1,8 +1,8 @@ #ifndef ___ASM_SPARC_CHECKSUM_H #define ___ASM_SPARC_CHECKSUM_H #if defined(__sparc__) && defined(__arch64__) -#include +#include #else -#include +#include #endif #endif diff --git a/trunk/arch/sparc/include/asm/checksum_32.h b/trunk/include/asm-sparc/checksum_32.h similarity index 100% rename from trunk/arch/sparc/include/asm/checksum_32.h rename to trunk/include/asm-sparc/checksum_32.h diff --git a/trunk/arch/sparc/include/asm/checksum_64.h b/trunk/include/asm-sparc/checksum_64.h similarity index 100% rename from trunk/arch/sparc/include/asm/checksum_64.h rename to trunk/include/asm-sparc/checksum_64.h diff --git a/trunk/arch/sparc/include/asm/chmctrl.h b/trunk/include/asm-sparc/chmctrl.h similarity index 100% rename from trunk/arch/sparc/include/asm/chmctrl.h rename to trunk/include/asm-sparc/chmctrl.h diff --git a/trunk/arch/sparc/include/asm/clock.h b/trunk/include/asm-sparc/clock.h similarity index 100% rename from trunk/arch/sparc/include/asm/clock.h rename to trunk/include/asm-sparc/clock.h diff --git a/trunk/arch/sparc/include/asm/cmt.h b/trunk/include/asm-sparc/cmt.h similarity index 100% rename from trunk/arch/sparc/include/asm/cmt.h rename to trunk/include/asm-sparc/cmt.h diff --git a/trunk/arch/sparc/include/asm/compat.h b/trunk/include/asm-sparc/compat.h similarity index 100% rename from trunk/arch/sparc/include/asm/compat.h rename to trunk/include/asm-sparc/compat.h diff --git a/trunk/arch/sparc/include/asm/compat_signal.h b/trunk/include/asm-sparc/compat_signal.h similarity index 100% rename from trunk/arch/sparc/include/asm/compat_signal.h rename to trunk/include/asm-sparc/compat_signal.h diff --git a/trunk/arch/sparc/include/asm/contregs.h b/trunk/include/asm-sparc/contregs.h similarity index 100% rename from trunk/arch/sparc/include/asm/contregs.h rename to trunk/include/asm-sparc/contregs.h diff --git a/trunk/arch/sparc/include/asm/cpudata.h b/trunk/include/asm-sparc/cpudata.h similarity index 65% rename from trunk/arch/sparc/include/asm/cpudata.h rename to trunk/include/asm-sparc/cpudata.h index b5976de7cacd..b76fac0c8d8f 100644 --- a/trunk/arch/sparc/include/asm/cpudata.h +++ b/trunk/include/asm-sparc/cpudata.h @@ -1,8 +1,8 @@ #ifndef ___ASM_SPARC_CPUDATA_H #define ___ASM_SPARC_CPUDATA_H #if defined(__sparc__) && defined(__arch64__) -#include +#include #else -#include +#include #endif #endif diff --git a/trunk/arch/sparc/include/asm/cpudata_32.h b/trunk/include/asm-sparc/cpudata_32.h similarity index 89% rename from trunk/arch/sparc/include/asm/cpudata_32.h rename to trunk/include/asm-sparc/cpudata_32.h index 31d48a0e32c7..a2c4d51d36c4 100644 --- a/trunk/arch/sparc/include/asm/cpudata_32.h +++ b/trunk/include/asm-sparc/cpudata_32.h @@ -2,7 +2,7 @@ * * Copyright (C) 2004 Keith M Wesolowski (wesolows@foobazco.org) * - * Based on include/asm/cpudata.h and Linux 2.4 smp.h + * Based on include/asm-sparc64/cpudata.h and Linux 2.4 smp.h * both (C) David S. Miller. */ diff --git a/trunk/arch/sparc/include/asm/cpudata_64.h b/trunk/include/asm-sparc/cpudata_64.h similarity index 100% rename from trunk/arch/sparc/include/asm/cpudata_64.h rename to trunk/include/asm-sparc/cpudata_64.h diff --git a/trunk/arch/sparc/include/asm/cputime.h b/trunk/include/asm-sparc/cputime.h similarity index 100% rename from trunk/arch/sparc/include/asm/cputime.h rename to trunk/include/asm-sparc/cputime.h diff --git a/trunk/arch/sparc/include/asm/current.h b/trunk/include/asm-sparc/current.h similarity index 96% rename from trunk/arch/sparc/include/asm/current.h rename to trunk/include/asm-sparc/current.h index 10a0df55a574..8a1d9d6643b0 100644 --- a/trunk/arch/sparc/include/asm/current.h +++ b/trunk/include/asm-sparc/current.h @@ -1,4 +1,4 @@ -/* include/asm/current.h +/* include/asm-sparc/current.h * * Copyright (C) 1999 IBM Deutschland Entwicklung GmbH, IBM Corporation * Copyright (C) 2002 Pete Zaitcev (zaitcev@yahoo.com) diff --git a/trunk/arch/sparc/include/asm/cypress.h b/trunk/include/asm-sparc/cypress.h similarity index 100% rename from trunk/arch/sparc/include/asm/cypress.h rename to trunk/include/asm-sparc/cypress.h diff --git a/trunk/arch/sparc/include/asm/dcr.h b/trunk/include/asm-sparc/dcr.h similarity index 100% rename from trunk/arch/sparc/include/asm/dcr.h rename to trunk/include/asm-sparc/dcr.h diff --git a/trunk/arch/sparc/include/asm/dcu.h b/trunk/include/asm-sparc/dcu.h similarity index 100% rename from trunk/arch/sparc/include/asm/dcu.h rename to trunk/include/asm-sparc/dcu.h diff --git a/trunk/arch/sparc/include/asm/delay.h b/trunk/include/asm-sparc/delay.h similarity index 65% rename from trunk/arch/sparc/include/asm/delay.h rename to trunk/include/asm-sparc/delay.h index 467caa2a97a0..6210a3ce9751 100644 --- a/trunk/arch/sparc/include/asm/delay.h +++ b/trunk/include/asm-sparc/delay.h @@ -1,8 +1,8 @@ #ifndef ___ASM_SPARC_DELAY_H #define ___ASM_SPARC_DELAY_H #if defined(__sparc__) && defined(__arch64__) -#include +#include #else -#include +#include #endif #endif diff --git a/trunk/arch/sparc/include/asm/delay_32.h b/trunk/include/asm-sparc/delay_32.h similarity index 100% rename from trunk/arch/sparc/include/asm/delay_32.h rename to trunk/include/asm-sparc/delay_32.h diff --git a/trunk/arch/sparc/include/asm/delay_64.h b/trunk/include/asm-sparc/delay_64.h similarity index 100% rename from trunk/arch/sparc/include/asm/delay_64.h rename to trunk/include/asm-sparc/delay_64.h diff --git a/trunk/arch/sparc/include/asm/device.h b/trunk/include/asm-sparc/device.h similarity index 100% rename from trunk/arch/sparc/include/asm/device.h rename to trunk/include/asm-sparc/device.h diff --git a/trunk/arch/sparc/include/asm/display7seg.h b/trunk/include/asm-sparc/display7seg.h similarity index 100% rename from trunk/arch/sparc/include/asm/display7seg.h rename to trunk/include/asm-sparc/display7seg.h diff --git a/trunk/arch/sparc/include/asm/div64.h b/trunk/include/asm-sparc/div64.h similarity index 100% rename from trunk/arch/sparc/include/asm/div64.h rename to trunk/include/asm-sparc/div64.h diff --git a/trunk/arch/sparc/include/asm/dma-mapping.h b/trunk/include/asm-sparc/dma-mapping.h similarity index 64% rename from trunk/arch/sparc/include/asm/dma-mapping.h rename to trunk/include/asm-sparc/dma-mapping.h index 0f4150e26619..7483504259ce 100644 --- a/trunk/arch/sparc/include/asm/dma-mapping.h +++ b/trunk/include/asm-sparc/dma-mapping.h @@ -1,8 +1,8 @@ #ifndef ___ASM_SPARC_DMA_MAPPING_H #define ___ASM_SPARC_DMA_MAPPING_H #if defined(__sparc__) && defined(__arch64__) -#include +#include #else -#include +#include #endif #endif diff --git a/trunk/arch/sparc/include/asm/dma-mapping_32.h b/trunk/include/asm-sparc/dma-mapping_32.h similarity index 100% rename from trunk/arch/sparc/include/asm/dma-mapping_32.h rename to trunk/include/asm-sparc/dma-mapping_32.h diff --git a/trunk/arch/sparc/include/asm/dma-mapping_64.h b/trunk/include/asm-sparc/dma-mapping_64.h similarity index 100% rename from trunk/arch/sparc/include/asm/dma-mapping_64.h rename to trunk/include/asm-sparc/dma-mapping_64.h diff --git a/trunk/arch/sparc/include/asm/dma.h b/trunk/include/asm-sparc/dma.h similarity index 66% rename from trunk/arch/sparc/include/asm/dma.h rename to trunk/include/asm-sparc/dma.h index aa1d90ac04c5..8cc69bfaae2a 100644 --- a/trunk/arch/sparc/include/asm/dma.h +++ b/trunk/include/asm-sparc/dma.h @@ -1,8 +1,8 @@ #ifndef ___ASM_SPARC_DMA_H #define ___ASM_SPARC_DMA_H #if defined(__sparc__) && defined(__arch64__) -#include +#include #else -#include +#include #endif #endif diff --git a/trunk/arch/sparc/include/asm/dma_32.h b/trunk/include/asm-sparc/dma_32.h similarity index 99% rename from trunk/arch/sparc/include/asm/dma_32.h rename to trunk/include/asm-sparc/dma_32.h index cf7189c0079b..959d6c8a71ae 100644 --- a/trunk/arch/sparc/include/asm/dma_32.h +++ b/trunk/include/asm-sparc/dma_32.h @@ -1,4 +1,4 @@ -/* include/asm/dma.h +/* include/asm-sparc/dma.h * * Copyright 1995 (C) David S. Miller (davem@davemloft.net) */ diff --git a/trunk/arch/sparc/include/asm/dma_64.h b/trunk/include/asm-sparc/dma_64.h similarity index 99% rename from trunk/arch/sparc/include/asm/dma_64.h rename to trunk/include/asm-sparc/dma_64.h index 46a8aecffc02..9d4c024bd3b3 100644 --- a/trunk/arch/sparc/include/asm/dma_64.h +++ b/trunk/include/asm-sparc/dma_64.h @@ -1,5 +1,5 @@ /* - * include/asm/dma.h + * include/asm-sparc64/dma.h * * Copyright 1996 (C) David S. Miller (davem@caip.rutgers.edu) */ diff --git a/trunk/arch/sparc/include/asm/ebus.h b/trunk/include/asm-sparc/ebus.h similarity index 66% rename from trunk/arch/sparc/include/asm/ebus.h rename to trunk/include/asm-sparc/ebus.h index 83a6d16c22e6..a5da2d00cd18 100644 --- a/trunk/arch/sparc/include/asm/ebus.h +++ b/trunk/include/asm-sparc/ebus.h @@ -1,8 +1,8 @@ #ifndef ___ASM_SPARC_EBUS_H #define ___ASM_SPARC_EBUS_H #if defined(__sparc__) && defined(__arch64__) -#include +#include #else -#include +#include #endif #endif diff --git a/trunk/arch/sparc/include/asm/ebus_32.h b/trunk/include/asm-sparc/ebus_32.h similarity index 100% rename from trunk/arch/sparc/include/asm/ebus_32.h rename to trunk/include/asm-sparc/ebus_32.h diff --git a/trunk/arch/sparc/include/asm/ebus_64.h b/trunk/include/asm-sparc/ebus_64.h similarity index 100% rename from trunk/arch/sparc/include/asm/ebus_64.h rename to trunk/include/asm-sparc/ebus_64.h diff --git a/trunk/arch/sparc/include/asm/ecc.h b/trunk/include/asm-sparc/ecc.h similarity index 100% rename from trunk/arch/sparc/include/asm/ecc.h rename to trunk/include/asm-sparc/ecc.h diff --git a/trunk/arch/sparc/include/asm/eeprom.h b/trunk/include/asm-sparc/eeprom.h similarity index 100% rename from trunk/arch/sparc/include/asm/eeprom.h rename to trunk/include/asm-sparc/eeprom.h diff --git a/trunk/arch/sparc/include/asm/elf.h b/trunk/include/asm-sparc/elf.h similarity index 66% rename from trunk/arch/sparc/include/asm/elf.h rename to trunk/include/asm-sparc/elf.h index 0a2816c50b07..f035c45d7b5e 100644 --- a/trunk/arch/sparc/include/asm/elf.h +++ b/trunk/include/asm-sparc/elf.h @@ -1,8 +1,8 @@ #ifndef ___ASM_SPARC_ELF_H #define ___ASM_SPARC_ELF_H #if defined(__sparc__) && defined(__arch64__) -#include +#include #else -#include +#include #endif #endif diff --git a/trunk/arch/sparc/include/asm/elf_32.h b/trunk/include/asm-sparc/elf_32.h similarity index 100% rename from trunk/arch/sparc/include/asm/elf_32.h rename to trunk/include/asm-sparc/elf_32.h diff --git a/trunk/arch/sparc/include/asm/elf_64.h b/trunk/include/asm-sparc/elf_64.h similarity index 100% rename from trunk/arch/sparc/include/asm/elf_64.h rename to trunk/include/asm-sparc/elf_64.h diff --git a/trunk/arch/sparc/include/asm/emergency-restart.h b/trunk/include/asm-sparc/emergency-restart.h similarity index 100% rename from trunk/arch/sparc/include/asm/emergency-restart.h rename to trunk/include/asm-sparc/emergency-restart.h diff --git a/trunk/arch/sparc/include/asm/envctrl.h b/trunk/include/asm-sparc/envctrl.h similarity index 100% rename from trunk/arch/sparc/include/asm/envctrl.h rename to trunk/include/asm-sparc/envctrl.h diff --git a/trunk/arch/sparc/include/asm/errno.h b/trunk/include/asm-sparc/errno.h similarity index 100% rename from trunk/arch/sparc/include/asm/errno.h rename to trunk/include/asm-sparc/errno.h diff --git a/trunk/arch/sparc/include/asm/estate.h b/trunk/include/asm-sparc/estate.h similarity index 100% rename from trunk/arch/sparc/include/asm/estate.h rename to trunk/include/asm-sparc/estate.h diff --git a/trunk/arch/sparc/include/asm/fb.h b/trunk/include/asm-sparc/fb.h similarity index 100% rename from trunk/arch/sparc/include/asm/fb.h rename to trunk/include/asm-sparc/fb.h diff --git a/trunk/arch/sparc/include/asm/fbio.h b/trunk/include/asm-sparc/fbio.h similarity index 100% rename from trunk/arch/sparc/include/asm/fbio.h rename to trunk/include/asm-sparc/fbio.h diff --git a/trunk/arch/sparc/include/asm/fcntl.h b/trunk/include/asm-sparc/fcntl.h similarity index 100% rename from trunk/arch/sparc/include/asm/fcntl.h rename to trunk/include/asm-sparc/fcntl.h diff --git a/trunk/arch/sparc/include/asm/fhc.h b/trunk/include/asm-sparc/fhc.h similarity index 100% rename from trunk/arch/sparc/include/asm/fhc.h rename to trunk/include/asm-sparc/fhc.h diff --git a/trunk/arch/sparc/include/asm/fixmap.h b/trunk/include/asm-sparc/fixmap.h similarity index 100% rename from trunk/arch/sparc/include/asm/fixmap.h rename to trunk/include/asm-sparc/fixmap.h diff --git a/trunk/arch/sparc/include/asm/floppy.h b/trunk/include/asm-sparc/floppy.h similarity index 65% rename from trunk/arch/sparc/include/asm/floppy.h rename to trunk/include/asm-sparc/floppy.h index faebd335b600..6c628ba15a8d 100644 --- a/trunk/arch/sparc/include/asm/floppy.h +++ b/trunk/include/asm-sparc/floppy.h @@ -1,8 +1,8 @@ #ifndef ___ASM_SPARC_FLOPPY_H #define ___ASM_SPARC_FLOPPY_H #if defined(__sparc__) && defined(__arch64__) -#include +#include #else -#include +#include #endif #endif diff --git a/trunk/arch/sparc/include/asm/floppy_32.h b/trunk/include/asm-sparc/floppy_32.h similarity index 99% rename from trunk/arch/sparc/include/asm/floppy_32.h rename to trunk/include/asm-sparc/floppy_32.h index ae3f00bf22ff..acdd06eafe59 100644 --- a/trunk/arch/sparc/include/asm/floppy_32.h +++ b/trunk/include/asm-sparc/floppy_32.h @@ -1,4 +1,4 @@ -/* asm/floppy.h: Sparc specific parts of the Floppy driver. +/* asm-sparc/floppy.h: Sparc specific parts of the Floppy driver. * * Copyright (C) 1995 David S. Miller (davem@davemloft.net) */ diff --git a/trunk/arch/sparc/include/asm/floppy_64.h b/trunk/include/asm-sparc/floppy_64.h similarity index 100% rename from trunk/arch/sparc/include/asm/floppy_64.h rename to trunk/include/asm-sparc/floppy_64.h diff --git a/trunk/arch/sparc/include/asm/fpumacro.h b/trunk/include/asm-sparc/fpumacro.h similarity index 100% rename from trunk/arch/sparc/include/asm/fpumacro.h rename to trunk/include/asm-sparc/fpumacro.h diff --git a/trunk/arch/sparc/include/asm/futex.h b/trunk/include/asm-sparc/futex.h similarity index 65% rename from trunk/arch/sparc/include/asm/futex.h rename to trunk/include/asm-sparc/futex.h index 736335f36713..c6a9f038c531 100644 --- a/trunk/arch/sparc/include/asm/futex.h +++ b/trunk/include/asm-sparc/futex.h @@ -1,8 +1,8 @@ #ifndef ___ASM_SPARC_FUTEX_H #define ___ASM_SPARC_FUTEX_H #if defined(__sparc__) && defined(__arch64__) -#include +#include #else -#include +#include #endif #endif diff --git a/trunk/arch/sparc/include/asm/futex_32.h b/trunk/include/asm-sparc/futex_32.h similarity index 100% rename from trunk/arch/sparc/include/asm/futex_32.h rename to trunk/include/asm-sparc/futex_32.h diff --git a/trunk/arch/sparc/include/asm/futex_64.h b/trunk/include/asm-sparc/futex_64.h similarity index 100% rename from trunk/arch/sparc/include/asm/futex_64.h rename to trunk/include/asm-sparc/futex_64.h diff --git a/trunk/arch/sparc/include/asm/hardirq.h b/trunk/include/asm-sparc/hardirq.h similarity index 65% rename from trunk/arch/sparc/include/asm/hardirq.h rename to trunk/include/asm-sparc/hardirq.h index 44d4e2345148..156478773100 100644 --- a/trunk/arch/sparc/include/asm/hardirq.h +++ b/trunk/include/asm-sparc/hardirq.h @@ -1,8 +1,8 @@ #ifndef ___ASM_SPARC_HARDIRQ_H #define ___ASM_SPARC_HARDIRQ_H #if defined(__sparc__) && defined(__arch64__) -#include +#include #else -#include +#include #endif #endif diff --git a/trunk/arch/sparc/include/asm/hardirq_32.h b/trunk/include/asm-sparc/hardirq_32.h similarity index 100% rename from trunk/arch/sparc/include/asm/hardirq_32.h rename to trunk/include/asm-sparc/hardirq_32.h diff --git a/trunk/arch/sparc/include/asm/hardirq_64.h b/trunk/include/asm-sparc/hardirq_64.h similarity index 100% rename from trunk/arch/sparc/include/asm/hardirq_64.h rename to trunk/include/asm-sparc/hardirq_64.h diff --git a/trunk/arch/sparc/include/asm/head.h b/trunk/include/asm-sparc/head.h similarity index 66% rename from trunk/arch/sparc/include/asm/head.h rename to trunk/include/asm-sparc/head.h index be8f03f3e731..14652abdea31 100644 --- a/trunk/arch/sparc/include/asm/head.h +++ b/trunk/include/asm-sparc/head.h @@ -1,8 +1,8 @@ #ifndef ___ASM_SPARC_HEAD_H #define ___ASM_SPARC_HEAD_H #if defined(__sparc__) && defined(__arch64__) -#include +#include #else -#include +#include #endif #endif diff --git a/trunk/arch/sparc/include/asm/head_32.h b/trunk/include/asm-sparc/head_32.h similarity index 100% rename from trunk/arch/sparc/include/asm/head_32.h rename to trunk/include/asm-sparc/head_32.h diff --git a/trunk/arch/sparc/include/asm/head_64.h b/trunk/include/asm-sparc/head_64.h similarity index 100% rename from trunk/arch/sparc/include/asm/head_64.h rename to trunk/include/asm-sparc/head_64.h diff --git a/trunk/arch/sparc/include/asm/highmem.h b/trunk/include/asm-sparc/highmem.h similarity index 100% rename from trunk/arch/sparc/include/asm/highmem.h rename to trunk/include/asm-sparc/highmem.h diff --git a/trunk/arch/sparc/include/asm/hugetlb.h b/trunk/include/asm-sparc/hugetlb.h similarity index 100% rename from trunk/arch/sparc/include/asm/hugetlb.h rename to trunk/include/asm-sparc/hugetlb.h diff --git a/trunk/arch/sparc/include/asm/hvtramp.h b/trunk/include/asm-sparc/hvtramp.h similarity index 100% rename from trunk/arch/sparc/include/asm/hvtramp.h rename to trunk/include/asm-sparc/hvtramp.h diff --git a/trunk/arch/sparc/include/asm/hw_irq.h b/trunk/include/asm-sparc/hw_irq.h similarity index 100% rename from trunk/arch/sparc/include/asm/hw_irq.h rename to trunk/include/asm-sparc/hw_irq.h diff --git a/trunk/arch/sparc/include/asm/hypervisor.h b/trunk/include/asm-sparc/hypervisor.h similarity index 100% rename from trunk/arch/sparc/include/asm/hypervisor.h rename to trunk/include/asm-sparc/hypervisor.h diff --git a/trunk/arch/sparc/include/asm/ide.h b/trunk/include/asm-sparc/ide.h similarity index 100% rename from trunk/arch/sparc/include/asm/ide.h rename to trunk/include/asm-sparc/ide.h diff --git a/trunk/arch/sparc/include/asm/idprom.h b/trunk/include/asm-sparc/idprom.h similarity index 100% rename from trunk/arch/sparc/include/asm/idprom.h rename to trunk/include/asm-sparc/idprom.h diff --git a/trunk/arch/sparc/include/asm/intr_queue.h b/trunk/include/asm-sparc/intr_queue.h similarity index 100% rename from trunk/arch/sparc/include/asm/intr_queue.h rename to trunk/include/asm-sparc/intr_queue.h diff --git a/trunk/arch/sparc/include/asm/io-unit.h b/trunk/include/asm-sparc/io-unit.h similarity index 100% rename from trunk/arch/sparc/include/asm/io-unit.h rename to trunk/include/asm-sparc/io-unit.h diff --git a/trunk/arch/sparc/include/asm/io.h b/trunk/include/asm-sparc/io.h similarity index 67% rename from trunk/arch/sparc/include/asm/io.h rename to trunk/include/asm-sparc/io.h index a34b2994937a..fc9024d3dfc3 100644 --- a/trunk/arch/sparc/include/asm/io.h +++ b/trunk/include/asm-sparc/io.h @@ -1,8 +1,8 @@ #ifndef ___ASM_SPARC_IO_H #define ___ASM_SPARC_IO_H #if defined(__sparc__) && defined(__arch64__) -#include +#include #else -#include +#include #endif #endif diff --git a/trunk/arch/sparc/include/asm/io_32.h b/trunk/include/asm-sparc/io_32.h similarity index 100% rename from trunk/arch/sparc/include/asm/io_32.h rename to trunk/include/asm-sparc/io_32.h diff --git a/trunk/arch/sparc/include/asm/io_64.h b/trunk/include/asm-sparc/io_64.h similarity index 100% rename from trunk/arch/sparc/include/asm/io_64.h rename to trunk/include/asm-sparc/io_64.h diff --git a/trunk/arch/sparc/include/asm/ioctl.h b/trunk/include/asm-sparc/ioctl.h similarity index 100% rename from trunk/arch/sparc/include/asm/ioctl.h rename to trunk/include/asm-sparc/ioctl.h diff --git a/trunk/arch/sparc/include/asm/ioctls.h b/trunk/include/asm-sparc/ioctls.h similarity index 100% rename from trunk/arch/sparc/include/asm/ioctls.h rename to trunk/include/asm-sparc/ioctls.h diff --git a/trunk/arch/sparc/include/asm/iommu.h b/trunk/include/asm-sparc/iommu.h similarity index 65% rename from trunk/arch/sparc/include/asm/iommu.h rename to trunk/include/asm-sparc/iommu.h index e650965b4a8d..91b072b0d7a0 100644 --- a/trunk/arch/sparc/include/asm/iommu.h +++ b/trunk/include/asm-sparc/iommu.h @@ -1,8 +1,8 @@ #ifndef ___ASM_SPARC_IOMMU_H #define ___ASM_SPARC_IOMMU_H #if defined(__sparc__) && defined(__arch64__) -#include +#include #else -#include +#include #endif #endif diff --git a/trunk/arch/sparc/include/asm/iommu_32.h b/trunk/include/asm-sparc/iommu_32.h similarity index 100% rename from trunk/arch/sparc/include/asm/iommu_32.h rename to trunk/include/asm-sparc/iommu_32.h diff --git a/trunk/arch/sparc/include/asm/iommu_64.h b/trunk/include/asm-sparc/iommu_64.h similarity index 100% rename from trunk/arch/sparc/include/asm/iommu_64.h rename to trunk/include/asm-sparc/iommu_64.h diff --git a/trunk/arch/sparc/include/asm/ipcbuf.h b/trunk/include/asm-sparc/ipcbuf.h similarity index 65% rename from trunk/arch/sparc/include/asm/ipcbuf.h rename to trunk/include/asm-sparc/ipcbuf.h index 17d6ef7b23a4..037605d986e2 100644 --- a/trunk/arch/sparc/include/asm/ipcbuf.h +++ b/trunk/include/asm-sparc/ipcbuf.h @@ -1,8 +1,8 @@ #ifndef ___ASM_SPARC_IPCBUF_H #define ___ASM_SPARC_IPCBUF_H #if defined(__sparc__) && defined(__arch64__) -#include +#include #else -#include +#include #endif #endif diff --git a/trunk/arch/sparc/include/asm/ipcbuf_32.h b/trunk/include/asm-sparc/ipcbuf_32.h similarity index 100% rename from trunk/arch/sparc/include/asm/ipcbuf_32.h rename to trunk/include/asm-sparc/ipcbuf_32.h diff --git a/trunk/arch/sparc/include/asm/ipcbuf_64.h b/trunk/include/asm-sparc/ipcbuf_64.h similarity index 100% rename from trunk/arch/sparc/include/asm/ipcbuf_64.h rename to trunk/include/asm-sparc/ipcbuf_64.h diff --git a/trunk/arch/sparc/include/asm/irq.h b/trunk/include/asm-sparc/irq.h similarity index 66% rename from trunk/arch/sparc/include/asm/irq.h rename to trunk/include/asm-sparc/irq.h index 3b44a6a14074..7af6bb4aa09c 100644 --- a/trunk/arch/sparc/include/asm/irq.h +++ b/trunk/include/asm-sparc/irq.h @@ -1,8 +1,8 @@ #ifndef ___ASM_SPARC_IRQ_H #define ___ASM_SPARC_IRQ_H #if defined(__sparc__) && defined(__arch64__) -#include +#include #else -#include +#include #endif #endif diff --git a/trunk/arch/sparc/include/asm/irq_32.h b/trunk/include/asm-sparc/irq_32.h similarity index 100% rename from trunk/arch/sparc/include/asm/irq_32.h rename to trunk/include/asm-sparc/irq_32.h diff --git a/trunk/arch/sparc/include/asm/irq_64.h b/trunk/include/asm-sparc/irq_64.h similarity index 100% rename from trunk/arch/sparc/include/asm/irq_64.h rename to trunk/include/asm-sparc/irq_64.h diff --git a/trunk/arch/sparc/include/asm/irq_regs.h b/trunk/include/asm-sparc/irq_regs.h similarity index 100% rename from trunk/arch/sparc/include/asm/irq_regs.h rename to trunk/include/asm-sparc/irq_regs.h diff --git a/trunk/arch/sparc/include/asm/irqflags.h b/trunk/include/asm-sparc/irqflags.h similarity index 65% rename from trunk/arch/sparc/include/asm/irqflags.h rename to trunk/include/asm-sparc/irqflags.h index 1e138632bd3f..c6402b187e23 100644 --- a/trunk/arch/sparc/include/asm/irqflags.h +++ b/trunk/include/asm-sparc/irqflags.h @@ -1,8 +1,8 @@ #ifndef ___ASM_SPARC_IRQFLAGS_H #define ___ASM_SPARC_IRQFLAGS_H #if defined(__sparc__) && defined(__arch64__) -#include +#include #else -#include +#include #endif #endif diff --git a/trunk/arch/sparc/include/asm/irqflags_32.h b/trunk/include/asm-sparc/irqflags_32.h similarity index 96% rename from trunk/arch/sparc/include/asm/irqflags_32.h rename to trunk/include/asm-sparc/irqflags_32.h index 0fca9d97d44f..db398fb32826 100644 --- a/trunk/arch/sparc/include/asm/irqflags_32.h +++ b/trunk/include/asm-sparc/irqflags_32.h @@ -1,5 +1,5 @@ /* - * include/asm/irqflags.h + * include/asm-sparc/irqflags.h * * IRQ flags handling * diff --git a/trunk/arch/sparc/include/asm/irqflags_64.h b/trunk/include/asm-sparc/irqflags_64.h similarity index 97% rename from trunk/arch/sparc/include/asm/irqflags_64.h rename to trunk/include/asm-sparc/irqflags_64.h index bb42e59162aa..024fc54d0682 100644 --- a/trunk/arch/sparc/include/asm/irqflags_64.h +++ b/trunk/include/asm-sparc/irqflags_64.h @@ -1,5 +1,5 @@ /* - * include/asm/irqflags.h + * include/asm-sparc64/irqflags.h * * IRQ flags handling * diff --git a/trunk/arch/sparc/include/asm/jsflash.h b/trunk/include/asm-sparc/jsflash.h similarity index 100% rename from trunk/arch/sparc/include/asm/jsflash.h rename to trunk/include/asm-sparc/jsflash.h diff --git a/trunk/arch/sparc/include/asm/kdebug.h b/trunk/include/asm-sparc/kdebug.h similarity index 65% rename from trunk/arch/sparc/include/asm/kdebug.h rename to trunk/include/asm-sparc/kdebug.h index 8d12581ca386..fe07d00d0534 100644 --- a/trunk/arch/sparc/include/asm/kdebug.h +++ b/trunk/include/asm-sparc/kdebug.h @@ -1,8 +1,8 @@ #ifndef ___ASM_SPARC_KDEBUG_H #define ___ASM_SPARC_KDEBUG_H #if defined(__sparc__) && defined(__arch64__) -#include +#include #else -#include +#include #endif #endif diff --git a/trunk/arch/sparc/include/asm/kdebug_32.h b/trunk/include/asm-sparc/kdebug_32.h similarity index 100% rename from trunk/arch/sparc/include/asm/kdebug_32.h rename to trunk/include/asm-sparc/kdebug_32.h diff --git a/trunk/arch/sparc/include/asm/kdebug_64.h b/trunk/include/asm-sparc/kdebug_64.h similarity index 100% rename from trunk/arch/sparc/include/asm/kdebug_64.h rename to trunk/include/asm-sparc/kdebug_64.h diff --git a/trunk/arch/sparc/include/asm/kgdb.h b/trunk/include/asm-sparc/kgdb.h similarity index 100% rename from trunk/arch/sparc/include/asm/kgdb.h rename to trunk/include/asm-sparc/kgdb.h diff --git a/trunk/arch/sparc/include/asm/kmap_types.h b/trunk/include/asm-sparc/kmap_types.h similarity index 100% rename from trunk/arch/sparc/include/asm/kmap_types.h rename to trunk/include/asm-sparc/kmap_types.h diff --git a/trunk/arch/sparc/include/asm/kprobes.h b/trunk/include/asm-sparc/kprobes.h similarity index 100% rename from trunk/arch/sparc/include/asm/kprobes.h rename to trunk/include/asm-sparc/kprobes.h diff --git a/trunk/arch/sparc/include/asm/ldc.h b/trunk/include/asm-sparc/ldc.h similarity index 100% rename from trunk/arch/sparc/include/asm/ldc.h rename to trunk/include/asm-sparc/ldc.h diff --git a/trunk/arch/sparc/include/asm/linkage.h b/trunk/include/asm-sparc/linkage.h similarity index 100% rename from trunk/arch/sparc/include/asm/linkage.h rename to trunk/include/asm-sparc/linkage.h diff --git a/trunk/arch/sparc/include/asm/lmb.h b/trunk/include/asm-sparc/lmb.h similarity index 100% rename from trunk/arch/sparc/include/asm/lmb.h rename to trunk/include/asm-sparc/lmb.h diff --git a/trunk/arch/sparc/include/asm/local.h b/trunk/include/asm-sparc/local.h similarity index 100% rename from trunk/arch/sparc/include/asm/local.h rename to trunk/include/asm-sparc/local.h diff --git a/trunk/arch/sparc/include/asm/lsu.h b/trunk/include/asm-sparc/lsu.h similarity index 100% rename from trunk/arch/sparc/include/asm/lsu.h rename to trunk/include/asm-sparc/lsu.h diff --git a/trunk/arch/sparc/include/asm/machines.h b/trunk/include/asm-sparc/machines.h similarity index 100% rename from trunk/arch/sparc/include/asm/machines.h rename to trunk/include/asm-sparc/machines.h diff --git a/trunk/arch/sparc/include/asm/mbus.h b/trunk/include/asm-sparc/mbus.h similarity index 100% rename from trunk/arch/sparc/include/asm/mbus.h rename to trunk/include/asm-sparc/mbus.h diff --git a/trunk/arch/sparc/include/asm/mc146818rtc.h b/trunk/include/asm-sparc/mc146818rtc.h similarity index 64% rename from trunk/arch/sparc/include/asm/mc146818rtc.h rename to trunk/include/asm-sparc/mc146818rtc.h index 67ed9e3a0235..9ab65c21e9e4 100644 --- a/trunk/arch/sparc/include/asm/mc146818rtc.h +++ b/trunk/include/asm-sparc/mc146818rtc.h @@ -1,8 +1,8 @@ #ifndef ___ASM_SPARC_MC146818RTC_H #define ___ASM_SPARC_MC146818RTC_H #if defined(__sparc__) && defined(__arch64__) -#include +#include #else -#include +#include #endif #endif diff --git a/trunk/arch/sparc/include/asm/mc146818rtc_32.h b/trunk/include/asm-sparc/mc146818rtc_32.h similarity index 100% rename from trunk/arch/sparc/include/asm/mc146818rtc_32.h rename to trunk/include/asm-sparc/mc146818rtc_32.h diff --git a/trunk/arch/sparc/include/asm/mc146818rtc_64.h b/trunk/include/asm-sparc/mc146818rtc_64.h similarity index 100% rename from trunk/arch/sparc/include/asm/mc146818rtc_64.h rename to trunk/include/asm-sparc/mc146818rtc_64.h diff --git a/trunk/arch/sparc/include/asm/mdesc.h b/trunk/include/asm-sparc/mdesc.h similarity index 100% rename from trunk/arch/sparc/include/asm/mdesc.h rename to trunk/include/asm-sparc/mdesc.h diff --git a/trunk/arch/sparc/include/asm/memreg.h b/trunk/include/asm-sparc/memreg.h similarity index 100% rename from trunk/arch/sparc/include/asm/memreg.h rename to trunk/include/asm-sparc/memreg.h diff --git a/trunk/arch/sparc/include/asm/mman.h b/trunk/include/asm-sparc/mman.h similarity index 100% rename from trunk/arch/sparc/include/asm/mman.h rename to trunk/include/asm-sparc/mman.h diff --git a/trunk/arch/sparc/include/asm/mmu.h b/trunk/include/asm-sparc/mmu.h similarity index 66% rename from trunk/arch/sparc/include/asm/mmu.h rename to trunk/include/asm-sparc/mmu.h index 88fa313887db..ee66bf6dcbd6 100644 --- a/trunk/arch/sparc/include/asm/mmu.h +++ b/trunk/include/asm-sparc/mmu.h @@ -1,8 +1,8 @@ #ifndef ___ASM_SPARC_MMU_H #define ___ASM_SPARC_MMU_H #if defined(__sparc__) && defined(__arch64__) -#include +#include #else -#include +#include #endif #endif diff --git a/trunk/arch/sparc/include/asm/mmu_32.h b/trunk/include/asm-sparc/mmu_32.h similarity index 100% rename from trunk/arch/sparc/include/asm/mmu_32.h rename to trunk/include/asm-sparc/mmu_32.h diff --git a/trunk/arch/sparc/include/asm/mmu_64.h b/trunk/include/asm-sparc/mmu_64.h similarity index 100% rename from trunk/arch/sparc/include/asm/mmu_64.h rename to trunk/include/asm-sparc/mmu_64.h diff --git a/trunk/arch/sparc/include/asm/mmu_context.h b/trunk/include/asm-sparc/mmu_context.h similarity index 64% rename from trunk/arch/sparc/include/asm/mmu_context.h rename to trunk/include/asm-sparc/mmu_context.h index 5531346c64f9..e14efb9532ff 100644 --- a/trunk/arch/sparc/include/asm/mmu_context.h +++ b/trunk/include/asm-sparc/mmu_context.h @@ -1,8 +1,8 @@ #ifndef ___ASM_SPARC_MMU_CONTEXT_H #define ___ASM_SPARC_MMU_CONTEXT_H #if defined(__sparc__) && defined(__arch64__) -#include +#include #else -#include +#include #endif #endif diff --git a/trunk/arch/sparc/include/asm/mmu_context_32.h b/trunk/include/asm-sparc/mmu_context_32.h similarity index 100% rename from trunk/arch/sparc/include/asm/mmu_context_32.h rename to trunk/include/asm-sparc/mmu_context_32.h diff --git a/trunk/arch/sparc/include/asm/mmu_context_64.h b/trunk/include/asm-sparc/mmu_context_64.h similarity index 100% rename from trunk/arch/sparc/include/asm/mmu_context_64.h rename to trunk/include/asm-sparc/mmu_context_64.h diff --git a/trunk/arch/sparc/include/asm/mmzone.h b/trunk/include/asm-sparc/mmzone.h similarity index 100% rename from trunk/arch/sparc/include/asm/mmzone.h rename to trunk/include/asm-sparc/mmzone.h diff --git a/trunk/arch/sparc/include/asm/module.h b/trunk/include/asm-sparc/module.h similarity index 65% rename from trunk/arch/sparc/include/asm/module.h rename to trunk/include/asm-sparc/module.h index e82cf9a3e60e..516138fe681a 100644 --- a/trunk/arch/sparc/include/asm/module.h +++ b/trunk/include/asm-sparc/module.h @@ -1,8 +1,8 @@ #ifndef ___ASM_SPARC_MODULE_H #define ___ASM_SPARC_MODULE_H #if defined(__sparc__) && defined(__arch64__) -#include +#include #else -#include +#include #endif #endif diff --git a/trunk/arch/sparc/include/asm/module_32.h b/trunk/include/asm-sparc/module_32.h similarity index 100% rename from trunk/arch/sparc/include/asm/module_32.h rename to trunk/include/asm-sparc/module_32.h diff --git a/trunk/arch/sparc/include/asm/module_64.h b/trunk/include/asm-sparc/module_64.h similarity index 100% rename from trunk/arch/sparc/include/asm/module_64.h rename to trunk/include/asm-sparc/module_64.h diff --git a/trunk/arch/sparc/include/asm/mostek.h b/trunk/include/asm-sparc/mostek.h similarity index 65% rename from trunk/arch/sparc/include/asm/mostek.h rename to trunk/include/asm-sparc/mostek.h index 433be3e0a69b..5b9f7fec7ee7 100644 --- a/trunk/arch/sparc/include/asm/mostek.h +++ b/trunk/include/asm-sparc/mostek.h @@ -1,8 +1,8 @@ #ifndef ___ASM_SPARC_MOSTEK_H #define ___ASM_SPARC_MOSTEK_H #if defined(__sparc__) && defined(__arch64__) -#include +#include #else -#include +#include #endif #endif diff --git a/trunk/arch/sparc/include/asm/mostek_32.h b/trunk/include/asm-sparc/mostek_32.h similarity index 100% rename from trunk/arch/sparc/include/asm/mostek_32.h rename to trunk/include/asm-sparc/mostek_32.h diff --git a/trunk/arch/sparc/include/asm/mostek_64.h b/trunk/include/asm-sparc/mostek_64.h similarity index 100% rename from trunk/arch/sparc/include/asm/mostek_64.h rename to trunk/include/asm-sparc/mostek_64.h diff --git a/trunk/arch/sparc/include/asm/mpmbox.h b/trunk/include/asm-sparc/mpmbox.h similarity index 100% rename from trunk/arch/sparc/include/asm/mpmbox.h rename to trunk/include/asm-sparc/mpmbox.h diff --git a/trunk/arch/sparc/include/asm/msgbuf.h b/trunk/include/asm-sparc/msgbuf.h similarity index 100% rename from trunk/arch/sparc/include/asm/msgbuf.h rename to trunk/include/asm-sparc/msgbuf.h diff --git a/trunk/arch/sparc/include/asm/msi.h b/trunk/include/asm-sparc/msi.h similarity index 100% rename from trunk/arch/sparc/include/asm/msi.h rename to trunk/include/asm-sparc/msi.h diff --git a/trunk/arch/sparc/include/asm/mutex.h b/trunk/include/asm-sparc/mutex.h similarity index 100% rename from trunk/arch/sparc/include/asm/mutex.h rename to trunk/include/asm-sparc/mutex.h diff --git a/trunk/arch/sparc/include/asm/mxcc.h b/trunk/include/asm-sparc/mxcc.h similarity index 100% rename from trunk/arch/sparc/include/asm/mxcc.h rename to trunk/include/asm-sparc/mxcc.h diff --git a/trunk/arch/sparc/include/asm/ns87303.h b/trunk/include/asm-sparc/ns87303.h similarity index 100% rename from trunk/arch/sparc/include/asm/ns87303.h rename to trunk/include/asm-sparc/ns87303.h diff --git a/trunk/arch/sparc/include/asm/obio.h b/trunk/include/asm-sparc/obio.h similarity index 100% rename from trunk/arch/sparc/include/asm/obio.h rename to trunk/include/asm-sparc/obio.h diff --git a/trunk/arch/sparc/include/asm/of_device.h b/trunk/include/asm-sparc/of_device.h similarity index 100% rename from trunk/arch/sparc/include/asm/of_device.h rename to trunk/include/asm-sparc/of_device.h diff --git a/trunk/arch/sparc/include/asm/of_platform.h b/trunk/include/asm-sparc/of_platform.h similarity index 64% rename from trunk/arch/sparc/include/asm/of_platform.h rename to trunk/include/asm-sparc/of_platform.h index aa699775ffba..851eb84d737e 100644 --- a/trunk/arch/sparc/include/asm/of_platform.h +++ b/trunk/include/asm-sparc/of_platform.h @@ -1,8 +1,8 @@ #ifndef ___ASM_SPARC_OF_PLATFORM_H #define ___ASM_SPARC_OF_PLATFORM_H #if defined(__sparc__) && defined(__arch64__) -#include +#include #else -#include +#include #endif #endif diff --git a/trunk/arch/sparc/include/asm/of_platform_32.h b/trunk/include/asm-sparc/of_platform_32.h similarity index 91% rename from trunk/arch/sparc/include/asm/of_platform_32.h rename to trunk/include/asm-sparc/of_platform_32.h index 723f7c9b7411..38334351c36b 100644 --- a/trunk/arch/sparc/include/asm/of_platform_32.h +++ b/trunk/include/asm-sparc/of_platform_32.h @@ -3,7 +3,7 @@ /* * Copyright (C) 2006 Benjamin Herrenschmidt, IBM Corp. * - * Modified for Sparc by merging parts of asm/of_device.h + * Modified for Sparc by merging parts of asm-sparc/of_device.h * by Stephen Rothwell * * This program is free software; you can redistribute it and/or diff --git a/trunk/arch/sparc/include/asm/of_platform_64.h b/trunk/include/asm-sparc/of_platform_64.h similarity index 91% rename from trunk/arch/sparc/include/asm/of_platform_64.h rename to trunk/include/asm-sparc/of_platform_64.h index 4f66a5f6342d..78aa032b674c 100644 --- a/trunk/arch/sparc/include/asm/of_platform_64.h +++ b/trunk/include/asm-sparc/of_platform_64.h @@ -3,7 +3,7 @@ /* * Copyright (C) 2006 Benjamin Herrenschmidt, IBM Corp. * - * Modified for Sparc by merging parts of asm/of_device.h + * Modified for Sparc by merging parts of asm-sparc/of_device.h * by Stephen Rothwell * * This program is free software; you can redistribute it and/or diff --git a/trunk/arch/sparc/include/asm/openprom.h b/trunk/include/asm-sparc/openprom.h similarity index 65% rename from trunk/arch/sparc/include/asm/openprom.h rename to trunk/include/asm-sparc/openprom.h index aaeae905ed3f..8c349f061994 100644 --- a/trunk/arch/sparc/include/asm/openprom.h +++ b/trunk/include/asm-sparc/openprom.h @@ -1,8 +1,8 @@ #ifndef ___ASM_SPARC_OPENPROM_H #define ___ASM_SPARC_OPENPROM_H #if defined(__sparc__) && defined(__arch64__) -#include +#include #else -#include +#include #endif #endif diff --git a/trunk/arch/sparc/include/asm/openprom_32.h b/trunk/include/asm-sparc/openprom_32.h similarity index 100% rename from trunk/arch/sparc/include/asm/openprom_32.h rename to trunk/include/asm-sparc/openprom_32.h diff --git a/trunk/arch/sparc/include/asm/openprom_64.h b/trunk/include/asm-sparc/openprom_64.h similarity index 100% rename from trunk/arch/sparc/include/asm/openprom_64.h rename to trunk/include/asm-sparc/openprom_64.h diff --git a/trunk/arch/sparc/include/asm/openpromio.h b/trunk/include/asm-sparc/openpromio.h similarity index 100% rename from trunk/arch/sparc/include/asm/openpromio.h rename to trunk/include/asm-sparc/openpromio.h diff --git a/trunk/arch/sparc/include/asm/oplib.h b/trunk/include/asm-sparc/oplib.h similarity index 65% rename from trunk/arch/sparc/include/asm/oplib.h rename to trunk/include/asm-sparc/oplib.h index 72e04e13a6b4..e88d7c04a292 100644 --- a/trunk/arch/sparc/include/asm/oplib.h +++ b/trunk/include/asm-sparc/oplib.h @@ -1,8 +1,8 @@ #ifndef ___ASM_SPARC_OPLIB_H #define ___ASM_SPARC_OPLIB_H #if defined(__sparc__) && defined(__arch64__) -#include +#include #else -#include +#include #endif #endif diff --git a/trunk/arch/sparc/include/asm/oplib_32.h b/trunk/include/asm-sparc/oplib_32.h similarity index 100% rename from trunk/arch/sparc/include/asm/oplib_32.h rename to trunk/include/asm-sparc/oplib_32.h diff --git a/trunk/arch/sparc/include/asm/oplib_64.h b/trunk/include/asm-sparc/oplib_64.h similarity index 100% rename from trunk/arch/sparc/include/asm/oplib_64.h rename to trunk/include/asm-sparc/oplib_64.h diff --git a/trunk/arch/sparc/include/asm/page.h b/trunk/include/asm-sparc/page.h similarity index 66% rename from trunk/arch/sparc/include/asm/page.h rename to trunk/include/asm-sparc/page.h index f21de0349025..f32f49fcf75c 100644 --- a/trunk/arch/sparc/include/asm/page.h +++ b/trunk/include/asm-sparc/page.h @@ -1,8 +1,8 @@ #ifndef ___ASM_SPARC_PAGE_H #define ___ASM_SPARC_PAGE_H #if defined(__sparc__) && defined(__arch64__) -#include +#include #else -#include +#include #endif #endif diff --git a/trunk/arch/sparc/include/asm/page_32.h b/trunk/include/asm-sparc/page_32.h similarity index 100% rename from trunk/arch/sparc/include/asm/page_32.h rename to trunk/include/asm-sparc/page_32.h diff --git a/trunk/arch/sparc/include/asm/page_64.h b/trunk/include/asm-sparc/page_64.h similarity index 100% rename from trunk/arch/sparc/include/asm/page_64.h rename to trunk/include/asm-sparc/page_64.h diff --git a/trunk/arch/sparc/include/asm/param.h b/trunk/include/asm-sparc/param.h similarity index 100% rename from trunk/arch/sparc/include/asm/param.h rename to trunk/include/asm-sparc/param.h diff --git a/trunk/arch/sparc/include/asm/parport.h b/trunk/include/asm-sparc/parport.h similarity index 100% rename from trunk/arch/sparc/include/asm/parport.h rename to trunk/include/asm-sparc/parport.h diff --git a/trunk/arch/sparc/include/asm/pbm.h b/trunk/include/asm-sparc/pbm.h similarity index 100% rename from trunk/arch/sparc/include/asm/pbm.h rename to trunk/include/asm-sparc/pbm.h diff --git a/trunk/arch/sparc/include/asm/pci.h b/trunk/include/asm-sparc/pci.h similarity index 66% rename from trunk/arch/sparc/include/asm/pci.h rename to trunk/include/asm-sparc/pci.h index 6e14fd179335..b807d52a4809 100644 --- a/trunk/arch/sparc/include/asm/pci.h +++ b/trunk/include/asm-sparc/pci.h @@ -1,8 +1,8 @@ #ifndef ___ASM_SPARC_PCI_H #define ___ASM_SPARC_PCI_H #if defined(__sparc__) && defined(__arch64__) -#include +#include #else -#include +#include #endif #endif diff --git a/trunk/arch/sparc/include/asm/pci_32.h b/trunk/include/asm-sparc/pci_32.h similarity index 100% rename from trunk/arch/sparc/include/asm/pci_32.h rename to trunk/include/asm-sparc/pci_32.h diff --git a/trunk/arch/sparc/include/asm/pci_64.h b/trunk/include/asm-sparc/pci_64.h similarity index 100% rename from trunk/arch/sparc/include/asm/pci_64.h rename to trunk/include/asm-sparc/pci_64.h diff --git a/trunk/arch/sparc/include/asm/pcic.h b/trunk/include/asm-sparc/pcic.h similarity index 100% rename from trunk/arch/sparc/include/asm/pcic.h rename to trunk/include/asm-sparc/pcic.h diff --git a/trunk/arch/sparc/include/asm/percpu.h b/trunk/include/asm-sparc/percpu.h similarity index 65% rename from trunk/arch/sparc/include/asm/percpu.h rename to trunk/include/asm-sparc/percpu.h index bfb1d19ff1bf..d98ed6cf2e36 100644 --- a/trunk/arch/sparc/include/asm/percpu.h +++ b/trunk/include/asm-sparc/percpu.h @@ -1,8 +1,8 @@ #ifndef ___ASM_SPARC_PERCPU_H #define ___ASM_SPARC_PERCPU_H #if defined(__sparc__) && defined(__arch64__) -#include +#include #else -#include +#include #endif #endif diff --git a/trunk/arch/sparc/include/asm/percpu_32.h b/trunk/include/asm-sparc/percpu_32.h similarity index 100% rename from trunk/arch/sparc/include/asm/percpu_32.h rename to trunk/include/asm-sparc/percpu_32.h diff --git a/trunk/arch/sparc/include/asm/percpu_64.h b/trunk/include/asm-sparc/percpu_64.h similarity index 100% rename from trunk/arch/sparc/include/asm/percpu_64.h rename to trunk/include/asm-sparc/percpu_64.h diff --git a/trunk/arch/sparc/include/asm/perfctr.h b/trunk/include/asm-sparc/perfctr.h similarity index 100% rename from trunk/arch/sparc/include/asm/perfctr.h rename to trunk/include/asm-sparc/perfctr.h diff --git a/trunk/arch/sparc/include/asm/pgalloc.h b/trunk/include/asm-sparc/pgalloc.h similarity index 65% rename from trunk/arch/sparc/include/asm/pgalloc.h rename to trunk/include/asm-sparc/pgalloc.h index b6db1f7cdcab..7fa02b53d392 100644 --- a/trunk/arch/sparc/include/asm/pgalloc.h +++ b/trunk/include/asm-sparc/pgalloc.h @@ -1,8 +1,8 @@ #ifndef ___ASM_SPARC_PGALLOC_H #define ___ASM_SPARC_PGALLOC_H #if defined(__sparc__) && defined(__arch64__) -#include +#include #else -#include +#include #endif #endif diff --git a/trunk/arch/sparc/include/asm/pgalloc_32.h b/trunk/include/asm-sparc/pgalloc_32.h similarity index 100% rename from trunk/arch/sparc/include/asm/pgalloc_32.h rename to trunk/include/asm-sparc/pgalloc_32.h diff --git a/trunk/arch/sparc/include/asm/pgalloc_64.h b/trunk/include/asm-sparc/pgalloc_64.h similarity index 100% rename from trunk/arch/sparc/include/asm/pgalloc_64.h rename to trunk/include/asm-sparc/pgalloc_64.h diff --git a/trunk/arch/sparc/include/asm/pgtable.h b/trunk/include/asm-sparc/pgtable.h similarity index 65% rename from trunk/arch/sparc/include/asm/pgtable.h rename to trunk/include/asm-sparc/pgtable.h index 59ba6f620732..63cdef53bc52 100644 --- a/trunk/arch/sparc/include/asm/pgtable.h +++ b/trunk/include/asm-sparc/pgtable.h @@ -1,8 +1,8 @@ #ifndef ___ASM_SPARC_PGTABLE_H #define ___ASM_SPARC_PGTABLE_H #if defined(__sparc__) && defined(__arch64__) -#include +#include #else -#include +#include #endif #endif diff --git a/trunk/arch/sparc/include/asm/pgtable_32.h b/trunk/include/asm-sparc/pgtable_32.h similarity index 99% rename from trunk/arch/sparc/include/asm/pgtable_32.h rename to trunk/include/asm-sparc/pgtable_32.h index 08237fda8874..781bd4694a1c 100644 --- a/trunk/arch/sparc/include/asm/pgtable_32.h +++ b/trunk/include/asm-sparc/pgtable_32.h @@ -1,7 +1,7 @@ #ifndef _SPARC_PGTABLE_H #define _SPARC_PGTABLE_H -/* asm/pgtable.h: Defines and functions used to work +/* asm-sparc/pgtable.h: Defines and functions used to work * with Sparc page tables. * * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) diff --git a/trunk/arch/sparc/include/asm/pgtable_64.h b/trunk/include/asm-sparc/pgtable_64.h similarity index 100% rename from trunk/arch/sparc/include/asm/pgtable_64.h rename to trunk/include/asm-sparc/pgtable_64.h diff --git a/trunk/arch/sparc/include/asm/pgtsrmmu.h b/trunk/include/asm-sparc/pgtsrmmu.h similarity index 100% rename from trunk/arch/sparc/include/asm/pgtsrmmu.h rename to trunk/include/asm-sparc/pgtsrmmu.h diff --git a/trunk/arch/sparc/include/asm/pgtsun4.h b/trunk/include/asm-sparc/pgtsun4.h similarity index 100% rename from trunk/arch/sparc/include/asm/pgtsun4.h rename to trunk/include/asm-sparc/pgtsun4.h diff --git a/trunk/arch/sparc/include/asm/pgtsun4c.h b/trunk/include/asm-sparc/pgtsun4c.h similarity index 100% rename from trunk/arch/sparc/include/asm/pgtsun4c.h rename to trunk/include/asm-sparc/pgtsun4c.h diff --git a/trunk/arch/sparc/include/asm/pil.h b/trunk/include/asm-sparc/pil.h similarity index 100% rename from trunk/arch/sparc/include/asm/pil.h rename to trunk/include/asm-sparc/pil.h diff --git a/trunk/arch/sparc/include/asm/poll.h b/trunk/include/asm-sparc/poll.h similarity index 100% rename from trunk/arch/sparc/include/asm/poll.h rename to trunk/include/asm-sparc/poll.h diff --git a/trunk/arch/sparc/include/asm/posix_types.h b/trunk/include/asm-sparc/posix_types.h similarity index 64% rename from trunk/arch/sparc/include/asm/posix_types.h rename to trunk/include/asm-sparc/posix_types.h index 03a0e091a884..58c820d75e83 100644 --- a/trunk/arch/sparc/include/asm/posix_types.h +++ b/trunk/include/asm-sparc/posix_types.h @@ -1,8 +1,8 @@ #ifndef ___ASM_SPARC_POSIX_TYPES_H #define ___ASM_SPARC_POSIX_TYPES_H #if defined(__sparc__) && defined(__arch64__) -#include +#include #else -#include +#include #endif #endif diff --git a/trunk/arch/sparc/include/asm/posix_types_32.h b/trunk/include/asm-sparc/posix_types_32.h similarity index 100% rename from trunk/arch/sparc/include/asm/posix_types_32.h rename to trunk/include/asm-sparc/posix_types_32.h diff --git a/trunk/arch/sparc/include/asm/posix_types_64.h b/trunk/include/asm-sparc/posix_types_64.h similarity index 100% rename from trunk/arch/sparc/include/asm/posix_types_64.h rename to trunk/include/asm-sparc/posix_types_64.h diff --git a/trunk/arch/sparc/include/asm/processor.h b/trunk/include/asm-sparc/processor.h similarity index 64% rename from trunk/arch/sparc/include/asm/processor.h rename to trunk/include/asm-sparc/processor.h index 9da9646bf6c6..11a66bb02eaa 100644 --- a/trunk/arch/sparc/include/asm/processor.h +++ b/trunk/include/asm-sparc/processor.h @@ -1,8 +1,8 @@ #ifndef ___ASM_SPARC_PROCESSOR_H #define ___ASM_SPARC_PROCESSOR_H #if defined(__sparc__) && defined(__arch64__) -#include +#include #else -#include +#include #endif #endif diff --git a/trunk/arch/sparc/include/asm/processor_32.h b/trunk/include/asm-sparc/processor_32.h similarity index 97% rename from trunk/arch/sparc/include/asm/processor_32.h rename to trunk/include/asm-sparc/processor_32.h index 2ae67a2e7f3a..562c0d69c537 100644 --- a/trunk/arch/sparc/include/asm/processor_32.h +++ b/trunk/include/asm-sparc/processor_32.h @@ -1,4 +1,4 @@ -/* include/asm/processor.h +/* include/asm-sparc/processor.h * * Copyright (C) 1994 David S. Miller (davem@caip.rutgers.edu) */ @@ -114,7 +114,6 @@ extern pid_t kernel_thread(int (*fn)(void *), void * arg, unsigned long flags); extern unsigned long get_wchan(struct task_struct *); -#define task_pt_regs(tsk) ((tsk)->thread.kregs) #define KSTK_EIP(tsk) ((tsk)->thread.kregs->pc) #define KSTK_ESP(tsk) ((tsk)->thread.kregs->u_regs[UREG_FP]) diff --git a/trunk/arch/sparc/include/asm/processor_64.h b/trunk/include/asm-sparc/processor_64.h similarity index 99% rename from trunk/arch/sparc/include/asm/processor_64.h rename to trunk/include/asm-sparc/processor_64.h index 137a6bd72fc8..70d42801a0d2 100644 --- a/trunk/arch/sparc/include/asm/processor_64.h +++ b/trunk/include/asm-sparc/processor_64.h @@ -1,5 +1,5 @@ /* - * include/asm/processor.h + * include/asm-sparc64/processor.h * * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu) */ diff --git a/trunk/arch/sparc/include/asm/prom.h b/trunk/include/asm-sparc/prom.h similarity index 100% rename from trunk/arch/sparc/include/asm/prom.h rename to trunk/include/asm-sparc/prom.h diff --git a/trunk/arch/sparc/include/asm/psr.h b/trunk/include/asm-sparc/psr.h similarity index 100% rename from trunk/arch/sparc/include/asm/psr.h rename to trunk/include/asm-sparc/psr.h diff --git a/trunk/arch/sparc/include/asm/psrcompat.h b/trunk/include/asm-sparc/psrcompat.h similarity index 100% rename from trunk/arch/sparc/include/asm/psrcompat.h rename to trunk/include/asm-sparc/psrcompat.h diff --git a/trunk/arch/sparc/include/asm/pstate.h b/trunk/include/asm-sparc/pstate.h similarity index 100% rename from trunk/arch/sparc/include/asm/pstate.h rename to trunk/include/asm-sparc/pstate.h diff --git a/trunk/arch/sparc/include/asm/ptrace.h b/trunk/include/asm-sparc/ptrace.h similarity index 65% rename from trunk/arch/sparc/include/asm/ptrace.h rename to trunk/include/asm-sparc/ptrace.h index 6dcbe2eed2e2..f36ab6c30ff3 100644 --- a/trunk/arch/sparc/include/asm/ptrace.h +++ b/trunk/include/asm-sparc/ptrace.h @@ -1,8 +1,8 @@ #ifndef ___ASM_SPARC_PTRACE_H #define ___ASM_SPARC_PTRACE_H #if defined(__sparc__) && defined(__arch64__) -#include +#include #else -#include +#include #endif #endif diff --git a/trunk/arch/sparc/include/asm/ptrace_32.h b/trunk/include/asm-sparc/ptrace_32.h similarity index 98% rename from trunk/arch/sparc/include/asm/ptrace_32.h rename to trunk/include/asm-sparc/ptrace_32.h index d43c88b86834..0401cc7ec38e 100644 --- a/trunk/arch/sparc/include/asm/ptrace_32.h +++ b/trunk/include/asm-sparc/ptrace_32.h @@ -74,7 +74,6 @@ struct sparc_stackf { #define user_mode(regs) (!((regs)->psr & PSR_PS)) #define instruction_pointer(regs) ((regs)->pc) -#define user_stack_pointer(regs) ((regs)->u_regs[UREG_FP]) unsigned long profile_pc(struct pt_regs *); extern void show_regs(struct pt_regs *); #endif diff --git a/trunk/arch/sparc/include/asm/ptrace_64.h b/trunk/include/asm-sparc/ptrace_64.h similarity index 99% rename from trunk/arch/sparc/include/asm/ptrace_64.h rename to trunk/include/asm-sparc/ptrace_64.h index ec6d45c84cd0..a682e66d5c4a 100644 --- a/trunk/arch/sparc/include/asm/ptrace_64.h +++ b/trunk/include/asm-sparc/ptrace_64.h @@ -146,7 +146,6 @@ do { current_thread_info()->syscall_noerror = 1; \ } while (0) #define user_mode(regs) (!((regs)->tstate & TSTATE_PRIV)) #define instruction_pointer(regs) ((regs)->tpc) -#define user_stack_pointer(regs) ((regs)->u_regs[UREG_FP]) #define regs_return_value(regs) ((regs)->u_regs[UREG_I0]) #ifdef CONFIG_SMP extern unsigned long profile_pc(struct pt_regs *); diff --git a/trunk/arch/sparc/include/asm/reboot.h b/trunk/include/asm-sparc/reboot.h similarity index 100% rename from trunk/arch/sparc/include/asm/reboot.h rename to trunk/include/asm-sparc/reboot.h diff --git a/trunk/arch/sparc/include/asm/reg.h b/trunk/include/asm-sparc/reg.h similarity index 66% rename from trunk/arch/sparc/include/asm/reg.h rename to trunk/include/asm-sparc/reg.h index 0c16e19cae4d..cb34b0a49aad 100644 --- a/trunk/arch/sparc/include/asm/reg.h +++ b/trunk/include/asm-sparc/reg.h @@ -1,8 +1,8 @@ #ifndef ___ASM_SPARC_REG_H #define ___ASM_SPARC_REG_H #if defined(__sparc__) && defined(__arch64__) -#include +#include #else -#include +#include #endif #endif diff --git a/trunk/arch/sparc/include/asm/reg_32.h b/trunk/include/asm-sparc/reg_32.h similarity index 98% rename from trunk/arch/sparc/include/asm/reg_32.h rename to trunk/include/asm-sparc/reg_32.h index 1efb056fb3d1..42fecfcd97e7 100644 --- a/trunk/arch/sparc/include/asm/reg_32.h +++ b/trunk/include/asm-sparc/reg_32.h @@ -1,5 +1,5 @@ /* - * linux/include/asm/reg.h + * linux/include/asm-sparc/reg.h * Layout of the registers as expected by gdb on the Sparc * we should replace the user.h definitions with those in * this file, we don't even use the other diff --git a/trunk/arch/sparc/include/asm/reg_64.h b/trunk/include/asm-sparc/reg_64.h similarity index 97% rename from trunk/arch/sparc/include/asm/reg_64.h rename to trunk/include/asm-sparc/reg_64.h index 6f277d7c7d88..eb24a07ff4d5 100644 --- a/trunk/arch/sparc/include/asm/reg_64.h +++ b/trunk/include/asm-sparc/reg_64.h @@ -1,5 +1,5 @@ /* - * linux/asm/reg.h + * linux/asm-sparc64/reg.h * Layout of the registers as expected by gdb on the Sparc * we should replace the user.h definitions with those in * this file, we don't even use the other diff --git a/trunk/arch/sparc/include/asm/resource.h b/trunk/include/asm-sparc/resource.h similarity index 100% rename from trunk/arch/sparc/include/asm/resource.h rename to trunk/include/asm-sparc/resource.h diff --git a/trunk/arch/sparc/include/asm/ross.h b/trunk/include/asm-sparc/ross.h similarity index 100% rename from trunk/arch/sparc/include/asm/ross.h rename to trunk/include/asm-sparc/ross.h diff --git a/trunk/arch/sparc/include/asm/rtc.h b/trunk/include/asm-sparc/rtc.h similarity index 100% rename from trunk/arch/sparc/include/asm/rtc.h rename to trunk/include/asm-sparc/rtc.h diff --git a/trunk/arch/sparc/include/asm/rwsem-const.h b/trunk/include/asm-sparc/rwsem-const.h similarity index 100% rename from trunk/arch/sparc/include/asm/rwsem-const.h rename to trunk/include/asm-sparc/rwsem-const.h diff --git a/trunk/arch/sparc/include/asm/rwsem.h b/trunk/include/asm-sparc/rwsem.h similarity index 100% rename from trunk/arch/sparc/include/asm/rwsem.h rename to trunk/include/asm-sparc/rwsem.h diff --git a/trunk/arch/sparc/include/asm/sbi.h b/trunk/include/asm-sparc/sbi.h similarity index 100% rename from trunk/arch/sparc/include/asm/sbi.h rename to trunk/include/asm-sparc/sbi.h diff --git a/trunk/arch/sparc/include/asm/sbus.h b/trunk/include/asm-sparc/sbus.h similarity index 66% rename from trunk/arch/sparc/include/asm/sbus.h rename to trunk/include/asm-sparc/sbus.h index f82481ab44db..8f29a1979665 100644 --- a/trunk/arch/sparc/include/asm/sbus.h +++ b/trunk/include/asm-sparc/sbus.h @@ -1,8 +1,8 @@ #ifndef ___ASM_SPARC_SBUS_H #define ___ASM_SPARC_SBUS_H #if defined(__sparc__) && defined(__arch64__) -#include +#include #else -#include +#include #endif #endif diff --git a/trunk/arch/sparc/include/asm/sbus_32.h b/trunk/include/asm-sparc/sbus_32.h similarity index 100% rename from trunk/arch/sparc/include/asm/sbus_32.h rename to trunk/include/asm-sparc/sbus_32.h diff --git a/trunk/arch/sparc/include/asm/sbus_64.h b/trunk/include/asm-sparc/sbus_64.h similarity index 100% rename from trunk/arch/sparc/include/asm/sbus_64.h rename to trunk/include/asm-sparc/sbus_64.h diff --git a/trunk/arch/sparc/include/asm/scatterlist.h b/trunk/include/asm-sparc/scatterlist.h similarity index 64% rename from trunk/arch/sparc/include/asm/scatterlist.h rename to trunk/include/asm-sparc/scatterlist.h index ec21a4517641..b1a0e316c2b6 100644 --- a/trunk/arch/sparc/include/asm/scatterlist.h +++ b/trunk/include/asm-sparc/scatterlist.h @@ -1,8 +1,8 @@ #ifndef ___ASM_SPARC_SCATTERLIST_H #define ___ASM_SPARC_SCATTERLIST_H #if defined(__sparc__) && defined(__arch64__) -#include +#include #else -#include +#include #endif #endif diff --git a/trunk/arch/sparc/include/asm/scatterlist_32.h b/trunk/include/asm-sparc/scatterlist_32.h similarity index 100% rename from trunk/arch/sparc/include/asm/scatterlist_32.h rename to trunk/include/asm-sparc/scatterlist_32.h diff --git a/trunk/arch/sparc/include/asm/scatterlist_64.h b/trunk/include/asm-sparc/scatterlist_64.h similarity index 100% rename from trunk/arch/sparc/include/asm/scatterlist_64.h rename to trunk/include/asm-sparc/scatterlist_64.h diff --git a/trunk/arch/sparc/include/asm/scratchpad.h b/trunk/include/asm-sparc/scratchpad.h similarity index 100% rename from trunk/arch/sparc/include/asm/scratchpad.h rename to trunk/include/asm-sparc/scratchpad.h diff --git a/trunk/arch/sparc/include/asm/seccomp.h b/trunk/include/asm-sparc/seccomp.h similarity index 100% rename from trunk/arch/sparc/include/asm/seccomp.h rename to trunk/include/asm-sparc/seccomp.h diff --git a/trunk/arch/sparc/include/asm/sections.h b/trunk/include/asm-sparc/sections.h similarity index 65% rename from trunk/arch/sparc/include/asm/sections.h rename to trunk/include/asm-sparc/sections.h index c7c69b00967f..cbd019162425 100644 --- a/trunk/arch/sparc/include/asm/sections.h +++ b/trunk/include/asm-sparc/sections.h @@ -1,8 +1,8 @@ #ifndef ___ASM_SPARC_SECTIONS_H #define ___ASM_SPARC_SECTIONS_H #if defined(__sparc__) && defined(__arch64__) -#include +#include #else -#include +#include #endif #endif diff --git a/trunk/arch/sparc/include/asm/sections_32.h b/trunk/include/asm-sparc/sections_32.h similarity index 100% rename from trunk/arch/sparc/include/asm/sections_32.h rename to trunk/include/asm-sparc/sections_32.h diff --git a/trunk/arch/sparc/include/asm/sections_64.h b/trunk/include/asm-sparc/sections_64.h similarity index 100% rename from trunk/arch/sparc/include/asm/sections_64.h rename to trunk/include/asm-sparc/sections_64.h diff --git a/trunk/arch/sparc/include/asm/sembuf.h b/trunk/include/asm-sparc/sembuf.h similarity index 100% rename from trunk/arch/sparc/include/asm/sembuf.h rename to trunk/include/asm-sparc/sembuf.h diff --git a/trunk/arch/sparc/include/asm/setup.h b/trunk/include/asm-sparc/setup.h similarity index 100% rename from trunk/arch/sparc/include/asm/setup.h rename to trunk/include/asm-sparc/setup.h diff --git a/trunk/arch/sparc/include/asm/sfafsr.h b/trunk/include/asm-sparc/sfafsr.h similarity index 100% rename from trunk/arch/sparc/include/asm/sfafsr.h rename to trunk/include/asm-sparc/sfafsr.h diff --git a/trunk/arch/sparc/include/asm/sfp-machine.h b/trunk/include/asm-sparc/sfp-machine.h similarity index 64% rename from trunk/arch/sparc/include/asm/sfp-machine.h rename to trunk/include/asm-sparc/sfp-machine.h index 4ebc3823ed4f..c676fcc2dd27 100644 --- a/trunk/arch/sparc/include/asm/sfp-machine.h +++ b/trunk/include/asm-sparc/sfp-machine.h @@ -1,8 +1,8 @@ #ifndef ___ASM_SPARC_SFP_MACHINE_H #define ___ASM_SPARC_SFP_MACHINE_H #if defined(__sparc__) && defined(__arch64__) -#include +#include #else -#include +#include #endif #endif diff --git a/trunk/arch/sparc/include/asm/sfp-machine_32.h b/trunk/include/asm-sparc/sfp-machine_32.h similarity index 100% rename from trunk/arch/sparc/include/asm/sfp-machine_32.h rename to trunk/include/asm-sparc/sfp-machine_32.h diff --git a/trunk/arch/sparc/include/asm/sfp-machine_64.h b/trunk/include/asm-sparc/sfp-machine_64.h similarity index 100% rename from trunk/arch/sparc/include/asm/sfp-machine_64.h rename to trunk/include/asm-sparc/sfp-machine_64.h diff --git a/trunk/arch/sparc/include/asm/shmbuf.h b/trunk/include/asm-sparc/shmbuf.h similarity index 100% rename from trunk/arch/sparc/include/asm/shmbuf.h rename to trunk/include/asm-sparc/shmbuf.h diff --git a/trunk/arch/sparc/include/asm/shmparam.h b/trunk/include/asm-sparc/shmparam.h similarity index 65% rename from trunk/arch/sparc/include/asm/shmparam.h rename to trunk/include/asm-sparc/shmparam.h index 8bf0cfe0694f..16fda7e9acc8 100644 --- a/trunk/arch/sparc/include/asm/shmparam.h +++ b/trunk/include/asm-sparc/shmparam.h @@ -1,8 +1,8 @@ #ifndef ___ASM_SPARC_SHMPARAM_H #define ___ASM_SPARC_SHMPARAM_H #if defined(__sparc__) && defined(__arch64__) -#include +#include #else -#include +#include #endif #endif diff --git a/trunk/arch/sparc/include/asm/shmparam_32.h b/trunk/include/asm-sparc/shmparam_32.h similarity index 100% rename from trunk/arch/sparc/include/asm/shmparam_32.h rename to trunk/include/asm-sparc/shmparam_32.h diff --git a/trunk/arch/sparc/include/asm/shmparam_64.h b/trunk/include/asm-sparc/shmparam_64.h similarity index 100% rename from trunk/arch/sparc/include/asm/shmparam_64.h rename to trunk/include/asm-sparc/shmparam_64.h diff --git a/trunk/arch/sparc/include/asm/sigcontext.h b/trunk/include/asm-sparc/sigcontext.h similarity index 64% rename from trunk/arch/sparc/include/asm/sigcontext.h rename to trunk/include/asm-sparc/sigcontext.h index e92de7e286b5..82fc7d54a4fa 100644 --- a/trunk/arch/sparc/include/asm/sigcontext.h +++ b/trunk/include/asm-sparc/sigcontext.h @@ -1,8 +1,8 @@ #ifndef ___ASM_SPARC_SIGCONTEXT_H #define ___ASM_SPARC_SIGCONTEXT_H #if defined(__sparc__) && defined(__arch64__) -#include +#include #else -#include +#include #endif #endif diff --git a/trunk/arch/sparc/include/asm/sigcontext_32.h b/trunk/include/asm-sparc/sigcontext_32.h similarity index 100% rename from trunk/arch/sparc/include/asm/sigcontext_32.h rename to trunk/include/asm-sparc/sigcontext_32.h diff --git a/trunk/arch/sparc/include/asm/sigcontext_64.h b/trunk/include/asm-sparc/sigcontext_64.h similarity index 100% rename from trunk/arch/sparc/include/asm/sigcontext_64.h rename to trunk/include/asm-sparc/sigcontext_64.h diff --git a/trunk/arch/sparc/include/asm/siginfo.h b/trunk/include/asm-sparc/siginfo.h similarity index 65% rename from trunk/arch/sparc/include/asm/siginfo.h rename to trunk/include/asm-sparc/siginfo.h index bd81f8d7f5ce..2c9fccf4ce18 100644 --- a/trunk/arch/sparc/include/asm/siginfo.h +++ b/trunk/include/asm-sparc/siginfo.h @@ -1,8 +1,8 @@ #ifndef ___ASM_SPARC_SIGINFO_H #define ___ASM_SPARC_SIGINFO_H #if defined(__sparc__) && defined(__arch64__) -#include +#include #else -#include +#include #endif #endif diff --git a/trunk/arch/sparc/include/asm/siginfo_32.h b/trunk/include/asm-sparc/siginfo_32.h similarity index 100% rename from trunk/arch/sparc/include/asm/siginfo_32.h rename to trunk/include/asm-sparc/siginfo_32.h diff --git a/trunk/arch/sparc/include/asm/siginfo_64.h b/trunk/include/asm-sparc/siginfo_64.h similarity index 100% rename from trunk/arch/sparc/include/asm/siginfo_64.h rename to trunk/include/asm-sparc/siginfo_64.h diff --git a/trunk/arch/sparc/include/asm/signal.h b/trunk/include/asm-sparc/signal.h similarity index 65% rename from trunk/arch/sparc/include/asm/signal.h rename to trunk/include/asm-sparc/signal.h index 27ab05dc203e..36f5f9e482f7 100644 --- a/trunk/arch/sparc/include/asm/signal.h +++ b/trunk/include/asm-sparc/signal.h @@ -1,8 +1,8 @@ #ifndef ___ASM_SPARC_SIGNAL_H #define ___ASM_SPARC_SIGNAL_H #if defined(__sparc__) && defined(__arch64__) -#include +#include #else -#include +#include #endif #endif diff --git a/trunk/arch/sparc/include/asm/signal_32.h b/trunk/include/asm-sparc/signal_32.h similarity index 100% rename from trunk/arch/sparc/include/asm/signal_32.h rename to trunk/include/asm-sparc/signal_32.h diff --git a/trunk/arch/sparc/include/asm/signal_64.h b/trunk/include/asm-sparc/signal_64.h similarity index 100% rename from trunk/arch/sparc/include/asm/signal_64.h rename to trunk/include/asm-sparc/signal_64.h diff --git a/trunk/arch/sparc/include/asm/smp.h b/trunk/include/asm-sparc/smp.h similarity index 66% rename from trunk/arch/sparc/include/asm/smp.h rename to trunk/include/asm-sparc/smp.h index b59672d0e19b..1f9dedfbabd8 100644 --- a/trunk/arch/sparc/include/asm/smp.h +++ b/trunk/include/asm-sparc/smp.h @@ -1,8 +1,8 @@ #ifndef ___ASM_SPARC_SMP_H #define ___ASM_SPARC_SMP_H #if defined(__sparc__) && defined(__arch64__) -#include +#include #else -#include +#include #endif #endif diff --git a/trunk/arch/sparc/include/asm/smp_32.h b/trunk/include/asm-sparc/smp_32.h similarity index 100% rename from trunk/arch/sparc/include/asm/smp_32.h rename to trunk/include/asm-sparc/smp_32.h diff --git a/trunk/arch/sparc/include/asm/smp_64.h b/trunk/include/asm-sparc/smp_64.h similarity index 100% rename from trunk/arch/sparc/include/asm/smp_64.h rename to trunk/include/asm-sparc/smp_64.h diff --git a/trunk/arch/sparc/include/asm/smpprim.h b/trunk/include/asm-sparc/smpprim.h similarity index 100% rename from trunk/arch/sparc/include/asm/smpprim.h rename to trunk/include/asm-sparc/smpprim.h diff --git a/trunk/arch/sparc/include/asm/socket.h b/trunk/include/asm-sparc/socket.h similarity index 100% rename from trunk/arch/sparc/include/asm/socket.h rename to trunk/include/asm-sparc/socket.h diff --git a/trunk/arch/sparc/include/asm/sockios.h b/trunk/include/asm-sparc/sockios.h similarity index 100% rename from trunk/arch/sparc/include/asm/sockios.h rename to trunk/include/asm-sparc/sockios.h diff --git a/trunk/arch/sparc/include/asm/sparsemem.h b/trunk/include/asm-sparc/sparsemem.h similarity index 100% rename from trunk/arch/sparc/include/asm/sparsemem.h rename to trunk/include/asm-sparc/sparsemem.h diff --git a/trunk/arch/sparc/include/asm/spinlock.h b/trunk/include/asm-sparc/spinlock.h similarity index 65% rename from trunk/arch/sparc/include/asm/spinlock.h rename to trunk/include/asm-sparc/spinlock.h index f276b0036b2c..3b71c50b72eb 100644 --- a/trunk/arch/sparc/include/asm/spinlock.h +++ b/trunk/include/asm-sparc/spinlock.h @@ -1,8 +1,8 @@ #ifndef ___ASM_SPARC_SPINLOCK_H #define ___ASM_SPARC_SPINLOCK_H #if defined(__sparc__) && defined(__arch64__) -#include +#include #else -#include +#include #endif #endif diff --git a/trunk/arch/sparc/include/asm/spinlock_32.h b/trunk/include/asm-sparc/spinlock_32.h similarity index 100% rename from trunk/arch/sparc/include/asm/spinlock_32.h rename to trunk/include/asm-sparc/spinlock_32.h diff --git a/trunk/arch/sparc/include/asm/spinlock_64.h b/trunk/include/asm-sparc/spinlock_64.h similarity index 100% rename from trunk/arch/sparc/include/asm/spinlock_64.h rename to trunk/include/asm-sparc/spinlock_64.h diff --git a/trunk/arch/sparc/include/asm/spinlock_types.h b/trunk/include/asm-sparc/spinlock_types.h similarity index 100% rename from trunk/arch/sparc/include/asm/spinlock_types.h rename to trunk/include/asm-sparc/spinlock_types.h diff --git a/trunk/arch/sparc/include/asm/spitfire.h b/trunk/include/asm-sparc/spitfire.h similarity index 100% rename from trunk/arch/sparc/include/asm/spitfire.h rename to trunk/include/asm-sparc/spitfire.h diff --git a/trunk/arch/sparc/include/asm/sstate.h b/trunk/include/asm-sparc/sstate.h similarity index 100% rename from trunk/arch/sparc/include/asm/sstate.h rename to trunk/include/asm-sparc/sstate.h diff --git a/trunk/arch/sparc/include/asm/stacktrace.h b/trunk/include/asm-sparc/stacktrace.h similarity index 100% rename from trunk/arch/sparc/include/asm/stacktrace.h rename to trunk/include/asm-sparc/stacktrace.h diff --git a/trunk/arch/sparc/include/asm/starfire.h b/trunk/include/asm-sparc/starfire.h similarity index 100% rename from trunk/arch/sparc/include/asm/starfire.h rename to trunk/include/asm-sparc/starfire.h diff --git a/trunk/arch/sparc/include/asm/stat.h b/trunk/include/asm-sparc/stat.h similarity index 66% rename from trunk/arch/sparc/include/asm/stat.h rename to trunk/include/asm-sparc/stat.h index d8153013df72..9fdcaf8c9cd3 100644 --- a/trunk/arch/sparc/include/asm/stat.h +++ b/trunk/include/asm-sparc/stat.h @@ -1,8 +1,8 @@ #ifndef ___ASM_SPARC_STAT_H #define ___ASM_SPARC_STAT_H #if defined(__sparc__) && defined(__arch64__) -#include +#include #else -#include +#include #endif #endif diff --git a/trunk/arch/sparc/include/asm/stat_32.h b/trunk/include/asm-sparc/stat_32.h similarity index 100% rename from trunk/arch/sparc/include/asm/stat_32.h rename to trunk/include/asm-sparc/stat_32.h diff --git a/trunk/arch/sparc/include/asm/stat_64.h b/trunk/include/asm-sparc/stat_64.h similarity index 100% rename from trunk/arch/sparc/include/asm/stat_64.h rename to trunk/include/asm-sparc/stat_64.h diff --git a/trunk/arch/sparc/include/asm/statfs.h b/trunk/include/asm-sparc/statfs.h similarity index 65% rename from trunk/arch/sparc/include/asm/statfs.h rename to trunk/include/asm-sparc/statfs.h index 5e937a73743d..a70cc52e7018 100644 --- a/trunk/arch/sparc/include/asm/statfs.h +++ b/trunk/include/asm-sparc/statfs.h @@ -1,8 +1,8 @@ #ifndef ___ASM_SPARC_STATFS_H #define ___ASM_SPARC_STATFS_H #if defined(__sparc__) && defined(__arch64__) -#include +#include #else -#include +#include #endif #endif diff --git a/trunk/arch/sparc/include/asm/statfs_32.h b/trunk/include/asm-sparc/statfs_32.h similarity index 100% rename from trunk/arch/sparc/include/asm/statfs_32.h rename to trunk/include/asm-sparc/statfs_32.h diff --git a/trunk/arch/sparc/include/asm/statfs_64.h b/trunk/include/asm-sparc/statfs_64.h similarity index 100% rename from trunk/arch/sparc/include/asm/statfs_64.h rename to trunk/include/asm-sparc/statfs_64.h diff --git a/trunk/arch/sparc/include/asm/string.h b/trunk/include/asm-sparc/string.h similarity index 65% rename from trunk/arch/sparc/include/asm/string.h rename to trunk/include/asm-sparc/string.h index 98b72a0c8e6e..14c04c7697a5 100644 --- a/trunk/arch/sparc/include/asm/string.h +++ b/trunk/include/asm-sparc/string.h @@ -1,8 +1,8 @@ #ifndef ___ASM_SPARC_STRING_H #define ___ASM_SPARC_STRING_H #if defined(__sparc__) && defined(__arch64__) -#include +#include #else -#include +#include #endif #endif diff --git a/trunk/arch/sparc/include/asm/string_32.h b/trunk/include/asm-sparc/string_32.h similarity index 100% rename from trunk/arch/sparc/include/asm/string_32.h rename to trunk/include/asm-sparc/string_32.h diff --git a/trunk/arch/sparc/include/asm/string_64.h b/trunk/include/asm-sparc/string_64.h similarity index 100% rename from trunk/arch/sparc/include/asm/string_64.h rename to trunk/include/asm-sparc/string_64.h diff --git a/trunk/arch/sparc/include/asm/sun4paddr.h b/trunk/include/asm-sparc/sun4paddr.h similarity index 100% rename from trunk/arch/sparc/include/asm/sun4paddr.h rename to trunk/include/asm-sparc/sun4paddr.h diff --git a/trunk/arch/sparc/include/asm/sun4prom.h b/trunk/include/asm-sparc/sun4prom.h similarity index 100% rename from trunk/arch/sparc/include/asm/sun4prom.h rename to trunk/include/asm-sparc/sun4prom.h diff --git a/trunk/arch/sparc/include/asm/sunbpp.h b/trunk/include/asm-sparc/sunbpp.h similarity index 99% rename from trunk/arch/sparc/include/asm/sunbpp.h rename to trunk/include/asm-sparc/sunbpp.h index d81a02eaf78b..92ee1a8ff3a2 100644 --- a/trunk/arch/sparc/include/asm/sunbpp.h +++ b/trunk/include/asm-sparc/sunbpp.h @@ -1,5 +1,5 @@ /* - * include/asm/sunbpp.h + * include/asm-sparc/sunbpp.h */ #ifndef _ASM_SPARC_SUNBPP_H diff --git a/trunk/arch/sparc/include/asm/swift.h b/trunk/include/asm-sparc/swift.h similarity index 100% rename from trunk/arch/sparc/include/asm/swift.h rename to trunk/include/asm-sparc/swift.h diff --git a/trunk/arch/sparc/include/asm/syscalls.h b/trunk/include/asm-sparc/syscalls.h similarity index 100% rename from trunk/arch/sparc/include/asm/syscalls.h rename to trunk/include/asm-sparc/syscalls.h diff --git a/trunk/arch/sparc/include/asm/sysen.h b/trunk/include/asm-sparc/sysen.h similarity index 100% rename from trunk/arch/sparc/include/asm/sysen.h rename to trunk/include/asm-sparc/sysen.h diff --git a/trunk/arch/sparc/include/asm/system.h b/trunk/include/asm-sparc/system.h similarity index 65% rename from trunk/arch/sparc/include/asm/system.h rename to trunk/include/asm-sparc/system.h index 7944a7cfc996..15e2a3bc4f61 100644 --- a/trunk/arch/sparc/include/asm/system.h +++ b/trunk/include/asm-sparc/system.h @@ -1,8 +1,8 @@ #ifndef ___ASM_SPARC_SYSTEM_H #define ___ASM_SPARC_SYSTEM_H #if defined(__sparc__) && defined(__arch64__) -#include +#include #else -#include +#include #endif #endif diff --git a/trunk/arch/sparc/include/asm/system_32.h b/trunk/include/asm-sparc/system_32.h similarity index 100% rename from trunk/arch/sparc/include/asm/system_32.h rename to trunk/include/asm-sparc/system_32.h diff --git a/trunk/arch/sparc/include/asm/system_64.h b/trunk/include/asm-sparc/system_64.h similarity index 100% rename from trunk/arch/sparc/include/asm/system_64.h rename to trunk/include/asm-sparc/system_64.h diff --git a/trunk/arch/sparc/include/asm/termbits.h b/trunk/include/asm-sparc/termbits.h similarity index 100% rename from trunk/arch/sparc/include/asm/termbits.h rename to trunk/include/asm-sparc/termbits.h diff --git a/trunk/arch/sparc/include/asm/termios.h b/trunk/include/asm-sparc/termios.h similarity index 100% rename from trunk/arch/sparc/include/asm/termios.h rename to trunk/include/asm-sparc/termios.h diff --git a/trunk/arch/sparc/include/asm/thread_info.h b/trunk/include/asm-sparc/thread_info.h similarity index 64% rename from trunk/arch/sparc/include/asm/thread_info.h rename to trunk/include/asm-sparc/thread_info.h index 122d7acc07e6..64155cf89f37 100644 --- a/trunk/arch/sparc/include/asm/thread_info.h +++ b/trunk/include/asm-sparc/thread_info.h @@ -1,8 +1,8 @@ #ifndef ___ASM_SPARC_THREAD_INFO_H #define ___ASM_SPARC_THREAD_INFO_H #if defined(__sparc__) && defined(__arch64__) -#include +#include #else -#include +#include #endif #endif diff --git a/trunk/arch/sparc/include/asm/thread_info_32.h b/trunk/include/asm-sparc/thread_info_32.h similarity index 95% rename from trunk/arch/sparc/include/asm/thread_info_32.h rename to trunk/include/asm-sparc/thread_info_32.h index cbb892d0dff0..2cf9db044055 100644 --- a/trunk/arch/sparc/include/asm/thread_info_32.h +++ b/trunk/include/asm-sparc/thread_info_32.h @@ -130,7 +130,7 @@ BTFIXUPDEF_CALL(void, free_thread_info, struct thread_info *) * thread information flag bit numbers */ #define TIF_SYSCALL_TRACE 0 /* syscall trace active */ -#define TIF_NOTIFY_RESUME 1 /* callback before returning to user */ +/* flag bit 1 is available */ #define TIF_SIGPENDING 2 /* signal pending */ #define TIF_NEED_RESCHED 3 /* rescheduling necessary */ #define TIF_RESTORE_SIGMASK 4 /* restore signal mask in do_signal() */ @@ -142,17 +142,12 @@ BTFIXUPDEF_CALL(void, free_thread_info, struct thread_info *) /* as above, but as bit values */ #define _TIF_SYSCALL_TRACE (1< +#include #else -#include +#include #endif #endif diff --git a/trunk/arch/sparc/include/asm/timer_32.h b/trunk/include/asm-sparc/timer_32.h similarity index 100% rename from trunk/arch/sparc/include/asm/timer_32.h rename to trunk/include/asm-sparc/timer_32.h diff --git a/trunk/arch/sparc/include/asm/timer_64.h b/trunk/include/asm-sparc/timer_64.h similarity index 100% rename from trunk/arch/sparc/include/asm/timer_64.h rename to trunk/include/asm-sparc/timer_64.h diff --git a/trunk/arch/sparc/include/asm/timex.h b/trunk/include/asm-sparc/timex.h similarity index 65% rename from trunk/arch/sparc/include/asm/timex.h rename to trunk/include/asm-sparc/timex.h index 70cc37b73827..01d9f199d452 100644 --- a/trunk/arch/sparc/include/asm/timex.h +++ b/trunk/include/asm-sparc/timex.h @@ -1,8 +1,8 @@ #ifndef ___ASM_SPARC_TIMEX_H #define ___ASM_SPARC_TIMEX_H #if defined(__sparc__) && defined(__arch64__) -#include +#include #else -#include +#include #endif #endif diff --git a/trunk/arch/sparc/include/asm/timex_32.h b/trunk/include/asm-sparc/timex_32.h similarity index 89% rename from trunk/arch/sparc/include/asm/timex_32.h rename to trunk/include/asm-sparc/timex_32.h index b6ccdb0d6f7d..71b45c90ccae 100644 --- a/trunk/arch/sparc/include/asm/timex_32.h +++ b/trunk/include/asm-sparc/timex_32.h @@ -1,5 +1,5 @@ /* - * linux/include/asm/timex.h + * linux/include/asm-sparc/timex.h * * sparc architecture timex specifications */ diff --git a/trunk/arch/sparc/include/asm/timex_64.h b/trunk/include/asm-sparc/timex_64.h similarity index 90% rename from trunk/arch/sparc/include/asm/timex_64.h rename to trunk/include/asm-sparc/timex_64.h index 18b30bc9823b..c622535c4560 100644 --- a/trunk/arch/sparc/include/asm/timex_64.h +++ b/trunk/include/asm-sparc/timex_64.h @@ -1,5 +1,5 @@ /* - * linux/include/asm/timex.h + * linux/include/asm-sparc64/timex.h * * sparc64 architecture timex specifications */ diff --git a/trunk/arch/sparc/include/asm/tlb.h b/trunk/include/asm-sparc/tlb.h similarity index 66% rename from trunk/arch/sparc/include/asm/tlb.h rename to trunk/include/asm-sparc/tlb.h index 92d0393bbcdc..a821057327c4 100644 --- a/trunk/arch/sparc/include/asm/tlb.h +++ b/trunk/include/asm-sparc/tlb.h @@ -1,8 +1,8 @@ #ifndef ___ASM_SPARC_TLB_H #define ___ASM_SPARC_TLB_H #if defined(__sparc__) && defined(__arch64__) -#include +#include #else -#include +#include #endif #endif diff --git a/trunk/arch/sparc/include/asm/tlb_32.h b/trunk/include/asm-sparc/tlb_32.h similarity index 100% rename from trunk/arch/sparc/include/asm/tlb_32.h rename to trunk/include/asm-sparc/tlb_32.h diff --git a/trunk/arch/sparc/include/asm/tlb_64.h b/trunk/include/asm-sparc/tlb_64.h similarity index 100% rename from trunk/arch/sparc/include/asm/tlb_64.h rename to trunk/include/asm-sparc/tlb_64.h diff --git a/trunk/arch/sparc/include/asm/tlbflush.h b/trunk/include/asm-sparc/tlbflush.h similarity index 65% rename from trunk/arch/sparc/include/asm/tlbflush.h rename to trunk/include/asm-sparc/tlbflush.h index 2c9629fad1e2..6e6bc12227b8 100644 --- a/trunk/arch/sparc/include/asm/tlbflush.h +++ b/trunk/include/asm-sparc/tlbflush.h @@ -1,8 +1,8 @@ #ifndef ___ASM_SPARC_TLBFLUSH_H #define ___ASM_SPARC_TLBFLUSH_H #if defined(__sparc__) && defined(__arch64__) -#include +#include #else -#include +#include #endif #endif diff --git a/trunk/arch/sparc/include/asm/tlbflush_32.h b/trunk/include/asm-sparc/tlbflush_32.h similarity index 100% rename from trunk/arch/sparc/include/asm/tlbflush_32.h rename to trunk/include/asm-sparc/tlbflush_32.h diff --git a/trunk/arch/sparc/include/asm/tlbflush_64.h b/trunk/include/asm-sparc/tlbflush_64.h similarity index 100% rename from trunk/arch/sparc/include/asm/tlbflush_64.h rename to trunk/include/asm-sparc/tlbflush_64.h diff --git a/trunk/arch/sparc/include/asm/topology.h b/trunk/include/asm-sparc/topology.h similarity index 65% rename from trunk/arch/sparc/include/asm/topology.h rename to trunk/include/asm-sparc/topology.h index ee4f191d394a..ed13630f32e2 100644 --- a/trunk/arch/sparc/include/asm/topology.h +++ b/trunk/include/asm-sparc/topology.h @@ -1,8 +1,8 @@ #ifndef ___ASM_SPARC_TOPOLOGY_H #define ___ASM_SPARC_TOPOLOGY_H #if defined(__sparc__) && defined(__arch64__) -#include +#include #else -#include +#include #endif #endif diff --git a/trunk/arch/sparc/include/asm/topology_32.h b/trunk/include/asm-sparc/topology_32.h similarity index 100% rename from trunk/arch/sparc/include/asm/topology_32.h rename to trunk/include/asm-sparc/topology_32.h diff --git a/trunk/arch/sparc/include/asm/topology_64.h b/trunk/include/asm-sparc/topology_64.h similarity index 100% rename from trunk/arch/sparc/include/asm/topology_64.h rename to trunk/include/asm-sparc/topology_64.h diff --git a/trunk/arch/sparc/include/asm/traps.h b/trunk/include/asm-sparc/traps.h similarity index 100% rename from trunk/arch/sparc/include/asm/traps.h rename to trunk/include/asm-sparc/traps.h diff --git a/trunk/arch/sparc/include/asm/tsb.h b/trunk/include/asm-sparc/tsb.h similarity index 100% rename from trunk/arch/sparc/include/asm/tsb.h rename to trunk/include/asm-sparc/tsb.h diff --git a/trunk/arch/sparc/include/asm/tsunami.h b/trunk/include/asm-sparc/tsunami.h similarity index 100% rename from trunk/arch/sparc/include/asm/tsunami.h rename to trunk/include/asm-sparc/tsunami.h diff --git a/trunk/arch/sparc/include/asm/ttable.h b/trunk/include/asm-sparc/ttable.h similarity index 100% rename from trunk/arch/sparc/include/asm/ttable.h rename to trunk/include/asm-sparc/ttable.h diff --git a/trunk/arch/sparc/include/asm/turbosparc.h b/trunk/include/asm-sparc/turbosparc.h similarity index 100% rename from trunk/arch/sparc/include/asm/turbosparc.h rename to trunk/include/asm-sparc/turbosparc.h diff --git a/trunk/arch/sparc/include/asm/types.h b/trunk/include/asm-sparc/types.h similarity index 100% rename from trunk/arch/sparc/include/asm/types.h rename to trunk/include/asm-sparc/types.h diff --git a/trunk/arch/sparc/include/asm/uaccess.h b/trunk/include/asm-sparc/uaccess.h similarity index 65% rename from trunk/arch/sparc/include/asm/uaccess.h rename to trunk/include/asm-sparc/uaccess.h index e88fbe5c0457..424facce5238 100644 --- a/trunk/arch/sparc/include/asm/uaccess.h +++ b/trunk/include/asm-sparc/uaccess.h @@ -1,8 +1,8 @@ #ifndef ___ASM_SPARC_UACCESS_H #define ___ASM_SPARC_UACCESS_H #if defined(__sparc__) && defined(__arch64__) -#include +#include #else -#include +#include #endif #endif diff --git a/trunk/arch/sparc/include/asm/uaccess_32.h b/trunk/include/asm-sparc/uaccess_32.h similarity index 100% rename from trunk/arch/sparc/include/asm/uaccess_32.h rename to trunk/include/asm-sparc/uaccess_32.h diff --git a/trunk/arch/sparc/include/asm/uaccess_64.h b/trunk/include/asm-sparc/uaccess_64.h similarity index 100% rename from trunk/arch/sparc/include/asm/uaccess_64.h rename to trunk/include/asm-sparc/uaccess_64.h diff --git a/trunk/arch/sparc/include/asm/uctx.h b/trunk/include/asm-sparc/uctx.h similarity index 100% rename from trunk/arch/sparc/include/asm/uctx.h rename to trunk/include/asm-sparc/uctx.h diff --git a/trunk/arch/sparc/include/asm/unaligned.h b/trunk/include/asm-sparc/unaligned.h similarity index 100% rename from trunk/arch/sparc/include/asm/unaligned.h rename to trunk/include/asm-sparc/unaligned.h diff --git a/trunk/arch/sparc/include/asm/unistd.h b/trunk/include/asm-sparc/unistd.h similarity index 65% rename from trunk/arch/sparc/include/asm/unistd.h rename to trunk/include/asm-sparc/unistd.h index 4207fb362da0..3c2609618a09 100644 --- a/trunk/arch/sparc/include/asm/unistd.h +++ b/trunk/include/asm-sparc/unistd.h @@ -1,8 +1,8 @@ #ifndef ___ASM_SPARC_UNISTD_H #define ___ASM_SPARC_UNISTD_H #if defined(__sparc__) && defined(__arch64__) -#include +#include #else -#include +#include #endif #endif diff --git a/trunk/arch/sparc/include/asm/unistd_32.h b/trunk/include/asm-sparc/unistd_32.h similarity index 100% rename from trunk/arch/sparc/include/asm/unistd_32.h rename to trunk/include/asm-sparc/unistd_32.h diff --git a/trunk/arch/sparc/include/asm/unistd_64.h b/trunk/include/asm-sparc/unistd_64.h similarity index 100% rename from trunk/arch/sparc/include/asm/unistd_64.h rename to trunk/include/asm-sparc/unistd_64.h diff --git a/trunk/arch/sparc/include/asm/upa.h b/trunk/include/asm-sparc/upa.h similarity index 100% rename from trunk/arch/sparc/include/asm/upa.h rename to trunk/include/asm-sparc/upa.h diff --git a/trunk/arch/sparc/include/asm/user.h b/trunk/include/asm-sparc/user.h similarity index 100% rename from trunk/arch/sparc/include/asm/user.h rename to trunk/include/asm-sparc/user.h diff --git a/trunk/arch/sparc/include/asm/utrap.h b/trunk/include/asm-sparc/utrap.h similarity index 97% rename from trunk/arch/sparc/include/asm/utrap.h rename to trunk/include/asm-sparc/utrap.h index b10e527c22d9..9da37babbe5b 100644 --- a/trunk/arch/sparc/include/asm/utrap.h +++ b/trunk/include/asm-sparc/utrap.h @@ -1,5 +1,5 @@ /* - * include/asm/utrap.h + * include/asm-sparc64/utrap.h * * Copyright (C) 1997 Jakub Jelinek (jj@sunsite.mff.cuni.cz) */ diff --git a/trunk/arch/sparc/include/asm/vac-ops.h b/trunk/include/asm-sparc/vac-ops.h similarity index 100% rename from trunk/arch/sparc/include/asm/vac-ops.h rename to trunk/include/asm-sparc/vac-ops.h diff --git a/trunk/arch/sparc/include/asm/vaddrs.h b/trunk/include/asm-sparc/vaddrs.h similarity index 97% rename from trunk/arch/sparc/include/asm/vaddrs.h rename to trunk/include/asm-sparc/vaddrs.h index 541e13755cec..a22fed5a3c6b 100644 --- a/trunk/arch/sparc/include/asm/vaddrs.h +++ b/trunk/include/asm-sparc/vaddrs.h @@ -4,7 +4,7 @@ #include /* - * asm/vaddrs.h: Here we define the virtual addresses at + * asm-sparc/vaddrs.h: Here we define the virtual addresses at * which important things will be mapped. * * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) diff --git a/trunk/arch/sparc/include/asm/vfc_ioctls.h b/trunk/include/asm-sparc/vfc_ioctls.h similarity index 100% rename from trunk/arch/sparc/include/asm/vfc_ioctls.h rename to trunk/include/asm-sparc/vfc_ioctls.h diff --git a/trunk/arch/sparc/include/asm/vga.h b/trunk/include/asm-sparc/vga.h similarity index 100% rename from trunk/arch/sparc/include/asm/vga.h rename to trunk/include/asm-sparc/vga.h diff --git a/trunk/arch/sparc/include/asm/viking.h b/trunk/include/asm-sparc/viking.h similarity index 100% rename from trunk/arch/sparc/include/asm/viking.h rename to trunk/include/asm-sparc/viking.h diff --git a/trunk/arch/sparc/include/asm/vio.h b/trunk/include/asm-sparc/vio.h similarity index 100% rename from trunk/arch/sparc/include/asm/vio.h rename to trunk/include/asm-sparc/vio.h diff --git a/trunk/arch/sparc/include/asm/visasm.h b/trunk/include/asm-sparc/visasm.h similarity index 100% rename from trunk/arch/sparc/include/asm/visasm.h rename to trunk/include/asm-sparc/visasm.h diff --git a/trunk/arch/sparc/include/asm/watchdog.h b/trunk/include/asm-sparc/watchdog.h similarity index 100% rename from trunk/arch/sparc/include/asm/watchdog.h rename to trunk/include/asm-sparc/watchdog.h diff --git a/trunk/arch/sparc/include/asm/winmacro.h b/trunk/include/asm-sparc/winmacro.h similarity index 100% rename from trunk/arch/sparc/include/asm/winmacro.h rename to trunk/include/asm-sparc/winmacro.h diff --git a/trunk/arch/sparc/include/asm/xor.h b/trunk/include/asm-sparc/xor.h similarity index 66% rename from trunk/arch/sparc/include/asm/xor.h rename to trunk/include/asm-sparc/xor.h index 8ed591c7db2d..35089a838c3f 100644 --- a/trunk/arch/sparc/include/asm/xor.h +++ b/trunk/include/asm-sparc/xor.h @@ -1,8 +1,8 @@ #ifndef ___ASM_SPARC_XOR_H #define ___ASM_SPARC_XOR_H #if defined(__sparc__) && defined(__arch64__) -#include +#include #else -#include +#include #endif #endif diff --git a/trunk/arch/sparc/include/asm/xor_32.h b/trunk/include/asm-sparc/xor_32.h similarity index 99% rename from trunk/arch/sparc/include/asm/xor_32.h rename to trunk/include/asm-sparc/xor_32.h index 44bfa0787f3f..f34b2cfa8206 100644 --- a/trunk/arch/sparc/include/asm/xor_32.h +++ b/trunk/include/asm-sparc/xor_32.h @@ -1,5 +1,5 @@ /* - * include/asm/xor.h + * include/asm-sparc/xor.h * * Optimized RAID-5 checksumming functions for 32-bit Sparc. * diff --git a/trunk/arch/sparc/include/asm/xor_64.h b/trunk/include/asm-sparc/xor_64.h similarity index 98% rename from trunk/arch/sparc/include/asm/xor_64.h rename to trunk/include/asm-sparc/xor_64.h index bee4bf4be3af..a0233884fc94 100644 --- a/trunk/arch/sparc/include/asm/xor_64.h +++ b/trunk/include/asm-sparc/xor_64.h @@ -1,5 +1,5 @@ /* - * include/asm/xor.h + * include/asm-sparc64/xor.h * * High speed xor_block operation for RAID4/5 utilizing the * UltraSparc Visual Instruction Set and Niagara block-init diff --git a/trunk/include/asm-sparc64/Kbuild b/trunk/include/asm-sparc64/Kbuild new file mode 100644 index 000000000000..6cdaf9d33b38 --- /dev/null +++ b/trunk/include/asm-sparc64/Kbuild @@ -0,0 +1 @@ +# dummy file to avoid breaking make headers_install diff --git a/trunk/include/asm-sparc64/agp.h b/trunk/include/asm-sparc64/agp.h new file mode 100644 index 000000000000..eb8d4b3f5163 --- /dev/null +++ b/trunk/include/asm-sparc64/agp.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/apb.h b/trunk/include/asm-sparc64/apb.h new file mode 100644 index 000000000000..5e236ca6e492 --- /dev/null +++ b/trunk/include/asm-sparc64/apb.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/asi.h b/trunk/include/asm-sparc64/asi.h new file mode 100644 index 000000000000..9b7110c516e8 --- /dev/null +++ b/trunk/include/asm-sparc64/asi.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/atomic.h b/trunk/include/asm-sparc64/atomic.h new file mode 100644 index 000000000000..f5126826ba34 --- /dev/null +++ b/trunk/include/asm-sparc64/atomic.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/auxio.h b/trunk/include/asm-sparc64/auxio.h new file mode 100644 index 000000000000..46c9042f30b4 --- /dev/null +++ b/trunk/include/asm-sparc64/auxio.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/auxvec.h b/trunk/include/asm-sparc64/auxvec.h new file mode 100644 index 000000000000..1f45c67d7316 --- /dev/null +++ b/trunk/include/asm-sparc64/auxvec.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/backoff.h b/trunk/include/asm-sparc64/backoff.h new file mode 100644 index 000000000000..8ee26d947e0e --- /dev/null +++ b/trunk/include/asm-sparc64/backoff.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/bbc.h b/trunk/include/asm-sparc64/bbc.h new file mode 100644 index 000000000000..06e8b6306514 --- /dev/null +++ b/trunk/include/asm-sparc64/bbc.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/bitops.h b/trunk/include/asm-sparc64/bitops.h new file mode 100644 index 000000000000..204404355bdd --- /dev/null +++ b/trunk/include/asm-sparc64/bitops.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/bpp.h b/trunk/include/asm-sparc64/bpp.h new file mode 100644 index 000000000000..514eee20272e --- /dev/null +++ b/trunk/include/asm-sparc64/bpp.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/bug.h b/trunk/include/asm-sparc64/bug.h new file mode 100644 index 000000000000..3433737c7a67 --- /dev/null +++ b/trunk/include/asm-sparc64/bug.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/bugs.h b/trunk/include/asm-sparc64/bugs.h new file mode 100644 index 000000000000..04ae9e2818cf --- /dev/null +++ b/trunk/include/asm-sparc64/bugs.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/byteorder.h b/trunk/include/asm-sparc64/byteorder.h new file mode 100644 index 000000000000..f672855bee17 --- /dev/null +++ b/trunk/include/asm-sparc64/byteorder.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/cache.h b/trunk/include/asm-sparc64/cache.h new file mode 100644 index 000000000000..fa9de5cadbf1 --- /dev/null +++ b/trunk/include/asm-sparc64/cache.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/cacheflush.h b/trunk/include/asm-sparc64/cacheflush.h new file mode 100644 index 000000000000..cf5b6b3e8a55 --- /dev/null +++ b/trunk/include/asm-sparc64/cacheflush.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/chafsr.h b/trunk/include/asm-sparc64/chafsr.h new file mode 100644 index 000000000000..aaab97562a39 --- /dev/null +++ b/trunk/include/asm-sparc64/chafsr.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/checksum.h b/trunk/include/asm-sparc64/checksum.h new file mode 100644 index 000000000000..c3966c5e29d8 --- /dev/null +++ b/trunk/include/asm-sparc64/checksum.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/chmctrl.h b/trunk/include/asm-sparc64/chmctrl.h new file mode 100644 index 000000000000..eb757b483b30 --- /dev/null +++ b/trunk/include/asm-sparc64/chmctrl.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/cmt.h b/trunk/include/asm-sparc64/cmt.h new file mode 100644 index 000000000000..b19b445cb810 --- /dev/null +++ b/trunk/include/asm-sparc64/cmt.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/compat.h b/trunk/include/asm-sparc64/compat.h new file mode 100644 index 000000000000..8c155d221952 --- /dev/null +++ b/trunk/include/asm-sparc64/compat.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/compat_signal.h b/trunk/include/asm-sparc64/compat_signal.h new file mode 100644 index 000000000000..7187dcc8cac7 --- /dev/null +++ b/trunk/include/asm-sparc64/compat_signal.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/cpudata.h b/trunk/include/asm-sparc64/cpudata.h new file mode 100644 index 000000000000..3220e134a579 --- /dev/null +++ b/trunk/include/asm-sparc64/cpudata.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/cputime.h b/trunk/include/asm-sparc64/cputime.h new file mode 100644 index 000000000000..435f37a92f7c --- /dev/null +++ b/trunk/include/asm-sparc64/cputime.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/current.h b/trunk/include/asm-sparc64/current.h new file mode 100644 index 000000000000..a7904a7f53a8 --- /dev/null +++ b/trunk/include/asm-sparc64/current.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/dcr.h b/trunk/include/asm-sparc64/dcr.h new file mode 100644 index 000000000000..d67613b1f5fe --- /dev/null +++ b/trunk/include/asm-sparc64/dcr.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/dcu.h b/trunk/include/asm-sparc64/dcu.h new file mode 100644 index 000000000000..28853f4968d1 --- /dev/null +++ b/trunk/include/asm-sparc64/dcu.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/delay.h b/trunk/include/asm-sparc64/delay.h new file mode 100644 index 000000000000..33dc5589d841 --- /dev/null +++ b/trunk/include/asm-sparc64/delay.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/device.h b/trunk/include/asm-sparc64/device.h new file mode 100644 index 000000000000..4145c47097e2 --- /dev/null +++ b/trunk/include/asm-sparc64/device.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/display7seg.h b/trunk/include/asm-sparc64/display7seg.h new file mode 100644 index 000000000000..e74f046b41de --- /dev/null +++ b/trunk/include/asm-sparc64/display7seg.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/div64.h b/trunk/include/asm-sparc64/div64.h new file mode 100644 index 000000000000..928c94f99ecf --- /dev/null +++ b/trunk/include/asm-sparc64/div64.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/dma-mapping.h b/trunk/include/asm-sparc64/dma-mapping.h new file mode 100644 index 000000000000..380b7b63147f --- /dev/null +++ b/trunk/include/asm-sparc64/dma-mapping.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/dma.h b/trunk/include/asm-sparc64/dma.h new file mode 100644 index 000000000000..2e36248e6b59 --- /dev/null +++ b/trunk/include/asm-sparc64/dma.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/ebus.h b/trunk/include/asm-sparc64/ebus.h new file mode 100644 index 000000000000..d7d476158bd5 --- /dev/null +++ b/trunk/include/asm-sparc64/ebus.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/elf.h b/trunk/include/asm-sparc64/elf.h new file mode 100644 index 000000000000..f256d9472c82 --- /dev/null +++ b/trunk/include/asm-sparc64/elf.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/emergency-restart.h b/trunk/include/asm-sparc64/emergency-restart.h new file mode 100644 index 000000000000..2cac7b644da8 --- /dev/null +++ b/trunk/include/asm-sparc64/emergency-restart.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/envctrl.h b/trunk/include/asm-sparc64/envctrl.h new file mode 100644 index 000000000000..a2cc0ca334ba --- /dev/null +++ b/trunk/include/asm-sparc64/envctrl.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/errno.h b/trunk/include/asm-sparc64/errno.h new file mode 100644 index 000000000000..9701fe01cc53 --- /dev/null +++ b/trunk/include/asm-sparc64/errno.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/estate.h b/trunk/include/asm-sparc64/estate.h new file mode 100644 index 000000000000..bedd0ef5f19c --- /dev/null +++ b/trunk/include/asm-sparc64/estate.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/fb.h b/trunk/include/asm-sparc64/fb.h new file mode 100644 index 000000000000..1c2ac5832f39 --- /dev/null +++ b/trunk/include/asm-sparc64/fb.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/fbio.h b/trunk/include/asm-sparc64/fbio.h new file mode 100644 index 000000000000..c17edf8c7bc4 --- /dev/null +++ b/trunk/include/asm-sparc64/fbio.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/fcntl.h b/trunk/include/asm-sparc64/fcntl.h new file mode 100644 index 000000000000..8b1beae48cd1 --- /dev/null +++ b/trunk/include/asm-sparc64/fcntl.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/fhc.h b/trunk/include/asm-sparc64/fhc.h new file mode 100644 index 000000000000..73eb04c19c47 --- /dev/null +++ b/trunk/include/asm-sparc64/fhc.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/floppy.h b/trunk/include/asm-sparc64/floppy.h new file mode 100644 index 000000000000..214878114436 --- /dev/null +++ b/trunk/include/asm-sparc64/floppy.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/fpumacro.h b/trunk/include/asm-sparc64/fpumacro.h new file mode 100644 index 000000000000..30d6d0f68bc3 --- /dev/null +++ b/trunk/include/asm-sparc64/fpumacro.h @@ -0,0 +1 @@ +#include diff --git a/trunk/arch/sparc/include/asm/ftrace.h b/trunk/include/asm-sparc64/ftrace.h similarity index 100% rename from trunk/arch/sparc/include/asm/ftrace.h rename to trunk/include/asm-sparc64/ftrace.h diff --git a/trunk/include/asm-sparc64/futex.h b/trunk/include/asm-sparc64/futex.h new file mode 100644 index 000000000000..1ceb0bb2fe53 --- /dev/null +++ b/trunk/include/asm-sparc64/futex.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/hardirq.h b/trunk/include/asm-sparc64/hardirq.h new file mode 100644 index 000000000000..63dca3db11f3 --- /dev/null +++ b/trunk/include/asm-sparc64/hardirq.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/head.h b/trunk/include/asm-sparc64/head.h new file mode 100644 index 000000000000..2254c09e53f9 --- /dev/null +++ b/trunk/include/asm-sparc64/head.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/hugetlb.h b/trunk/include/asm-sparc64/hugetlb.h new file mode 100644 index 000000000000..21d8f0a9c243 --- /dev/null +++ b/trunk/include/asm-sparc64/hugetlb.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/hvtramp.h b/trunk/include/asm-sparc64/hvtramp.h new file mode 100644 index 000000000000..fb46bfe934a7 --- /dev/null +++ b/trunk/include/asm-sparc64/hvtramp.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/hw_irq.h b/trunk/include/asm-sparc64/hw_irq.h new file mode 100644 index 000000000000..16920a291f51 --- /dev/null +++ b/trunk/include/asm-sparc64/hw_irq.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/hypervisor.h b/trunk/include/asm-sparc64/hypervisor.h new file mode 100644 index 000000000000..fe7e51a9e429 --- /dev/null +++ b/trunk/include/asm-sparc64/hypervisor.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/ide.h b/trunk/include/asm-sparc64/ide.h new file mode 100644 index 000000000000..7125317a428d --- /dev/null +++ b/trunk/include/asm-sparc64/ide.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/idprom.h b/trunk/include/asm-sparc64/idprom.h new file mode 100644 index 000000000000..c22f9c30bc78 --- /dev/null +++ b/trunk/include/asm-sparc64/idprom.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/intr_queue.h b/trunk/include/asm-sparc64/intr_queue.h new file mode 100644 index 000000000000..f7225015b3db --- /dev/null +++ b/trunk/include/asm-sparc64/intr_queue.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/io.h b/trunk/include/asm-sparc64/io.h new file mode 100644 index 000000000000..25ff258dfd33 --- /dev/null +++ b/trunk/include/asm-sparc64/io.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/ioctl.h b/trunk/include/asm-sparc64/ioctl.h new file mode 100644 index 000000000000..18fc5623ff51 --- /dev/null +++ b/trunk/include/asm-sparc64/ioctl.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/ioctls.h b/trunk/include/asm-sparc64/ioctls.h new file mode 100644 index 000000000000..dcd5540ec103 --- /dev/null +++ b/trunk/include/asm-sparc64/ioctls.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/iommu.h b/trunk/include/asm-sparc64/iommu.h new file mode 100644 index 000000000000..76252bb85e97 --- /dev/null +++ b/trunk/include/asm-sparc64/iommu.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/ipcbuf.h b/trunk/include/asm-sparc64/ipcbuf.h new file mode 100644 index 000000000000..41dfaf1149b5 --- /dev/null +++ b/trunk/include/asm-sparc64/ipcbuf.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/irq.h b/trunk/include/asm-sparc64/irq.h new file mode 100644 index 000000000000..b2102e65947c --- /dev/null +++ b/trunk/include/asm-sparc64/irq.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/irq_regs.h b/trunk/include/asm-sparc64/irq_regs.h new file mode 100644 index 000000000000..1e2b8a1e745a --- /dev/null +++ b/trunk/include/asm-sparc64/irq_regs.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/irqflags.h b/trunk/include/asm-sparc64/irqflags.h new file mode 100644 index 000000000000..27b091fc3fa0 --- /dev/null +++ b/trunk/include/asm-sparc64/irqflags.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/kdebug.h b/trunk/include/asm-sparc64/kdebug.h new file mode 100644 index 000000000000..78cfd5d2749b --- /dev/null +++ b/trunk/include/asm-sparc64/kdebug.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/kgdb.h b/trunk/include/asm-sparc64/kgdb.h new file mode 100644 index 000000000000..aa6532fd3a13 --- /dev/null +++ b/trunk/include/asm-sparc64/kgdb.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/kmap_types.h b/trunk/include/asm-sparc64/kmap_types.h new file mode 100644 index 000000000000..276530cf5395 --- /dev/null +++ b/trunk/include/asm-sparc64/kmap_types.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/kprobes.h b/trunk/include/asm-sparc64/kprobes.h new file mode 100644 index 000000000000..c55e43e4d2a4 --- /dev/null +++ b/trunk/include/asm-sparc64/kprobes.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/ldc.h b/trunk/include/asm-sparc64/ldc.h new file mode 100644 index 000000000000..40f3f231c457 --- /dev/null +++ b/trunk/include/asm-sparc64/ldc.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/linkage.h b/trunk/include/asm-sparc64/linkage.h new file mode 100644 index 000000000000..3ea4fd13f193 --- /dev/null +++ b/trunk/include/asm-sparc64/linkage.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/lmb.h b/trunk/include/asm-sparc64/lmb.h new file mode 100644 index 000000000000..3d04981701e2 --- /dev/null +++ b/trunk/include/asm-sparc64/lmb.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/local.h b/trunk/include/asm-sparc64/local.h new file mode 100644 index 000000000000..c11c530f74d0 --- /dev/null +++ b/trunk/include/asm-sparc64/local.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/lsu.h b/trunk/include/asm-sparc64/lsu.h new file mode 100644 index 000000000000..4e3d8b128a58 --- /dev/null +++ b/trunk/include/asm-sparc64/lsu.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/mc146818rtc.h b/trunk/include/asm-sparc64/mc146818rtc.h new file mode 100644 index 000000000000..97842e6ed1c2 --- /dev/null +++ b/trunk/include/asm-sparc64/mc146818rtc.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/mdesc.h b/trunk/include/asm-sparc64/mdesc.h new file mode 100644 index 000000000000..165a19347286 --- /dev/null +++ b/trunk/include/asm-sparc64/mdesc.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/mman.h b/trunk/include/asm-sparc64/mman.h new file mode 100644 index 000000000000..17ddb1724f51 --- /dev/null +++ b/trunk/include/asm-sparc64/mman.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/mmu.h b/trunk/include/asm-sparc64/mmu.h new file mode 100644 index 000000000000..e677a64d8db1 --- /dev/null +++ b/trunk/include/asm-sparc64/mmu.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/mmu_context.h b/trunk/include/asm-sparc64/mmu_context.h new file mode 100644 index 000000000000..877fee94bd4e --- /dev/null +++ b/trunk/include/asm-sparc64/mmu_context.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/mmzone.h b/trunk/include/asm-sparc64/mmzone.h new file mode 100644 index 000000000000..43a710f7892a --- /dev/null +++ b/trunk/include/asm-sparc64/mmzone.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/module.h b/trunk/include/asm-sparc64/module.h new file mode 100644 index 000000000000..a9606db55e4a --- /dev/null +++ b/trunk/include/asm-sparc64/module.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/mostek.h b/trunk/include/asm-sparc64/mostek.h new file mode 100644 index 000000000000..95a752f7e875 --- /dev/null +++ b/trunk/include/asm-sparc64/mostek.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/msgbuf.h b/trunk/include/asm-sparc64/msgbuf.h new file mode 100644 index 000000000000..5b33cc9d9bfb --- /dev/null +++ b/trunk/include/asm-sparc64/msgbuf.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/mutex.h b/trunk/include/asm-sparc64/mutex.h new file mode 100644 index 000000000000..c0c0f8f260d6 --- /dev/null +++ b/trunk/include/asm-sparc64/mutex.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/ns87303.h b/trunk/include/asm-sparc64/ns87303.h new file mode 100644 index 000000000000..5f369d4df3db --- /dev/null +++ b/trunk/include/asm-sparc64/ns87303.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/of_device.h b/trunk/include/asm-sparc64/of_device.h new file mode 100644 index 000000000000..a769fdbe164a --- /dev/null +++ b/trunk/include/asm-sparc64/of_device.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/of_platform.h b/trunk/include/asm-sparc64/of_platform.h new file mode 100644 index 000000000000..f7c427b8bc61 --- /dev/null +++ b/trunk/include/asm-sparc64/of_platform.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/openprom.h b/trunk/include/asm-sparc64/openprom.h new file mode 100644 index 000000000000..acf4b234fae3 --- /dev/null +++ b/trunk/include/asm-sparc64/openprom.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/openpromio.h b/trunk/include/asm-sparc64/openpromio.h new file mode 100644 index 000000000000..122fabda21f1 --- /dev/null +++ b/trunk/include/asm-sparc64/openpromio.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/oplib.h b/trunk/include/asm-sparc64/oplib.h new file mode 100644 index 000000000000..d93e44e63510 --- /dev/null +++ b/trunk/include/asm-sparc64/oplib.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/page.h b/trunk/include/asm-sparc64/page.h new file mode 100644 index 000000000000..f46c1fb53028 --- /dev/null +++ b/trunk/include/asm-sparc64/page.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/param.h b/trunk/include/asm-sparc64/param.h new file mode 100644 index 000000000000..40c6dc110822 --- /dev/null +++ b/trunk/include/asm-sparc64/param.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/parport.h b/trunk/include/asm-sparc64/parport.h new file mode 100644 index 000000000000..b4e4ca812eb6 --- /dev/null +++ b/trunk/include/asm-sparc64/parport.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/pci.h b/trunk/include/asm-sparc64/pci.h new file mode 100644 index 000000000000..da54c4d1f39c --- /dev/null +++ b/trunk/include/asm-sparc64/pci.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/percpu.h b/trunk/include/asm-sparc64/percpu.h new file mode 100644 index 000000000000..292729bb350f --- /dev/null +++ b/trunk/include/asm-sparc64/percpu.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/perfctr.h b/trunk/include/asm-sparc64/perfctr.h new file mode 100644 index 000000000000..52073a9f8e30 --- /dev/null +++ b/trunk/include/asm-sparc64/perfctr.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/pgalloc.h b/trunk/include/asm-sparc64/pgalloc.h new file mode 100644 index 000000000000..bec31641011c --- /dev/null +++ b/trunk/include/asm-sparc64/pgalloc.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/pgtable.h b/trunk/include/asm-sparc64/pgtable.h new file mode 100644 index 000000000000..9decbd99aeff --- /dev/null +++ b/trunk/include/asm-sparc64/pgtable.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/pil.h b/trunk/include/asm-sparc64/pil.h new file mode 100644 index 000000000000..d805f33f1e0f --- /dev/null +++ b/trunk/include/asm-sparc64/pil.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/poll.h b/trunk/include/asm-sparc64/poll.h new file mode 100644 index 000000000000..8e2f31b4641a --- /dev/null +++ b/trunk/include/asm-sparc64/poll.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/posix_types.h b/trunk/include/asm-sparc64/posix_types.h new file mode 100644 index 000000000000..8cee99200232 --- /dev/null +++ b/trunk/include/asm-sparc64/posix_types.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/processor.h b/trunk/include/asm-sparc64/processor.h new file mode 100644 index 000000000000..21de6cc182eb --- /dev/null +++ b/trunk/include/asm-sparc64/processor.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/prom.h b/trunk/include/asm-sparc64/prom.h new file mode 100644 index 000000000000..5fa166ee3ffa --- /dev/null +++ b/trunk/include/asm-sparc64/prom.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/psrcompat.h b/trunk/include/asm-sparc64/psrcompat.h new file mode 100644 index 000000000000..587846f48358 --- /dev/null +++ b/trunk/include/asm-sparc64/psrcompat.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/pstate.h b/trunk/include/asm-sparc64/pstate.h new file mode 100644 index 000000000000..3ccf0be25360 --- /dev/null +++ b/trunk/include/asm-sparc64/pstate.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/ptrace.h b/trunk/include/asm-sparc64/ptrace.h new file mode 100644 index 000000000000..1a55b9fb3b0c --- /dev/null +++ b/trunk/include/asm-sparc64/ptrace.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/reboot.h b/trunk/include/asm-sparc64/reboot.h new file mode 100644 index 000000000000..0d72eb811cc8 --- /dev/null +++ b/trunk/include/asm-sparc64/reboot.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/reg.h b/trunk/include/asm-sparc64/reg.h new file mode 100644 index 000000000000..495bab27da07 --- /dev/null +++ b/trunk/include/asm-sparc64/reg.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/resource.h b/trunk/include/asm-sparc64/resource.h new file mode 100644 index 000000000000..46e3bc0de476 --- /dev/null +++ b/trunk/include/asm-sparc64/resource.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/rtc.h b/trunk/include/asm-sparc64/rtc.h new file mode 100644 index 000000000000..e49a9685aead --- /dev/null +++ b/trunk/include/asm-sparc64/rtc.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/rwsem-const.h b/trunk/include/asm-sparc64/rwsem-const.h new file mode 100644 index 000000000000..2a1de315c86a --- /dev/null +++ b/trunk/include/asm-sparc64/rwsem-const.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/rwsem.h b/trunk/include/asm-sparc64/rwsem.h new file mode 100644 index 000000000000..6943c56ed087 --- /dev/null +++ b/trunk/include/asm-sparc64/rwsem.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/sbus.h b/trunk/include/asm-sparc64/sbus.h new file mode 100644 index 000000000000..0cab0e89b874 --- /dev/null +++ b/trunk/include/asm-sparc64/sbus.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/scatterlist.h b/trunk/include/asm-sparc64/scatterlist.h new file mode 100644 index 000000000000..b7fef95953ca --- /dev/null +++ b/trunk/include/asm-sparc64/scatterlist.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/scratchpad.h b/trunk/include/asm-sparc64/scratchpad.h new file mode 100644 index 000000000000..23675f6a915a --- /dev/null +++ b/trunk/include/asm-sparc64/scratchpad.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/seccomp.h b/trunk/include/asm-sparc64/seccomp.h new file mode 100644 index 000000000000..f22f02a08a61 --- /dev/null +++ b/trunk/include/asm-sparc64/seccomp.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/sections.h b/trunk/include/asm-sparc64/sections.h new file mode 100644 index 000000000000..721496f8b2be --- /dev/null +++ b/trunk/include/asm-sparc64/sections.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/sembuf.h b/trunk/include/asm-sparc64/sembuf.h new file mode 100644 index 000000000000..c55b95214136 --- /dev/null +++ b/trunk/include/asm-sparc64/sembuf.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/setup.h b/trunk/include/asm-sparc64/setup.h new file mode 100644 index 000000000000..7143d06b2c55 --- /dev/null +++ b/trunk/include/asm-sparc64/setup.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/sfafsr.h b/trunk/include/asm-sparc64/sfafsr.h new file mode 100644 index 000000000000..8036fc377a4d --- /dev/null +++ b/trunk/include/asm-sparc64/sfafsr.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/sfp-machine.h b/trunk/include/asm-sparc64/sfp-machine.h new file mode 100644 index 000000000000..7bbc4fecdc7d --- /dev/null +++ b/trunk/include/asm-sparc64/sfp-machine.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/shmbuf.h b/trunk/include/asm-sparc64/shmbuf.h new file mode 100644 index 000000000000..0c54a2d68681 --- /dev/null +++ b/trunk/include/asm-sparc64/shmbuf.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/shmparam.h b/trunk/include/asm-sparc64/shmparam.h new file mode 100644 index 000000000000..5fa3a9b05e7f --- /dev/null +++ b/trunk/include/asm-sparc64/shmparam.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/sigcontext.h b/trunk/include/asm-sparc64/sigcontext.h new file mode 100644 index 000000000000..5b16dcce44f2 --- /dev/null +++ b/trunk/include/asm-sparc64/sigcontext.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/siginfo.h b/trunk/include/asm-sparc64/siginfo.h new file mode 100644 index 000000000000..8ffd6ebabc7a --- /dev/null +++ b/trunk/include/asm-sparc64/siginfo.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/signal.h b/trunk/include/asm-sparc64/signal.h new file mode 100644 index 000000000000..79705e5d49c3 --- /dev/null +++ b/trunk/include/asm-sparc64/signal.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/smp.h b/trunk/include/asm-sparc64/smp.h new file mode 100644 index 000000000000..5095a2cbea52 --- /dev/null +++ b/trunk/include/asm-sparc64/smp.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/socket.h b/trunk/include/asm-sparc64/socket.h new file mode 100644 index 000000000000..13e0d5d94bb3 --- /dev/null +++ b/trunk/include/asm-sparc64/socket.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/sockios.h b/trunk/include/asm-sparc64/sockios.h new file mode 100644 index 000000000000..2cb4b641482c --- /dev/null +++ b/trunk/include/asm-sparc64/sockios.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/sparsemem.h b/trunk/include/asm-sparc64/sparsemem.h new file mode 100644 index 000000000000..e681f22a97ae --- /dev/null +++ b/trunk/include/asm-sparc64/sparsemem.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/spinlock.h b/trunk/include/asm-sparc64/spinlock.h new file mode 100644 index 000000000000..0115b8156eb8 --- /dev/null +++ b/trunk/include/asm-sparc64/spinlock.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/spinlock_types.h b/trunk/include/asm-sparc64/spinlock_types.h new file mode 100644 index 000000000000..48d81c8734b5 --- /dev/null +++ b/trunk/include/asm-sparc64/spinlock_types.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/spitfire.h b/trunk/include/asm-sparc64/spitfire.h new file mode 100644 index 000000000000..4430d2fbb0dc --- /dev/null +++ b/trunk/include/asm-sparc64/spitfire.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/sstate.h b/trunk/include/asm-sparc64/sstate.h new file mode 100644 index 000000000000..97720ce2fd43 --- /dev/null +++ b/trunk/include/asm-sparc64/sstate.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/stacktrace.h b/trunk/include/asm-sparc64/stacktrace.h new file mode 100644 index 000000000000..adc9b92c0ef1 --- /dev/null +++ b/trunk/include/asm-sparc64/stacktrace.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/starfire.h b/trunk/include/asm-sparc64/starfire.h new file mode 100644 index 000000000000..db97daa3bed4 --- /dev/null +++ b/trunk/include/asm-sparc64/starfire.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/stat.h b/trunk/include/asm-sparc64/stat.h new file mode 100644 index 000000000000..b108a866256b --- /dev/null +++ b/trunk/include/asm-sparc64/stat.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/statfs.h b/trunk/include/asm-sparc64/statfs.h new file mode 100644 index 000000000000..5503d6a4c67e --- /dev/null +++ b/trunk/include/asm-sparc64/statfs.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/string.h b/trunk/include/asm-sparc64/string.h new file mode 100644 index 000000000000..5018cd8b6ad0 --- /dev/null +++ b/trunk/include/asm-sparc64/string.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/sunbpp.h b/trunk/include/asm-sparc64/sunbpp.h new file mode 100644 index 000000000000..9632be290eb5 --- /dev/null +++ b/trunk/include/asm-sparc64/sunbpp.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/syscalls.h b/trunk/include/asm-sparc64/syscalls.h new file mode 100644 index 000000000000..3477b16e30ca --- /dev/null +++ b/trunk/include/asm-sparc64/syscalls.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/system.h b/trunk/include/asm-sparc64/system.h new file mode 100644 index 000000000000..be2603c2e527 --- /dev/null +++ b/trunk/include/asm-sparc64/system.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/termbits.h b/trunk/include/asm-sparc64/termbits.h new file mode 100644 index 000000000000..e03f97592c70 --- /dev/null +++ b/trunk/include/asm-sparc64/termbits.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/termios.h b/trunk/include/asm-sparc64/termios.h new file mode 100644 index 000000000000..940495eb05cc --- /dev/null +++ b/trunk/include/asm-sparc64/termios.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/thread_info.h b/trunk/include/asm-sparc64/thread_info.h new file mode 100644 index 000000000000..92bed7913395 --- /dev/null +++ b/trunk/include/asm-sparc64/thread_info.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/timer.h b/trunk/include/asm-sparc64/timer.h new file mode 100644 index 000000000000..88026d83cc93 --- /dev/null +++ b/trunk/include/asm-sparc64/timer.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/timex.h b/trunk/include/asm-sparc64/timex.h new file mode 100644 index 000000000000..8dd59ee24b48 --- /dev/null +++ b/trunk/include/asm-sparc64/timex.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/tlb.h b/trunk/include/asm-sparc64/tlb.h new file mode 100644 index 000000000000..ae92fce10936 --- /dev/null +++ b/trunk/include/asm-sparc64/tlb.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/tlbflush.h b/trunk/include/asm-sparc64/tlbflush.h new file mode 100644 index 000000000000..a43979a06cd9 --- /dev/null +++ b/trunk/include/asm-sparc64/tlbflush.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/topology.h b/trunk/include/asm-sparc64/topology.h new file mode 100644 index 000000000000..46999b60fbba --- /dev/null +++ b/trunk/include/asm-sparc64/topology.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/tsb.h b/trunk/include/asm-sparc64/tsb.h new file mode 100644 index 000000000000..3677a302ea3e --- /dev/null +++ b/trunk/include/asm-sparc64/tsb.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/ttable.h b/trunk/include/asm-sparc64/ttable.h new file mode 100644 index 000000000000..a550f1bf6f9b --- /dev/null +++ b/trunk/include/asm-sparc64/ttable.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/types.h b/trunk/include/asm-sparc64/types.h new file mode 100644 index 000000000000..cfbfad5043eb --- /dev/null +++ b/trunk/include/asm-sparc64/types.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/uaccess.h b/trunk/include/asm-sparc64/uaccess.h new file mode 100644 index 000000000000..2872d22844f3 --- /dev/null +++ b/trunk/include/asm-sparc64/uaccess.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/uctx.h b/trunk/include/asm-sparc64/uctx.h new file mode 100644 index 000000000000..9e1b5794b07f --- /dev/null +++ b/trunk/include/asm-sparc64/uctx.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/unaligned.h b/trunk/include/asm-sparc64/unaligned.h new file mode 100644 index 000000000000..19fbf9508acf --- /dev/null +++ b/trunk/include/asm-sparc64/unaligned.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/unistd.h b/trunk/include/asm-sparc64/unistd.h new file mode 100644 index 000000000000..ad86e0b7a455 --- /dev/null +++ b/trunk/include/asm-sparc64/unistd.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/upa.h b/trunk/include/asm-sparc64/upa.h new file mode 100644 index 000000000000..aab72930815a --- /dev/null +++ b/trunk/include/asm-sparc64/upa.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/user.h b/trunk/include/asm-sparc64/user.h new file mode 100644 index 000000000000..29fc6e906c29 --- /dev/null +++ b/trunk/include/asm-sparc64/user.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/utrap.h b/trunk/include/asm-sparc64/utrap.h new file mode 100644 index 000000000000..b030a41f1895 --- /dev/null +++ b/trunk/include/asm-sparc64/utrap.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/vga.h b/trunk/include/asm-sparc64/vga.h new file mode 100644 index 000000000000..fbf4d58a56f0 --- /dev/null +++ b/trunk/include/asm-sparc64/vga.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/vio.h b/trunk/include/asm-sparc64/vio.h new file mode 100644 index 000000000000..299b26ab81a7 --- /dev/null +++ b/trunk/include/asm-sparc64/vio.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/visasm.h b/trunk/include/asm-sparc64/visasm.h new file mode 100644 index 000000000000..837a12278f4a --- /dev/null +++ b/trunk/include/asm-sparc64/visasm.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/watchdog.h b/trunk/include/asm-sparc64/watchdog.h new file mode 100644 index 000000000000..b0f2857145f7 --- /dev/null +++ b/trunk/include/asm-sparc64/watchdog.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/asm-sparc64/xor.h b/trunk/include/asm-sparc64/xor.h new file mode 100644 index 000000000000..ef187cc07ed5 --- /dev/null +++ b/trunk/include/asm-sparc64/xor.h @@ -0,0 +1 @@ +#include diff --git a/trunk/include/linux/sched.h b/trunk/include/linux/sched.h index 5270d449ff9d..034c1ca6b332 100644 --- a/trunk/include/linux/sched.h +++ b/trunk/include/linux/sched.h @@ -505,7 +505,7 @@ struct signal_struct { unsigned long nvcsw, nivcsw, cnvcsw, cnivcsw; unsigned long min_flt, maj_flt, cmin_flt, cmaj_flt; unsigned long inblock, oublock, cinblock, coublock; - struct task_io_accounting ioac; + struct proc_io_accounting ioac; /* * Cumulative ns of scheduled CPU time for dead threads in the @@ -1253,7 +1253,7 @@ struct task_struct { unsigned long ptrace_message; siginfo_t *last_siginfo; /* For ptrace use. */ - struct task_io_accounting ioac; + struct proc_io_accounting ioac; #if defined(CONFIG_TASK_XACCT) u64 acct_rss_mem1; /* accumulated rss usage */ u64 acct_vm_mem1; /* accumulated virtual memory usage */ @@ -2183,22 +2183,22 @@ extern long sched_group_rt_period(struct task_group *tg); #ifdef CONFIG_TASK_XACCT static inline void add_rchar(struct task_struct *tsk, ssize_t amt) { - tsk->ioac.rchar += amt; + tsk->ioac.chr.rchar += amt; } static inline void add_wchar(struct task_struct *tsk, ssize_t amt) { - tsk->ioac.wchar += amt; + tsk->ioac.chr.wchar += amt; } static inline void inc_syscr(struct task_struct *tsk) { - tsk->ioac.syscr++; + tsk->ioac.chr.syscr++; } static inline void inc_syscw(struct task_struct *tsk) { - tsk->ioac.syscw++; + tsk->ioac.chr.syscw++; } #else static inline void add_rchar(struct task_struct *tsk, ssize_t amt) diff --git a/trunk/include/linux/task_io_accounting.h b/trunk/include/linux/task_io_accounting.h index 5e88afc9a2fb..165390f8b936 100644 --- a/trunk/include/linux/task_io_accounting.h +++ b/trunk/include/linux/task_io_accounting.h @@ -1,5 +1,5 @@ /* - * task_io_accounting: a structure which is used for recording a single task's + * proc_io_accounting: a structure which is used for recording a single task's * IO statistics. * * Don't include this header file directly - it is designed to be dragged in via @@ -8,8 +8,8 @@ * Blame akpm@osdl.org for all this. */ -struct task_io_accounting { #ifdef CONFIG_TASK_XACCT +struct task_chr_io_accounting { /* bytes read */ u64 rchar; /* bytes written */ @@ -18,9 +18,14 @@ struct task_io_accounting { u64 syscr; /* # of write syscalls */ u64 syscw; +}; +#else /* CONFIG_TASK_XACCT */ +struct task_chr_io_accounting { +}; #endif /* CONFIG_TASK_XACCT */ #ifdef CONFIG_TASK_IO_ACCOUNTING +struct task_io_accounting { /* * The number of bytes which this task has caused to be read from * storage. @@ -41,5 +46,13 @@ struct task_io_accounting { * information loss in doing that. */ u64 cancelled_write_bytes; +}; +#else /* CONFIG_TASK_IO_ACCOUNTING */ +struct task_io_accounting { +}; #endif /* CONFIG_TASK_IO_ACCOUNTING */ + +struct proc_io_accounting { + struct task_chr_io_accounting chr; + struct task_io_accounting blk; }; diff --git a/trunk/include/linux/task_io_accounting_ops.h b/trunk/include/linux/task_io_accounting_ops.h index 4d090f9ee608..e6f958ebe97f 100644 --- a/trunk/include/linux/task_io_accounting_ops.h +++ b/trunk/include/linux/task_io_accounting_ops.h @@ -9,7 +9,7 @@ #ifdef CONFIG_TASK_IO_ACCOUNTING static inline void task_io_account_read(size_t bytes) { - current->ioac.read_bytes += bytes; + current->ioac.blk.read_bytes += bytes; } /* @@ -18,12 +18,12 @@ static inline void task_io_account_read(size_t bytes) */ static inline unsigned long task_io_get_inblock(const struct task_struct *p) { - return p->ioac.read_bytes >> 9; + return p->ioac.blk.read_bytes >> 9; } static inline void task_io_account_write(size_t bytes) { - current->ioac.write_bytes += bytes; + current->ioac.blk.write_bytes += bytes; } /* @@ -32,25 +32,25 @@ static inline void task_io_account_write(size_t bytes) */ static inline unsigned long task_io_get_oublock(const struct task_struct *p) { - return p->ioac.write_bytes >> 9; + return p->ioac.blk.write_bytes >> 9; } static inline void task_io_account_cancelled_write(size_t bytes) { - current->ioac.cancelled_write_bytes += bytes; + current->ioac.blk.cancelled_write_bytes += bytes; } -static inline void task_io_accounting_init(struct task_io_accounting *ioac) +static inline void task_io_accounting_init(struct proc_io_accounting *ioac) { memset(ioac, 0, sizeof(*ioac)); } -static inline void task_blk_io_accounting_add(struct task_io_accounting *dst, - struct task_io_accounting *src) +static inline void task_blk_io_accounting_add(struct proc_io_accounting *dst, + struct proc_io_accounting *src) { - dst->read_bytes += src->read_bytes; - dst->write_bytes += src->write_bytes; - dst->cancelled_write_bytes += src->cancelled_write_bytes; + dst->blk.read_bytes += src->blk.read_bytes; + dst->blk.write_bytes += src->blk.write_bytes; + dst->blk.cancelled_write_bytes += src->blk.cancelled_write_bytes; } #else @@ -77,35 +77,35 @@ static inline void task_io_account_cancelled_write(size_t bytes) { } -static inline void task_io_accounting_init(struct task_io_accounting *ioac) +static inline void task_io_accounting_init(struct proc_io_accounting *ioac) { } -static inline void task_blk_io_accounting_add(struct task_io_accounting *dst, - struct task_io_accounting *src) +static inline void task_blk_io_accounting_add(struct proc_io_accounting *dst, + struct proc_io_accounting *src) { } #endif /* CONFIG_TASK_IO_ACCOUNTING */ #ifdef CONFIG_TASK_XACCT -static inline void task_chr_io_accounting_add(struct task_io_accounting *dst, - struct task_io_accounting *src) +static inline void task_chr_io_accounting_add(struct proc_io_accounting *dst, + struct proc_io_accounting *src) { - dst->rchar += src->rchar; - dst->wchar += src->wchar; - dst->syscr += src->syscr; - dst->syscw += src->syscw; + dst->chr.rchar += src->chr.rchar; + dst->chr.wchar += src->chr.wchar; + dst->chr.syscr += src->chr.syscr; + dst->chr.syscw += src->chr.syscw; } #else -static inline void task_chr_io_accounting_add(struct task_io_accounting *dst, - struct task_io_accounting *src) +static inline void task_chr_io_accounting_add(struct proc_io_accounting *dst, + struct proc_io_accounting *src) { } #endif /* CONFIG_TASK_XACCT */ -static inline void task_io_accounting_add(struct task_io_accounting *dst, - struct task_io_accounting *src) +static inline void task_io_accounting_add(struct proc_io_accounting *dst, + struct proc_io_accounting *src) { task_chr_io_accounting_add(dst, src); task_blk_io_accounting_add(dst, src); diff --git a/trunk/include/linux/videodev.h b/trunk/include/linux/videodev.h index 15a653d41132..9385a566aed8 100644 --- a/trunk/include/linux/videodev.h +++ b/trunk/include/linux/videodev.h @@ -17,21 +17,6 @@ #if defined(CONFIG_VIDEO_V4L1_COMPAT) || !defined (__KERNEL__) -#define VID_TYPE_CAPTURE 1 /* Can capture */ -#define VID_TYPE_TUNER 2 /* Can tune */ -#define VID_TYPE_TELETEXT 4 /* Does teletext */ -#define VID_TYPE_OVERLAY 8 /* Overlay onto frame buffer */ -#define VID_TYPE_CHROMAKEY 16 /* Overlay by chromakey */ -#define VID_TYPE_CLIPPING 32 /* Can clip */ -#define VID_TYPE_FRAMERAM 64 /* Uses the frame buffer memory */ -#define VID_TYPE_SCALES 128 /* Scalable */ -#define VID_TYPE_MONOCHROME 256 /* Monochrome only */ -#define VID_TYPE_SUBCAPTURE 512 /* Can capture subareas of the image */ -#define VID_TYPE_MPEG_DECODER 1024 /* Can decode MPEG streams */ -#define VID_TYPE_MPEG_ENCODER 2048 /* Can encode MPEG streams */ -#define VID_TYPE_MJPEG_DECODER 4096 /* Can decode MJPEG streams */ -#define VID_TYPE_MJPEG_ENCODER 8192 /* Can encode MJPEG streams */ - struct video_capability { char name[32]; diff --git a/trunk/include/linux/videodev2.h b/trunk/include/linux/videodev2.h index e466bd54a50e..2e66a95e8d32 100644 --- a/trunk/include/linux/videodev2.h +++ b/trunk/include/linux/videodev2.h @@ -71,11 +71,6 @@ */ #define VIDEO_MAX_FRAME 32 -#ifndef __KERNEL__ - -/* These defines are V4L1 specific and should not be used with the V4L2 API! - They will be removed from this header in the future. */ - #define VID_TYPE_CAPTURE 1 /* Can capture */ #define VID_TYPE_TUNER 2 /* Can tune */ #define VID_TYPE_TELETEXT 4 /* Does teletext */ @@ -90,15 +85,14 @@ #define VID_TYPE_MPEG_ENCODER 2048 /* Can encode MPEG streams */ #define VID_TYPE_MJPEG_DECODER 4096 /* Can decode MJPEG streams */ #define VID_TYPE_MJPEG_ENCODER 8192 /* Can encode MJPEG streams */ -#endif /* * M I S C E L L A N E O U S */ /* Four-character-code (FOURCC) */ -#define v4l2_fourcc(a, b, c, d)\ - ((__u32)(a) | ((__u32)(b) << 8) | ((__u32)(c) << 16) | ((__u32)(d) << 24)) +#define v4l2_fourcc(a,b,c,d)\ + (((__u32)(a)<<0)|((__u32)(b)<<8)|((__u32)(c)<<16)|((__u32)(d)<<24)) /* * E N U M S @@ -232,7 +226,8 @@ struct v4l2_fract { /* * D R I V E R C A P A B I L I T I E S */ -struct v4l2_capability { +struct v4l2_capability +{ __u8 driver[16]; /* i.e. "bttv" */ __u8 card[32]; /* i.e. "Hauppauge WinTV" */ __u8 bus_info[32]; /* "PCI:" + pci_name(pci_dev) */ @@ -264,7 +259,8 @@ struct v4l2_capability { /* * V I D E O I M A G E F O R M A T */ -struct v4l2_pix_format { +struct v4l2_pix_format +{ __u32 width; __u32 height; __u32 pixelformat; @@ -276,69 +272,68 @@ struct v4l2_pix_format { }; /* Pixel format FOURCC depth Description */ -#define V4L2_PIX_FMT_RGB332 v4l2_fourcc('R', 'G', 'B', '1') /* 8 RGB-3-3-2 */ -#define V4L2_PIX_FMT_RGB444 v4l2_fourcc('R', '4', '4', '4') /* 16 xxxxrrrr ggggbbbb */ -#define V4L2_PIX_FMT_RGB555 v4l2_fourcc('R', 'G', 'B', 'O') /* 16 RGB-5-5-5 */ -#define V4L2_PIX_FMT_RGB565 v4l2_fourcc('R', 'G', 'B', 'P') /* 16 RGB-5-6-5 */ -#define V4L2_PIX_FMT_RGB555X v4l2_fourcc('R', 'G', 'B', 'Q') /* 16 RGB-5-5-5 BE */ -#define V4L2_PIX_FMT_RGB565X v4l2_fourcc('R', 'G', 'B', 'R') /* 16 RGB-5-6-5 BE */ -#define V4L2_PIX_FMT_BGR24 v4l2_fourcc('B', 'G', 'R', '3') /* 24 BGR-8-8-8 */ -#define V4L2_PIX_FMT_RGB24 v4l2_fourcc('R', 'G', 'B', '3') /* 24 RGB-8-8-8 */ -#define V4L2_PIX_FMT_BGR32 v4l2_fourcc('B', 'G', 'R', '4') /* 32 BGR-8-8-8-8 */ -#define V4L2_PIX_FMT_RGB32 v4l2_fourcc('R', 'G', 'B', '4') /* 32 RGB-8-8-8-8 */ -#define V4L2_PIX_FMT_GREY v4l2_fourcc('G', 'R', 'E', 'Y') /* 8 Greyscale */ -#define V4L2_PIX_FMT_Y16 v4l2_fourcc('Y', '1', '6', ' ') /* 16 Greyscale */ -#define V4L2_PIX_FMT_PAL8 v4l2_fourcc('P', 'A', 'L', '8') /* 8 8-bit palette */ -#define V4L2_PIX_FMT_YVU410 v4l2_fourcc('Y', 'V', 'U', '9') /* 9 YVU 4:1:0 */ -#define V4L2_PIX_FMT_YVU420 v4l2_fourcc('Y', 'V', '1', '2') /* 12 YVU 4:2:0 */ -#define V4L2_PIX_FMT_YUYV v4l2_fourcc('Y', 'U', 'Y', 'V') /* 16 YUV 4:2:2 */ -#define V4L2_PIX_FMT_UYVY v4l2_fourcc('U', 'Y', 'V', 'Y') /* 16 YUV 4:2:2 */ -#define V4L2_PIX_FMT_YUV422P v4l2_fourcc('4', '2', '2', 'P') /* 16 YVU422 planar */ -#define V4L2_PIX_FMT_YUV411P v4l2_fourcc('4', '1', '1', 'P') /* 16 YVU411 planar */ -#define V4L2_PIX_FMT_Y41P v4l2_fourcc('Y', '4', '1', 'P') /* 12 YUV 4:1:1 */ -#define V4L2_PIX_FMT_YUV444 v4l2_fourcc('Y', '4', '4', '4') /* 16 xxxxyyyy uuuuvvvv */ -#define V4L2_PIX_FMT_YUV555 v4l2_fourcc('Y', 'U', 'V', 'O') /* 16 YUV-5-5-5 */ -#define V4L2_PIX_FMT_YUV565 v4l2_fourcc('Y', 'U', 'V', 'P') /* 16 YUV-5-6-5 */ -#define V4L2_PIX_FMT_YUV32 v4l2_fourcc('Y', 'U', 'V', '4') /* 32 YUV-8-8-8-8 */ +#define V4L2_PIX_FMT_RGB332 v4l2_fourcc('R','G','B','1') /* 8 RGB-3-3-2 */ +#define V4L2_PIX_FMT_RGB444 v4l2_fourcc('R','4','4','4') /* 16 xxxxrrrr ggggbbbb */ +#define V4L2_PIX_FMT_RGB555 v4l2_fourcc('R','G','B','O') /* 16 RGB-5-5-5 */ +#define V4L2_PIX_FMT_RGB565 v4l2_fourcc('R','G','B','P') /* 16 RGB-5-6-5 */ +#define V4L2_PIX_FMT_RGB555X v4l2_fourcc('R','G','B','Q') /* 16 RGB-5-5-5 BE */ +#define V4L2_PIX_FMT_RGB565X v4l2_fourcc('R','G','B','R') /* 16 RGB-5-6-5 BE */ +#define V4L2_PIX_FMT_BGR24 v4l2_fourcc('B','G','R','3') /* 24 BGR-8-8-8 */ +#define V4L2_PIX_FMT_RGB24 v4l2_fourcc('R','G','B','3') /* 24 RGB-8-8-8 */ +#define V4L2_PIX_FMT_BGR32 v4l2_fourcc('B','G','R','4') /* 32 BGR-8-8-8-8 */ +#define V4L2_PIX_FMT_RGB32 v4l2_fourcc('R','G','B','4') /* 32 RGB-8-8-8-8 */ +#define V4L2_PIX_FMT_GREY v4l2_fourcc('G','R','E','Y') /* 8 Greyscale */ +#define V4L2_PIX_FMT_Y16 v4l2_fourcc('Y','1','6',' ') /* 16 Greyscale */ +#define V4L2_PIX_FMT_PAL8 v4l2_fourcc('P','A','L','8') /* 8 8-bit palette */ +#define V4L2_PIX_FMT_YVU410 v4l2_fourcc('Y','V','U','9') /* 9 YVU 4:1:0 */ +#define V4L2_PIX_FMT_YVU420 v4l2_fourcc('Y','V','1','2') /* 12 YVU 4:2:0 */ +#define V4L2_PIX_FMT_YUYV v4l2_fourcc('Y','U','Y','V') /* 16 YUV 4:2:2 */ +#define V4L2_PIX_FMT_UYVY v4l2_fourcc('U','Y','V','Y') /* 16 YUV 4:2:2 */ +#define V4L2_PIX_FMT_YUV422P v4l2_fourcc('4','2','2','P') /* 16 YVU422 planar */ +#define V4L2_PIX_FMT_YUV411P v4l2_fourcc('4','1','1','P') /* 16 YVU411 planar */ +#define V4L2_PIX_FMT_Y41P v4l2_fourcc('Y','4','1','P') /* 12 YUV 4:1:1 */ +#define V4L2_PIX_FMT_YUV444 v4l2_fourcc('Y','4','4','4') /* 16 xxxxyyyy uuuuvvvv */ +#define V4L2_PIX_FMT_YUV555 v4l2_fourcc('Y','U','V','O') /* 16 YUV-5-5-5 */ +#define V4L2_PIX_FMT_YUV565 v4l2_fourcc('Y','U','V','P') /* 16 YUV-5-6-5 */ +#define V4L2_PIX_FMT_YUV32 v4l2_fourcc('Y','U','V','4') /* 32 YUV-8-8-8-8 */ /* two planes -- one Y, one Cr + Cb interleaved */ -#define V4L2_PIX_FMT_NV12 v4l2_fourcc('N', 'V', '1', '2') /* 12 Y/CbCr 4:2:0 */ -#define V4L2_PIX_FMT_NV21 v4l2_fourcc('N', 'V', '2', '1') /* 12 Y/CrCb 4:2:0 */ +#define V4L2_PIX_FMT_NV12 v4l2_fourcc('N','V','1','2') /* 12 Y/CbCr 4:2:0 */ +#define V4L2_PIX_FMT_NV21 v4l2_fourcc('N','V','2','1') /* 12 Y/CrCb 4:2:0 */ /* The following formats are not defined in the V4L2 specification */ -#define V4L2_PIX_FMT_YUV410 v4l2_fourcc('Y', 'U', 'V', '9') /* 9 YUV 4:1:0 */ -#define V4L2_PIX_FMT_YUV420 v4l2_fourcc('Y', 'U', '1', '2') /* 12 YUV 4:2:0 */ -#define V4L2_PIX_FMT_YYUV v4l2_fourcc('Y', 'Y', 'U', 'V') /* 16 YUV 4:2:2 */ -#define V4L2_PIX_FMT_HI240 v4l2_fourcc('H', 'I', '2', '4') /* 8 8-bit color */ -#define V4L2_PIX_FMT_HM12 v4l2_fourcc('H', 'M', '1', '2') /* 8 YUV 4:2:0 16x16 macroblocks */ +#define V4L2_PIX_FMT_YUV410 v4l2_fourcc('Y','U','V','9') /* 9 YUV 4:1:0 */ +#define V4L2_PIX_FMT_YUV420 v4l2_fourcc('Y','U','1','2') /* 12 YUV 4:2:0 */ +#define V4L2_PIX_FMT_YYUV v4l2_fourcc('Y','Y','U','V') /* 16 YUV 4:2:2 */ +#define V4L2_PIX_FMT_HI240 v4l2_fourcc('H','I','2','4') /* 8 8-bit color */ +#define V4L2_PIX_FMT_HM12 v4l2_fourcc('H','M','1','2') /* 8 YUV 4:2:0 16x16 macroblocks */ /* see http://www.siliconimaging.com/RGB%20Bayer.htm */ -#define V4L2_PIX_FMT_SBGGR8 v4l2_fourcc('B', 'A', '8', '1') /* 8 BGBG.. GRGR.. */ -#define V4L2_PIX_FMT_SGBRG8 v4l2_fourcc('G', 'B', 'R', 'G') /* 8 GBGB.. RGRG.. */ -#define V4L2_PIX_FMT_SBGGR16 v4l2_fourcc('B', 'Y', 'R', '2') /* 16 BGBG.. GRGR.. */ +#define V4L2_PIX_FMT_SBGGR8 v4l2_fourcc('B','A','8','1') /* 8 BGBG.. GRGR.. */ +#define V4L2_PIX_FMT_SGBRG8 v4l2_fourcc('G','B','R','G') /* 8 GBGB.. RGRG.. */ +#define V4L2_PIX_FMT_SBGGR16 v4l2_fourcc('B','Y','R','2') /* 16 BGBG.. GRGR.. */ /* compressed formats */ -#define V4L2_PIX_FMT_MJPEG v4l2_fourcc('M', 'J', 'P', 'G') /* Motion-JPEG */ -#define V4L2_PIX_FMT_JPEG v4l2_fourcc('J', 'P', 'E', 'G') /* JFIF JPEG */ -#define V4L2_PIX_FMT_DV v4l2_fourcc('d', 'v', 's', 'd') /* 1394 */ -#define V4L2_PIX_FMT_MPEG v4l2_fourcc('M', 'P', 'E', 'G') /* MPEG-1/2/4 */ +#define V4L2_PIX_FMT_MJPEG v4l2_fourcc('M','J','P','G') /* Motion-JPEG */ +#define V4L2_PIX_FMT_JPEG v4l2_fourcc('J','P','E','G') /* JFIF JPEG */ +#define V4L2_PIX_FMT_DV v4l2_fourcc('d','v','s','d') /* 1394 */ +#define V4L2_PIX_FMT_MPEG v4l2_fourcc('M','P','E','G') /* MPEG-1/2/4 */ /* Vendor-specific formats */ -#define V4L2_PIX_FMT_WNVA v4l2_fourcc('W', 'N', 'V', 'A') /* Winnov hw compress */ -#define V4L2_PIX_FMT_SN9C10X v4l2_fourcc('S', '9', '1', '0') /* SN9C10x compression */ -#define V4L2_PIX_FMT_PWC1 v4l2_fourcc('P', 'W', 'C', '1') /* pwc older webcam */ -#define V4L2_PIX_FMT_PWC2 v4l2_fourcc('P', 'W', 'C', '2') /* pwc newer webcam */ -#define V4L2_PIX_FMT_ET61X251 v4l2_fourcc('E', '6', '2', '5') /* ET61X251 compression */ -#define V4L2_PIX_FMT_SPCA501 v4l2_fourcc('S', '5', '0', '1') /* YUYV per line */ -#define V4L2_PIX_FMT_SPCA505 v4l2_fourcc('S', '5', '0', '5') /* YYUV per line */ -#define V4L2_PIX_FMT_SPCA508 v4l2_fourcc('S', '5', '0', '8') /* YUVY per line */ -#define V4L2_PIX_FMT_SPCA561 v4l2_fourcc('S', '5', '6', '1') /* compressed GBRG bayer */ -#define V4L2_PIX_FMT_PAC207 v4l2_fourcc('P', '2', '0', '7') /* compressed BGGR bayer */ +#define V4L2_PIX_FMT_WNVA v4l2_fourcc('W','N','V','A') /* Winnov hw compress */ +#define V4L2_PIX_FMT_SN9C10X v4l2_fourcc('S','9','1','0') /* SN9C10x compression */ +#define V4L2_PIX_FMT_PWC1 v4l2_fourcc('P','W','C','1') /* pwc older webcam */ +#define V4L2_PIX_FMT_PWC2 v4l2_fourcc('P','W','C','2') /* pwc newer webcam */ +#define V4L2_PIX_FMT_ET61X251 v4l2_fourcc('E','6','2','5') /* ET61X251 compression */ +#define V4L2_PIX_FMT_SPCA501 v4l2_fourcc('S','5','0','1') /* YUYV per line */ +#define V4L2_PIX_FMT_SPCA561 v4l2_fourcc('S','5','6','1') /* compressed GBRG bayer */ +#define V4L2_PIX_FMT_PAC207 v4l2_fourcc('P','2','0','7') /* compressed BGGR bayer */ /* * F O R M A T E N U M E R A T I O N */ -struct v4l2_fmtdesc { +struct v4l2_fmtdesc +{ __u32 index; /* Format number */ enum v4l2_buf_type type; /* buffer type */ __u32 flags; @@ -354,18 +349,21 @@ struct v4l2_fmtdesc { /* * F R A M E S I Z E E N U M E R A T I O N */ -enum v4l2_frmsizetypes { +enum v4l2_frmsizetypes +{ V4L2_FRMSIZE_TYPE_DISCRETE = 1, V4L2_FRMSIZE_TYPE_CONTINUOUS = 2, V4L2_FRMSIZE_TYPE_STEPWISE = 3, }; -struct v4l2_frmsize_discrete { +struct v4l2_frmsize_discrete +{ __u32 width; /* Frame width [pixel] */ __u32 height; /* Frame height [pixel] */ }; -struct v4l2_frmsize_stepwise { +struct v4l2_frmsize_stepwise +{ __u32 min_width; /* Minimum frame width [pixel] */ __u32 max_width; /* Maximum frame width [pixel] */ __u32 step_width; /* Frame width step size [pixel] */ @@ -374,7 +372,8 @@ struct v4l2_frmsize_stepwise { __u32 step_height; /* Frame height step size [pixel] */ }; -struct v4l2_frmsizeenum { +struct v4l2_frmsizeenum +{ __u32 index; /* Frame size number */ __u32 pixel_format; /* Pixel format */ __u32 type; /* Frame size type the device supports. */ @@ -390,19 +389,22 @@ struct v4l2_frmsizeenum { /* * F R A M E R A T E E N U M E R A T I O N */ -enum v4l2_frmivaltypes { +enum v4l2_frmivaltypes +{ V4L2_FRMIVAL_TYPE_DISCRETE = 1, V4L2_FRMIVAL_TYPE_CONTINUOUS = 2, V4L2_FRMIVAL_TYPE_STEPWISE = 3, }; -struct v4l2_frmival_stepwise { +struct v4l2_frmival_stepwise +{ struct v4l2_fract min; /* Minimum frame interval [s] */ struct v4l2_fract max; /* Maximum frame interval [s] */ struct v4l2_fract step; /* Frame interval step size [s] */ }; -struct v4l2_frmivalenum { +struct v4l2_frmivalenum +{ __u32 index; /* Frame format index */ __u32 pixel_format; /* Pixel format */ __u32 width; /* Frame width */ @@ -421,7 +423,8 @@ struct v4l2_frmivalenum { /* * T I M E C O D E */ -struct v4l2_timecode { +struct v4l2_timecode +{ __u32 type; __u32 flags; __u8 frames; @@ -446,7 +449,8 @@ struct v4l2_timecode { #define V4L2_TC_USERBITS_8BITCHARS 0x0008 /* The above is based on SMPTE timecodes */ -struct v4l2_jpegcompression { +struct v4l2_jpegcompression +{ int quality; int APPn; /* Number of APP segment to be written, @@ -478,14 +482,16 @@ struct v4l2_jpegcompression { /* * M E M O R Y - M A P P I N G B U F F E R S */ -struct v4l2_requestbuffers { +struct v4l2_requestbuffers +{ __u32 count; enum v4l2_buf_type type; enum v4l2_memory memory; __u32 reserved[2]; }; -struct v4l2_buffer { +struct v4l2_buffer +{ __u32 index; enum v4l2_buf_type type; __u32 bytesused; @@ -519,12 +525,13 @@ struct v4l2_buffer { /* * O V E R L A Y P R E V I E W */ -struct v4l2_framebuffer { +struct v4l2_framebuffer +{ __u32 capability; __u32 flags; /* FIXME: in theory we should pass something like PCI device + memory * region + offset instead of some physical address */ - void *base; + void* base; struct v4l2_pix_format fmt; }; /* Flags for the 'capability' field. Read only */ @@ -543,12 +550,14 @@ struct v4l2_framebuffer { #define V4L2_FBUF_FLAG_GLOBAL_ALPHA 0x0010 #define V4L2_FBUF_FLAG_LOCAL_INV_ALPHA 0x0020 -struct v4l2_clip { +struct v4l2_clip +{ struct v4l2_rect c; struct v4l2_clip __user *next; }; -struct v4l2_window { +struct v4l2_window +{ struct v4l2_rect w; enum v4l2_field field; __u32 chromakey; @@ -561,7 +570,8 @@ struct v4l2_window { /* * C A P T U R E P A R A M E T E R S */ -struct v4l2_captureparm { +struct v4l2_captureparm +{ __u32 capability; /* Supported modes */ __u32 capturemode; /* Current mode */ struct v4l2_fract timeperframe; /* Time per frame in .1us units */ @@ -574,7 +584,8 @@ struct v4l2_captureparm { #define V4L2_MODE_HIGHQUALITY 0x0001 /* High quality imaging mode */ #define V4L2_CAP_TIMEPERFRAME 0x1000 /* timeperframe field is supported */ -struct v4l2_outputparm { +struct v4l2_outputparm +{ __u32 capability; /* Supported modes */ __u32 outputmode; /* Current mode */ struct v4l2_fract timeperframe; /* Time per frame in seconds */ @@ -691,7 +702,8 @@ typedef __u64 v4l2_std_id; #define V4L2_STD_ALL (V4L2_STD_525_60 |\ V4L2_STD_625_50) -struct v4l2_standard { +struct v4l2_standard +{ __u32 index; v4l2_std_id id; __u8 name[24]; @@ -703,7 +715,8 @@ struct v4l2_standard { /* * V I D E O I N P U T S */ -struct v4l2_input { +struct v4l2_input +{ __u32 index; /* Which input */ __u8 name[32]; /* Label */ __u32 type; /* Type of input */ @@ -740,7 +753,8 @@ struct v4l2_input { /* * V I D E O O U T P U T S */ -struct v4l2_output { +struct v4l2_output +{ __u32 index; /* Which output */ __u8 name[32]; /* Label */ __u32 type; /* Type of output */ @@ -757,12 +771,14 @@ struct v4l2_output { /* * C O N T R O L S */ -struct v4l2_control { +struct v4l2_control +{ __u32 id; __s32 value; }; -struct v4l2_ext_control { +struct v4l2_ext_control +{ __u32 id; __u32 reserved2[2]; union { @@ -772,7 +788,8 @@ struct v4l2_ext_control { }; } __attribute__ ((packed)); -struct v4l2_ext_controls { +struct v4l2_ext_controls +{ __u32 ctrl_class; __u32 count; __u32 error_idx; @@ -790,7 +807,8 @@ struct v4l2_ext_controls { #define V4L2_CTRL_DRIVER_PRIV(id) (((id) & 0xffff) >= 0x1000) /* Used in the VIDIOC_QUERYCTRL ioctl for querying controls */ -struct v4l2_queryctrl { +struct v4l2_queryctrl +{ __u32 id; enum v4l2_ctrl_type type; __u8 name[32]; /* Whatever */ @@ -803,7 +821,8 @@ struct v4l2_queryctrl { }; /* Used in the VIDIOC_QUERYMENU ioctl for querying menu items */ -struct v4l2_querymenu { +struct v4l2_querymenu +{ __u32 id; __u32 index; __u8 name[32]; /* Whatever */ @@ -1085,7 +1104,8 @@ enum v4l2_exposure_auto_type { /* * T U N I N G */ -struct v4l2_tuner { +struct v4l2_tuner +{ __u32 index; __u8 name[32]; enum v4l2_tuner_type type; @@ -1099,7 +1119,8 @@ struct v4l2_tuner { __u32 reserved[4]; }; -struct v4l2_modulator { +struct v4l2_modulator +{ __u32 index; __u8 name[32]; __u32 capability; @@ -1132,7 +1153,8 @@ struct v4l2_modulator { #define V4L2_TUNER_MODE_LANG1 0x0003 #define V4L2_TUNER_MODE_LANG1_LANG2 0x0004 -struct v4l2_frequency { +struct v4l2_frequency +{ __u32 tuner; enum v4l2_tuner_type type; __u32 frequency; @@ -1150,7 +1172,8 @@ struct v4l2_hw_freq_seek { /* * A U D I O */ -struct v4l2_audio { +struct v4l2_audio +{ __u32 index; __u8 name[32]; __u32 capability; @@ -1165,7 +1188,8 @@ struct v4l2_audio { /* Flags for the 'mode' field */ #define V4L2_AUDMODE_AVL 0x00001 -struct v4l2_audioout { +struct v4l2_audioout +{ __u32 index; __u8 name[32]; __u32 capability; @@ -1229,7 +1253,8 @@ struct v4l2_encoder_cmd { */ /* Raw VBI */ -struct v4l2_vbi_format { +struct v4l2_vbi_format +{ __u32 sampling_rate; /* in 1 Hz */ __u32 offset; __u32 samples_per_line; @@ -1241,8 +1266,8 @@ struct v4l2_vbi_format { }; /* VBI flags */ -#define V4L2_VBI_UNSYNC (1 << 0) -#define V4L2_VBI_INTERLACED (1 << 1) +#define V4L2_VBI_UNSYNC (1<< 0) +#define V4L2_VBI_INTERLACED (1<< 1) /* Sliced VBI * @@ -1251,7 +1276,8 @@ struct v4l2_vbi_format { * notice in the definitive implementation. */ -struct v4l2_sliced_vbi_format { +struct v4l2_sliced_vbi_format +{ __u16 service_set; /* service_lines[0][...] specifies lines 0-23 (1-23 used) of the first field service_lines[1][...] specifies lines 0-23 (1-23 used) of the second field @@ -1275,7 +1301,8 @@ struct v4l2_sliced_vbi_format { #define V4L2_SLICED_VBI_525 (V4L2_SLICED_CAPTION_525) #define V4L2_SLICED_VBI_625 (V4L2_SLICED_TELETEXT_B | V4L2_SLICED_VPS | V4L2_SLICED_WSS_625) -struct v4l2_sliced_vbi_cap { +struct v4l2_sliced_vbi_cap +{ __u16 service_set; /* service_lines[0][...] specifies lines 0-23 (1-23 used) of the first field service_lines[1][...] specifies lines 0-23 (1-23 used) of the second field @@ -1286,7 +1313,8 @@ struct v4l2_sliced_vbi_cap { __u32 reserved[3]; /* must be 0 */ }; -struct v4l2_sliced_vbi_data { +struct v4l2_sliced_vbi_data +{ __u32 id; __u32 field; /* 0: first field, 1: second field */ __u32 line; /* 1-23 */ @@ -1300,23 +1328,27 @@ struct v4l2_sliced_vbi_data { /* Stream data format */ -struct v4l2_format { +struct v4l2_format +{ enum v4l2_buf_type type; - union { - struct v4l2_pix_format pix; /* V4L2_BUF_TYPE_VIDEO_CAPTURE */ - struct v4l2_window win; /* V4L2_BUF_TYPE_VIDEO_OVERLAY */ - struct v4l2_vbi_format vbi; /* V4L2_BUF_TYPE_VBI_CAPTURE */ - struct v4l2_sliced_vbi_format sliced; /* V4L2_BUF_TYPE_SLICED_VBI_CAPTURE */ - __u8 raw_data[200]; /* user-defined */ + union + { + struct v4l2_pix_format pix; // V4L2_BUF_TYPE_VIDEO_CAPTURE + struct v4l2_window win; // V4L2_BUF_TYPE_VIDEO_OVERLAY + struct v4l2_vbi_format vbi; // V4L2_BUF_TYPE_VBI_CAPTURE + struct v4l2_sliced_vbi_format sliced; // V4L2_BUF_TYPE_SLICED_VBI_CAPTURE + __u8 raw_data[200]; // user-defined } fmt; }; /* Stream type-dependent parameters */ -struct v4l2_streamparm { +struct v4l2_streamparm +{ enum v4l2_buf_type type; - union { + union + { struct v4l2_captureparm capture; struct v4l2_outputparm output; __u8 raw_data[200]; /* user-defined */ @@ -1354,86 +1386,92 @@ struct v4l2_chip_ident { * I O C T L C O D E S F O R V I D E O D E V I C E S * */ -#define VIDIOC_QUERYCAP _IOR('V', 0, struct v4l2_capability) -#define VIDIOC_RESERVED _IO('V', 1) -#define VIDIOC_ENUM_FMT _IOWR('V', 2, struct v4l2_fmtdesc) -#define VIDIOC_G_FMT _IOWR('V', 4, struct v4l2_format) -#define VIDIOC_S_FMT _IOWR('V', 5, struct v4l2_format) -#define VIDIOC_REQBUFS _IOWR('V', 8, struct v4l2_requestbuffers) -#define VIDIOC_QUERYBUF _IOWR('V', 9, struct v4l2_buffer) -#define VIDIOC_G_FBUF _IOR('V', 10, struct v4l2_framebuffer) -#define VIDIOC_S_FBUF _IOW('V', 11, struct v4l2_framebuffer) -#define VIDIOC_OVERLAY _IOW('V', 14, int) -#define VIDIOC_QBUF _IOWR('V', 15, struct v4l2_buffer) -#define VIDIOC_DQBUF _IOWR('V', 17, struct v4l2_buffer) -#define VIDIOC_STREAMON _IOW('V', 18, int) -#define VIDIOC_STREAMOFF _IOW('V', 19, int) -#define VIDIOC_G_PARM _IOWR('V', 21, struct v4l2_streamparm) -#define VIDIOC_S_PARM _IOWR('V', 22, struct v4l2_streamparm) -#define VIDIOC_G_STD _IOR('V', 23, v4l2_std_id) -#define VIDIOC_S_STD _IOW('V', 24, v4l2_std_id) -#define VIDIOC_ENUMSTD _IOWR('V', 25, struct v4l2_standard) -#define VIDIOC_ENUMINPUT _IOWR('V', 26, struct v4l2_input) -#define VIDIOC_G_CTRL _IOWR('V', 27, struct v4l2_control) -#define VIDIOC_S_CTRL _IOWR('V', 28, struct v4l2_control) -#define VIDIOC_G_TUNER _IOWR('V', 29, struct v4l2_tuner) -#define VIDIOC_S_TUNER _IOW('V', 30, struct v4l2_tuner) -#define VIDIOC_G_AUDIO _IOR('V', 33, struct v4l2_audio) -#define VIDIOC_S_AUDIO _IOW('V', 34, struct v4l2_audio) -#define VIDIOC_QUERYCTRL _IOWR('V', 36, struct v4l2_queryctrl) -#define VIDIOC_QUERYMENU _IOWR('V', 37, struct v4l2_querymenu) -#define VIDIOC_G_INPUT _IOR('V', 38, int) -#define VIDIOC_S_INPUT _IOWR('V', 39, int) -#define VIDIOC_G_OUTPUT _IOR('V', 46, int) -#define VIDIOC_S_OUTPUT _IOWR('V', 47, int) -#define VIDIOC_ENUMOUTPUT _IOWR('V', 48, struct v4l2_output) -#define VIDIOC_G_AUDOUT _IOR('V', 49, struct v4l2_audioout) -#define VIDIOC_S_AUDOUT _IOW('V', 50, struct v4l2_audioout) -#define VIDIOC_G_MODULATOR _IOWR('V', 54, struct v4l2_modulator) -#define VIDIOC_S_MODULATOR _IOW('V', 55, struct v4l2_modulator) -#define VIDIOC_G_FREQUENCY _IOWR('V', 56, struct v4l2_frequency) -#define VIDIOC_S_FREQUENCY _IOW('V', 57, struct v4l2_frequency) -#define VIDIOC_CROPCAP _IOWR('V', 58, struct v4l2_cropcap) -#define VIDIOC_G_CROP _IOWR('V', 59, struct v4l2_crop) -#define VIDIOC_S_CROP _IOW('V', 60, struct v4l2_crop) -#define VIDIOC_G_JPEGCOMP _IOR('V', 61, struct v4l2_jpegcompression) -#define VIDIOC_S_JPEGCOMP _IOW('V', 62, struct v4l2_jpegcompression) -#define VIDIOC_QUERYSTD _IOR('V', 63, v4l2_std_id) -#define VIDIOC_TRY_FMT _IOWR('V', 64, struct v4l2_format) -#define VIDIOC_ENUMAUDIO _IOWR('V', 65, struct v4l2_audio) -#define VIDIOC_ENUMAUDOUT _IOWR('V', 66, struct v4l2_audioout) -#define VIDIOC_G_PRIORITY _IOR('V', 67, enum v4l2_priority) -#define VIDIOC_S_PRIORITY _IOW('V', 68, enum v4l2_priority) -#define VIDIOC_G_SLICED_VBI_CAP _IOWR('V', 69, struct v4l2_sliced_vbi_cap) -#define VIDIOC_LOG_STATUS _IO('V', 70) -#define VIDIOC_G_EXT_CTRLS _IOWR('V', 71, struct v4l2_ext_controls) -#define VIDIOC_S_EXT_CTRLS _IOWR('V', 72, struct v4l2_ext_controls) -#define VIDIOC_TRY_EXT_CTRLS _IOWR('V', 73, struct v4l2_ext_controls) +#define VIDIOC_QUERYCAP _IOR ('V', 0, struct v4l2_capability) +#define VIDIOC_RESERVED _IO ('V', 1) +#define VIDIOC_ENUM_FMT _IOWR ('V', 2, struct v4l2_fmtdesc) +#define VIDIOC_G_FMT _IOWR ('V', 4, struct v4l2_format) +#define VIDIOC_S_FMT _IOWR ('V', 5, struct v4l2_format) +#define VIDIOC_REQBUFS _IOWR ('V', 8, struct v4l2_requestbuffers) +#define VIDIOC_QUERYBUF _IOWR ('V', 9, struct v4l2_buffer) +#define VIDIOC_G_FBUF _IOR ('V', 10, struct v4l2_framebuffer) +#define VIDIOC_S_FBUF _IOW ('V', 11, struct v4l2_framebuffer) +#define VIDIOC_OVERLAY _IOW ('V', 14, int) +#define VIDIOC_QBUF _IOWR ('V', 15, struct v4l2_buffer) +#define VIDIOC_DQBUF _IOWR ('V', 17, struct v4l2_buffer) +#define VIDIOC_STREAMON _IOW ('V', 18, int) +#define VIDIOC_STREAMOFF _IOW ('V', 19, int) +#define VIDIOC_G_PARM _IOWR ('V', 21, struct v4l2_streamparm) +#define VIDIOC_S_PARM _IOWR ('V', 22, struct v4l2_streamparm) +#define VIDIOC_G_STD _IOR ('V', 23, v4l2_std_id) +#define VIDIOC_S_STD _IOW ('V', 24, v4l2_std_id) +#define VIDIOC_ENUMSTD _IOWR ('V', 25, struct v4l2_standard) +#define VIDIOC_ENUMINPUT _IOWR ('V', 26, struct v4l2_input) +#define VIDIOC_G_CTRL _IOWR ('V', 27, struct v4l2_control) +#define VIDIOC_S_CTRL _IOWR ('V', 28, struct v4l2_control) +#define VIDIOC_G_TUNER _IOWR ('V', 29, struct v4l2_tuner) +#define VIDIOC_S_TUNER _IOW ('V', 30, struct v4l2_tuner) +#define VIDIOC_G_AUDIO _IOR ('V', 33, struct v4l2_audio) +#define VIDIOC_S_AUDIO _IOW ('V', 34, struct v4l2_audio) +#define VIDIOC_QUERYCTRL _IOWR ('V', 36, struct v4l2_queryctrl) +#define VIDIOC_QUERYMENU _IOWR ('V', 37, struct v4l2_querymenu) +#define VIDIOC_G_INPUT _IOR ('V', 38, int) +#define VIDIOC_S_INPUT _IOWR ('V', 39, int) +#define VIDIOC_G_OUTPUT _IOR ('V', 46, int) +#define VIDIOC_S_OUTPUT _IOWR ('V', 47, int) +#define VIDIOC_ENUMOUTPUT _IOWR ('V', 48, struct v4l2_output) +#define VIDIOC_G_AUDOUT _IOR ('V', 49, struct v4l2_audioout) +#define VIDIOC_S_AUDOUT _IOW ('V', 50, struct v4l2_audioout) +#define VIDIOC_G_MODULATOR _IOWR ('V', 54, struct v4l2_modulator) +#define VIDIOC_S_MODULATOR _IOW ('V', 55, struct v4l2_modulator) +#define VIDIOC_G_FREQUENCY _IOWR ('V', 56, struct v4l2_frequency) +#define VIDIOC_S_FREQUENCY _IOW ('V', 57, struct v4l2_frequency) +#define VIDIOC_CROPCAP _IOWR ('V', 58, struct v4l2_cropcap) +#define VIDIOC_G_CROP _IOWR ('V', 59, struct v4l2_crop) +#define VIDIOC_S_CROP _IOW ('V', 60, struct v4l2_crop) +#define VIDIOC_G_JPEGCOMP _IOR ('V', 61, struct v4l2_jpegcompression) +#define VIDIOC_S_JPEGCOMP _IOW ('V', 62, struct v4l2_jpegcompression) +#define VIDIOC_QUERYSTD _IOR ('V', 63, v4l2_std_id) +#define VIDIOC_TRY_FMT _IOWR ('V', 64, struct v4l2_format) +#define VIDIOC_ENUMAUDIO _IOWR ('V', 65, struct v4l2_audio) +#define VIDIOC_ENUMAUDOUT _IOWR ('V', 66, struct v4l2_audioout) +#define VIDIOC_G_PRIORITY _IOR ('V', 67, enum v4l2_priority) +#define VIDIOC_S_PRIORITY _IOW ('V', 68, enum v4l2_priority) +#define VIDIOC_G_SLICED_VBI_CAP _IOWR ('V', 69, struct v4l2_sliced_vbi_cap) +#define VIDIOC_LOG_STATUS _IO ('V', 70) +#define VIDIOC_G_EXT_CTRLS _IOWR ('V', 71, struct v4l2_ext_controls) +#define VIDIOC_S_EXT_CTRLS _IOWR ('V', 72, struct v4l2_ext_controls) +#define VIDIOC_TRY_EXT_CTRLS _IOWR ('V', 73, struct v4l2_ext_controls) #if 1 -#define VIDIOC_ENUM_FRAMESIZES _IOWR('V', 74, struct v4l2_frmsizeenum) -#define VIDIOC_ENUM_FRAMEINTERVALS _IOWR('V', 75, struct v4l2_frmivalenum) -#define VIDIOC_G_ENC_INDEX _IOR('V', 76, struct v4l2_enc_idx) -#define VIDIOC_ENCODER_CMD _IOWR('V', 77, struct v4l2_encoder_cmd) -#define VIDIOC_TRY_ENCODER_CMD _IOWR('V', 78, struct v4l2_encoder_cmd) +#define VIDIOC_ENUM_FRAMESIZES _IOWR ('V', 74, struct v4l2_frmsizeenum) +#define VIDIOC_ENUM_FRAMEINTERVALS _IOWR ('V', 75, struct v4l2_frmivalenum) +#define VIDIOC_G_ENC_INDEX _IOR ('V', 76, struct v4l2_enc_idx) +#define VIDIOC_ENCODER_CMD _IOWR ('V', 77, struct v4l2_encoder_cmd) +#define VIDIOC_TRY_ENCODER_CMD _IOWR ('V', 78, struct v4l2_encoder_cmd) /* Experimental, only implemented if CONFIG_VIDEO_ADV_DEBUG is defined */ -#define VIDIOC_DBG_S_REGISTER _IOW('V', 79, struct v4l2_register) -#define VIDIOC_DBG_G_REGISTER _IOWR('V', 80, struct v4l2_register) +#define VIDIOC_DBG_S_REGISTER _IOW ('V', 79, struct v4l2_register) +#define VIDIOC_DBG_G_REGISTER _IOWR ('V', 80, struct v4l2_register) -#define VIDIOC_G_CHIP_IDENT _IOWR('V', 81, struct v4l2_chip_ident) +#define VIDIOC_G_CHIP_IDENT _IOWR ('V', 81, struct v4l2_chip_ident) #endif -#define VIDIOC_S_HW_FREQ_SEEK _IOW('V', 82, struct v4l2_hw_freq_seek) +#define VIDIOC_S_HW_FREQ_SEEK _IOW ('V', 82, struct v4l2_hw_freq_seek) #ifdef __OLD_VIDIOC_ /* for compatibility, will go away some day */ -#define VIDIOC_OVERLAY_OLD _IOWR('V', 14, int) -#define VIDIOC_S_PARM_OLD _IOW('V', 22, struct v4l2_streamparm) -#define VIDIOC_S_CTRL_OLD _IOW('V', 28, struct v4l2_control) -#define VIDIOC_G_AUDIO_OLD _IOWR('V', 33, struct v4l2_audio) -#define VIDIOC_G_AUDOUT_OLD _IOWR('V', 49, struct v4l2_audioout) -#define VIDIOC_CROPCAP_OLD _IOR('V', 58, struct v4l2_cropcap) +#define VIDIOC_OVERLAY_OLD _IOWR ('V', 14, int) +#define VIDIOC_S_PARM_OLD _IOW ('V', 22, struct v4l2_streamparm) +#define VIDIOC_S_CTRL_OLD _IOW ('V', 28, struct v4l2_control) +#define VIDIOC_G_AUDIO_OLD _IOWR ('V', 33, struct v4l2_audio) +#define VIDIOC_G_AUDOUT_OLD _IOWR ('V', 49, struct v4l2_audioout) +#define VIDIOC_CROPCAP_OLD _IOR ('V', 58, struct v4l2_cropcap) #endif #define BASE_VIDIOC_PRIVATE 192 /* 192-255 are private */ #endif /* __LINUX_VIDEODEV2_H */ + +/* + * Local variables: + * c-basic-offset: 8 + * End: + */ diff --git a/trunk/include/linux/videotext.h b/trunk/include/linux/videotext.h index 3e68c8d1c7f7..018f92047ff8 100644 --- a/trunk/include/linux/videotext.h +++ b/trunk/include/linux/videotext.h @@ -45,10 +45,10 @@ #define VTXIOCCLRCACHE_OLD 0x710b /* clear cache on VTX-interface (if avail.) */ #define VTXIOCSETVIRT_OLD 0x710c /* turn on virtual mode (this disables TV-display) */ -/* +/* * Definitions for VTXIOCGETINFO */ - + #define SAA5243 0 #define SAA5246 1 #define SAA5249 2 @@ -57,10 +57,10 @@ typedef struct { int version_major, version_minor; /* version of driver; if version_major changes, driver */ - /* is not backward compatible!!! CHECK THIS!!! */ + /* is not backward compatible!!! CHECK THIS!!! */ int numpages; /* number of page-buffers of vtx-chipset */ int cct_type; /* type of vtx-chipset (SAA5243, SAA5246, SAA5248 or - * SAA5249) */ + * SAA5249) */ } vtx_info_t; @@ -81,7 +81,7 @@ vtx_info_t; #define PGMASK_HOUR (HR_TEN | HR_UNIT) #define PGMASK_MINUTE (MIN_TEN | MIN_UNIT) -typedef struct +typedef struct { int page; /* number of requested page (hexadecimal) */ int hour; /* requested hour (hexadecimal) */ @@ -98,11 +98,11 @@ vtx_pagereq_t; /* * Definitions for VTXIOC{GETSTAT,PUTSTAT} */ - + #define VTX_PAGESIZE (40 * 24) #define VTX_VIRTUALSIZE (40 * 49) -typedef struct +typedef struct { int pagenum; /* number of page (hexadecimal) */ int hour; /* hour (hexadecimal) */ @@ -121,5 +121,5 @@ typedef struct unsigned hamming : 1; /* hamming-error occurred */ } vtx_pageinfo_t; - + #endif /* _VTX_H */ diff --git a/trunk/include/media/audiochip.h b/trunk/include/media/audiochip.h index e69de29bb2d1..db8823d45a7d 100644 --- a/trunk/include/media/audiochip.h +++ b/trunk/include/media/audiochip.h @@ -0,0 +1,26 @@ +/* + */ + +#ifndef AUDIOCHIP_H +#define AUDIOCHIP_H + +enum audiochip { + AUDIO_CHIP_NONE, + AUDIO_CHIP_UNKNOWN, + /* Provided by video chip */ + AUDIO_CHIP_INTERNAL, + /* Provided by tvaudio.c */ + AUDIO_CHIP_TDA8425, + AUDIO_CHIP_TEA6300, + AUDIO_CHIP_TEA6420, + AUDIO_CHIP_TDA9840, + AUDIO_CHIP_TDA985X, + AUDIO_CHIP_TDA9874, + AUDIO_CHIP_PIC16C54, + /* Provided by msp3400.c */ + AUDIO_CHIP_MSP34XX, + /* Provided by wm8775.c */ + AUDIO_CHIP_WM8775 +}; + +#endif /* AUDIOCHIP_H */ diff --git a/trunk/include/media/saa7146_vv.h b/trunk/include/media/saa7146_vv.h index 1d104096619c..89c442eb8849 100644 --- a/trunk/include/media/saa7146_vv.h +++ b/trunk/include/media/saa7146_vv.h @@ -2,7 +2,6 @@ #define __SAA7146_VV__ #include -#include #include #include diff --git a/trunk/include/media/tveeprom.h b/trunk/include/media/tveeprom.h index a8ad75a9152a..5660ea24996b 100644 --- a/trunk/include/media/tveeprom.h +++ b/trunk/include/media/tveeprom.h @@ -3,12 +3,7 @@ struct tveeprom { u32 has_radio; - /* If has_ir == 0, then it is unknown what the IR capabilities are, - otherwise: - bit 0: 1 (= IR capabilities are known) - bit 1: IR receiver present - bit 2: IR transmitter (blaster) present */ - u32 has_ir; + u32 has_ir; /* bit 0: IR receiver present, bit 1: IR transmitter (blaster) present. -1 == unknown */ u32 has_MAC_address; /* 0: no MAC, 1: MAC present, 2: unknown */ u32 tuner_type; diff --git a/trunk/include/media/v4l2-chip-ident.h b/trunk/include/media/v4l2-chip-ident.h index 41b509babf3f..2a527742701a 100644 --- a/trunk/include/media/v4l2-chip-ident.h +++ b/trunk/include/media/v4l2-chip-ident.h @@ -90,10 +90,7 @@ enum { /* module m52790: just ident 52790 */ V4L2_IDENT_M52790 = 52790, - /* module msp3400: reserved range 34000-34999 and 44000-44999 */ - V4L2_IDENT_MSPX4XX = 34000, /* generic MSPX4XX identifier, only - use internally (tveeprom.c). */ - + /* module msp34xx: reserved range 34000-34999 */ V4L2_IDENT_MSP3400B = 34002, V4L2_IDENT_MSP3410B = 34102, @@ -145,7 +142,7 @@ enum { V4L2_IDENT_MSP3457G = 34577, V4L2_IDENT_MSP3467G = 34677, - /* module msp3400: reserved range 34000-34999 and 44000-44999 */ + /* module msp44xx: reserved range 44000-44999 */ V4L2_IDENT_MSP4400G = 44007, V4L2_IDENT_MSP4410G = 44107, V4L2_IDENT_MSP4420G = 44207, diff --git a/trunk/include/media/v4l2-common.h b/trunk/include/media/v4l2-common.h index 07d3a9a575d1..020d05758bd8 100644 --- a/trunk/include/media/v4l2-common.h +++ b/trunk/include/media/v4l2-common.h @@ -28,6 +28,12 @@ #include +/* v4l debugging and diagnostics */ + +/* Debug bitmask flags to be used on V4L2 */ +#define V4L2_DEBUG_IOCTL 0x01 +#define V4L2_DEBUG_IOCTL_ARG 0x02 + /* Common printk constucts for v4l-i2c drivers. These macros create a unique prefix consisting of the driver name, the adapter number and the i2c address. */ @@ -55,20 +61,21 @@ v4l_client_printk(KERN_DEBUG, client, fmt , ## arg); \ } while (0) -/* ------------------------------------------------------------------------- */ -/* Priority helper functions */ +/* Use this macro for non-I2C drivers. Pass the driver name as the first arg. */ +#define v4l_print_ioctl(name, cmd) \ + do { \ + printk(KERN_DEBUG "%s: ", name); \ + v4l_printk_ioctl(cmd); \ + } while (0) -struct v4l2_prio_state { - atomic_t prios[4]; -}; -int v4l2_prio_init(struct v4l2_prio_state *global); -int v4l2_prio_change(struct v4l2_prio_state *global, enum v4l2_priority *local, - enum v4l2_priority new); -int v4l2_prio_open(struct v4l2_prio_state *global, enum v4l2_priority *local); -int v4l2_prio_close(struct v4l2_prio_state *global, enum v4l2_priority *local); -enum v4l2_priority v4l2_prio_max(struct v4l2_prio_state *global); -int v4l2_prio_check(struct v4l2_prio_state *global, enum v4l2_priority *local); +/* Use this macro in I2C drivers where 'client' is the struct i2c_client + pointer */ +#define v4l_i2c_print_ioctl(client, cmd) \ + do { \ + v4l_client_printk(KERN_DEBUG, client, ""); \ + v4l_printk_ioctl(cmd); \ + } while (0) /* ------------------------------------------------------------------------- */ diff --git a/trunk/include/media/v4l2-dev.h b/trunk/include/media/v4l2-dev.h index 2745e1afc722..33f379b1ecfe 100644 --- a/trunk/include/media/v4l2-dev.h +++ b/trunk/include/media/v4l2-dev.h @@ -9,6 +9,7 @@ #ifndef _V4L2_DEV_H #define _V4L2_DEV_H +#define OBSOLETE_OWNER 1 /* to be removed soon */ #define OBSOLETE_DEVDATA 1 /* to be removed soon */ #include @@ -16,7 +17,11 @@ #include #include #include /* need __user */ +#ifdef CONFIG_VIDEO_V4L1_COMPAT +#include +#else #include +#endif #define VIDEO_MAJOR 81 /* Minor device allocation */ @@ -34,7 +39,42 @@ #define VFL_TYPE_RADIO 2 #define VFL_TYPE_VTX 3 -struct v4l2_ioctl_callbacks; +/* Video standard functions */ +extern const char *v4l2_norm_to_name(v4l2_std_id id); +extern int v4l2_video_std_construct(struct v4l2_standard *vs, + int id, const char *name); +/* Prints the ioctl in a human-readable format */ +extern void v4l_printk_ioctl(unsigned int cmd); + +/* prority handling */ +struct v4l2_prio_state { + atomic_t prios[4]; +}; +int v4l2_prio_init(struct v4l2_prio_state *global); +int v4l2_prio_change(struct v4l2_prio_state *global, enum v4l2_priority *local, + enum v4l2_priority new); +int v4l2_prio_open(struct v4l2_prio_state *global, enum v4l2_priority *local); +int v4l2_prio_close(struct v4l2_prio_state *global, enum v4l2_priority *local); +enum v4l2_priority v4l2_prio_max(struct v4l2_prio_state *global); +int v4l2_prio_check(struct v4l2_prio_state *global, enum v4l2_priority *local); + +/* names for fancy debug output */ +extern const char *v4l2_field_names[]; +extern const char *v4l2_type_names[]; + +/* Compatibility layer interface -- v4l1-compat module */ +typedef int (*v4l2_kioctl)(struct inode *inode, struct file *file, + unsigned int cmd, void *arg); +#ifdef CONFIG_VIDEO_V4L1_COMPAT +int v4l_compat_translate_ioctl(struct inode *inode, struct file *file, + int cmd, void *arg, v4l2_kioctl driver_ioctl); +#else +#define v4l_compat_translate_ioctl(inode,file,cmd,arg,ioctl) -EINVAL +#endif + +/* 32 Bits compatibility layer for 64 bits processors */ +extern long v4l_compat_ioctl32(struct file *file, unsigned int cmd, + unsigned long arg); /* * Newer version of video_device, handled by videodev2.c @@ -48,17 +88,18 @@ struct video_device const struct file_operations *fops; /* sysfs */ - struct device dev; /* v4l device */ - struct device *parent; /* device parent */ + struct device class_dev; /* v4l device */ + struct device *dev; /* device parent */ /* device info */ char name[32]; - int vfl_type; + int type; /* v4l1 */ + int type2; /* v4l2 */ int minor; - /* attribute to differentiate multiple indices on one physical device */ + /* attribute to diferentiate multiple indexs on one physical device */ int index; - int debug; /* Activates debug level*/ + int debug; /* Activates debug level*/ /* Video standard vars */ v4l2_std_id tvnorms; /* Supported tv norms */ @@ -68,36 +109,285 @@ struct video_device void (*release)(struct video_device *vfd); /* ioctl callbacks */ - const struct v4l2_ioctl_ops *ioctl_ops; -#ifdef OBSOLETE_DEVDATA /* to be removed soon */ - /* dev->driver_data will be used instead some day. - * Use the video_{get|set}_drvdata() helper functions, - * so the switch over will be transparent for you. - * Or use {pci|usb}_{get|set}_drvdata() directly. */ - void *priv; + /* VIDIOC_QUERYCAP handler */ + int (*vidioc_querycap)(struct file *file, void *fh, struct v4l2_capability *cap); + + /* Priority handling */ + int (*vidioc_g_priority) (struct file *file, void *fh, + enum v4l2_priority *p); + int (*vidioc_s_priority) (struct file *file, void *fh, + enum v4l2_priority p); + + /* VIDIOC_ENUM_FMT handlers */ + int (*vidioc_enum_fmt_vid_cap) (struct file *file, void *fh, + struct v4l2_fmtdesc *f); + int (*vidioc_enum_fmt_vid_overlay) (struct file *file, void *fh, + struct v4l2_fmtdesc *f); + int (*vidioc_enum_fmt_vid_out) (struct file *file, void *fh, + struct v4l2_fmtdesc *f); +#if 1 + /* deprecated, will be removed in 2.6.28 */ + int (*vidioc_enum_fmt_vbi_cap) (struct file *file, void *fh, + struct v4l2_fmtdesc *f); +#endif + int (*vidioc_enum_fmt_type_private)(struct file *file, void *fh, + struct v4l2_fmtdesc *f); + + /* VIDIOC_G_FMT handlers */ + int (*vidioc_g_fmt_vid_cap) (struct file *file, void *fh, + struct v4l2_format *f); + int (*vidioc_g_fmt_vid_overlay)(struct file *file, void *fh, + struct v4l2_format *f); + int (*vidioc_g_fmt_vid_out) (struct file *file, void *fh, + struct v4l2_format *f); + int (*vidioc_g_fmt_vid_out_overlay)(struct file *file, void *fh, + struct v4l2_format *f); + int (*vidioc_g_fmt_vbi_cap) (struct file *file, void *fh, + struct v4l2_format *f); + int (*vidioc_g_fmt_vbi_out) (struct file *file, void *fh, + struct v4l2_format *f); + int (*vidioc_g_fmt_sliced_vbi_cap)(struct file *file, void *fh, + struct v4l2_format *f); + int (*vidioc_g_fmt_sliced_vbi_out)(struct file *file, void *fh, + struct v4l2_format *f); + int (*vidioc_g_fmt_type_private)(struct file *file, void *fh, + struct v4l2_format *f); + + /* VIDIOC_S_FMT handlers */ + int (*vidioc_s_fmt_vid_cap) (struct file *file, void *fh, + struct v4l2_format *f); + int (*vidioc_s_fmt_vid_overlay)(struct file *file, void *fh, + struct v4l2_format *f); + int (*vidioc_s_fmt_vid_out) (struct file *file, void *fh, + struct v4l2_format *f); + int (*vidioc_s_fmt_vid_out_overlay)(struct file *file, void *fh, + struct v4l2_format *f); + int (*vidioc_s_fmt_vbi_cap) (struct file *file, void *fh, + struct v4l2_format *f); + int (*vidioc_s_fmt_vbi_out) (struct file *file, void *fh, + struct v4l2_format *f); + int (*vidioc_s_fmt_sliced_vbi_cap)(struct file *file, void *fh, + struct v4l2_format *f); + int (*vidioc_s_fmt_sliced_vbi_out)(struct file *file, void *fh, + struct v4l2_format *f); + int (*vidioc_s_fmt_type_private)(struct file *file, void *fh, + struct v4l2_format *f); + + /* VIDIOC_TRY_FMT handlers */ + int (*vidioc_try_fmt_vid_cap) (struct file *file, void *fh, + struct v4l2_format *f); + int (*vidioc_try_fmt_vid_overlay)(struct file *file, void *fh, + struct v4l2_format *f); + int (*vidioc_try_fmt_vid_out) (struct file *file, void *fh, + struct v4l2_format *f); + int (*vidioc_try_fmt_vid_out_overlay)(struct file *file, void *fh, + struct v4l2_format *f); + int (*vidioc_try_fmt_vbi_cap) (struct file *file, void *fh, + struct v4l2_format *f); + int (*vidioc_try_fmt_vbi_out) (struct file *file, void *fh, + struct v4l2_format *f); + int (*vidioc_try_fmt_sliced_vbi_cap)(struct file *file, void *fh, + struct v4l2_format *f); + int (*vidioc_try_fmt_sliced_vbi_out)(struct file *file, void *fh, + struct v4l2_format *f); + int (*vidioc_try_fmt_type_private)(struct file *file, void *fh, + struct v4l2_format *f); + + /* Buffer handlers */ + int (*vidioc_reqbufs) (struct file *file, void *fh, struct v4l2_requestbuffers *b); + int (*vidioc_querybuf)(struct file *file, void *fh, struct v4l2_buffer *b); + int (*vidioc_qbuf) (struct file *file, void *fh, struct v4l2_buffer *b); + int (*vidioc_dqbuf) (struct file *file, void *fh, struct v4l2_buffer *b); + + + int (*vidioc_overlay) (struct file *file, void *fh, unsigned int i); +#ifdef CONFIG_VIDEO_V4L1_COMPAT + /* buffer type is struct vidio_mbuf * */ + int (*vidiocgmbuf) (struct file *file, void *fh, struct video_mbuf *p); #endif + int (*vidioc_g_fbuf) (struct file *file, void *fh, + struct v4l2_framebuffer *a); + int (*vidioc_s_fbuf) (struct file *file, void *fh, + struct v4l2_framebuffer *a); + + /* Stream on/off */ + int (*vidioc_streamon) (struct file *file, void *fh, enum v4l2_buf_type i); + int (*vidioc_streamoff)(struct file *file, void *fh, enum v4l2_buf_type i); + + /* Standard handling + ENUMSTD is handled by videodev.c + */ + int (*vidioc_g_std) (struct file *file, void *fh, v4l2_std_id *norm); + int (*vidioc_s_std) (struct file *file, void *fh, v4l2_std_id *norm); + int (*vidioc_querystd) (struct file *file, void *fh, v4l2_std_id *a); + + /* Input handling */ + int (*vidioc_enum_input)(struct file *file, void *fh, + struct v4l2_input *inp); + int (*vidioc_g_input) (struct file *file, void *fh, unsigned int *i); + int (*vidioc_s_input) (struct file *file, void *fh, unsigned int i); + + /* Output handling */ + int (*vidioc_enum_output) (struct file *file, void *fh, + struct v4l2_output *a); + int (*vidioc_g_output) (struct file *file, void *fh, unsigned int *i); + int (*vidioc_s_output) (struct file *file, void *fh, unsigned int i); + + /* Control handling */ + int (*vidioc_queryctrl) (struct file *file, void *fh, + struct v4l2_queryctrl *a); + int (*vidioc_g_ctrl) (struct file *file, void *fh, + struct v4l2_control *a); + int (*vidioc_s_ctrl) (struct file *file, void *fh, + struct v4l2_control *a); + int (*vidioc_g_ext_ctrls) (struct file *file, void *fh, + struct v4l2_ext_controls *a); + int (*vidioc_s_ext_ctrls) (struct file *file, void *fh, + struct v4l2_ext_controls *a); + int (*vidioc_try_ext_ctrls) (struct file *file, void *fh, + struct v4l2_ext_controls *a); + int (*vidioc_querymenu) (struct file *file, void *fh, + struct v4l2_querymenu *a); + + /* Audio ioctls */ + int (*vidioc_enumaudio) (struct file *file, void *fh, + struct v4l2_audio *a); + int (*vidioc_g_audio) (struct file *file, void *fh, + struct v4l2_audio *a); + int (*vidioc_s_audio) (struct file *file, void *fh, + struct v4l2_audio *a); + + /* Audio out ioctls */ + int (*vidioc_enumaudout) (struct file *file, void *fh, + struct v4l2_audioout *a); + int (*vidioc_g_audout) (struct file *file, void *fh, + struct v4l2_audioout *a); + int (*vidioc_s_audout) (struct file *file, void *fh, + struct v4l2_audioout *a); + int (*vidioc_g_modulator) (struct file *file, void *fh, + struct v4l2_modulator *a); + int (*vidioc_s_modulator) (struct file *file, void *fh, + struct v4l2_modulator *a); + /* Crop ioctls */ + int (*vidioc_cropcap) (struct file *file, void *fh, + struct v4l2_cropcap *a); + int (*vidioc_g_crop) (struct file *file, void *fh, + struct v4l2_crop *a); + int (*vidioc_s_crop) (struct file *file, void *fh, + struct v4l2_crop *a); + /* Compression ioctls */ + int (*vidioc_g_jpegcomp) (struct file *file, void *fh, + struct v4l2_jpegcompression *a); + int (*vidioc_s_jpegcomp) (struct file *file, void *fh, + struct v4l2_jpegcompression *a); + int (*vidioc_g_enc_index) (struct file *file, void *fh, + struct v4l2_enc_idx *a); + int (*vidioc_encoder_cmd) (struct file *file, void *fh, + struct v4l2_encoder_cmd *a); + int (*vidioc_try_encoder_cmd) (struct file *file, void *fh, + struct v4l2_encoder_cmd *a); - /* for videodev.c internal usage -- please don't touch */ + /* Stream type-dependent parameter ioctls */ + int (*vidioc_g_parm) (struct file *file, void *fh, + struct v4l2_streamparm *a); + int (*vidioc_s_parm) (struct file *file, void *fh, + struct v4l2_streamparm *a); + + /* Tuner ioctls */ + int (*vidioc_g_tuner) (struct file *file, void *fh, + struct v4l2_tuner *a); + int (*vidioc_s_tuner) (struct file *file, void *fh, + struct v4l2_tuner *a); + int (*vidioc_g_frequency) (struct file *file, void *fh, + struct v4l2_frequency *a); + int (*vidioc_s_frequency) (struct file *file, void *fh, + struct v4l2_frequency *a); + + /* Sliced VBI cap */ + int (*vidioc_g_sliced_vbi_cap) (struct file *file, void *fh, + struct v4l2_sliced_vbi_cap *a); + + /* Log status ioctl */ + int (*vidioc_log_status) (struct file *file, void *fh); + + int (*vidioc_s_hw_freq_seek) (struct file *file, void *fh, + struct v4l2_hw_freq_seek *a); + + /* Debugging ioctls */ +#ifdef CONFIG_VIDEO_ADV_DEBUG + int (*vidioc_g_register) (struct file *file, void *fh, + struct v4l2_register *reg); + int (*vidioc_s_register) (struct file *file, void *fh, + struct v4l2_register *reg); +#endif + int (*vidioc_g_chip_ident) (struct file *file, void *fh, + struct v4l2_chip_ident *chip); + + /* For other private ioctls */ + int (*vidioc_default) (struct file *file, void *fh, + int cmd, void *arg); + + +#ifdef OBSOLETE_OWNER /* to be removed soon */ +/* obsolete -- fops->owner is used instead */ +struct module *owner; +/* dev->driver_data will be used instead some day. + * Use the video_{get|set}_drvdata() helper functions, + * so the switch over will be transparent for you. + * Or use {pci|usb}_{get|set}_drvdata() directly. */ +void *priv; +#endif + + /* for videodev.c intenal usage -- please don't touch */ int users; /* video_exclusive_{open|close} ... */ struct mutex lock; /* ... helper function uses these */ }; /* Class-dev to video-device */ -#define to_video_device(cd) container_of(cd, struct video_device, dev) +#define to_video_device(cd) container_of(cd, struct video_device, class_dev) /* Version 2 functions */ extern int video_register_device(struct video_device *vfd, int type, int nr); int video_register_device_index(struct video_device *vfd, int type, int nr, int index); void video_unregister_device(struct video_device *); +extern int video_ioctl2(struct inode *inode, struct file *file, + unsigned int cmd, unsigned long arg); /* helper functions to alloc / release struct video_device, the later can be used for video_device->release() */ struct video_device *video_device_alloc(void); void video_device_release(struct video_device *vfd); -#ifdef OBSOLETE_DEVDATA /* to be removed soon */ +/* Include support for obsoleted stuff */ +extern int video_usercopy(struct inode *inode, struct file *file, + unsigned int cmd, unsigned long arg, + int (*func)(struct inode *inode, struct file *file, + unsigned int cmd, void *arg)); + +#ifdef CONFIG_VIDEO_V4L1_COMPAT +#include + +static inline int __must_check +video_device_create_file(struct video_device *vfd, + struct device_attribute *attr) +{ + int ret = device_create_file(&vfd->class_dev, attr); + if (ret < 0) + printk(KERN_WARNING "%s error: %d\n", __func__, ret); + return ret; +} +static inline void +video_device_remove_file(struct video_device *vfd, + struct device_attribute *attr) +{ + device_remove_file(&vfd->class_dev, attr); +} + +#endif /* CONFIG_VIDEO_V4L1_COMPAT */ + +#ifdef OBSOLETE_OWNER /* to be removed soon */ /* helper functions to access driver private data. */ static inline void *video_get_drvdata(struct video_device *dev) { @@ -109,6 +399,9 @@ static inline void video_set_drvdata(struct video_device *dev, void *data) dev->priv = data; } +#endif + +#ifdef OBSOLETE_DEVDATA /* to be removed soon */ /* Obsolete stuff - Still needed for radio devices and obsolete drivers */ extern struct video_device* video_devdata(struct file*); extern int video_exclusive_open(struct inode *inode, struct file *file); diff --git a/trunk/include/media/v4l2-ioctl.h b/trunk/include/media/v4l2-ioctl.h deleted file mode 100644 index dc6404618555..000000000000 --- a/trunk/include/media/v4l2-ioctl.h +++ /dev/null @@ -1,301 +0,0 @@ -/* - * - * V 4 L 2 D R I V E R H E L P E R A P I - * - * Moved from videodev2.h - * - * Some commonly needed functions for drivers (v4l2-common.o module) - */ -#ifndef _V4L2_IOCTL_H -#define _V4L2_IOCTL_H - -#include -#include -#include -#include -#include /* need __user */ -#ifdef CONFIG_VIDEO_V4L1_COMPAT -#include -#else -#include -#endif - -struct v4l2_ioctl_ops { - /* ioctl callbacks */ - - /* VIDIOC_QUERYCAP handler */ - int (*vidioc_querycap)(struct file *file, void *fh, struct v4l2_capability *cap); - - /* Priority handling */ - int (*vidioc_g_priority) (struct file *file, void *fh, - enum v4l2_priority *p); - int (*vidioc_s_priority) (struct file *file, void *fh, - enum v4l2_priority p); - - /* VIDIOC_ENUM_FMT handlers */ - int (*vidioc_enum_fmt_vid_cap) (struct file *file, void *fh, - struct v4l2_fmtdesc *f); - int (*vidioc_enum_fmt_vid_overlay) (struct file *file, void *fh, - struct v4l2_fmtdesc *f); - int (*vidioc_enum_fmt_vid_out) (struct file *file, void *fh, - struct v4l2_fmtdesc *f); -#if 1 - /* deprecated, will be removed in 2.6.28 */ - int (*vidioc_enum_fmt_vbi_cap) (struct file *file, void *fh, - struct v4l2_fmtdesc *f); -#endif - int (*vidioc_enum_fmt_type_private)(struct file *file, void *fh, - struct v4l2_fmtdesc *f); - - /* VIDIOC_G_FMT handlers */ - int (*vidioc_g_fmt_vid_cap) (struct file *file, void *fh, - struct v4l2_format *f); - int (*vidioc_g_fmt_vid_overlay)(struct file *file, void *fh, - struct v4l2_format *f); - int (*vidioc_g_fmt_vid_out) (struct file *file, void *fh, - struct v4l2_format *f); - int (*vidioc_g_fmt_vid_out_overlay)(struct file *file, void *fh, - struct v4l2_format *f); - int (*vidioc_g_fmt_vbi_cap) (struct file *file, void *fh, - struct v4l2_format *f); - int (*vidioc_g_fmt_vbi_out) (struct file *file, void *fh, - struct v4l2_format *f); - int (*vidioc_g_fmt_sliced_vbi_cap)(struct file *file, void *fh, - struct v4l2_format *f); - int (*vidioc_g_fmt_sliced_vbi_out)(struct file *file, void *fh, - struct v4l2_format *f); - int (*vidioc_g_fmt_type_private)(struct file *file, void *fh, - struct v4l2_format *f); - - /* VIDIOC_S_FMT handlers */ - int (*vidioc_s_fmt_vid_cap) (struct file *file, void *fh, - struct v4l2_format *f); - int (*vidioc_s_fmt_vid_overlay)(struct file *file, void *fh, - struct v4l2_format *f); - int (*vidioc_s_fmt_vid_out) (struct file *file, void *fh, - struct v4l2_format *f); - int (*vidioc_s_fmt_vid_out_overlay)(struct file *file, void *fh, - struct v4l2_format *f); - int (*vidioc_s_fmt_vbi_cap) (struct file *file, void *fh, - struct v4l2_format *f); - int (*vidioc_s_fmt_vbi_out) (struct file *file, void *fh, - struct v4l2_format *f); - int (*vidioc_s_fmt_sliced_vbi_cap)(struct file *file, void *fh, - struct v4l2_format *f); - int (*vidioc_s_fmt_sliced_vbi_out)(struct file *file, void *fh, - struct v4l2_format *f); - int (*vidioc_s_fmt_type_private)(struct file *file, void *fh, - struct v4l2_format *f); - - /* VIDIOC_TRY_FMT handlers */ - int (*vidioc_try_fmt_vid_cap) (struct file *file, void *fh, - struct v4l2_format *f); - int (*vidioc_try_fmt_vid_overlay)(struct file *file, void *fh, - struct v4l2_format *f); - int (*vidioc_try_fmt_vid_out) (struct file *file, void *fh, - struct v4l2_format *f); - int (*vidioc_try_fmt_vid_out_overlay)(struct file *file, void *fh, - struct v4l2_format *f); - int (*vidioc_try_fmt_vbi_cap) (struct file *file, void *fh, - struct v4l2_format *f); - int (*vidioc_try_fmt_vbi_out) (struct file *file, void *fh, - struct v4l2_format *f); - int (*vidioc_try_fmt_sliced_vbi_cap)(struct file *file, void *fh, - struct v4l2_format *f); - int (*vidioc_try_fmt_sliced_vbi_out)(struct file *file, void *fh, - struct v4l2_format *f); - int (*vidioc_try_fmt_type_private)(struct file *file, void *fh, - struct v4l2_format *f); - - /* Buffer handlers */ - int (*vidioc_reqbufs) (struct file *file, void *fh, struct v4l2_requestbuffers *b); - int (*vidioc_querybuf)(struct file *file, void *fh, struct v4l2_buffer *b); - int (*vidioc_qbuf) (struct file *file, void *fh, struct v4l2_buffer *b); - int (*vidioc_dqbuf) (struct file *file, void *fh, struct v4l2_buffer *b); - - - int (*vidioc_overlay) (struct file *file, void *fh, unsigned int i); -#ifdef CONFIG_VIDEO_V4L1_COMPAT - /* buffer type is struct vidio_mbuf * */ - int (*vidiocgmbuf) (struct file *file, void *fh, struct video_mbuf *p); -#endif - int (*vidioc_g_fbuf) (struct file *file, void *fh, - struct v4l2_framebuffer *a); - int (*vidioc_s_fbuf) (struct file *file, void *fh, - struct v4l2_framebuffer *a); - - /* Stream on/off */ - int (*vidioc_streamon) (struct file *file, void *fh, enum v4l2_buf_type i); - int (*vidioc_streamoff)(struct file *file, void *fh, enum v4l2_buf_type i); - - /* Standard handling - ENUMSTD is handled by videodev.c - */ - int (*vidioc_g_std) (struct file *file, void *fh, v4l2_std_id *norm); - int (*vidioc_s_std) (struct file *file, void *fh, v4l2_std_id *norm); - int (*vidioc_querystd) (struct file *file, void *fh, v4l2_std_id *a); - - /* Input handling */ - int (*vidioc_enum_input)(struct file *file, void *fh, - struct v4l2_input *inp); - int (*vidioc_g_input) (struct file *file, void *fh, unsigned int *i); - int (*vidioc_s_input) (struct file *file, void *fh, unsigned int i); - - /* Output handling */ - int (*vidioc_enum_output) (struct file *file, void *fh, - struct v4l2_output *a); - int (*vidioc_g_output) (struct file *file, void *fh, unsigned int *i); - int (*vidioc_s_output) (struct file *file, void *fh, unsigned int i); - - /* Control handling */ - int (*vidioc_queryctrl) (struct file *file, void *fh, - struct v4l2_queryctrl *a); - int (*vidioc_g_ctrl) (struct file *file, void *fh, - struct v4l2_control *a); - int (*vidioc_s_ctrl) (struct file *file, void *fh, - struct v4l2_control *a); - int (*vidioc_g_ext_ctrls) (struct file *file, void *fh, - struct v4l2_ext_controls *a); - int (*vidioc_s_ext_ctrls) (struct file *file, void *fh, - struct v4l2_ext_controls *a); - int (*vidioc_try_ext_ctrls) (struct file *file, void *fh, - struct v4l2_ext_controls *a); - int (*vidioc_querymenu) (struct file *file, void *fh, - struct v4l2_querymenu *a); - - /* Audio ioctls */ - int (*vidioc_enumaudio) (struct file *file, void *fh, - struct v4l2_audio *a); - int (*vidioc_g_audio) (struct file *file, void *fh, - struct v4l2_audio *a); - int (*vidioc_s_audio) (struct file *file, void *fh, - struct v4l2_audio *a); - - /* Audio out ioctls */ - int (*vidioc_enumaudout) (struct file *file, void *fh, - struct v4l2_audioout *a); - int (*vidioc_g_audout) (struct file *file, void *fh, - struct v4l2_audioout *a); - int (*vidioc_s_audout) (struct file *file, void *fh, - struct v4l2_audioout *a); - int (*vidioc_g_modulator) (struct file *file, void *fh, - struct v4l2_modulator *a); - int (*vidioc_s_modulator) (struct file *file, void *fh, - struct v4l2_modulator *a); - /* Crop ioctls */ - int (*vidioc_cropcap) (struct file *file, void *fh, - struct v4l2_cropcap *a); - int (*vidioc_g_crop) (struct file *file, void *fh, - struct v4l2_crop *a); - int (*vidioc_s_crop) (struct file *file, void *fh, - struct v4l2_crop *a); - /* Compression ioctls */ - int (*vidioc_g_jpegcomp) (struct file *file, void *fh, - struct v4l2_jpegcompression *a); - int (*vidioc_s_jpegcomp) (struct file *file, void *fh, - struct v4l2_jpegcompression *a); - int (*vidioc_g_enc_index) (struct file *file, void *fh, - struct v4l2_enc_idx *a); - int (*vidioc_encoder_cmd) (struct file *file, void *fh, - struct v4l2_encoder_cmd *a); - int (*vidioc_try_encoder_cmd) (struct file *file, void *fh, - struct v4l2_encoder_cmd *a); - - /* Stream type-dependent parameter ioctls */ - int (*vidioc_g_parm) (struct file *file, void *fh, - struct v4l2_streamparm *a); - int (*vidioc_s_parm) (struct file *file, void *fh, - struct v4l2_streamparm *a); - - /* Tuner ioctls */ - int (*vidioc_g_tuner) (struct file *file, void *fh, - struct v4l2_tuner *a); - int (*vidioc_s_tuner) (struct file *file, void *fh, - struct v4l2_tuner *a); - int (*vidioc_g_frequency) (struct file *file, void *fh, - struct v4l2_frequency *a); - int (*vidioc_s_frequency) (struct file *file, void *fh, - struct v4l2_frequency *a); - - /* Sliced VBI cap */ - int (*vidioc_g_sliced_vbi_cap) (struct file *file, void *fh, - struct v4l2_sliced_vbi_cap *a); - - /* Log status ioctl */ - int (*vidioc_log_status) (struct file *file, void *fh); - - int (*vidioc_s_hw_freq_seek) (struct file *file, void *fh, - struct v4l2_hw_freq_seek *a); - - /* Debugging ioctls */ -#ifdef CONFIG_VIDEO_ADV_DEBUG - int (*vidioc_g_register) (struct file *file, void *fh, - struct v4l2_register *reg); - int (*vidioc_s_register) (struct file *file, void *fh, - struct v4l2_register *reg); -#endif - int (*vidioc_g_chip_ident) (struct file *file, void *fh, - struct v4l2_chip_ident *chip); - - /* For other private ioctls */ - int (*vidioc_default) (struct file *file, void *fh, - int cmd, void *arg); -}; - - -/* v4l debugging and diagnostics */ - -/* Debug bitmask flags to be used on V4L2 */ -#define V4L2_DEBUG_IOCTL 0x01 -#define V4L2_DEBUG_IOCTL_ARG 0x02 - -/* Use this macro for non-I2C drivers. Pass the driver name as the first arg. */ -#define v4l_print_ioctl(name, cmd) \ - do { \ - printk(KERN_DEBUG "%s: ", name); \ - v4l_printk_ioctl(cmd); \ - } while (0) - -/* Use this macro in I2C drivers where 'client' is the struct i2c_client - pointer */ -#define v4l_i2c_print_ioctl(client, cmd) \ - do { \ - v4l_client_printk(KERN_DEBUG, client, ""); \ - v4l_printk_ioctl(cmd); \ - } while (0) - -/* Video standard functions */ -extern const char *v4l2_norm_to_name(v4l2_std_id id); -extern int v4l2_video_std_construct(struct v4l2_standard *vs, - int id, const char *name); -/* Prints the ioctl in a human-readable format */ -extern void v4l_printk_ioctl(unsigned int cmd); - -/* names for fancy debug output */ -extern const char *v4l2_field_names[]; -extern const char *v4l2_type_names[]; - -/* Compatibility layer interface -- v4l1-compat module */ -typedef int (*v4l2_kioctl)(struct inode *inode, struct file *file, - unsigned int cmd, void *arg); -#ifdef CONFIG_VIDEO_V4L1_COMPAT -int v4l_compat_translate_ioctl(struct inode *inode, struct file *file, - int cmd, void *arg, v4l2_kioctl driver_ioctl); -#else -#define v4l_compat_translate_ioctl(inode, file, cmd, arg, ioctl) (-EINVAL) -#endif - -/* 32 Bits compatibility layer for 64 bits processors */ -extern long v4l_compat_ioctl32(struct file *file, unsigned int cmd, - unsigned long arg); - -extern int video_ioctl2(struct inode *inode, struct file *file, - unsigned int cmd, unsigned long arg); - -/* Include support for obsoleted stuff */ -extern int video_usercopy(struct inode *inode, struct file *file, - unsigned int cmd, unsigned long arg, - int (*func)(struct inode *inode, struct file *file, - unsigned int cmd, void *arg)); - -#endif /* _V4L2_IOCTL_H */ diff --git a/trunk/kernel/module.c b/trunk/kernel/module.c index d8b5605132a0..d861bd5b8c10 100644 --- a/trunk/kernel/module.c +++ b/trunk/kernel/module.c @@ -325,18 +325,6 @@ static unsigned long find_symbol(const char *name, return -ENOENT; } -/* lookup symbol in given range of kernel_symbols */ -static const struct kernel_symbol *lookup_symbol(const char *name, - const struct kernel_symbol *start, - const struct kernel_symbol *stop) -{ - const struct kernel_symbol *ks = start; - for (; ks < stop; ks++) - if (strcmp(ks->name, name) == 0) - return ks; - return NULL; -} - /* Search for module by name: must hold module_mutex. */ static struct module *find_module(const char *name) { @@ -1703,6 +1691,19 @@ static void setup_modinfo(struct module *mod, Elf_Shdr *sechdrs, } #ifdef CONFIG_KALLSYMS + +/* lookup symbol in given range of kernel_symbols */ +static const struct kernel_symbol *lookup_symbol(const char *name, + const struct kernel_symbol *start, + const struct kernel_symbol *stop) +{ + const struct kernel_symbol *ks = start; + for (; ks < stop; ks++) + if (strcmp(ks->name, name) == 0) + return ks; + return NULL; +} + static int is_exported(const char *name, const struct module *mod) { if (!mod && lookup_symbol(name, __start___ksymtab, __stop___ksymtab)) diff --git a/trunk/kernel/tsacct.c b/trunk/kernel/tsacct.c index 8ebcd8532dfb..f9cd2561689c 100644 --- a/trunk/kernel/tsacct.c +++ b/trunk/kernel/tsacct.c @@ -94,14 +94,14 @@ void xacct_add_tsk(struct taskstats *stats, struct task_struct *p) stats->hiwater_vm = mm->hiwater_vm * PAGE_SIZE / KB; mmput(mm); } - stats->read_char = p->ioac.rchar; - stats->write_char = p->ioac.wchar; - stats->read_syscalls = p->ioac.syscr; - stats->write_syscalls = p->ioac.syscw; + stats->read_char = p->ioac.chr.rchar; + stats->write_char = p->ioac.chr.wchar; + stats->read_syscalls = p->ioac.chr.syscr; + stats->write_syscalls = p->ioac.chr.syscw; #ifdef CONFIG_TASK_IO_ACCOUNTING - stats->read_bytes = p->ioac.read_bytes; - stats->write_bytes = p->ioac.write_bytes; - stats->cancelled_write_bytes = p->ioac.cancelled_write_bytes; + stats->read_bytes = p->ioac.blk.read_bytes; + stats->write_bytes = p->ioac.blk.write_bytes; + stats->cancelled_write_bytes = p->ioac.blk.cancelled_write_bytes; #else stats->read_bytes = 0; stats->write_bytes = 0; diff --git a/trunk/net/dccp/dccp.h b/trunk/net/dccp/dccp.h index 1c2e3ec2eb57..743d85fcd651 100644 --- a/trunk/net/dccp/dccp.h +++ b/trunk/net/dccp/dccp.h @@ -226,7 +226,7 @@ static inline void dccp_csum_outgoing(struct sk_buff *skb) extern void dccp_v4_send_check(struct sock *sk, int len, struct sk_buff *skb); -extern int dccp_retransmit_skb(struct sock *sk); +extern int dccp_retransmit_skb(struct sock *sk, struct sk_buff *skb); extern void dccp_send_ack(struct sock *sk); extern void dccp_reqsk_send_ack(struct sk_buff *sk, struct request_sock *rsk); diff --git a/trunk/net/dccp/ipv4.c b/trunk/net/dccp/ipv4.c index 882c5c4de69e..a835b88237cb 100644 --- a/trunk/net/dccp/ipv4.c +++ b/trunk/net/dccp/ipv4.c @@ -196,8 +196,8 @@ static inline void dccp_do_pmtu_discovery(struct sock *sk, static void dccp_v4_err(struct sk_buff *skb, u32 info) { const struct iphdr *iph = (struct iphdr *)skb->data; - const u8 offset = iph->ihl << 2; - const struct dccp_hdr *dh = (struct dccp_hdr *)(skb->data + offset); + const struct dccp_hdr *dh = (struct dccp_hdr *)(skb->data + + (iph->ihl << 2)); struct dccp_sock *dp; struct inet_sock *inet; const int type = icmp_hdr(skb)->type; @@ -207,8 +207,7 @@ static void dccp_v4_err(struct sk_buff *skb, u32 info) int err; struct net *net = dev_net(skb->dev); - if (skb->len < offset + sizeof(*dh) || - skb->len < offset + __dccp_basic_hdr_len(dh)) { + if (skb->len < (iph->ihl << 2) + 8) { ICMP_INC_STATS_BH(net, ICMP_MIB_INERRORS); return; } @@ -239,7 +238,7 @@ static void dccp_v4_err(struct sk_buff *skb, u32 info) dp = dccp_sk(sk); seq = dccp_hdr_seq(dh); if ((1 << sk->sk_state) & ~(DCCPF_REQUESTING | DCCPF_LISTEN) && - !between48(seq, dp->dccps_awl, dp->dccps_awh)) { + !between48(seq, dp->dccps_swl, dp->dccps_swh)) { NET_INC_STATS_BH(net, LINUX_MIB_OUTOFWINDOWICMPS); goto out; } diff --git a/trunk/net/dccp/ipv6.c b/trunk/net/dccp/ipv6.c index 5e1ee0da2c40..da509127e00c 100644 --- a/trunk/net/dccp/ipv6.c +++ b/trunk/net/dccp/ipv6.c @@ -89,19 +89,12 @@ static void dccp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, { struct ipv6hdr *hdr = (struct ipv6hdr *)skb->data; const struct dccp_hdr *dh = (struct dccp_hdr *)(skb->data + offset); - struct dccp_sock *dp; struct ipv6_pinfo *np; struct sock *sk; int err; __u64 seq; struct net *net = dev_net(skb->dev); - if (skb->len < offset + sizeof(*dh) || - skb->len < offset + __dccp_basic_hdr_len(dh)) { - ICMP6_INC_STATS_BH(__in6_dev_get(skb->dev), ICMP6_MIB_INERRORS); - return; - } - sk = inet6_lookup(net, &dccp_hashinfo, &hdr->daddr, dh->dccph_dport, &hdr->saddr, dh->dccph_sport, inet6_iif(skb)); @@ -123,14 +116,6 @@ static void dccp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, if (sk->sk_state == DCCP_CLOSED) goto out; - dp = dccp_sk(sk); - seq = dccp_hdr_seq(dh); - if ((1 << sk->sk_state) & ~(DCCPF_REQUESTING | DCCPF_LISTEN) && - !between48(seq, dp->dccps_awl, dp->dccps_awh)) { - NET_INC_STATS_BH(net, LINUX_MIB_OUTOFWINDOWICMPS); - goto out; - } - np = inet6_sk(sk); if (type == ICMPV6_PKT_TOOBIG) { @@ -183,6 +168,7 @@ static void dccp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, icmpv6_err_convert(type, code, &err); + seq = dccp_hdr_seq(dh); /* Might be for an request_sock */ switch (sk->sk_state) { struct request_sock *req, **prev; diff --git a/trunk/net/dccp/output.c b/trunk/net/dccp/output.c index d06945c7d3df..fe20068c5d8e 100644 --- a/trunk/net/dccp/output.c +++ b/trunk/net/dccp/output.c @@ -53,11 +53,8 @@ static int dccp_transmit_skb(struct sock *sk, struct sk_buff *skb) dccp_packet_hdr_len(dcb->dccpd_type); int err, set_ack = 1; u64 ackno = dp->dccps_gsr; - /* - * Increment GSS here already in case the option code needs it. - * Update GSS for real only if option processing below succeeds. - */ - dcb->dccpd_seq = ADD48(dp->dccps_gss, 1); + + dccp_inc_seqno(&dp->dccps_gss); switch (dcb->dccpd_type) { case DCCP_PKT_DATA: @@ -69,9 +66,6 @@ static int dccp_transmit_skb(struct sock *sk, struct sk_buff *skb) case DCCP_PKT_REQUEST: set_ack = 0; - /* Use ISS on the first (non-retransmitted) Request. */ - if (icsk->icsk_retransmits == 0) - dcb->dccpd_seq = dp->dccps_iss; /* fall through */ case DCCP_PKT_SYNC: @@ -90,6 +84,8 @@ static int dccp_transmit_skb(struct sock *sk, struct sk_buff *skb) break; } + dcb->dccpd_seq = dp->dccps_gss; + if (dccp_insert_options(sk, skb)) { kfree_skb(skb); return -EPROTO; @@ -107,7 +103,7 @@ static int dccp_transmit_skb(struct sock *sk, struct sk_buff *skb) /* XXX For now we're using only 48 bits sequence numbers */ dh->dccph_x = 1; - dccp_update_gss(sk, dcb->dccpd_seq); + dp->dccps_awh = dp->dccps_gss; dccp_hdr_set_seq(dh, dp->dccps_gss); if (set_ack) dccp_hdr_set_ack(dccp_hdr_ack_bits(skb), ackno); @@ -116,11 +112,6 @@ static int dccp_transmit_skb(struct sock *sk, struct sk_buff *skb) case DCCP_PKT_REQUEST: dccp_hdr_request(skb)->dccph_req_service = dp->dccps_service; - /* - * Limit Ack window to ISS <= P.ackno <= GSS, so that - * only Responses to Requests we sent are considered. - */ - dp->dccps_awl = dp->dccps_iss; break; case DCCP_PKT_RESET: dccp_hdr_reset(skb)->dccph_reset_code = @@ -293,26 +284,14 @@ void dccp_write_xmit(struct sock *sk, int block) } } -/** - * dccp_retransmit_skb - Retransmit Request, Close, or CloseReq packets - * There are only four retransmittable packet types in DCCP: - * - Request in client-REQUEST state (sec. 8.1.1), - * - CloseReq in server-CLOSEREQ state (sec. 8.3), - * - Close in node-CLOSING state (sec. 8.3), - * - Acks in client-PARTOPEN state (sec. 8.1.5, handled by dccp_delack_timer()). - * This function expects sk->sk_send_head to contain the original skb. - */ -int dccp_retransmit_skb(struct sock *sk) +int dccp_retransmit_skb(struct sock *sk, struct sk_buff *skb) { - WARN_ON(sk->sk_send_head == NULL); - if (inet_csk(sk)->icsk_af_ops->rebuild_header(sk) != 0) return -EHOSTUNREACH; /* Routing failure or similar. */ - /* this count is used to distinguish original and retransmitted skb */ - inet_csk(sk)->icsk_retransmits++; - - return dccp_transmit_skb(sk, skb_clone(sk->sk_send_head, GFP_ATOMIC)); + return dccp_transmit_skb(sk, (skb_cloned(skb) ? + pskb_copy(skb, GFP_ATOMIC): + skb_clone(skb, GFP_ATOMIC))); } struct sk_buff *dccp_make_response(struct sock *sk, struct dst_entry *dst, @@ -458,7 +437,19 @@ static inline void dccp_connect_init(struct sock *sk) dccp_sync_mss(sk, dst_mtu(dst)); - /* Initialise GAR as per 8.5; AWL/AWH are set in dccp_transmit_skb() */ + /* + * SWL and AWL are initially adjusted so that they are not less than + * the initial Sequence Numbers received and sent, respectively: + * SWL := max(GSR + 1 - floor(W/4), ISR), + * AWL := max(GSS - W' + 1, ISS). + * These adjustments MUST be applied only at the beginning of the + * connection. + */ + dccp_update_gss(sk, dp->dccps_iss); + dccp_set_seqno(&dp->dccps_awl, max48(dp->dccps_awl, dp->dccps_iss)); + + /* S.GAR - greatest valid acknowledgement number received on a non-Sync; + * initialized to S.ISS (sec. 8.5) */ dp->dccps_gar = dp->dccps_iss; icsk->icsk_retransmits = 0; diff --git a/trunk/net/dccp/timer.c b/trunk/net/dccp/timer.c index 54b3c7e9e016..6a5b961b6f5c 100644 --- a/trunk/net/dccp/timer.c +++ b/trunk/net/dccp/timer.c @@ -98,12 +98,22 @@ static void dccp_retransmit_timer(struct sock *sk) goto backoff; } + /* + * sk->sk_send_head has to have one skb with + * DCCP_SKB_CB(skb)->dccpd_type set to one of the retransmittable DCCP + * packet types. The only packets eligible for retransmission are: + * -- Requests in client-REQUEST state (sec. 8.1.1) + * -- Acks in client-PARTOPEN state (sec. 8.1.5) + * -- CloseReq in server-CLOSEREQ state (sec. 8.3) + * -- Close in node-CLOSING state (sec. 8.3) */ + WARN_ON(sk->sk_send_head == NULL); + /* * More than than 4MSL (8 minutes) has passed, a RESET(aborted) was * sent, no need to retransmit, this sock is dead. */ if (dccp_write_timeout(sk)) - return; + goto out; /* * We want to know the number of packets retransmitted, not the @@ -112,28 +122,30 @@ static void dccp_retransmit_timer(struct sock *sk) if (icsk->icsk_retransmits == 0) DCCP_INC_STATS_BH(DCCP_MIB_TIMEOUTS); - if (dccp_retransmit_skb(sk) != 0) { + if (dccp_retransmit_skb(sk, sk->sk_send_head) < 0) { /* * Retransmission failed because of local congestion, * do not backoff. */ - if (--icsk->icsk_retransmits == 0) + if (icsk->icsk_retransmits == 0) icsk->icsk_retransmits = 1; inet_csk_reset_xmit_timer(sk, ICSK_TIME_RETRANS, min(icsk->icsk_rto, TCP_RESOURCE_PROBE_INTERVAL), DCCP_RTO_MAX); - return; + goto out; } backoff: icsk->icsk_backoff++; + icsk->icsk_retransmits++; icsk->icsk_rto = min(icsk->icsk_rto << 1, DCCP_RTO_MAX); inet_csk_reset_xmit_timer(sk, ICSK_TIME_RETRANS, icsk->icsk_rto, DCCP_RTO_MAX); if (icsk->icsk_retransmits > sysctl_dccp_retries1) __sk_dst_reset(sk); +out:; } static void dccp_write_timer(unsigned long data) diff --git a/trunk/net/ipv4/ipcomp.c b/trunk/net/ipv4/ipcomp.c index 38ccb6dfb02e..a42b64d040c4 100644 --- a/trunk/net/ipv4/ipcomp.c +++ b/trunk/net/ipv4/ipcomp.c @@ -104,7 +104,9 @@ static int ipcomp_tunnel_attach(struct xfrm_state *x) static int ipcomp4_init_state(struct xfrm_state *x) { - int err = -EINVAL; + int err; + struct ipcomp_data *ipcd; + struct xfrm_algo_desc *calg_desc; x->props.header_len = 0; switch (x->props.mode) { diff --git a/trunk/net/ipv6/ipcomp6.c b/trunk/net/ipv6/ipcomp6.c index 4545e4306862..0cfcea42153a 100644 --- a/trunk/net/ipv6/ipcomp6.c +++ b/trunk/net/ipv6/ipcomp6.c @@ -134,7 +134,9 @@ static int ipcomp6_tunnel_attach(struct xfrm_state *x) static int ipcomp6_init_state(struct xfrm_state *x) { - int err = -EINVAL; + int err; + struct ipcomp_data *ipcd; + struct xfrm_algo_desc *calg_desc; x->props.header_len = 0; switch (x->props.mode) { diff --git a/trunk/sound/i2c/other/tea575x-tuner.c b/trunk/sound/i2c/other/tea575x-tuner.c index 83e90057270e..87e3aefeddc3 100644 --- a/trunk/sound/i2c/other/tea575x-tuner.c +++ b/trunk/sound/i2c/other/tea575x-tuner.c @@ -189,7 +189,9 @@ void snd_tea575x_init(struct snd_tea575x *tea) } memset(&tea->vd, 0, sizeof(tea->vd)); + tea->vd.owner = tea->card->module; strcpy(tea->vd.name, tea->tea5759 ? "TEA5759 radio" : "TEA5757 radio"); + tea->vd.type = VID_TYPE_TUNER; tea->vd.release = snd_tea575x_release; video_set_drvdata(&tea->vd, tea); tea->vd.fops = &tea->fops;