Commit graph

664 commits

Author SHA1 Message Date
Mauro Carvalho Chehab
1b0bfee39d [media] mt2063: don't crash if device is not initialized
Instead of crash, return -ENODEV, if the device is not poperly
initialized.

Also, give a second chance for it to initialize, at set_params
calls.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-04 22:48:59 -02:00
Mauro Carvalho Chehab
b5a910679b [media] mt2063: Remove two unused temporary vars
mt2063.c:1531:12: warning: variable 'ofout' set but not used [-Wunused-but-set-variable]
mt2063.c:1531:6: warning: variable 'ofin' set but not used [-Wunused-but-set-variable]

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-04 22:48:58 -02:00
Mauro Carvalho Chehab
2e1d5885f4 [media] mt2063: Rewrite tuning logic
Several vars at set_parms functions were set, but unused.
 Remove them and change the logic to return -EINVAL if the
analog set_param is used for digital mode.

At the analog side, cleans the logic that sets the several
analog standards.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-04 22:48:57 -02:00
Mauro Carvalho Chehab
db6587bfd2 [media] mt2063: Add some debug printk's
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-04 22:48:56 -02:00
Mauro Carvalho Chehab
669b67d959 [media] mt2063: Convert it to the DVBv5 way for set_params()
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-04 22:31:40 -02:00
Mauro Carvalho Chehab
d76f28f2c3 [media] mt2063: Properly document the author of the original driver
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-04 22:31:26 -02:00
Mauro Carvalho Chehab
8fdb226ee1 [media] mt2063: Rearrange the delivery system functions
No functional changes on this patch. Better organize the delivery
system information and data types, putting everything together,
to improve readability.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-04 22:22:20 -02:00
Mauro Carvalho Chehab
54a4613fdb [media] mt2063: Fix comments
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-04 22:21:43 -02:00
Mauro Carvalho Chehab
99ac541254 [media] mt2063: Fix analog/digital set params logic
The driver were using a hacky way of setting analog and digital
frequencies. Remove the hack and properly add the tuner logic for
each supported type of standard.

I was tempted to add more standards there, like SECAM and to fix
radio (as stepping seems broken), but I opted to keep it as-is,
as tests would be needed to add additional standards.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-04 22:21:34 -02:00
Mauro Carvalho Chehab
6fb167000e [media] mt2063: make checkpatch.pl happy
Fix everything but 80 columns and two msleep warnings

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-04 22:21:16 -02:00
Mauro Carvalho Chehab
e3f94fb8c5 [media] mt2063: Cleanup some function prototypes
No functional changes here.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-04 22:21:05 -02:00
Mauro Carvalho Chehab
8294e3ed41 [media] mt2063: Reorder the code to avoid function prototypes
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-04 22:20:58 -02:00
Mauro Carvalho Chehab
4713e225a5 [media] mt2063: Remove setParm/getParm abstraction layer
This layer just increases the code size for no good reason,
and makes harder to debug.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-04 22:20:48 -02:00
Mauro Carvalho Chehab
3d49700fb1 [media] mt2063: Rework on the publicly-exported functions
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-04 22:20:34 -02:00
Mauro Carvalho Chehab
fad11dbc93 [media] mt2063: Simplify mt2063_setTune logic
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-04 22:20:27 -02:00
Mauro Carvalho Chehab
31e67faeaf [media] mt2063: simplify lockstatus logic
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-04 22:20:21 -02:00
Mauro Carvalho Chehab
66aea30d32 [media] mt2063: Remove several unused parameters
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-04 22:20:16 -02:00
Mauro Carvalho Chehab
fd1126cac0 [media] mt2063: Use linux default max function
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-04 22:20:09 -02:00
Mauro Carvalho Chehab
8c64f93285 [media] mt2063: Don't violate the DVB API
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-04 22:20:01 -02:00
Mauro Carvalho Chehab
01e0dafc64 [media] mt2063: Simplify device init logic
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-04 22:19:53 -02:00
Mauro Carvalho Chehab
e930b3a03e [media] mt2063: Simplify some functions
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-04 22:19:44 -02:00
Mauro Carvalho Chehab
e1de3d18d4 [media] mt2063: Rewrite read/write logic at the driver
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-04 22:19:38 -02:00
Mauro Carvalho Chehab
d0dcc2da26 [media] mt2063: Remove the code for more than one adjacent mt2063 tuners
Such code is disabled via ifdef's. Also, they're ugly and rely
on some static structures. Just remove. If ever needed, the git
log can be used to recover it.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-04 22:19:31 -02:00
Mauro Carvalho Chehab
dcd52d20d3 [media] mt2063: Use state for the state structure
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-04 22:19:21 -02:00
Mauro Carvalho Chehab
51f0f7b3ed [media] mt2063: Merge the two state structures into one
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-04 22:19:11 -02:00
Mauro Carvalho Chehab
29a0a4fec5 [media] mt2063: Remove unused data structures
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-04 22:19:04 -02:00
Mauro Carvalho Chehab
fdf77a4f8e [media] mt2063: Use Unix standard error handling
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-04 22:18:59 -02:00
Mauro Carvalho Chehab
065719a768 [media] mt2063: Remove internal version checks
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-04 22:18:49 -02:00
Mauro Carvalho Chehab
6d3d748a62 [media] mt2063: Move data structures to the driver
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-04 22:18:43 -02:00
Mauro Carvalho Chehab
f867695a0f [media] mt2063: get rid of compilation warnings
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-04 22:18:32 -02:00
Mauro Carvalho Chehab
059cd82d25 [media] mt2063: Remove unused stuff
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-04 22:18:07 -02:00
Mauro Carvalho Chehab
bf97555e08 [media] mt2063: Re-define functions as static
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-04 22:17:59 -02:00
Mauro Carvalho Chehab
a0813ea340 [media] mt2063: Remove most of the #if's
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-04 22:16:24 -02:00
Mauro Carvalho Chehab
cfde89258a [media] mt2063: Use standard Linux types, instead of redefining them
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-04 22:16:23 -02:00
Mauro Carvalho Chehab
b675668aaf [media] mt2063: Fix the driver to make it compile
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-04 22:16:22 -02:00
Mauro Carvalho Chehab
0ff4843218 [media] mt2063: Move code from mt2063_cfg.h
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-04 22:16:15 -02:00
Mauro Carvalho Chehab
4dca4efc10 [media] mt2063: Fix some Coding styles at mt2063.h
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-04 22:16:04 -02:00
Mauro Carvalho Chehab
0e301442d6 [media] mt2063: CodingStyle fixes
convert to Unix eol, run Lindent and remove bad whitespaces

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-04 22:13:54 -02:00
Mauro Carvalho Chehab
223c7b05e5 [media] add driver for mt2063
Those files are marked as licensed with GPL, so, it is ok to
merge. They came from Terratec site:

http://linux.terratec.de/files/TERRATEC_H7/20110323_TERRATEC_H7_Linux.tar.gz

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-04 22:12:41 -02:00
Mauro Carvalho Chehab
c6f56e7d79 [media] dvb: don't use DVBv3 bandwidth macros
Every frontend now uses DVBv5 way. So, let's not use the DVBv3
macros internally anymore.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-12-31 10:22:49 -02:00
Mauro Carvalho Chehab
14d24d148c [media] tuners: remove dvb_frontend_parameters from set_params()
This is a big patch, yet trivial: now that all tuners use the DVBv5
way to pass parameters (e. g. via fe->dtv_property_cache), the
extra parameter can be removed from set_params() call.

After this change, very few DVBv3 specific stuff are left at the
tuners.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-12-31 08:57:29 -02:00
Mauro Carvalho Chehab
249fa0b01c [media] dvb: remove dvb_frontend_parameters from calc_regs()
The calc_regs() callback is used by a few frontends (mt352, nxt200x,
digitv and zl10353). On all places it is called, the parameters are
set by DVBv5 way. So, just use the DVBv5 struct and remove the
extra parameter.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-12-31 08:52:22 -02:00
Mauro Carvalho Chehab
9481f4009c [media] tuner-simple: use DVBv5 parameters on set_params()
Despite its name, tuner-simple has a complex logic to set freqs ;)

Basically, it can be called by two different ways: via set_params()
or via calc_regs() callbacks. Both are bound to the DVBv3 API.
Also, set_params internally calls calc_regs().

In order to get rid of DVBv3 params at set_params(), it shouldn't
call calc_regs() anymore. The code duplication is very small,
as most of the code there is just to check for invalid parameters.

With regards to calc_regs(), it should still trust on bandwidth and
frequency parameters passed via DVBv3, until a later patch fixes
it.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-12-31 08:38:35 -02:00
Mauro Carvalho Chehab
40d6f2b837 [media] xc4000: use DVBv5 parameters on set_params()
Instead of using DVBv3 parameters, rely on DVBv5 parameters to
set the tuner.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-12-31 08:27:49 -02:00
Mauro Carvalho Chehab
506cd71454 [media] tuner-xc2028: use DVBv5 parameters on set_params()
Instead of using DVBv3 parameters, rely on DVBv5 parameters to
set the tuner.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-12-31 08:27:44 -02:00
Mauro Carvalho Chehab
53ccd1ca69 [media] tda827x: use DVBv5 parameters on set_params()
Instead of using DVBv3 parameters, rely on DVBv5 parameters to
set the tuner.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-12-31 08:27:39 -02:00
Mauro Carvalho Chehab
5ca1c94dea [media] tda18271-fe: use DVBv5 parameters on set_params()
Instead of using DVBv3 parameters, rely on DVBv5 parameters to
set the tuner.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-12-31 08:27:34 -02:00
Mauro Carvalho Chehab
ce0e93a52a [media] tda18271: add support for QAM 7 MHz map
This standard is not properly documented, but its settings are at
the tda18271dd driver, and are somewhat obvious, as they follow
the same logic as DVB-T 7MHz.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-12-31 08:27:27 -02:00
Mauro Carvalho Chehab
67ccfe3b9e [media] tda18218: use DVBv5 parameters on set_params()
Instead of using DVBv3 parameters, rely on DVBv5 parameters to
set the tuner.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-12-31 08:27:22 -02:00
Mauro Carvalho Chehab
e12617e6f0 [media] mxl5007t: use DVBv5 parameters on set_params()
Instead of using DVBv3 parameters, rely on DVBv5 parameters to
set the tuner.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-12-31 08:27:16 -02:00
Mauro Carvalho Chehab
1b750d09fe [media] mxl5005s: fix: don't discard bandwidth changes
There is a bug on mxl5005s logic: when the bandwidth changes, but using
the same delivery system, the code discard the set_params()
reconfiguration request.

This was happening because, in the previous coding, the bandwidth
calculus were after the check for delivery system changes.

The previous patch changed the logic to estimate the bandwidth to
happend together with the changes at the delivery system.

So, with a one-statement change, it is possible to make the tuner to
reconfigure, in order to adjust to bandwidth changes. this will
likely fix issues on countries that use 7MHz/8MHz DVB-T channels.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-12-31 08:27:11 -02:00
Mauro Carvalho Chehab
9818d7dff2 [media] mxl5005s: use DVBv5 parameters on set_params()
Instead of using DVBv3 parameters, rely on DVBv5 parameters to
set the tuner.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-12-31 08:27:06 -02:00
Mauro Carvalho Chehab
82c0126ff2 [media] mt2266: use DVBv5 parameters for set_params()
Instead of using DVBv3 parameters, rely on DVBv5 parameters to
set the tuner.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-12-31 08:27:01 -02:00
Mauro Carvalho Chehab
9f1791618a [media] max2165: use DVBv5 parameters on set_params()
Instead of using DVBv3 parameters, rely on DVBv5 parameters to
set the tuner.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-12-31 08:26:56 -02:00
Mauro Carvalho Chehab
35fea0649e [media] mc44s803: use DVBv5 parameters on set_params()
Instead of using DVBv3 parameters, rely on DVBv5 parameters to
set the tuner.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-12-31 08:26:50 -02:00
Mauro Carvalho Chehab
01ce5a7915 [media] mt2031: remove fake implementaion of get_bandwidth()
This driver implements a fake get_bandwidth() callback. In
reallity, the tuner driver won't adjust its low-pass
filter based on a bandwidth, and were just providing a fake
method for demods to read whatever was "set".

This code is useless, as none of the drivers that use
this tuner seems to require a get_bandwidth() callback.

While here, convert set_params to use the DVBv5 way to pass
parameters to tuners.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-12-31 08:26:44 -02:00
Mauro Carvalho Chehab
2676c258eb [media] mt2060: remove fake implementaion of get_bandwidth()
This driver implements a fake get_bandwidth() callback. In
reallity, the tuner driver won't adjust its low-pass
filter based on a bandwidth, and were just providing a fake
method for demods to read whatever was "set".

This code is useless, as none of the drivers that use
this tuner seems to require a get_bandwidth() callback.

While here, convert set_params to use the DVBv5 way to pass
parameters to tuners.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-12-31 08:26:40 -02:00
Mauro Carvalho Chehab
8b80ff3ad5 [media] qt1010: remove fake implementaion of get_bandwidth()
This driver implements a fake get_bandwidth() callback. In
reallity, the tuner driver won't adjust its low-pass
filter based on a bandwidth, and were just providing a fake
method for demods to read whatever was "set".

This code is useless, as none of the drivers that use
this tuner seems to require a get_bandwidth() callback.

While here, convert set_params to use the DVBv5 way to pass
parameters to tuners.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-12-31 08:26:35 -02:00
Mauro Carvalho Chehab
0349471bc5 [media] dvb: replace SYS_DVBC_ANNEX_AC by the right delsys
SYS_DVBC_ANNEX_AC is an alias for SYS_DVBC_ANNEX_A. However,
the first one is incorrect, as not all devices support both.
So, replace its occurrences by the proper value (either
SYS_DVBC_ANNEX_A or both SYS_DVBC_ANNEX_A and SYS_DVBC_ANNEX_C).

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-12-31 08:26:24 -02:00
Thomas Meyer
1b7acf0ccd [media] xc4000: Use kcalloc instead of kzalloc to allocate array
The advantage of kcalloc is, that will prevent integer overflows which could
result from the multiplication of number of elements and size and it is also
a bit nicer to read.

The semantic patch that makes this change is available
in https://lkml.org/lkml/2011/11/25/107

Signed-off-by: Thomas Meyer <thomas@m3y3r.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-12-30 17:22:21 -02:00
Mauro Carvalho Chehab
b4d48c942c Merge tag 'v3.2-rc7' into staging/for_v3.3
Linux 3.2-rc7

* tag 'v3.2-rc7': (1304 commits)
  Linux 3.2-rc7
  netfilter: xt_connbytes: handle negation correctly
  Btrfs: call d_instantiate after all ops are setup
  Btrfs: fix worker lock misuse in find_worker
  net: relax rcvbuf limits
  rps: fix insufficient bounds checking in store_rps_dev_flow_table_cnt()
  net: introduce DST_NOPEER dst flag
  mqprio: Avoid panic if no options are provided
  bridge: provide a mtu() method for fake_dst_ops
  md/bitmap: It is OK to clear bits during recovery.
  md: don't give up looking for spares on first failure-to-add
  md/raid5: ensure correct assessment of drives during degraded reshape.
  md/linear: fix hot-add of devices to linear arrays.
  sparc64: Fix MSIQ HV call ordering in pci_sun4v_msiq_build_irq().
  pata_of_platform: Add missing CONFIG_OF_IRQ dependency.
  ipv4: using prefetch requires including prefetch.h
  VFS: Fix race between CPU hotplug and lglocks
  vfs: __read_cache_page should use gfp argument rather than GFP_KERNEL
  USB: Fix usb/isp1760 build on sparc
  net: Add a flow_cache_flush_deferred function
  ...

Conflicts:
	drivers/media/common/tuners/tda18218.c
	drivers/media/video/omap3isp/ispccdc.c
	drivers/staging/media/as102/as102_drv.h
2011-12-30 13:59:37 -02:00
Linus Torvalds
62d7a2927f Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media
* 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: (31 commits)
  Revert "[media] af9015: limit I2C access to keep FW happy"
  [media] s5p-fimc: Fix camera input configuration in subdev operations
  [media] m5mols: Fix logic in sanity check
  [media] ati_remote: switch to single-byte scancodes
  [media] V4L: mt9m111: fix uninitialised mutex
  [media] V4L: omap1_camera: fix missing <linux/module.h> include
  [media] V4L: mt9t112: use after free in mt9t112_probe()
  [media] V4L: soc-camera: fix compiler warnings on 64-bit platforms
  [media] s5p_mfc_enc: fix s/H264/H263/ typo
  [media] omap_vout: Fix compile error in 3.1
  [media] au0828: add missing models 72101, 72201 & 72261 to the model matrix
  [media] au0828: add missing USB ID 2040:7213
  [media] au0828: add missing USB ID 2040:7260
  [media] [trivial] omap24xxcam-dma: Fix logical test
  [media] omap_vout: fix crash if no driver for a display
  [media] media: video: s5p-tv: fix build break
  [media] omap3isp: fix compilation of ispvideo.c
  [media] m5mols: Fix set_fmt to return proper pixel format code
  [media] s5p-fimc: Use correct fourcc for RGB565 colour format
  [media] s5p-fimc: Fail driver probing when sensor configuration is wrong
  ...
2011-12-20 10:49:39 -08:00
Mauro Carvalho Chehab
fd66c45dd5 [media] Remove Annex A/C selection via roll-off factor
Instead of using a roll-off factor, change DRX-K & friends to select
the bandwidth filter and the Nyquist half roll-off via delivery system.

This provides a cleaner support for Annex A/C switch.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-12-20 11:50:23 -02:00
Mauro Carvalho Chehab
0433cd28f3 [media] xc5000: Add support for 7MHz bandwidth for DVB-C/DVB-T
While xc5000 supports 7MHz bandwidth, the driver were lacking the code
implementing this feature, causing tuning issues with VHF chanels
used in Countries like Italy.

After this patch:

>>> tune to: 177500000:INVERSION_AUTO:BANDWIDTH_7_MHZ:FEC_2_3:FEC_AUTO:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_32:HIERARCHY_NONE
0x0000 0x0d49: pmt_pid 0x0102 RAI -- Rai 1 (running)
0x0000 0x0d4a: pmt_pid 0x0101 RAI -- Rai 2 (running)
0x0000 0x0d4b: pmt_pid 0x0100 RAI -- Rai 3 TGR Veneto (running)
0x0000 0x0d53: pmt_pid 0x0118 RAI -- Rai News (running)
0x0000 0x0d54: pmt_pid 0x0119 Rai -- Rai 3 TGR Emilia Romagna (running)
0x0000 0x0d4c: pmt_pid 0x0103 Rai -- Rai Radio1 (running)
0x0000 0x0d4d: pmt_pid 0x0104 Rai -- Rai Radio2 (running)
0x0000 0x0d4e: pmt_pid 0x0105 Rai -- Rai Radio3 (running)
Network Name 'Rai'

Tested-by: Eddi De Pieri <eddi@depieri.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-12-09 08:01:01 -02:00
Mauro Carvalho Chehab
78bd3dc8da [media] xc5000,tda18271c2dd: Fix bandwidth calculus
While here, add a debug message, to easy detecting bugs on it.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-12-08 17:04:38 -02:00
Mauro Carvalho Chehab
2bf936290b [media] xc5000: Remove the global mutex lock at xc5000 firmware init
As reported by Devin Heitmueller <dheitmueller@kernellabs.com>:

> It seems like a change such as this could significantly change the
> timing of tuner initialization if you have multiple xc5000 based
> products that might have a slow i2c bus.  Was that intentional?

After discussed with Eddi de Pierri <eddi@depieri.net>, it was pointed that
the change was not intentional, and it was just a trial while developing
the patches that add support for HVR-930C.

So, remove this hack.

Reported-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Acked by: Eddi de Pierri <eddi@depieri.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-12-07 07:59:14 -02:00
Mauro Carvalho Chehab
884b0515dc [media] tuner-xc2028: Better report signal strength
Fix lock bit to better indicate signal strength, from 4096 to
65535.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-11-30 14:43:36 -02:00
Antti Palosaari
576b849ea7 [media] mxl5007t: fix reg read
Register to read should be written to register 0xfb and then
perform I2C read to get reg value.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-11-24 17:55:39 -02:00
Antti Palosaari
8cffcc7899 [media] tda18212: round IF frequency to close hardware value
Chip configures IF frequency resolution of 50 kHz. Round it nearest.
Off-by 50 kHz is almost nothing in real life...

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-11-24 17:53:35 -02:00
Antti Palosaari
835bf82ce4 [media] tda18212: implement .get_if_frequency()
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-11-24 17:53:30 -02:00
Antti Palosaari
ed9405140e [media] qt1010: implement .get_if_frequency()
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-11-24 17:53:17 -02:00
Antti Palosaari
055327c55a [media] mt2060: implement .get_if_frequency()
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-11-24 17:53:00 -02:00
Antti Palosaari
d7d89dc85b [media] tda18218: fix 6 MHz default IF frequency
Default IF for 6 MHz bandwidth is 3 MHz. Use that.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-11-24 17:52:09 -02:00
Antti Palosaari
522fdf7319 [media] tda18218: implement .get_if_frequency()
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-11-24 17:50:57 -02:00
Mauro Carvalho Chehab
12cbfd0a3c Merge tag 'v3.2-rc2' into staging/for_v3.3
* tag 'v3.2-rc2': (3068 commits)
  Linux 3.2-rc2
  hfs: add sanity check for file name length
  fsl-rio: fix compile error
  blackfin: Fixup export.h includes
  Blackfin: add serial TX IRQ in individual platform resource
  virtio-pci: fix use after free
  ACPI / cpuidle: Remove acpi_idle_suspend (to fix suspend regression)
  drm/radeon/kms/combios: fix dynamic allocation of PM clock modes
  [CPUFREQ] db8500: fix build error due to undeclared i variable
  bma023: Add SFI translation for this device
  vrtc: change its year offset from 1960 to 1972
  ce4100: fix a build error
  arm/imx: fix imx6q mmc error when mounting rootfs
  arm/imx: fix AUTO_ZRELADDR selection
  arm/imx: fix the references to ARCH_MX3
  ARM: mx51/53: set pwm clock parent to ipg_perclk
  btrfs: rename the option to nospace_cache
  drm/radeon/kms/pm: switch to dynamically allocating clock mode array
  drm/radeon/kms: optimize r600_pm_profile_init
  drm/radeon/kms/pm: add a proper pm profile init function for fusion
  ...

Conflicts:
	drivers/media/radio/Kconfig
2011-11-23 19:42:09 -02:00
Eddi De Pieri
82e7dbbd4a [media] em28xx: initial support for HAUPPAUGE HVR-930C again
With this patch I try again to add initial support for HVR930C.

Tested only DVB-T, since in Italy Analog service is stopped.

Actually "scan -a0 -f1", find only about 50 channel while 400 should
be available.

[mchehab@redhat.com: Tested with DVB-C and fixed a few whitespace issues]
Tested-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Eddi De Pieri <eddi@depieri.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-11-20 11:24:20 -02:00
Mauro Carvalho Chehab
35621030c0 [media] xc5000: Add support for get_if_frequency
This is needed for devices with DRX-K and xc5000.

Tested with a HVR 930C hardware.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-11-20 11:04:20 -02:00
Mauro Carvalho Chehab
2440f7aff4 [media] Properly implement ITU-T J.88 Annex C support
The Annex C support were broken with the previous implementation,
as, at xc5000 and tda18271c2dd, it were choosing the wrong bandwidth
for some symbol rates.

At DRX-J, it were always selecting Annex A, even having Annex C
support coded there.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-11-11 20:26:03 -02:00
Michael Krufky
8c8ee11345 [media] tda18271: add tda18271_get_if_frequency
Reported-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-11-08 08:25:15 -02:00
Michael Krufky
d697b4ce94 [media] mxl5007t: add mxl5007t_get_if_frequency
Reported-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-11-08 08:24:13 -02:00
Dmitri Belimov
fabade547f [media] FM1216ME_MK3 AUX byte for FM mode
Write AUX byte to FM1216ME_MK3 when FM mode, better sensitivity. It can be
usefull for other tuners.

Signed-off-by: Beholder Intl. Ltd. Dmitry Belimov <d.belimov@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-11-07 12:39:17 -02:00
Antti Palosaari
b682ad1d17 [media] tda18212: add DVB-T2 support
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-11-07 10:25:56 -02:00
Linus Torvalds
32aaeffbd4 Merge branch 'modsplit-Oct31_2011' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux
* 'modsplit-Oct31_2011' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux: (230 commits)
  Revert "tracing: Include module.h in define_trace.h"
  irq: don't put module.h into irq.h for tracking irqgen modules.
  bluetooth: macroize two small inlines to avoid module.h
  ip_vs.h: fix implicit use of module_get/module_put from module.h
  nf_conntrack.h: fix up fallout from implicit moduleparam.h presence
  include: replace linux/module.h with "struct module" wherever possible
  include: convert various register fcns to macros to avoid include chaining
  crypto.h: remove unused crypto_tfm_alg_modname() inline
  uwb.h: fix implicit use of asm/page.h for PAGE_SIZE
  pm_runtime.h: explicitly requires notifier.h
  linux/dmaengine.h: fix implicit use of bitmap.h and asm/page.h
  miscdevice.h: fix up implicit use of lists and types
  stop_machine.h: fix implicit use of smp.h for smp_processor_id
  of: fix implicit use of errno.h in include/linux/of.h
  of_platform.h: delete needless include <linux/module.h>
  acpi: remove module.h include from platform/aclinux.h
  miscdevice.h: delete unnecessary inclusion of module.h
  device_cgroup.h: delete needless include <linux/module.h>
  net: sch_generic remove redundant use of <linux/module.h>
  net: inet_timewait_sock doesnt need <linux/module.h>
  ...

Fix up trivial conflicts (other header files, and  removal of the ab3550 mfd driver) in
 - drivers/media/dvb/frontends/dibx000_common.c
 - drivers/media/video/{mt9m111.c,ov6650.c}
 - drivers/mfd/ab3550-core.c
 - include/linux/dmaengine.h
2011-11-06 19:44:47 -08:00
Paul Gortmaker
7a707b8920 drivers/media: Add module.h to all files using it implicitly
A pending cleanup will mean that module.h won't be implicitly
everywhere anymore.  Make sure the modular drivers in clocksource
are actually calling out for <module.h> explicitly in advance.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
2011-10-31 19:31:51 -04:00
Paul Gortmaker
35a246363e drivers/media: Add export.h for EXPORT_SYMBOL/THIS_MODULE as required
These two macros were in module.h but now module.h is no longer
sprayed across every source file imaginable, so the users need
to expicitly call out their use of them.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
2011-10-31 19:31:51 -04:00
Hans Verkuil
d3bcaf083b [media] mxl5005s: fix compiler warning
Removed the unused Xtal_Int variable. That made it also possible to remove a
related function. However, the code of that function has been preserved in a
comment describing an equation. Without that function that comment would
have been hard to understand.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-09-06 14:43:43 -03:00
Hans Verkuil
7b4668efc4 [media] saa7146: fix compiler warning
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-09-06 14:40:09 -03:00
Hans Verkuil
f68afe5d45 [media] mt20xx.c: fix compiler warnings
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-09-06 14:38:42 -03:00
Joe Perches
44d0b80e5f [media] saa7146: Use current logging styles
Standardize the mechanisms to emit logging messages.

A few other modules used an #include from saa7146,
convert those at the same time.

Add pr_fmt.
Convert printks to pr_<level>
Convert printks without KERN_<level> to appropriate pr_<level>.
Convert logging macros requiring multiple parentheses to normal style.
Removed embedded prefixes when pr_fmt was added.
Whitespace cleanups when around other conversions.
Use printf extension %pM to print mac address.
Coalesce format strings.

Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Michael Hunold <michael@mihu.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-09-03 20:54:14 -03:00
Chris Rankin
0b8bd83cf3 [media] em28xx: don't sleep on disconnect
The DVB framework will try to power-down an adapter that no-one is using
any more, but this assumes that the adapter is still connected to the
machine. That's not always true for a USB adapter, so disable the sleep
operations when the adapter has been physically unplugged.

This prevents I2C write failures with error -19 from appearing
occasionally in the dmesg log.

Signed-off-by: Chris Rankin <rankincj@yahoo.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-09-03 20:50:22 -03:00
Arnaud Lacombe
3f5c14d3d3 [media] drivers/media: do not use EXTRA_CFLAGS
Usage of these flags has been deprecated for nearly 4 years by:

    commit f77bf01425
    Author: Sam Ravnborg <sam@neptun.(none)>
    Date:   Mon Oct 15 22:25:06 2007 +0200

        kbuild: introduce ccflags-y, asflags-y and ldflags-y

Moreover, these flags (at least EXTRA_CFLAGS) have been documented for command
line use. By default, gmake(1) do not override command line setting, so this is
likely to result in build failure or unexpected behavior.

Replace their usage by Kbuild's `{as,cc,ld}flags-y'.

Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: Mauro Carvalho Chehab <mchehab@infradead.org>
Cc: linux-media@vger.kernel.org
Signed-off-by: Arnaud Lacombe <lacombar@gmail.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-09-03 18:50:59 -03:00
Mauro Carvalho Chehab
fd34cb08ba [media] tuner/xc2028: Fix frequency offset for radio mode
In radio mode, no frequency offset should be used.

Instead of taking Thierry's patch that creates a separate function
to calculate the digital offset, it seemed better to just keep
everything at the same place.

Reported-by: Thierry Reding <thierry.reding@avionic-design.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-08-31 15:16:00 -03:00
Thierry Reding
4d37ece757 [media] tuner/xc2028: Add I2C flush callback
When loading the firmware, complete each chunk by sending an I2C flush
command to the frontend. Some devices like the tm6000 seem to require
this to properly flush the I2C buffers.

The current code in tm6000 executes the flush command once after each
I2C transfer, which slows down the firmware loading especially when
loading large BASE type images.

Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-08-31 15:03:22 -03:00
Joe Perches
2b50763a0b [media] tda18212: Use standard logging, remove tda18212_priv.h
Use the more current logging styles with pr_fmt.
Remove now unnecessary private include.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-08-27 11:20:45 -03:00
Joe Perches
be85fefecb [media] tda18271: Use printk extension %pV
Deduplicate printk formats to save ~20KB text.

$ size drivers/media/common/tuners/tda18271*o.*
   text	   data	    bss	    dec	    hex	filename
  10747	     56	   1920	  12723	   31b3	drivers/media/common/tuners/tda18271-common.o.new
  18889	     56	   3112	  22057	   5629	drivers/media/common/tuners/tda18271-common.o.old
  20561	    204	   4264	  25029	   61c5	drivers/media/common/tuners/tda18271-fe.o.new
  31093	    204	   6000	  37297	   91b1	drivers/media/common/tuners/tda18271-fe.o.old
   3681	   6760	    440	  10881	   2a81	drivers/media/common/tuners/tda18271-maps.o.new
   5631	   6760	    680	  13071	   330f	drivers/media/common/tuners/tda18271-maps.o.old

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-08-27 11:19:43 -03:00
Jose Alberto Reguero
2d84ca215f [media] tda827x: improve recection with limit frequencies
tda827x is currently taking the demod IF frequency into account while
seeking for the proper tuner range. This is wrong, as the demod IF
frequency has nothing to do with the tuner PLL.

Signed-off-by: Jose Alberto Reguero <jareguero@telefonica.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-08-07 09:32:16 -03:00
Mauro Carvalho Chehab
941830c927 [media] xc4000: make checkpatch.pl happy
Solve the ./scripts/checkpatch.pl compliants for the patches
that added xc4000 support, including a few changes at dib0700.

While here, remove a few printk noise by converting some msgs
into debug ones.

Cc: Istvan Varga <istvan_v@mailbox.hu>
Cc: Patrick Boettcher <pboettcher@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:52:40 -03:00
istvan_v@mailbox.hu
8edeb6eb1a [media] xc4000: removed card_type
Removed the use of 'card_type' from the tuner configuration structure, and
replaced it with separate parameters to set board-specific configuration.

Signed-off-by: Istvan Varga <istvan_v@mailbox.hu>
Cc: Patrick Boettcher <pboettcher@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:52:40 -03:00
istvan_v@mailbox.hu
09f4634293 [media] xc4000: check firmware version
Enabled code to check if the version of the firmware reported by the hardware
is correct after uploading it.

Signed-off-by: Istvan Varga <istvan_v@mailbox.hu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:52:40 -03:00
istvan_v@mailbox.hu
341747bef5 [media] xc4000: code cleanup
Various coding style changes:
  - removed unused / commented out code
  - changed C++ style comments to C format
  - renamed functions and variables that included upper case letters in the name
  - removed tabs from module parameter descriptions
  - replaced the use of XC_RESULT_* with standard error codes

Signed-off-by: Istvan Varga <istvan_v@mailbox.hu>
Cc: Patrick Boettcher <pboettcher@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:52:40 -03:00
Istvan Varga
7db98fe66b [media] xc4000: detect also xc4100
Added code to detect the XC4100 chip, which is presumably an analog-only
"value" version of the XC4000. It is not sure, however, if any devices
using this have actually been produced and sold, so the patch may be
unneeded.

Signed-off-by: Istvan Varga <istvan_v@mailbox.hu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:52:39 -03:00
Istvan Varga
8f76afe8d7 [media] xc4000: removed redundant tuner reset
This patch causes the tuner reset command to be ignored in the firmware
code, since this only happens when the BASE/INIT1 firmware is loaded by
check_firmware(), and in that case check_firmware() already calls the
reset callback before starting to load the firmware.

Signed-off-by: Istvan Varga <istvan_v@mailbox.hu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:52:39 -03:00
Istvan Varga
e75873c1f8 [media] xc4000: xc_tune_channel() cleanup
Minor coding changes related to the xc_tune_channel() function.

Signed-off-by: Istvan Varga <istvan_v@mailbox.hu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:52:39 -03:00
Istvan Varga
818a1776a4 [media] xc4000: implemented analog TV and radio
The following patch implements support for analog TV and FM radio.

Signed-off-by: Istvan Varga <istvan_v@mailbox.hu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:52:39 -03:00
Istvan Varga
923137a403 [media] xc4000: added audio_std module parameter
The 'audio_std' module parameter makes it possible to fine tune
some audio related aspects of the driver, like setting the exact
audio standard (NICAM, A2, etc.) to be used for some video standards.

Signed-off-by: Istvan Varga <istvan_v@mailbox.hu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:52:39 -03:00
Istvan Varga
30f544ec56 [media] xc4000: setting registers
This patch implements setting the registers in xc4000_set_params()
and xc4000_set_analog_params(). A new register is defined which enables
filtering of the composite video output (this is needed to avoid bad
picture quality with some boards).

Signed-off-by: Istvan Varga <istvan_v@mailbox.hu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:52:38 -03:00
Istvan Varga
f4312e2fd4 [media] xc4000: debug message improvements
The following patch makes a few minor changes to the printing
of debug messages, and reporting the tuner status. The 'debug'
module parameter can now be set from 0 to 2 to control the
verbosity of debug messages.

Signed-off-by: Istvan Varga <istvan_v@mailbox.hu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:52:38 -03:00
Istvan Varga
027fd36186 [media] xc4000: firmware initialization
This patch fixes/cleans up the loading of the firmware file when the
driver is loaded and initialized.

Signed-off-by: Istvan Varga <istvan_v@mailbox.hu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:52:36 -03:00
Istvan Varga
5272f6b1f4 [media] xc4000: implemented power management
The following patch implements the xc4000_sleep() function.
The 'no_powerdown' module parameter is now interpreted differently:
  - 0 uses a device-specific default
  - 1 disables power management like before
  - 2 enables power management

Signed-off-by: Istvan Varga <istvan_v@mailbox.hu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:52:36 -03:00
Istvan Varga
0b4021321c [media] xc4000: added card_type
This patch adds support for selecting a card type in struct
xc4000_config, to allow for implementing some card specific code
in the driver.

Signed-off-by: Istvan Varga <istvan_v@mailbox.hu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:52:36 -03:00
Istvan Varga
595a83f49a [media] xc4000: check_firmware() cleanup
This patch makes the following fixes in check_firmware():
  - there is only one BASE and INIT1 firmware for XC4000
  - loading SCODE is needed also for FM radio

Signed-off-by: Istvan Varga <istvan_v@mailbox.hu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:52:36 -03:00
Istvan Varga
ffce6266c8 [media] xc4000: simplified load_scode
Removed unused code from load_scode() (all SCODE firmwares are
assumed to have the HAS_IF bit set).

Signed-off-by: Istvan Varga <istvan_v@mailbox.hu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:52:34 -03:00
Istvan Varga
3db9570482 [media] xc4000: simplified seek_firmware()
This patch simplifies the code in seek_firmware().

Signed-off-by: Istvan Varga <istvan_v@mailbox.hu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:52:34 -03:00
Istvan Varga
fa285bc1bf [media] xc4000: added firmware_name parameter
The firmware_name module parameter makes it possible to set the firmware
file name. It defaults to "xc4000.fw" if not specified.

Signed-off-by: Istvan Varga <istvan_v@mailbox.hu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:52:34 -03:00
Istvan Varga
1368ceb266 [media] xc4000: fixed frequency error
The xc_get_frequency_error() function reported the frequency error
incorrectly. The data read from the hardware is a signed integer, in
15625 Hz units. The attached patch fixes the bug.

Signed-off-by: Istvan Varga <istvan_v@mailbox.hu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:52:34 -03:00
Istvan Varga
5614942bb0 [media] xc4000: added mutex
This patch adds a mutex to xc4000_priv, to protect the driver
from being accessed by multiple processes at the same time.

Signed-off-by: Istvan Varga <istvan_v@mailbox.hu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:52:34 -03:00
Istvan Varga
f0ef7c88ca [media] xc4000: added support for 7 MHz DVB-T
The following patch implements support for DVB-T with 7 MHz bandwidth.

Signed-off-by: Istvan Varga <istvan_v@mailbox.hu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:52:34 -03:00
Istvan Varga
4911085fa3 [media] xc4000: updated standards table
This patch makes the following changes to the standards table:
  - added 'u16 int_freq' to struct XC_TV_STANDARD (needed for analog TV
    and radio, 0 for DVB-T)
  - added new standard for SECAM-D/K video with PAL-D/K audio
  - the 'int_freq' values are now specified in the table
  - changed VideoMode for NTSC and PAL-B/G standards

Signed-off-by: Istvan Varga <istvan_v@mailbox.hu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:52:33 -03:00
Istvan Varga
fbe4a29f2f [media] xc4000: code cleanup
This is the first of a set of patches that update the original xc4000
sources to my modified version. It removes some unused code, and makes
a few minor formatting changes.

[mchehab@redhat.com: re-add XC_TUNE_ANALOG/XC_TUNE_DIGITAL constants, to avoid compilation breakage]
Signed-off-by: Istvan Varga <istvan_v@mailbox.hu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:52:33 -03:00
Mauro Carvalho Chehab
e3bb7c607f [media] xc4000: Fix a few bad whitespaces on it
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:52:33 -03:00
Devin Heitmueller
b6cdb5bea3 [media] xc4000: cleanup dmesg logging
Remove some printk() calls added during driver development, and demote some
other messages to debug only (to reduce dmesg chatter).

Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:52:33 -03:00
Devin Heitmueller
980029eb35 [media] xc4000: rename firmware image filename
Give the xc4000 firmware filename a filename that makes more sense for public
release.

Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:52:31 -03:00
Devin Heitmueller
4922cec59a [media] xc4000: turn off debug logging by default
Don't dump debug into to dmesg by default (something I had enabled during
bringup of the xc4000 driver).

Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:52:31 -03:00
Devin Heitmueller
ed23db3227 [media] xc4000: get rid of hard-coded 8MHz firmware config
Remove a hack I had put in to force the firmware to be 8MHz, now setting
the firmware properly based on the target standard.

Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:52:31 -03:00
Devin Heitmueller
799ed11afe [media] xc4000: handle dib0700 broken i2c stretching
It was confirmed by DibCom that i2c stretching is broken in the i2c master
on the dib7700.  So we need to put a hack into the xc4000 driver to not
complain in certain very specific cases where we know i2c stretching occurs.

Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:52:30 -03:00
Devin Heitmueller
fe83036476 [media] xc4000: use if_khz provided in xc4000_config
Remove hard-coded references to 5400, using the value passed in when the
xc4000 is attached.

Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:52:30 -03:00
Devin Heitmueller
ee4c3cd67b [media] xc4000: continued cleanup of the firmware loading routine
Properly setup the standard firmware loading and scode loading, as well as
getting rid of a ton of dead code.  Note that I am getting a single i2c
error when the standard firmware sets the video standard, but everything else
seems to be loading properly now.

Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:52:29 -03:00
Devin Heitmueller
d0962382cf [media] xc4000: add code to do standard and scode firmware loading
Add code to handle firmware blobs for the standard and scode.  Note there
appears to be some issue with loading the DTV8 standard firmware, probably
related to direct/indirect mode.

Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:52:29 -03:00
Devin Heitmueller
e7490d5962 [media] xc4000: remove xc5000 firmware loading routine
Since we use the xc3028 version of the firmware file parsing routine (which
includes support for scodes and separate blobs), we can drop the xc5000
version of the code.

Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:52:29 -03:00
Devin Heitmueller
02dec50982 [media] xc4000: remove XREG_BUSY code only supported in xc5000
The xc4000 driver is based on the original xc5000 driver, and while the
xc5000 supports the XREG_BUSY register, the xc4000 does not.  So remove the
code in question.

Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:52:29 -03:00
Devin Heitmueller
6bf60d56b3 [media] xc4000: properly set type for init1 firmware
We need to set the firmware type properly in order to locate the init1
firmware.

Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:52:28 -03:00
Devin Heitmueller
31f880e2b9 [media] xc4000: cut over to using xc5000 version for loading i2c sequences
The xc3028 version does i2c splitting in a different manner than xc4000 and
xc5000, so reuse the xc5000 version of the routine (the key here being that
xc4000 expects the first *two* bytes to be the same for splitting transactions.

Doing it the xc3028 way was resulting in i2c errors partially through the
firmware load.  With this change, it would appear that the entire base firmware
is being loaded successfully (product id now properly shows 0x0FA0).

Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:52:28 -03:00
Devin Heitmueller
11091a31fb [media] xc4000: pull in firmware management code from xc3028
Switch over to using the firmware management routines from the tuner-xc2028,
since that has support for scodes, etc.

This code still requires signficant cleanup, and at this point the base
firmware does not load properly (i2c write errors about 300 bytes in).

Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:52:28 -03:00
Davide Ferri
8d009a0c41 [media] dib0700: add initial code for PCTV 340e by Davide Ferri
This is initial code written by Davide Ferri for the PCTV 340e, including
a new xc4000 driver.  I am checking in all the code unmodified, and making
no assertions about its quality (other than confirming it compiles).

[mchehab@redhat.com: rebased on the top of the current tree]
Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Davide Ferri <davidef1986@gmail.com>
Cc: Patrick Boettcher <pboettcher@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:52:25 -03:00
Andreas Oberritter
15ed9d01b6 [media] DVB: mxl5005s: handle new bandwidths by returning -EINVAL
drivers/media/common/tuners/mxl5005s.c: In function ‘mxl5005s_set_params’:
drivers/media/common/tuners/mxl5005s.c:4016: warning: enumeration value ‘BANDWIDTH_5_MHZ’ not handled in switch
drivers/media/common/tuners/mxl5005s.c:4016: warning: enumeration value ‘BANDWIDTH_10_MHZ’ not handled in switch
drivers/media/common/tuners/mxl5005s.c:4016: warning: enumeration value ‘BANDWIDTH_1_712_MHZ’ not handled in switch

Signed-off-by: Andreas Oberritter <obi@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-05-20 19:04:59 -03:00
Antti Palosaari
f9d0bc1c08 [media] tda18271: add DVB-C support
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-05-20 09:30:05 -03:00
Antti Palosaari
26eb7045f1 [media] NXP TDA18212HN silicon tuner driver
New silicon tuner driver.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-05-20 09:26:57 -03:00
Bjørn Mork
abd34d8d6b [media] use pci_dev->revision
pci_setup_device() has saved the PCI revision in the pci_dev
struct since Linux 2.6.23.  Use it.

Cc: Auke Kok <auke-jan.h.kok@intel.com>
Signed-off-by: Bjørn Mork <bjorn@mork.no>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-05-20 07:26:16 -03:00
Mauro Carvalho Chehab
e0df5417ac [media] xc5000: Improve it to work better with 6MHz-spaced channels
Brazil uses 6MHz-spaced channels. So, the nyquist filter for
DVB-C should be different, otherwise, inter-channel interference
may badly affect the device, and signal may not be properly decoded.

On my tests here, without this patch, sometimes channels are seen,
but, most of the time, PID filter returns with timeout.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-05-20 07:26:14 -03:00
Linus Torvalds
7fcaa9aaea Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6
* 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6: (42 commits)
  [media] media: vb2: correct queue initialization order
  [media] media: vb2: fix incorrect v4l2_buffer->flags handling
  [media] s5p-fimc: Add support for the buffer timestamps and sequence
  [media] s5p-fimc: Fix bytesperline and plane payload setup
  [media] s5p-fimc: Do not allow changing format after REQBUFS
  [media] s5p-fimc: Fix FIMC3 pixel limits on Exynos4
  [media] tda18271: update tda18271c2_rf_cal as per NXP's rev.04 datasheet
  [media] tda18271: update tda18271_rf_band as per NXP's rev.04 datasheet
  [media] tda18271: fix bad calculation of main post divider byte
  [media] tda18271: prog_cal and prog_tab variables should be s32, not u8
  [media] tda18271: fix calculation bug in tda18271_rf_tracking_filters_init
  [media] omap3isp: queue: Don't corrupt buf->npages when get_user_pages() fails
  [media] v4l: Don't register media entities for subdev device nodes
  [media] omap3isp: Don't increment node entity use count when poweron fails
  [media] omap3isp: lane shifter support
  [media] omap3isp: ccdc: support Y10/12, 8-bit bayer fmts
  [media] media: add missing 8-bit bayer formats and Y12
  [media] v4l: add V4L2_PIX_FMT_Y12 format
  cx23885: Fix stv0367 Kconfig dependency
  [media] omap3isp: Use isp xclk defines
  ...

Fix up trivial conflict (spelink errurs) in drivers/media/video/omap3isp/isp.c
2011-04-27 15:17:52 -07:00
Michael Krufky
5b9a81d14f [media] tda18271: update tda18271c2_rf_cal as per NXP's rev.04 datasheet
Cc: Stefan Sibiga <stefansibiga@yahoo.ca>
Signed-off-by: Michael Krufky <mkrufky@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-04-19 11:33:24 -03:00
Michael Krufky
786e86ae5e [media] tda18271: update tda18271_rf_band as per NXP's rev.04 datasheet
Cc: Stefan Sibiga <stefansibiga@yahoo.ca>
Signed-off-by: Michael Krufky <mkrufky@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-04-19 11:33:04 -03:00
Michael Krufky
3f688e8c62 [media] tda18271: fix bad calculation of main post divider byte
R_MPD bit 3 does not depend on analog vs. digital. Just use
(0x7f & pd) directly from the values in the main pll table.

Thanks to Stefan Sibiga for pointing this out.

Cc: Stefan Sibiga <stefansibiga@yahoo.ca>
Signed-off-by: Michael Krufky <mkrufky@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-04-19 11:32:44 -03:00
Michael Krufky
381ad0ea14 [media] tda18271: prog_cal and prog_tab variables should be s32, not u8
Fix type of prog_cal and prog_tab variables to avoid any possible
calculation errors.

Signed-off-by: Michael Krufky <mkrufky@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-04-19 11:31:52 -03:00
Michael Krufky
f78028b68f [media] tda18271: fix calculation bug in tda18271_rf_tracking_filters_init
Misplaced parenthesis cause a calculation bug in
tda18271_rf_tracking_filters_init

Thanks to Stefan Sibiga for pointing this out.

Cc: Stefan Sibiga <stefansibiga@yahoo.ca>
Signed-off-by: Michael Krufky <mkrufky@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-04-19 11:30:33 -03:00
Lucas De Marchi
25985edced Fix common misspellings
Fixes generated by 'codespell' and manually reviewed.

Signed-off-by: Lucas De Marchi <lucas.demarchi@profusion.mobi>
2011-03-31 11:26:23 -03:00
Hans Verkuil
aa40d19497 [media] tuner-xc2028.c: fix compile warning
drivers/media/common/tuners/tuner-xc2028.c: In function 'generic_set_freq':
drivers/media/common/tuners/tuner-xc2028.c:936:15: warning: comparison between 'enum tuner_mode' and 'enum v4l2_tuner_type'

Argument type was enum tuner_mode, but should have been enum v4l2_tuner_type.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-03-22 04:53:58 -03:00
Dmitri Belimov
724dcbfa9c [media] xc5000: add set_config and other
Add one more radio input, usefull for tm6010
Add control output amplitude.
Add set_config function for configure tuner when TV card hasn't dvb part.

Signed-off-by: Beholder Intl. Ltd. Dmitry Belimov <d.belimov@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-03-21 20:32:19 -03:00
Igor M. Liplianin
e80edce1ab [media] xc5000: add support for DVB-C tuning
Signed-off-by: Igor M. Liplianin <liplianin@netup.ru>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-03-21 20:32:17 -03:00
Mauro Carvalho Chehab
437f5fa342 [media] tuner: Remove remaining usages of T_DIGITAL_TV
A few places used T_DIGITAL_TV internally. Remove the usage of this
obsolete mode mask.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-03-21 20:32:04 -03:00