Commit 6a5df38f authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6

* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6: (116 commits)
  V4L/DVB (13698): pms: replace asm/uaccess.h to linux/uaccess.h
  V4L/DVB (13690): radio/si470x: #include <sched.h>
  V4L/DVB (13688): au8522: modify the attributes of local filter coefficients
  V4L/DVB (13687): cx231xx: use NULL when pointer is needed
  V4L/DVB: Davinci VPFE Capture: remove unused #include <linux/version.h>
  V4L/DVB (13685): Correct code taking the size of a pointer
  V4L/DVB (13684): Fix some cut-and-paste noise in dib0090.h
  V4L/DVB (13683): sanio-ms: clean up init, exit and id_table
  V4L/DVB (13682): dib8000: make some constant static
  V4L/DVB: lgs8gxx: Use shifts rather than multiply/divide when possible
  V4L/DVB (13680b): DocBook/media: create links for included sources
  V4L/DVB (13680a): DocBook/media: copy images after building HTML
  V4L/DVB (13678): Add support for yet another DvbWorld, TeVii and Prof USB devices
  V4L/DVB (13676): configurable IRQ mode on NetUP Dual DVB-S2 CI; IRQ from CAM processing (CI interface works faster)
  V4L/DVB (13674): stv090x: Add DiSEqC envelope mode
  V4L/DVB (13673): lnbp21: Implement 22 kHz tone control
  V4L/DVB (13671): sh_mobile_ceu_camera: Remove frame size page alignment
  V4L/DVB (13670): soc-camera: Add mt9t112 camera driver
  V4L/DVB (13669): tw9910: Add sync polarity support
  V4L/DVB (13668): tw9910: remove cropping
  ...
parents 9cfc8624 262ab9ac
...@@ -32,10 +32,10 @@ PS_METHOD = $(prefer-db2x) ...@@ -32,10 +32,10 @@ PS_METHOD = $(prefer-db2x)
### ###
# The targets that may be used. # The targets that may be used.
PHONY += xmldocs sgmldocs psdocs pdfdocs htmldocs mandocs installmandocs cleandocs media PHONY += xmldocs sgmldocs psdocs pdfdocs htmldocs mandocs installmandocs cleandocs xmldoclinks
BOOKS := $(addprefix $(obj)/,$(DOCBOOKS)) BOOKS := $(addprefix $(obj)/,$(DOCBOOKS))
xmldocs: $(BOOKS) xmldocs: $(BOOKS) xmldoclinks
sgmldocs: xmldocs sgmldocs: xmldocs
PS := $(patsubst %.xml, %.ps, $(BOOKS)) PS := $(patsubst %.xml, %.ps, $(BOOKS))
...@@ -45,15 +45,24 @@ PDF := $(patsubst %.xml, %.pdf, $(BOOKS)) ...@@ -45,15 +45,24 @@ PDF := $(patsubst %.xml, %.pdf, $(BOOKS))
pdfdocs: $(PDF) pdfdocs: $(PDF)
HTML := $(sort $(patsubst %.xml, %.html, $(BOOKS))) HTML := $(sort $(patsubst %.xml, %.html, $(BOOKS)))
htmldocs: media $(HTML) htmldocs: $(HTML)
$(call build_main_index) $(call build_main_index)
$(call build_images)
MAN := $(patsubst %.xml, %.9, $(BOOKS)) MAN := $(patsubst %.xml, %.9, $(BOOKS))
mandocs: $(MAN) mandocs: $(MAN)
media: build_images = mkdir -p $(objtree)/Documentation/DocBook/media/ && \
mkdir -p $(srctree)/Documentation/DocBook/media/ cp $(srctree)/Documentation/DocBook/dvb/*.png $(srctree)/Documentation/DocBook/v4l/*.gif $(objtree)/Documentation/DocBook/media/
cp $(srctree)/Documentation/DocBook/dvb/*.png $(srctree)/Documentation/DocBook/v4l/*.gif $(srctree)/Documentation/DocBook/media/
xmldoclinks:
ifneq ($(objtree),$(srctree))
for dep in dvb media-entities.tmpl media-indices.tmpl v4l; do \
rm -f $(objtree)/Documentation/DocBook/$$dep \
&& ln -s $(srctree)/Documentation/DocBook/$$dep $(objtree)/Documentation/DocBook/ \
|| exit; \
done
endif
installmandocs: mandocs installmandocs: mandocs
mkdir -p /usr/local/man/man9/ mkdir -p /usr/local/man/man9/
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
<!ENTITY VIDIOC-ENUMINPUT "<link linkend='vidioc-enuminput'><constant>VIDIOC_ENUMINPUT</constant></link>"> <!ENTITY VIDIOC-ENUMINPUT "<link linkend='vidioc-enuminput'><constant>VIDIOC_ENUMINPUT</constant></link>">
<!ENTITY VIDIOC-ENUMOUTPUT "<link linkend='vidioc-enumoutput'><constant>VIDIOC_ENUMOUTPUT</constant></link>"> <!ENTITY VIDIOC-ENUMOUTPUT "<link linkend='vidioc-enumoutput'><constant>VIDIOC_ENUMOUTPUT</constant></link>">
<!ENTITY VIDIOC-ENUMSTD "<link linkend='vidioc-enumstd'><constant>VIDIOC_ENUMSTD</constant></link>"> <!ENTITY VIDIOC-ENUMSTD "<link linkend='vidioc-enumstd'><constant>VIDIOC_ENUMSTD</constant></link>">
<!ENTITY VIDIOC-ENUM-DV-PRESETS "<link linkend='vidioc-enum-dv-presets'><constant>VIDIOC_ENUM_DV_PRESETS</constant></link>">
<!ENTITY VIDIOC-ENUM-FMT "<link linkend='vidioc-enum-fmt'><constant>VIDIOC_ENUM_FMT</constant></link>"> <!ENTITY VIDIOC-ENUM-FMT "<link linkend='vidioc-enum-fmt'><constant>VIDIOC_ENUM_FMT</constant></link>">
<!ENTITY VIDIOC-ENUM-FRAMEINTERVALS "<link linkend='vidioc-enum-frameintervals'><constant>VIDIOC_ENUM_FRAMEINTERVALS</constant></link>"> <!ENTITY VIDIOC-ENUM-FRAMEINTERVALS "<link linkend='vidioc-enum-frameintervals'><constant>VIDIOC_ENUM_FRAMEINTERVALS</constant></link>">
<!ENTITY VIDIOC-ENUM-FRAMESIZES "<link linkend='vidioc-enum-framesizes'><constant>VIDIOC_ENUM_FRAMESIZES</constant></link>"> <!ENTITY VIDIOC-ENUM-FRAMESIZES "<link linkend='vidioc-enum-framesizes'><constant>VIDIOC_ENUM_FRAMESIZES</constant></link>">
...@@ -30,6 +31,8 @@ ...@@ -30,6 +31,8 @@
<!ENTITY VIDIOC-G-AUDOUT "<link linkend='vidioc-g-audioout'><constant>VIDIOC_G_AUDOUT</constant></link>"> <!ENTITY VIDIOC-G-AUDOUT "<link linkend='vidioc-g-audioout'><constant>VIDIOC_G_AUDOUT</constant></link>">
<!ENTITY VIDIOC-G-CROP "<link linkend='vidioc-g-crop'><constant>VIDIOC_G_CROP</constant></link>"> <!ENTITY VIDIOC-G-CROP "<link linkend='vidioc-g-crop'><constant>VIDIOC_G_CROP</constant></link>">
<!ENTITY VIDIOC-G-CTRL "<link linkend='vidioc-g-ctrl'><constant>VIDIOC_G_CTRL</constant></link>"> <!ENTITY VIDIOC-G-CTRL "<link linkend='vidioc-g-ctrl'><constant>VIDIOC_G_CTRL</constant></link>">
<!ENTITY VIDIOC-G-DV-PRESET "<link linkend='vidioc-g-dv-preset'><constant>VIDIOC_G_DV_PRESET</constant></link>">
<!ENTITY VIDIOC-G-DV-TIMINGS "<link linkend='vidioc-g-dv-timings'><constant>VIDIOC_G_DV_TIMINGS</constant></link>">
<!ENTITY VIDIOC-G-ENC-INDEX "<link linkend='vidioc-g-enc-index'><constant>VIDIOC_G_ENC_INDEX</constant></link>"> <!ENTITY VIDIOC-G-ENC-INDEX "<link linkend='vidioc-g-enc-index'><constant>VIDIOC_G_ENC_INDEX</constant></link>">
<!ENTITY VIDIOC-G-EXT-CTRLS "<link linkend='vidioc-g-ext-ctrls'><constant>VIDIOC_G_EXT_CTRLS</constant></link>"> <!ENTITY VIDIOC-G-EXT-CTRLS "<link linkend='vidioc-g-ext-ctrls'><constant>VIDIOC_G_EXT_CTRLS</constant></link>">
<!ENTITY VIDIOC-G-FBUF "<link linkend='vidioc-g-fbuf'><constant>VIDIOC_G_FBUF</constant></link>"> <!ENTITY VIDIOC-G-FBUF "<link linkend='vidioc-g-fbuf'><constant>VIDIOC_G_FBUF</constant></link>">
...@@ -53,6 +56,7 @@ ...@@ -53,6 +56,7 @@
<!ENTITY VIDIOC-QUERYCTRL "<link linkend='vidioc-queryctrl'><constant>VIDIOC_QUERYCTRL</constant></link>"> <!ENTITY VIDIOC-QUERYCTRL "<link linkend='vidioc-queryctrl'><constant>VIDIOC_QUERYCTRL</constant></link>">
<!ENTITY VIDIOC-QUERYMENU "<link linkend='vidioc-queryctrl'><constant>VIDIOC_QUERYMENU</constant></link>"> <!ENTITY VIDIOC-QUERYMENU "<link linkend='vidioc-queryctrl'><constant>VIDIOC_QUERYMENU</constant></link>">
<!ENTITY VIDIOC-QUERYSTD "<link linkend='vidioc-querystd'><constant>VIDIOC_QUERYSTD</constant></link>"> <!ENTITY VIDIOC-QUERYSTD "<link linkend='vidioc-querystd'><constant>VIDIOC_QUERYSTD</constant></link>">
<!ENTITY VIDIOC-QUERY-DV-PRESET "<link linkend='vidioc-query-dv-preset'><constant>VIDIOC_QUERY_DV_PRESET</constant></link>">
<!ENTITY VIDIOC-REQBUFS "<link linkend='vidioc-reqbufs'><constant>VIDIOC_REQBUFS</constant></link>"> <!ENTITY VIDIOC-REQBUFS "<link linkend='vidioc-reqbufs'><constant>VIDIOC_REQBUFS</constant></link>">
<!ENTITY VIDIOC-STREAMOFF "<link linkend='vidioc-streamon'><constant>VIDIOC_STREAMOFF</constant></link>"> <!ENTITY VIDIOC-STREAMOFF "<link linkend='vidioc-streamon'><constant>VIDIOC_STREAMOFF</constant></link>">
<!ENTITY VIDIOC-STREAMON "<link linkend='vidioc-streamon'><constant>VIDIOC_STREAMON</constant></link>"> <!ENTITY VIDIOC-STREAMON "<link linkend='vidioc-streamon'><constant>VIDIOC_STREAMON</constant></link>">
...@@ -60,6 +64,8 @@ ...@@ -60,6 +64,8 @@
<!ENTITY VIDIOC-S-AUDOUT "<link linkend='vidioc-g-audioout'><constant>VIDIOC_S_AUDOUT</constant></link>"> <!ENTITY VIDIOC-S-AUDOUT "<link linkend='vidioc-g-audioout'><constant>VIDIOC_S_AUDOUT</constant></link>">
<!ENTITY VIDIOC-S-CROP "<link linkend='vidioc-g-crop'><constant>VIDIOC_S_CROP</constant></link>"> <!ENTITY VIDIOC-S-CROP "<link linkend='vidioc-g-crop'><constant>VIDIOC_S_CROP</constant></link>">
<!ENTITY VIDIOC-S-CTRL "<link linkend='vidioc-g-ctrl'><constant>VIDIOC_S_CTRL</constant></link>"> <!ENTITY VIDIOC-S-CTRL "<link linkend='vidioc-g-ctrl'><constant>VIDIOC_S_CTRL</constant></link>">
<!ENTITY VIDIOC-S-DV-PRESET "<link linkend='vidioc-g-dv-preset'><constant>VIDIOC_S_DV_PRESET</constant></link>">
<!ENTITY VIDIOC-S-DV-TIMINGS "<link linkend='vidioc-g-dv-timings'><constant>VIDIOC_S_DV_TIMINGS</constant></link>">
<!ENTITY VIDIOC-S-EXT-CTRLS "<link linkend='vidioc-g-ext-ctrls'><constant>VIDIOC_S_EXT_CTRLS</constant></link>"> <!ENTITY VIDIOC-S-EXT-CTRLS "<link linkend='vidioc-g-ext-ctrls'><constant>VIDIOC_S_EXT_CTRLS</constant></link>">
<!ENTITY VIDIOC-S-FBUF "<link linkend='vidioc-g-fbuf'><constant>VIDIOC_S_FBUF</constant></link>"> <!ENTITY VIDIOC-S-FBUF "<link linkend='vidioc-g-fbuf'><constant>VIDIOC_S_FBUF</constant></link>">
<!ENTITY VIDIOC-S-FMT "<link linkend='vidioc-g-fmt'><constant>VIDIOC_S_FMT</constant></link>"> <!ENTITY VIDIOC-S-FMT "<link linkend='vidioc-g-fmt'><constant>VIDIOC_S_FMT</constant></link>">
...@@ -118,6 +124,7 @@ ...@@ -118,6 +124,7 @@
<!-- Structures --> <!-- Structures -->
<!ENTITY v4l2-audio "struct&nbsp;<link linkend='v4l2-audio'>v4l2_audio</link>"> <!ENTITY v4l2-audio "struct&nbsp;<link linkend='v4l2-audio'>v4l2_audio</link>">
<!ENTITY v4l2-audioout "struct&nbsp;<link linkend='v4l2-audioout'>v4l2_audioout</link>"> <!ENTITY v4l2-audioout "struct&nbsp;<link linkend='v4l2-audioout'>v4l2_audioout</link>">
<!ENTITY v4l2-bt-timings "struct&nbsp;<link linkend='v4l2-bt-timings'>v4l2_bt_timings</link>">
<!ENTITY v4l2-buffer "struct&nbsp;<link linkend='v4l2-buffer'>v4l2_buffer</link>"> <!ENTITY v4l2-buffer "struct&nbsp;<link linkend='v4l2-buffer'>v4l2_buffer</link>">
<!ENTITY v4l2-capability "struct&nbsp;<link linkend='v4l2-capability'>v4l2_capability</link>"> <!ENTITY v4l2-capability "struct&nbsp;<link linkend='v4l2-capability'>v4l2_capability</link>">
<!ENTITY v4l2-captureparm "struct&nbsp;<link linkend='v4l2-captureparm'>v4l2_captureparm</link>"> <!ENTITY v4l2-captureparm "struct&nbsp;<link linkend='v4l2-captureparm'>v4l2_captureparm</link>">
...@@ -128,6 +135,9 @@ ...@@ -128,6 +135,9 @@
<!ENTITY v4l2-dbg-chip-ident "struct&nbsp;<link linkend='v4l2-dbg-chip-ident'>v4l2_dbg_chip_ident</link>"> <!ENTITY v4l2-dbg-chip-ident "struct&nbsp;<link linkend='v4l2-dbg-chip-ident'>v4l2_dbg_chip_ident</link>">
<!ENTITY v4l2-dbg-match "struct&nbsp;<link linkend='v4l2-dbg-match'>v4l2_dbg_match</link>"> <!ENTITY v4l2-dbg-match "struct&nbsp;<link linkend='v4l2-dbg-match'>v4l2_dbg_match</link>">
<!ENTITY v4l2-dbg-register "struct&nbsp;<link linkend='v4l2-dbg-register'>v4l2_dbg_register</link>"> <!ENTITY v4l2-dbg-register "struct&nbsp;<link linkend='v4l2-dbg-register'>v4l2_dbg_register</link>">
<!ENTITY v4l2-dv-enum-preset "struct&nbsp;<link linkend='v4l2-dv-enum-preset'>v4l2_dv_enum_preset</link>">
<!ENTITY v4l2-dv-preset "struct&nbsp;<link linkend='v4l2-dv-preset'>v4l2_dv_preset</link>">
<!ENTITY v4l2-dv-timings "struct&nbsp;<link linkend='v4l2-dv-timings'>v4l2_dv_timings</link>">
<!ENTITY v4l2-enc-idx "struct&nbsp;<link linkend='v4l2-enc-idx'>v4l2_enc_idx</link>"> <!ENTITY v4l2-enc-idx "struct&nbsp;<link linkend='v4l2-enc-idx'>v4l2_enc_idx</link>">
<!ENTITY v4l2-enc-idx-entry "struct&nbsp;<link linkend='v4l2-enc-idx-entry'>v4l2_enc_idx_entry</link>"> <!ENTITY v4l2-enc-idx-entry "struct&nbsp;<link linkend='v4l2-enc-idx-entry'>v4l2_enc_idx_entry</link>">
<!ENTITY v4l2-encoder-cmd "struct&nbsp;<link linkend='v4l2-encoder-cmd'>v4l2_encoder_cmd</link>"> <!ENTITY v4l2-encoder-cmd "struct&nbsp;<link linkend='v4l2-encoder-cmd'>v4l2_encoder_cmd</link>">
...@@ -243,6 +253,10 @@ ...@@ -243,6 +253,10 @@
<!ENTITY sub-enumaudioout SYSTEM "v4l/vidioc-enumaudioout.xml"> <!ENTITY sub-enumaudioout SYSTEM "v4l/vidioc-enumaudioout.xml">
<!ENTITY sub-enuminput SYSTEM "v4l/vidioc-enuminput.xml"> <!ENTITY sub-enuminput SYSTEM "v4l/vidioc-enuminput.xml">
<!ENTITY sub-enumoutput SYSTEM "v4l/vidioc-enumoutput.xml"> <!ENTITY sub-enumoutput SYSTEM "v4l/vidioc-enumoutput.xml">
<!ENTITY sub-enum-dv-presets SYSTEM "v4l/vidioc-enum-dv-presets.xml">
<!ENTITY sub-g-dv-preset SYSTEM "v4l/vidioc-g-dv-preset.xml">
<!ENTITY sub-query-dv-preset SYSTEM "v4l/vidioc-query-dv-preset.xml">
<!ENTITY sub-g-dv-timings SYSTEM "v4l/vidioc-g-dv-timings.xml">
<!ENTITY sub-enumstd SYSTEM "v4l/vidioc-enumstd.xml"> <!ENTITY sub-enumstd SYSTEM "v4l/vidioc-enumstd.xml">
<!ENTITY sub-g-audio SYSTEM "v4l/vidioc-g-audio.xml"> <!ENTITY sub-g-audio SYSTEM "v4l/vidioc-g-audio.xml">
<!ENTITY sub-g-audioout SYSTEM "v4l/vidioc-g-audioout.xml"> <!ENTITY sub-g-audioout SYSTEM "v4l/vidioc-g-audioout.xml">
...@@ -333,6 +347,10 @@ ...@@ -333,6 +347,10 @@
<!ENTITY enumaudioout SYSTEM "v4l/vidioc-enumaudioout.xml"> <!ENTITY enumaudioout SYSTEM "v4l/vidioc-enumaudioout.xml">
<!ENTITY enuminput SYSTEM "v4l/vidioc-enuminput.xml"> <!ENTITY enuminput SYSTEM "v4l/vidioc-enuminput.xml">
<!ENTITY enumoutput SYSTEM "v4l/vidioc-enumoutput.xml"> <!ENTITY enumoutput SYSTEM "v4l/vidioc-enumoutput.xml">
<!ENTITY enum-dv-presets SYSTEM "v4l/vidioc-enum-dv-presets.xml">
<!ENTITY g-dv-preset SYSTEM "v4l/vidioc-g-dv-preset.xml">
<!ENTITY query-dv-preset SYSTEM "v4l/vidioc-query-dv-preset.xml">
<!ENTITY g-dv-timings SYSTEM "v4l/vidioc-g-dv-timings.xml">
<!ENTITY enumstd SYSTEM "v4l/vidioc-enumstd.xml"> <!ENTITY enumstd SYSTEM "v4l/vidioc-enumstd.xml">
<!ENTITY g-audio SYSTEM "v4l/vidioc-g-audio.xml"> <!ENTITY g-audio SYSTEM "v4l/vidioc-g-audio.xml">
<!ENTITY g-audioout SYSTEM "v4l/vidioc-g-audioout.xml"> <!ENTITY g-audioout SYSTEM "v4l/vidioc-g-audioout.xml">
......
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
<indexentry><primaryie>enum&nbsp;<link linkend='v4l2-preemphasis'>v4l2_preemphasis</link></primaryie></indexentry> <indexentry><primaryie>enum&nbsp;<link linkend='v4l2-preemphasis'>v4l2_preemphasis</link></primaryie></indexentry>
<indexentry><primaryie>struct&nbsp;<link linkend='v4l2-audio'>v4l2_audio</link></primaryie></indexentry> <indexentry><primaryie>struct&nbsp;<link linkend='v4l2-audio'>v4l2_audio</link></primaryie></indexentry>
<indexentry><primaryie>struct&nbsp;<link linkend='v4l2-audioout'>v4l2_audioout</link></primaryie></indexentry> <indexentry><primaryie>struct&nbsp;<link linkend='v4l2-audioout'>v4l2_audioout</link></primaryie></indexentry>
<indexentry><primaryie>struct&nbsp;<link linkend='v4l2-bt-timings'>v4l2_bt_timings</link></primaryie></indexentry>
<indexentry><primaryie>struct&nbsp;<link linkend='v4l2-buffer'>v4l2_buffer</link></primaryie></indexentry> <indexentry><primaryie>struct&nbsp;<link linkend='v4l2-buffer'>v4l2_buffer</link></primaryie></indexentry>
<indexentry><primaryie>struct&nbsp;<link linkend='v4l2-capability'>v4l2_capability</link></primaryie></indexentry> <indexentry><primaryie>struct&nbsp;<link linkend='v4l2-capability'>v4l2_capability</link></primaryie></indexentry>
<indexentry><primaryie>struct&nbsp;<link linkend='v4l2-captureparm'>v4l2_captureparm</link></primaryie></indexentry> <indexentry><primaryie>struct&nbsp;<link linkend='v4l2-captureparm'>v4l2_captureparm</link></primaryie></indexentry>
...@@ -46,6 +47,9 @@ ...@@ -46,6 +47,9 @@
<indexentry><primaryie>struct&nbsp;<link linkend='v4l2-dbg-chip-ident'>v4l2_dbg_chip_ident</link></primaryie></indexentry> <indexentry><primaryie>struct&nbsp;<link linkend='v4l2-dbg-chip-ident'>v4l2_dbg_chip_ident</link></primaryie></indexentry>
<indexentry><primaryie>struct&nbsp;<link linkend='v4l2-dbg-match'>v4l2_dbg_match</link></primaryie></indexentry> <indexentry><primaryie>struct&nbsp;<link linkend='v4l2-dbg-match'>v4l2_dbg_match</link></primaryie></indexentry>
<indexentry><primaryie>struct&nbsp;<link linkend='v4l2-dbg-register'>v4l2_dbg_register</link></primaryie></indexentry> <indexentry><primaryie>struct&nbsp;<link linkend='v4l2-dbg-register'>v4l2_dbg_register</link></primaryie></indexentry>
<indexentry><primaryie>struct&nbsp;<link linkend='v4l2-dv-enum-preset'>v4l2_dv_enum_preset</link></primaryie></indexentry>
<indexentry><primaryie>struct&nbsp;<link linkend='v4l2-dv-preset'>v4l2_dv_preset</link></primaryie></indexentry>
<indexentry><primaryie>struct&nbsp;<link linkend='v4l2-dv-timings'>v4l2_dv_timings</link></primaryie></indexentry>
<indexentry><primaryie>struct&nbsp;<link linkend='v4l2-enc-idx'>v4l2_enc_idx</link></primaryie></indexentry> <indexentry><primaryie>struct&nbsp;<link linkend='v4l2-enc-idx'>v4l2_enc_idx</link></primaryie></indexentry>
<indexentry><primaryie>struct&nbsp;<link linkend='v4l2-enc-idx-entry'>v4l2_enc_idx_entry</link></primaryie></indexentry> <indexentry><primaryie>struct&nbsp;<link linkend='v4l2-enc-idx-entry'>v4l2_enc_idx_entry</link></primaryie></indexentry>
<indexentry><primaryie>struct&nbsp;<link linkend='v4l2-encoder-cmd'>v4l2_encoder_cmd</link></primaryie></indexentry> <indexentry><primaryie>struct&nbsp;<link linkend='v4l2-encoder-cmd'>v4l2_encoder_cmd</link></primaryie></indexentry>
......
...@@ -716,6 +716,41 @@ if (-1 == ioctl (fd, &VIDIOC-S-STD;, &amp;std_id)) { ...@@ -716,6 +716,41 @@ if (-1 == ioctl (fd, &VIDIOC-S-STD;, &amp;std_id)) {
} }
</programlisting> </programlisting>
</example> </example>
<section id="dv-timings">
<title>Digital Video (DV) Timings</title>
<para>
The video standards discussed so far has been dealing with Analog TV and the
corresponding video timings. Today there are many more different hardware interfaces
such as High Definition TV interfaces (HDMI), VGA, DVI connectors etc., that carry
video signals and there is a need to extend the API to select the video timings
for these interfaces. Since it is not possible to extend the &v4l2-std-id; due to
the limited bits available, a new set of IOCTLs is added to set/get video timings at
the input and output: </para><itemizedlist>
<listitem>
<para>DV Presets: Digital Video (DV) presets. These are IDs representing a
video timing at the input/output. Presets are pre-defined timings implemented
by the hardware according to video standards. A __u32 data type is used to represent
a preset unlike the bit mask that is used in &v4l2-std-id; allowing future extensions
to support as many different presets as needed.</para>
</listitem>
<listitem>
<para>Custom DV Timings: This will allow applications to define more detailed
custom video timings for the interface. This includes parameters such as width, height,
polarities, frontporch, backporch etc.
</para>
</listitem>
</itemizedlist>
<para>To enumerate and query the attributes of DV presets supported by a device,
applications use the &VIDIOC-ENUM-DV-PRESETS; ioctl. To get the current DV preset,
applications use the &VIDIOC-G-DV-PRESET; ioctl and to set a preset they use the
&VIDIOC-S-DV-PRESET; ioctl.</para>
<para>To set custom DV timings for the device, applications use the
&VIDIOC-S-DV-TIMINGS; ioctl and to get current custom DV timings they use the
&VIDIOC-G-DV-TIMINGS; ioctl.</para>
<para>Applications can make use of the <xref linkend="input-capabilities" /> and
<xref linkend="output-capabilities"/> flags to decide what ioctls are available to set the
video timings for the device.</para>
</section>
</section> </section>
&sub-controls; &sub-controls;
......
...@@ -2324,6 +2324,14 @@ more information.</para> ...@@ -2324,6 +2324,14 @@ more information.</para>
</listitem> </listitem>
</orderedlist> </orderedlist>
</section> </section>
<section>
<title>V4L2 in Linux 2.6.33</title>
<orderedlist>
<listitem>
<para>Added support for Digital Video timings in order to support HDTV receivers and transmitters.</para>
</listitem>
</orderedlist>
</section>
</section> </section>
<section id="other"> <section id="other">
......
...@@ -74,6 +74,17 @@ Remote Controller chapter.</contrib> ...@@ -74,6 +74,17 @@ Remote Controller chapter.</contrib>
</address> </address>
</affiliation> </affiliation>
</author> </author>
<author>
<firstname>Muralidharan</firstname>
<surname>Karicheri</surname>
<contrib>Documented the Digital Video timings API.</contrib>
<affiliation>
<address>
<email>m-karicheri2@ti.com</email>
</address>
</affiliation>
</author>
</authorgroup> </authorgroup>
<copyright> <copyright>
...@@ -89,7 +100,7 @@ Remote Controller chapter.</contrib> ...@@ -89,7 +100,7 @@ Remote Controller chapter.</contrib>
<year>2008</year> <year>2008</year>
<year>2009</year> <year>2009</year>
<holder>Bill Dirks, Michael H. Schimek, Hans Verkuil, Martin <holder>Bill Dirks, Michael H. Schimek, Hans Verkuil, Martin
Rubli, Andy Walls, Mauro Carvalho Chehab</holder> Rubli, Andy Walls, Muralidharan Karicheri, Mauro Carvalho Chehab</holder>
</copyright> </copyright>
<legalnotice> <legalnotice>
<para>Except when explicitly stated as GPL, programming examples within <para>Except when explicitly stated as GPL, programming examples within
...@@ -102,6 +113,13 @@ structs, ioctls) must be noted in more detail in the history chapter ...@@ -102,6 +113,13 @@ structs, ioctls) must be noted in more detail in the history chapter
(compat.sgml), along with the possible impact on existing drivers and (compat.sgml), along with the possible impact on existing drivers and
applications. --> applications. -->
<revision>
<revnumber>2.6.33</revnumber>
<date>2009-12-03</date>
<authorinitials>mk</authorinitials>
<revremark>Added documentation for the Digital Video timings API.</revremark>
</revision>
<revision> <revision>
<revnumber>2.6.32</revnumber> <revnumber>2.6.32</revnumber>
<date>2009-08-31</date> <date>2009-08-31</date>
...@@ -355,7 +373,7 @@ and discussions on the V4L mailing list.</revremark> ...@@ -355,7 +373,7 @@ and discussions on the V4L mailing list.</revremark>
</partinfo> </partinfo>
<title>Video for Linux Two API Specification</title> <title>Video for Linux Two API Specification</title>
<subtitle>Revision 2.6.32</subtitle> <subtitle>Revision 2.6.33</subtitle>
<chapter id="common"> <chapter id="common">
&sub-common; &sub-common;
...@@ -411,6 +429,7 @@ and discussions on the V4L mailing list.</revremark> ...@@ -411,6 +429,7 @@ and discussions on the V4L mailing list.</revremark>
&sub-encoder-cmd; &sub-encoder-cmd;
&sub-enumaudio; &sub-enumaudio;
&sub-enumaudioout; &sub-enumaudioout;
&sub-enum-dv-presets;
&sub-enum-fmt; &sub-enum-fmt;
&sub-enum-framesizes; &sub-enum-framesizes;
&sub-enum-frameintervals; &sub-enum-frameintervals;
...@@ -421,6 +440,8 @@ and discussions on the V4L mailing list.</revremark> ...@@ -421,6 +440,8 @@ and discussions on the V4L mailing list.</revremark>
&sub-g-audioout; &sub-g-audioout;
&sub-g-crop; &sub-g-crop;
&sub-g-ctrl; &sub-g-ctrl;
&sub-g-dv-preset;
&sub-g-dv-timings;
&sub-g-enc-index; &sub-g-enc-index;
&sub-g-ext-ctrls; &sub-g-ext-ctrls;
&sub-g-fbuf; &sub-g-fbuf;
...@@ -441,6 +462,7 @@ and discussions on the V4L mailing list.</revremark> ...@@ -441,6 +462,7 @@ and discussions on the V4L mailing list.</revremark>
&sub-querybuf; &sub-querybuf;
&sub-querycap; &sub-querycap;
&sub-queryctrl; &sub-queryctrl;
&sub-query-dv-preset;
&sub-querystd; &sub-querystd;
&sub-reqbufs; &sub-reqbufs;
&sub-s-hw-freq-seek; &sub-s-hw-freq-seek;
......
...@@ -733,6 +733,99 @@ struct <link linkend="v4l2-standard">v4l2_standard</link> { ...@@ -733,6 +733,99 @@ struct <link linkend="v4l2-standard">v4l2_standard</link> {
__u32 reserved[4]; __u32 reserved[4];
}; };
/*
* V I D E O T I M I N G S D V P R E S E T
*/
struct <link linkend="v4l2-dv-preset">v4l2_dv_preset</link> {
__u32 preset;
__u32 reserved[4];
};
/*
* D V P R E S E T S E N U M E R A T I O N
*/
struct <link linkend="v4l2-dv-enum-preset">v4l2_dv_enum_preset</link> {
__u32 index;
__u32 preset;
__u8 name[32]; /* Name of the preset timing */
__u32 width;
__u32 height;
__u32 reserved[4];
};
/*
* D V P R E S E T V A L U E S
*/
#define V4L2_DV_INVALID 0
#define V4L2_DV_480P59_94 1 /* BT.1362 */
#define V4L2_DV_576P50 2 /* BT.1362 */
#define V4L2_DV_720P24 3 /* SMPTE 296M */
#define V4L2_DV_720P25 4 /* SMPTE 296M */
#define V4L2_DV_720P30 5 /* SMPTE 296M */
#define V4L2_DV_720P50 6 /* SMPTE 296M */
#define V4L2_DV_720P59_94 7 /* SMPTE 274M */
#define V4L2_DV_720P60 8 /* SMPTE 274M/296M */
#define V4L2_DV_1080I29_97 9 /* BT.1120/ SMPTE 274M */
#define V4L2_DV_1080I30 10 /* BT.1120/ SMPTE 274M */
#define V4L2_DV_1080I25 11 /* BT.1120 */
#define V4L2_DV_1080I50 12 /* SMPTE 296M */
#define V4L2_DV_1080I60 13 /* SMPTE 296M */
#define V4L2_DV_1080P24 14 /* SMPTE 296M */
#define V4L2_DV_1080P25 15 /* SMPTE 296M */
#define V4L2_DV_1080P30 16 /* SMPTE 296M */
#define V4L2_DV_1080P50 17 /* BT.1120 */
#define V4L2_DV_1080P60 18 /* BT.1120 */
/*
* D V B T T I M I N G S
*/
/* BT.656/BT.1120 timing data */
struct <link linkend="v4l2-bt-timings">v4l2_bt_timings</link> {
__u32 width; /* width in pixels */
__u32 height; /* height in lines */
__u32 interlaced; /* Interlaced or progressive */
__u32 polarities; /* Positive or negative polarity */
__u64 pixelclock; /* Pixel clock in HZ. Ex. 74.25MHz-&gt;74250000 */
__u32 hfrontporch; /* Horizpontal front porch in pixels */
__u32 hsync; /* Horizontal Sync length in pixels */
__u32 hbackporch; /* Horizontal back porch in pixels */
__u32 vfrontporch; /* Vertical front porch in pixels */
__u32 vsync; /* Vertical Sync length in lines */
__u32 vbackporch; /* Vertical back porch in lines */
__u32 il_vfrontporch; /* Vertical front porch for bottom field of
* interlaced field formats
*/
__u32 il_vsync; /* Vertical sync length for bottom field of
* interlaced field formats
*/
__u32 il_vbackporch; /* Vertical back porch for bottom field of
* interlaced field formats
*/
__u32 reserved[16];
} __attribute__ ((packed));
/* Interlaced or progressive format */
#define V4L2_DV_PROGRESSIVE 0
#define V4L2_DV_INTERLACED 1
/* Polarities. If bit is not set, it is assumed to be negative polarity */
#define V4L2_DV_VSYNC_POS_POL 0x00000001
#define V4L2_DV_HSYNC_POS_POL 0x00000002
/* DV timings */
struct <link linkend="v4l2-dv-timings">v4l2_dv_timings</link> {
__u32 type;
union {
struct <link linkend="v4l2-bt-timings">v4l2_bt_timings</link> bt;
__u32 reserved[32];
};
} __attribute__ ((packed));
/* Values for the type field */
#define V4L2_DV_BT_656_1120 0 /* BT.656/1120 timing type */
/* /*
* V I D E O I N P U T S * V I D E O I N P U T S
*/ */
...@@ -744,7 +837,8 @@ struct <link linkend="v4l2-input">v4l2_input</link> { ...@@ -744,7 +837,8 @@ struct <link linkend="v4l2-input">v4l2_input</link> {
__u32 tuner; /* Associated tuner */ __u32 tuner; /* Associated tuner */
v4l2_std_id std; v4l2_std_id std;
__u32 status; __u32 status;
__u32 reserved[4]; __u32 capabilities;
__u32 reserved[3];
}; };
/* Values for the 'type' field */ /* Values for the 'type' field */
...@@ -775,6 +869,11 @@ struct <link linkend="v4l2-input">v4l2_input</link> { ...@@ -775,6 +869,11 @@ struct <link linkend="v4l2-input">v4l2_input</link> {
#define V4L2_IN_ST_NO_ACCESS 0x02000000 /* Conditional access denied */ #define V4L2_IN_ST_NO_ACCESS 0x02000000 /* Conditional access denied */
#define V4L2_IN_ST_VTR 0x04000000 /* VTR time constant */ #define V4L2_IN_ST_VTR 0x04000000 /* VTR time constant */
/* capabilities flags */
#define V4L2_IN_CAP_PRESETS 0x00000001 /* Supports S_DV_PRESET */
#define V4L2_IN_CAP_CUSTOM_TIMINGS 0x00000002 /* Supports S_DV_TIMINGS */
#define V4L2_IN_CAP_STD 0x00000004 /* Supports S_STD */
/* /*
* V I D E O O U T P U T S * V I D E O O U T P U T S
*/ */
...@@ -785,13 +884,19 @@ struct <link linkend="v4l2-output">v4l2_output</link> { ...@@ -785,13 +884,19 @@ struct <link linkend="v4l2-output">v4l2_output</link> {
__u32 audioset; /* Associated audios (bitfield) */ __u32 audioset; /* Associated audios (bitfield) */
__u32 modulator; /* Associated modulator */ __u32 modulator; /* Associated modulator */
v4l2_std_id std; v4l2_std_id std;
__u32 reserved[4]; __u32 capabilities;
__u32 reserved[3];
}; };
/* Values for the 'type' field */ /* Values for the 'type' field */
#define V4L2_OUTPUT_TYPE_MODULATOR 1 #define V4L2_OUTPUT_TYPE_MODULATOR 1
#define V4L2_OUTPUT_TYPE_ANALOG 2 #define V4L2_OUTPUT_TYPE_ANALOG 2
#define V4L2_OUTPUT_TYPE_ANALOGVGAOVERLAY 3 #define V4L2_OUTPUT_TYPE_ANALOGVGAOVERLAY 3
/* capabilities flags */
#define V4L2_OUT_CAP_PRESETS 0x00000001 /* Supports S_DV_PRESET */
#define V4L2_OUT_CAP_CUSTOM_TIMINGS 0x00000002 /* Supports S_DV_TIMINGS */
#define V4L2_OUT_CAP_STD 0x00000004 /* Supports S_STD */
/* /*
* C O N T R O L S * C O N T R O L S
*/ */
...@@ -1626,6 +1731,13 @@ struct <link linkend="v4l2-dbg-chip-ident">v4l2_dbg_chip_ident</link> { ...@@ -1626,6 +1731,13 @@ struct <link linkend="v4l2-dbg-chip-ident">v4l2_dbg_chip_ident</link> {
#endif #endif
#define VIDIOC_S_HW_FREQ_SEEK _IOW('V', 82, struct <link linkend="v4l2-hw-freq-seek">v4l2_hw_freq_seek</link>) #define VIDIOC_S_HW_FREQ_SEEK _IOW('V', 82, struct <link linkend="v4l2-hw-freq-seek">v4l2_hw_freq_seek</link>)
#define VIDIOC_ENUM_DV_PRESETS _IOWR('V', 83, struct <link linkend="v4l2-dv-enum-preset">v4l2_dv_enum_preset</link>)
#define VIDIOC_S_DV_PRESET _IOWR('V', 84, struct <link linkend="v4l2-dv-preset">v4l2_dv_preset</link>)
#define VIDIOC_G_DV_PRESET _IOWR('V', 85, struct <link linkend="v4l2-dv-preset">v4l2_dv_preset</link>)
#define VIDIOC_QUERY_DV_PRESET _IOR('V', 86, struct <link linkend="v4l2-dv-preset">v4l2_dv_preset</link>)
#define VIDIOC_S_DV_TIMINGS _IOWR('V', 87, struct <link linkend="v4l2-dv-timings">v4l2_dv_timings</link>)
#define VIDIOC_G_DV_TIMINGS _IOWR('V', 88, struct <link linkend="v4l2-dv-timings">v4l2_dv_timings</link>)
/* Reminder: when adding new ioctls please add support for them to /* Reminder: when adding new ioctls please add support for them to
drivers/media/video/v4l2-compat-ioctl32.c as well! */ drivers/media/video/v4l2-compat-ioctl32.c as well! */
......
<refentry id="vidioc-enum-dv-presets">
<refmeta>
<refentrytitle>ioctl VIDIOC_ENUM_DV_PRESETS</refentrytitle>
&manvol;
</refmeta>
<refnamediv>
<refname>VIDIOC_ENUM_DV_PRESETS</refname>
<refpurpose>Enumerate supported Digital Video presets</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_dv_enum_preset *<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_ENUM_DV_PRESETS</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>argp</parameter></term>
<listitem>
<para></para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>To query the attributes of a DV preset, applications initialize the
<structfield>index</structfield> field and zero the reserved array of &v4l2-dv-enum-preset;
and call the <constant>VIDIOC_ENUM_DV_PRESETS</constant> ioctl with a pointer to this
structure. Drivers fill the rest of the structure or return an
&EINVAL; when the index is out of bounds. To enumerate all DV Presets supported,
applications shall begin at index zero, incrementing by one until the
driver returns <errorcode>EINVAL</errorcode>. Drivers may enumerate a
different set of DV presets after switching the video input or
output.</para>
<table pgwide="1" frame="none" id="v4l2-dv-enum-preset">
<title>struct <structname>v4l2_dv_enum_presets</structname></title>
<tgroup cols="3">
&cs-str;
<tbody valign="top">
<row>
<entry>__u32</entry>
<entry><structfield>index</structfield></entry>
<entry>Number of the DV preset, set by the
application.</entry>
</row>
<row>
<entry>__u32</entry>
<entry><structfield>preset</structfield></entry>
<entry>This field identifies one of the DV preset values listed in <xref linkend="v4l2-dv-presets-vals"/>.</entry>
</row>
<row>
<entry>__u8</entry>
<entry><structfield>name</structfield>[24]</entry>
<entry>Name of the preset, a NUL-terminated ASCII string, for example: "720P-60", "1080I-60". This information is
intended for the user.</entry>
</row>
<row>
<entry>__u32</entry>
<entry><structfield>width</structfield></entry>
<entry>Width of the active video in pixels for the DV preset.</entry>
</row>
<row>
<entry>__u32</entry>
<entry><structfield>height</structfield></entry>
<entry>Height of the active video in lines for the DV preset.</entry>
</row>
<row>
<entry>__u32</entry>
<entry><structfield>reserved</structfield>[4]</entry>
<entry>Reserved for future extensions. Drivers must set the array to zero.</entry>
</row>
</tbody>
</tgroup>
</table>
<table pgwide="1" frame="none" id="v4l2-dv-presets-vals">
<title>struct <structname>DV Presets</structname></title>
<tgroup cols="3">
&cs-str;
<tbody valign="top">
<row>
<entry>Preset</entry>
<entry>Preset value</entry>
<entry>Description</entry>
</row>
<row>
<entry></entry>
<entry></entry>
<entry></entry>
</row>
<row>
<entry>V4L2_DV_INVALID</entry>
<entry>0</entry>
<entry>Invalid preset value.</entry>
</row>
<row>
<entry>V4L2_DV_480P59_94</entry>
<entry>1</entry>
<entry>720x480 progressive video at 59.94 fps as per BT.1362.</entry>
</row>
<row>
<entry>V4L2_DV_576P50</entry>
<entry>2</entry>
<entry>720x576 progressive video at 50 fps as per BT.1362.</entry>
</row>
<row>
<entry>V4L2_DV_720P24</entry>
<entry>3</entry>
<entry>1280x720 progressive video at 24 fps as per SMPTE 296M.</entry>
</row>
<row>
<entry>V4L2_DV_720P25</entry>
<entry>4</entry>
<entry>1280x720 progressive video at 25 fps as per SMPTE 296M.</entry>
</row>
<row>
<entry>V4L2_DV_720P30</entry>
<entry>5</entry>
<entry>1280x720 progressive video at 30 fps as per SMPTE 296M.</entry>
</row>
<row>
<entry>V4L2_DV_720P50</entry>
<entry>6</entry>
<entry>1280x720 progressive video at 50 fps as per SMPTE 296M.</entry>
</row>
<row>
<entry>V4L2_DV_720P59_94</entry>
<entry>7</entry>
<entry>1280x720 progressive video at 59.94 fps as per SMPTE 274M.</entry>
</row>
<row>
<entry>V4L2_DV_720P60</entry>
<entry>8</entry>
<entry>1280x720 progressive video at 60 fps as per SMPTE 274M/296M.</entry>
</row>
<row>
<entry>V4L2_DV_1080I29_97</entry>
<entry>9</entry>
<entry>1920x1080 interlaced video at 29.97 fps as per BT.1120/SMPTE 274M.</entry>
</row>
<row>
<entry>V4L2_DV_1080I30</entry>
<entry>10</entry>
<entry>1920x1080 interlaced video at 30 fps as per BT.1120/SMPTE 274M.</entry>
</row>
<row>
<entry>V4L2_DV_1080I25</entry>
<entry>11</entry>
<entry>1920x1080 interlaced video at 25 fps as per BT.1120.</entry>
</row>
<row>
<entry>V4L2_DV_1080I50</entry>
<entry>12</entry>
<entry>1920x1080 interlaced video at 50 fps as per SMPTE 296M.</entry>
</row>
<row>
<entry>V4L2_DV_1080I60</entry>
<entry>13</entry>
<entry>1920x1080 interlaced video at 60 fps as per SMPTE 296M.</entry>
</row>
<row>
<entry>V4L2_DV_1080P24</entry>
<entry>14</entry>
<entry>1920x1080 progressive video at 24 fps as per SMPTE 296M.</entry>
</row>
<row>
<entry>V4L2_DV_1080P25</entry>
<entry>15</entry>
<entry>1920x1080 progressive video at 25 fps as per SMPTE 296M.</entry>
</row>
<row>
<entry>V4L2_DV_1080P30</entry>
<entry>16</entry>
<entry>1920x1080 progressive video at 30 fps as per SMPTE 296M.</entry>
</row>
<row>
<entry>V4L2_DV_1080P50</entry>
<entry>17</entry>
<entry>1920x1080 progressive video at 50 fps as per BT.1120.</entry>
</row>
<row>
<entry>V4L2_DV_1080P60</entry>
<entry>18</entry>
<entry>1920x1080 progressive video at 60 fps as per BT.1120.</entry>
</row>
</tbody>
</tgroup>
</table>
</refsect1>
<refsect1>
&return-value;
<variablelist>
<varlistentry>
<term><errorcode>EINVAL</errorcode></term>
<listitem>
<para>The &v4l2-dv-enum-preset; <structfield>index</structfield>
is out of bounds.</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
</refentry>
<!--
Local Variables:
mode: sgml
sgml-parent-document: "v4l2.sgml"
indent-tabs-mode: nil
End:
-->
...@@ -124,7 +124,13 @@ current input.</entry> ...@@ -124,7 +124,13 @@ current input.</entry>
</row> </row>
<row> <row>
<entry>__u32</entry> <entry>__u32</entry>
<entry><structfield>reserved</structfield>[4]</entry> <entry><structfield>capabilities</structfield></entry>
<entry>This field provides capabilities for the
input. See <xref linkend="input-capabilities" /> for flags.</entry>
</row>
<row>
<entry>__u32</entry>
<entry><structfield>reserved</structfield>[3]</entry>
<entry>Reserved for future extensions. Drivers must set <entry>Reserved for future extensions. Drivers must set
the array to zero.</entry> the array to zero.</entry>
</row> </row>
...@@ -261,6 +267,34 @@ flag is set Macrovision has been detected.</entry> ...@@ -261,6 +267,34 @@ flag is set Macrovision has been detected.</entry>
</tbody> </tbody>
</tgroup> </tgroup>
</table> </table>
<!-- Capability flags based on video timings RFC by Muralidharan
Karicheri, titled RFC (v1.2): V4L - Support for video timings at the
input/output interface to linux-media@vger.kernel.org on 19 Oct 2009.
-->
<table frame="none" pgwide="1" id="input-capabilities">
<title>Input capabilities</title>
<tgroup cols="3">
&cs-def;
<tbody valign="top">
<row>
<entry><constant>V4L2_IN_CAP_PRESETS</constant></entry>
<entry>0x00000001</entry>
<entry>This input supports setting DV presets by using VIDIOC_S_DV_PRESET.</entry>
</row>
<row>
<entry><constant>V4L2_OUT_CAP_CUSTOM_TIMINGS</constant></entry>
<entry>0x00000002</entry>
<entry>This input supports setting custom video timings by using VIDIOC_S_DV_TIMINGS.</entry>
</row>
<row>
<entry><constant>V4L2_IN_CAP_STD</constant></entry>
<entry>0x00000004</entry>
<entry>This input supports setting the TV standard by using VIDIOC_S_STD.</entry>
</row>
</tbody>
</tgroup>
</table>
</refsect1> </refsect1>
<refsect1> <refsect1>
......
...@@ -114,7 +114,13 @@ details on video standards and how to switch see <xref ...@@ -114,7 +114,13 @@ details on video standards and how to switch see <xref
</row> </row>
<row> <row>
<entry>__u32</entry> <entry>__u32</entry>
<entry><structfield>reserved</structfield>[4]</entry> <entry><structfield>capabilities</structfield></entry>
<entry>This field provides capabilities for the
output. See <xref linkend="output-capabilities" /> for flags.</entry>
</row>
<row>
<entry>__u32</entry>
<entry><structfield>reserved</structfield>[3]</entry>
<entry>Reserved for future extensions. Drivers must set <entry>Reserved for future extensions. Drivers must set
the array to zero.</entry> the array to zero.</entry>
</row> </row>
...@@ -147,6 +153,34 @@ CVBS, S-Video, RGB.</entry> ...@@ -147,6 +153,34 @@ CVBS, S-Video, RGB.</entry>
</tgroup> </tgroup>
</table> </table>
<!-- Capabilities flags based on video timings RFC by Muralidharan
Karicheri, titled RFC (v1.2): V4L - Support for video timings at the
input/output interface to linux-media@vger.kernel.org on 19 Oct 2009.
-->
<table frame="none" pgwide="1" id="output-capabilities">
<title>Output capabilities</title>
<tgroup cols="3">
&cs-def;
<tbody valign="top">
<row>
<entry><constant>V4L2_OUT_CAP_PRESETS</constant></entry>
<entry>0x00000001</entry>
<entry>This output supports setting DV presets by using VIDIOC_S_DV_PRESET.</entry>
</row>
<row>
<entry><constant>V4L2_OUT_CAP_CUSTOM_TIMINGS</constant></entry>
<entry>0x00000002</entry>
<entry>This output supports setting custom video timings by using VIDIOC_S_DV_TIMINGS.</entry>
</row>
<row>
<entry><constant>V4L2_OUT_CAP_STD</constant></entry>
<entry>0x00000004</entry>
<entry>This output supports setting the TV standard by using VIDIOC_S_STD.</entry>
</row>
</tbody>
</tgroup>
</table>
</refsect1> </refsect1>
<refsect1> <refsect1>
&return-value; &return-value;
......
<refentry id="vidioc-g-dv-preset">
<refmeta>
<refentrytitle>ioctl VIDIOC_G_DV_PRESET, VIDIOC_S_DV_PRESET</refentrytitle>
&manvol;
</refmeta>
<refnamediv>
<refname>VIDIOC_G_DV_PRESET</refname>
<refname>VIDIOC_S_DV_PRESET</refname>
<refpurpose>Query or select the DV preset of the current input or output</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis>
<funcprototype>
<funcdef>int <function>ioctl</function></funcdef>
<paramdef>int <parameter>fd</parameter></paramdef>
<paramdef>int <parameter>request</parameter></paramdef>
<paramdef>&v4l2-dv-preset;
*<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_DV_PRESET, VIDIOC_S_DV_PRESET</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>argp</parameter></term>
<listitem>
<para></para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>To query and select the current DV preset, applications
use the <constant>VIDIOC_G_DV_PRESET</constant> and <constant>VIDIOC_S_DV_PRESET</constant>
ioctls which take a pointer to a &v4l2-dv-preset; type as argument.
Applications must zero the reserved array in &v4l2-dv-preset;.
<constant>VIDIOC_G_DV_PRESET</constant> returns a dv preset in the field
<structfield>preset</structfield> of &v4l2-dv-preset;.</para>
<para><constant>VIDIOC_S_DV_PRESET</constant> accepts a pointer to a &v4l2-dv-preset;
that has the preset value to be set. Applications must zero the reserved array in &v4l2-dv-preset;.
If the preset is not supported, it returns an &EINVAL; </para>
</refsect1>
<refsect1>
&return-value;
<variablelist>
<varlistentry>
<term><errorcode>EINVAL</errorcode></term>
<listitem>
<para>This ioctl is not supported, or the
<constant>VIDIOC_S_DV_PRESET</constant>,<constant>VIDIOC_S_DV_PRESET</constant> parameter was unsuitable.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><errorcode>EBUSY</errorcode></term>
<listitem>
<para>The device is busy and therefore can not change the preset.</para>
</listitem>
</varlistentry>
</variablelist>
<table pgwide="1" frame="none" id="v4l2-dv-preset">
<title>struct <structname>v4l2_dv_preset</structname></title>
<tgroup cols="3">
&cs-str;
<tbody valign="top">
<row>
<entry>__u32</entry>
<entry><structfield>preset</structfield></entry>
<entry>Preset value to represent the digital video timings</entry>
</row>
<row>
<entry>__u32</entry>
<entry><structfield>reserved[4]</structfield></entry>
<entry>Reserved fields for future use</entry>
</row>
</tbody>
</tgroup>
</table>
</refsect1>
</refentry>
<!--
Local Variables:
mode: sgml
sgml-parent-document: "v4l2.sgml"
indent-tabs-mode: nil
End:
-->
<refentry id="vidioc-g-dv-timings">
<refmeta>
<refentrytitle>ioctl VIDIOC_G_DV_TIMINGS, VIDIOC_S_DV_TIMINGS</refentrytitle>
&manvol;
</refmeta>
<refnamediv>
<refname>VIDIOC_G_DV_TIMINGS</refname>
<refname>VIDIOC_S_DV_TIMINGS</refname>
<refpurpose>Get or set custom DV timings for input or output</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis>
<funcprototype>
<funcdef>int <function>ioctl</function></funcdef>
<paramdef>int <parameter>fd</parameter></paramdef>
<paramdef>int <parameter>request</parameter></paramdef>
<paramdef>&v4l2-dv-timings;
*<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_DV_TIMINGS, VIDIOC_S_DV_TIMINGS</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>argp</parameter></term>
<listitem>
<para></para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>To set custom DV timings for the input or output, applications use the
<constant>VIDIOC_S_DV_TIMINGS</constant> ioctl and to get the current custom timings,
applications use the <constant>VIDIOC_G_DV_TIMINGS</constant> ioctl. The detailed timing
information is filled in using the structure &v4l2-dv-timings;. These ioctls take
a pointer to the &v4l2-dv-timings; structure as argument. If the ioctl is not supported
or the timing values are not correct, the driver returns &EINVAL;.</para>
</refsect1>
<refsect1>
&return-value;
<variablelist>
<varlistentry>
<term><errorcode>EINVAL</errorcode></term>
<listitem>
<para>This ioctl is not supported, or the
<constant>VIDIOC_S_DV_TIMINGS</constant> parameter was unsuitable.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><errorcode>EBUSY</errorcode></term>
<listitem>
<para>The device is busy and therefore can not change the timings.</para>
</listitem>
</varlistentry>
</variablelist>
<table pgwide="1" frame="none" id="v4l2-bt-timings">
<title>struct <structname>v4l2_bt_timings</structname></title>
<tgroup cols="3">
&cs-str;
<tbody valign="top">
<row>
<entry>__u32</entry>
<entry><structfield>width</structfield></entry>
<entry>Width of the active video in pixels</entry>
</row>
<row>
<entry>__u32</entry>
<entry><structfield>height</structfield></entry>
<entry>Height of the active video in lines</entry>
</row>
<row>
<entry>__u32</entry>
<entry><structfield>interlaced</structfield></entry>
<entry>Progressive (0) or interlaced (1)</entry>
</row>
<row>
<entry>__u32</entry>
<entry><structfield>polarities</structfield></entry>
<entry>This is a bit mask that defines polarities of sync signals.
bit 0 (V4L2_DV_VSYNC_POS_POL) is for vertical sync polarity and bit 1 (V4L2_DV_HSYNC_POS_POL) is for horizontal sync polarity. If the bit is set
(1) it is positive polarity and if is cleared (0), it is negative polarity.</entry>
</row>
<row>
<entry>__u64</entry>
<entry><structfield>pixelclock</structfield></entry>
<entry>Pixel clock in Hz. Ex. 74.25MHz->74250000</entry>
</row>
<row>
<entry>__u32</entry>
<entry><structfield>hfrontporch</structfield></entry>
<entry>Horizontal front porch in pixels</entry>
</row>
<row>
<entry>__u32</entry>
<entry><structfield>hsync</structfield></entry>
<entry>Horizontal sync length in pixels</entry>
</row>
<row>
<entry>__u32</entry>
<entry><structfield>hbackporch</structfield></entry>
<entry>Horizontal back porch in pixels</entry>
</row>
<row>
<entry>__u32</entry>
<entry><structfield>vfrontporch</structfield></entry>
<entry>Vertical front porch in lines</entry>
</row>
<row>
<entry>__u32</entry>
<entry><structfield>vsync</structfield></entry>
<entry>Vertical sync length in lines</entry>
</row>
<row>
<entry>__u32</entry>
<entry><structfield>vbackporch</structfield></entry>
<entry>Vertical back porch in lines</entry>
</row>
<row>
<entry>__u32</entry>
<entry><structfield>il_vfrontporch</structfield></entry>
<entry>Vertical front porch in lines for bottom field of interlaced field formats</entry>
</row>
<row>
<entry>__u32</entry>
<entry><structfield>il_vsync</structfield></entry>
<entry>Vertical sync length in lines for bottom field of interlaced field formats</entry>
</row>
<row>
<entry>__u32</entry>
<entry><structfield>il_vbackporch</structfield></entry>
<entry>Vertical back porch in lines for bottom field of interlaced field formats</entry>
</row>
</tbody>
</tgroup>
</table>
<table pgwide="1" frame="none" id="v4l2-dv-timings">
<title>struct <structname>v4l2_dv_timings</structname></title>
<tgroup cols="4">
&cs-str;
<tbody valign="top">
<row>
<entry>__u32</entry>
<entry><structfield>type</structfield></entry>
<entry></entry>
<entry>Type of DV timings as listed in <xref linkend="dv-timing-types"/>.</entry>
</row>
<row>
<entry>union</entry>
<entry><structfield></structfield></entry>
<entry></entry>
</row>
<row>
<entry></entry>
<entry>&v4l2-bt-timings;</entry>
<entry><structfield>bt</structfield></entry>
<entry>Timings defined by BT.656/1120 specifications</entry>
</row>
<row>
<entry></entry>
<entry>__u32</entry>
<entry><structfield>reserved</structfield>[32]</entry>
<entry></entry>
</row>
</tbody>
</tgroup>
</table>
<table pgwide="1" frame="none" id="dv-timing-types">
<title>DV Timing types</title>
<tgroup cols="3">
&cs-str;
<tbody valign="top">
<row>
<entry>Timing type</entry>
<entry>value</entry>
<entry>Description</entry>
</row>
<row>
<entry></entry>
<entry></entry>
<entry></entry>
</row>
<row>
<entry>V4L2_DV_BT_656_1120</entry>
<entry>0</entry>
<entry>BT.656/1120 timings</entry>
</row>
</tbody>
</tgroup>
</table>
</refsect1>
</refentry>
<!--
Local Variables:
mode: sgml
sgml-parent-document: "v4l2.sgml"
indent-tabs-mode: nil
End:
-->
...@@ -86,6 +86,12 @@ standards.</para> ...@@ -86,6 +86,12 @@ standards.</para>
<constant>VIDIOC_S_STD</constant> parameter was unsuitable.</para> <constant>VIDIOC_S_STD</constant> parameter was unsuitable.</para>
</listitem> </listitem>
</varlistentry> </varlistentry>
<varlistentry>
<term><errorcode>EBUSY</errorcode></term>
<listitem>
<para>The device is busy and therefore can not change the standard</para>
</listitem>
</varlistentry>
</variablelist> </variablelist>
</refsect1> </refsect1>
</refentry> </refentry>
......
<refentry id="vidioc-query-dv-preset">
<refmeta>
<refentrytitle>ioctl VIDIOC_QUERY_DV_PRESET</refentrytitle>
&manvol;
</refmeta>
<refnamediv>
<refname>VIDIOC_QUERY_DV_PRESET</refname>
<refpurpose>Sense the DV preset received by the current
input</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis>
<funcprototype>
<funcdef>int <function>ioctl</function></funcdef>
<paramdef>int <parameter>fd</parameter></paramdef>
<paramdef>int <parameter>request</parameter></paramdef>
<paramdef>&v4l2-dv-preset; *<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_QUERY_DV_PRESET</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>argp</parameter></term>
<listitem>
<para></para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>The hardware may be able to detect the current DV preset
automatically, similar to sensing the video standard. To do so, applications
call <constant> VIDIOC_QUERY_DV_PRESET</constant> with a pointer to a
&v4l2-dv-preset; type. Once the hardware detects a preset, that preset is
returned in the preset field of &v4l2-dv-preset;. When detection is not
possible or fails, the value V4L2_DV_INVALID is returned.</para>
</refsect1>
<refsect1>
&return-value;
<variablelist>
<varlistentry>
<term><errorcode>EINVAL</errorcode></term>
<listitem>
<para>This ioctl is not supported.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><errorcode>EBUSY</errorcode></term>
<listitem>
<para>The device is busy and therefore can not sense the preset</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
</refentry>
<!--
Local Variables:
mode: sgml
sgml-parent-document: "v4l2.sgml"
indent-tabs-mode: nil
End:
-->
...@@ -70,6 +70,12 @@ current video input or output.</para> ...@@ -70,6 +70,12 @@ current video input or output.</para>
<para>This ioctl is not supported.</para> <para>This ioctl is not supported.</para>
</listitem> </listitem>
</varlistentry> </varlistentry>
<varlistentry>
<term><errorcode>EBUSY</errorcode></term>
<listitem>
<para>The device is busy and therefore can not detect the standard</para>
</listitem>
</varlistentry>
</variablelist> </variablelist>
</refsect1> </refsect1>
</refentry> </refentry>
......
...@@ -12,6 +12,7 @@ m5602 0402:5602 ALi Video Camera Controller ...@@ -12,6 +12,7 @@ m5602 0402:5602 ALi Video Camera Controller
spca501 040a:0002 Kodak DVC-325 spca501 040a:0002 Kodak DVC-325
spca500 040a:0300 Kodak EZ200 spca500 040a:0300 Kodak EZ200
zc3xx 041e:041e Creative WebCam Live! zc3xx 041e:041e Creative WebCam Live!
ov519 041e:4003 Video Blaster WebCam Go Plus
spca500 041e:400a Creative PC-CAM 300 spca500 041e:400a Creative PC-CAM 300
sunplus 041e:400b Creative PC-CAM 600 sunplus 041e:400b Creative PC-CAM 600
sunplus 041e:4012 PC-Cam350 sunplus 041e:4012 PC-Cam350
...@@ -168,10 +169,14 @@ sunplus 055f:c650 Mustek MDC5500Z ...@@ -168,10 +169,14 @@ sunplus 055f:c650 Mustek MDC5500Z
zc3xx 055f:d003 Mustek WCam300A zc3xx 055f:d003 Mustek WCam300A
zc3xx 055f:d004 Mustek WCam300 AN zc3xx 055f:d004 Mustek WCam300 AN
conex 0572:0041 Creative Notebook cx11646 conex 0572:0041 Creative Notebook cx11646
ov519 05a9:0511 Video Blaster WebCam 3/WebCam Plus, D-Link USB Digital Video Camera
ov519 05a9:0518 Creative WebCam
ov519 05a9:0519 OV519 Microphone ov519 05a9:0519 OV519 Microphone
ov519 05a9:0530 OmniVision ov519 05a9:0530 OmniVision
ov519 05a9:2800 OmniVision SuperCAM
ov519 05a9:4519 Webcam Classic ov519 05a9:4519 Webcam Classic
ov519 05a9:8519 OmniVision ov519 05a9:8519 OmniVision
ov519 05a9:a511 D-Link USB Digital Video Camera
ov519 05a9:a518 D-Link DSB-C310 Webcam ov519 05a9:a518 D-Link DSB-C310 Webcam
sunplus 05da:1018 Digital Dream Enigma 1.3 sunplus 05da:1018 Digital Dream Enigma 1.3
stk014 05e1:0893 Syntek DV4000 stk014 05e1:0893 Syntek DV4000
...@@ -187,7 +192,7 @@ ov534 06f8:3002 Hercules Blog Webcam ...@@ -187,7 +192,7 @@ ov534 06f8:3002 Hercules Blog Webcam
ov534 06f8:3003 Hercules Dualpix HD Weblog ov534 06f8:3003 Hercules Dualpix HD Weblog
sonixj 06f8:3004 Hercules Classic Silver sonixj 06f8:3004 Hercules Classic Silver
sonixj 06f8:3008 Hercules Deluxe Optical Glass sonixj 06f8:3008 Hercules Deluxe Optical Glass
pac7311 06f8:3009 Hercules Classic Link pac7302 06f8:3009 Hercules Classic Link
spca508 0733:0110 ViewQuest VQ110 spca508 0733:0110 ViewQuest VQ110
spca501 0733:0401 Intel Create and Share spca501 0733:0401 Intel Create and Share
spca501 0733:0402 ViewQuest M318B spca501 0733:0402 ViewQuest M318B
...@@ -199,6 +204,7 @@ sunplus 0733:2221 Mercury Digital Pro 3.1p ...@@ -199,6 +204,7 @@ sunplus 0733:2221 Mercury Digital Pro 3.1p
sunplus 0733:3261 Concord 3045 spca536a sunplus 0733:3261 Concord 3045 spca536a
sunplus 0733:3281 Cyberpix S550V sunplus 0733:3281 Cyberpix S550V
spca506 0734:043b 3DeMon USB Capture aka spca506 0734:043b 3DeMon USB Capture aka
ov519 0813:0002 Dual Mode USB Camera Plus
spca500 084d:0003 D-Link DSC-350 spca500 084d:0003 D-Link DSC-350
spca500 08ca:0103 Aiptek PocketDV spca500 08ca:0103 Aiptek PocketDV
sunplus 08ca:0104 Aiptek PocketDVII 1.3 sunplus 08ca:0104 Aiptek PocketDVII 1.3
...@@ -236,15 +242,15 @@ pac7311 093a:2603 Philips SPC 500 NC ...@@ -236,15 +242,15 @@ pac7311 093a:2603 Philips SPC 500 NC
pac7311 093a:2608 Trust WB-3300p pac7311 093a:2608 Trust WB-3300p
pac7311 093a:260e Gigaware VGA PC Camera, Trust WB-3350p, SIGMA cam 2350 pac7311 093a:260e Gigaware VGA PC Camera, Trust WB-3350p, SIGMA cam 2350
pac7311 093a:260f SnakeCam pac7311 093a:260f SnakeCam
pac7311 093a:2620 Apollo AC-905 pac7302 093a:2620 Apollo AC-905
pac7311 093a:2621 PAC731x pac7302 093a:2621 PAC731x
pac7311 093a:2622 Genius Eye 312 pac7302 093a:2622 Genius Eye 312
pac7311 093a:2624 PAC7302 pac7302 093a:2624 PAC7302
pac7311 093a:2626 Labtec 2200 pac7302 093a:2626 Labtec 2200
pac7311 093a:2628 Genius iLook 300 pac7302 093a:2628 Genius iLook 300
pac7311 093a:2629 Genious iSlim 300 pac7302 093a:2629 Genious iSlim 300
pac7311 093a:262a Webcam 300k pac7302 093a:262a Webcam 300k
pac7311 093a:262c Philips SPC 230 NC pac7302 093a:262c Philips SPC 230 NC
jeilinj 0979:0280 Sakar 57379 jeilinj 0979:0280 Sakar 57379
zc3xx 0ac8:0302 Z-star Vimicro zc0302 zc3xx 0ac8:0302 Z-star Vimicro zc0302
vc032x 0ac8:0321 Vimicro generic vc0321 vc032x 0ac8:0321 Vimicro generic vc0321
...@@ -259,6 +265,7 @@ vc032x 0ac8:c002 Sony embedded vimicro ...@@ -259,6 +265,7 @@ vc032x 0ac8:c002 Sony embedded vimicro
vc032x 0ac8:c301 Samsung Q1 Ultra Premium vc032x 0ac8:c301 Samsung Q1 Ultra Premium
spca508 0af9:0010 Hama USB Sightcam 100 spca508 0af9:0010 Hama USB Sightcam 100
spca508 0af9:0011 Hama USB Sightcam 100 spca508 0af9:0011 Hama USB Sightcam 100
ov519 0b62:0059 iBOT2 Webcam
sonixb 0c45:6001 Genius VideoCAM NB sonixb 0c45:6001 Genius VideoCAM NB
sonixb 0c45:6005 Microdia Sweex Mini Webcam sonixb 0c45:6005 Microdia Sweex Mini Webcam
sonixb 0c45:6007 Sonix sn9c101 + Tas5110D sonixb 0c45:6007 Sonix sn9c101 + Tas5110D
...@@ -318,8 +325,10 @@ sn9c20x 0c45:62b3 PC Camera (SN9C202 + OV9655) ...@@ -318,8 +325,10 @@ sn9c20x 0c45:62b3 PC Camera (SN9C202 + OV9655)
sn9c20x 0c45:62bb PC Camera (SN9C202 + OV7660) sn9c20x 0c45:62bb PC Camera (SN9C202 + OV7660)
sn9c20x 0c45:62bc PC Camera (SN9C202 + HV7131R) sn9c20x 0c45:62bc PC Camera (SN9C202 + HV7131R)
sunplus 0d64:0303 Sunplus FashionCam DXG sunplus 0d64:0303 Sunplus FashionCam DXG
ov519 0e96:c001 TRUST 380 USB2 SPACEC@M
etoms 102c:6151 Qcam Sangha CIF etoms 102c:6151 Qcam Sangha CIF
etoms 102c:6251 Qcam xxxxxx VGA etoms 102c:6251 Qcam xxxxxx VGA
ov519 1046:9967 W9967CF/W9968CF WebCam IC, Video Blaster WebCam Go
zc3xx 10fd:0128 Typhoon Webshot II USB 300k 0x0128 zc3xx 10fd:0128 Typhoon Webshot II USB 300k 0x0128
spca561 10fd:7e50 FlyCam Usb 100 spca561 10fd:7e50 FlyCam Usb 100
zc3xx 10fd:8050 Typhoon Webshot II USB 300k zc3xx 10fd:8050 Typhoon Webshot II USB 300k
...@@ -332,7 +341,12 @@ spca501 1776:501c Arowana 300K CMOS Camera ...@@ -332,7 +341,12 @@ spca501 1776:501c Arowana 300K CMOS Camera
t613 17a1:0128 TASCORP JPEG Webcam, NGS Cyclops t613 17a1:0128 TASCORP JPEG Webcam, NGS Cyclops
vc032x 17ef:4802 Lenovo Vc0323+MI1310_SOC vc032x 17ef:4802 Lenovo Vc0323+MI1310_SOC
pac207 2001:f115 D-Link DSB-C120 pac207 2001:f115 D-Link DSB-C120
sq905c 2770:9050 sq905c
sq905c 2770:905c DualCamera
sq905 2770:9120 Argus Digital Camera DC1512
sq905c 2770:913d sq905c
spca500 2899:012c Toptro Industrial spca500 2899:012c Toptro Industrial
ov519 8020:ef04 ov519
spca508 8086:0110 Intel Easy PC Camera spca508 8086:0110 Intel Easy PC Camera
spca500 8086:0630 Intel Pocket PC Camera spca500 8086:0630 Intel Pocket PC Camera
spca506 99fa:8988 Grandtec V.cap spca506 99fa:8988 Grandtec V.cap
......
Cropping and Scaling algorithm, used in the sh_mobile_ceu_camera driver
=======================================================================
Terminology
-----------
sensor scales: horizontal and vertical scales, configured by the sensor driver
host scales: -"- host driver
combined scales: sensor_scale * host_scale
Generic scaling / cropping scheme
---------------------------------
-1--
|
-2-- -\
| --\
| --\
+-5-- -\ -- -3--
| ---\
| --- -4-- -\
| -\
| - -6--
|
| - -6'-
| -/
| --- -4'- -/
| ---/
+-5'- -/
| -- -3'-
| --/
| --/
-2'- -/
|
|
-1'-
Produced by user requests:
S_CROP(left / top = (5) - (1), width / height = (5') - (5))
S_FMT(width / height = (6') - (6))
Here:
(1) to (1') - whole max width or height
(1) to (2) - sensor cropped left or top
(2) to (2') - sensor cropped width or height
(3) to (3') - sensor scale
(3) to (4) - CEU cropped left or top
(4) to (4') - CEU cropped width or height
(5) to (5') - reverse sensor scale applied to CEU cropped width or height
(2) to (5) - reverse sensor scale applied to CEU cropped left or top
(6) to (6') - CEU scale - user window
S_FMT
-----
Do not touch input rectangle - it is already optimal.
1. Calculate current sensor scales:
scale_s = ((3') - (3)) / ((2') - (2))
2. Calculate "effective" input crop (sensor subwindow) - CEU crop scaled back at
current sensor scales onto input window - this is user S_CROP:
width_u = (5') - (5) = ((4') - (4)) * scale_s
3. Calculate new combined scales from "effective" input window to requested user
window:
scale_comb = width_u / ((6') - (6))
4. Calculate sensor output window by applying combined scales to real input
window:
width_s_out = ((2') - (2)) / scale_comb
5. Apply iterative sensor S_FMT for sensor output window.
subdev->video_ops->s_fmt(.width = width_s_out)
6. Retrieve sensor output window (g_fmt)
7. Calculate new sensor scales:
scale_s_new = ((3')_new - (3)_new) / ((2') - (2))
8. Calculate new CEU crop - apply sensor scales to previously calculated
"effective" crop:
width_ceu = (4')_new - (4)_new = width_u / scale_s_new
left_ceu = (4)_new - (3)_new = ((5) - (2)) / scale_s_new
9. Use CEU cropping to crop to the new window:
ceu_crop(.width = width_ceu, .left = left_ceu)
10. Use CEU scaling to scale to the requested user window:
scale_ceu = width_ceu / width
S_CROP
------
If old scale applied to new crop is invalid produce nearest new scale possible
1. Calculate current combined scales.
scale_comb = (((4') - (4)) / ((6') - (6))) * (((2') - (2)) / ((3') - (3)))
2. Apply iterative sensor S_CROP for new input window.
3. If old combined scales applied to new crop produce an impossible user window,
adjust scales to produce nearest possible window.
width_u_out = ((5') - (5)) / scale_comb
if (width_u_out > max)
scale_comb = ((5') - (5)) / max;
else if (width_u_out < min)
scale_comb = ((5') - (5)) / min;
4. Issue G_CROP to retrieve actual input window.
5. Using actual input window and calculated combined scales calculate sensor
target output window.
width_s_out = ((3') - (3)) = ((2') - (2)) / scale_comb
6. Apply iterative S_FMT for new sensor target output window.
7. Issue G_FMT to retrieve the actual sensor output window.
8. Calculate sensor scales.
scale_s = ((3') - (3)) / ((2') - (2))
9. Calculate sensor output subwindow to be cropped on CEU by applying sensor
scales to the requested window.
width_ceu = ((5') - (5)) / scale_s
10. Use CEU cropping for above calculated window.
11. Calculate CEU scales from sensor scales from results of (10) and user window
from (3)
scale_ceu = calc_scale(((5') - (5)), &width_u_out)
12. Apply CEU scales.
--
Author: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
...@@ -561,6 +561,8 @@ video_device helper functions ...@@ -561,6 +561,8 @@ video_device helper functions
There are a few useful helper functions: There are a few useful helper functions:
- file/video_device private data
You can set/get driver private data in the video_device struct using: You can set/get driver private data in the video_device struct using:
void *video_get_drvdata(struct video_device *vdev); void *video_get_drvdata(struct video_device *vdev);
...@@ -575,8 +577,7 @@ struct video_device *video_devdata(struct file *file); ...@@ -575,8 +577,7 @@ struct video_device *video_devdata(struct file *file);
returns the video_device belonging to the file struct. returns the video_device belonging to the file struct.
The final helper function combines video_get_drvdata with The video_drvdata function combines video_get_drvdata with video_devdata:
video_devdata:
void *video_drvdata(struct file *file); void *video_drvdata(struct file *file);
...@@ -584,6 +585,17 @@ You can go from a video_device struct to the v4l2_device struct using: ...@@ -584,6 +585,17 @@ You can go from a video_device struct to the v4l2_device struct using:
struct v4l2_device *v4l2_dev = vdev->v4l2_dev; struct v4l2_device *v4l2_dev = vdev->v4l2_dev;
- Device node name
The video_device node kernel name can be retrieved using
const char *video_device_node_name(struct video_device *vdev);
The name is used as a hint by userspace tools such as udev. The function
should be used where possible instead of accessing the video_device::num and
video_device::minor fields.
video buffer helper functions video buffer helper functions
----------------------------- -----------------------------
......
...@@ -316,20 +316,23 @@ static struct soc_camera_platform_info camera_info = { ...@@ -316,20 +316,23 @@ static struct soc_camera_platform_info camera_info = {
.format_name = "UYVY", .format_name = "UYVY",
.format_depth = 16, .format_depth = 16,
.format = { .format = {
.pixelformat = V4L2_PIX_FMT_UYVY, .code = V4L2_MBUS_FMT_YUYV8_2X8_BE,
.colorspace = V4L2_COLORSPACE_SMPTE170M, .colorspace = V4L2_COLORSPACE_SMPTE170M,
.field = V4L2_FIELD_NONE,
.width = 640, .width = 640,
.height = 480, .height = 480,
}, },
.bus_param = SOCAM_PCLK_SAMPLE_RISING | SOCAM_HSYNC_ACTIVE_HIGH | .bus_param = SOCAM_PCLK_SAMPLE_RISING | SOCAM_HSYNC_ACTIVE_HIGH |
SOCAM_VSYNC_ACTIVE_HIGH | SOCAM_MASTER | SOCAM_DATAWIDTH_8, SOCAM_VSYNC_ACTIVE_HIGH | SOCAM_MASTER | SOCAM_DATAWIDTH_8,
.set_capture = camera_set_capture, .set_capture = camera_set_capture,
.link = { };
struct soc_camera_link camera_link = {
.bus_id = 0, .bus_id = 0,
.add_device = ap325rxa_camera_add, .add_device = ap325rxa_camera_add,
.del_device = ap325rxa_camera_del, .del_device = ap325rxa_camera_del,
.module_name = "soc_camera_platform", .module_name = "soc_camera_platform",
}, .priv = &camera_info,
}; };
static void dummy_release(struct device *dev) static void dummy_release(struct device *dev)
...@@ -347,7 +350,7 @@ static struct platform_device camera_device = { ...@@ -347,7 +350,7 @@ static struct platform_device camera_device = {
static int ap325rxa_camera_add(struct soc_camera_link *icl, static int ap325rxa_camera_add(struct soc_camera_link *icl,
struct device *dev) struct device *dev)
{ {
if (icl != &camera_info.link || camera_probe() <= 0) if (icl != &camera_link || camera_probe() <= 0)
return -ENODEV; return -ENODEV;
camera_info.dev = dev; camera_info.dev = dev;
...@@ -357,7 +360,7 @@ static int ap325rxa_camera_add(struct soc_camera_link *icl, ...@@ -357,7 +360,7 @@ static int ap325rxa_camera_add(struct soc_camera_link *icl,
static void ap325rxa_camera_del(struct soc_camera_link *icl) static void ap325rxa_camera_del(struct soc_camera_link *icl)
{ {
if (icl != &camera_info.link) if (icl != &camera_link)
return; return;
platform_device_unregister(&camera_device); platform_device_unregister(&camera_device);
...@@ -470,13 +473,15 @@ static struct ov772x_camera_info ov7725_info = { ...@@ -470,13 +473,15 @@ static struct ov772x_camera_info ov7725_info = {
.buswidth = SOCAM_DATAWIDTH_8, .buswidth = SOCAM_DATAWIDTH_8,
.flags = OV772X_FLAG_VFLIP | OV772X_FLAG_HFLIP, .flags = OV772X_FLAG_VFLIP | OV772X_FLAG_HFLIP,
.edgectrl = OV772X_AUTO_EDGECTRL(0xf, 0), .edgectrl = OV772X_AUTO_EDGECTRL(0xf, 0),
.link = { };
static struct soc_camera_link ov7725_link = {
.bus_id = 0, .bus_id = 0,
.power = ov7725_power, .power = ov7725_power,
.board_info = &ap325rxa_i2c_camera[0], .board_info = &ap325rxa_i2c_camera[0],
.i2c_adapter_id = 0, .i2c_adapter_id = 0,
.module_name = "ov772x", .module_name = "ov772x",
}, .priv = &ov7725_info,
}; };
static struct platform_device ap325rxa_camera[] = { static struct platform_device ap325rxa_camera[] = {
...@@ -484,13 +489,13 @@ static struct platform_device ap325rxa_camera[] = { ...@@ -484,13 +489,13 @@ static struct platform_device ap325rxa_camera[] = {
.name = "soc-camera-pdrv", .name = "soc-camera-pdrv",
.id = 0, .id = 0,
.dev = { .dev = {
.platform_data = &ov7725_info.link, .platform_data = &ov7725_link,
}, },
}, { }, {
.name = "soc-camera-pdrv", .name = "soc-camera-pdrv",
.id = 1, .id = 1,
.dev = { .dev = {
.platform_data = &camera_info.link, .platform_data = &camera_link,
}, },
}, },
}; };
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#include <linux/input/sh_keysc.h> #include <linux/input/sh_keysc.h>
#include <linux/i2c.h> #include <linux/i2c.h>
#include <linux/usb/r8a66597.h> #include <linux/usb/r8a66597.h>
#include <media/rj54n1cb0c.h>
#include <media/soc_camera.h> #include <media/soc_camera.h>
#include <media/sh_mobile_ceu.h> #include <media/sh_mobile_ceu.h>
#include <video/sh_mobile_lcdc.h> #include <video/sh_mobile_lcdc.h>
...@@ -255,6 +256,9 @@ static struct i2c_board_info kfr2r09_i2c_camera = { ...@@ -255,6 +256,9 @@ static struct i2c_board_info kfr2r09_i2c_camera = {
static struct clk *camera_clk; static struct clk *camera_clk;
/* set VIO_CKO clock to 25MHz */
#define CEU_MCLK_FREQ 25000000
#define DRVCRB 0xA405018C #define DRVCRB 0xA405018C
static int camera_power(struct device *dev, int mode) static int camera_power(struct device *dev, int mode)
{ {
...@@ -267,8 +271,7 @@ static int camera_power(struct device *dev, int mode) ...@@ -267,8 +271,7 @@ static int camera_power(struct device *dev, int mode)
if (IS_ERR(camera_clk)) if (IS_ERR(camera_clk))
return PTR_ERR(camera_clk); return PTR_ERR(camera_clk);
/* set VIO_CKO clock to 25MHz */ rate = clk_round_rate(camera_clk, CEU_MCLK_FREQ);
rate = clk_round_rate(camera_clk, 25000000);
ret = clk_set_rate(camera_clk, rate); ret = clk_set_rate(camera_clk, rate);
if (ret < 0) if (ret < 0)
goto eclkrate; goto eclkrate;
...@@ -318,11 +321,17 @@ static int camera_power(struct device *dev, int mode) ...@@ -318,11 +321,17 @@ static int camera_power(struct device *dev, int mode)
return ret; return ret;
} }
static struct rj54n1_pdata rj54n1_priv = {
.mclk_freq = CEU_MCLK_FREQ,
.ioctl_high = false,
};
static struct soc_camera_link rj54n1_link = { static struct soc_camera_link rj54n1_link = {
.power = camera_power, .power = camera_power,
.board_info = &kfr2r09_i2c_camera, .board_info = &kfr2r09_i2c_camera,
.i2c_adapter_id = 1, .i2c_adapter_id = 1,
.module_name = "rj54n1cb0c", .module_name = "rj54n1cb0c",
.priv = &rj54n1_priv,
}; };
static struct platform_device kfr2r09_camera = { static struct platform_device kfr2r09_camera = {
......
...@@ -432,23 +432,27 @@ static struct i2c_board_info migor_i2c_camera[] = { ...@@ -432,23 +432,27 @@ static struct i2c_board_info migor_i2c_camera[] = {
static struct ov772x_camera_info ov7725_info = { static struct ov772x_camera_info ov7725_info = {
.buswidth = SOCAM_DATAWIDTH_8, .buswidth = SOCAM_DATAWIDTH_8,
.link = { };
static struct soc_camera_link ov7725_link = {
.power = ov7725_power, .power = ov7725_power,
.board_info = &migor_i2c_camera[0], .board_info = &migor_i2c_camera[0],
.i2c_adapter_id = 0, .i2c_adapter_id = 0,
.module_name = "ov772x", .module_name = "ov772x",
}, .priv = &ov7725_info,
}; };
static struct tw9910_video_info tw9910_info = { static struct tw9910_video_info tw9910_info = {
.buswidth = SOCAM_DATAWIDTH_8, .buswidth = SOCAM_DATAWIDTH_8,
.mpout = TW9910_MPO_FIELD, .mpout = TW9910_MPO_FIELD,
.link = { };
static struct soc_camera_link tw9910_link = {
.power = tw9910_power, .power = tw9910_power,
.board_info = &migor_i2c_camera[1], .board_info = &migor_i2c_camera[1],
.i2c_adapter_id = 0, .i2c_adapter_id = 0,
.module_name = "tw9910", .module_name = "tw9910",
} .priv = &tw9910_info,
}; };
static struct platform_device migor_camera[] = { static struct platform_device migor_camera[] = {
...@@ -456,13 +460,13 @@ static struct platform_device migor_camera[] = { ...@@ -456,13 +460,13 @@ static struct platform_device migor_camera[] = {
.name = "soc-camera-pdrv", .name = "soc-camera-pdrv",
.id = 0, .id = 0,
.dev = { .dev = {
.platform_data = &ov7725_info.link, .platform_data = &ov7725_link,
}, },
}, { }, {
.name = "soc-camera-pdrv", .name = "soc-camera-pdrv",
.id = 1, .id = 1,
.dev = { .dev = {
.platform_data = &tw9910_info.link, .platform_data = &tw9910_link,
}, },
}, },
}; };
......
config IR_CORE
tristate
depends on INPUT
default INPUT
config VIDEO_IR
tristate
depends on IR_CORE
default IR_CORE
ir-common-objs := ir-functions.o ir-keymaps.o
ir-core-objs := ir-keytable.o
obj-$(CONFIG_IR_CORE) += ir-core.o
obj-$(CONFIG_VIDEO_IR) += ir-common.o
...@@ -34,9 +34,6 @@ static int repeat = 1; ...@@ -34,9 +34,6 @@ static int repeat = 1;
module_param(repeat, int, 0444); module_param(repeat, int, 0444);
MODULE_PARM_DESC(repeat,"auto-repeat for IR keys (default: on)"); MODULE_PARM_DESC(repeat,"auto-repeat for IR keys (default: on)");
int media_ir_debug; /* media_ir_debug level (0,1,2) */
module_param_named(debug, media_ir_debug, int, 0644);
/* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */
static void ir_input_key_event(struct input_dev *dev, struct ir_input_state *ir) static void ir_input_key_event(struct input_dev *dev, struct ir_input_state *ir)
...@@ -55,25 +52,10 @@ static void ir_input_key_event(struct input_dev *dev, struct ir_input_state *ir) ...@@ -55,25 +52,10 @@ static void ir_input_key_event(struct input_dev *dev, struct ir_input_state *ir)
/* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */
int ir_input_init(struct input_dev *dev, struct ir_input_state *ir, int ir_input_init(struct input_dev *dev, struct ir_input_state *ir,
int ir_type, struct ir_scancode_table *ir_codes) int ir_type)
{ {
ir->ir_type = ir_type; ir->ir_type = ir_type;
ir->keytable.size = ir_roundup_tablesize(ir_codes->size);
ir->keytable.scan = kzalloc(ir->keytable.size *
sizeof(struct ir_scancode), GFP_KERNEL);
if (!ir->keytable.scan)
return -ENOMEM;
IR_dprintk(1, "Allocated space for %d keycode entries (%zd bytes)\n",
ir->keytable.size,
ir->keytable.size * sizeof(ir->keytable.scan));
ir_copy_table(&ir->keytable, ir_codes);
ir_set_keycode_table(dev, &ir->keytable);
clear_bit(0, dev->keybit);
set_bit(EV_KEY, dev->evbit);
if (repeat) if (repeat)
set_bit(EV_REP, dev->evbit); set_bit(EV_REP, dev->evbit);
......
...@@ -1847,76 +1847,6 @@ struct ir_scancode_table ir_codes_hauppauge_new_table = { ...@@ -1847,76 +1847,6 @@ struct ir_scancode_table ir_codes_hauppauge_new_table = {
}; };
EXPORT_SYMBOL_GPL(ir_codes_hauppauge_new_table); EXPORT_SYMBOL_GPL(ir_codes_hauppauge_new_table);
/*
* Hauppauge:the newer, gray remotes (seems there are multiple
* slightly different versions), shipped with cx88+ivtv cards.
*
* This table contains the complete RC5 code, instead of just the data part
*/
static struct ir_scancode ir_codes_rc5_hauppauge_new[] = {
/* Keys 0 to 9 */
{ 0x1e00, KEY_0 },
{ 0x1e01, KEY_1 },
{ 0x1e02, KEY_2 },
{ 0x1e03, KEY_3 },
{ 0x1e04, KEY_4 },
{ 0x1e05, KEY_5 },
{ 0x1e06, KEY_6 },
{ 0x1e07, KEY_7 },
{ 0x1e08, KEY_8 },
{ 0x1e09, KEY_9 },
{ 0x1e0a, KEY_TEXT }, /* keypad asterisk as well */
{ 0x1e0b, KEY_RED }, /* red button */
{ 0x1e0c, KEY_RADIO },
{ 0x1e0d, KEY_MENU },
{ 0x1e0e, KEY_SUBTITLE }, /* also the # key */
{ 0x1e0f, KEY_MUTE },
{ 0x1e10, KEY_VOLUMEUP },
{ 0x1e11, KEY_VOLUMEDOWN },
{ 0x1e12, KEY_PREVIOUS }, /* previous channel */
{ 0x1e14, KEY_UP },
{ 0x1e15, KEY_DOWN },
{ 0x1e16, KEY_LEFT },
{ 0x1e17, KEY_RIGHT },
{ 0x1e18, KEY_VIDEO }, /* Videos */
{ 0x1e19, KEY_AUDIO }, /* Music */
/* 0x1e1a: Pictures - presume this means
"Multimedia Home Platform" -
no "PICTURES" key in input.h
*/
{ 0x1e1a, KEY_MHP },
{ 0x1e1b, KEY_EPG }, /* Guide */
{ 0x1e1c, KEY_TV },
{ 0x1e1e, KEY_NEXTSONG }, /* skip >| */
{ 0x1e1f, KEY_EXIT }, /* back/exit */
{ 0x1e20, KEY_CHANNELUP }, /* channel / program + */
{ 0x1e21, KEY_CHANNELDOWN }, /* channel / program - */
{ 0x1e22, KEY_CHANNEL }, /* source (old black remote) */
{ 0x1e24, KEY_PREVIOUSSONG }, /* replay |< */
{ 0x1e25, KEY_ENTER }, /* OK */
{ 0x1e26, KEY_SLEEP }, /* minimize (old black remote) */
{ 0x1e29, KEY_BLUE }, /* blue key */
{ 0x1e2e, KEY_GREEN }, /* green button */
{ 0x1e30, KEY_PAUSE }, /* pause */
{ 0x1e32, KEY_REWIND }, /* backward << */
{ 0x1e34, KEY_FASTFORWARD }, /* forward >> */
{ 0x1e35, KEY_PLAY },
{ 0x1e36, KEY_STOP },
{ 0x1e37, KEY_RECORD }, /* recording */
{ 0x1e38, KEY_YELLOW }, /* yellow key */
{ 0x1e3b, KEY_SELECT }, /* top right button */
{ 0x1e3c, KEY_ZOOM }, /* full */
{ 0x1e3d, KEY_POWER }, /* system power (green button) */
};
struct ir_scancode_table ir_codes_rc5_hauppauge_new_table = {
.scan = ir_codes_rc5_hauppauge_new,
.size = ARRAY_SIZE(ir_codes_rc5_hauppauge_new),
};
EXPORT_SYMBOL_GPL(ir_codes_rc5_hauppauge_new_table);
static struct ir_scancode ir_codes_npgtech[] = { static struct ir_scancode ir_codes_npgtech[] = {
{ 0x1d, KEY_SWITCHVIDEOMODE }, /* switch inputs */ { 0x1d, KEY_SWITCHVIDEOMODE }, /* switch inputs */
{ 0x2a, KEY_FRONT }, { 0x2a, KEY_FRONT },
...@@ -3314,3 +3244,152 @@ struct ir_scancode_table ir_codes_gadmei_rm008z_table = { ...@@ -3314,3 +3244,152 @@ struct ir_scancode_table ir_codes_gadmei_rm008z_table = {
}; };
EXPORT_SYMBOL_GPL(ir_codes_gadmei_rm008z_table); EXPORT_SYMBOL_GPL(ir_codes_gadmei_rm008z_table);
/*************************************************************
* COMPLETE SCANCODE TABLES
* Instead of just a partial scancode, the tables bellow
* contains the complete scancode and the receiver protocol
*************************************************************/
/*
* Hauppauge:the newer, gray remotes (seems there are multiple
* slightly different versions), shipped with cx88+ivtv cards.
*
* This table contains the complete RC5 code, instead of just the data part
*/
static struct ir_scancode ir_codes_rc5_hauppauge_new[] = {
/* Keys 0 to 9 */
{ 0x1e00, KEY_0 },
{ 0x1e01, KEY_1 },
{ 0x1e02, KEY_2 },
{ 0x1e03, KEY_3 },
{ 0x1e04, KEY_4 },
{ 0x1e05, KEY_5 },
{ 0x1e06, KEY_6 },
{ 0x1e07, KEY_7 },
{ 0x1e08, KEY_8 },
{ 0x1e09, KEY_9 },
{ 0x1e0a, KEY_TEXT }, /* keypad asterisk as well */
{ 0x1e0b, KEY_RED }, /* red button */
{ 0x1e0c, KEY_RADIO },
{ 0x1e0d, KEY_MENU },
{ 0x1e0e, KEY_SUBTITLE }, /* also the # key */
{ 0x1e0f, KEY_MUTE },
{ 0x1e10, KEY_VOLUMEUP },
{ 0x1e11, KEY_VOLUMEDOWN },
{ 0x1e12, KEY_PREVIOUS }, /* previous channel */
{ 0x1e14, KEY_UP },
{ 0x1e15, KEY_DOWN },
{ 0x1e16, KEY_LEFT },
{ 0x1e17, KEY_RIGHT },
{ 0x1e18, KEY_VIDEO }, /* Videos */
{ 0x1e19, KEY_AUDIO }, /* Music */
/* 0x1e1a: Pictures - presume this means
"Multimedia Home Platform" -
no "PICTURES" key in input.h
*/
{ 0x1e1a, KEY_MHP },
{ 0x1e1b, KEY_EPG }, /* Guide */
{ 0x1e1c, KEY_TV },
{ 0x1e1e, KEY_NEXTSONG }, /* skip >| */
{ 0x1e1f, KEY_EXIT }, /* back/exit */
{ 0x1e20, KEY_CHANNELUP }, /* channel / program + */
{ 0x1e21, KEY_CHANNELDOWN }, /* channel / program - */
{ 0x1e22, KEY_CHANNEL }, /* source (old black remote) */
{ 0x1e24, KEY_PREVIOUSSONG }, /* replay |< */
{ 0x1e25, KEY_ENTER }, /* OK */
{ 0x1e26, KEY_SLEEP }, /* minimize (old black remote) */
{ 0x1e29, KEY_BLUE }, /* blue key */
{ 0x1e2e, KEY_GREEN }, /* green button */
{ 0x1e30, KEY_PAUSE }, /* pause */
{ 0x1e32, KEY_REWIND }, /* backward << */
{ 0x1e34, KEY_FASTFORWARD }, /* forward >> */
{ 0x1e35, KEY_PLAY },
{ 0x1e36, KEY_STOP },
{ 0x1e37, KEY_RECORD }, /* recording */
{ 0x1e38, KEY_YELLOW }, /* yellow key */
{ 0x1e3b, KEY_SELECT }, /* top right button */
{ 0x1e3c, KEY_ZOOM }, /* full */
{ 0x1e3d, KEY_POWER }, /* system power (green button) */
};
struct ir_scancode_table ir_codes_rc5_hauppauge_new_table = {
.scan = ir_codes_rc5_hauppauge_new,
.size = ARRAY_SIZE(ir_codes_rc5_hauppauge_new),
.ir_type = IR_TYPE_RC5,
};
EXPORT_SYMBOL_GPL(ir_codes_rc5_hauppauge_new_table);
/* Terratec Cinergy Hybrid T USB XS FM
Mauro Carvalho Chehab <mchehab@redhat.com>
*/
static struct ir_scancode ir_codes_nec_terratec_cinergy_xs[] = {
{ 0x1441, KEY_HOME},
{ 0x1401, KEY_POWER2},
{ 0x1442, KEY_MENU}, /* DVD menu */
{ 0x1443, KEY_SUBTITLE},
{ 0x1444, KEY_TEXT}, /* Teletext */
{ 0x1445, KEY_DELETE},
{ 0x1402, KEY_1},
{ 0x1403, KEY_2},
{ 0x1404, KEY_3},
{ 0x1405, KEY_4},
{ 0x1406, KEY_5},
{ 0x1407, KEY_6},
{ 0x1408, KEY_7},
{ 0x1409, KEY_8},
{ 0x140a, KEY_9},
{ 0x140c, KEY_0},
{ 0x140b, KEY_TUNER}, /* AV */
{ 0x140d, KEY_MODE}, /* A.B */
{ 0x1446, KEY_TV},
{ 0x1447, KEY_DVD},
{ 0x1449, KEY_VIDEO},
{ 0x144a, KEY_RADIO}, /* Music */
{ 0x144b, KEY_CAMERA}, /* PIC */
{ 0x1410, KEY_UP},
{ 0x1411, KEY_LEFT},
{ 0x1412, KEY_OK},
{ 0x1413, KEY_RIGHT},
{ 0x1414, KEY_DOWN},
{ 0x140f, KEY_EPG},
{ 0x1416, KEY_INFO},
{ 0x144d, KEY_BACKSPACE},
{ 0x141c, KEY_VOLUMEUP},
{ 0x141e, KEY_VOLUMEDOWN},
{ 0x144c, KEY_PLAY},
{ 0x141d, KEY_MUTE},
{ 0x141b, KEY_CHANNELUP},
{ 0x141f, KEY_CHANNELDOWN},
{ 0x1417, KEY_RED},
{ 0x1418, KEY_GREEN},
{ 0x1419, KEY_YELLOW},
{ 0x141a, KEY_BLUE},
{ 0x1458, KEY_RECORD},
{ 0x1448, KEY_STOP},
{ 0x1440, KEY_PAUSE},
{ 0x1454, KEY_LAST},
{ 0x144e, KEY_REWIND},
{ 0x144f, KEY_FASTFORWARD},
{ 0x145c, KEY_NEXT},
};
struct ir_scancode_table ir_codes_nec_terratec_cinergy_xs_table = {
.scan = ir_codes_nec_terratec_cinergy_xs,
.size = ARRAY_SIZE(ir_codes_nec_terratec_cinergy_xs),
.ir_type = IR_TYPE_NEC,
};
EXPORT_SYMBOL_GPL(ir_codes_nec_terratec_cinergy_xs_table);
/* ir-register.c - handle IR scancode->keycode tables /* ir-register.c - handle IR scancode->keycode tables
* *
* Copyright (C) 2009 by Mauro Carvalho Chehab <mchehab@redhat.com> * Copyright (C) 2009 by Mauro Carvalho Chehab <mchehab@redhat.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation version 2 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/usb/input.h>
#include <linux/usb/input.h>
#include <media/ir-common.h> #include <media/ir-common.h>
#define IR_TAB_MIN_SIZE 32 #define IR_TAB_MIN_SIZE 32
...@@ -72,6 +81,7 @@ int ir_roundup_tablesize(int n_elems) ...@@ -72,6 +81,7 @@ int ir_roundup_tablesize(int n_elems)
return n_elems; return n_elems;
} }
EXPORT_SYMBOL_GPL(ir_roundup_tablesize);
/** /**
* ir_copy_table() - copies a keytable, discarding the unused entries * ir_copy_table() - copies a keytable, discarding the unused entries
...@@ -100,6 +110,7 @@ int ir_copy_table(struct ir_scancode_table *destin, ...@@ -100,6 +110,7 @@ int ir_copy_table(struct ir_scancode_table *destin,
return 0; return 0;
} }
EXPORT_SYMBOL_GPL(ir_copy_table);
/** /**
* ir_getkeycode() - get a keycode at the evdev scancode ->keycode table * ir_getkeycode() - get a keycode at the evdev scancode ->keycode table
...@@ -114,7 +125,8 @@ static int ir_getkeycode(struct input_dev *dev, ...@@ -114,7 +125,8 @@ static int ir_getkeycode(struct input_dev *dev,
int scancode, int *keycode) int scancode, int *keycode)
{ {
int elem; int elem;
struct ir_scancode_table *rc_tab = input_get_drvdata(dev); struct ir_input_dev *ir_dev = input_get_drvdata(dev);
struct ir_scancode_table *rc_tab = &ir_dev->rc_tab;
elem = ir_seek_table(rc_tab, scancode); elem = ir_seek_table(rc_tab, scancode);
if (elem >= 0) { if (elem >= 0) {
...@@ -136,7 +148,6 @@ static int ir_getkeycode(struct input_dev *dev, ...@@ -136,7 +148,6 @@ static int ir_getkeycode(struct input_dev *dev,
return 0; return 0;
} }
/** /**
* ir_is_resize_needed() - Check if the table needs rezise * ir_is_resize_needed() - Check if the table needs rezise
* @table: keycode table that may need to resize * @table: keycode table that may need to resize
...@@ -286,7 +297,8 @@ static int ir_setkeycode(struct input_dev *dev, ...@@ -286,7 +297,8 @@ static int ir_setkeycode(struct input_dev *dev,
int scancode, int keycode) int scancode, int keycode)
{ {
int rc = 0; int rc = 0;
struct ir_scancode_table *rc_tab = input_get_drvdata(dev); struct ir_input_dev *ir_dev = input_get_drvdata(dev);
struct ir_scancode_table *rc_tab = &ir_dev->rc_tab;
struct ir_scancode *keymap = rc_tab->scan; struct ir_scancode *keymap = rc_tab->scan;
unsigned long flags; unsigned long flags;
...@@ -360,7 +372,8 @@ static int ir_setkeycode(struct input_dev *dev, ...@@ -360,7 +372,8 @@ static int ir_setkeycode(struct input_dev *dev,
*/ */
u32 ir_g_keycode_from_table(struct input_dev *dev, u32 scancode) u32 ir_g_keycode_from_table(struct input_dev *dev, u32 scancode)
{ {
struct ir_scancode_table *rc_tab = input_get_drvdata(dev); struct ir_input_dev *ir_dev = input_get_drvdata(dev);
struct ir_scancode_table *rc_tab = &ir_dev->rc_tab;
struct ir_scancode *keymap = rc_tab->scan; struct ir_scancode *keymap = rc_tab->scan;
int elem; int elem;
...@@ -378,9 +391,10 @@ u32 ir_g_keycode_from_table(struct input_dev *dev, u32 scancode) ...@@ -378,9 +391,10 @@ u32 ir_g_keycode_from_table(struct input_dev *dev, u32 scancode)
/* Reports userspace that an unknown keycode were got */ /* Reports userspace that an unknown keycode were got */
return KEY_RESERVED; return KEY_RESERVED;
} }
EXPORT_SYMBOL_GPL(ir_g_keycode_from_table);
/** /**
* ir_set_keycode_table() - sets the IR keycode table and add the handlers * ir_input_register() - sets the IR keycode table and add the handlers
* for keymap table get/set * for keymap table get/set
* @input_dev: the struct input_dev descriptor of the device * @input_dev: the struct input_dev descriptor of the device
* @rc_tab: the struct ir_scancode_table table of scancode/keymap * @rc_tab: the struct ir_scancode_table table of scancode/keymap
...@@ -389,17 +403,34 @@ u32 ir_g_keycode_from_table(struct input_dev *dev, u32 scancode) ...@@ -389,17 +403,34 @@ u32 ir_g_keycode_from_table(struct input_dev *dev, u32 scancode)
* an IR. * an IR.
* It should be called before registering the IR device. * It should be called before registering the IR device.
*/ */
int ir_set_keycode_table(struct input_dev *input_dev, int ir_input_register(struct input_dev *input_dev,
struct ir_scancode_table *rc_tab) struct ir_scancode_table *rc_tab)
{ {
struct ir_input_dev *ir_dev;
struct ir_scancode *keymap = rc_tab->scan; struct ir_scancode *keymap = rc_tab->scan;
int i; int i, rc;
spin_lock_init(&rc_tab->lock);
if (rc_tab->scan == NULL || !rc_tab->size) if (rc_tab->scan == NULL || !rc_tab->size)
return -EINVAL; return -EINVAL;
ir_dev = kzalloc(sizeof(*ir_dev), GFP_KERNEL);
if (!ir_dev)
return -ENOMEM;
spin_lock_init(&rc_tab->lock);
ir_dev->rc_tab.size = ir_roundup_tablesize(rc_tab->size);
ir_dev->rc_tab.scan = kzalloc(ir_dev->rc_tab.size *
sizeof(struct ir_scancode), GFP_KERNEL);
if (!ir_dev->rc_tab.scan)
return -ENOMEM;
IR_dprintk(1, "Allocated space for %d keycode entries (%zd bytes)\n",
ir_dev->rc_tab.size,
ir_dev->rc_tab.size * sizeof(ir_dev->rc_tab.scan));
ir_copy_table(&ir_dev->rc_tab, rc_tab);
/* set the bits for the keys */ /* set the bits for the keys */
IR_dprintk(1, "key map size: %d\n", rc_tab->size); IR_dprintk(1, "key map size: %d\n", rc_tab->size);
for (i = 0; i < rc_tab->size; i++) { for (i = 0; i < rc_tab->size; i++) {
...@@ -407,23 +438,48 @@ int ir_set_keycode_table(struct input_dev *input_dev, ...@@ -407,23 +438,48 @@ int ir_set_keycode_table(struct input_dev *input_dev,
i, keymap[i].keycode); i, keymap[i].keycode);
set_bit(keymap[i].keycode, input_dev->keybit); set_bit(keymap[i].keycode, input_dev->keybit);
} }
clear_bit(0, input_dev->keybit);
set_bit(EV_KEY, input_dev->evbit);
input_dev->getkeycode = ir_getkeycode; input_dev->getkeycode = ir_getkeycode;
input_dev->setkeycode = ir_setkeycode; input_dev->setkeycode = ir_setkeycode;
input_set_drvdata(input_dev, rc_tab); input_set_drvdata(input_dev, ir_dev);
return 0; rc = input_register_device(input_dev);
if (rc < 0) {
kfree(rc_tab->scan);
kfree(ir_dev);
input_set_drvdata(input_dev, NULL);
}
return rc;
} }
EXPORT_SYMBOL_GPL(ir_input_register);
void ir_input_free(struct input_dev *dev) void ir_input_unregister(struct input_dev *dev)
{ {
struct ir_scancode_table *rc_tab = input_get_drvdata(dev); struct ir_input_dev *ir_dev = input_get_drvdata(dev);
struct ir_scancode_table *rc_tab;
if (!ir_dev)
return;
IR_dprintk(1, "Freed keycode table\n"); IR_dprintk(1, "Freed keycode table\n");
rc_tab = &ir_dev->rc_tab;
rc_tab->size = 0; rc_tab->size = 0;
kfree(rc_tab->scan); kfree(rc_tab->scan);
rc_tab->scan = NULL; rc_tab->scan = NULL;
kfree(ir_dev);
input_unregister_device(dev);
} }
EXPORT_SYMBOL_GPL(ir_input_free); EXPORT_SYMBOL_GPL(ir_input_unregister);
int ir_core_debug; /* ir_debug level (0,1,2) */
EXPORT_SYMBOL_GPL(ir_core_debug);
module_param_named(debug, ir_core_debug, int, 0644);
MODULE_AUTHOR("Mauro Carvalho Chehab <mchehab@redhat.com>");
MODULE_LICENSE("GPL");
...@@ -99,6 +99,7 @@ config VIDEO_MEDIA ...@@ -99,6 +99,7 @@ config VIDEO_MEDIA
comment "Multimedia drivers" comment "Multimedia drivers"
source "drivers/media/common/Kconfig" source "drivers/media/common/Kconfig"
source "drivers/media/IR/Kconfig"
# #
# Tuner drivers for DVB and V4L # Tuner drivers for DVB and V4L
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# Makefile for the kernel multimedia device drivers. # Makefile for the kernel multimedia device drivers.
# #
obj-y += common/ video/ obj-y += common/ IR/ video/
obj-$(CONFIG_VIDEO_DEV) += radio/ obj-$(CONFIG_VIDEO_DEV) += radio/
obj-$(CONFIG_DVB_CORE) += dvb/ obj-$(CONFIG_DVB_CORE) += dvb/
saa7146-objs := saa7146_i2c.o saa7146_core.o saa7146-objs := saa7146_i2c.o saa7146_core.o
saa7146_vv-objs := saa7146_fops.o saa7146_video.o saa7146_hlp.o saa7146_vbi.o saa7146_vv-objs := saa7146_fops.o saa7146_video.o saa7146_hlp.o saa7146_vbi.o
ir-common-objs := ir-functions.o ir-keymaps.o ir-keytable.o
obj-y += tuners/ obj-y += tuners/
obj-$(CONFIG_VIDEO_SAA7146) += saa7146.o obj-$(CONFIG_VIDEO_SAA7146) += saa7146.o
obj-$(CONFIG_VIDEO_SAA7146_VV) += saa7146_vv.o obj-$(CONFIG_VIDEO_SAA7146_VV) += saa7146_vv.o
obj-$(CONFIG_VIDEO_IR) += ir-common.o
#include <media/saa7146_vv.h> #include <media/saa7146_vv.h>
#define BOARD_CAN_DO_VBI(dev) (dev->revision != 0 && dev->vv_data->vbi_minor != -1)
/****************************************************************************/ /****************************************************************************/
/* resource management functions, shamelessly stolen from saa7134 driver */ /* resource management functions, shamelessly stolen from saa7134 driver */
...@@ -194,43 +192,24 @@ void saa7146_buffer_timeout(unsigned long data) ...@@ -194,43 +192,24 @@ void saa7146_buffer_timeout(unsigned long data)
static int fops_open(struct file *file) static int fops_open(struct file *file)
{ {
unsigned int minor = video_devdata(file)->minor; struct video_device *vdev = video_devdata(file);
struct saa7146_dev *h = NULL, *dev = NULL; struct saa7146_dev *dev = video_drvdata(file);
struct list_head *list;
struct saa7146_fh *fh = NULL; struct saa7146_fh *fh = NULL;
int result = 0; int result = 0;
enum v4l2_buf_type type = V4L2_BUF_TYPE_VIDEO_CAPTURE; enum v4l2_buf_type type;
DEB_EE(("file:%p, minor:%d\n", file, minor)); DEB_EE(("file:%p, dev:%s\n", file, video_device_node_name(vdev)));
if (mutex_lock_interruptible(&saa7146_devices_lock)) if (mutex_lock_interruptible(&saa7146_devices_lock))
return -ERESTARTSYS; return -ERESTARTSYS;
list_for_each(list,&saa7146_devices) {
h = list_entry(list, struct saa7146_dev, item);
if( NULL == h->vv_data ) {
DEB_D(("device %p has not registered video devices.\n",h));
continue;
}
DEB_D(("trying: %p @ major %d,%d\n",h,h->vv_data->video_minor,h->vv_data->vbi_minor));
if (h->vv_data->video_minor == minor) {
dev = h;
}
if (h->vv_data->vbi_minor == minor) {
type = V4L2_BUF_TYPE_VBI_CAPTURE;
dev = h;
}
}
if (NULL == dev) {
DEB_S(("no such video device.\n"));
result = -ENODEV;
goto out;
}
DEB_D(("using: %p\n",dev)); DEB_D(("using: %p\n",dev));
type = vdev->vfl_type == VFL_TYPE_GRABBER
? V4L2_BUF_TYPE_VIDEO_CAPTURE
: V4L2_BUF_TYPE_VBI_CAPTURE;
/* check if an extension is registered */ /* check if an extension is registered */
if( NULL == dev->ext ) { if( NULL == dev->ext ) {
DEB_S(("no extension registered for this device.\n")); DEB_S(("no extension registered for this device.\n"));
...@@ -474,9 +453,6 @@ int saa7146_vv_init(struct saa7146_dev* dev, struct saa7146_ext_vv *ext_vv) ...@@ -474,9 +453,6 @@ int saa7146_vv_init(struct saa7146_dev* dev, struct saa7146_ext_vv *ext_vv)
configuration data) */ configuration data) */
dev->ext_vv_data = ext_vv; dev->ext_vv_data = ext_vv;
vv->video_minor = -1;
vv->vbi_minor = -1;
vv->d_clipping.cpu_addr = pci_alloc_consistent(dev->pci, SAA7146_CLIPPING_MEM, &vv->d_clipping.dma_handle); vv->d_clipping.cpu_addr = pci_alloc_consistent(dev->pci, SAA7146_CLIPPING_MEM, &vv->d_clipping.dma_handle);
if( NULL == vv->d_clipping.cpu_addr ) { if( NULL == vv->d_clipping.cpu_addr ) {
ERR(("out of memory. aborting.\n")); ERR(("out of memory. aborting.\n"));
...@@ -515,7 +491,6 @@ EXPORT_SYMBOL_GPL(saa7146_vv_release); ...@@ -515,7 +491,6 @@ EXPORT_SYMBOL_GPL(saa7146_vv_release);
int saa7146_register_device(struct video_device **vid, struct saa7146_dev* dev, int saa7146_register_device(struct video_device **vid, struct saa7146_dev* dev,
char *name, int type) char *name, int type)
{ {
struct saa7146_vv *vv = dev->vv_data;
struct video_device *vfd; struct video_device *vfd;
int err; int err;
int i; int i;
...@@ -543,15 +518,8 @@ int saa7146_register_device(struct video_device **vid, struct saa7146_dev* dev, ...@@ -543,15 +518,8 @@ int saa7146_register_device(struct video_device **vid, struct saa7146_dev* dev,
return err; return err;
} }
if( VFL_TYPE_GRABBER == type ) { INFO(("%s: registered device %s [v4l2]\n",
vv->video_minor = vfd->minor; dev->name, video_device_node_name(vfd)));
INFO(("%s: registered device video%d [v4l2]\n",
dev->name, vfd->num));
} else {
vv->vbi_minor = vfd->minor;
INFO(("%s: registered device vbi%d [v4l2]\n",
dev->name, vfd->num));
}
*vid = vfd; *vid = vfd;
return 0; return 0;
...@@ -560,16 +528,8 @@ EXPORT_SYMBOL_GPL(saa7146_register_device); ...@@ -560,16 +528,8 @@ EXPORT_SYMBOL_GPL(saa7146_register_device);
int saa7146_unregister_device(struct video_device **vid, struct saa7146_dev* dev) int saa7146_unregister_device(struct video_device **vid, struct saa7146_dev* dev)
{ {
struct saa7146_vv *vv = dev->vv_data;
DEB_EE(("dev:%p\n",dev)); DEB_EE(("dev:%p\n",dev));
if ((*vid)->vfl_type == VFL_TYPE_GRABBER) {
vv->video_minor = -1;
} else {
vv->vbi_minor = -1;
}
video_unregister_device(*vid); video_unregister_device(*vid);
*vid = NULL; *vid = NULL;
......
...@@ -589,7 +589,7 @@ int __devinit dm1105_ir_init(struct dm1105dvb *dm1105) ...@@ -589,7 +589,7 @@ int __devinit dm1105_ir_init(struct dm1105dvb *dm1105)
snprintf(dm1105->ir.input_phys, sizeof(dm1105->ir.input_phys), snprintf(dm1105->ir.input_phys, sizeof(dm1105->ir.input_phys),
"pci-%s/ir0", pci_name(dm1105->pdev)); "pci-%s/ir0", pci_name(dm1105->pdev));
err = ir_input_init(input_dev, &dm1105->ir.ir, ir_type, ir_codes); err = ir_input_init(input_dev, &dm1105->ir.ir, ir_type);
if (err < 0) { if (err < 0) {
input_free_device(input_dev); input_free_device(input_dev);
return err; return err;
...@@ -611,20 +611,14 @@ int __devinit dm1105_ir_init(struct dm1105dvb *dm1105) ...@@ -611,20 +611,14 @@ int __devinit dm1105_ir_init(struct dm1105dvb *dm1105)
INIT_WORK(&dm1105->ir.work, dm1105_emit_key); INIT_WORK(&dm1105->ir.work, dm1105_emit_key);
err = input_register_device(input_dev); err = ir_input_register(input_dev, ir_codes);
if (err) {
ir_input_free(input_dev);
input_free_device(input_dev);
return err;
}
return 0; return err;
} }
void __devexit dm1105_ir_exit(struct dm1105dvb *dm1105) void __devexit dm1105_ir_exit(struct dm1105dvb *dm1105)
{ {
ir_input_free(dm1105->ir.input_dev); ir_input_unregister(dm1105->ir.input_dev);
input_unregister_device(dm1105->ir.input_dev);
} }
static int __devinit dm1105dvb_hw_init(struct dm1105dvb *dm1105dvb) static int __devinit dm1105dvb_hw_init(struct dm1105dvb *dm1105dvb)
......
...@@ -265,9 +265,13 @@ config DVB_USB_DW2102 ...@@ -265,9 +265,13 @@ config DVB_USB_DW2102
select DVB_TDA10021 if !DVB_FE_CUSTOMISE select DVB_TDA10021 if !DVB_FE_CUSTOMISE
select DVB_MT312 if !DVB_FE_CUSTOMISE select DVB_MT312 if !DVB_FE_CUSTOMISE
select DVB_ZL10039 if !DVB_FE_CUSTOMISE select DVB_ZL10039 if !DVB_FE_CUSTOMISE
select DVB_DS3000 if !DVB_FE_CUSTOMISE
select DVB_STB6100 if !DVB_FE_CUSTOMISE
select DVB_STV6110 if !DVB_FE_CUSTOMISE
select DVB_STV0900 if !DVB_FE_CUSTOMISE
help help
Say Y here to support the DvbWorld DVB-S/S2 USB2.0 receivers Say Y here to support the DvbWorld, TeVii, Prof DVB-S/S2 USB2.0
and the TeVii S650, S630. receivers.
config DVB_USB_CINERGY_T2 config DVB_USB_CINERGY_T2
tristate "Terratec CinergyT2/qanu USB 2.0 DVB-T receiver" tristate "Terratec CinergyT2/qanu USB 2.0 DVB-T receiver"
......
...@@ -20,6 +20,8 @@ extern int dvb_usb_dib0700_debug; ...@@ -20,6 +20,8 @@ extern int dvb_usb_dib0700_debug;
#define deb_fwdata(args...) dprintk(dvb_usb_dib0700_debug,0x04,args) #define deb_fwdata(args...) dprintk(dvb_usb_dib0700_debug,0x04,args)
#define deb_data(args...) dprintk(dvb_usb_dib0700_debug,0x08,args) #define deb_data(args...) dprintk(dvb_usb_dib0700_debug,0x08,args)
#define REQUEST_SET_USB_XFER_LEN 0x0 /* valid only for firmware version */
/* higher than 1.21 */
#define REQUEST_I2C_READ 0x2 #define REQUEST_I2C_READ 0x2
#define REQUEST_I2C_WRITE 0x3 #define REQUEST_I2C_WRITE 0x3
#define REQUEST_POLL_RC 0x4 /* deprecated in firmware v1.20 */ #define REQUEST_POLL_RC 0x4 /* deprecated in firmware v1.20 */
...@@ -44,6 +46,8 @@ struct dib0700_state { ...@@ -44,6 +46,8 @@ struct dib0700_state {
u8 is_dib7000pc; u8 is_dib7000pc;
u8 fw_use_new_i2c_api; u8 fw_use_new_i2c_api;
u8 disable_streaming_master_mode; u8 disable_streaming_master_mode;
u32 fw_version;
u32 nb_packet_buffer_size;
}; };
extern int dib0700_get_version(struct dvb_usb_device *d, u32 *hwversion, extern int dib0700_get_version(struct dvb_usb_device *d, u32 *hwversion,
......
...@@ -17,6 +17,14 @@ int dvb_usb_dib0700_ir_proto = 1; ...@@ -17,6 +17,14 @@ int dvb_usb_dib0700_ir_proto = 1;
module_param(dvb_usb_dib0700_ir_proto, int, 0644); module_param(dvb_usb_dib0700_ir_proto, int, 0644);
MODULE_PARM_DESC(dvb_usb_dib0700_ir_proto, "set ir protocol (0=NEC, 1=RC5 (default), 2=RC6)."); MODULE_PARM_DESC(dvb_usb_dib0700_ir_proto, "set ir protocol (0=NEC, 1=RC5 (default), 2=RC6).");
static int nb_packet_buffer_size = 21;
module_param(nb_packet_buffer_size, int, 0644);
MODULE_PARM_DESC(nb_packet_buffer_size,
"Set the dib0700 driver data buffer size. This parameter "
"corresponds to the number of TS packets. The actual size of "
"the data buffer corresponds to this parameter "
"multiplied by 188 (default: 21)");
DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr); DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
...@@ -28,9 +36,13 @@ int dib0700_get_version(struct dvb_usb_device *d, u32 *hwversion, ...@@ -28,9 +36,13 @@ int dib0700_get_version(struct dvb_usb_device *d, u32 *hwversion,
REQUEST_GET_VERSION, REQUEST_GET_VERSION,
USB_TYPE_VENDOR | USB_DIR_IN, 0, 0, USB_TYPE_VENDOR | USB_DIR_IN, 0, 0,
b, sizeof(b), USB_CTRL_GET_TIMEOUT); b, sizeof(b), USB_CTRL_GET_TIMEOUT);
if (hwversion != NULL)
*hwversion = (b[0] << 24) | (b[1] << 16) | (b[2] << 8) | b[3]; *hwversion = (b[0] << 24) | (b[1] << 16) | (b[2] << 8) | b[3];
if (romversion != NULL)
*romversion = (b[4] << 24) | (b[5] << 16) | (b[6] << 8) | b[7]; *romversion = (b[4] << 24) | (b[5] << 16) | (b[6] << 8) | b[7];
if (ramversion != NULL)
*ramversion = (b[8] << 24) | (b[9] << 16) | (b[10] << 8) | b[11]; *ramversion = (b[8] << 24) | (b[9] << 16) | (b[10] << 8) | b[11];
if (fwtype != NULL)
*fwtype = (b[12] << 24) | (b[13] << 16) | (b[14] << 8) | b[15]; *fwtype = (b[12] << 24) | (b[13] << 16) | (b[14] << 8) | b[15];
return ret; return ret;
} }
...@@ -97,6 +109,27 @@ int dib0700_set_gpio(struct dvb_usb_device *d, enum dib07x0_gpios gpio, u8 gpio_ ...@@ -97,6 +109,27 @@ int dib0700_set_gpio(struct dvb_usb_device *d, enum dib07x0_gpios gpio, u8 gpio_
return dib0700_ctrl_wr(d,buf,3); return dib0700_ctrl_wr(d,buf,3);
} }
static int dib0700_set_usb_xfer_len(struct dvb_usb_device *d, u16 nb_ts_packets)
{
struct dib0700_state *st = d->priv;
u8 b[3];
int ret;
if (st->fw_version >= 0x10201) {
b[0] = REQUEST_SET_USB_XFER_LEN;
b[1] = (nb_ts_packets >> 8)&0xff;
b[2] = nb_ts_packets & 0xff;
deb_info("set the USB xfer len to %i Ts packet\n", nb_ts_packets);
ret = dib0700_ctrl_wr(d, b, 3);
} else {
deb_info("this firmware does not allow to change the USB xfer len\n");
ret = -EIO;
}
return ret;
}
/* /*
* I2C master xfer function (supported in 1.20 firmware) * I2C master xfer function (supported in 1.20 firmware)
*/ */
...@@ -328,7 +361,9 @@ static int dib0700_jumpram(struct usb_device *udev, u32 address) ...@@ -328,7 +361,9 @@ static int dib0700_jumpram(struct usb_device *udev, u32 address)
int dib0700_download_firmware(struct usb_device *udev, const struct firmware *fw) int dib0700_download_firmware(struct usb_device *udev, const struct firmware *fw)
{ {
struct hexline hx; struct hexline hx;
int pos = 0, ret, act_len; int pos = 0, ret, act_len, i, adap_num;
u8 b[16];
u32 fw_version;
u8 buf[260]; u8 buf[260];
...@@ -364,6 +399,34 @@ int dib0700_download_firmware(struct usb_device *udev, const struct firmware *fw ...@@ -364,6 +399,34 @@ int dib0700_download_firmware(struct usb_device *udev, const struct firmware *fw
} else } else
ret = -EIO; ret = -EIO;
/* the number of ts packet has to be at least 1 */
if (nb_packet_buffer_size < 1)
nb_packet_buffer_size = 1;
/* get the fimware version */
usb_control_msg(udev, usb_rcvctrlpipe(udev, 0),
REQUEST_GET_VERSION,
USB_TYPE_VENDOR | USB_DIR_IN, 0, 0,
b, sizeof(b), USB_CTRL_GET_TIMEOUT);
fw_version = (b[8] << 24) | (b[9] << 16) | (b[10] << 8) | b[11];
/* set the buffer size - DVB-USB is allocating URB buffers
* only after the firwmare download was successful */
for (i = 0; i < dib0700_device_count; i++) {
for (adap_num = 0; adap_num < dib0700_devices[i].num_adapters;
adap_num++) {
if (fw_version >= 0x10201)
dib0700_devices[i].adapter[adap_num].stream.u.bulk.buffersize = 188*nb_packet_buffer_size;
else {
/* for fw version older than 1.20.1,
* the buffersize has to be n times 512 */
dib0700_devices[i].adapter[adap_num].stream.u.bulk.buffersize = ((188*nb_packet_buffer_size+188/2)/512)*512;
if (dib0700_devices[i].adapter[adap_num].stream.u.bulk.buffersize < 512)
dib0700_devices[i].adapter[adap_num].stream.u.bulk.buffersize = 512;
}
}
}
return ret; return ret;
} }
...@@ -371,6 +434,18 @@ int dib0700_streaming_ctrl(struct dvb_usb_adapter *adap, int onoff) ...@@ -371,6 +434,18 @@ int dib0700_streaming_ctrl(struct dvb_usb_adapter *adap, int onoff)
{ {
struct dib0700_state *st = adap->dev->priv; struct dib0700_state *st = adap->dev->priv;
u8 b[4]; u8 b[4];
int ret;
if ((onoff != 0) && (st->fw_version >= 0x10201)) {
/* for firmware later than 1.20.1,
* the USB xfer length can be set */
ret = dib0700_set_usb_xfer_len(adap->dev,
st->nb_packet_buffer_size);
if (ret < 0) {
deb_info("can not set the USB xfer len\n");
return ret;
}
}
b[0] = REQUEST_ENABLE_VIDEO; b[0] = REQUEST_ENABLE_VIDEO;
b[1] = (onoff << 4) | 0x00; /* this bit gives a kind of command, rather than enabling something or not */ b[1] = (onoff << 4) | 0x00; /* this bit gives a kind of command, rather than enabling something or not */
...@@ -415,9 +490,21 @@ static int dib0700_probe(struct usb_interface *intf, ...@@ -415,9 +490,21 @@ static int dib0700_probe(struct usb_interface *intf,
for (i = 0; i < dib0700_device_count; i++) for (i = 0; i < dib0700_device_count; i++)
if (dvb_usb_device_init(intf, &dib0700_devices[i], THIS_MODULE, if (dvb_usb_device_init(intf, &dib0700_devices[i], THIS_MODULE,
&dev, adapter_nr) == 0) &dev, adapter_nr) == 0) {
{ struct dib0700_state *st = dev->priv;
u32 hwversion, romversion, fw_version, fwtype;
dib0700_get_version(dev, &hwversion, &romversion,
&fw_version, &fwtype);
deb_info("Firmware version: %x, %d, 0x%x, %d\n",
hwversion, romversion, fw_version, fwtype);
st->fw_version = fw_version;
st->nb_packet_buffer_size = (u32)nb_packet_buffer_size;
dib0700_rc_setup(dev); dib0700_rc_setup(dev);
return 0; return 0;
} }
......
This diff is collapsed.
...@@ -142,9 +142,14 @@ static int dibusb_i2c_xfer(struct i2c_adapter *adap,struct i2c_msg msg[],int num ...@@ -142,9 +142,14 @@ static int dibusb_i2c_xfer(struct i2c_adapter *adap,struct i2c_msg msg[],int num
} else if ((msg[i].flags & I2C_M_RD) == 0) { } else if ((msg[i].flags & I2C_M_RD) == 0) {
if (dibusb_i2c_msg(d, msg[i].addr, msg[i].buf,msg[i].len,NULL,0) < 0) if (dibusb_i2c_msg(d, msg[i].addr, msg[i].buf,msg[i].len,NULL,0) < 0)
break; break;
} else } else if (msg[i].addr != 0x50) {
/* 0x50 is the address of the eeprom - we need to protect it
* from dibusb's bad i2c implementation: reads without
* writing the offset before are forbidden */
if (dibusb_i2c_msg(d, msg[i].addr, NULL, 0, msg[i].buf, msg[i].len) < 0)
break; break;
} }
}
mutex_unlock(&d->i2c_mutex); mutex_unlock(&d->i2c_mutex);
return i; return i;
...@@ -243,6 +248,12 @@ static struct dib3000mc_config mod3000p_dib3000p_config = { ...@@ -243,6 +248,12 @@ static struct dib3000mc_config mod3000p_dib3000p_config = {
int dibusb_dib3000mc_frontend_attach(struct dvb_usb_adapter *adap) int dibusb_dib3000mc_frontend_attach(struct dvb_usb_adapter *adap)
{ {
if (adap->dev->udev->descriptor.idVendor == USB_VID_LITEON &&
adap->dev->udev->descriptor.idProduct ==
USB_PID_LITEON_DVB_T_WARM) {
msleep(1000);
}
if ((adap->fe = dvb_attach(dib3000mc_attach, &adap->dev->i2c_adap, DEFAULT_DIB3000P_I2C_ADDRESS, &mod3000p_dib3000p_config)) != NULL || if ((adap->fe = dvb_attach(dib3000mc_attach, &adap->dev->i2c_adap, DEFAULT_DIB3000P_I2C_ADDRESS, &mod3000p_dib3000p_config)) != NULL ||
(adap->fe = dvb_attach(dib3000mc_attach, &adap->dev->i2c_adap, DEFAULT_DIB3000MC_I2C_ADDRESS, &mod3000p_dib3000p_config)) != NULL) { (adap->fe = dvb_attach(dib3000mc_attach, &adap->dev->i2c_adap, DEFAULT_DIB3000MC_I2C_ADDRESS, &mod3000p_dib3000p_config)) != NULL) {
if (adap->priv != NULL) { if (adap->priv != NULL) {
......
...@@ -47,6 +47,7 @@ ...@@ -47,6 +47,7 @@
#define USB_VID_MSI_2 0x1462 #define USB_VID_MSI_2 0x1462
#define USB_VID_OPERA1 0x695c #define USB_VID_OPERA1 0x695c
#define USB_VID_PINNACLE 0x2304 #define USB_VID_PINNACLE 0x2304
#define USB_VID_PCTV 0x2013
#define USB_VID_PIXELVIEW 0x1554 #define USB_VID_PIXELVIEW 0x1554
#define USB_VID_TECHNOTREND 0x0b48 #define USB_VID_TECHNOTREND 0x0b48
#define USB_VID_TERRATEC 0x0ccd #define USB_VID_TERRATEC 0x0ccd
...@@ -101,6 +102,7 @@ ...@@ -101,6 +102,7 @@
#define USB_PID_DIBCOM_STK7070PD 0x1ebe #define USB_PID_DIBCOM_STK7070PD 0x1ebe
#define USB_PID_DIBCOM_STK807XP 0x1f90 #define USB_PID_DIBCOM_STK807XP 0x1f90
#define USB_PID_DIBCOM_STK807XPVR 0x1f98 #define USB_PID_DIBCOM_STK807XPVR 0x1f98
#define USB_PID_DIBCOM_STK8096GP 0x1fa0
#define USB_PID_DIBCOM_ANCHOR_2135_COLD 0x2131 #define USB_PID_DIBCOM_ANCHOR_2135_COLD 0x2131
#define USB_PID_DIBCOM_STK7770P 0x1e80 #define USB_PID_DIBCOM_STK7770P 0x1e80
#define USB_PID_DPOSH_M9206_COLD 0x9206 #define USB_PID_DPOSH_M9206_COLD 0x9206
...@@ -211,6 +213,7 @@ ...@@ -211,6 +213,7 @@
#define USB_PID_PINNACLE_PCTV801E_SE 0x023b #define USB_PID_PINNACLE_PCTV801E_SE 0x023b
#define USB_PID_PINNACLE_PCTV73A 0x0243 #define USB_PID_PINNACLE_PCTV73A 0x0243
#define USB_PID_PINNACLE_PCTV73ESE 0x0245 #define USB_PID_PINNACLE_PCTV73ESE 0x0245
#define USB_PID_PINNACLE_PCTV74E 0x0246
#define USB_PID_PINNACLE_PCTV282E 0x0248 #define USB_PID_PINNACLE_PCTV282E 0x0248
#define USB_PID_PIXELVIEW_SBTVD 0x5010 #define USB_PID_PIXELVIEW_SBTVD 0x5010
#define USB_PID_PCTV_200E 0x020e #define USB_PID_PCTV_200E 0x020e
......
This diff is collapsed.
...@@ -134,11 +134,13 @@ static int jdvbt90502_pll_set_freq(struct jdvbt90502_state *state, u32 freq) ...@@ -134,11 +134,13 @@ static int jdvbt90502_pll_set_freq(struct jdvbt90502_state *state, u32 freq)
deb_fe("%s: freq=%d, step=%d\n", __func__, freq, deb_fe("%s: freq=%d, step=%d\n", __func__, freq,
state->frontend.ops.info.frequency_stepsize); state->frontend.ops.info.frequency_stepsize);
/* freq -> oscilator frequency conversion. */ /* freq -> oscilator frequency conversion. */
/* freq: 473,000,000 + n*6,000,000 (no 1/7MHz shift to center freq) */ /* freq: 473,000,000 + n*6,000,000 [+ 142857 (center freq. shift)] */
/* add 400[1/7 MHZ] = 57.142857MHz. 57MHz for the IF, */
/* 1/7MHz for center freq shift */
f = freq / state->frontend.ops.info.frequency_stepsize; f = freq / state->frontend.ops.info.frequency_stepsize;
f += 400; /* add 399[1/7 MHZ] = 57MHz for the IF */
f += 399;
/* add center frequency shift if necessary */
if (f % 7 == 0)
f++;
pll_freq_cmd[DEMOD_REDIRECT_REG] = JDVBT90502_2ND_I2C_REG; /* 0xFE */ pll_freq_cmd[DEMOD_REDIRECT_REG] = JDVBT90502_2ND_I2C_REG; /* 0xFE */
pll_freq_cmd[ADDRESS_BYTE] = state->config.pll_address << 1; pll_freq_cmd[ADDRESS_BYTE] = state->config.pll_address << 1;
pll_freq_cmd[DIVIDER_BYTE1] = (f >> 8) & 0x7F; pll_freq_cmd[DIVIDER_BYTE1] = (f >> 8) & 0x7F;
......
...@@ -146,8 +146,8 @@ static int gp8psk_fe_set_frontend(struct dvb_frontend* fe, ...@@ -146,8 +146,8 @@ static int gp8psk_fe_set_frontend(struct dvb_frontend* fe,
switch (c->delivery_system) { switch (c->delivery_system) {
case SYS_DVBS: case SYS_DVBS:
/* Only QPSK is supported for DVB-S */ /* Allow QPSK and 8PSK (even for DVB-S) */
if (c->modulation != QPSK) { if (c->modulation != QPSK && c->modulation != PSK_8) {
deb_fe("%s: unsupported modulation selected (%d)\n", deb_fe("%s: unsupported modulation selected (%d)\n",
__func__, c->modulation); __func__, c->modulation);
return -EOPNOTSUPP; return -EOPNOTSUPP;
......
...@@ -526,6 +526,15 @@ config DVB_TUNER_DIB0070 ...@@ -526,6 +526,15 @@ config DVB_TUNER_DIB0070
This device is only used inside a SiP called together with a This device is only used inside a SiP called together with a
demodulator for now. demodulator for now.
config DVB_TUNER_DIB0090
tristate "DiBcom DiB0090 silicon base-band tuner"
depends on I2C
default m if DVB_FE_CUSTOMISE
help
A driver for the silicon baseband tuner DiB0090 from DiBcom.
This device is only used inside a SiP called together with a
demodulator for now.
comment "SEC control devices for DVB-S" comment "SEC control devices for DVB-S"
depends on DVB_CORE depends on DVB_CORE
......
...@@ -55,6 +55,7 @@ obj-$(CONFIG_DVB_TDA10086) += tda10086.o ...@@ -55,6 +55,7 @@ obj-$(CONFIG_DVB_TDA10086) += tda10086.o
obj-$(CONFIG_DVB_TDA826X) += tda826x.o obj-$(CONFIG_DVB_TDA826X) += tda826x.o
obj-$(CONFIG_DVB_TDA8261) += tda8261.o obj-$(CONFIG_DVB_TDA8261) += tda8261.o
obj-$(CONFIG_DVB_TUNER_DIB0070) += dib0070.o obj-$(CONFIG_DVB_TUNER_DIB0070) += dib0070.o
obj-$(CONFIG_DVB_TUNER_DIB0090) += dib0090.o
obj-$(CONFIG_DVB_TUA6100) += tua6100.o obj-$(CONFIG_DVB_TUA6100) += tua6100.o
obj-$(CONFIG_DVB_S5H1409) += s5h1409.o obj-$(CONFIG_DVB_S5H1409) += s5h1409.o
obj-$(CONFIG_DVB_TUNER_ITD1000) += itd1000.o obj-$(CONFIG_DVB_TUNER_ITD1000) += itd1000.o
......
...@@ -62,7 +62,7 @@ struct au8522_register_config { ...@@ -62,7 +62,7 @@ struct au8522_register_config {
The values are as follows from left to right The values are as follows from left to right
0="ATV RF" 1="ATV RF13" 2="CVBS" 3="S-Video" 4="PAL" 5=CVBS13" 6="SVideo13" 0="ATV RF" 1="ATV RF13" 2="CVBS" 3="S-Video" 4="PAL" 5=CVBS13" 6="SVideo13"
*/ */
struct au8522_register_config filter_coef[] = { static const struct au8522_register_config filter_coef[] = {
{AU8522_FILTER_COEF_R410, {0x25, 0x00, 0x25, 0x25, 0x00, 0x00, 0x00} }, {AU8522_FILTER_COEF_R410, {0x25, 0x00, 0x25, 0x25, 0x00, 0x00, 0x00} },
{AU8522_FILTER_COEF_R411, {0x20, 0x00, 0x20, 0x20, 0x00, 0x00, 0x00} }, {AU8522_FILTER_COEF_R411, {0x20, 0x00, 0x20, 0x20, 0x00, 0x00, 0x00} },
{AU8522_FILTER_COEF_R412, {0x03, 0x00, 0x03, 0x03, 0x00, 0x00, 0x00} }, {AU8522_FILTER_COEF_R412, {0x03, 0x00, 0x03, 0x03, 0x00, 0x00, 0x00} },
...@@ -104,7 +104,7 @@ struct au8522_register_config filter_coef[] = { ...@@ -104,7 +104,7 @@ struct au8522_register_config filter_coef[] = {
0="SIF" 1="ATVRF/ATVRF13" 0="SIF" 1="ATVRF/ATVRF13"
Note: the "ATVRF/ATVRF13" mode has never been tested Note: the "ATVRF/ATVRF13" mode has never been tested
*/ */
struct au8522_register_config lpfilter_coef[] = { static const struct au8522_register_config lpfilter_coef[] = {
{0x060b, {0x21, 0x0b} }, {0x060b, {0x21, 0x0b} },
{0x060c, {0xad, 0xad} }, {0x060c, {0xad, 0xad} },
{0x060d, {0x70, 0xf0} }, {0x060d, {0x70, 0xf0} },
......
This diff is collapsed.
...@@ -52,6 +52,8 @@ struct dib0070_config { ...@@ -52,6 +52,8 @@ struct dib0070_config {
extern struct dvb_frontend *dib0070_attach(struct dvb_frontend *fe, struct i2c_adapter *i2c, struct dib0070_config *cfg); extern struct dvb_frontend *dib0070_attach(struct dvb_frontend *fe, struct i2c_adapter *i2c, struct dib0070_config *cfg);
extern u16 dib0070_wbd_offset(struct dvb_frontend *); extern u16 dib0070_wbd_offset(struct dvb_frontend *);
extern void dib0070_ctrl_agc_filter(struct dvb_frontend *, u8 open); extern void dib0070_ctrl_agc_filter(struct dvb_frontend *, u8 open);
extern u8 dib0070_get_rf_output(struct dvb_frontend *fe);
extern int dib0070_set_rf_output(struct dvb_frontend *fe, u8 no);
#else #else
static inline struct dvb_frontend *dib0070_attach(struct dvb_frontend *fe, struct i2c_adapter *i2c, struct dib0070_config *cfg) static inline struct dvb_frontend *dib0070_attach(struct dvb_frontend *fe, struct i2c_adapter *i2c, struct dib0070_config *cfg)
{ {
...@@ -62,7 +64,7 @@ static inline struct dvb_frontend *dib0070_attach(struct dvb_frontend *fe, struc ...@@ -62,7 +64,7 @@ static inline struct dvb_frontend *dib0070_attach(struct dvb_frontend *fe, struc
static inline u16 dib0070_wbd_offset(struct dvb_frontend *fe) static inline u16 dib0070_wbd_offset(struct dvb_frontend *fe)
{ {
printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__); printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
return -ENODEV; return 0;
} }
static inline void dib0070_ctrl_agc_filter(struct dvb_frontend *fe, u8 open) static inline void dib0070_ctrl_agc_filter(struct dvb_frontend *fe, u8 open)
......
This diff is collapsed.
/*
* Linux-DVB Driver for DiBcom's DiB0090 base-band RF Tuner.
*
* Copyright (C) 2005-7 DiBcom (http://www.dibcom.fr/)
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, version 2.
*/
#ifndef DIB0090_H
#define DIB0090_H
struct dvb_frontend;
struct i2c_adapter;
#define DEFAULT_DIB0090_I2C_ADDRESS 0x60
struct dib0090_io_config {
u32 clock_khz;
u8 pll_bypass:1;
u8 pll_range:1;
u8 pll_prediv:6;
u8 pll_loopdiv:6;
u8 adc_clock_ratio; /* valid is 8, 7 ,6 */
u16 pll_int_loop_filt;
};
struct dib0090_config {
struct dib0090_io_config io;
int (*reset) (struct dvb_frontend *, int);
int (*sleep) (struct dvb_frontend *, int);
/* offset in kHz */
int freq_offset_khz_uhf;
int freq_offset_khz_vhf;
int (*get_adc_power) (struct dvb_frontend *);
u8 clkouttobamse:1; /* activate or deactivate clock output */
u8 analog_output;
u8 i2c_address;
/* add drives and other things if necessary */
u16 wbd_vhf_offset;
u16 wbd_cband_offset;
u8 use_pwm_agc;
u8 clkoutdrive;
};
#if defined(CONFIG_DVB_TUNER_DIB0090) || (defined(CONFIG_DVB_TUNER_DIB0090_MODULE) && defined(MODULE))
extern struct dvb_frontend *dib0090_register(struct dvb_frontend *fe, struct i2c_adapter *i2c, const struct dib0090_config *config);
extern void dib0090_dcc_freq(struct dvb_frontend *fe, u8 fast);
extern void dib0090_pwm_gain_reset(struct dvb_frontend *fe);
extern u16 dib0090_get_wbd_offset(struct dvb_frontend *tuner);
extern int dib0090_gain_control(struct dvb_frontend *fe);
extern enum frontend_tune_state dib0090_get_tune_state(struct dvb_frontend *fe);
extern int dib0090_set_tune_state(struct dvb_frontend *fe, enum frontend_tune_state tune_state);
extern void dib0090_get_current_gain(struct dvb_frontend *fe, u16 * rf, u16 * bb, u16 * rf_gain_limit, u16 * rflt);
#else
static inline struct dvb_frontend *dib0090_register(struct dvb_frontend *fe, struct i2c_adapter *i2c, struct dib0090_config *config)
{
printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
return NULL;
}
static inline void dib0090_dcc_freq(struct dvb_frontend *fe, u8 fast)
{
printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
}
static inline void dib0090_pwm_gain_reset(struct dvb_frontend *fe)
{
printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
}
static inline u16 dib0090_get_wbd_offset(struct dvb_frontend *tuner)
{
printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
return 0;
}
static inline int dib0090_gain_control(struct dvb_frontend *fe)
{
printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
return -ENODEV;
}
static inline enum frontend_tune_state dib0090_get_tune_state(struct dvb_frontend *fe)
{
printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
return CT_DONE;
}
static inline int dib0090_set_tune_state(struct dvb_frontend *fe, enum frontend_tune_state tune_state)
{
printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
return -ENODEV;
}
static inline void dib0090_get_current_gain(struct dvb_frontend *fe, u16 * rf, u16 * bb, u16 * rf_gain_limit, u16 * rflt)
{
printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
}
#endif
#endif
...@@ -28,18 +28,6 @@ MODULE_PARM_DESC(debug, "turn on debugging (default: 0)"); ...@@ -28,18 +28,6 @@ MODULE_PARM_DESC(debug, "turn on debugging (default: 0)");
#define dprintk(args...) do { if (debug) { printk(KERN_DEBUG "DiB8000: "); printk(args); printk("\n"); } } while (0) #define dprintk(args...) do { if (debug) { printk(KERN_DEBUG "DiB8000: "); printk(args); printk("\n"); } } while (0)
enum frontend_tune_state {
CT_AGC_START = 20,
CT_AGC_STEP_0,
CT_AGC_STEP_1,
CT_AGC_STEP_2,
CT_AGC_STEP_3,
CT_AGC_STEP_4,
CT_AGC_STOP,
CT_DEMOD_START = 30,
};
#define FE_STATUS_TUNE_FAILED 0 #define FE_STATUS_TUNE_FAILED 0
struct i2c_device { struct i2c_device {
...@@ -133,104 +121,104 @@ static int dib8000_write_word(struct dib8000_state *state, u16 reg, u16 val) ...@@ -133,104 +121,104 @@ static int dib8000_write_word(struct dib8000_state *state, u16 reg, u16 val)
return dib8000_i2c_write16(&state->i2c, reg, val); return dib8000_i2c_write16(&state->i2c, reg, val);
} }
const int16_t coeff_2k_sb_1seg_dqpsk[8] = { static const int16_t coeff_2k_sb_1seg_dqpsk[8] = {
(769 << 5) | 0x0a, (745 << 5) | 0x03, (595 << 5) | 0x0d, (769 << 5) | 0x0a, (920 << 5) | 0x09, (784 << 5) | 0x02, (519 << 5) | 0x0c, (769 << 5) | 0x0a, (745 << 5) | 0x03, (595 << 5) | 0x0d, (769 << 5) | 0x0a, (920 << 5) | 0x09, (784 << 5) | 0x02, (519 << 5) | 0x0c,
(920 << 5) | 0x09 (920 << 5) | 0x09
}; };
const int16_t coeff_2k_sb_1seg[8] = { static const int16_t coeff_2k_sb_1seg[8] = {
(692 << 5) | 0x0b, (683 << 5) | 0x01, (519 << 5) | 0x09, (692 << 5) | 0x0b, 0 | 0x1f, 0 | 0x1f, 0 | 0x1f, 0 | 0x1f (692 << 5) | 0x0b, (683 << 5) | 0x01, (519 << 5) | 0x09, (692 << 5) | 0x0b, 0 | 0x1f, 0 | 0x1f, 0 | 0x1f, 0 | 0x1f
}; };
const int16_t coeff_2k_sb_3seg_0dqpsk_1dqpsk[8] = { static const int16_t coeff_2k_sb_3seg_0dqpsk_1dqpsk[8] = {
(832 << 5) | 0x10, (912 << 5) | 0x05, (900 << 5) | 0x12, (832 << 5) | 0x10, (-931 << 5) | 0x0f, (912 << 5) | 0x04, (807 << 5) | 0x11, (832 << 5) | 0x10, (912 << 5) | 0x05, (900 << 5) | 0x12, (832 << 5) | 0x10, (-931 << 5) | 0x0f, (912 << 5) | 0x04, (807 << 5) | 0x11,
(-931 << 5) | 0x0f (-931 << 5) | 0x0f
}; };
const int16_t coeff_2k_sb_3seg_0dqpsk[8] = { static const int16_t coeff_2k_sb_3seg_0dqpsk[8] = {
(622 << 5) | 0x0c, (941 << 5) | 0x04, (796 << 5) | 0x10, (622 << 5) | 0x0c, (982 << 5) | 0x0c, (519 << 5) | 0x02, (572 << 5) | 0x0e, (622 << 5) | 0x0c, (941 << 5) | 0x04, (796 << 5) | 0x10, (622 << 5) | 0x0c, (982 << 5) | 0x0c, (519 << 5) | 0x02, (572 << 5) | 0x0e,
(982 << 5) | 0x0c (982 << 5) | 0x0c
}; };
const int16_t coeff_2k_sb_3seg_1dqpsk[8] = { static const int16_t coeff_2k_sb_3seg_1dqpsk[8] = {
(699 << 5) | 0x14, (607 << 5) | 0x04, (944 << 5) | 0x13, (699 << 5) | 0x14, (-720 << 5) | 0x0d, (640 << 5) | 0x03, (866 << 5) | 0x12, (699 << 5) | 0x14, (607 << 5) | 0x04, (944 << 5) | 0x13, (699 << 5) | 0x14, (-720 << 5) | 0x0d, (640 << 5) | 0x03, (866 << 5) | 0x12,
(-720 << 5) | 0x0d (-720 << 5) | 0x0d
}; };
const int16_t coeff_2k_sb_3seg[8] = { static const int16_t coeff_2k_sb_3seg[8] = {
(664 << 5) | 0x0c, (925 << 5) | 0x03, (937 << 5) | 0x10, (664 << 5) | 0x0c, (-610 << 5) | 0x0a, (697 << 5) | 0x01, (836 << 5) | 0x0e, (664 << 5) | 0x0c, (925 << 5) | 0x03, (937 << 5) | 0x10, (664 << 5) | 0x0c, (-610 << 5) | 0x0a, (697 << 5) | 0x01, (836 << 5) | 0x0e,
(-610 << 5) | 0x0a (-610 << 5) | 0x0a
}; };
const int16_t coeff_4k_sb_1seg_dqpsk[8] = { static const int16_t coeff_4k_sb_1seg_dqpsk[8] = {
(-955 << 5) | 0x0e, (687 << 5) | 0x04, (818 << 5) | 0x10, (-955 << 5) | 0x0e, (-922 << 5) | 0x0d, (750 << 5) | 0x03, (665 << 5) | 0x0f, (-955 << 5) | 0x0e, (687 << 5) | 0x04, (818 << 5) | 0x10, (-955 << 5) | 0x0e, (-922 << 5) | 0x0d, (750 << 5) | 0x03, (665 << 5) | 0x0f,
(-922 << 5) | 0x0d (-922 << 5) | 0x0d
}; };
const int16_t coeff_4k_sb_1seg[8] = { static const int16_t coeff_4k_sb_1seg[8] = {
(638 << 5) | 0x0d, (683 << 5) | 0x02, (638 << 5) | 0x0d, (638 << 5) | 0x0d, (-655 << 5) | 0x0a, (517 << 5) | 0x00, (698 << 5) | 0x0d, (638 << 5) | 0x0d, (683 << 5) | 0x02, (638 << 5) | 0x0d, (638 << 5) | 0x0d, (-655 << 5) | 0x0a, (517 << 5) | 0x00, (698 << 5) | 0x0d,
(-655 << 5) | 0x0a (-655 << 5) | 0x0a
}; };
const int16_t coeff_4k_sb_3seg_0dqpsk_1dqpsk[8] = { static const int16_t coeff_4k_sb_3seg_0dqpsk_1dqpsk[8] = {
(-707 << 5) | 0x14, (910 << 5) | 0x06, (889 << 5) | 0x16, (-707 << 5) | 0x14, (-958 << 5) | 0x13, (993 << 5) | 0x05, (523 << 5) | 0x14, (-707 << 5) | 0x14, (910 << 5) | 0x06, (889 << 5) | 0x16, (-707 << 5) | 0x14, (-958 << 5) | 0x13, (993 << 5) | 0x05, (523 << 5) | 0x14,
(-958 << 5) | 0x13 (-958 << 5) | 0x13
}; };
const int16_t coeff_4k_sb_3seg_0dqpsk[8] = { static const int16_t coeff_4k_sb_3seg_0dqpsk[8] = {
(-723 << 5) | 0x13, (910 << 5) | 0x05, (777 << 5) | 0x14, (-723 << 5) | 0x13, (-568 << 5) | 0x0f, (547 << 5) | 0x03, (696 << 5) | 0x12, (-723 << 5) | 0x13, (910 << 5) | 0x05, (777 << 5) | 0x14, (-723 << 5) | 0x13, (-568 << 5) | 0x0f, (547 << 5) | 0x03, (696 << 5) | 0x12,
(-568 << 5) | 0x0f (-568 << 5) | 0x0f
}; };
const int16_t coeff_4k_sb_3seg_1dqpsk[8] = { static const int16_t coeff_4k_sb_3seg_1dqpsk[8] = {
(-940 << 5) | 0x15, (607 << 5) | 0x05, (915 << 5) | 0x16, (-940 << 5) | 0x15, (-848 << 5) | 0x13, (683 << 5) | 0x04, (543 << 5) | 0x14, (-940 << 5) | 0x15, (607 << 5) | 0x05, (915 << 5) | 0x16, (-940 << 5) | 0x15, (-848 << 5) | 0x13, (683 << 5) | 0x04, (543 << 5) | 0x14,
(-848 << 5) | 0x13 (-848 << 5) | 0x13
}; };
const int16_t coeff_4k_sb_3seg[8] = { static const int16_t coeff_4k_sb_3seg[8] = {
(612 << 5) | 0x12, (910 << 5) | 0x04, (864 << 5) | 0x14, (612 << 5) | 0x12, (-869 << 5) | 0x13, (683 << 5) | 0x02, (869 << 5) | 0x12, (612 << 5) | 0x12, (910 << 5) | 0x04, (864 << 5) | 0x14, (612 << 5) | 0x12, (-869 << 5) | 0x13, (683 << 5) | 0x02, (869 << 5) | 0x12,
(-869 << 5) | 0x13 (-869 << 5) | 0x13
}; };
const int16_t coeff_8k_sb_1seg_dqpsk[8] = { static const int16_t coeff_8k_sb_1seg_dqpsk[8] = {
(-835 << 5) | 0x12, (684 << 5) | 0x05, (735 << 5) | 0x14, (-835 << 5) | 0x12, (-598 << 5) | 0x10, (781 << 5) | 0x04, (739 << 5) | 0x13, (-835 << 5) | 0x12, (684 << 5) | 0x05, (735 << 5) | 0x14, (-835 << 5) | 0x12, (-598 << 5) | 0x10, (781 << 5) | 0x04, (739 << 5) | 0x13,
(-598 << 5) | 0x10 (-598 << 5) | 0x10
}; };
const int16_t coeff_8k_sb_1seg[8] = { static const int16_t coeff_8k_sb_1seg[8] = {
(673 << 5) | 0x0f, (683 << 5) | 0x03, (808 << 5) | 0x12, (673 << 5) | 0x0f, (585 << 5) | 0x0f, (512 << 5) | 0x01, (780 << 5) | 0x0f, (673 << 5) | 0x0f, (683 << 5) | 0x03, (808 << 5) | 0x12, (673 << 5) | 0x0f, (585 << 5) | 0x0f, (512 << 5) | 0x01, (780 << 5) | 0x0f,
(585 << 5) | 0x0f (585 << 5) | 0x0f
}; };
const int16_t coeff_8k_sb_3seg_0dqpsk_1dqpsk[8] = { static const int16_t coeff_8k_sb_3seg_0dqpsk_1dqpsk[8] = {
(863 << 5) | 0x17, (930 << 5) | 0x07, (878 << 5) | 0x19, (863 << 5) | 0x17, (0 << 5) | 0x14, (521 << 5) | 0x05, (980 << 5) | 0x18, (863 << 5) | 0x17, (930 << 5) | 0x07, (878 << 5) | 0x19, (863 << 5) | 0x17, (0 << 5) | 0x14, (521 << 5) | 0x05, (980 << 5) | 0x18,
(0 << 5) | 0x14 (0 << 5) | 0x14
}; };
const int16_t coeff_8k_sb_3seg_0dqpsk[8] = { static const int16_t coeff_8k_sb_3seg_0dqpsk[8] = {
(-924 << 5) | 0x17, (910 << 5) | 0x06, (774 << 5) | 0x17, (-924 << 5) | 0x17, (-877 << 5) | 0x15, (565 << 5) | 0x04, (553 << 5) | 0x15, (-924 << 5) | 0x17, (910 << 5) | 0x06, (774 << 5) | 0x17, (-924 << 5) | 0x17, (-877 << 5) | 0x15, (565 << 5) | 0x04, (553 << 5) | 0x15,
(-877 << 5) | 0x15 (-877 << 5) | 0x15
}; };
const int16_t coeff_8k_sb_3seg_1dqpsk[8] = { static const int16_t coeff_8k_sb_3seg_1dqpsk[8] = {
(-921 << 5) | 0x19, (607 << 5) | 0x06, (881 << 5) | 0x19, (-921 << 5) | 0x19, (-921 << 5) | 0x14, (713 << 5) | 0x05, (1018 << 5) | 0x18, (-921 << 5) | 0x19, (607 << 5) | 0x06, (881 << 5) | 0x19, (-921 << 5) | 0x19, (-921 << 5) | 0x14, (713 << 5) | 0x05, (1018 << 5) | 0x18,
(-921 << 5) | 0x14 (-921 << 5) | 0x14
}; };
const int16_t coeff_8k_sb_3seg[8] = { static const int16_t coeff_8k_sb_3seg[8] = {
(514 << 5) | 0x14, (910 << 5) | 0x05, (861 << 5) | 0x17, (514 << 5) | 0x14, (690 << 5) | 0x14, (683 << 5) | 0x03, (662 << 5) | 0x15, (514 << 5) | 0x14, (910 << 5) | 0x05, (861 << 5) | 0x17, (514 << 5) | 0x14, (690 << 5) | 0x14, (683 << 5) | 0x03, (662 << 5) | 0x15,
(690 << 5) | 0x14 (690 << 5) | 0x14
}; };
const int16_t ana_fe_coeff_3seg[24] = { static const int16_t ana_fe_coeff_3seg[24] = {
81, 80, 78, 74, 68, 61, 54, 45, 37, 28, 19, 11, 4, 1022, 1017, 1013, 1010, 1008, 1008, 1008, 1008, 1010, 1014, 1017 81, 80, 78, 74, 68, 61, 54, 45, 37, 28, 19, 11, 4, 1022, 1017, 1013, 1010, 1008, 1008, 1008, 1008, 1010, 1014, 1017
}; };
const int16_t ana_fe_coeff_1seg[24] = { static const int16_t ana_fe_coeff_1seg[24] = {
249, 226, 164, 82, 5, 981, 970, 988, 1018, 20, 31, 26, 8, 1012, 1000, 1018, 1012, 8, 15, 14, 9, 3, 1017, 1003 249, 226, 164, 82, 5, 981, 970, 988, 1018, 20, 31, 26, 8, 1012, 1000, 1018, 1012, 8, 15, 14, 9, 3, 1017, 1003
}; };
const int16_t ana_fe_coeff_13seg[24] = { static const int16_t ana_fe_coeff_13seg[24] = {
396, 305, 105, -51, -77, -12, 41, 31, -11, -30, -11, 14, 15, -2, -13, -7, 5, 8, 1, -6, -7, -3, 0, 1 396, 305, 105, -51, -77, -12, 41, 31, -11, -30, -11, 14, 15, -2, -13, -7, 5, 8, 1, -6, -7, -3, 0, 1
}; };
...@@ -852,6 +840,14 @@ static int dib8000_set_agc_config(struct dib8000_state *state, u8 band) ...@@ -852,6 +840,14 @@ static int dib8000_set_agc_config(struct dib8000_state *state, u8 band)
return 0; return 0;
} }
void dib8000_pwm_agc_reset(struct dvb_frontend *fe)
{
struct dib8000_state *state = fe->demodulator_priv;
dib8000_set_adc_state(state, DIBX000_ADC_ON);
dib8000_set_agc_config(state, (unsigned char)(BAND_OF_FREQUENCY(fe->dtv_property_cache.frequency / 1000)));
}
EXPORT_SYMBOL(dib8000_pwm_agc_reset);
static int dib8000_agc_soft_split(struct dib8000_state *state) static int dib8000_agc_soft_split(struct dib8000_state *state)
{ {
u16 agc, split_offset; u16 agc, split_offset;
...@@ -939,6 +935,32 @@ static int dib8000_agc_startup(struct dvb_frontend *fe) ...@@ -939,6 +935,32 @@ static int dib8000_agc_startup(struct dvb_frontend *fe)
} }
static const int32_t lut_1000ln_mant[] =
{
908, 7003, 7090, 7170, 7244, 7313, 7377, 7438, 7495, 7549, 7600
};
int32_t dib8000_get_adc_power(struct dvb_frontend *fe, uint8_t mode)
{
struct dib8000_state *state = fe->demodulator_priv;
uint32_t ix = 0, tmp_val = 0, exp = 0, mant = 0;
int32_t val;
val = dib8000_read32(state, 384);
/* mode = 1 : ln_agcpower calc using mant-exp conversion and mantis look up table */
if (mode) {
tmp_val = val;
while (tmp_val >>= 1)
exp++;
mant = (val * 1000 / (1<<exp));
ix = (uint8_t)((mant-1000)/100); /* index of the LUT */
val = (lut_1000ln_mant[ix] + 693*(exp-20) - 6908); /* 1000 * ln(adcpower_real) ; 693 = 1000ln(2) ; 6908 = 1000*ln(1000) ; 20 comes from adc_real = adc_pow_int / 2**20 */
val = (val*256)/1000;
}
return val;
}
EXPORT_SYMBOL(dib8000_get_adc_power);
static void dib8000_update_timf(struct dib8000_state *state) static void dib8000_update_timf(struct dib8000_state *state)
{ {
u32 timf = state->timf = dib8000_read32(state, 435); u32 timf = state->timf = dib8000_read32(state, 435);
...@@ -1401,10 +1423,9 @@ static void dib8000_set_channel(struct dib8000_state *state, u8 seq, u8 autosear ...@@ -1401,10 +1423,9 @@ static void dib8000_set_channel(struct dib8000_state *state, u8 seq, u8 autosear
} }
break; break;
} }
}
if (state->fe.dtv_property_cache.isdbt_sb_mode == 1)
for (i = 0; i < 8; i++) for (i = 0; i < 8; i++)
dib8000_write_word(state, 343 + i, ncoeff[i]); dib8000_write_word(state, 343 + i, ncoeff[i]);
}
// P_small_coef_ext_enable=ISDB-Tsb, P_small_narrow_band=ISDB-Tsb, P_small_last_seg=13, P_small_offset_num_car=5 // P_small_coef_ext_enable=ISDB-Tsb, P_small_narrow_band=ISDB-Tsb, P_small_last_seg=13, P_small_offset_num_car=5
dib8000_write_word(state, 351, dib8000_write_word(state, 351,
...@@ -1854,6 +1875,24 @@ static int dib8000_sleep(struct dvb_frontend *fe) ...@@ -1854,6 +1875,24 @@ static int dib8000_sleep(struct dvb_frontend *fe)
} }
} }
enum frontend_tune_state dib8000_get_tune_state(struct dvb_frontend *fe)
{
struct dib8000_state *state = fe->demodulator_priv;
return state->tune_state;
}
EXPORT_SYMBOL(dib8000_get_tune_state);
int dib8000_set_tune_state(struct dvb_frontend *fe, enum frontend_tune_state tune_state)
{
struct dib8000_state *state = fe->demodulator_priv;
state->tune_state = tune_state;
return 0;
}
EXPORT_SYMBOL(dib8000_set_tune_state);
static int dib8000_get_frontend(struct dvb_frontend *fe, struct dvb_frontend_parameters *fep) static int dib8000_get_frontend(struct dvb_frontend *fe, struct dvb_frontend_parameters *fep)
{ {
struct dib8000_state *state = fe->demodulator_priv; struct dib8000_state *state = fe->demodulator_priv;
...@@ -2043,29 +2082,31 @@ static int dib8000_read_status(struct dvb_frontend *fe, fe_status_t * stat) ...@@ -2043,29 +2082,31 @@ static int dib8000_read_status(struct dvb_frontend *fe, fe_status_t * stat)
*stat = 0; *stat = 0;
if ((lock >> 14) & 1) // AGC if ((lock >> 13) & 1)
*stat |= FE_HAS_SIGNAL; *stat |= FE_HAS_SIGNAL;
if ((lock >> 8) & 1) // Equal if ((lock >> 8) & 1) /* Equal */
*stat |= FE_HAS_CARRIER; *stat |= FE_HAS_CARRIER;
if ((lock >> 3) & 1) // TMCC_SYNC if (((lock >> 1) & 0xf) == 0xf) /* TMCC_SYNC */
*stat |= FE_HAS_SYNC; *stat |= FE_HAS_SYNC;
if ((lock >> 5) & 7) // FEC MPEG if (((lock >> 12) & 1) && ((lock >> 5) & 7)) /* FEC MPEG */
*stat |= FE_HAS_LOCK; *stat |= FE_HAS_LOCK;
lock = dib8000_read_word(state, 554); // Viterbi Layer A if ((lock >> 12) & 1) {
lock = dib8000_read_word(state, 554); /* Viterbi Layer A */
if (lock & 0x01) if (lock & 0x01)
*stat |= FE_HAS_VITERBI; *stat |= FE_HAS_VITERBI;
lock = dib8000_read_word(state, 555); // Viterbi Layer B lock = dib8000_read_word(state, 555); /* Viterbi Layer B */
if (lock & 0x01) if (lock & 0x01)
*stat |= FE_HAS_VITERBI; *stat |= FE_HAS_VITERBI;
lock = dib8000_read_word(state, 556); // Viterbi Layer C lock = dib8000_read_word(state, 556); /* Viterbi Layer C */
if (lock & 0x01) if (lock & 0x01)
*stat |= FE_HAS_VITERBI; *stat |= FE_HAS_VITERBI;
}
return 0; return 0;
} }
......
...@@ -46,6 +46,10 @@ extern int dib8000_set_gpio(struct dvb_frontend *, u8 num, u8 dir, u8 val); ...@@ -46,6 +46,10 @@ extern int dib8000_set_gpio(struct dvb_frontend *, u8 num, u8 dir, u8 val);
extern int dib8000_set_wbd_ref(struct dvb_frontend *, u16 value); extern int dib8000_set_wbd_ref(struct dvb_frontend *, u16 value);
extern int dib8000_pid_filter_ctrl(struct dvb_frontend *, u8 onoff); extern int dib8000_pid_filter_ctrl(struct dvb_frontend *, u8 onoff);
extern int dib8000_pid_filter(struct dvb_frontend *, u8 id, u16 pid, u8 onoff); extern int dib8000_pid_filter(struct dvb_frontend *, u8 id, u16 pid, u8 onoff);
extern int dib8000_set_tune_state(struct dvb_frontend *fe, enum frontend_tune_state tune_state);
extern enum frontend_tune_state dib8000_get_tune_state(struct dvb_frontend *fe);
extern void dib8000_pwm_agc_reset(struct dvb_frontend *fe);
extern s32 dib8000_get_adc_power(struct dvb_frontend *fe, u8 mode);
#else #else
static inline struct dvb_frontend *dib8000_attach(struct i2c_adapter *i2c_adap, u8 i2c_addr, struct dib8000_config *cfg) static inline struct dvb_frontend *dib8000_attach(struct i2c_adapter *i2c_adap, u8 i2c_addr, struct dib8000_config *cfg)
{ {
...@@ -59,35 +63,53 @@ static inline struct i2c_adapter *dib8000_get_i2c_master(struct dvb_frontend *fe ...@@ -59,35 +63,53 @@ static inline struct i2c_adapter *dib8000_get_i2c_master(struct dvb_frontend *fe
return NULL; return NULL;
} }
int dib8000_i2c_enumeration(struct i2c_adapter *host, int no_of_demods, u8 default_addr, u8 first_addr) static inline int dib8000_i2c_enumeration(struct i2c_adapter *host, int no_of_demods, u8 default_addr, u8 first_addr)
{ {
printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__); printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
return -ENODEV; return -ENODEV;
} }
int dib8000_set_gpio(struct dvb_frontend *fe, u8 num, u8 dir, u8 val) static inline int dib8000_set_gpio(struct dvb_frontend *fe, u8 num, u8 dir, u8 val)
{ {
printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__); printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
return -ENODEV; return -ENODEV;
} }
int dib8000_set_wbd_ref(struct dvb_frontend *fe, u16 value) static inline int dib8000_set_wbd_ref(struct dvb_frontend *fe, u16 value)
{ {
printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__); printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
return -ENODEV; return -ENODEV;
} }
int dib8000_pid_filter_ctrl(struct dvb_frontend *fe, u8 onoff) static inline int dib8000_pid_filter_ctrl(struct dvb_frontend *fe, u8 onoff)
{ {
printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__); printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
return -ENODEV; return -ENODEV;
} }
int dib8000_pid_filter(struct dvb_frontend *fe, u8 id, u16 pid, u8 onoff) static inline int dib8000_pid_filter(struct dvb_frontend *fe, u8 id, u16 pid, u8 onoff)
{ {
printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__); printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
return -ENODEV; return -ENODEV;
} }
static inline int dib8000_set_tune_state(struct dvb_frontend *fe, enum frontend_tune_state tune_state)
{
printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
return -ENODEV;
}
static inline enum frontend_tune_state dib8000_get_tune_state(struct dvb_frontend *fe)
{
printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
return CT_SHUTDOWN,
}
static inline void dib8000_pwm_agc_reset(struct dvb_frontend *fe)
{
printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
}
static inline s32 dib8000_get_adc_power(struct dvb_frontend *fe, u8 mode)
{
printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
}
#endif #endif
#endif #endif
...@@ -6,7 +6,7 @@ static int debug; ...@@ -6,7 +6,7 @@ static int debug;
module_param(debug, int, 0644); module_param(debug, int, 0644);
MODULE_PARM_DESC(debug, "turn on debugging (default: 0)"); MODULE_PARM_DESC(debug, "turn on debugging (default: 0)");
#define dprintk(args...) do { if (debug) { printk(KERN_DEBUG "DiBX000: "); printk(args); } } while (0) #define dprintk(args...) do { if (debug) { printk(KERN_DEBUG "DiBX000: "); printk(args); printk("\n"); } } while (0)
static int dibx000_write_word(struct dibx000_i2c_master *mst, u16 reg, u16 val) static int dibx000_write_word(struct dibx000_i2c_master *mst, u16 reg, u16 val)
{ {
...@@ -25,7 +25,7 @@ static int dibx000_i2c_select_interface(struct dibx000_i2c_master *mst, ...@@ -25,7 +25,7 @@ static int dibx000_i2c_select_interface(struct dibx000_i2c_master *mst,
enum dibx000_i2c_interface intf) enum dibx000_i2c_interface intf)
{ {
if (mst->device_rev > DIB3000MC && mst->selected_interface != intf) { if (mst->device_rev > DIB3000MC && mst->selected_interface != intf) {
dprintk("selecting interface: %d\n", intf); dprintk("selecting interface: %d", intf);
mst->selected_interface = intf; mst->selected_interface = intf;
return dibx000_write_word(mst, mst->base_reg + 4, intf); return dibx000_write_word(mst, mst->base_reg + 4, intf);
} }
...@@ -171,9 +171,18 @@ void dibx000_exit_i2c_master(struct dibx000_i2c_master *mst) ...@@ -171,9 +171,18 @@ void dibx000_exit_i2c_master(struct dibx000_i2c_master *mst)
{ {
i2c_del_adapter(&mst->gated_tuner_i2c_adap); i2c_del_adapter(&mst->gated_tuner_i2c_adap);
} }
EXPORT_SYMBOL(dibx000_exit_i2c_master); EXPORT_SYMBOL(dibx000_exit_i2c_master);
u32 systime()
{
struct timespec t;
t = current_kernel_time();
return (t.tv_sec * 10000) + (t.tv_nsec / 100000);
}
EXPORT_SYMBOL(systime);
MODULE_AUTHOR("Patrick Boettcher <pboettcher@dibcom.fr>"); MODULE_AUTHOR("Patrick Boettcher <pboettcher@dibcom.fr>");
MODULE_DESCRIPTION("Common function the DiBcom demodulator family"); MODULE_DESCRIPTION("Common function the DiBcom demodulator family");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
...@@ -199,7 +199,7 @@ static int lgs8gxx_set_if_freq(struct lgs8gxx_state *priv, u32 freq /*in kHz*/) ...@@ -199,7 +199,7 @@ static int lgs8gxx_set_if_freq(struct lgs8gxx_state *priv, u32 freq /*in kHz*/)
val = freq; val = freq;
if (freq != 0) { if (freq != 0) {
val *= (u64)1 << 32; val <<= 32;
if (if_clk != 0) if (if_clk != 0)
do_div(val, if_clk); do_div(val, if_clk);
v32 = val & 0xFFFFFFFF; v32 = val & 0xFFFFFFFF;
...@@ -246,7 +246,7 @@ static int lgs8gxx_get_afc_phase(struct lgs8gxx_state *priv) ...@@ -246,7 +246,7 @@ static int lgs8gxx_get_afc_phase(struct lgs8gxx_state *priv)
val = v32; val = v32;
val *= priv->config->if_clk_freq; val *= priv->config->if_clk_freq;
val /= (u64)1 << 32; val >>= 32;
dprintk("AFC = %u kHz\n", (u32)val); dprintk("AFC = %u kHz\n", (u32)val);
return 0; return 0;
} }
......
/* /*
* lnbp21.c - driver for lnb supply and control ic lnbp21 * lnbp21.c - driver for lnb supply and control ic lnbp21
* *
* Copyright (C) 2006 Oliver Endriss * Copyright (C) 2006, 2009 Oliver Endriss <o.endriss@gmx.de>
* Copyright (C) 2009 Igor M. Liplianin <liplianin@netup.ru> * Copyright (C) 2009 Igor M. Liplianin <liplianin@netup.ru>
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -91,6 +91,31 @@ static int lnbp21_enable_high_lnb_voltage(struct dvb_frontend *fe, long arg) ...@@ -91,6 +91,31 @@ static int lnbp21_enable_high_lnb_voltage(struct dvb_frontend *fe, long arg)
return (i2c_transfer(lnbp21->i2c, &msg, 1) == 1) ? 0 : -EIO; return (i2c_transfer(lnbp21->i2c, &msg, 1) == 1) ? 0 : -EIO;
} }
static int lnbp21_set_tone(struct dvb_frontend *fe,
fe_sec_tone_mode_t tone)
{
struct lnbp21 *lnbp21 = (struct lnbp21 *) fe->sec_priv;
struct i2c_msg msg = { .addr = lnbp21->i2c_addr, .flags = 0,
.buf = &lnbp21->config,
.len = sizeof(lnbp21->config) };
switch (tone) {
case SEC_TONE_OFF:
lnbp21->config &= ~LNBP21_TEN;
break;
case SEC_TONE_ON:
lnbp21->config |= LNBP21_TEN;
break;
default:
return -EINVAL;
};
lnbp21->config |= lnbp21->override_or;
lnbp21->config &= lnbp21->override_and;
return (i2c_transfer(lnbp21->i2c, &msg, 1) == 1) ? 0 : -EIO;
}
static void lnbp21_release(struct dvb_frontend *fe) static void lnbp21_release(struct dvb_frontend *fe)
{ {
/* LNBP power off */ /* LNBP power off */
...@@ -133,6 +158,7 @@ static struct dvb_frontend *lnbx2x_attach(struct dvb_frontend *fe, ...@@ -133,6 +158,7 @@ static struct dvb_frontend *lnbx2x_attach(struct dvb_frontend *fe,
/* override frontend ops */ /* override frontend ops */
fe->ops.set_voltage = lnbp21_set_voltage; fe->ops.set_voltage = lnbp21_set_voltage;
fe->ops.enable_high_lnb_voltage = lnbp21_enable_high_lnb_voltage; fe->ops.enable_high_lnb_voltage = lnbp21_enable_high_lnb_voltage;
fe->ops.set_tone = lnbp21_set_tone;
printk(KERN_INFO "LNBx2x attached on addr=%x\n", lnbp21->i2c_addr); printk(KERN_INFO "LNBx2x attached on addr=%x\n", lnbp21->i2c_addr);
return fe; return fe;
......
This diff is collapsed.
This diff is collapsed.
...@@ -75,6 +75,8 @@ struct stv090x_config { ...@@ -75,6 +75,8 @@ struct stv090x_config {
enum stv090x_i2crpt repeater_level; enum stv090x_i2crpt repeater_level;
bool diseqc_envelope_mode;
int (*tuner_init) (struct dvb_frontend *fe); int (*tuner_init) (struct dvb_frontend *fe);
int (*tuner_set_mode) (struct dvb_frontend *fe, enum tuner_mode mode); int (*tuner_set_mode) (struct dvb_frontend *fe, enum tuner_mode mode);
int (*tuner_set_frequency) (struct dvb_frontend *fe, u32 frequency); int (*tuner_set_frequency) (struct dvb_frontend *fe, u32 frequency);
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment