Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab...
Linus Torvalds [Sun, 15 Jan 2012 20:49:56 +0000 (12:49 -0800)]
* 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: (655 commits)
  [media] revert patch: HDIC HD29L2 DMB-TH USB2.0 reference design driver
  mb86a20s: Add a few more register settings at the init seq
  mb86a20s: Group registers into the same line
  [media] [PATCH] don't reset the delivery system on DTV_CLEAR
  [media] [BUG] it913x-fe fix typo error making SNR levels unstable
  [media] cx23885: Query the CX25840 during enum_input for status
  [media] cx25840: Add support for g_input_status
  [media] rc-videomate-m1f.c Rename to match remote controler name
  [media] drivers: media: au0828: Fix dependency for VIDEO_AU0828
  [media] convert drivers/media/* to use module_platform_driver()
  [media] drivers: video: cx231xx: Fix dependency for VIDEO_CX231XX_DVB
  [media] Exynos4 JPEG codec v4l2 driver
  [media] doc: v4l: selection: choose pixels as units for selection rectangles
  [media] v4l: s5p-tv: mixer: fix setup of VP scaling
  [media] v4l: s5p-tv: mixer: add support for selection API
  [media] v4l: emulate old crop API using extended crop/compose API
  [media] doc: v4l: add documentation for selection API
  [media] doc: v4l: add binary images for selection API
  [media] v4l: add support for selection api
  [media] hd29l2: fix review findings
  ...

555 files changed:
Documentation/DocBook/media/constraints.png.b64 [new file with mode: 0644]
Documentation/DocBook/media/dvb/dvbproperty.xml
Documentation/DocBook/media/dvb/frontend.xml
Documentation/DocBook/media/selection.png.b64 [new file with mode: 0644]
Documentation/DocBook/media/v4l/biblio.xml
Documentation/DocBook/media/v4l/common.xml
Documentation/DocBook/media/v4l/compat.xml
Documentation/DocBook/media/v4l/controls.xml
Documentation/DocBook/media/v4l/dev-capture.xml
Documentation/DocBook/media/v4l/dev-codec.xml
Documentation/DocBook/media/v4l/dev-effect.xml
Documentation/DocBook/media/v4l/dev-event.xml
Documentation/DocBook/media/v4l/dev-osd.xml
Documentation/DocBook/media/v4l/dev-output.xml
Documentation/DocBook/media/v4l/dev-overlay.xml
Documentation/DocBook/media/v4l/dev-radio.xml
Documentation/DocBook/media/v4l/dev-raw-vbi.xml
Documentation/DocBook/media/v4l/dev-rds.xml
Documentation/DocBook/media/v4l/dev-sliced-vbi.xml
Documentation/DocBook/media/v4l/dev-teletext.xml
Documentation/DocBook/media/v4l/driver.xml
Documentation/DocBook/media/v4l/func-close.xml
Documentation/DocBook/media/v4l/func-ioctl.xml
Documentation/DocBook/media/v4l/func-mmap.xml
Documentation/DocBook/media/v4l/func-munmap.xml
Documentation/DocBook/media/v4l/func-open.xml
Documentation/DocBook/media/v4l/func-poll.xml
Documentation/DocBook/media/v4l/func-read.xml
Documentation/DocBook/media/v4l/func-select.xml
Documentation/DocBook/media/v4l/func-write.xml
Documentation/DocBook/media/v4l/io.xml
Documentation/DocBook/media/v4l/libv4l.xml
Documentation/DocBook/media/v4l/pixfmt-grey.xml
Documentation/DocBook/media/v4l/pixfmt-m420.xml
Documentation/DocBook/media/v4l/pixfmt-nv12.xml
Documentation/DocBook/media/v4l/pixfmt-nv12m.xml
Documentation/DocBook/media/v4l/pixfmt-nv12mt.xml
Documentation/DocBook/media/v4l/pixfmt-nv16.xml
Documentation/DocBook/media/v4l/pixfmt-packed-rgb.xml
Documentation/DocBook/media/v4l/pixfmt-packed-yuv.xml
Documentation/DocBook/media/v4l/pixfmt-sbggr16.xml
Documentation/DocBook/media/v4l/pixfmt-sbggr8.xml
Documentation/DocBook/media/v4l/pixfmt-sgbrg8.xml
Documentation/DocBook/media/v4l/pixfmt-sgrbg8.xml
Documentation/DocBook/media/v4l/pixfmt-uyvy.xml
Documentation/DocBook/media/v4l/pixfmt-vyuy.xml
Documentation/DocBook/media/v4l/pixfmt-y16.xml
Documentation/DocBook/media/v4l/pixfmt-y41p.xml
Documentation/DocBook/media/v4l/pixfmt-yuv410.xml
Documentation/DocBook/media/v4l/pixfmt-yuv411p.xml
Documentation/DocBook/media/v4l/pixfmt-yuv420.xml
Documentation/DocBook/media/v4l/pixfmt-yuv420m.xml
Documentation/DocBook/media/v4l/pixfmt-yuv422p.xml
Documentation/DocBook/media/v4l/pixfmt-yuyv.xml
Documentation/DocBook/media/v4l/pixfmt-yvyu.xml
Documentation/DocBook/media/v4l/pixfmt.xml
Documentation/DocBook/media/v4l/selection-api.xml [new file with mode: 0644]
Documentation/DocBook/media/v4l/v4l2.xml
Documentation/DocBook/media/v4l/vidioc-enum-dv-presets.xml
Documentation/DocBook/media/v4l/vidioc-enum-fmt.xml
Documentation/DocBook/media/v4l/vidioc-enuminput.xml
Documentation/DocBook/media/v4l/vidioc-enumoutput.xml
Documentation/DocBook/media/v4l/vidioc-enumstd.xml
Documentation/DocBook/media/v4l/vidioc-g-ctrl.xml
Documentation/DocBook/media/v4l/vidioc-g-ext-ctrls.xml
Documentation/DocBook/media/v4l/vidioc-g-fbuf.xml
Documentation/DocBook/media/v4l/vidioc-g-frequency.xml
Documentation/DocBook/media/v4l/vidioc-g-modulator.xml
Documentation/DocBook/media/v4l/vidioc-g-priority.xml
Documentation/DocBook/media/v4l/vidioc-g-selection.xml [new file with mode: 0644]
Documentation/DocBook/media/v4l/vidioc-g-std.xml
Documentation/DocBook/media/v4l/vidioc-g-tuner.xml
Documentation/DocBook/media/v4l/vidioc-querybuf.xml
Documentation/DocBook/media/v4l/vidioc-queryctrl.xml
Documentation/DocBook/media/v4l/vidioc-s-hw-freq-seek.xml
Documentation/dvb/get_dvb_firmware
Documentation/feature-removal-schedule.txt
Documentation/video4linux/CARDLIST.au0828
Documentation/video4linux/CARDLIST.bttv
Documentation/video4linux/CARDLIST.cx23885
Documentation/video4linux/CARDLIST.cx88
Documentation/video4linux/CARDLIST.em28xx
Documentation/video4linux/CARDLIST.saa7134
Documentation/video4linux/CARDLIST.saa7164
Documentation/video4linux/gspca.txt
Documentation/video4linux/v4l2-framework.txt
MAINTAINERS
drivers/media/common/tuners/Kconfig
drivers/media/common/tuners/Makefile
drivers/media/common/tuners/max2165.c
drivers/media/common/tuners/mc44s803.c
drivers/media/common/tuners/mt2060.c
drivers/media/common/tuners/mt2060_priv.h
drivers/media/common/tuners/mt2063.c [new file with mode: 0644]
drivers/media/common/tuners/mt2063.h [new file with mode: 0644]
drivers/media/common/tuners/mt2131.c
drivers/media/common/tuners/mt2131_priv.h
drivers/media/common/tuners/mt2266.c
drivers/media/common/tuners/mxl5005s.c
drivers/media/common/tuners/mxl5007t.c
drivers/media/common/tuners/qt1010.c
drivers/media/common/tuners/qt1010_priv.h
drivers/media/common/tuners/tda18212.c
drivers/media/common/tuners/tda18212.h
drivers/media/common/tuners/tda18218.c
drivers/media/common/tuners/tda18218_priv.h
drivers/media/common/tuners/tda18271-fe.c
drivers/media/common/tuners/tda18271-maps.c
drivers/media/common/tuners/tda18271-priv.h
drivers/media/common/tuners/tda18271.h
drivers/media/common/tuners/tda827x.c
drivers/media/common/tuners/tuner-simple.c
drivers/media/common/tuners/tuner-xc2028.c
drivers/media/common/tuners/xc4000.c
drivers/media/common/tuners/xc5000.c
drivers/media/dvb/b2c2/flexcop.c
drivers/media/dvb/bt8xx/dst.c
drivers/media/dvb/bt8xx/dst_common.h
drivers/media/dvb/bt8xx/dvb-bt8xx.c
drivers/media/dvb/ddbridge/ddbridge-core.c
drivers/media/dvb/dm1105/dm1105.c
drivers/media/dvb/dvb-core/dvb_ca_en50221.c
drivers/media/dvb/dvb-core/dvb_frontend.c
drivers/media/dvb/dvb-core/dvb_frontend.h
drivers/media/dvb/dvb-core/dvb_net.c
drivers/media/dvb/dvb-usb/Kconfig
drivers/media/dvb/dvb-usb/af9005-fe.c
drivers/media/dvb/dvb-usb/af9005.c
drivers/media/dvb/dvb-usb/af9015.c
drivers/media/dvb/dvb-usb/af9015.h
drivers/media/dvb/dvb-usb/anysee.c
drivers/media/dvb/dvb-usb/anysee.h
drivers/media/dvb/dvb-usb/cinergyT2-fe.c
drivers/media/dvb/dvb-usb/cxusb.c
drivers/media/dvb/dvb-usb/dib0700_devices.c
drivers/media/dvb/dvb-usb/digitv.c
drivers/media/dvb/dvb-usb/dtt200u-fe.c
drivers/media/dvb/dvb-usb/dvb-usb-dvb.c
drivers/media/dvb/dvb-usb/dvb-usb-ids.h
drivers/media/dvb/dvb-usb/dw2102.c
drivers/media/dvb/dvb-usb/friio-fe.c
drivers/media/dvb/dvb-usb/gp8psk-fe.c
drivers/media/dvb/dvb-usb/it913x.c
drivers/media/dvb/dvb-usb/lmedm04.c
drivers/media/dvb/dvb-usb/mxl111sf-demod.c
drivers/media/dvb/dvb-usb/mxl111sf-tuner.c
drivers/media/dvb/dvb-usb/mxl111sf.c
drivers/media/dvb/dvb-usb/ttusb2.c
drivers/media/dvb/dvb-usb/vp702x-fe.c
drivers/media/dvb/dvb-usb/vp7045-fe.c
drivers/media/dvb/firewire/firedtv-avc.c
drivers/media/dvb/firewire/firedtv-dvb.c
drivers/media/dvb/firewire/firedtv-fe.c
drivers/media/dvb/firewire/firedtv.h
drivers/media/dvb/frontends/Kconfig
drivers/media/dvb/frontends/Makefile
drivers/media/dvb/frontends/af9013.c
drivers/media/dvb/frontends/af9013.h
drivers/media/dvb/frontends/af9013_priv.h
drivers/media/dvb/frontends/atbm8830.c
drivers/media/dvb/frontends/au8522_dig.c
drivers/media/dvb/frontends/bcm3510.c
drivers/media/dvb/frontends/bsbe1.h
drivers/media/dvb/frontends/bsru6.h
drivers/media/dvb/frontends/cx22700.c
drivers/media/dvb/frontends/cx22702.c
drivers/media/dvb/frontends/cx24110.c
drivers/media/dvb/frontends/cx24113.c
drivers/media/dvb/frontends/cx24116.c
drivers/media/dvb/frontends/cx24123.c
drivers/media/dvb/frontends/cxd2820r.h
drivers/media/dvb/frontends/cxd2820r_c.c
drivers/media/dvb/frontends/cxd2820r_core.c
drivers/media/dvb/frontends/cxd2820r_priv.h
drivers/media/dvb/frontends/cxd2820r_t.c
drivers/media/dvb/frontends/cxd2820r_t2.c
drivers/media/dvb/frontends/dib0070.c
drivers/media/dvb/frontends/dib0090.c
drivers/media/dvb/frontends/dib0090.h
drivers/media/dvb/frontends/dib3000mb.c
drivers/media/dvb/frontends/dib3000mb_priv.h
drivers/media/dvb/frontends/dib3000mc.c
drivers/media/dvb/frontends/dib7000m.c
drivers/media/dvb/frontends/dib7000p.c
drivers/media/dvb/frontends/dib7000p.h
drivers/media/dvb/frontends/dib8000.c
drivers/media/dvb/frontends/dib8000.h
drivers/media/dvb/frontends/dib9000.c
drivers/media/dvb/frontends/dibx000_common.h
drivers/media/dvb/frontends/drxd.h
drivers/media/dvb/frontends/drxd_hard.c
drivers/media/dvb/frontends/drxk.h
drivers/media/dvb/frontends/drxk_hard.c
drivers/media/dvb/frontends/drxk_hard.h
drivers/media/dvb/frontends/ds3000.c
drivers/media/dvb/frontends/dvb-pll.c
drivers/media/dvb/frontends/dvb_dummy_fe.c
drivers/media/dvb/frontends/ec100.c
drivers/media/dvb/frontends/hd29l2.c [new file with mode: 0644]
drivers/media/dvb/frontends/hd29l2.h [new file with mode: 0644]
drivers/media/dvb/frontends/hd29l2_priv.h [new file with mode: 0644]
drivers/media/dvb/frontends/it913x-fe-priv.h
drivers/media/dvb/frontends/it913x-fe.c
drivers/media/dvb/frontends/it913x-fe.h
drivers/media/dvb/frontends/itd1000.c
drivers/media/dvb/frontends/ix2505v.c
drivers/media/dvb/frontends/l64781.c
drivers/media/dvb/frontends/lgdt3305.c
drivers/media/dvb/frontends/lgdt330x.c
drivers/media/dvb/frontends/lgs8gl5.c
drivers/media/dvb/frontends/lgs8gxx.c
drivers/media/dvb/frontends/mb86a16.c
drivers/media/dvb/frontends/mb86a20s.c
drivers/media/dvb/frontends/mt312.c
drivers/media/dvb/frontends/mt352.c
drivers/media/dvb/frontends/nxt200x.c
drivers/media/dvb/frontends/nxt6000.c
drivers/media/dvb/frontends/or51132.c
drivers/media/dvb/frontends/or51211.c
drivers/media/dvb/frontends/s5h1409.c
drivers/media/dvb/frontends/s5h1411.c
drivers/media/dvb/frontends/s5h1420.c
drivers/media/dvb/frontends/s5h1432.c
drivers/media/dvb/frontends/s921.c
drivers/media/dvb/frontends/si21xx.c
drivers/media/dvb/frontends/sp8870.c
drivers/media/dvb/frontends/sp887x.c
drivers/media/dvb/frontends/stb0899_drv.c
drivers/media/dvb/frontends/stb6000.c
drivers/media/dvb/frontends/stb6100.c
drivers/media/dvb/frontends/stv0288.c
drivers/media/dvb/frontends/stv0297.c
drivers/media/dvb/frontends/stv0299.c
drivers/media/dvb/frontends/stv0367.c
drivers/media/dvb/frontends/stv0900_core.c
drivers/media/dvb/frontends/stv090x.c
drivers/media/dvb/frontends/stv6110.c
drivers/media/dvb/frontends/tda10021.c
drivers/media/dvb/frontends/tda10023.c
drivers/media/dvb/frontends/tda10048.c
drivers/media/dvb/frontends/tda1004x.c
drivers/media/dvb/frontends/tda10071.c
drivers/media/dvb/frontends/tda10086.c
drivers/media/dvb/frontends/tda18271c2dd.c
drivers/media/dvb/frontends/tda8083.c
drivers/media/dvb/frontends/tda826x.c
drivers/media/dvb/frontends/tdhd1.h
drivers/media/dvb/frontends/tua6100.c
drivers/media/dvb/frontends/ves1820.c
drivers/media/dvb/frontends/ves1x93.c
drivers/media/dvb/frontends/zl10036.c
drivers/media/dvb/frontends/zl10039.c
drivers/media/dvb/frontends/zl10353.c
drivers/media/dvb/mantis/mantis_vp1033.c
drivers/media/dvb/mantis/mantis_vp2033.c
drivers/media/dvb/mantis/mantis_vp2040.c
drivers/media/dvb/ngene/ngene-cards.c
drivers/media/dvb/pluto2/pluto2.c
drivers/media/dvb/pt1/va1j5jf8007s.c
drivers/media/dvb/pt1/va1j5jf8007t.c
drivers/media/dvb/siano/smsdvb.c
drivers/media/dvb/ttpci/av7110.c
drivers/media/dvb/ttpci/av7110.h
drivers/media/dvb/ttpci/budget-av.c
drivers/media/dvb/ttpci/budget-ci.c
drivers/media/dvb/ttpci/budget-patch.c
drivers/media/dvb/ttpci/budget.c
drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c
drivers/media/dvb/ttusb-dec/ttusbdecfe.c
drivers/media/media-device.c
drivers/media/radio/Kconfig
drivers/media/radio/radio-si4713.c
drivers/media/radio/radio-timb.c
drivers/media/radio/radio-wl1273.c
drivers/media/radio/tef6862.c
drivers/media/radio/wl128x/Kconfig
drivers/media/radio/wl128x/fmdrv_common.c
drivers/media/radio/wl128x/fmdrv_common.h
drivers/media/radio/wl128x/fmdrv_rx.c
drivers/media/radio/wl128x/fmdrv_rx.h
drivers/media/radio/wl128x/fmdrv_tx.c
drivers/media/radio/wl128x/fmdrv_tx.h
drivers/media/radio/wl128x/fmdrv_v4l2.c
drivers/media/rc/Kconfig
drivers/media/rc/Makefile
drivers/media/rc/ir-nec-decoder.c
drivers/media/rc/ir-raw.c
drivers/media/rc/ir-rc6-decoder.c
drivers/media/rc/ir-sanyo-decoder.c [new file with mode: 0644]
drivers/media/rc/keymaps/rc-hauppauge.c
drivers/media/rc/keymaps/rc-videomate-m1f.c
drivers/media/rc/rc-core-priv.h
drivers/media/rc/rc-main.c
drivers/media/rc/redrat3.c
drivers/media/video/Kconfig
drivers/media/video/Makefile
drivers/media/video/adv7170.c
drivers/media/video/as3645a.c [new file with mode: 0644]
drivers/media/video/atmel-isi.c
drivers/media/video/au0828/Kconfig
drivers/media/video/au0828/au0828-i2c.c
drivers/media/video/bt8xx/bt848.h
drivers/media/video/bt8xx/bttv-cards.c
drivers/media/video/bt8xx/bttv-driver.c
drivers/media/video/bt8xx/bttv-i2c.c
drivers/media/video/bt8xx/bttv.h
drivers/media/video/cx18/cx18-i2c.c
drivers/media/video/cx18/cx18-i2c.h
drivers/media/video/cx231xx/Kconfig
drivers/media/video/cx231xx/cx231xx-audio.c
drivers/media/video/cx231xx/cx231xx-cards.c
drivers/media/video/cx231xx/cx231xx-core.c
drivers/media/video/cx231xx/cx231xx-dvb.c
drivers/media/video/cx231xx/cx231xx-input.c
drivers/media/video/cx231xx/cx231xx-vbi.c
drivers/media/video/cx231xx/cx231xx-video.c
drivers/media/video/cx231xx/cx231xx.h
drivers/media/video/cx23885/cx23885-417.c
drivers/media/video/cx23885/cx23885-cards.c
drivers/media/video/cx23885/cx23885-core.c
drivers/media/video/cx23885/cx23885-dvb.c
drivers/media/video/cx23885/cx23885-i2c.c
drivers/media/video/cx23885/cx23885-video.c
drivers/media/video/cx23885/cx23885.h
drivers/media/video/cx25821/cx25821-alsa.c
drivers/media/video/cx25821/cx25821-audio-upstream.c
drivers/media/video/cx25821/cx25821-audio.h
drivers/media/video/cx25821/cx25821-cards.c
drivers/media/video/cx25821/cx25821-core.c
drivers/media/video/cx25821/cx25821-i2c.c
drivers/media/video/cx25821/cx25821-medusa-defines.h
drivers/media/video/cx25821/cx25821-medusa-reg.h
drivers/media/video/cx25821/cx25821-medusa-video.c
drivers/media/video/cx25821/cx25821-video-upstream-ch2.c
drivers/media/video/cx25821/cx25821-video-upstream.c
drivers/media/video/cx25821/cx25821-video.c
drivers/media/video/cx25821/cx25821.h
drivers/media/video/cx25840/cx25840-audio.c
drivers/media/video/cx25840/cx25840-core.c
drivers/media/video/cx88/Kconfig
drivers/media/video/cx88/cx88-cards.c
drivers/media/video/cx88/cx88-dvb.c
drivers/media/video/cx88/cx88-i2c.c
drivers/media/video/cx88/cx88-input.c
drivers/media/video/cx88/cx88.h
drivers/media/video/davinci/dm355_ccdc.c
drivers/media/video/davinci/dm644x_ccdc.c
drivers/media/video/davinci/isif.c
drivers/media/video/davinci/vpbe.c
drivers/media/video/davinci/vpbe_display.c
drivers/media/video/davinci/vpbe_osd.c
drivers/media/video/davinci/vpbe_venc.c
drivers/media/video/davinci/vpfe_capture.c
drivers/media/video/davinci/vpif_capture.c
drivers/media/video/em28xx/em28xx-audio.c
drivers/media/video/em28xx/em28xx-cards.c
drivers/media/video/em28xx/em28xx-core.c
drivers/media/video/em28xx/em28xx-dvb.c
drivers/media/video/em28xx/em28xx-input.c
drivers/media/video/em28xx/em28xx-reg.h
drivers/media/video/em28xx/em28xx-video.c
drivers/media/video/em28xx/em28xx.h
drivers/media/video/fsl-viu.c
drivers/media/video/gspca/Kconfig
drivers/media/video/gspca/Makefile
drivers/media/video/gspca/benq.c
drivers/media/video/gspca/gl860/gl860.c
drivers/media/video/gspca/gspca.c
drivers/media/video/gspca/gspca.h
drivers/media/video/gspca/jl2005bcd.c [new file with mode: 0644]
drivers/media/video/gspca/konica.c
drivers/media/video/gspca/mars.c
drivers/media/video/gspca/nw80x.c
drivers/media/video/gspca/ov519.c
drivers/media/video/gspca/ov534_9.c
drivers/media/video/gspca/pac207.c
drivers/media/video/gspca/pac7302.c
drivers/media/video/gspca/se401.c
drivers/media/video/gspca/sn9c20x.c
drivers/media/video/gspca/sonixb.c
drivers/media/video/gspca/sonixj.c
drivers/media/video/gspca/spca561.c
drivers/media/video/gspca/stv06xx/stv06xx.c
drivers/media/video/gspca/t613.c
drivers/media/video/gspca/topro.c
drivers/media/video/gspca/vicam.c
drivers/media/video/gspca/xirlink_cit.c
drivers/media/video/gspca/zc3xx.c
drivers/media/video/ir-kbd-i2c.c
drivers/media/video/ivtv/ivtv-i2c.h
drivers/media/video/m5mols/m5mols.h
drivers/media/video/m5mols/m5mols_capture.c
drivers/media/video/m5mols/m5mols_core.c
drivers/media/video/m5mols/m5mols_reg.h
drivers/media/video/marvell-ccic/mcam-core.c
drivers/media/video/marvell-ccic/mmp-driver.c
drivers/media/video/mt9m001.c
drivers/media/video/mt9m111.c
drivers/media/video/mt9p031.c
drivers/media/video/mt9t001.c
drivers/media/video/mt9t031.c
drivers/media/video/mt9v022.c
drivers/media/video/mt9v032.c
drivers/media/video/mx1_camera.c
drivers/media/video/mx2_camera.c
drivers/media/video/mx3_camera.c
drivers/media/video/omap/omap_vout.c
drivers/media/video/omap/omap_voutdef.h
drivers/media/video/omap1_camera.c
drivers/media/video/omap24xxcam.c
drivers/media/video/omap3isp/isp.c
drivers/media/video/omap3isp/ispccdc.c
drivers/media/video/omap3isp/ispccdc.h
drivers/media/video/omap3isp/ispccp2.c
drivers/media/video/omap3isp/ispccp2.h
drivers/media/video/omap3isp/ispcsi2.c
drivers/media/video/omap3isp/ispcsi2.h
drivers/media/video/omap3isp/isppreview.c
drivers/media/video/omap3isp/isppreview.h
drivers/media/video/omap3isp/ispresizer.c
drivers/media/video/omap3isp/ispresizer.h
drivers/media/video/omap3isp/ispvideo.c
drivers/media/video/omap3isp/ispvideo.h
drivers/media/video/pvrusb2/pvrusb2-hdw.c
drivers/media/video/pwc/pwc-ctrl.c
drivers/media/video/pwc/pwc-dec23.c
drivers/media/video/pwc/pwc-dec23.h
drivers/media/video/pwc/pwc-if.c
drivers/media/video/pwc/pwc-kiara.h
drivers/media/video/pwc/pwc-misc.c
drivers/media/video/pwc/pwc-timon.h
drivers/media/video/pwc/pwc-uncompress.c
drivers/media/video/pwc/pwc-v4l.c
drivers/media/video/pwc/pwc.h
drivers/media/video/pxa_camera.c
drivers/media/video/s5p-fimc/fimc-capture.c
drivers/media/video/s5p-fimc/fimc-core.c
drivers/media/video/s5p-fimc/fimc-core.h
drivers/media/video/s5p-fimc/fimc-reg.c
drivers/media/video/s5p-fimc/mipi-csis.c
drivers/media/video/s5p-fimc/mipi-csis.h
drivers/media/video/s5p-fimc/regs-fimc.h
drivers/media/video/s5p-g2d/Makefile [new file with mode: 0644]
drivers/media/video/s5p-g2d/g2d-hw.c [new file with mode: 0644]
drivers/media/video/s5p-g2d/g2d-regs.h [new file with mode: 0644]
drivers/media/video/s5p-g2d/g2d.c [new file with mode: 0644]
drivers/media/video/s5p-g2d/g2d.h [new file with mode: 0644]
drivers/media/video/s5p-jpeg/Makefile [new file with mode: 0644]
drivers/media/video/s5p-jpeg/jpeg-core.c [new file with mode: 0644]
drivers/media/video/s5p-jpeg/jpeg-core.h [new file with mode: 0644]
drivers/media/video/s5p-jpeg/jpeg-hw.h [new file with mode: 0644]
drivers/media/video/s5p-jpeg/jpeg-regs.h [new file with mode: 0644]
drivers/media/video/s5p-mfc/s5p_mfc.c
drivers/media/video/s5p-tv/hdmi_drv.c
drivers/media/video/s5p-tv/mixer.h
drivers/media/video/s5p-tv/mixer_grp_layer.c
drivers/media/video/s5p-tv/mixer_video.c
drivers/media/video/s5p-tv/mixer_vp_layer.c
drivers/media/video/s5p-tv/sdo_drv.c
drivers/media/video/saa7134/saa7134-cards.c
drivers/media/video/saa7134/saa7134-core.c
drivers/media/video/saa7134/saa7134-dvb.c
drivers/media/video/saa7134/saa7134-input.c
drivers/media/video/saa7134/saa7134-tvaudio.c
drivers/media/video/saa7134/saa7134-video.c
drivers/media/video/saa7134/saa7134.h
drivers/media/video/saa7164/saa7164-bus.c
drivers/media/video/sh_mobile_ceu_camera.c
drivers/media/video/sh_mobile_csi2.c
drivers/media/video/soc_camera.c
drivers/media/video/soc_camera_platform.c
drivers/media/video/stk-webcam.c
drivers/media/video/timblogiw.c
drivers/media/video/tlg2300/pd-common.h
drivers/media/video/tlg2300/pd-dvb.c
drivers/media/video/tm6000/Kconfig
drivers/media/video/tm6000/tm6000-alsa.c
drivers/media/video/tm6000/tm6000-cards.c
drivers/media/video/tm6000/tm6000-core.c
drivers/media/video/tm6000/tm6000-dvb.c
drivers/media/video/tm6000/tm6000-i2c.c
drivers/media/video/tm6000/tm6000-input.c
drivers/media/video/tm6000/tm6000-regs.h
drivers/media/video/tm6000/tm6000-stds.c
drivers/media/video/tm6000/tm6000-video.c
drivers/media/video/tm6000/tm6000.h
drivers/media/video/tuner-core.c
drivers/media/video/tvp5150.c
drivers/media/video/usbvision/usbvision-i2c.c
drivers/media/video/uvc/Kconfig
drivers/media/video/uvc/Makefile
drivers/media/video/uvc/uvc_ctrl.c
drivers/media/video/uvc/uvc_debugfs.c [new file with mode: 0644]
drivers/media/video/uvc/uvc_driver.c
drivers/media/video/uvc/uvc_isight.c
drivers/media/video/uvc/uvc_queue.c
drivers/media/video/uvc/uvc_v4l2.c
drivers/media/video/uvc/uvc_video.c
drivers/media/video/uvc/uvcvideo.h
drivers/media/video/v4l2-compat-ioctl32.c
drivers/media/video/v4l2-ctrls.c
drivers/media/video/v4l2-dev.c
drivers/media/video/v4l2-device.c
drivers/media/video/v4l2-ioctl.c
drivers/media/video/v4l2-subdev.c
drivers/media/video/via-camera.c
drivers/media/video/videobuf-dvb.c
drivers/media/video/videobuf2-core.c
drivers/media/video/videobuf2-dma-sg.c
drivers/media/video/videobuf2-memops.c
drivers/media/video/videobuf2-vmalloc.c
drivers/media/video/vino.c
drivers/staging/media/as102/Kconfig
drivers/staging/media/as102/Makefile
drivers/staging/media/as102/as102_drv.c
drivers/staging/media/as102/as102_drv.h
drivers/staging/media/as102/as102_fe.c
drivers/staging/media/as102/as102_fw.c
drivers/staging/media/as102/as102_fw.h
drivers/staging/media/as102/as102_usb_drv.c
drivers/staging/media/as102/as102_usb_drv.h
drivers/staging/media/as102/as10x_cmd.c
drivers/staging/media/as102/as10x_cmd.h
drivers/staging/media/as102/as10x_cmd_cfg.c
drivers/staging/media/as102/as10x_cmd_stream.c
drivers/staging/media/as102/as10x_handle.h
drivers/staging/media/as102/as10x_types.h
drivers/staging/media/dt3155v4l/dt3155v4l.c
drivers/staging/media/easycap/easycap.h
drivers/staging/media/easycap/easycap_ioctl.c
drivers/staging/media/easycap/easycap_low.c
drivers/staging/media/easycap/easycap_main.c
drivers/staging/media/easycap/easycap_settings.c
drivers/staging/media/easycap/easycap_sound.c
drivers/staging/media/go7007/go7007-usb.c
drivers/staging/media/lirc/lirc_imon.c
drivers/staging/media/lirc/lirc_serial.c
drivers/staging/media/solo6x10/Makefile
drivers/staging/media/solo6x10/solo6x10-jpeg.h [moved from drivers/staging/media/solo6x10/jpeg.h with 100% similarity]
drivers/staging/media/solo6x10/v4l2-enc.c
fs/compat_ioctl.c
include/linux/dvb/frontend.h
include/linux/dvb/version.h
include/linux/videodev2.h
include/media/as3645a.h [new file with mode: 0644]
include/media/atmel-isi.h
include/media/cx25840.h
include/media/davinci/vpbe.h
include/media/davinci/vpbe_venc.h
include/media/media-entity.h
include/media/omap3isp.h
include/media/pwc-ioctl.h [deleted file]
include/media/rc-map.h
include/media/soc_camera.h
include/media/v4l2-ioctl.h

diff --git a/Documentation/DocBook/media/constraints.png.b64 b/Documentation/DocBook/media/constraints.png.b64
new file mode 100644 (file)
index 0000000..125b4a9
--- /dev/null
@@ -0,0 +1,59 @@
+iVBORw0KGgoAAAANSUhEUgAAAlQAAAFYCAYAAACVsmLPAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A
+/wD/oL2nkwAAAAlwSFlzAAAOxAAADsQBlSsOGwAAAAd0SU1FB9sLCBIAKVtZsMAAAAxxSURBVHja
+7d3ZbqvIAkDRLsv//8v0QytXvpYZap7Wko56OAnE2AXbBSbhOI7jHwAAkr1sAgAAQQUAIKgAAAQV
+AICgAgBAUAEACCoAAEEFACCoAAAQVAAAzb2jvyMEWw0AmFvh37xnhgoAQFABAPT1zvruwtNlAADV
+VLxsyQwVAICgAgAQVAAAggoAQFABACCoYEohuFkugKACsmLq178DIKiAyJgSVQCCCigQU6IKQFAB
+BWJKVAEIKqBgKIkqAEEFFAgkUQUgqIACYSSqAAQViKkwxjIAEFSwbUyJKgBBBWJq8GUCIKhgm5gS
+VQCCCsSUqAIQVMBYoSOqAAQVLOk41lwXAIIKhoqqJyFUYhkACCpYMqpiQqjEMgAQVLBUVKWEUIll
+ACCoYImoygmhEssAQFDBElHVexkACCoAAEEFACCoAAAQVAAAggoAQFABAAgqAAAEFQCAoAIAEFQA
+AIIKAABBBQAgqAAABBUAgKACAOA/b5sAGjsO2wBgMWaoAAAEFQCAoAIAEFQAADtzUXohIQQbAYDi
+Dh9kmYIZKgAAQQUAIKgAAAQVAICgAgAgmU/5VeSTGQDE8InxeZmhAgAQVAAAggoAQFABAAgqAAAE
+FQCAoAIAEFQAAHtyY0/o4O7efe4JCzAXM1QAAIIKAEBQAQAIKgAAQQUAgKACABBUAACCCgBAUAEA
+IKgAAAQVAICgAgAQVAAACCoAAEEFACCoAAAEFVBICGMsAwBBBVPHVE4QlVgGAIIKpo6ps/9utQwA
+BBUsEVMpQVRiGQAIKlgqpmKCqMQyABBUsGRMzbouAAQVNHMca64LA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noliY9TV/FzZnr++U+z+dfcIw93qblPtNxVwUvcIF7N/7uZJRlbLMQS5KN0MFtQ4w
+YgrWGberjs+Y21vExmqN/eDAz0M4jsifrtZ5alh5ZyWmAMbaJxfe75qhgl7veMUUwDIEFfSMKjEF
+sAQXpUOrqJrk5nSwpLvT7yOMxxl+Ro9LUMFQUSWmoP348zN6XIIK7FgAWDWo/DZuAAAXpQMACCoA
+gM7iT/m5BgQA4P+YoQIAEFQAAIIKAEBQAQAIKgAABBUAgKACABBUAAB7+hfHbDX87cMFJQAAAABJ
+RU5ErkJggg==
index 3bc8a61..ffee1fb 100644 (file)
@@ -334,9 +334,10 @@ typedef enum fe_rolloff {
                <title>fe_delivery_system type</title>
                <para>Possible values: </para>
 <programlisting>
+
 typedef enum fe_delivery_system {
        SYS_UNDEFINED,
-       SYS_DVBC_ANNEX_AC,
+       SYS_DVBC_ANNEX_A,
        SYS_DVBC_ANNEX_B,
        SYS_DVBT,
        SYS_DSS,
@@ -353,6 +354,7 @@ typedef enum fe_delivery_system {
        SYS_DAB,
        SYS_DVBT2,
        SYS_TURBO,
+       SYS_DVBC_ANNEX_C,
 } fe_delivery_system_t;
 </programlisting>
                </section>
@@ -647,6 +649,18 @@ typedef enum fe_hierarchy {
                        many data types via a single multiplex. The API will soon support this
                        at which point this section will be expanded.</para>
        </section>
+       <section id="DTV_ENUM_DELSYS">
+               <title><constant>DTV_ENUM_DELSYS</constant></title>
+               <para>A Multi standard frontend needs to advertise the delivery systems provided.
+                       Applications need to enumerate the provided delivery systems, before using
+                       any other operation with the frontend. Prior to it's introduction,
+                       FE_GET_INFO was used to determine a frontend type. A frontend which
+                       provides more than a single delivery system, FE_GET_INFO doesn't help much.
+                       Applications which intends to use a multistandard frontend must enumerate
+                       the delivery systems associated with it, rather than trying to use
+                       FE_GET_INFO. In the case of a legacy frontend, the result is just the same
+                       as with FE_GET_INFO, but in a more structured format </para>
+       </section>
 </section>
        <section id="frontend-property-terrestrial-systems">
        <title>Properties used on terrestrial delivery systems</title>
@@ -767,7 +781,8 @@ typedef enum fe_hierarchy {
        <title>Properties used on cable delivery systems</title>
        <section id="dvbc-params">
                <title>DVB-C delivery system</title>
-               <para>The DVB-C Annex-A/C is the widely used cable standard. Transmission uses QAM modulation.</para>
+               <para>The DVB-C Annex-A is the widely used cable standard. Transmission uses QAM modulation.</para>
+               <para>The DVB-C Annex-C is optimized for 6MHz, and is used in Japan. It supports a subset of the Annex A modulation types, and a roll-off of 0.13, instead of 0.15</para>
                <para>The following parameters are valid for DVB-C Annex A/C:</para>
                <itemizedlist mark='opencircle'>
                        <listitem><para><link linkend="DTV-API-VERSION"><constant>DTV_API_VERSION</constant></link></para></listitem>
index 61407ea..aeaed59 100644 (file)
@@ -45,8 +45,8 @@ transmission. The fontend types are given by fe_type_t type, defined as:</para>
   </row>
   <row>
      <entry id="FE_QAM"><constant>FE_QAM</constant></entry>
-     <entry>For DVB-C annex A/C standard</entry>
-     <entry><constant>SYS_DVBC_ANNEX_AC</constant></entry>
+     <entry>For DVB-C annex A standard</entry>
+     <entry><constant>SYS_DVBC_ANNEX_A</constant></entry>
   </row>
   <row>
      <entry id="FE_OFDM"><constant>FE_OFDM</constant></entry>
@@ -63,6 +63,10 @@ transmission. The fontend types are given by fe_type_t type, defined as:</para>
 <para>Newer formats like DVB-S2, ISDB-T, ISDB-S and DVB-T2 are not described at the above, as they're
 supported via the new <link linkend="FE_GET_SET_PROPERTY">FE_GET_PROPERTY/FE_GET_SET_PROPERTY</link> ioctl's, using the <link linkend="DTV-DELIVERY-SYSTEM">DTV_DELIVERY_SYSTEM</link> parameter.
 </para>
+
+<para>The usage of this field is deprecated, as it doesn't report all supported standards, and
+will provide an incomplete information for frontends that support multiple delivery systems.
+Please use <link linkend="DTV_ENUM_DELSYS">DTV_ENUM_DELSYS</link> instead.</para>
 </section>
 
 <section id="fe-caps-t">
diff --git a/Documentation/DocBook/media/selection.png.b64 b/Documentation/DocBook/media/selection.png.b64
new file mode 100644 (file)
index 0000000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5YumxPbMlfECALz2tbY+DGTtCbO1PBxky3a21E86eiy2
+PiE4VT+9l/YHKKVIZdHR0s21JyDs/WWjhvmM/CIDAIzouX+3pSpo6fUxfbsSc2nu2c49fdaUUzds
+DWy27mOq45dif1K1P0DPslYWbf3VKPXya3uKQ6rt9osMANCDrQ/7qPmhJr3u17uK8b3bnGo/j94F
+0Op5BVDSZZqmafObLpdNH55rQcJrBcrWx83HLv/19ak+/Pc+Qn7rdqfc19flbA1+UuwLAGz9rt3R
+baFkx/J3H/F+lD59/wPA6T5+96Muv/87pj9VZM6iFGn93mXU8uQGv8gAAAAALShSWQQAcITKokY6
+liqLAKA6eyqLfmg2AADoj2kCANhLWAQAAB0SBgGwl7BohV9kAAAAgJEIi1YIgwAAAICRCIsAAMji
+Y6VCGwCo01+aAAAAAIA7lUUAACR10QQA0PZ3+TRN0+Y3XXQBAIDydnRbKNmx1EcEgC76UyqLAAAo
+1vkEAOq3KyzSEQAAAADokwmuAQAAAHgQFgEAAADwICwCAAAA4EFYBAAAAMCDsAgAAACAB2ERAAAA
+AA/CIgAAAAAehEUAAAAAPAiLAAAAAHgQFgEAAADwICwCAAAA4EFYBAAAAMCDsAgAAACAB2ERAAAA
+AA/CIgAAAAAehEUAAAAAPAiLAAAAAHgQFgEAAADwICwCAAAA4EFYBAAAAMCDsAgAAACAB2ERAAAA
+AA/CIgAAAAAe/g/10lQlA3JSSwAAAABJRU5ErkJggg==
index afc8a0d..cea6fd3 100644 (file)
@@ -178,11 +178,3 @@ in the frequency range from 87,5 to 108,0 MHz</title>
     </biblioentry>
 
   </bibliography>
-
-  <!--
-Local Variables:
-mode: sgml
-sgml-parent-document: "v4l2.sgml"
-indent-tabs-mode: nil
-End:
-  -->
index a86f7a0..c79278a 100644 (file)
@@ -1168,6 +1168,8 @@ dheight = format.fmt.pix.height;
     </section>
   </section>
 
+  &sub-selection-api;
+
   <section id="streaming-par">
     <title>Streaming Parameters</title>
 
@@ -1195,11 +1197,3 @@ separate parameters for input and output devices.</para>
     <para>These ioctls are optional, drivers need not implement
 them. If so, they return the &EINVAL;.</para>
   </section>
-
-  <!--
-Local Variables:
-mode: sgml
-sgml-parent-document: "v4l2.sgml"
-indent-tabs-mode: nil
-End:
-  -->
index b68698f..c736380 100644 (file)
@@ -1082,7 +1082,7 @@ until the time in the timestamp field has arrived. I would like to
 follow SGI's lead, and adopt a multimedia timestamping system like
 their UST (Unadjusted System Time). See
 http://web.archive.org/web/*/http://reality.sgi.com
-/cpirazzi_engr/lg/time/intro.html. 
+/cpirazzi_engr/lg/time/intro.html.
 UST uses timestamps that are 64-bit signed integers
 (not struct timeval's) and given in nanosecond units. The UST clock
 starts at zero when the system is booted and runs continuously and
@@ -2376,6 +2376,23 @@ that used it. It was originally scheduled for removal in 2.6.35.
         <listitem>
          <para>V4L2_CTRL_FLAG_VOLATILE was added to signal volatile controls to userspace.</para>
         </listitem>
+        <listitem>
+         <para>Add selection API for extended control over cropping and
+composing. Does not affect the compatibility of current drivers and
+applications.  See <link linkend="selection-api"> selection API </link> for
+details.</para>
+        </listitem>
+      </orderedlist>
+    </section>
+
+    <section>
+      <title>V4L2 in Linux 3.3</title>
+      <orderedlist>
+        <listitem>
+         <para>Added <constant>V4L2_CID_ALPHA_COMPONENT</constant> control
+           to the <link linkend="control">User controls class</link>.
+         </para>
+        </listitem>
       </orderedlist>
     </section>
 
@@ -2489,6 +2506,9 @@ ioctls.</para>
         <listitem>
          <para>&VIDIOC-CREATE-BUFS; and &VIDIOC-PREPARE-BUF; ioctls.</para>
         </listitem>
+        <listitem>
+         <para>Selection API. <xref linkend="selection-api" /></para>
+        </listitem>
       </itemizedlist>
     </section>
 
@@ -2507,11 +2527,3 @@ interfaces and should not be implemented in new drivers.</para>
       </itemizedlist>
     </section>
   </section>
-
-  <!--
-Local Variables:
-mode: sgml
-sgml-parent-document: "v4l2.sgml"
-indent-tabs-mode: nil
-End:
-  -->
index 3bc5ee8..a1be378 100644 (file)
@@ -324,12 +324,6 @@ minimum value disables backlight compensation.</entry>
                (usually a microscope).</entry>
          </row>
          <row>
-           <entry><constant>V4L2_CID_LASTP1</constant></entry>
-           <entry></entry>
-           <entry>End of the predefined control IDs (currently
-<constant>V4L2_CID_ILLUMINATORS_2</constant> + 1).</entry>
-         </row>
-         <row>
            <entry><constant>V4L2_CID_MIN_BUFFERS_FOR_CAPTURE</constant></entry>
            <entry>integer</entry>
            <entry>This is a read-only control that can be read by the application
@@ -345,6 +339,25 @@ and used as a hint to determine the number of OUTPUT buffers to pass to REQBUFS.
 The value is the minimum number of OUTPUT buffers that is necessary for hardware
 to work.</entry>
          </row>
+         <row id="v4l2-alpha-component">
+           <entry><constant>V4L2_CID_ALPHA_COMPONENT</constant></entry>
+           <entry>integer</entry>
+           <entry> Sets the alpha color component on the capture device or on
+           the capture buffer queue of a mem-to-mem device. When a mem-to-mem
+           device produces frame format that includes an alpha component
+           (e.g. <link linkend="rgb-formats">packed RGB image formats</link>)
+           and the alpha value is not defined by the mem-to-mem input data
+           this control lets you select the alpha component value of all
+           pixels. It is applicable to any pixel format that contains an alpha
+           component.
+           </entry>
+         </row>
+         <row>
+           <entry><constant>V4L2_CID_LASTP1</constant></entry>
+           <entry></entry>
+           <entry>End of the predefined control IDs (currently
+             <constant>V4L2_CID_ALPHA_COMPONENT</constant> + 1).</entry>
+         </row>
          <row>
            <entry><constant>V4L2_CID_PRIVATE_BASE</constant></entry>
            <entry></entry>
@@ -3329,6 +3342,16 @@ interface and may change in the future.</para>
                  <entry>The short circuit protection of the flash
                  controller has been triggered.</entry>
                </row>
+               <row>
+                 <entry><constant>V4L2_FLASH_FAULT_OVER_CURRENT</constant></entry>
+                 <entry>Current in the LED power supply has exceeded the limit
+                 specific to the flash controller.</entry>
+               </row>
+               <row>
+                 <entry><constant>V4L2_FLASH_FAULT_INDICATOR</constant></entry>
+                 <entry>The flash controller has detected a short or open
+                 circuit condition on the indicator LED.</entry>
+               </row>
              </tbody>
            </entrytbl>
          </row>
@@ -3357,11 +3380,3 @@ interface and may change in the future.</para>
 
     </section>
 </section>
-
-  <!--
-Local Variables:
-mode: sgml
-sgml-parent-document: "common.sgml"
-indent-tabs-mode: nil
-End:
-  -->
index 2237c66..e1c5f94 100644 (file)
@@ -108,11 +108,3 @@ linkend="mmap">memory mapping</link> or <link
 linkend="userp">user pointer</link>) I/O. See <xref
 linkend="io" /> for details.</para>
   </section>
-
-  <!--
-Local Variables:
-mode: sgml
-sgml-parent-document: "v4l2.sgml"
-indent-tabs-mode: nil
-End:
-  -->
index 6e156dc..dca0ecd 100644 (file)
@@ -16,11 +16,3 @@ Applications send data to be converted to the driver through a
 I/O.</para>
 
   <para>[to do]</para>
-
-  <!--
-Local Variables:
-mode: sgml
-sgml-parent-document: "v4l2.sgml"
-indent-tabs-mode: nil
-End:
-  -->
index 9c243be..2350a67 100644 (file)
@@ -15,11 +15,3 @@ receive the result data either with &func-read; and &func-write;
 functions, or through the streaming I/O mechanism.</para>
 
   <para>[to do]</para>
-
-  <!--
-Local Variables:
-mode: sgml
-sgml-parent-document: "v4l2.sgml"
-indent-tabs-mode: nil
-End:
-  -->
index f14ae3f..19f4bec 100644 (file)
@@ -41,11 +41,3 @@ intermediate step leading up to that information. See the documentation for the
 event you want to subscribe to whether this is applicable for that event or not.</para>
        </listitem>
       </orderedlist></para>
-
-  <!--
-Local Variables:
-mode: sgml
-sgml-parent-document: "v4l2.sgml"
-indent-tabs-mode: nil
-End:
-  -->
index c9a68a2..479d943 100644 (file)
@@ -154,11 +154,3 @@ data flow. For more information see <xref linkend="crop" />.</para>
 however the framebuffer interface of the driver may support the
 <constant>FBIOBLANK</constant> ioctl.</para>
   </section>
-
-  <!--
-Local Variables:
-mode: sgml
-sgml-parent-document: "v4l2.sgml"
-indent-tabs-mode: nil
-End:
-  -->
index 919e22c..9130a3d 100644 (file)
@@ -104,11 +104,3 @@ linkend="mmap">memory mapping</link> or <link
 linkend="userp">user pointer</link>) I/O. See <xref
 linkend="io" /> for details.</para>
   </section>
-
-  <!--
-Local Variables:
-mode: sgml
-sgml-parent-document: "v4l2.sgml"
-indent-tabs-mode: nil
-End:
-  -->
index 92513cf..40d1d76 100644 (file)
@@ -369,11 +369,3 @@ reasons. <!-- video4linux-list@redhat.com on 22 Oct 2002 subject
     <para>To start or stop the frame buffer overlay applications call
 the &VIDIOC-OVERLAY; ioctl.</para>
   </section>
-
-  <!--
-Local Variables:
-mode: sgml
-sgml-parent-document: "v4l2.sgml"
-indent-tabs-mode: nil
-End:
-  -->
index 73aa90b..3e6ac73 100644 (file)
@@ -47,11 +47,3 @@ depending on the selected frequency. The &VIDIOC-G-TUNER; or
 &VIDIOC-G-MODULATOR; ioctl
 reports the supported frequency range.</para>
   </section>
-
-<!--
-Local Variables:
-mode: sgml
-sgml-parent-document: "v4l2.sgml"
-indent-tabs-mode: nil
-End:
- -->
index c5a70bd..b788c72 100644 (file)
@@ -337,11 +337,3 @@ an &EBUSY; if the required hardware resources are temporarily
 unavailable, for example the device is already in use by another
 process.</para>
   </section>
-
-  <!--
-Local Variables:
-mode: sgml
-sgml-parent-document: "v4l2.sgml"
-indent-tabs-mode: nil
-End:
-  -->
index 2427f54..38883a4 100644 (file)
@@ -29,10 +29,10 @@ returned by the &VIDIOC-QUERYCAP; ioctl.  Any tuner that supports RDS
 will set the <constant>V4L2_TUNER_CAP_RDS</constant> flag in
 the <structfield>capability</structfield> field of &v4l2-tuner;.  If
 the driver only passes RDS blocks without interpreting the data
-the <constant>V4L2_TUNER_SUB_RDS_BLOCK_IO</constant> flag has to be
+the <constant>V4L2_TUNER_CAP_RDS_BLOCK_IO</constant> flag has to be
 set, see <link linkend="reading-rds-data">Reading RDS data</link>.
 For future use the
-flag <constant>V4L2_TUNER_SUB_RDS_CONTROLS</constant> has also been
+flag <constant>V4L2_TUNER_CAP_RDS_CONTROLS</constant> has also been
 defined. However, a driver for a radio tuner with this capability does
 not yet exist, so if you are planning to write such a driver you
 should discuss this on the linux-media mailing list: &v4l-ml;.</para>
@@ -52,9 +52,9 @@ field of &v4l2-modulator;.
 In order to enable the RDS transmission one must set the <constant>V4L2_TUNER_SUB_RDS</constant>
 bit in the <structfield>txsubchans</structfield> field of &v4l2-modulator;.
 If the driver only passes RDS blocks without interpreting the data
-the <constant>V4L2_TUNER_SUB_RDS_BLOCK_IO</constant> flag has to be set. If the
+the <constant>V4L2_TUNER_CAP_RDS_BLOCK_IO</constant> flag has to be set. If the
 tuner is capable of handling RDS entities like program identification codes and radio
-text, the flag <constant>V4L2_TUNER_SUB_RDS_CONTROLS</constant> should be set,
+text, the flag <constant>V4L2_TUNER_CAP_RDS_CONTROLS</constant> should be set,
 see <link linkend="writing-rds-data">Writing RDS data</link> and
 <link linkend="fm-tx-controls">FM Transmitter Control Reference</link>.</para>
   </section>
@@ -194,11 +194,3 @@ as follows:</para>
       </tgroup>
     </table>
   </section>
-
-<!--
-Local Variables:
-mode: sgml
-sgml-parent-document: "v4l2.sgml"
-indent-tabs-mode: nil
-End:
- -->
index 69e789f..548f8ea 100644 (file)
@@ -697,12 +697,3 @@ Sliced VBI services</link> for a description of the line payload.</entry>
 
   </section>
   </section>
-
-
-<!--
-Local Variables:
-mode: sgml
-sgml-parent-document: "v4l2.sgml"
-indent-tabs-mode: nil
-End:
- -->
index 414b1cf..bd21c64 100644 (file)
@@ -27,11 +27,3 @@ kernel 2.6.37.</para>
 
   <para>Modern devices all use the <link linkend="raw-vbi">raw</link> or
 <link linkend="sliced">sliced</link> VBI API.</para>
-
-  <!--
-Local Variables:
-mode: sgml
-sgml-parent-document: "v4l2.sgml"
-indent-tabs-mode: nil
-End:
-  -->
index 1f7eea5..eacafe3 100644 (file)
@@ -198,11 +198,3 @@ devices with the videodev module.</para>
     <para>to do</para>
   </section>
 -->
-
-<!--
-Local Variables:
-mode: sgml
-sgml-parent-document: "v4l2.sgml"
-indent-tabs-mode: nil
-End:
--->
index dfb41cb..232920d 100644 (file)
@@ -60,11 +60,3 @@ descriptor.</para>
     </variablelist>
   </refsect1>
 </refentry>
-
-<!--
-Local Variables:
-mode: sgml
-sgml-parent-document: "v4l2.sgml"
-indent-tabs-mode: nil
-End:
--->
index 2de64be..4394184 100644 (file)
@@ -69,11 +69,3 @@ their respective function and parameters are specified in <xref
     the parameter remains unmodified.</para>
   </refsect1>
 </refentry>
-
-<!--
-Local Variables:
-mode: sgml
-sgml-parent-document: "v4l2.sgml"
-indent-tabs-mode: nil
-End:
--->
index 786732b..f31ad71 100644 (file)
@@ -181,11 +181,3 @@ complete the request.</para>
     </variablelist>
   </refsect1>
 </refentry>
-
-<!--
-Local Variables:
-mode: sgml
-sgml-parent-document: "v4l2.sgml"
-indent-tabs-mode: nil
-End:
--->
index e2c4190..860d49c 100644 (file)
@@ -74,11 +74,3 @@ mapped yet.</para>
     </variablelist>
   </refsect1>
 </refentry>
-
-<!--
-Local Variables:
-mode: sgml
-sgml-parent-document: "v4l2.sgml"
-indent-tabs-mode: nil
-End:
--->
index 7595d07..cf64e20 100644 (file)
@@ -111,11 +111,3 @@ system has been reached.</para>
     </variablelist>
   </refsect1>
 </refentry>
-
-<!--
-Local Variables:
-mode: sgml
-sgml-parent-document: "v4l2.sgml"
-indent-tabs-mode: nil
-End:
--->
index ec3c718..85cad8b 100644 (file)
@@ -117,11 +117,3 @@ than <constant>OPEN_MAX</constant>.</para>
     </variablelist>
   </refsect1>
 </refentry>
-
-<!--
-Local Variables:
-mode: sgml
-sgml-parent-document: "v4l2.sgml"
-indent-tabs-mode: nil
-End:
--->
index a5089bf..e218bbf 100644 (file)
@@ -179,11 +179,3 @@ type of device.</para>
     </variablelist>
   </refsect1>
 </refentry>
-
-<!--
-Local Variables:
-mode: sgml
-sgml-parent-document: "v4l2.sgml"
-indent-tabs-mode: nil
-End:
--->
index b671362..e12a60d 100644 (file)
@@ -128,11 +128,3 @@ zero or greater than <constant>FD_SETSIZE</constant>.</para>
     </variablelist>
   </refsect1>
 </refentry>
-
-<!--
-Local Variables:
-mode: sgml
-sgml-parent-document: "v4l2.sgml"
-indent-tabs-mode: nil
-End:
--->
index 2c09c09..5752078 100644 (file)
@@ -126,11 +126,3 @@ type of device.</para>
     </variablelist>
   </refsect1>
 </refentry>
-
-<!--
-Local Variables:
-mode: sgml
-sgml-parent-document: "v4l2.sgml"
-indent-tabs-mode: nil
-End:
--->
index 3f47df1..b815929 100644 (file)
@@ -1282,11 +1282,3 @@ line, top field first. The bottom field is transmitted first.</entry>
        </mediaobject>
     </figure>
   </section>
-
-  <!--
-Local Variables:
-mode: sgml
-sgml-parent-document: "v4l2.sgml"
-indent-tabs-mode: nil
-End:
-  -->
index 3cb10ec..d3b71e2 100644 (file)
@@ -158,10 +158,3 @@ still don't use libv4l.</para>
        </section>
 
 </section>
-<!--
-Local Variables:
-mode: sgml
-sgml-parent-document: "v4l2.sgml"
-indent-tabs-mode: nil
-End:
--->
index 3b72bc6..bee970d 100644 (file)
@@ -60,11 +60,3 @@ pixel image</title>
        </example>
       </refsect1>
     </refentry>
-
-  <!--
-Local Variables:
-mode: sgml
-sgml-parent-document: "pixfmt.sgml"
-indent-tabs-mode: nil
-End:
-  -->
index ce4bc01..aadae92 100644 (file)
@@ -137,11 +137,3 @@ pixel image</title>
        </example>
       </refsect1>
     </refentry>
-
-  <!--
-Local Variables:
-mode: sgml
-sgml-parent-document: "pixfmt.sgml"
-indent-tabs-mode: nil
-End:
-  -->
index 873f670..84dd4fd 100644 (file)
@@ -141,11 +141,3 @@ pixel image</title>
        </example>
       </refsect1>
     </refentry>
-
-  <!--
-Local Variables:
-mode: sgml
-sgml-parent-document: "pixfmt.sgml"
-indent-tabs-mode: nil
-End:
-  -->
index c9e166d..3fd3ce5 100644 (file)
@@ -144,11 +144,3 @@ CbCr plane has as many pad bytes after its rows.</para>
        </example>
       </refsect1>
     </refentry>
-
-  <!--
-Local Variables:
-mode: sgml
-sgml-parent-document: "pixfmt.sgml"
-indent-tabs-mode: nil
-End:
-  -->
index 7a2855a..2f82b1d 100644 (file)
@@ -64,11 +64,3 @@ layout of macroblocks</title>
        </example>
       </refsect1>
     </refentry>
-
-  <!--
-Local Variables:
-mode: sgml
-sgml-parent-document: "pixfmt.sgml"
-indent-tabs-mode: nil
-End:
-  -->
index 2609403..8ae1f8a 100644 (file)
@@ -164,11 +164,3 @@ pixel image</title>
        </example>
       </refsect1>
     </refentry>
-
-  <!--
-Local Variables:
-mode: sgml
-sgml-parent-document: "pixfmt.sgml"
-indent-tabs-mode: nil
-End:
-  -->
index 4db272b..166c8d6 100644 (file)
@@ -428,8 +428,11 @@ colorspace <constant>V4L2_COLORSPACE_SRGB</constant>.</para>
     <para>Bit 7 is the most significant bit. The value of a = alpha
 bits is undefined when reading from the driver, ignored when writing
 to the driver, except when alpha blending has been negotiated for a
-<link linkend="overlay">Video Overlay</link> or <link
-linkend="osd">Video Output Overlay</link>.</para>
+<link linkend="overlay">Video Overlay</link> or <link linkend="osd">
+Video Output Overlay</link> or when alpha component has been configured
+for a <link linkend="capture">Video Capture</link> by means of <link
+linkend="v4l2-alpha-component"> <constant>V4L2_CID_ALPHA_COMPONENT
+</constant> </link> control.</para>
 
     <example>
       <title><constant>V4L2_PIX_FMT_BGR24</constant> 4 &times; 4 pixel
@@ -930,11 +933,3 @@ See &v4l-dvb; for access instructions.</para>
 
   </refsect1>
     </refentry>
-
-  <!--
-Local Variables:
-mode: sgml
-sgml-parent-document: "pixfmt.sgml"
-indent-tabs-mode: nil
-End:
-  -->
index 3cab5d0..33fa5a4 100644 (file)
@@ -234,11 +234,3 @@ linkend="osd">Video Output Overlay</link>.</para>
 
   </refsect1>
     </refentry>
-
-  <!--
-Local Variables:
-mode: sgml
-sgml-parent-document: "pixfmt.sgml"
-indent-tabs-mode: nil
-End:
-  -->
index 519a9ef..6494b05 100644 (file)
@@ -81,11 +81,3 @@ pixel image</title>
     </example>
   </refsect1>
 </refentry>
-
-  <!--
-Local Variables:
-mode: sgml
-sgml-parent-document: "pixfmt.sgml"
-indent-tabs-mode: nil
-End:
-  -->
index 5fe84ec..5eaf2b4 100644 (file)
@@ -65,11 +65,3 @@ pixel image</title>
        </example>
       </refsect1>
     </refentry>
-
-  <!--
-Local Variables:
-mode: sgml
-sgml-parent-document: "pixfmt.sgml"
-indent-tabs-mode: nil
-End:
-  -->
index d67a472..fee65dc 100644 (file)
@@ -65,11 +65,3 @@ pixel image</title>
        </example>
       </refsect1>
     </refentry>
-
-  <!--
-Local Variables:
-mode: sgml
-sgml-parent-document: "pixfmt.sgml"
-indent-tabs-mode: nil
-End:
-  -->
index 0cdf13b..19727ab 100644 (file)
@@ -65,11 +65,3 @@ columns and rows.</para>
        </example>
       </refsect1>
     </refentry>
-
-  <!--
-Local Variables:
-mode: sgml
-sgml-parent-document: "pixfmt.sgml"
-indent-tabs-mode: nil
-End:
-  -->
index 816c8d4..b1f6801 100644 (file)
@@ -118,11 +118,3 @@ pixel image</title>
        </example>
       </refsect1>
     </refentry>
-
-  <!--
-Local Variables:
-mode: sgml
-sgml-parent-document: "pixfmt.sgml"
-indent-tabs-mode: nil
-End:
-  -->
index 61f12a5..8280340 100644 (file)
@@ -118,11 +118,3 @@ pixel image</title>
        </example>
       </refsect1>
     </refentry>
-
-  <!--
-Local Variables:
-mode: sgml
-sgml-parent-document: "pixfmt.sgml"
-indent-tabs-mode: nil
-End:
-  -->
index d584040..ff4f727 100644 (file)
@@ -79,11 +79,3 @@ pixel image</title>
     </example>
   </refsect1>
 </refentry>
-
-  <!--
-Local Variables:
-mode: sgml
-sgml-parent-document: "pixfmt.sgml"
-indent-tabs-mode: nil
-End:
-  -->
index 73c8536..98dcb91 100644 (file)
@@ -147,11 +147,3 @@ pixel image</title>
        </example>
       </refsect1>
     </refentry>
-
-  <!--
-Local Variables:
-mode: sgml
-sgml-parent-document: "pixfmt.sgml"
-indent-tabs-mode: nil
-End:
-  -->
index 8eb4a19..0869dce 100644 (file)
@@ -131,11 +131,3 @@ pixel image</title>
        </example>
       </refsect1>
     </refentry>
-
-  <!--
-Local Variables:
-mode: sgml
-sgml-parent-document: "pixfmt.sgml"
-indent-tabs-mode: nil
-End:
-  -->
index 00e0960..086dc73 100644 (file)
@@ -145,11 +145,3 @@ pixel image</title>
        </example>
       </refsect1>
     </refentry>
-
-  <!--
-Local Variables:
-mode: sgml
-sgml-parent-document: "v4l2.sgml"
-indent-tabs-mode: nil
-End:
-  -->
index 42d7de5..48649fa 100644 (file)
@@ -147,11 +147,3 @@ pixel image</title>
        </example>
       </refsect1>
     </refentry>
-
-  <!--
-Local Variables:
-mode: sgml
-sgml-parent-document: "pixfmt.sgml"
-indent-tabs-mode: nil
-End:
-  -->
index f5d8f57..9957863 100644 (file)
@@ -152,11 +152,3 @@ pixel image</title>
        </example>
       </refsect1>
     </refentry>
-
-  <!--
-Local Variables:
-mode: sgml
-sgml-parent-document: "pixfmt.sgml"
-indent-tabs-mode: nil
-End:
-  -->
index 4348bd9..4ce6463 100644 (file)
@@ -151,11 +151,3 @@ pixel image</title>
        </example>
       </refsect1>
     </refentry>
-
-  <!--
-Local Variables:
-mode: sgml
-sgml-parent-document: "pixfmt.sgml"
-indent-tabs-mode: nil
-End:
-  -->
index bdb2ffa..5838409 100644 (file)
@@ -118,11 +118,3 @@ pixel image</title>
        </example>
       </refsect1>
     </refentry>
-
-  <!--
-Local Variables:
-mode: sgml
-sgml-parent-document: "pixfmt.sgml"
-indent-tabs-mode: nil
-End:
-  -->
index 40d17ae..bfffdc7 100644 (file)
@@ -118,11 +118,3 @@ pixel image</title>
        </example>
       </refsect1>
     </refentry>
-
-  <!--
-Local Variables:
-mode: sgml
-sgml-parent-document: "pixfmt.sgml"
-indent-tabs-mode: nil
-End:
-  -->
index aef4615..31eaae2 100644 (file)
@@ -891,6 +891,11 @@ kernel sources in the file <filename>Documentation/video4linux/cx2341x/README.hm
            <entry>'M310'</entry>
            <entry>Compressed BGGR Bayer format used by the gspca driver.</entry>
          </row>
+         <row id="V4L2-PIX-FMT-JL2005BCD">
+           <entry><constant>V4L2_PIX_FMT_JL2005BCD</constant></entry>
+           <entry>'JL20'</entry>
+           <entry>JPEG compressed RGGB Bayer format used by the gspca driver.</entry>
+         </row>
          <row id="V4L2-PIX-FMT-OV511">
            <entry><constant>V4L2_PIX_FMT_OV511</constant></entry>
            <entry>'O511'</entry>
@@ -998,11 +1003,3 @@ the other bits are set to 0.</entry>
       </tgroup>
     </table>
   </section>
-
-  <!--
-Local Variables:
-mode: sgml
-sgml-parent-document: "v4l2.sgml"
-indent-tabs-mode: nil
-End:
-  -->
diff --git a/Documentation/DocBook/media/v4l/selection-api.xml b/Documentation/DocBook/media/v4l/selection-api.xml
new file mode 100644 (file)
index 0000000..2f0bdb4
--- /dev/null
@@ -0,0 +1,321 @@
+<section id="selection-api">
+
+  <title>Experimental API for cropping, composing and scaling</title>
+
+      <note>
+       <title>Experimental</title>
+
+       <para>This is an <link linkend="experimental">experimental</link>
+interface and may change in the future.</para>
+      </note>
+
+  <section>
+    <title>Introduction</title>
+
+<para>Some video capture devices can sample a subsection of a picture and
+shrink or enlarge it to an image of arbitrary size. Next, the devices can
+insert the image into larger one. Some video output devices can crop part of an
+input image, scale it up or down and insert it at an arbitrary scan line and
+horizontal offset into a video signal. We call these abilities cropping,
+scaling and composing.</para>
+
+<para>On a video <emphasis>capture</emphasis> device the source is a video
+signal, and the cropping target determine the area actually sampled. The sink
+is an image stored in a memory buffer.  The composing area specifies which part
+of the buffer is actually written to by the hardware. </para>
+
+<para>On a video <emphasis>output</emphasis> device the source is an image in a
+memory buffer, and the cropping target is a part of an image to be shown on a
+display. The sink is the display or the graphics screen. The application may
+select the part of display where the image should be displayed. The size and
+position of such a window is controlled by the compose target.</para>
+
+<para>Rectangles for all cropping and composing targets are defined even if the
+device does supports neither cropping nor composing. Their size and position
+will be fixed in such a case. If the device does not support scaling then the
+cropping and composing rectangles have the same size.</para>
+
+  </section>
+
+    <section>
+      <title>Selection targets</title>
+
+      <figure id="sel-targets-capture">
+       <title>Cropping and composing targets</title>
+       <mediaobject>
+         <imageobject>
+           <imagedata fileref="selection.png" format="PNG" />
+         </imageobject>
+         <textobject>
+           <phrase>Targets used by a cropping, composing and scaling
+            process</phrase>
+         </textobject>
+       </mediaobject>
+      </figure>
+    </section>
+
+  <section>
+
+  <title>Configuration</title>
+
+<para>Applications can use the <link linkend="vidioc-g-selection">selection
+API</link> to select an area in a video signal or a buffer, and to query for
+default settings and hardware limits.</para>
+
+<para>Video hardware can have various cropping, composing and scaling
+limitations. It may only scale up or down, support only discrete scaling
+factors, or have different scaling abilities in the horizontal and vertical
+directions. Also it may not support scaling at all. At the same time the
+cropping/composing rectangles may have to be aligned, and both the source and
+the sink may have arbitrary upper and lower size limits. Therefore, as usual,
+drivers are expected to adjust the requested parameters and return the actual
+values selected. An application can control the rounding behaviour using <link
+linkend="v4l2-sel-flags"> constraint flags </link>.</para>
+
+   <section>
+
+   <title>Configuration of video capture</title>
+
+<para>See figure <xref linkend="sel-targets-capture" /> for examples of the
+selection targets available for a video capture device.  It is recommended to
+configure the cropping targets before to the composing targets.</para>
+
+<para>The range of coordinates of the top left corner, width and height of
+areas that can be sampled is given by the <constant> V4L2_SEL_TGT_CROP_BOUNDS
+</constant> target. It is recommended for the driver developers to put the
+top/left corner at position <constant> (0,0) </constant>.  The rectangle's
+coordinates are expressed in pixels.</para>
+
+<para>The top left corner, width and height of the source rectangle, that is
+the area actually sampled, is given by the <constant> V4L2_SEL_TGT_CROP_ACTIVE
+</constant> target. It uses the same coordinate system as <constant>
+V4L2_SEL_TGT_CROP_BOUNDS </constant>. The active cropping area must lie
+completely inside the capture boundaries. The driver may further adjust the
+requested size and/or position according to hardware limitations.</para>
+
+<para>Each capture device has a default source rectangle, given by the
+<constant> V4L2_SEL_TGT_CROP_DEFAULT </constant> target. This rectangle shall
+over what the driver writer considers the complete picture.  Drivers shall set
+the active crop rectangle to the default when the driver is first loaded, but
+not later.</para>
+
+<para>The composing targets refer to a memory buffer. The limits of composing
+coordinates are obtained using <constant> V4L2_SEL_TGT_COMPOSE_BOUNDS
+</constant>.  All coordinates are expressed in pixels. The rectangle's top/left
+corner must be located at position <constant> (0,0) </constant>. The width and
+height are equal to the image size set by <constant> VIDIOC_S_FMT </constant>.
+</para>
+
+<para>The part of a buffer into which the image is inserted by the hardware is
+controlled by the <constant> V4L2_SEL_TGT_COMPOSE_ACTIVE </constant> target.
+The rectangle's coordinates are also expressed in the same coordinate system as
+the bounds rectangle. The composing rectangle must lie completely inside bounds
+rectangle. The driver must adjust the composing rectangle to fit to the
+bounding limits. Moreover, the driver can perform other adjustments according
+to hardware limitations. The application can control rounding behaviour using
+<link linkend="v4l2-sel-flags"> constraint flags </link>.</para>
+
+<para>For capture devices the default composing rectangle is queried using
+<constant> V4L2_SEL_TGT_COMPOSE_DEFAULT </constant>. It is usually equal to the
+bounding rectangle.</para>
+
+<para>The part of a buffer that is modified by the hardware is given by
+<constant> V4L2_SEL_TGT_COMPOSE_PADDED </constant>. It contains all pixels
+defined using <constant> V4L2_SEL_TGT_COMPOSE_ACTIVE </constant> plus all
+padding data modified by hardware during insertion process. All pixels outside
+this rectangle <emphasis>must not</emphasis> be changed by the hardware. The
+content of pixels that lie inside the padded area but outside active area is
+undefined. The application can use the padded and active rectangles to detect
+where the rubbish pixels are located and remove them if needed.</para>
+
+   </section>
+
+   <section>
+
+   <title>Configuration of video output</title>
+
+<para>For output devices targets and ioctls are used similarly to the video
+capture case. The <emphasis> composing </emphasis> rectangle refers to the
+insertion of an image into a video signal. The cropping rectangles refer to a
+memory buffer. It is recommended to configure the composing targets before to
+the cropping targets.</para>
+
+<para>The cropping targets refer to the memory buffer that contains an image to
+be inserted into a video signal or graphical screen. The limits of cropping
+coordinates are obtained using <constant> V4L2_SEL_TGT_CROP_BOUNDS </constant>.
+All coordinates are expressed in pixels. The top/left corner is always point
+<constant> (0,0) </constant>.  The width and height is equal to the image size
+specified using <constant> VIDIOC_S_FMT </constant> ioctl.</para>
+
+<para>The top left corner, width and height of the source rectangle, that is
+the area from which image date are processed by the hardware, is given by the
+<constant> V4L2_SEL_TGT_CROP_ACTIVE </constant>. Its coordinates are expressed
+in in the same coordinate system as the bounds rectangle. The active cropping
+area must lie completely inside the crop boundaries and the driver may further
+adjust the requested size and/or position according to hardware
+limitations.</para>
+
+<para>For output devices the default cropping rectangle is queried using
+<constant> V4L2_SEL_TGT_CROP_DEFAULT </constant>. It is usually equal to the
+bounding rectangle.</para>
+
+<para>The part of a video signal or graphics display where the image is
+inserted by the hardware is controlled by <constant>
+V4L2_SEL_TGT_COMPOSE_ACTIVE </constant> target.  The rectangle's coordinates
+are expressed in pixels. The composing rectangle must lie completely inside the
+bounds rectangle.  The driver must adjust the area to fit to the bounding
+limits.  Moreover, the driver can perform other adjustments according to
+hardware limitations. </para>
+
+<para>The device has a default composing rectangle, given by the <constant>
+V4L2_SEL_TGT_COMPOSE_DEFAULT </constant> target. This rectangle shall cover what
+the driver writer considers the complete picture. It is recommended for the
+driver developers to put the top/left corner at position <constant> (0,0)
+</constant>. Drivers shall set the active composing rectangle to the default
+one when the driver is first loaded.</para>
+
+<para>The devices may introduce additional content to video signal other than
+an image from memory buffers.  It includes borders around an image. However,
+such a padded area is driver-dependent feature not covered by this document.
+Driver developers are encouraged to keep padded rectangle equal to active one.
+The padded target is accessed by the <constant> V4L2_SEL_TGT_COMPOSE_PADDED
+</constant> identifier.  It must contain all pixels from the <constant>
+V4L2_SEL_TGT_COMPOSE_ACTIVE </constant> target.</para>
+
+   </section>
+
+   <section>
+
+     <title>Scaling control.</title>
+
+<para>An application can detect if scaling is performed by comparing the width
+and the height of rectangles obtained using <constant> V4L2_SEL_TGT_CROP_ACTIVE
+</constant> and <constant> V4L2_SEL_TGT_COMPOSE_ACTIVE </constant> targets. If
+these are not equal then the scaling is applied. The application can compute
+the scaling ratios using these values.</para>
+
+   </section>
+
+  </section>
+
+  <section>
+
+    <title>Comparison with old cropping API.</title>
+
+<para>The selection API was introduced to cope with deficiencies of previous
+<link linkend="crop"> API </link>, that was designed to control simple capture
+devices. Later the cropping API was adopted by video output drivers. The ioctls
+are used to select a part of the display were the video signal is inserted. It
+should be considered as an API abuse because the described operation is
+actually the composing.  The selection API makes a clear distinction between
+composing and cropping operations by setting the appropriate targets.  The V4L2
+API lacks any support for composing to and cropping from an image inside a
+memory buffer.  The application could configure a capture device to fill only a
+part of an image by abusing V4L2 API.  Cropping a smaller image from a larger
+one is achieved by setting the field <structfield>
+&v4l2-pix-format;::bytesperline </structfield>.  Introducing an image offsets
+could be done by modifying field <structfield> &v4l2-buffer;::m:userptr
+</structfield> before calling <constant> VIDIOC_QBUF </constant>. Those
+operations should be avoided because they are not portable (endianness), and do
+not work for macroblock and Bayer formats and mmap buffers.  The selection API
+deals with configuration of buffer cropping/composing in a clear, intuitive and
+portable way.  Next, with the selection API the concepts of the padded target
+and constraints flags are introduced.  Finally, <structname> &v4l2-crop;
+</structname> and <structname> &v4l2-cropcap; </structname> have no reserved
+fields. Therefore there is no way to extend their functionality.  The new
+<structname> &v4l2-selection; </structname> provides a lot of place for future
+extensions.  Driver developers are encouraged to implement only selection API.
+The former cropping API would be simulated using the new one. </para>
+
+  </section>
+
+   <section>
+      <title>Examples</title>
+      <example>
+       <title>Resetting the cropping parameters</title>
+
+       <para>(A video capture device is assumed; change <constant>
+V4L2_BUF_TYPE_VIDEO_CAPTURE </constant> for other devices; change target to
+<constant> V4L2_SEL_TGT_COMPOSE_* </constant> family to configure composing
+area)</para>
+
+       <programlisting>
+
+       &v4l2-selection; sel = {
+               .type = V4L2_BUF_TYPE_VIDEO_CAPTURE,
+               .target = V4L2_SEL_TGT_CROP_DEFAULT,
+       };
+       ret = ioctl(fd, &VIDIOC-G-SELECTION;, &amp;sel);
+       if (ret)
+               exit(-1);
+       sel.target = V4L2_SEL_TGT_CROP_ACTIVE;
+       ret = ioctl(fd, &VIDIOC-S-SELECTION;, &amp;sel);
+       if (ret)
+               exit(-1);
+
+        </programlisting>
+      </example>
+
+      <example>
+       <title>Simple downscaling</title>
+       <para>Setting a composing area on output of size of <emphasis> at most
+</emphasis> half of limit placed at a center of a display.</para>
+       <programlisting>
+
+       &v4l2-selection; sel = {
+               .type = V4L2_BUF_TYPE_VIDEO_OUTPUT,
+               .target = V4L2_SEL_TGT_COMPOSE_BOUNDS,
+       };
+       struct v4l2_rect r;
+
+       ret = ioctl(fd, &VIDIOC-G-SELECTION;, &amp;sel);
+       if (ret)
+               exit(-1);
+       /* setting smaller compose rectangle */
+       r.width = sel.r.width / 2;
+       r.height = sel.r.height / 2;
+       r.left = sel.r.width / 4;
+       r.top = sel.r.height / 4;
+       sel.r = r;
+       sel.target = V4L2_SEL_TGT_COMPOSE_ACTIVE;
+       sel.flags = V4L2_SEL_FLAG_LE;
+       ret = ioctl(fd, &VIDIOC-S-SELECTION;, &amp;sel);
+       if (ret)
+               exit(-1);
+
+        </programlisting>
+      </example>
+
+      <example>
+       <title>Querying for scaling factors</title>
+       <para>A video output device is assumed; change <constant>
+V4L2_BUF_TYPE_VIDEO_OUTPUT </constant> for other devices</para>
+       <programlisting>
+
+       &v4l2-selection; compose = {
+               .type = V4L2_BUF_TYPE_VIDEO_OUTPUT,
+               .target = V4L2_SEL_TGT_COMPOSE_ACTIVE,
+       };
+       &v4l2-selection; crop = {
+               .type = V4L2_BUF_TYPE_VIDEO_OUTPUT,
+               .target = V4L2_SEL_TGT_CROP_ACTIVE,
+       };
+       double hscale, vscale;
+
+       ret = ioctl(fd, &VIDIOC-G-SELECTION;, &amp;compose);
+       if (ret)
+               exit(-1);
+       ret = ioctl(fd, &VIDIOC-G-SELECTION;, &amp;crop);
+       if (ret)
+               exit(-1);
+
+       /* computing scaling factors */
+       hscale = (double)compose.r.width / crop.r.width;
+       vscale = (double)compose.r.height / crop.r.height;
+
+       </programlisting>
+      </example>
+
+   </section>
+
+</section>
index 2ab365c..e97c512 100644 (file)
@@ -501,6 +501,7 @@ and discussions on the V4L mailing list.</revremark>
     &sub-g-output;
     &sub-g-parm;
     &sub-g-priority;
+    &sub-g-selection;
     &sub-g-sliced-vbi-cap;
     &sub-g-std;
     &sub-g-tuner;
index 1d31427..0be17c2 100644 (file)
@@ -228,11 +228,3 @@ is out of bounds.</para>
     </variablelist>
   </refsect1>
 </refentry>
-
-<!--
-Local Variables:
-mode: sgml
-sgml-parent-document: "v4l2.sgml"
-indent-tabs-mode: nil
-End:
--->
index 71d373b..347d142 100644 (file)
@@ -156,11 +156,3 @@ bounds.</para>
     </variablelist>
   </refsect1>
 </refentry>
-
-<!--
-Local Variables:
-mode: sgml
-sgml-parent-document: "v4l2.sgml"
-indent-tabs-mode: nil
-End:
--->
index 476fe1d..9b8efcd 100644 (file)
@@ -311,11 +311,3 @@ out of bounds.</para>
     </variablelist>
   </refsect1>
 </refentry>
-
-<!--
-Local Variables:
-mode: sgml
-sgml-parent-document: "v4l2.sgml"
-indent-tabs-mode: nil
-End:
--->
index a281d26..a64d5ef 100644 (file)
@@ -196,11 +196,3 @@ is out of bounds.</para>
     </variablelist>
   </refsect1>
 </refentry>
-
-<!--
-Local Variables:
-mode: sgml
-sgml-parent-document: "v4l2.sgml"
-indent-tabs-mode: nil
-End:
--->
index 95803fe..3a5fc54 100644 (file)
@@ -381,11 +381,3 @@ is out of bounds.</para>
     </variablelist>
   </refsect1>
 </refentry>
-
-<!--
-Local Variables:
-mode: sgml
-sgml-parent-document: "v4l2.sgml"
-indent-tabs-mode: nil
-End:
--->
index 5146d00..12b1d05 100644 (file)
@@ -127,11 +127,3 @@ this control belongs to.</para>
     </variablelist>
   </refsect1>
 </refentry>
-
-<!--
-Local Variables:
-mode: sgml
-sgml-parent-document: "v4l2.sgml"
-indent-tabs-mode: nil
-End:
--->
index 5122ce8..6f1f9a6 100644 (file)
@@ -312,10 +312,3 @@ to store the payload and this error code is returned.</para>
   </refsect1>
 </refentry>
 
-<!--
-Local Variables:
-mode: sgml
-sgml-parent-document: "v4l2.sgml"
-indent-tabs-mode: nil
-End:
--->
index 0557182..93817f3 100644 (file)
@@ -295,7 +295,8 @@ set this field to zero.</entry>
            <entry>The device is capable of non-destructive overlays.
 When the driver clears this flag, only destructive overlays are
 supported. There are no drivers yet which support both destructive and
-non-destructive overlays.</entry>
+non-destructive overlays. Video Output Overlays are in practice always
+non-destructive.</entry>
          </row>
          <row>
            <entry><constant>V4L2_FBUF_CAP_CHROMAKEY</constant></entry>
@@ -339,8 +340,8 @@ blending makes no sense for destructive overlays.</entry>
          <row>
            <entry><constant>V4L2_FBUF_CAP_SRC_CHROMAKEY</constant></entry>
            <entry>0x0080</entry>
-           <entry>The device supports Source Chroma-keying. Framebuffer pixels
-with the chroma-key colors are replaced by video pixels, which is exactly opposite of
+           <entry>The device supports Source Chroma-keying. Video pixels
+with the chroma-key colors are replaced by framebuffer pixels, which is exactly opposite of
 <constant>V4L2_FBUF_CAP_CHROMAKEY</constant></entry>
          </row>
        </tbody>
@@ -356,7 +357,9 @@ with the chroma-key colors are replaced by video pixels, which is exactly opposi
            <entry><constant>V4L2_FBUF_FLAG_PRIMARY</constant></entry>
            <entry>0x0001</entry>
            <entry>The framebuffer is the primary graphics surface.
-In other words, the overlay is destructive. [?]</entry>
+In other words, the overlay is destructive. This flag is typically set by any
+driver that doesn't have the <constant>V4L2_FBUF_CAP_EXTERNOVERLAY</constant>
+capability and it is cleared otherwise.</entry>
          </row>
          <row>
            <entry><constant>V4L2_FBUF_FLAG_OVERLAY</constant></entry>
@@ -366,9 +369,8 @@ size as the capture. [?]</entry>
          </row>
          <row>
            <entry spanname="hspan">The purpose of
-<constant>V4L2_FBUF_FLAG_PRIMARY</constant> and
 <constant>V4L2_FBUF_FLAG_OVERLAY</constant> was never quite clear.
-Most drivers seem to ignore these flags. For compatibility with the
+Most drivers seem to ignore this flag. For compatibility with the
 <wordasword>bttv</wordasword> driver applications should set the
 <constant>V4L2_FBUF_FLAG_OVERLAY</constant> flag.</entry>
          </row>
index 062d720..1643181 100644 (file)
@@ -135,11 +135,3 @@ wrong.</para>
     </variablelist>
   </refsect1>
 </refentry>
-
-<!--
-Local Variables:
-mode: sgml
-sgml-parent-document: "v4l2.sgml"
-indent-tabs-mode: nil
-End:
--->
index 15ce660..7f4ac7e 100644 (file)
@@ -236,11 +236,3 @@ mode.</entry>
     </variablelist>
   </refsect1>
 </refentry>
-
-<!--
-Local Variables:
-mode: sgml
-sgml-parent-document: "v4l2.sgml"
-indent-tabs-mode: nil
-End:
--->
index 8f5e3da..6a81b4f 100644 (file)
@@ -133,11 +133,3 @@ priority.</para>
     </variablelist>
   </refsect1>
 </refentry>
-
-<!--
-Local Variables:
-mode: sgml
-sgml-parent-document: "v4l2.sgml"
-indent-tabs-mode: nil
-End:
--->
diff --git a/Documentation/DocBook/media/v4l/vidioc-g-selection.xml b/Documentation/DocBook/media/v4l/vidioc-g-selection.xml
new file mode 100644 (file)
index 0000000..a9d36e0
--- /dev/null
@@ -0,0 +1,304 @@
+<refentry id="vidioc-g-selection">
+
+  <refmeta>
+    <refentrytitle>ioctl VIDIOC_G_SELECTION, VIDIOC_S_SELECTION</refentrytitle>
+    &manvol;
+  </refmeta>
+
+  <refnamediv>
+    <refname>VIDIOC_G_SELECTION</refname>
+    <refname>VIDIOC_S_SELECTION</refname>
+    <refpurpose>Get or set one of the selection rectangles</refpurpose>
+  </refnamediv>
+
+  <refsynopsisdiv>
+    <funcsynopsis>
+      <funcprototype>
+       <funcdef>int <function>ioctl</function></funcdef>
+       <paramdef>int <parameter>fd</parameter></paramdef>
+       <paramdef>int <parameter>request</parameter></paramdef>
+       <paramdef>struct v4l2_selection *<parameter>argp</parameter></paramdef>
+      </funcprototype>
+    </funcsynopsis>
+  </refsynopsisdiv>
+
+  <refsect1>
+    <title>Arguments</title>
+
+    <variablelist>
+      <varlistentry>
+       <term><parameter>fd</parameter></term>
+       <listitem>
+         <para>&fd;</para>
+       </listitem>
+      </varlistentry>
+      <varlistentry>
+       <term><parameter>request</parameter></term>
+       <listitem>
+         <para>VIDIOC_G_SELECTION, VIDIOC_S_SELECTION</para>
+       </listitem>
+      </varlistentry>
+      <varlistentry>
+       <term><parameter>argp</parameter></term>
+       <listitem>
+         <para></para>
+       </listitem>
+      </varlistentry>
+    </variablelist>
+  </refsect1>
+
+  <refsect1>
+    <title>Description</title>
+
+    <note>
+      <title>Experimental</title>
+      <para>This is an <link linkend="experimental"> experimental </link>
+      interface and may change in the future.</para>
+    </note>
+
+    <para>The ioctls are used to query and configure selection rectangles.</para>
+
+<para> To query the cropping (composing) rectangle set <structfield>
+&v4l2-selection;::type </structfield> to the respective buffer type.  Do not
+use multiplanar buffers.  Use <constant> V4L2_BUF_TYPE_VIDEO_CAPTURE
+</constant> instead of <constant> V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE
+</constant>.  Use <constant> V4L2_BUF_TYPE_VIDEO_OUTPUT </constant> instead of
+<constant> V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE </constant>.  The next step is
+setting <structfield> &v4l2-selection;::target </structfield> to value
+<constant> V4L2_SEL_TGT_CROP_ACTIVE </constant> (<constant>
+V4L2_SEL_TGT_COMPOSE_ACTIVE </constant>).  Please refer to table <xref
+linkend="v4l2-sel-target" /> or <xref linkend="selection-api" /> for additional
+targets.  Fields <structfield> &v4l2-selection;::flags </structfield> and
+<structfield> &v4l2-selection;::reserved </structfield> are ignored and they
+must be filled with zeros.  The driver fills the rest of the structure or
+returns &EINVAL; if incorrect buffer type or target was used. If cropping
+(composing) is not supported then the active rectangle is not mutable and it is
+always equal to the bounds rectangle.  Finally, structure <structfield>
+&v4l2-selection;::r </structfield> is filled with the current cropping
+(composing) coordinates. The coordinates are expressed in driver-dependent
+units. The only exception are rectangles for images in raw formats, whose
+coordinates are always expressed in pixels.  </para>
+
+<para> To change the cropping (composing) rectangle set <structfield>
+&v4l2-selection;::type </structfield> to the respective buffer type.  Do not
+use multiplanar buffers.  Use <constant> V4L2_BUF_TYPE_VIDEO_CAPTURE
+</constant> instead of <constant> V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE
+</constant>.  Use <constant> V4L2_BUF_TYPE_VIDEO_OUTPUT </constant> instead of
+<constant> V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE </constant>.  The next step is
+setting <structfield> &v4l2-selection;::target </structfield> to value
+<constant> V4L2_SEL_TGT_CROP_ACTIVE </constant> (<constant>
+V4L2_SEL_TGT_COMPOSE_ACTIVE </constant>). Please refer to table <xref
+linkend="v4l2-sel-target" /> or <xref linkend="selection-api" /> for additional
+targets.  Set desired active area into the field <structfield>
+&v4l2-selection;::r </structfield>.  Field <structfield>
+&v4l2-selection;::reserved </structfield> is ignored and must be filled with
+zeros.  The driver may adjust the rectangle coordinates. An application may
+introduce constraints to control rounding behaviour. Set the field
+<structfield> &v4l2-selection;::flags </structfield> to one of values:
+
+<itemizedlist>
+  <listitem>
+<para><constant>0</constant> - The driver can adjust the rectangle size freely
+and shall choose a crop/compose rectangle as close as possible to the requested
+one.</para>
+  </listitem>
+  <listitem>
+<para><constant>V4L2_SEL_FLAG_GE</constant> - The driver is not allowed to
+shrink the rectangle.  The original rectangle must lay inside the adjusted
+one.</para>
+  </listitem>
+  <listitem>
+<para><constant>V4L2_SEL_FLAG_LE</constant> - The driver is not allowed to
+enlarge the rectangle.  The adjusted rectangle must lay inside the original
+one.</para>
+  </listitem>
+  <listitem>
+<para><constant>V4L2_SEL_FLAG_GE | V4L2_SEL_FLAG_LE</constant> - The driver
+must choose the size exactly the same as in the requested rectangle.</para>
+  </listitem>
+</itemizedlist>
+
+Please refer to <xref linkend="sel-const-adjust" />.
+
+</para>
+
+<para> The driver may have to adjusts the requested dimensions against hardware
+limits and other parts as the pipeline, i.e. the bounds given by the
+capture/output window or TV display. The closest possible values of horizontal
+and vertical offset and sizes are chosen according to following priority:
+
+<orderedlist>
+  <listitem>
+    <para>Satisfy constraints from <structfield>&v4l2-selection;::flags</structfield>.</para>
+  </listitem>
+  <listitem>
+    <para>Adjust width, height, left, and top to hardware limits and alignments.</para>
+  </listitem>
+  <listitem>
+    <para>Keep center of adjusted rectangle as close as possible to the original one.</para>
+  </listitem>
+  <listitem>
+    <para>Keep width and height as close as possible to original ones.</para>
+  </listitem>
+  <listitem>
+    <para>Keep horizontal and vertical offset as close as possible to original ones.</para>
+  </listitem>
+</orderedlist>
+
+On success the field <structfield> &v4l2-selection;::r </structfield> contains
+the adjusted rectangle. When the parameters are unsuitable the application may
+modify the cropping (composing) or image parameters and repeat the cycle until
+satisfactory parameters have been negotiated. If constraints flags have to be
+violated at then ERANGE is returned. The error indicates that <emphasis> there
+exist no rectangle </emphasis> that satisfies the constraints.</para>
+
+  </refsect1>
+
+  <refsect1>
+    <table frame="none" pgwide="1" id="v4l2-sel-target">
+      <title>Selection targets.</title>
+      <tgroup cols="3">
+       &cs-def;
+       <tbody valign="top">
+         <row>
+            <entry><constant>V4L2_SEL_TGT_CROP_ACTIVE</constant></entry>
+            <entry>0</entry>
+            <entry>area that is currently cropped by hardware</entry>
+         </row>
+         <row>
+            <entry><constant>V4L2_SEL_TGT_CROP_DEFAULT</constant></entry>
+            <entry>1</entry>
+            <entry>suggested cropping rectangle that covers the "whole picture"</entry>
+         </row>
+         <row>
+            <entry><constant>V4L2_SEL_TGT_CROP_BOUNDS</constant></entry>
+            <entry>2</entry>
+            <entry>limits for the cropping rectangle</entry>
+         </row>
+         <row>
+            <entry><constant>V4L2_SEL_TGT_COMPOSE_ACTIVE</constant></entry>
+            <entry>256</entry>
+            <entry>area to which data are composed by hardware</entry>
+         </row>
+         <row>
+            <entry><constant>V4L2_SEL_TGT_COMPOSE_DEFAULT</constant></entry>
+            <entry>257</entry>
+            <entry>suggested composing rectangle that covers the "whole picture"</entry>
+         </row>
+         <row>
+            <entry><constant>V4L2_SEL_TGT_COMPOSE_BOUNDS</constant></entry>
+            <entry>258</entry>
+            <entry>limits for the composing rectangle</entry>
+         </row>
+         <row>
+            <entry><constant>V4L2_SEL_TGT_COMPOSE_PADDED</constant></entry>
+            <entry>259</entry>
+            <entry>the active area and all padding pixels that are inserted or modified by the hardware</entry>
+         </row>
+       </tbody>
+      </tgroup>
+    </table>
+  </refsect1>
+
+  <refsect1>
+    <table frame="none" pgwide="1" id="v4l2-sel-flags">
+      <title>Selection constraint flags</title>
+      <tgroup cols="3">
+       &cs-def;
+       <tbody valign="top">
+         <row>
+            <entry><constant>V4L2_SEL_FLAG_GE</constant></entry>
+            <entry>0x00000001</entry>
+            <entry>indicate that adjusted rectangle must contain a rectangle from <structfield>&v4l2-selection;::r</structfield></entry>
+         </row>
+         <row>
+            <entry><constant>V4L2_SEL_FLAG_LE</constant></entry>
+            <entry>0x00000002</entry>
+            <entry>indicate that adjusted rectangle must be inside a rectangle from <structfield>&v4l2-selection;::r</structfield></entry>
+         </row>
+       </tbody>
+      </tgroup>
+    </table>
+  </refsect1>
+
+    <section>
+      <figure id="sel-const-adjust">
+       <title>Size adjustments with constraint flags.</title>
+       <mediaobject>
+         <imageobject>
+           <imagedata fileref="constraints.png" format="PNG" />
+         </imageobject>
+         <textobject>
+           <phrase>Behaviour of rectangle adjustment for different constraint
+            flags.</phrase>
+         </textobject>
+       </mediaobject>
+      </figure>
+    </section>
+
+  <refsect1>
+    <table pgwide="1" frame="none" id="v4l2-selection">
+      <title>struct <structname>v4l2_selection</structname></title>
+      <tgroup cols="3">
+       &cs-str;
+       <tbody valign="top">
+         <row>
+           <entry>__u32</entry>
+           <entry><structfield>type</structfield></entry>
+           <entry>Type of the buffer (from &v4l2-buf-type;)</entry>
+         </row>
+         <row>
+           <entry>__u32</entry>
+           <entry><structfield>target</structfield></entry>
+            <entry>used to select between <link linkend="v4l2-sel-target"> cropping and composing rectangles </link></entry>
+         </row>
+         <row>
+           <entry>__u32</entry>
+           <entry><structfield>flags</structfield></entry>
+            <entry>control over coordinates adjustments, refer to <link linkend="v4l2-sel-flags">selection flags</link></entry>
+         </row>
+         <row>
+           <entry>&v4l2-rect;</entry>
+           <entry><structfield>r</structfield></entry>
+           <entry>selection rectangle</entry>
+         </row>
+         <row>
+           <entry>__u32</entry>
+           <entry><structfield>reserved[9]</structfield></entry>
+           <entry>Reserved fields for future use</entry>
+         </row>
+       </tbody>
+      </tgroup>
+    </table>
+  </refsect1>
+
+  <refsect1>
+    &return-value;
+    <variablelist>
+      <varlistentry>
+       <term><errorcode>EINVAL</errorcode></term>
+       <listitem>
+         <para>The buffer <structfield> &v4l2-selection;::type </structfield>
+or <structfield> &v4l2-selection;::target </structfield> is not supported, or
+the <structfield> &v4l2-selection;::flags </structfield> are invalid.</para>
+       </listitem>
+      </varlistentry>
+      <varlistentry>
+       <term><errorcode>ERANGE</errorcode></term>
+       <listitem>
+         <para>it is not possible to adjust a rectangle <structfield>
+&v4l2-selection;::r </structfield> that satisfies all contraints from
+<structfield> &v4l2-selection;::flags </structfield>.</para>
+       </listitem>
+      </varlistentry>
+      <varlistentry>
+       <term><errorcode>EBUSY</errorcode></term>
+       <listitem>
+         <para>it is not possible to apply change of selection rectangle at the moment.
+Usually because streaming is in progress.</para>
+       </listitem>
+      </varlistentry>
+    </variablelist>
+  </refsect1>
+
+</refentry>
index 37996f2..99ff1a0 100644 (file)
@@ -88,11 +88,3 @@ standards.</para>
     </variablelist>
   </refsect1>
 </refentry>
-
-<!--
-Local Variables:
-mode: sgml
-sgml-parent-document: "v4l2.sgml"
-indent-tabs-mode: nil
-End:
--->
index bd98c73..91ec2fb 100644 (file)
@@ -318,6 +318,16 @@ standard.</para><!-- FIXME what if PAL+NTSC and Bi but not SAP? --></entry>
        <entry>RDS capture is supported. This capability is only valid for
 radio tuners.</entry>
          </row>
+         <row>
+       <entry><constant>V4L2_TUNER_CAP_RDS_BLOCK_IO</constant></entry>
+       <entry>0x0100</entry>
+       <entry>The RDS data is passed as unparsed RDS blocks.</entry>
+         </row>
+         <row>
+       <entry><constant>V4L2_TUNER_CAP_RDS_CONTROLS</constant></entry>
+       <entry>0x0200</entry>
+       <entry>The RDS data is parsed by the hardware and set via controls.</entry>
+         </row>
        </tbody>
       </tgroup>
     </table>
@@ -525,11 +535,3 @@ out of bounds.</para>
     </variablelist>
   </refsect1>
 </refentry>
-
-<!--
-Local Variables:
-mode: sgml
-sgml-parent-document: "v4l2.sgml"
-indent-tabs-mode: nil
-End:
--->
index 5c104d4..6e414d7 100644 (file)
@@ -100,11 +100,3 @@ supported, or the <structfield>index</structfield> is out of bounds.</para>
     </variablelist>
   </refsect1>
 </refentry>
-
-<!--
-Local Variables:
-mode: sgml
-sgml-parent-document: "v4l2.sgml"
-indent-tabs-mode: nil
-End:
--->
index 0ac0057..36660d3 100644 (file)
@@ -443,11 +443,3 @@ or this particular menu item is not supported by the driver.</para>
     </variablelist>
   </refsect1>
 </refentry>
-
-<!--
-Local Variables:
-mode: sgml
-sgml-parent-document: "v4l2.sgml"
-indent-tabs-mode: nil
-End:
--->
index c30dcc4..e013da8 100644 (file)
@@ -125,11 +125,3 @@ wrong.</para>
     </variablelist>
   </refsect1>
 </refentry>
-
-<!--
-Local Variables:
-mode: sgml
-sgml-parent-document: "v4l2.sgml"
-indent-tabs-mode: nil
-End:
--->
index e67be7a..d1d4a17 100755 (executable)
@@ -27,8 +27,8 @@ use IO::Handle;
                "or51211", "or51132_qam", "or51132_vsb", "bluebird",
                "opera1", "cx231xx", "cx18", "cx23885", "pvrusb2", "mpc718",
                "af9015", "ngene", "az6027", "lme2510_lg", "lme2510c_s7395",
-               "lme2510c_s7395_old", "drxk", "drxk_terratec_h5", "tda10071",
-               "it9135" );
+               "lme2510c_s7395_old", "drxk", "drxk_terratec_h5",
+               "drxk_hauppauge_hvr930c", "tda10071", "it9135", "it9137");
 
 # Check args
 syntax() if (scalar(@ARGV) != 1);
@@ -644,6 +644,24 @@ sub drxk {
     "$fwfile"
 }
 
+sub drxk_hauppauge_hvr930c {
+    my $url = "http://www.wintvcd.co.uk/drivers/";
+    my $zipfile = "HVR-9x0_5_10_325_28153_SIGNED.zip";
+    my $hash = "83ab82e7e9480ec8bf1ae0155ca63c88";
+    my $tmpdir = tempdir(DIR => "/tmp", CLEANUP => 1);
+    my $drvfile = "HVR-900/emOEM.sys";
+    my $fwfile = "dvb-usb-hauppauge-hvr930c-drxk.fw";
+
+    checkstandard();
+
+    wgetfile($zipfile, $url . $zipfile);
+    verify($zipfile, $hash);
+    unzip($zipfile, $tmpdir);
+    extract("$tmpdir/$drvfile", 0x117b0, 42692, "$fwfile");
+
+    "$fwfile"
+}
+
 sub drxk_terratec_h5 {
     my $url = "http://www.linuxtv.org/downloads/firmware/";
     my $hash = "19000dada8e2741162ccc50cc91fa7f1";
@@ -658,6 +676,26 @@ sub drxk_terratec_h5 {
 }
 
 sub it9135 {
+       my $sourcefile = "dvb-usb-it9135.zip";
+       my $url = "http://www.ite.com.tw/uploads/firmware/v3.6.0.0/$sourcefile";
+       my $hash = "1e55f6c8833f1d0ae067c2bb2953e6a9";
+       my $tmpdir = tempdir(DIR => "/tmp", CLEANUP => 0);
+       my $outfile = "dvb-usb-it9135.fw";
+       my $fwfile1 = "dvb-usb-it9135-01.fw";
+       my $fwfile2 = "dvb-usb-it9135-02.fw";
+
+       checkstandard();
+
+       wgetfile($sourcefile, $url);
+       unzip($sourcefile, $tmpdir);
+       verify("$tmpdir/$outfile", $hash);
+       extract("$tmpdir/$outfile", 64, 8128, "$fwfile1");
+       extract("$tmpdir/$outfile", 12866, 5817, "$fwfile2");
+
+       "$fwfile1 $fwfile2"
+}
+
+sub it9137 {
     my $url = "http://kworld.server261.com/kworld/CD/ITE_TiVme/V1.00/";
     my $zipfile = "Driver_V10.323.1.0412.100412.zip";
     my $hash = "79b597dc648698ed6820845c0c9d0d37";
index d49c2ec..d725c0d 100644 (file)
@@ -439,41 +439,6 @@ Who:       Jean Delvare <khali@linux-fr.org>
 
 ----------------------------
 
-What:  Support for driver specific ioctls in the pwc driver (everything
-       defined in media/pwc-ioctl.h)
-When:  3.3
-Why:   This stems from the v4l1 era, with v4l2 everything can be done with
-       standardized v4l2 API calls
-Who:   Hans de Goede <hdegoede@redhat.com>
-
-----------------------------
-
-What:  Driver specific sysfs API in the pwc driver
-When:  3.3
-Why:   Setting pan/tilt should be done with v4l2 controls, like with other
-       cams. The button is available as a standard input device
-Who:   Hans de Goede <hdegoede@redhat.com>
-
-----------------------------
-
-What:  Driver specific use of pixfmt.priv in the pwc driver
-When:  3.3
-Why:   The .priv field never was intended for this, setting a framerate is
-       support using the standardized S_PARM ioctl
-Who:   Hans de Goede <hdegoede@redhat.com>
-
-----------------------------
-
-What:  Software emulation of arbritary resolutions in the pwc driver
-When:  3.3
-Why:   The pwc driver claims to support any resolution between 160x120
-       and 640x480, but emulates this by simply drawing a black border
-       around the image. Userspace can draw its own black border if it
-       really wants one.
-Who:   Hans de Goede <hdegoede@redhat.com>
-
-----------------------------
-
 What:  For VIDIOC_S_FREQUENCY the type field must match the device node's type.
        If not, return -EINVAL.
 When:  3.2
index d5cb4ea..7b59e95 100644 (file)
@@ -1,5 +1,5 @@
   0 -> Unknown board                            (au0828)
-  1 -> Hauppauge HVR950Q                        (au0828)        [2040:7200,2040:7210,2040:7217,2040:721b,2040:721e,2040:721f,2040:7280,0fd9:0008]
+  1 -> Hauppauge HVR950Q                        (au0828)        [2040:7200,2040:7210,2040:7217,2040:721b,2040:721e,2040:721f,2040:7280,0fd9:0008,2040:7260,2040:7213]
   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]
index 4739d56..b753906 100644 (file)
@@ -71,7 +71,7 @@
  70 -> Prolink Pixelview PV-BT878P+ (Rev.4C,8E)
  71 -> Lifeview FlyVideo 98EZ (capture only) LR51          [1851:1851]
  72 -> Prolink Pixelview PV-BT878P+9B (PlayTV Pro rev.9B FM+NICAM) [1554:4011]
- 73 -> Sensoray 311                                        [6000:0311]
+ 73 -> Sensoray 311/611                                    [6000:0311,6000:0611]
  74 -> RemoteVision MX (RV605)
  75 -> Powercolor MTV878/ MTV878R/ MTV878F
  76 -> Canopus WinDVR PCI (COMPAQ Presario 3524JP, 5112JP) [0e11:0079]
 157 -> Geovision GV-800(S) (master)                        [800a:763d]
 158 -> Geovision GV-800(S) (slave)                         [800b:763d,800c:763d,800d:763d]
 159 -> ProVideo PV183                                      [1830:1540,1831:1540,1832:1540,1833:1540,1834:1540,1835:1540,1836:1540,1837:1540]
+160 -> Tongwei Video Technology TD-3116                    [f200:3116]
index 8910449..23584d0 100644 (file)
@@ -29,3 +29,6 @@
  28 -> LEADTEK WinFast PxTV1200                            [107d:6f22]
  29 -> GoTView X5 3D Hybrid                                [5654:2390]
  30 -> NetUP Dual DVB-T/C-CI RF                            [1b55:e2e4]
+ 31 -> Leadtek Winfast PxDVR3200 H XC4000                  [107d:6f39]
+ 32 -> MPX-885
+ 33 -> Mygica X8507                                        [14f1:8502]
index d9c0f11..eee18e6 100644 (file)
@@ -85,3 +85,5 @@
  84 -> Samsung SMT 7020 DVB-S                              [18ac:dc00,18ac:dccd]
  85 -> Twinhan VP-1027 DVB-S                               [1822:0023]
  86 -> TeVii S464 DVB-S/S2                                 [d464:9022]
+ 87 -> Leadtek WinFast DTV2000 H PLUS                      [107d:6f42]
+ 88 -> Leadtek WinFast DTV1800 H (XC4000)                  [107d:6f38]
index 4a7b3df..e7be3ac 100644 (file)
@@ -11,7 +11,7 @@
  10 -> Hauppauge WinTV HVR 900                  (em2880)        [2040:6500]
  11 -> Terratec Hybrid XS                       (em2880)
  12 -> Kworld PVR TV 2800 RF                    (em2820/em2840)
- 13 -> Terratec Prodigy XS                      (em2880)        [0ccd:0047]
+ 13 -> Terratec Prodigy XS                      (em2880)
  14 -> SIIG AVTuner-PVR / 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]
@@ -40,7 +40,7 @@
  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]
+ 42 -> Kworld 355 U DVB-T                       (em2870)        [eb1a:e355,eb1a:e357,eb1a:e359]
  43 -> Terratec Cinergy T XS                    (em2870)        [0ccd:0043]
  44 -> Terratec Cinergy T XS (MT2060)           (em2870)
  45 -> Pinnacle PCTV DVB-T                      (em2870)
@@ -64,7 +64,7 @@
  64 -> Easy Cap Capture DC-60                   (em2860)
  65 -> IO-DATA GV-MVP/SZ                        (em2820/em2840) [04bb:0515]
  66 -> Empire dual TV                           (em2880)
- 67 -> Terratec Grabby                          (em2860)        [0ccd:0096]
+ 67 -> Terratec Grabby                          (em2860)        [0ccd:0096,0ccd:10AF]
  68 -> Terratec AV350                           (em2860)        [0ccd:0084]
  69 -> KWorld ATSC 315U HDTV TV Box             (em2882)        [eb1a:a313]
  70 -> Evga inDtube                             (em2882)
@@ -76,3 +76,7 @@
  76 -> KWorld PlusTV 340U or UB435-Q (ATSC)     (em2870)        [1b80:a340]
  77 -> EM2874 Leadership ISDBT                  (em2874)
  78 -> PCTV nanoStick T2 290e                   (em28174)
+ 79 -> Terratec Cinergy H5                      (em2884)        [0ccd:10a2,0ccd:10ad]
+ 80 -> PCTV DVB-S2 Stick (460e)                 (em28174)
+ 81 -> Hauppauge WinTV HVR 930C                 (em2884)        [2040:1605]
+ 82 -> Terratec Cinergy HTC Stick               (em2884)        [0ccd:00b2]
index 7efae9b..e7ef38a 100644 (file)
 185 -> MagicPro ProHDTV Pro2 DMB-TH/Hybrid      [17de:d136]
 186 -> Beholder BeholdTV 501                    [5ace:5010]
 187 -> Beholder BeholdTV 503 FM                 [5ace:5030]
+188 -> Sensoray 811/911                         [6000:0811,6000:0911]
index 152bd7b..2205e8d 100644 (file)
@@ -7,3 +7,5 @@
   6 -> Hauppauge WinTV-HVR2200                             [0070:8901]
   7 -> Hauppauge WinTV-HVR2250                             [0070:8891,0070:8851]
   8 -> Hauppauge WinTV-HVR2250                             [0070:88A1]
+  9 -> Hauppauge WinTV-HVR2200                             [0070:8940]
+ 10 -> Hauppauge WinTV-HVR2200                             [0070:8953]
index b15e29f..f2060f0 100644 (file)
@@ -189,6 +189,7 @@ ov519               05a9:0511       Video Blaster WebCam 3/WebCam Plus, D-Link USB Digital Video Ca
 ov519          05a9:0518       Creative WebCam
 ov519          05a9:0519       OV519 Microphone
 ov519          05a9:0530       OmniVision
+ov534_9                05a9:1550       OmniVision VEHO Filmscanner
 ov519          05a9:2800       OmniVision SuperCAM
 ov519          05a9:4519       Webcam Classic
 ov534_9                05a9:8065       OmniVision test kit ov538+ov9712
@@ -278,6 +279,7 @@ pac7302             093a:2628       Genius iLook 300
 pac7302                093a:2629       Genious iSlim 300
 pac7302                093a:262a       Webcam 300k
 pac7302                093a:262c       Philips SPC 230 NC
+jl2005bcd      0979:0227       Various brands, 19 known cameras supported
 jeilinj                0979:0280       Sakar 57379
 jeilinj                0979:0280       Sportscam DV15
 zc3xx          0ac8:0302       Z-star Vimicro zc0302
index f8dcabf..659b2ba 100644 (file)
@@ -612,6 +612,12 @@ You can set a pointer to a mutex_lock in struct video_device. Usually this
 will be either a top-level mutex or a mutex per device node. If you want
 finer-grained locking then you have to set it to NULL and do you own locking.
 
+It is up to the driver developer to decide which method to use. However, if
+your driver has high-latency operations (for example, changing the exposure
+of a USB webcam might take a long time), then you might be better off with
+doing your own locking if you want to allow the user to do other things with
+the device while waiting for the high-latency command to finish.
+
 If a lock is specified then all file operations will be serialized on that
 lock. If you use videobuf then you must pass the same lock to the videobuf
 queue initialize function: if videobuf has to wait for a frame to arrive, then
@@ -619,6 +625,11 @@ it will temporarily unlock the lock and relock it afterwards. If your driver
 also waits in the code, then you should do the same to allow other processes
 to access the device node while the first process is waiting for something.
 
+In the case of videobuf2 you will need to implement the wait_prepare and
+wait_finish callbacks to unlock/lock if applicable. In particular, if you use
+the lock in struct video_device then you must unlock/lock this mutex in
+wait_prepare and wait_finish.
+
 The implementation of a hotplug disconnect should also take the lock before
 calling v4l2_device_disconnect.
 
index ebbee87..2a90101 100644 (file)
@@ -2821,6 +2821,14 @@ L:       platform-driver-x86@vger.kernel.org
 S:     Maintained
 F:     drivers/platform/x86/fujitsu-laptop.c
 
+FUJITSU M-5MO LS CAMERA ISP DRIVER
+M:     Kyungmin Park <kyungmin.park@samsung.com>
+M:     Heungjun Kim <riverful.kim@samsung.com>
+L:     linux-media@vger.kernel.org
+S:     Maintained
+F:     drivers/media/video/m5mols/
+F:     include/media/m5mols.h
+
 FUSE: FILESYSTEM IN USERSPACE
 M:     Miklos Szeredi <miklos@szeredi.hu>
 L:     fuse-devel@lists.sourceforge.net
index 996302a..4a6d5ce 100644 (file)
@@ -26,7 +26,7 @@ config MEDIA_TUNER
        select MEDIA_TUNER_XC4000 if !MEDIA_TUNER_CUSTOMISE
        select MEDIA_TUNER_MT20XX if !MEDIA_TUNER_CUSTOMISE
        select MEDIA_TUNER_TDA8290 if !MEDIA_TUNER_CUSTOMISE
-       select MEDIA_TUNER_TEA5761 if !MEDIA_TUNER_CUSTOMISE
+       select MEDIA_TUNER_TEA5761 if !MEDIA_TUNER_CUSTOMISE && EXPERIMENTAL
        select MEDIA_TUNER_TEA5767 if !MEDIA_TUNER_CUSTOMISE
        select MEDIA_TUNER_SIMPLE if !MEDIA_TUNER_CUSTOMISE
        select MEDIA_TUNER_TDA9887 if !MEDIA_TUNER_CUSTOMISE
@@ -116,6 +116,13 @@ config MEDIA_TUNER_MT2060
        help
          A driver for the silicon IF tuner MT2060 from Microtune.
 
+config MEDIA_TUNER_MT2063
+       tristate "Microtune MT2063 silicon IF tuner"
+       depends on VIDEO_MEDIA && I2C
+       default m if MEDIA_TUNER_CUSTOMISE
+       help
+         A driver for the silicon IF tuner MT2063 from Microtune.
+
 config MEDIA_TUNER_MT2266
        tristate "Microtune MT2266 silicon tuner"
        depends on VIDEO_MEDIA && I2C
index 196c12a..8295854 100644 (file)
@@ -18,6 +18,7 @@ obj-$(CONFIG_MEDIA_TUNER_TDA18271) += tda18271.o
 obj-$(CONFIG_MEDIA_TUNER_XC5000) += xc5000.o
 obj-$(CONFIG_MEDIA_TUNER_XC4000) += xc4000.o
 obj-$(CONFIG_MEDIA_TUNER_MT2060) += mt2060.o
+obj-$(CONFIG_MEDIA_TUNER_MT2063) += mt2063.o
 obj-$(CONFIG_MEDIA_TUNER_MT2266) += mt2266.o
 obj-$(CONFIG_MEDIA_TUNER_QT1010) += qt1010.o
 obj-$(CONFIG_MEDIA_TUNER_MT2131) += mt2131.o
index 9883617..cb2c98f 100644 (file)
@@ -151,7 +151,7 @@ static int max2165_set_bandwidth(struct max2165_priv *priv, u32 bw)
 {
        u8 val;
 
-       if (bw == BANDWIDTH_8_MHZ)
+       if (bw == 8000000)
                val = priv->bb_filter_8mhz_cfg;
        else
                val = priv->bb_filter_7mhz_cfg;
@@ -257,39 +257,28 @@ static void max2165_debug_status(struct max2165_priv *priv)
        dprintk("VCO: %d, VCO Sub-band: %d, ADC: %d\n", vco, vco_sub_band, adc);
 }
 
-static int max2165_set_params(struct dvb_frontend *fe,
-       struct dvb_frontend_parameters *params)
+static int max2165_set_params(struct dvb_frontend *fe)
 {
        struct max2165_priv *priv = fe->tuner_priv;
+       struct dtv_frontend_properties *c = &fe->dtv_property_cache;
        int ret;
 
-       dprintk("%s() frequency=%d (Hz)\n", __func__, params->frequency);
-       if (fe->ops.info.type == FE_ATSC) {
-                       return -EINVAL;
-       } else if (fe->ops.info.type == FE_OFDM) {
-               dprintk("%s() OFDM\n", __func__);
-               switch (params->u.ofdm.bandwidth) {
-               case BANDWIDTH_6_MHZ:
-                       return -EINVAL;
-               case BANDWIDTH_7_MHZ:
-               case BANDWIDTH_8_MHZ:
-                       priv->frequency = params->frequency;
-                       priv->bandwidth = params->u.ofdm.bandwidth;
-                       break;
-               default:
-                       printk(KERN_ERR "MAX2165 bandwidth not set!\n");
-                       return -EINVAL;
-               }
-       } else {
-               printk(KERN_ERR "MAX2165 modulation type not supported!\n");
+       switch (c->bandwidth_hz) {
+       case 7000000:
+       case 8000000:
+               priv->frequency = c->frequency;
+               break;
+       default:
+               printk(KERN_INFO "MAX2165: bandwidth %d Hz not supported.\n",
+                      c->bandwidth_hz);
                return -EINVAL;
        }
 
-       dprintk("%s() frequency=%d\n", __func__, priv->frequency);
+       dprintk("%s() frequency=%d\n", __func__, c->frequency);
 
        if (fe->ops.i2c_gate_ctrl)
                fe->ops.i2c_gate_ctrl(fe, 1);
-       max2165_set_bandwidth(priv, priv->bandwidth);
+       max2165_set_bandwidth(priv, c->bandwidth_hz);
        ret = max2165_set_rf(priv, priv->frequency);
        mdelay(50);
        max2165_debug_status(priv);
@@ -370,7 +359,7 @@ static int max2165_init(struct dvb_frontend *fe)
 
        max2165_read_rom_table(priv);
 
-       max2165_set_bandwidth(priv, BANDWIDTH_8_MHZ);
+       max2165_set_bandwidth(priv, 8000000);
 
        if (fe->ops.i2c_gate_ctrl)
                        fe->ops.i2c_gate_ctrl(fe, 0);
index fe5c4b8..5ddce7e 100644 (file)
@@ -214,22 +214,22 @@ exit:
        return err;
 }
 
-static int mc44s803_set_params(struct dvb_frontend *fe,
-                              struct dvb_frontend_parameters *params)
+static int mc44s803_set_params(struct dvb_frontend *fe)
 {
        struct mc44s803_priv *priv = fe->tuner_priv;
+       struct dtv_frontend_properties *c = &fe->dtv_property_cache;
        u32 r1, r2, n1, n2, lo1, lo2, freq, val;
        int err;
 
-       priv->frequency = params->frequency;
+       priv->frequency = c->frequency;
 
        r1 = MC44S803_OSC / 1000000;
        r2 = MC44S803_OSC /  100000;
 
-       n1 = (params->frequency + MC44S803_IF1 + 500000) / 1000000;
+       n1 = (c->frequency + MC44S803_IF1 + 500000) / 1000000;
        freq = MC44S803_OSC / r1 * n1;
        lo1 = ((60 * n1) + (r1 / 2)) / r1;
-       freq = freq - params->frequency;
+       freq = freq - c->frequency;
 
        n2 = (freq - MC44S803_IF2 + 50000) / 100000;
        lo2 = ((60 * n2) + (r2 / 2)) / r2;
index 2d0e768..13381de 100644 (file)
@@ -153,8 +153,9 @@ static int mt2060_spurcheck(u32 lo1,u32 lo2,u32 if2)
 #define IF2  36150       // IF2 frequency = 36.150 MHz
 #define FREF 16000       // Quartz oscillator 16 MHz
 
-static int mt2060_set_params(struct dvb_frontend *fe, struct dvb_frontend_parameters *params)
+static int mt2060_set_params(struct dvb_frontend *fe)
 {
+       struct dtv_frontend_properties *c = &fe->dtv_property_cache;
        struct mt2060_priv *priv;
        int ret=0;
        int i=0;
@@ -176,8 +177,7 @@ static int mt2060_set_params(struct dvb_frontend *fe, struct dvb_frontend_parame
 
        mt2060_writeregs(priv,b,2);
 
-       freq = params->frequency / 1000; // Hz -> kHz
-       priv->bandwidth = (fe->ops.info.type == FE_OFDM) ? params->u.ofdm.bandwidth : 0;
+       freq = c->frequency / 1000; /* Hz -> kHz */
 
        f_lo1 = freq + if1 * 1000;
        f_lo1 = (f_lo1 / 250) * 250;
@@ -293,10 +293,9 @@ static int mt2060_get_frequency(struct dvb_frontend *fe, u32 *frequency)
        return 0;
 }
 
-static int mt2060_get_bandwidth(struct dvb_frontend *fe, u32 *bandwidth)
+static int mt2060_get_if_frequency(struct dvb_frontend *fe, u32 *frequency)
 {
-       struct mt2060_priv *priv = fe->tuner_priv;
-       *bandwidth = priv->bandwidth;
+       *frequency = IF2 * 1000;
        return 0;
 }
 
@@ -356,7 +355,7 @@ static const struct dvb_tuner_ops mt2060_tuner_ops = {
 
        .set_params    = mt2060_set_params,
        .get_frequency = mt2060_get_frequency,
-       .get_bandwidth = mt2060_get_bandwidth
+       .get_if_frequency = mt2060_get_if_frequency,
 };
 
 /* This functions tries to identify a MT2060 tuner by reading the PART/REV register. This is hasty. */
index 5eaccde..2b60de6 100644 (file)
@@ -97,7 +97,6 @@ struct mt2060_priv {
        struct i2c_adapter   *i2c;
 
        u32 frequency;
-       u32 bandwidth;
        u16 if1_freq;
        u8  fmfreq;
 };
diff --git a/drivers/media/common/tuners/mt2063.c b/drivers/media/common/tuners/mt2063.c
new file mode 100644 (file)
index 0000000..c89af3c
--- /dev/null
@@ -0,0 +1,2307 @@
+/*
+ * Driver for mt2063 Micronas tuner
+ *
+ * Copyright (c) 2011 Mauro Carvalho Chehab <mchehab@redhat.com>
+ *
+ * This driver came from a driver originally written by:
+ *             Henry Wang <Henry.wang@AzureWave.com>
+ * Made publicly available by Terratec, at:
+ *     http://linux.terratec.de/files/TERRATEC_H7/20110323_TERRATEC_H7_Linux.tar.gz
+ * The original driver's license is GPL, as declared with MODULE_LICENSE()
+ *
+ * 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 under version 2 of the License.
+ *
+ * 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.
+ */
+
+#include <linux/init.h>
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/string.h>
+#include <linux/videodev2.h>
+
+#include "mt2063.h"
+
+static unsigned int debug;
+module_param(debug, int, 0644);
+MODULE_PARM_DESC(debug, "Set Verbosity level");
+
+#define dprintk(level, fmt, arg...) do {                               \
+if (debug >= level)                                                    \
+       printk(KERN_DEBUG "mt2063 %s: " fmt, __func__, ## arg); \
+} while (0)
+
+
+/* positive error codes used internally */
+
+/*  Info: Unavoidable LO-related spur may be present in the output  */
+#define MT2063_SPUR_PRESENT_ERR             (0x00800000)
+
+/*  Info: Mask of bits used for # of LO-related spurs that were avoided during tuning  */
+#define MT2063_SPUR_CNT_MASK                (0x001f0000)
+#define MT2063_SPUR_SHIFT                   (16)
+
+/*  Info: Upconverter frequency is out of range (may be reason for MT_UPC_UNLOCK) */
+#define MT2063_UPC_RANGE                    (0x04000000)
+
+/*  Info: Downconverter frequency is out of range (may be reason for MT_DPC_UNLOCK) */
+#define MT2063_DNC_RANGE                    (0x08000000)
+
+/*
+ *  Constant defining the version of the following structure
+ *  and therefore the API for this code.
+ *
+ *  When compiling the tuner driver, the preprocessor will
+ *  check against this version number to make sure that
+ *  it matches the version that the tuner driver knows about.
+ */
+
+/* DECT Frequency Avoidance */
+#define MT2063_DECT_AVOID_US_FREQS      0x00000001
+
+#define MT2063_DECT_AVOID_EURO_FREQS    0x00000002
+
+#define MT2063_EXCLUDE_US_DECT_FREQUENCIES(s) (((s) & MT2063_DECT_AVOID_US_FREQS) != 0)
+
+#define MT2063_EXCLUDE_EURO_DECT_FREQUENCIES(s) (((s) & MT2063_DECT_AVOID_EURO_FREQS) != 0)
+
+enum MT2063_DECT_Avoid_Type {
+       MT2063_NO_DECT_AVOIDANCE = 0,                           /* Do not create DECT exclusion zones.     */
+       MT2063_AVOID_US_DECT = MT2063_DECT_AVOID_US_FREQS,      /* Avoid US DECT frequencies.              */
+       MT2063_AVOID_EURO_DECT = MT2063_DECT_AVOID_EURO_FREQS,  /* Avoid European DECT frequencies.        */
+       MT2063_AVOID_BOTH                                       /* Avoid both regions. Not typically used. */
+};
+
+#define MT2063_MAX_ZONES 48
+
+struct MT2063_ExclZone_t {
+       u32 min_;
+       u32 max_;
+       struct MT2063_ExclZone_t *next_;
+};
+
+/*
+ *  Structure of data needed for Spur Avoidance
+ */
+struct MT2063_AvoidSpursData_t {
+       u32 f_ref;
+       u32 f_in;
+       u32 f_LO1;
+       u32 f_if1_Center;
+       u32 f_if1_Request;
+       u32 f_if1_bw;
+       u32 f_LO2;
+       u32 f_out;
+       u32 f_out_bw;
+       u32 f_LO1_Step;
+       u32 f_LO2_Step;
+       u32 f_LO1_FracN_Avoid;
+       u32 f_LO2_FracN_Avoid;
+       u32 f_zif_bw;
+       u32 f_min_LO_Separation;
+       u32 maxH1;
+       u32 maxH2;
+       enum MT2063_DECT_Avoid_Type avoidDECT;
+       u32 bSpurPresent;
+       u32 bSpurAvoided;
+       u32 nSpursFound;
+       u32 nZones;
+       struct MT2063_ExclZone_t *freeZones;
+       struct MT2063_ExclZone_t *usedZones;
+       struct MT2063_ExclZone_t MT2063_ExclZones[MT2063_MAX_ZONES];
+};
+
+/*
+ * Parameter for function MT2063_SetPowerMask that specifies the power down
+ * of various sections of the MT2063.
+ */
+enum MT2063_Mask_Bits {
+       MT2063_REG_SD = 0x0040,         /* Shutdown regulator                 */
+       MT2063_SRO_SD = 0x0020,         /* Shutdown SRO                       */
+       MT2063_AFC_SD = 0x0010,         /* Shutdown AFC A/D                   */
+       MT2063_PD_SD = 0x0002,          /* Enable power detector shutdown     */
+       MT2063_PDADC_SD = 0x0001,       /* Enable power detector A/D shutdown */
+       MT2063_VCO_SD = 0x8000,         /* Enable VCO shutdown                */
+       MT2063_LTX_SD = 0x4000,         /* Enable LTX shutdown                */
+       MT2063_LT1_SD = 0x2000,         /* Enable LT1 shutdown                */
+       MT2063_LNA_SD = 0x1000,         /* Enable LNA shutdown                */
+       MT2063_UPC_SD = 0x0800,         /* Enable upconverter shutdown        */
+       MT2063_DNC_SD = 0x0400,         /* Enable downconverter shutdown      */
+       MT2063_VGA_SD = 0x0200,         /* Enable VGA shutdown                */
+       MT2063_AMP_SD = 0x0100,         /* Enable AMP shutdown                */
+       MT2063_ALL_SD = 0xFF73,         /* All shutdown bits for this tuner   */
+       MT2063_NONE_SD = 0x0000         /* No shutdown bits                   */
+};
+
+/*
+ *  Possible values for MT2063_DNC_OUTPUT
+ */
+enum MT2063_DNC_Output_Enable {
+       MT2063_DNC_NONE = 0,
+       MT2063_DNC_1,
+       MT2063_DNC_2,
+       MT2063_DNC_BOTH
+};
+
+/*
+ *  Two-wire serial bus subaddresses of the tuner registers.
+ *  Also known as the tuner's register addresses.
+ */
+enum MT2063_Register_Offsets {
+       MT2063_REG_PART_REV = 0,        /*  0x00: Part/Rev Code         */
+       MT2063_REG_LO1CQ_1,             /*  0x01: LO1C Queued Byte 1    */
+       MT2063_REG_LO1CQ_2,             /*  0x02: LO1C Queued Byte 2    */
+       MT2063_REG_LO2CQ_1,             /*  0x03: LO2C Queued Byte 1    */
+       MT2063_REG_LO2CQ_2,             /*  0x04: LO2C Queued Byte 2    */
+       MT2063_REG_LO2CQ_3,             /*  0x05: LO2C Queued Byte 3    */
+       MT2063_REG_RSVD_06,             /*  0x06: Reserved              */
+       MT2063_REG_LO_STATUS,           /*  0x07: LO Status             */
+       MT2063_REG_FIFFC,               /*  0x08: FIFF Center           */
+       MT2063_REG_CLEARTUNE,           /*  0x09: ClearTune Filter      */
+       MT2063_REG_ADC_OUT,             /*  0x0A: ADC_OUT               */
+       MT2063_REG_LO1C_1,              /*  0x0B: LO1C Byte 1           */
+       MT2063_REG_LO1C_2,              /*  0x0C: LO1C Byte 2           */
+       MT2063_REG_LO2C_1,              /*  0x0D: LO2C Byte 1           */
+       MT2063_REG_LO2C_2,              /*  0x0E: LO2C Byte 2           */
+       MT2063_REG_LO2C_3,              /*  0x0F: LO2C Byte 3           */
+       MT2063_REG_RSVD_10,             /*  0x10: Reserved              */
+       MT2063_REG_PWR_1,               /*  0x11: PWR Byte 1            */
+       MT2063_REG_PWR_2,               /*  0x12: PWR Byte 2            */
+       MT2063_REG_TEMP_STATUS,         /*  0x13: Temp Status           */
+       MT2063_REG_XO_STATUS,           /*  0x14: Crystal Status        */
+       MT2063_REG_RF_STATUS,           /*  0x15: RF Attn Status        */
+       MT2063_REG_FIF_STATUS,          /*  0x16: FIF Attn Status       */
+       MT2063_REG_LNA_OV,              /*  0x17: LNA Attn Override     */
+       MT2063_REG_RF_OV,               /*  0x18: RF Attn Override      */
+       MT2063_REG_FIF_OV,              /*  0x19: FIF Attn Override     */
+       MT2063_REG_LNA_TGT,             /*  0x1A: Reserved              */
+       MT2063_REG_PD1_TGT,             /*  0x1B: Pwr Det 1 Target      */
+       MT2063_REG_PD2_TGT,             /*  0x1C: Pwr Det 2 Target      */
+       MT2063_REG_RSVD_1D,             /*  0x1D: Reserved              */
+       MT2063_REG_RSVD_1E,             /*  0x1E: Reserved              */
+       MT2063_REG_RSVD_1F,             /*  0x1F: Reserved              */
+       MT2063_REG_RSVD_20,             /*  0x20: Reserved              */
+       MT2063_REG_BYP_CTRL,            /*  0x21: Bypass Control        */
+       MT2063_REG_RSVD_22,             /*  0x22: Reserved              */
+       MT2063_REG_RSVD_23,             /*  0x23: Reserved              */
+       MT2063_REG_RSVD_24,             /*  0x24: Reserved              */
+       MT2063_REG_RSVD_25,             /*  0x25: Reserved              */
+       MT2063_REG_RSVD_26,             /*  0x26: Reserved              */
+       MT2063_REG_RSVD_27,             /*  0x27: Reserved              */
+       MT2063_REG_FIFF_CTRL,           /*  0x28: FIFF Control          */
+       MT2063_REG_FIFF_OFFSET,         /*  0x29: FIFF Offset           */
+       MT2063_REG_CTUNE_CTRL,          /*  0x2A: Reserved              */
+       MT2063_REG_CTUNE_OV,            /*  0x2B: Reserved              */
+       MT2063_REG_CTRL_2C,             /*  0x2C: Reserved              */
+       MT2063_REG_FIFF_CTRL2,          /*  0x2D: Fiff Control          */
+       MT2063_REG_RSVD_2E,             /*  0x2E: Reserved              */
+       MT2063_REG_DNC_GAIN,            /*  0x2F: DNC Control           */
+       MT2063_REG_VGA_GAIN,            /*  0x30: VGA Gain Ctrl         */
+       MT2063_REG_RSVD_31,             /*  0x31: Reserved              */
+       MT2063_REG_TEMP_SEL,            /*  0x32: Temperature Selection */
+       MT2063_REG_RSVD_33,             /*  0x33: Reserved              */
+       MT2063_REG_RSVD_34,             /*  0x34: Reserved              */
+       MT2063_REG_RSVD_35,             /*  0x35: Reserved              */
+       MT2063_REG_RSVD_36,             /*  0x36: Reserved              */
+       MT2063_REG_RSVD_37,             /*  0x37: Reserved              */
+       MT2063_REG_RSVD_38,             /*  0x38: Reserved              */
+       MT2063_REG_RSVD_39,             /*  0x39: Reserved              */
+       MT2063_REG_RSVD_3A,             /*  0x3A: Reserved              */
+       MT2063_REG_RSVD_3B,             /*  0x3B: Reserved              */
+       MT2063_REG_RSVD_3C,             /*  0x3C: Reserved              */
+       MT2063_REG_END_REGS
+};
+
+struct mt2063_state {
+       struct i2c_adapter *i2c;
+
+       bool init;
+
+       const struct mt2063_config *config;
+       struct dvb_tuner_ops ops;
+       struct dvb_frontend *frontend;
+       struct tuner_state status;
+
+       u32 frequency;
+       u32 srate;
+       u32 bandwidth;
+       u32 reference;
+
+       u32 tuner_id;
+       struct MT2063_AvoidSpursData_t AS_Data;
+       u32 f_IF1_actual;
+       u32 rcvr_mode;
+       u32 ctfilt_sw;
+       u32 CTFiltMax[31];
+       u32 num_regs;
+       u8 reg[MT2063_REG_END_REGS];
+};
+
+/*
+ * mt2063_write - Write data into the I2C bus
+ */
+static u32 mt2063_write(struct mt2063_state *state, u8 reg, u8 *data, u32 len)
+{
+       struct dvb_frontend *fe = state->frontend;
+       int ret;
+       u8 buf[60];
+       struct i2c_msg msg = {
+               .addr = state->config->tuner_address,
+               .flags = 0,
+               .buf = buf,
+               .len = len + 1
+       };
+
+       dprintk(2, "\n");
+
+       msg.buf[0] = reg;
+       memcpy(msg.buf + 1, data, len);
+
+       if (fe->ops.i2c_gate_ctrl)
+               fe->ops.i2c_gate_ctrl(fe, 1);
+       ret = i2c_transfer(state->i2c, &msg, 1);
+       if (fe->ops.i2c_gate_ctrl)
+               fe->ops.i2c_gate_ctrl(fe, 0);
+
+       if (ret < 0)
+               printk(KERN_ERR "%s error ret=%d\n", __func__, ret);
+
+       return ret;
+}
+
+/*
+ * mt2063_write - Write register data into the I2C bus, caching the value
+ */
+static u32 mt2063_setreg(struct mt2063_state *state, u8 reg, u8 val)
+{
+       u32 status;
+
+       dprintk(2, "\n");
+
+       if (reg >= MT2063_REG_END_REGS)
+               return -ERANGE;
+
+       status = mt2063_write(state, reg, &val, 1);
+       if (status < 0)
+               return status;
+
+       state->reg[reg] = val;
+
+       return 0;
+}
+
+/*
+ * mt2063_read - Read data from the I2C bus
+ */
+static u32 mt2063_read(struct mt2063_state *state,
+                          u8 subAddress, u8 *pData, u32 cnt)
+{
+       u32 status = 0; /* Status to be returned        */
+       struct dvb_frontend *fe = state->frontend;
+       u32 i = 0;
+
+       dprintk(2, "addr 0x%02x, cnt %d\n", subAddress, cnt);
+
+       if (fe->ops.i2c_gate_ctrl)
+               fe->ops.i2c_gate_ctrl(fe, 1);
+
+       for (i = 0; i < cnt; i++) {
+               u8 b0[] = { subAddress + i };
+               struct i2c_msg msg[] = {
+                       {
+                               .addr = state->config->tuner_address,
+                               .flags = 0,
+                               .buf = b0,
+                               .len = 1
+                       }, {
+                               .addr = state->config->tuner_address,
+                               .flags = I2C_M_RD,
+                               .buf = pData + i,
+                               .len = 1
+                       }
+               };
+
+               status = i2c_transfer(state->i2c, msg, 2);
+               dprintk(2, "addr 0x%02x, ret = %d, val = 0x%02x\n",
+                          subAddress + i, status, *(pData + i));
+               if (status < 0)
+                       break;
+       }
+       if (fe->ops.i2c_gate_ctrl)
+               fe->ops.i2c_gate_ctrl(fe, 0);
+
+       if (status < 0)
+               printk(KERN_ERR "Can't read from address 0x%02x,\n",
+                      subAddress + i);
+
+       return status;
+}
+
+/*
+ * FIXME: Is this really needed?
+ */
+static int MT2063_Sleep(struct dvb_frontend *fe)
+{
+       /*
+        *  ToDo:  Add code here to implement a OS blocking
+        */
+       msleep(10);
+
+       return 0;
+}
+
+/*
+ * Microtune spur avoidance
+ */
+
+/*  Implement ceiling, floor functions.  */
+#define ceil(n, d) (((n) < 0) ? (-((-(n))/(d))) : (n)/(d) + ((n)%(d) != 0))
+#define floor(n, d) (((n) < 0) ? (-((-(n))/(d))) - ((n)%(d) != 0) : (n)/(d))
+
+struct MT2063_FIFZone_t {
+       s32 min_;
+       s32 max_;
+};
+
+static struct MT2063_ExclZone_t *InsertNode(struct MT2063_AvoidSpursData_t
+                                           *pAS_Info,
+                                           struct MT2063_ExclZone_t *pPrevNode)
+{
+       struct MT2063_ExclZone_t *pNode;
+
+       dprintk(2, "\n");
+
+       /*  Check for a node in the free list  */
+       if (pAS_Info->freeZones != NULL) {
+               /*  Use one from the free list  */
+               pNode = pAS_Info->freeZones;
+               pAS_Info->freeZones = pNode->next_;
+       } else {
+               /*  Grab a node from the array  */
+               pNode = &pAS_Info->MT2063_ExclZones[pAS_Info->nZones];
+       }
+
+       if (pPrevNode != NULL) {
+               pNode->next_ = pPrevNode->next_;
+               pPrevNode->next_ = pNode;
+       } else {                /*  insert at the beginning of the list  */
+
+               pNode->next_ = pAS_Info->usedZones;
+               pAS_Info->usedZones = pNode;
+       }
+
+       pAS_Info->nZones++;
+       return pNode;
+}
+
+static struct MT2063_ExclZone_t *RemoveNode(struct MT2063_AvoidSpursData_t
+                                           *pAS_Info,
+                                           struct MT2063_ExclZone_t *pPrevNode,
+                                           struct MT2063_ExclZone_t
+                                           *pNodeToRemove)
+{
+       struct MT2063_ExclZone_t *pNext = pNodeToRemove->next_;
+
+       dprintk(2, "\n");
+
+       /*  Make previous node point to the subsequent node  */
+       if (pPrevNode != NULL)
+               pPrevNode->next_ = pNext;
+
+       /*  Add pNodeToRemove to the beginning of the freeZones  */
+       pNodeToRemove->next_ = pAS_Info->freeZones;
+       pAS_Info->freeZones = pNodeToRemove;
+
+       /*  Decrement node count  */
+       pAS_Info->nZones--;
+
+       return pNext;
+}
+
+/*
+ * MT_AddExclZone()
+ *
+ * Add (and merge) an exclusion zone into the list.
+ * If the range (f_min, f_max) is totally outside the
+ * 1st IF BW, ignore the entry.
+ * If the range (f_min, f_max) is negative, ignore the entry.
+ */
+static void MT2063_AddExclZone(struct MT2063_AvoidSpursData_t *pAS_Info,
+                              u32 f_min, u32 f_max)
+{
+       struct MT2063_ExclZone_t *pNode = pAS_Info->usedZones;
+       struct MT2063_ExclZone_t *pPrev = NULL;
+       struct MT2063_ExclZone_t *pNext = NULL;
+
+       dprintk(2, "\n");
+
+       /*  Check to see if this overlaps the 1st IF filter  */
+       if ((f_max > (pAS_Info->f_if1_Center - (pAS_Info->f_if1_bw / 2)))
+           && (f_min < (pAS_Info->f_if1_Center + (pAS_Info->f_if1_bw / 2)))
+           && (f_min < f_max)) {
+               /*
+                *                1        2         3      4       5        6
+                *
+                *   New entry:  |---|    |--|      |--|    |-|    |---|    |--|
+                *                or       or        or     or      or
+                *   Existing:  |--|      |--|      |--|    |---|  |-|      |--|
+                */
+
+               /*  Check for our place in the list  */
+               while ((pNode != NULL) && (pNode->max_ < f_min)) {
+                       pPrev = pNode;
+                       pNode = pNode->next_;
+               }
+
+               if ((pNode != NULL) && (pNode->min_ < f_max)) {
+                       /*  Combine me with pNode  */
+                       if (f_min < pNode->min_)
+                               pNode->min_ = f_min;
+                       if (f_max > pNode->max_)
+                               pNode->max_ = f_max;
+               } else {
+                       pNode = InsertNode(pAS_Info, pPrev);
+                       pNode->min_ = f_min;
+                       pNode->max_ = f_max;
+               }
+
+               /*  Look for merging possibilities  */
+               pNext = pNode->next_;
+               while ((pNext != NULL) && (pNext->min_ < pNode->max_)) {
+                       if (pNext->max_ > pNode->max_)
+                               pNode->max_ = pNext->max_;
+                       /*  Remove pNext, return ptr to pNext->next  */
+                       pNext = RemoveNode(pAS_Info, pNode, pNext);
+               }
+       }
+}
+
+/*
+ *  Reset all exclusion zones.
+ *  Add zones to protect the PLL FracN regions near zero
+ */
+static void MT2063_ResetExclZones(struct MT2063_AvoidSpursData_t *pAS_Info)
+{
+       u32 center;
+
+       dprintk(2, "\n");
+
+       pAS_Info->nZones = 0;   /*  this clears the used list  */
+       pAS_Info->usedZones = NULL;     /*  reset ptr                  */
+       pAS_Info->freeZones = NULL;     /*  reset ptr                  */
+
+       center =
+           pAS_Info->f_ref *
+           ((pAS_Info->f_if1_Center - pAS_Info->f_if1_bw / 2 +
+             pAS_Info->f_in) / pAS_Info->f_ref) - pAS_Info->f_in;
+       while (center <
+              pAS_Info->f_if1_Center + pAS_Info->f_if1_bw / 2 +
+              pAS_Info->f_LO1_FracN_Avoid) {
+               /*  Exclude LO1 FracN  */
+               MT2063_AddExclZone(pAS_Info,
+                                  center - pAS_Info->f_LO1_FracN_Avoid,
+                                  center - 1);
+               MT2063_AddExclZone(pAS_Info, center + 1,
+                                  center + pAS_Info->f_LO1_FracN_Avoid);
+               center += pAS_Info->f_ref;
+       }
+
+       center =
+           pAS_Info->f_ref *
+           ((pAS_Info->f_if1_Center - pAS_Info->f_if1_bw / 2 -
+             pAS_Info->f_out) / pAS_Info->f_ref) + pAS_Info->f_out;
+       while (center <
+              pAS_Info->f_if1_Center + pAS_Info->f_if1_bw / 2 +
+              pAS_Info->f_LO2_FracN_Avoid) {
+               /*  Exclude LO2 FracN  */
+               MT2063_AddExclZone(pAS_Info,
+                                  center - pAS_Info->f_LO2_FracN_Avoid,
+                                  center - 1);
+               MT2063_AddExclZone(pAS_Info, center + 1,
+                                  center + pAS_Info->f_LO2_FracN_Avoid);
+               center += pAS_Info->f_ref;
+       }
+
+       if (MT2063_EXCLUDE_US_DECT_FREQUENCIES(pAS_Info->avoidDECT)) {
+               /*  Exclude LO1 values that conflict with DECT channels */
+               MT2063_AddExclZone(pAS_Info, 1920836000 - pAS_Info->f_in, 1922236000 - pAS_Info->f_in); /* Ctr = 1921.536 */
+               MT2063_AddExclZone(pAS_Info, 1922564000 - pAS_Info->f_in, 1923964000 - pAS_Info->f_in); /* Ctr = 1923.264 */
+               MT2063_AddExclZone(pAS_Info, 1924292000 - pAS_Info->f_in, 1925692000 - pAS_Info->f_in); /* Ctr = 1924.992 */
+               MT2063_AddExclZone(pAS_Info, 1926020000 - pAS_Info->f_in, 1927420000 - pAS_Info->f_in); /* Ctr = 1926.720 */
+               MT2063_AddExclZone(pAS_Info, 1927748000 - pAS_Info->f_in, 1929148000 - pAS_Info->f_in); /* Ctr = 1928.448 */
+       }
+
+       if (MT2063_EXCLUDE_EURO_DECT_FREQUENCIES(pAS_Info->avoidDECT)) {
+               MT2063_AddExclZone(pAS_Info, 1896644000 - pAS_Info->f_in, 1898044000 - pAS_Info->f_in); /* Ctr = 1897.344 */
+               MT2063_AddExclZone(pAS_Info, 1894916000 - pAS_Info->f_in, 1896316000 - pAS_Info->f_in); /* Ctr = 1895.616 */
+               MT2063_AddExclZone(pAS_Info, 1893188000 - pAS_Info->f_in, 1894588000 - pAS_Info->f_in); /* Ctr = 1893.888 */
+               MT2063_AddExclZone(pAS_Info, 1891460000 - pAS_Info->f_in, 1892860000 - pAS_Info->f_in); /* Ctr = 1892.16  */
+               MT2063_AddExclZone(pAS_Info, 1889732000 - pAS_Info->f_in, 1891132000 - pAS_Info->f_in); /* Ctr = 1890.432 */
+               MT2063_AddExclZone(pAS_Info, 1888004000 - pAS_Info->f_in, 1889404000 - pAS_Info->f_in); /* Ctr = 1888.704 */
+               MT2063_AddExclZone(pAS_Info, 1886276000 - pAS_Info->f_in, 1887676000 - pAS_Info->f_in); /* Ctr = 1886.976 */
+               MT2063_AddExclZone(pAS_Info, 1884548000 - pAS_Info->f_in, 1885948000 - pAS_Info->f_in); /* Ctr = 1885.248 */
+               MT2063_AddExclZone(pAS_Info, 1882820000 - pAS_Info->f_in, 1884220000 - pAS_Info->f_in); /* Ctr = 1883.52  */
+               MT2063_AddExclZone(pAS_Info, 1881092000 - pAS_Info->f_in, 1882492000 - pAS_Info->f_in); /* Ctr = 1881.792 */
+       }
+}
+
+/*
+ * MT_ChooseFirstIF - Choose the best available 1st IF
+ *                    If f_Desired is not excluded, choose that first.
+ *                    Otherwise, return the value closest to f_Center that is
+ *                    not excluded
+ */
+static u32 MT2063_ChooseFirstIF(struct MT2063_AvoidSpursData_t *pAS_Info)
+{
+       /*
+        * Update "f_Desired" to be the nearest "combinational-multiple" of
+        * "f_LO1_Step".
+        * The resulting number, F_LO1 must be a multiple of f_LO1_Step.
+        * And F_LO1 is the arithmetic sum of f_in + f_Center.
+        * Neither f_in, nor f_Center must be a multiple of f_LO1_Step.
+        * However, the sum must be.
+        */
+       const u32 f_Desired =
+           pAS_Info->f_LO1_Step *
+           ((pAS_Info->f_if1_Request + pAS_Info->f_in +
+             pAS_Info->f_LO1_Step / 2) / pAS_Info->f_LO1_Step) -
+           pAS_Info->f_in;
+       const u32 f_Step =
+           (pAS_Info->f_LO1_Step >
+            pAS_Info->f_LO2_Step) ? pAS_Info->f_LO1_Step : pAS_Info->
+           f_LO2_Step;
+       u32 f_Center;
+       s32 i;
+       s32 j = 0;
+       u32 bDesiredExcluded = 0;
+       u32 bZeroExcluded = 0;
+       s32 tmpMin, tmpMax;
+       s32 bestDiff;
+       struct MT2063_ExclZone_t *pNode = pAS_Info->usedZones;
+       struct MT2063_FIFZone_t zones[MT2063_MAX_ZONES];
+
+       dprintk(2, "\n");
+
+       if (pAS_Info->nZones == 0)
+               return f_Desired;
+
+       /*
+        *  f_Center needs to be an integer multiple of f_Step away
+        *  from f_Desired
+        */
+       if (pAS_Info->f_if1_Center > f_Desired)
+               f_Center =
+                   f_Desired +
+                   f_Step *
+                   ((pAS_Info->f_if1_Center - f_Desired +
+                     f_Step / 2) / f_Step);
+       else
+               f_Center =
+                   f_Desired -
+                   f_Step *
+                   ((f_Desired - pAS_Info->f_if1_Center +
+                     f_Step / 2) / f_Step);
+
+       /*
+        * Take MT_ExclZones, center around f_Center and change the
+        * resolution to f_Step
+        */
+       while (pNode != NULL) {
+               /*  floor function  */
+               tmpMin =
+                   floor((s32) (pNode->min_ - f_Center), (s32) f_Step);
+
+               /*  ceil function  */
+               tmpMax =
+                   ceil((s32) (pNode->max_ - f_Center), (s32) f_Step);
+
+               if ((pNode->min_ < f_Desired) && (pNode->max_ > f_Desired))
+                       bDesiredExcluded = 1;
+
+               if ((tmpMin < 0) && (tmpMax > 0))
+                       bZeroExcluded = 1;
+
+               /*  See if this zone overlaps the previous  */
+               if ((j > 0) && (tmpMin < zones[j - 1].max_))
+                       zones[j - 1].max_ = tmpMax;
+               else {
+                       /*  Add new zone  */
+                       zones[j].min_ = tmpMin;
+                       zones[j].max_ = tmpMax;
+                       j++;
+               }
+               pNode = pNode->next_;
+       }
+
+       /*
+        *  If the desired is okay, return with it
+        */
+       if (bDesiredExcluded == 0)
+               return f_Desired;
+
+       /*
+        *  If the desired is excluded and the center is okay, return with it
+        */
+       if (bZeroExcluded == 0)
+               return f_Center;
+
+       /*  Find the value closest to 0 (f_Center)  */
+       bestDiff = zones[0].min_;
+       for (i = 0; i < j; i++) {
+               if (abs(zones[i].min_) < abs(bestDiff))
+                       bestDiff = zones[i].min_;
+               if (abs(zones[i].max_) < abs(bestDiff))
+                       bestDiff = zones[i].max_;
+       }
+
+       if (bestDiff < 0)
+               return f_Center - ((u32) (-bestDiff) * f_Step);
+
+       return f_Center + (bestDiff * f_Step);
+}
+
+/**
+ * gcd() - Uses Euclid's algorithm
+ *
+ * @u, @v:     Unsigned values whose GCD is desired.
+ *
+ * Returns THE greatest common divisor of u and v, if either value is 0,
+ * the other value is returned as the result.
+ */
+static u32 MT2063_gcd(u32 u, u32 v)
+{
+       u32 r;
+
+       while (v != 0) {
+               r = u % v;
+               u = v;
+               v = r;
+       }
+
+       return u;
+}
+
+/**
+ * IsSpurInBand() - Checks to see if a spur will be present within the IF's
+ *                  bandwidth. (fIFOut +/- fIFBW, -fIFOut +/- fIFBW)
+ *
+ *                    ma   mb                                     mc   md
+ *                  <--+-+-+-------------------+-------------------+-+-+-->
+ *                     |   ^                   0                   ^   |
+ *                     ^   b=-fIFOut+fIFBW/2      -b=+fIFOut-fIFBW/2   ^
+ *                     a=-fIFOut-fIFBW/2              -a=+fIFOut+fIFBW/2
+ *
+ *                  Note that some equations are doubled to prevent round-off
+ *                  problems when calculating fIFBW/2
+ *
+ * @pAS_Info:  Avoid Spurs information block
+ * @fm:                If spur, amount f_IF1 has to move negative
+ * @fp:                If spur, amount f_IF1 has to move positive
+ *
+ *  Returns 1 if an LO spur would be present, otherwise 0.
+ */
+static u32 IsSpurInBand(struct MT2063_AvoidSpursData_t *pAS_Info,
+                       u32 *fm, u32 * fp)
+{
+       /*
+        **  Calculate LO frequency settings.
+        */
+       u32 n, n0;
+       const u32 f_LO1 = pAS_Info->f_LO1;
+       const u32 f_LO2 = pAS_Info->f_LO2;
+       const u32 d = pAS_Info->f_out + pAS_Info->f_out_bw / 2;
+       const u32 c = d - pAS_Info->f_out_bw;
+       const u32 f = pAS_Info->f_zif_bw / 2;
+       const u32 f_Scale = (f_LO1 / (UINT_MAX / 2 / pAS_Info->maxH1)) + 1;
+       s32 f_nsLO1, f_nsLO2;
+       s32 f_Spur;
+       u32 ma, mb, mc, md, me, mf;
+       u32 lo_gcd, gd_Scale, gc_Scale, gf_Scale, hgds, hgfs, hgcs;
+
+       dprintk(2, "\n");
+
+       *fm = 0;
+
+       /*
+        ** For each edge (d, c & f), calculate a scale, based on the gcd
+        ** of f_LO1, f_LO2 and the edge value.  Use the larger of this
+        ** gcd-based scale factor or f_Scale.
+        */
+       lo_gcd = MT2063_gcd(f_LO1, f_LO2);
+       gd_Scale = max((u32) MT2063_gcd(lo_gcd, d), f_Scale);
+       hgds = gd_Scale / 2;
+       gc_Scale = max((u32) MT2063_gcd(lo_gcd, c), f_Scale);
+       hgcs = gc_Scale / 2;
+       gf_Scale = max((u32) MT2063_gcd(lo_gcd, f), f_Scale);
+       hgfs = gf_Scale / 2;
+
+       n0 = DIV_ROUND_UP(f_LO2 - d, f_LO1 - f_LO2);
+
+       /*  Check out all multiples of LO1 from n0 to m_maxLOSpurHarmonic  */
+       for (n = n0; n <= pAS_Info->maxH1; ++n) {
+               md = (n * ((f_LO1 + hgds) / gd_Scale) -
+                     ((d + hgds) / gd_Scale)) / ((f_LO2 + hgds) / gd_Scale);
+
+               /*  If # fLO2 harmonics > m_maxLOSpurHarmonic, then no spurs present  */
+               if (md >= pAS_Info->maxH1)
+                       break;
+
+               ma = (n * ((f_LO1 + hgds) / gd_Scale) +
+                     ((d + hgds) / gd_Scale)) / ((f_LO2 + hgds) / gd_Scale);
+
+               /*  If no spurs between +/- (f_out + f_IFBW/2), then try next harmonic  */
+               if (md == ma)
+                       continue;
+
+               mc = (n * ((f_LO1 + hgcs) / gc_Scale) -
+                     ((c + hgcs) / gc_Scale)) / ((f_LO2 + hgcs) / gc_Scale);
+               if (mc != md) {
+                       f_nsLO1 = (s32) (n * (f_LO1 / gc_Scale));
+                       f_nsLO2 = (s32) (mc * (f_LO2 / gc_Scale));
+                       f_Spur =
+                           (gc_Scale * (f_nsLO1 - f_nsLO2)) +
+                           n * (f_LO1 % gc_Scale) - mc * (f_LO2 % gc_Scale);
+
+                       *fp = ((f_Spur - (s32) c) / (mc - n)) + 1;
+                       *fm = (((s32) d - f_Spur) / (mc - n)) + 1;
+                       return 1;
+               }
+
+               /*  Location of Zero-IF-spur to be checked  */
+               me = (n * ((f_LO1 + hgfs) / gf_Scale) +
+                     ((f + hgfs) / gf_Scale)) / ((f_LO2 + hgfs) / gf_Scale);
+               mf = (n * ((f_LO1 + hgfs) / gf_Scale) -
+                     ((f + hgfs) / gf_Scale)) / ((f_LO2 + hgfs) / gf_Scale);
+               if (me != mf) {
+                       f_nsLO1 = n * (f_LO1 / gf_Scale);
+                       f_nsLO2 = me * (f_LO2 / gf_Scale);
+                       f_Spur =
+                           (gf_Scale * (f_nsLO1 - f_nsLO2)) +
+                           n * (f_LO1 % gf_Scale) - me * (f_LO2 % gf_Scale);
+
+                       *fp = ((f_Spur + (s32) f) / (me - n)) + 1;
+                       *fm = (((s32) f - f_Spur) / (me - n)) + 1;
+                       return 1;
+               }
+
+               mb = (n * ((f_LO1 + hgcs) / gc_Scale) +
+                     ((c + hgcs) / gc_Scale)) / ((f_LO2 + hgcs) / gc_Scale);
+               if (ma != mb) {
+                       f_nsLO1 = n * (f_LO1 / gc_Scale);
+                       f_nsLO2 = ma * (f_LO2 / gc_Scale);
+                       f_Spur =
+                           (gc_Scale * (f_nsLO1 - f_nsLO2)) +
+                           n * (f_LO1 % gc_Scale) - ma * (f_LO2 % gc_Scale);
+
+                       *fp = (((s32) d + f_Spur) / (ma - n)) + 1;
+                       *fm = (-(f_Spur + (s32) c) / (ma - n)) + 1;
+                       return 1;
+               }
+       }
+
+       /*  No spurs found  */
+       return 0;
+}
+
+/*
+ * MT_AvoidSpurs() - Main entry point to avoid spurs.
+ *                   Checks for existing spurs in present LO1, LO2 freqs
+ *                   and if present, chooses spur-free LO1, LO2 combination
+ *                   that tunes the same input/output frequencies.
+ */
+static u32 MT2063_AvoidSpurs(struct MT2063_AvoidSpursData_t *pAS_Info)
+{
+       u32 status = 0;
+       u32 fm, fp;             /*  restricted range on LO's        */
+       pAS_Info->bSpurAvoided = 0;
+       pAS_Info->nSpursFound = 0;
+
+       dprintk(2, "\n");
+
+       if (pAS_Info->maxH1 == 0)
+               return 0;
+
+       /*
+        * Avoid LO Generated Spurs
+        *
+        * Make sure that have no LO-related spurs within the IF output
+        * bandwidth.
+        *
+        * If there is an LO spur in this band, start at the current IF1 frequency
+        * and work out until we find a spur-free frequency or run up against the
+        * 1st IF SAW band edge.  Use temporary copies of fLO1 and fLO2 so that they
+        * will be unchanged if a spur-free setting is not found.
+        */
+       pAS_Info->bSpurPresent = IsSpurInBand(pAS_Info, &fm, &fp);
+       if (pAS_Info->bSpurPresent) {
+               u32 zfIF1 = pAS_Info->f_LO1 - pAS_Info->f_in;   /*  current attempt at a 1st IF  */
+               u32 zfLO1 = pAS_Info->f_LO1;    /*  current attempt at an LO1 freq  */
+               u32 zfLO2 = pAS_Info->f_LO2;    /*  current attempt at an LO2 freq  */
+               u32 delta_IF1;
+               u32 new_IF1;
+
+               /*
+                **  Spur was found, attempt to find a spur-free 1st IF
+                */
+               do {
+                       pAS_Info->nSpursFound++;
+
+                       /*  Raise f_IF1_upper, if needed  */
+                       MT2063_AddExclZone(pAS_Info, zfIF1 - fm, zfIF1 + fp);
+
+                       /*  Choose next IF1 that is closest to f_IF1_CENTER              */
+                       new_IF1 = MT2063_ChooseFirstIF(pAS_Info);
+
+                       if (new_IF1 > zfIF1) {
+                               pAS_Info->f_LO1 += (new_IF1 - zfIF1);
+                               pAS_Info->f_LO2 += (new_IF1 - zfIF1);
+                       } else {
+                               pAS_Info->f_LO1 -= (zfIF1 - new_IF1);
+                               pAS_Info->f_LO2 -= (zfIF1 - new_IF1);
+                       }
+                       zfIF1 = new_IF1;
+
+                       if (zfIF1 > pAS_Info->f_if1_Center)
+                               delta_IF1 = zfIF1 - pAS_Info->f_if1_Center;
+                       else
+                               delta_IF1 = pAS_Info->f_if1_Center - zfIF1;
+
+                       pAS_Info->bSpurPresent = IsSpurInBand(pAS_Info, &fm, &fp);
+               /*
+                *  Continue while the new 1st IF is still within the 1st IF bandwidth
+                *  and there is a spur in the band (again)
+                */
+               } while ((2 * delta_IF1 + pAS_Info->f_out_bw <= pAS_Info->f_if1_bw) && pAS_Info->bSpurPresent);
+
+               /*
+                * Use the LO-spur free values found.  If the search went all
+                * the way to the 1st IF band edge and always found spurs, just
+                * leave the original choice.  It's as "good" as any other.
+                */
+               if (pAS_Info->bSpurPresent == 1) {
+                       status |= MT2063_SPUR_PRESENT_ERR;
+                       pAS_Info->f_LO1 = zfLO1;
+                       pAS_Info->f_LO2 = zfLO2;
+               } else
+                       pAS_Info->bSpurAvoided = 1;
+       }
+
+       status |=
+           ((pAS_Info->
+             nSpursFound << MT2063_SPUR_SHIFT) & MT2063_SPUR_CNT_MASK);
+
+       return status;
+}
+
+/*
+ * Constants used by the tuning algorithm
+ */
+#define MT2063_REF_FREQ          (16000000UL)  /* Reference oscillator Frequency (in Hz) */
+#define MT2063_IF1_BW            (22000000UL)  /* The IF1 filter bandwidth (in Hz) */
+#define MT2063_TUNE_STEP_SIZE       (50000UL)  /* Tune in steps of 50 kHz */
+#define MT2063_SPUR_STEP_HZ        (250000UL)  /* Step size (in Hz) to move IF1 when avoiding spurs */
+#define MT2063_ZIF_BW             (2000000UL)  /* Zero-IF spur-free bandwidth (in Hz) */
+#define MT2063_MAX_HARMONICS_1         (15UL)  /* Highest intra-tuner LO Spur Harmonic to be avoided */
+#define MT2063_MAX_HARMONICS_2          (5UL)  /* Highest inter-tuner LO Spur Harmonic to be avoided */
+#define MT2063_MIN_LO_SEP         (1000000UL)  /* Minimum inter-tuner LO frequency separation */
+#define MT2063_LO1_FRACN_AVOID          (0UL)  /* LO1 FracN numerator avoid region (in Hz) */
+#define MT2063_LO2_FRACN_AVOID     (199999UL)  /* LO2 FracN numerator avoid region (in Hz) */
+#define MT2063_MIN_FIN_FREQ      (44000000UL)  /* Minimum input frequency (in Hz) */
+#define MT2063_MAX_FIN_FREQ    (1100000000UL)  /* Maximum input frequency (in Hz) */
+#define MT2063_MIN_FOUT_FREQ     (36000000UL)  /* Minimum output frequency (in Hz) */
+#define MT2063_MAX_FOUT_FREQ     (57000000UL)  /* Maximum output frequency (in Hz) */
+#define MT2063_MIN_DNC_FREQ    (1293000000UL)  /* Minimum LO2 frequency (in Hz) */
+#define MT2063_MAX_DNC_FREQ    (1614000000UL)  /* Maximum LO2 frequency (in Hz) */
+#define MT2063_MIN_UPC_FREQ    (1396000000UL)  /* Minimum LO1 frequency (in Hz) */
+#define MT2063_MAX_UPC_FREQ    (2750000000UL)  /* Maximum LO1 frequency (in Hz) */
+
+/*
+ *  Define the supported Part/Rev codes for the MT2063
+ */
+#define MT2063_B0       (0x9B)
+#define MT2063_B1       (0x9C)
+#define MT2063_B2       (0x9D)
+#define MT2063_B3       (0x9E)
+
+/**
+ * mt2063_lockStatus - Checks to see if LO1 and LO2 are locked
+ *
+ * @state:     struct mt2063_state pointer
+ *
+ * This function returns 0, if no lock, 1 if locked and a value < 1 if error
+ */
+static unsigned int mt2063_lockStatus(struct mt2063_state *state)
+{
+       const u32 nMaxWait = 100;       /*  wait a maximum of 100 msec   */
+       const u32 nPollRate = 2;        /*  poll status bits every 2 ms */
+       const u32 nMaxLoops = nMaxWait / nPollRate;
+       const u8 LO1LK = 0x80;
+       u8 LO2LK = 0x08;
+       u32 status;
+       u32 nDelays = 0;
+
+       dprintk(2, "\n");
+
+       /*  LO2 Lock bit was in a different place for B0 version  */
+       if (state->tuner_id == MT2063_B0)
+               LO2LK = 0x40;
+
+       do {
+               status = mt2063_read(state, MT2063_REG_LO_STATUS,
+                                    &state->reg[MT2063_REG_LO_STATUS], 1);
+
+               if (status < 0)
+                       return status;
+
+               if ((state->reg[MT2063_REG_LO_STATUS] & (LO1LK | LO2LK)) ==
+                   (LO1LK | LO2LK)) {
+                       return TUNER_STATUS_LOCKED | TUNER_STATUS_STEREO;
+               }
+               msleep(nPollRate);      /*  Wait between retries  */
+       } while (++nDelays < nMaxLoops);
+
+       /*
+        * Got no lock or partial lock
+        */
+       return 0;
+}
+
+/*
+ *  Constants for setting receiver modes.
+ *  (6 modes defined at this time, enumerated by mt2063_delivery_sys)
+ *  (DNC1GC & DNC2GC are the values, which are used, when the specific
+ *   DNC Output is selected, the other is always off)
+ *
+ *                enum mt2063_delivery_sys
+ * -------------+----------------------------------------------
+ * Mode 0 :     | MT2063_CABLE_QAM
+ * Mode 1 :     | MT2063_CABLE_ANALOG
+ * Mode 2 :     | MT2063_OFFAIR_COFDM
+ * Mode 3 :     | MT2063_OFFAIR_COFDM_SAWLESS
+ * Mode 4 :     | MT2063_OFFAIR_ANALOG
+ * Mode 5 :     | MT2063_OFFAIR_8VSB
+ * --------------+----------------------------------------------
+ *
+ *                |<----------   Mode  -------------->|
+ *    Reg Field   |  0  |  1  |  2  |  3  |  4  |  5  |
+ *    ------------+-----+-----+-----+-----+-----+-----+
+ *    RFAGCen     | OFF | OFF | OFF | OFF | OFF | OFF
+ *    LNARin      |   0 |   0 |   3 |   3 |  3  |  3
+ *    FIFFQen     |   1 |   1 |   1 |   1 |  1  |  1
+ *    FIFFq       |   0 |   0 |   0 |   0 |  0  |  0
+ *    DNC1gc      |   0 |   0 |   0 |   0 |  0  |  0
+ *    DNC2gc      |   0 |   0 |   0 |   0 |  0  |  0
+ *    GCU Auto    |   1 |   1 |   1 |   1 |  1  |  1
+ *    LNA max Atn |  31 |  31 |  31 |  31 | 31  | 31
+ *    LNA Target  |  44 |  43 |  43 |  43 | 43  | 43
+ *    ign  RF Ovl |   0 |   0 |   0 |   0 |  0  |  0
+ *    RF  max Atn |  31 |  31 |  31 |  31 | 31  | 31
+ *    PD1 Target  |  36 |  36 |  38 |  38 | 36  | 38
+ *    ign FIF Ovl |   0 |   0 |   0 |   0 |  0  |  0
+ *    FIF max Atn |   5 |   5 |   5 |   5 |  5  |  5
+ *    PD2 Target  |  40 |  33 |  42 |  42 | 33  | 42
+ */
+
+enum mt2063_delivery_sys {
+       MT2063_CABLE_QAM = 0,
+       MT2063_CABLE_ANALOG,
+       MT2063_OFFAIR_COFDM,
+       MT2063_OFFAIR_COFDM_SAWLESS,
+       MT2063_OFFAIR_ANALOG,
+       MT2063_OFFAIR_8VSB,
+       MT2063_NUM_RCVR_MODES
+};
+
+static const char *mt2063_mode_name[] = {
+       [MT2063_CABLE_QAM]              = "digital cable",
+       [MT2063_CABLE_ANALOG]           = "analog cable",
+       [MT2063_OFFAIR_COFDM]           = "digital offair",
+       [MT2063_OFFAIR_COFDM_SAWLESS]   = "digital offair without SAW",
+       [MT2063_OFFAIR_ANALOG]          = "analog offair",
+       [MT2063_OFFAIR_8VSB]            = "analog offair 8vsb",
+};
+
+static const u8 RFAGCEN[]      = {  0,  0,  0,  0,  0,  0 };
+static const u8 LNARIN[]       = {  0,  0,  3,  3,  3,  3 };
+static const u8 FIFFQEN[]      = {  1,  1,  1,  1,  1,  1 };
+static const u8 FIFFQ[]                = {  0,  0,  0,  0,  0,  0 };
+static const u8 DNC1GC[]       = {  0,  0,  0,  0,  0,  0 };
+static const u8 DNC2GC[]       = {  0,  0,  0,  0,  0,  0 };
+static const u8 ACLNAMAX[]     = { 31, 31, 31, 31, 31, 31 };
+static const u8 LNATGT[]       = { 44, 43, 43, 43, 43, 43 };
+static const u8 RFOVDIS[]      = {  0,  0,  0,  0,  0,  0 };
+static const u8 ACRFMAX[]      = { 31, 31, 31, 31, 31, 31 };
+static const u8 PD1TGT[]       = { 36, 36, 38, 38, 36, 38 };
+static const u8 FIFOVDIS[]     = {  0,  0,  0,  0,  0,  0 };
+static const u8 ACFIFMAX[]     = { 29, 29, 29, 29, 29, 29 };
+static const u8 PD2TGT[]       = { 40, 33, 38, 42, 30, 38 };
+
+/*
+ * mt2063_set_dnc_output_enable()
+ */
+static u32 mt2063_get_dnc_output_enable(struct mt2063_state *state,
+                                       enum MT2063_DNC_Output_Enable *pValue)
+{
+       dprintk(2, "\n");
+
+       if ((state->reg[MT2063_REG_DNC_GAIN] & 0x03) == 0x03) { /* if DNC1 is off */
+               if ((state->reg[MT2063_REG_VGA_GAIN] & 0x03) == 0x03)   /* if DNC2 is off */
+                       *pValue = MT2063_DNC_NONE;
+               else
+                       *pValue = MT2063_DNC_2;
+       } else {        /* DNC1 is on */
+               if ((state->reg[MT2063_REG_VGA_GAIN] & 0x03) == 0x03)   /* if DNC2 is off */
+                       *pValue = MT2063_DNC_1;
+               else
+                       *pValue = MT2063_DNC_BOTH;
+       }
+       return 0;
+}
+
+/*
+ * mt2063_set_dnc_output_enable()
+ */
+static u32 mt2063_set_dnc_output_enable(struct mt2063_state *state,
+                                       enum MT2063_DNC_Output_Enable nValue)
+{
+       u32 status = 0; /* Status to be returned        */
+       u8 val = 0;
+
+       dprintk(2, "\n");
+
+       /* selects, which DNC output is used */
+       switch (nValue) {
+       case MT2063_DNC_NONE:
+               val = (state->reg[MT2063_REG_DNC_GAIN] & 0xFC) | 0x03;  /* Set DNC1GC=3 */
+               if (state->reg[MT2063_REG_DNC_GAIN] !=
+                   val)
+                       status |=
+                           mt2063_setreg(state,
+                                         MT2063_REG_DNC_GAIN,
+                                         val);
+
+               val = (state->reg[MT2063_REG_VGA_GAIN] & 0xFC) | 0x03;  /* Set DNC2GC=3 */
+               if (state->reg[MT2063_REG_VGA_GAIN] !=
+                   val)
+                       status |=
+                           mt2063_setreg(state,
+                                         MT2063_REG_VGA_GAIN,
+                                         val);
+
+               val = (state->reg[MT2063_REG_RSVD_20] & ~0x40); /* Set PD2MUX=0 */
+               if (state->reg[MT2063_REG_RSVD_20] !=
+                   val)
+                       status |=
+                           mt2063_setreg(state,
+                                         MT2063_REG_RSVD_20,
+                                         val);
+
+               break;
+       case MT2063_DNC_1:
+               val = (state->reg[MT2063_REG_DNC_GAIN] & 0xFC) | (DNC1GC[state->rcvr_mode] & 0x03);     /* Set DNC1GC=x */
+               if (state->reg[MT2063_REG_DNC_GAIN] !=
+                   val)
+                       status |=
+                           mt2063_setreg(state,
+                                         MT2063_REG_DNC_GAIN,
+                                         val);
+
+               val = (state->reg[MT2063_REG_VGA_GAIN] & 0xFC) | 0x03;  /* Set DNC2GC=3 */
+               if (state->reg[MT2063_REG_VGA_GAIN] !=
+                   val)
+                       status |=
+                           mt2063_setreg(state,
+                                         MT2063_REG_VGA_GAIN,
+                                         val);
+
+               val = (state->reg[MT2063_REG_RSVD_20] & ~0x40); /* Set PD2MUX=0 */
+               if (state->reg[MT2063_REG_RSVD_20] !=
+                   val)
+                       status |=
+                           mt2063_setreg(state,
+                                         MT2063_REG_RSVD_20,
+                                         val);
+
+               break;
+       case MT2063_DNC_2:
+               val = (state->reg[MT2063_REG_DNC_GAIN] & 0xFC) | 0x03;  /* Set DNC1GC=3 */
+               if (state->reg[MT2063_REG_DNC_GAIN] !=
+                   val)
+                       status |=
+                           mt2063_setreg(state,
+                                         MT2063_REG_DNC_GAIN,
+                                         val);
+
+               val = (state->reg[MT2063_REG_VGA_GAIN] & 0xFC) | (DNC2GC[state->rcvr_mode] & 0x03);     /* Set DNC2GC=x */
+               if (state->reg[MT2063_REG_VGA_GAIN] !=
+                   val)
+                       status |=
+                           mt2063_setreg(state,
+                                         MT2063_REG_VGA_GAIN,
+                                         val);
+
+               val = (state->reg[MT2063_REG_RSVD_20] | 0x40);  /* Set PD2MUX=1 */
+               if (state->reg[MT2063_REG_RSVD_20] !=
+                   val)
+                       status |=
+                           mt2063_setreg(state,
+                                         MT2063_REG_RSVD_20,
+                                         val);
+
+               break;
+       case MT2063_DNC_BOTH:
+               val = (state->reg[MT2063_REG_DNC_GAIN] & 0xFC) | (DNC1GC[state->rcvr_mode] & 0x03);     /* Set DNC1GC=x */
+               if (state->reg[MT2063_REG_DNC_GAIN] !=
+                   val)
+                       status |=
+                           mt2063_setreg(state,
+                                         MT2063_REG_DNC_GAIN,
+                                         val);
+
+               val = (state->reg[MT2063_REG_VGA_GAIN] & 0xFC) | (DNC2GC[state->rcvr_mode] & 0x03);     /* Set DNC2GC=x */
+               if (state->reg[MT2063_REG_VGA_GAIN] !=
+                   val)
+                       status |=
+                           mt2063_setreg(state,
+                                         MT2063_REG_VGA_GAIN,
+                                         val);
+
+               val = (state->reg[MT2063_REG_RSVD_20] | 0x40);  /* Set PD2MUX=1 */
+               if (state->reg[MT2063_REG_RSVD_20] !=
+                   val)
+                       status |=
+                           mt2063_setreg(state,
+                                         MT2063_REG_RSVD_20,
+                                         val);
+
+               break;
+       default:
+               break;
+       }
+
+       return status;
+}
+
+/*
+ * MT2063_SetReceiverMode() - Set the MT2063 receiver mode, according with
+ *                           the selected enum mt2063_delivery_sys type.
+ *
+ *  (DNC1GC & DNC2GC are the values, which are used, when the specific
+ *   DNC Output is selected, the other is always off)
+ *
+ * @state:     ptr to mt2063_state structure
+ * @Mode:      desired reciever delivery system
+ *
+ * Note: Register cache must be valid for it to work
+ */
+
+static u32 MT2063_SetReceiverMode(struct mt2063_state *state,
+                                 enum mt2063_delivery_sys Mode)
+{
+       u32 status = 0; /* Status to be returned        */
+       u8 val;
+       u32 longval;
+
+       dprintk(2, "\n");
+
+       if (Mode >= MT2063_NUM_RCVR_MODES)
+               status = -ERANGE;
+
+       /* RFAGCen */
+       if (status >= 0) {
+               val =
+                   (state->
+                    reg[MT2063_REG_PD1_TGT] & (u8) ~0x40) | (RFAGCEN[Mode]
+                                                                  ? 0x40 :
+                                                                  0x00);
+               if (state->reg[MT2063_REG_PD1_TGT] != val)
+                       status |= mt2063_setreg(state, MT2063_REG_PD1_TGT, val);
+       }
+
+       /* LNARin */
+       if (status >= 0) {
+               u8 val = (state->reg[MT2063_REG_CTRL_2C] & (u8) ~0x03) |
+                        (LNARIN[Mode] & 0x03);
+               if (state->reg[MT2063_REG_CTRL_2C] != val)
+                       status |= mt2063_setreg(state, MT2063_REG_CTRL_2C, val);
+       }
+
+       /* FIFFQEN and FIFFQ */
+       if (status >= 0) {
+               val =
+                   (state->
+                    reg[MT2063_REG_FIFF_CTRL2] & (u8) ~0xF0) |
+                   (FIFFQEN[Mode] << 7) | (FIFFQ[Mode] << 4);
+               if (state->reg[MT2063_REG_FIFF_CTRL2] != val) {
+                       status |=
+                           mt2063_setreg(state, MT2063_REG_FIFF_CTRL2, val);
+                       /* trigger FIFF calibration, needed after changing FIFFQ */
+                       val =
+                           (state->reg[MT2063_REG_FIFF_CTRL] | (u8) 0x01);
+                       status |=
+                           mt2063_setreg(state, MT2063_REG_FIFF_CTRL, val);
+                       val =
+                           (state->
+                            reg[MT2063_REG_FIFF_CTRL] & (u8) ~0x01);
+                       status |=
+                           mt2063_setreg(state, MT2063_REG_FIFF_CTRL, val);
+               }
+       }
+
+       /* DNC1GC & DNC2GC */
+       status |= mt2063_get_dnc_output_enable(state, &longval);
+       status |= mt2063_set_dnc_output_enable(state, longval);
+
+       /* acLNAmax */
+       if (status >= 0) {
+               u8 val = (state->reg[MT2063_REG_LNA_OV] & (u8) ~0x1F) |
+                        (ACLNAMAX[Mode] & 0x1F);
+               if (state->reg[MT2063_REG_LNA_OV] != val)
+                       status |= mt2063_setreg(state, MT2063_REG_LNA_OV, val);
+       }
+
+       /* LNATGT */
+       if (status >= 0) {
+               u8 val = (state->reg[MT2063_REG_LNA_TGT] & (u8) ~0x3F) |
+                        (LNATGT[Mode] & 0x3F);
+               if (state->reg[MT2063_REG_LNA_TGT] != val)
+                       status |= mt2063_setreg(state, MT2063_REG_LNA_TGT, val);
+       }
+
+       /* ACRF */
+       if (status >= 0) {
+               u8 val = (state->reg[MT2063_REG_RF_OV] & (u8) ~0x1F) |
+                        (ACRFMAX[Mode] & 0x1F);
+               if (state->reg[MT2063_REG_RF_OV] != val)
+                       status |= mt2063_setreg(state, MT2063_REG_RF_OV, val);
+       }
+
+       /* PD1TGT */
+       if (status >= 0) {
+               u8 val = (state->reg[MT2063_REG_PD1_TGT] & (u8) ~0x3F) |
+                        (PD1TGT[Mode] & 0x3F);
+               if (state->reg[MT2063_REG_PD1_TGT] != val)
+                       status |= mt2063_setreg(state, MT2063_REG_PD1_TGT, val);
+       }
+
+       /* FIFATN */
+       if (status >= 0) {
+               u8 val = ACFIFMAX[Mode];
+               if (state->reg[MT2063_REG_PART_REV] != MT2063_B3 && val > 5)
+                       val = 5;
+               val = (state->reg[MT2063_REG_FIF_OV] & (u8) ~0x1F) |
+                     (val & 0x1F);
+               if (state->reg[MT2063_REG_FIF_OV] != val)
+                       status |= mt2063_setreg(state, MT2063_REG_FIF_OV, val);
+       }
+
+       /* PD2TGT */
+       if (status >= 0) {
+               u8 val = (state->reg[MT2063_REG_PD2_TGT] & (u8) ~0x3F) |
+                   (PD2TGT[Mode] & 0x3F);
+               if (state->reg[MT2063_REG_PD2_TGT] != val)
+                       status |= mt2063_setreg(state, MT2063_REG_PD2_TGT, val);
+       }
+
+       /* Ignore ATN Overload */
+       if (status >= 0) {
+               val = (state->reg[MT2063_REG_LNA_TGT] & (u8) ~0x80) |
+                     (RFOVDIS[Mode] ? 0x80 : 0x00);
+               if (state->reg[MT2063_REG_LNA_TGT] != val)
+                       status |= mt2063_setreg(state, MT2063_REG_LNA_TGT, val);
+       }
+
+       /* Ignore FIF Overload */
+       if (status >= 0) {
+               val = (state->reg[MT2063_REG_PD1_TGT] & (u8) ~0x80) |
+                     (FIFOVDIS[Mode] ? 0x80 : 0x00);
+               if (state->reg[MT2063_REG_PD1_TGT] != val)
+                       status |= mt2063_setreg(state, MT2063_REG_PD1_TGT, val);
+       }
+
+       if (status >= 0) {
+               state->rcvr_mode = Mode;
+               dprintk(1, "mt2063 mode changed to %s\n",
+                       mt2063_mode_name[state->rcvr_mode]);
+       }
+
+       return status;
+}
+
+/*
+ * MT2063_ClearPowerMaskBits () - Clears the power-down mask bits for various
+ *                               sections of the MT2063
+ *
+ * @Bits:              Mask bits to be cleared.
+ *
+ * See definition of MT2063_Mask_Bits type for description
+ * of each of the power bits.
+ */
+static u32 MT2063_ClearPowerMaskBits(struct mt2063_state *state,
+                                    enum MT2063_Mask_Bits Bits)
+{
+       u32 status = 0;
+
+       dprintk(2, "\n");
+       Bits = (enum MT2063_Mask_Bits)(Bits & MT2063_ALL_SD);   /* Only valid bits for this tuner */
+       if ((Bits & 0xFF00) != 0) {
+               state->reg[MT2063_REG_PWR_2] &= ~(u8) (Bits >> 8);
+               status |=
+                   mt2063_write(state,
+                                   MT2063_REG_PWR_2,
+                                   &state->reg[MT2063_REG_PWR_2], 1);
+       }
+       if ((Bits & 0xFF) != 0) {
+               state->reg[MT2063_REG_PWR_1] &= ~(u8) (Bits & 0xFF);
+               status |=
+                   mt2063_write(state,
+                                   MT2063_REG_PWR_1,
+                                   &state->reg[MT2063_REG_PWR_1], 1);
+       }
+
+       return status;
+}
+
+/*
+ * MT2063_SoftwareShutdown() - Enables or disables software shutdown function.
+ *                            When Shutdown is 1, any section whose power
+ *                            mask is set will be shutdown.
+ */
+static u32 MT2063_SoftwareShutdown(struct mt2063_state *state, u8 Shutdown)
+{
+       u32 status;
+
+       dprintk(2, "\n");
+       if (Shutdown == 1)
+               state->reg[MT2063_REG_PWR_1] |= 0x04;
+       else
+               state->reg[MT2063_REG_PWR_1] &= ~0x04;
+
+       status = mt2063_write(state,
+                           MT2063_REG_PWR_1,
+                           &state->reg[MT2063_REG_PWR_1], 1);
+
+       if (Shutdown != 1) {
+               state->reg[MT2063_REG_BYP_CTRL] =
+                   (state->reg[MT2063_REG_BYP_CTRL] & 0x9F) | 0x40;
+               status |=
+                   mt2063_write(state,
+                                   MT2063_REG_BYP_CTRL,
+                                   &state->reg[MT2063_REG_BYP_CTRL],
+                                   1);
+               state->reg[MT2063_REG_BYP_CTRL] =
+                   (state->reg[MT2063_REG_BYP_CTRL] & 0x9F);
+               status |=
+                   mt2063_write(state,
+                                   MT2063_REG_BYP_CTRL,
+                                   &state->reg[MT2063_REG_BYP_CTRL],
+                                   1);
+       }
+
+       return status;
+}
+
+static u32 MT2063_Round_fLO(u32 f_LO, u32 f_LO_Step, u32 f_ref)
+{
+       return f_ref * (f_LO / f_ref)
+           + f_LO_Step * (((f_LO % f_ref) + (f_LO_Step / 2)) / f_LO_Step);
+}
+
+/**
+ * fLO_FractionalTerm() - Calculates the portion contributed by FracN / denom.
+ *                        This function preserves maximum precision without
+ *                        risk of overflow.  It accurately calculates
+ *                        f_ref * num / denom to within 1 HZ with fixed math.
+ *
+ * @num :      Fractional portion of the multiplier
+ * @denom:     denominator portion of the ratio
+ * @f_Ref:     SRO frequency.
+ *
+ * This calculation handles f_ref as two separate 14-bit fields.
+ * Therefore, a maximum value of 2^28-1 may safely be used for f_ref.
+ * This is the genesis of the magic number "14" and the magic mask value of
+ * 0x03FFF.
+ *
+ * This routine successfully handles denom values up to and including 2^18.
+ *  Returns:        f_ref * num / denom
+ */
+static u32 MT2063_fLO_FractionalTerm(u32 f_ref, u32 num, u32 denom)
+{
+       u32 t1 = (f_ref >> 14) * num;
+       u32 term1 = t1 / denom;
+       u32 loss = t1 % denom;
+       u32 term2 =
+           (((f_ref & 0x00003FFF) * num + (loss << 14)) + (denom / 2)) / denom;
+       return (term1 << 14) + term2;
+}
+
+/*
+ * CalcLO1Mult()- Calculates Integer divider value and the numerator
+ *                value for a FracN PLL.
+ *
+ *                This function assumes that the f_LO and f_Ref are
+ *                evenly divisible by f_LO_Step.
+ *
+ * @Div:       OUTPUT: Whole number portion of the multiplier
+ * @FracN:     OUTPUT: Fractional portion of the multiplier
+ * @f_LO:      desired LO frequency.
+ * @f_LO_Step: Minimum step size for the LO (in Hz).
+ * @f_Ref:     SRO frequency.
+ * @f_Avoid:   Range of PLL frequencies to avoid near integer multiples
+ *             of f_Ref (in Hz).
+ *
+ * Returns:        Recalculated LO frequency.
+ */
+static u32 MT2063_CalcLO1Mult(u32 *Div,
+                             u32 *FracN,
+                             u32 f_LO,
+                             u32 f_LO_Step, u32 f_Ref)
+{
+       /*  Calculate the whole number portion of the divider */
+       *Div = f_LO / f_Ref;
+
+       /*  Calculate the numerator value (round to nearest f_LO_Step) */
+       *FracN =
+           (64 * (((f_LO % f_Ref) + (f_LO_Step / 2)) / f_LO_Step) +
+            (f_Ref / f_LO_Step / 2)) / (f_Ref / f_LO_Step);
+
+       return (f_Ref * (*Div)) + MT2063_fLO_FractionalTerm(f_Ref, *FracN, 64);
+}
+
+/**
+ * CalcLO2Mult() - Calculates Integer divider value and the numerator
+ *                 value for a FracN PLL.
+ *
+ *                  This function assumes that the f_LO and f_Ref are
+ *                  evenly divisible by f_LO_Step.
+ *
+ * @Div:       OUTPUT: Whole number portion of the multiplier
+ * @FracN:     OUTPUT: Fractional portion of the multiplier
+ * @f_LO:      desired LO frequency.
+ * @f_LO_Step: Minimum step size for the LO (in Hz).
+ * @f_Ref:     SRO frequency.
+ * @f_Avoid:   Range of PLL frequencies to avoid near
+ *             integer multiples of f_Ref (in Hz).
+ *
+ * Returns: Recalculated LO frequency.
+ */
+static u32 MT2063_CalcLO2Mult(u32 *Div,
+                             u32 *FracN,
+                             u32 f_LO,
+                             u32 f_LO_Step, u32 f_Ref)
+{
+       /*  Calculate the whole number portion of the divider */
+       *Div = f_LO / f_Ref;
+
+       /*  Calculate the numerator value (round to nearest f_LO_Step) */
+       *FracN =
+           (8191 * (((f_LO % f_Ref) + (f_LO_Step / 2)) / f_LO_Step) +
+            (f_Ref / f_LO_Step / 2)) / (f_Ref / f_LO_Step);
+
+       return (f_Ref * (*Div)) + MT2063_fLO_FractionalTerm(f_Ref, *FracN,
+                                                           8191);
+}
+
+/*
+ * FindClearTuneFilter() - Calculate the corrrect ClearTune filter to be
+ *                        used for a given input frequency.
+ *
+ * @state:     ptr to tuner data structure
+ * @f_in:      RF input center frequency (in Hz).
+ *
+ * Returns: ClearTune filter number (0-31)
+ */
+static u32 FindClearTuneFilter(struct mt2063_state *state, u32 f_in)
+{
+       u32 RFBand;
+       u32 idx;                /*  index loop                      */
+
+       /*
+        **  Find RF Band setting
+        */
+       RFBand = 31;            /*  def when f_in > all    */
+       for (idx = 0; idx < 31; ++idx) {
+               if (state->CTFiltMax[idx] >= f_in) {
+                       RFBand = idx;
+                       break;
+               }
+       }
+       return RFBand;
+}
+
+/*
+ * MT2063_Tune() - Change the tuner's tuned frequency to RFin.
+ */
+static u32 MT2063_Tune(struct mt2063_state *state, u32 f_in)
+{                              /* RF input center frequency   */
+
+       u32 status = 0;
+       u32 LO1;                /*  1st LO register value           */
+       u32 Num1;               /*  Numerator for LO1 reg. value    */
+       u32 f_IF1;              /*  1st IF requested                */
+       u32 LO2;                /*  2nd LO register value           */
+       u32 Num2;               /*  Numerator for LO2 reg. value    */
+       u32 ofLO1, ofLO2;       /*  last time's LO frequencies      */
+       u8 fiffc = 0x80;        /*  FIFF center freq from tuner     */
+       u32 fiffof;             /*  Offset from FIFF center freq    */
+       const u8 LO1LK = 0x80;  /*  Mask for LO1 Lock bit           */
+       u8 LO2LK = 0x08;        /*  Mask for LO2 Lock bit           */
+       u8 val;
+       u32 RFBand;
+
+       dprintk(2, "\n");
+       /*  Check the input and output frequency ranges                   */
+       if ((f_in < MT2063_MIN_FIN_FREQ) || (f_in > MT2063_MAX_FIN_FREQ))
+               return -EINVAL;
+
+       if ((state->AS_Data.f_out < MT2063_MIN_FOUT_FREQ)
+           || (state->AS_Data.f_out > MT2063_MAX_FOUT_FREQ))
+               return -EINVAL;
+
+       /*
+        * Save original LO1 and LO2 register values
+        */
+       ofLO1 = state->AS_Data.f_LO1;
+       ofLO2 = state->AS_Data.f_LO2; 
+
+       /*
+        * Find and set RF Band setting
+        */
+       if (state->ctfilt_sw == 1) {
+               val = (state->reg[MT2063_REG_CTUNE_CTRL] | 0x08);
+               if (state->reg[MT2063_REG_CTUNE_CTRL] != val) {
+                       status |=
+                           mt2063_setreg(state, MT2063_REG_CTUNE_CTRL, val);
+               }
+               val = state->reg[MT2063_REG_CTUNE_OV];
+               RFBand = FindClearTuneFilter(state, f_in);
+               state->reg[MT2063_REG_CTUNE_OV] =
+                   (u8) ((state->reg[MT2063_REG_CTUNE_OV] & ~0x1F)
+                             | RFBand);
+               if (state->reg[MT2063_REG_CTUNE_OV] != val) {
+                       status |=
+                           mt2063_setreg(state, MT2063_REG_CTUNE_OV, val);
+               }
+       }
+
+       /*
+        * Read the FIFF Center Frequency from the tuner
+        */
+       if (status >= 0) {
+               status |=
+                   mt2063_read(state,
+                                  MT2063_REG_FIFFC,
+                                  &state->reg[MT2063_REG_FIFFC], 1);
+               fiffc = state->reg[MT2063_REG_FIFFC];
+       }
+       /*
+        * Assign in the requested values
+        */
+       state->AS_Data.f_in = f_in;
+       /*  Request a 1st IF such that LO1 is on a step size */
+       state->AS_Data.f_if1_Request =
+           MT2063_Round_fLO(state->AS_Data.f_if1_Request + f_in,
+                            state->AS_Data.f_LO1_Step,
+                            state->AS_Data.f_ref) - f_in;
+
+       /*
+        * Calculate frequency settings.  f_IF1_FREQ + f_in is the
+        * desired LO1 frequency
+        */
+       MT2063_ResetExc