platform/kernel/linux-rpi.git
9 years ago[media] DocBook: rewrite FE_GET_PROPERTY/FE_SET_PROPERTY to use the std way
Mauro Carvalho Chehab [Tue, 26 May 2015 11:48:51 +0000 (08:48 -0300)]
[media] DocBook: rewrite FE_GET_PROPERTY/FE_SET_PROPERTY to use the std way

Use the standard way of documenting ioctls for FE_GET_PROPERTY
and FE_SET_PROPERTY.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] DocBook: move DVB properties to happen earlier at the document
Mauro Carvalho Chehab [Tue, 26 May 2015 11:47:47 +0000 (08:47 -0300)]
[media] DocBook: move DVB properties to happen earlier at the document

The DVBv5 API uses DVB properties as the main way to set the frontend
and collect statistics. Move the definition to happen earlier, in
order to reflect its importance.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] DocBook: improve documentation for FE_READ_STATUS
Mauro Carvalho Chehab [Tue, 26 May 2015 11:17:53 +0000 (08:17 -0300)]
[media] DocBook: improve documentation for FE_READ_STATUS

Move the ioctl and enum fe_status to a separate xml file and
put it into a better format.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] DocBook: move FE_GET_INFO to a separate xml file
Mauro Carvalho Chehab [Tue, 26 May 2015 10:39:46 +0000 (07:39 -0300)]
[media] DocBook: move FE_GET_INFO to a separate xml file

Keeping everything altogether makes harder to reorganize the
DocBook. So, move the FE_GET_INFO ioctl and the associated structures
into a separate file.

No functional changes.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] DocBook: reformat FE_GET_INFO ioctl documentation
Mauro Carvalho Chehab [Tue, 26 May 2015 01:56:03 +0000 (22:56 -0300)]
[media] DocBook: reformat FE_GET_INFO ioctl documentation

The DVB part of the docbook has a completely different format
than the V4L2 part, as it was written as a separate document.

As the V4L2 documentation is on better shape, and its format
allows adding more information, let's use it for FE_GET_INFO
and gradually update the non-legacy DVB ioctls using the new
format.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] dvb: split enum from typedefs at frontend.h
Mauro Carvalho Chehab [Tue, 26 May 2015 10:34:21 +0000 (07:34 -0300)]
[media] dvb: split enum from typedefs at frontend.h

Using typedefs is already bad enough, but doing it together
with enum declaration is even worse.

Also, it breaks the scripts at DocBook that would be generating
reference pointers for the enums.

Well, we can't get rid of typedef right now, but let's at least
declare it on a separate line, and let the scripts to generate
the cross-reference, as this is needed for the next DocBook
patches.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] DocBook: move DVBv3 frontend bits to a separate section
Mauro Carvalho Chehab [Mon, 25 May 2015 19:44:40 +0000 (16:44 -0300)]
[media] DocBook: move DVBv3 frontend bits to a separate section

Although the recommended usage is the DVBv5 API calls, the
documentation doesn't make it clear about what's the recommended
calls and what's legacy.

So, move the legacy API bits to a separate xml, putting them into
a new section.

Please notice that more changes are needed, since some of the
bits there are cross-referenced elsewhere.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] DocBook: Improve DVB frontend description
Mauro Carvalho Chehab [Mon, 25 May 2015 17:24:38 +0000 (14:24 -0300)]
[media] DocBook: Improve DVB frontend description

The DVB frontend API got bitrotten. Update it.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] DocBook: fix emphasis at the DVB documentation
Mauro Carvalho Chehab [Mon, 25 May 2015 17:31:02 +0000 (14:31 -0300)]
[media] DocBook: fix emphasis at the DVB documentation

Currently, it is using 'role="tt"', but this is not defined at
the DocBook 4.5 spec. The net result is that no emphasis happens.

So, replace them to bold emphasis.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] DocBook: add drawing with a typical media device
Mauro Carvalho Chehab [Mon, 25 May 2015 16:40:28 +0000 (13:40 -0300)]
[media] DocBook: add drawing with a typical media device

An illustration of what's considered a typical media device
may help people to better understand the contents of the media
infrastructure API docbook. So, add it.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] DocBook: add a note about the ALSA API
Mauro Carvalho Chehab [Mon, 25 May 2015 16:39:48 +0000 (13:39 -0300)]
[media] DocBook: add a note about the ALSA API

The Docbook mistakenly makes to believe that all needed APIs for
media devices are there. Add a note there pointing that some
sub-devices are actually be controlled via ALSA API.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] DocBook: Update DVB supported standards at introduction
Mauro Carvalho Chehab [Mon, 25 May 2015 16:38:01 +0000 (13:38 -0300)]
[media] DocBook: Update DVB supported standards at introduction

The list of standards at the media docbook is incomplete, and it
is mentioning that the DVB-S2 & friends is "currently being updated".
That's wrong, as such update occurred back in 2008.

So, provide a more complete list of supported standards and add
a reference to the actual list.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] cx24120: Assume ucb registers is a counter
Jemma Denson [Wed, 20 May 2015 14:57:49 +0000 (11:57 -0300)]
[media] cx24120: Assume ucb registers is a counter

The ucblocks register is probably a counter and not a rate; assume
it is so and change the calculations as required.

Signed-off-by: Jemma Denson <jdenson@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] dvb-core: fix 32-bit overflow during bandwidth calculation
Antti Palosaari [Tue, 14 Apr 2015 18:12:54 +0000 (15:12 -0300)]
[media] dvb-core: fix 32-bit overflow during bandwidth calculation

Frontend bandwidth calculation overflows on very high DVB-S/S2
symbol rates. Use mult_frac() macro in order to keep calculation
correct.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] e4000: Fix rangehigh value
Mauro Carvalho Chehab [Wed, 20 May 2015 16:52:48 +0000 (13:52 -0300)]
[media] e4000: Fix rangehigh value

As reported by smatch:

drivers/media/tuners/e4000.c:287:32: warning: constant 2208000000 is so big it is long long
drivers/media/tuners/e4000.c:287:32: warning: decimal constant 2208000000 is between LONG_MAX and ULONG_MAX. For C99 that means long long, C90 compilers are very likely to produce unsigned long (and a warning) here
drivers/media/tuners/e4000.c:287:3: warning: this decimal constant is unsigned only in ISO C90
   .rangehigh  =  2208000000,
   ^

Cc: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] e4000: implement V4L2 subdevice tuner and core ops
Antti Palosaari [Tue, 12 May 2015 17:26:07 +0000 (14:26 -0300)]
[media] e4000: implement V4L2 subdevice tuner and core ops

Implement V4L2 subdevice tuner and core ops. After that this driver
is hybrid driver implementing both V4L2 and DVB ops.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] e4000: various small changes
Antti Palosaari [Tue, 21 Apr 2015 20:13:39 +0000 (17:13 -0300)]
[media] e4000: various small changes

* Rename device state from 's' to 'dev'.
* Move single include to driver private header.
* Change error handling type of each function to one I tend use
nowadays.
* Remove dummy register write from init. Even Windows driver does this
multiple times remove it as I have never seen any I2C errors.
* Define I2C client pointer for each function and use it.
* Do not clean tuner ops during driver remove - not needed.
* Disable sysfs device bind / unbind. We are not allowed manually
bind / unbind device from the driver currently.
* Rename some other variables.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] e4000: revise synthesizer calculation
Antti Palosaari [Wed, 22 Apr 2015 00:18:45 +0000 (21:18 -0300)]
[media] e4000: revise synthesizer calculation

Update synthesizer calculation to model I prefer nowadays. It is
mostly just renaming some variables to ones I think are most standard.
Also add 'schematic' of synthesizer following my current understanding.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] rtl2832_sdr: cleanup some set_bit() calls
Dan Carpenter [Thu, 14 May 2015 08:39:17 +0000 (05:39 -0300)]
[media] rtl2832_sdr: cleanup some set_bit() calls

This code works fine but static checkers complain.  The test_bit()
function takes the bit number and not a mask.  Then the other issue is
that we were using USB_STATE_URB_BUF which is BIT(0) instead of URB_BUF.
Also we were open coding that instead of using the test/clear/set_bit()
functions.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] cobalt: add new driver
Hans Verkuil [Tue, 12 May 2015 11:52:21 +0000 (08:52 -0300)]
[media] cobalt: add new driver

The cobalt device is a PCIe card with 4 HDMI inputs (adv7604) and a
connector that can be used to hook up an adv7511 transmitter or an
adv7842 receiver daughterboard.

This device is used within Cisco but is sadly not available outside
of Cisco. Nevertheless it is a very interesting driver that can serve
as an example of how to support HDMI hardware and how to use the popular
adv devices.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] adv7604/adv7842: replace FMT_CHANGED by V4L2_DEVICE_NOTIFY_EVENT
Hans Verkuil [Thu, 7 May 2015 13:37:57 +0000 (10:37 -0300)]
[media] adv7604/adv7842: replace FMT_CHANGED by V4L2_DEVICE_NOTIFY_EVENT

This makes it easier for the bridge driver to just passthrough such
events to the corresponding device node.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] v4l2-subdev: allow subdev to send an event to the v4l2_device notify function
jean-michel.hautbois@vodalys.com [Wed, 18 Mar 2015 10:21:47 +0000 (07:21 -0300)]
[media] v4l2-subdev: allow subdev to send an event to the v4l2_device notify function

All drivers use custom notifications, in particular when source changes.
The bridge only has to map the subdev that sends it to whatever video node it is connected to.

Signed-off-by: Jean-Michel Hautbois <jean-michel.hautbois@vodalys.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] vb2: allow requeuing buffers while streaming
Hans Verkuil [Tue, 20 Jan 2015 15:18:16 +0000 (12:18 -0300)]
[media] vb2: allow requeuing buffers while streaming

vb2_buffer_done() already allows STATE_QUEUED, but currently only when not
streaming. It is useful to allow it while streaming as well, as this makes
it possible for drivers to requeue buffers while waiting for a stable
video signal.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] adv7842: Make output format configurable through pad format operations
Hans Verkuil [Fri, 1 May 2015 14:31:30 +0000 (11:31 -0300)]
[media] adv7842: Make output format configurable through pad format operations

Replace the dummy video format operations by pad format operations that
configure the output format.

Copied from the adv7604 driver.

Note: while arch/blackfin/mach-bf609/boards/ezkit.c uses adv7842_platform_data
this source has not been updated because it is broken since the very
beginning. It depends on a struct adv7842_output_format that does not
exist.

And besides that gcc has no support for bf609 so nobody can compile it
except by installing a toolchain from ADI.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Cc: Scott Jiang <scott.jiang.linux@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] cx24120: fix minor checkpatch-error
Patrick Boettcher [Wed, 20 May 2015 07:58:49 +0000 (04:58 -0300)]
[media] cx24120: fix minor checkpatch-error

Remove multiple blank likes.

Signed-off-by: Patrick Boettcher <patrick.boettcher@posteo.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] cx24120: Update comment & fix typo
Jemma Denson [Tue, 19 May 2015 20:32:55 +0000 (17:32 -0300)]
[media] cx24120: Update comment & fix typo

These state vars are used for more than just ber calculation, also
fix typo.

Signed-off-by: Jemma Denson <jdenson@gmail.com>
Signed-off-by: Patrick Boettcher <patrick.boettcher@posteo.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] cx24120: Check for lock before updating BER & UCB
Jemma Denson [Tue, 19 May 2015 20:23:14 +0000 (17:23 -0300)]
[media] cx24120: Check for lock before updating BER & UCB

BER & UCB aren't available unless we're locked; don't update dvbv5
stats when not locked and mark these counters as unavailable.

Signed-off-by: Jemma Denson <jdenson@gmail.com>
Signed-off-by: Patrick Boettcher <patrick.boettcher@posteo.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] cx24120: Convert ucblocks to dvbv5 stats
Jemma Denson [Tue, 19 May 2015 18:52:46 +0000 (15:52 -0300)]
[media] cx24120: Convert ucblocks to dvbv5 stats

DVBv3 is a legacy API. Drivers should use DVBv5, in order to support
modern applications. So, implement UCB using dvbv5.

Signed-off-by: Jemma Denson <jdenson@gmail.com>
Signed-off-by: Patrick Boettcher <patrick.boettcher@posteo.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] cx24120: Convert read_ber to retrieve from cache
Jemma Denson [Tue, 19 May 2015 18:29:44 +0000 (15:29 -0300)]
[media] cx24120: Convert read_ber to retrieve from cache

Instead of reading BER again for DVBv3 call, use the value from the cache.

Signed-off-by: Jemma Denson <jdenson@gmail.com>
Signed-off-by: Patrick Boettcher <patrick.boettcher@posteo.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] cx24120: Add in dvbv5 stats for bit error rate
Jemma Denson [Tue, 19 May 2015 18:17:23 +0000 (15:17 -0300)]
[media] cx24120: Add in dvbv5 stats for bit error rate

DVBv3 is a legacy API. Drivers should use DVBv5, in order to support
modern applications. So, implement BER using dvbv5.

Signed-off-by: Jemma Denson <jdenson@gmail.com>
Signed-off-by: Patrick Boettcher <patrick.boettcher@posteo.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] cx24120: constify static data
Mauro Carvalho Chehab [Tue, 19 May 2015 11:19:47 +0000 (08:19 -0300)]
[media] cx24120: constify static data

Use const on the static data, as gcc may optimize better the
code. Also, would prevent that some code would override the
data there.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Signed-off-by: Patrick Boettcher <patrick.boettcher@posteo.de>
9 years ago[media] cx24120: declare cx24120_init() as static
Mauro Carvalho Chehab [Tue, 19 May 2015 11:06:52 +0000 (08:06 -0300)]
[media] cx24120: declare cx24120_init() as static

drivers/media/dvb-frontends/cx24120.c:1182:5: warning: no previous prototype for 'cx24120_init' [-Wmissing-prototypes]
 int cx24120_init(struct dvb_frontend *fe)
     ^

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Signed-off-by: Patrick Boettcher <patrick.boettcher@posteo.de>
9 years ago[media] cx24120: don't initialize a var that won't be used
Mauro Carvalho Chehab [Tue, 19 May 2015 11:04:35 +0000 (08:04 -0300)]
[media] cx24120: don't initialize a var that won't be used

As reported by smatch:
drivers/media/dvb-frontends/cx24120.c: In function 'cx24120_message_send':
drivers/media/dvb-frontends/cx24120.c:368:6: warning: variable 'ret' set but not used [-Wunused-but-set-variable]
  int ret, ficus;
      ^

The values written by cx24120 are never checked. So, remove the
check here too. That's said, the best would be to do the reverse,
but globally: to properly handle the error codes.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Signed-off-by: Patrick Boettcher <patrick.boettcher@posteo.de>
9 years ago[media] cx24120: Complete modfec_table
Jemma Denson [Fri, 15 May 2015 19:08:26 +0000 (16:08 -0300)]
[media] cx24120: Complete modfec_table

Add in all the likely values for setting fec on tuning. Some values
yet to be tested but very likely to be correct.
In the very unlikely event that these are wrong tuning with
FEC_AUTO will still work.

Signed-off-by: Jemma Denson <jdenson@gmail.com>
Signed-off-by: Patrick Boettcher <patrick.boettcher@posteo.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] b2c2: Reset no_base_addr on skystarS2 attach failure
Jemma Denson [Fri, 15 May 2015 18:40:29 +0000 (15:40 -0300)]
[media] b2c2: Reset no_base_addr on skystarS2 attach failure

If set, all the other drivers reset no_base_addr on failure to
attach - git commit for this being added to some of them seems to
be eccd15aad72f774b2059f708bc422dbb8493bb30

This driver has been floating around outside the mainline for so
long it hasn't had this fix, so add it in.

Whilst here tidy surrounding code to fix style issues.

Signed-off-by: Jemma Denson <jdenson@gmail.com>
Signed-off-by: Patrick Boettcher <patrick.boettcher@posteo.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] cx24120: More tidying in cx24120_init
Jemma Denson [Fri, 8 May 2015 20:36:19 +0000 (17:36 -0300)]
[media] cx24120: More tidying in cx24120_init

Remove reg1 by refactoring for loops
Change ret into an int as it's only used for return values now,
and remove reset_result by using ret instead.

Signed-off-by: Jemma Denson <jdenson@gmail.com>
Signed-off-by: Patrick Boettcher <patrick.boettcher@posteo.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] cx24120: Tidy cx24120_init
Jemma Denson [Fri, 8 May 2015 20:26:34 +0000 (17:26 -0300)]
[media] cx24120: Tidy cx24120_init

Use reg instead of ret for all calls to readreg, remove ret_EA
as it doesn't need to be a separate var anymore.

Signed-off-by: Jemma Denson <jdenson@gmail.com>
Signed-off-by: Patrick Boettcher <patrick.boettcher@posteo.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] cx24120: Remove unneccesary assignments in cx24120_init
Jemma Denson [Fri, 8 May 2015 19:57:56 +0000 (16:57 -0300)]
[media] cx24120: Remove unneccesary assignments in cx24120_init

Probably a remnant of this driver being reverse engineered,
cx24120_init assigned ret on each call to writereg - they're not
used for anything so remove them to clear up the codebase.

Signed-off-by: Jemma Denson <jdenson@gmail.com>
Signed-off-by: Patrick Boettcher <patrick.boettcher@posteo.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] cx24120: Tidy up calls to dev_dbg
Jemma Denson [Fri, 8 May 2015 19:34:31 +0000 (16:34 -0300)]
[media] cx24120: Tidy up calls to dev_dbg

Remove __func__ from calls to dev_dbg as dynamic debug can add in
the function name anyway.
Remove debug call in dvbv3 read_signal_strength as userspace has
this value anyway.
Reword some strings to make them simpler / more obvious.

Signed-off-by: Jemma Denson <jdenson@gmail.com>
Signed-off-by: Patrick Boettcher <patrick.boettcher@posteo.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] cx24120: Move CNR to DVBv5 stats
Jemma Denson [Fri, 8 May 2015 18:52:45 +0000 (15:52 -0300)]
[media] cx24120: Move CNR to DVBv5 stats

Better to report CNR via DVBv5 stats, as scale can be used.

Signed-off-by: Jemma Denson <jdenson@gmail.com>
Signed-off-by: Patrick Boettcher <patrick.boettcher@posteo.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] cx24120: Fix disecq_send_burst command
Jemma Denson [Tue, 5 May 2015 21:33:27 +0000 (18:33 -0300)]
[media] cx24120: Fix disecq_send_burst command

Previous version of this driver had a memset before every call
to cmd. This meant the default value of cmd.arg[1] was zero unless
burst is set. Make sure it remains zero.
Also fe_sec_mini_cmd_t is an enum, so test against it.

Signed-off-by: Jemma Denson <jdenson@gmail.com>
Signed-off-by: Patrick Boettcher <patrick.boettcher@posteo.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] cx24120: More coding style fixes
Jemma Denson [Tue, 5 May 2015 21:31:10 +0000 (18:31 -0300)]
[media] cx24120: More coding style fixes

Signed-off-by: Jemma Denson <jdenson@gmail.com>
Signed-off-by: Patrick Boettcher <patrick.boettcher@posteo.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] cx24120: Improve cooked signal strength value
Jemma Denson [Tue, 5 May 2015 21:09:45 +0000 (18:09 -0300)]
[media] cx24120: Improve cooked signal strength value

Algorithm copied from cx24117.c - it seems to work. Showing 95% on
a signal I know to be somewhere around 74dBuV.

[mchehab@osg.samsung.net: merged two patches, to avoid breaking compilation]
Signed-off-by: Jemma Denson <jdenson@gmail.com>
Signed-off-by: Patrick Boettcher <patrick.boettcher@posteo.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] cx24120: Return DVBv3 signal strength from cache
Jemma Denson [Tue, 5 May 2015 20:47:55 +0000 (17:47 -0300)]
[media] cx24120: Return DVBv3 signal strength from cache

This patch changes DVBv3 signal strength to read from the cache by
moving the signal strength reading routine into get_stat, and
reducing read_signal_strength to just returning the cached value.

Signed-off-by: Jemma Denson <jdenson@gmail.com>
Signed-off-by: Patrick Boettcher <patrick.boettcher@posteo.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] cx24120: Remove additional calls to read_status
Jemma Denson [Tue, 5 May 2015 20:18:11 +0000 (17:18 -0300)]
[media] cx24120: Remove additional calls to read_status

get_frontend was making a call to read_status, which is being
called periodically anyway. Have read_status store fe_status in
the state struct instead and use that within get_frontend.

Signed-off-by: Jemma Denson <jdenson@gmail.com>
Signed-off-by: Patrick Boettcher <patrick.boettcher@posteo.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] cx24120: Enable DVBv5 signal strength stats
Jemma Denson [Tue, 5 May 2015 20:10:13 +0000 (17:10 -0300)]
[media] cx24120: Enable DVBv5 signal strength stats

Previous patch added in collection, this patch enables them by
signalling they are available.

Signed-off-by: Jemma Denson <jdenson@gmail.com>
Signed-off-by: Patrick Boettcher <patrick.boettcher@posteo.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] cx24120: Add DVBv5 signal strength stats
Jemma Denson [Tue, 5 May 2015 19:59:27 +0000 (16:59 -0300)]
[media] cx24120: Add DVBv5 signal strength stats

Add new get_stats function, called from read_status, for
collecting DVBv5 stats into the frontend cache. Only signal
strength for now, can add others later.
Not currently marked as available, future patch will enable.

Signed-off-by: Jemma Denson <jdenson@gmail.com>
Signed-off-by: Patrick Boettcher <patrick.boettcher@posteo.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] cx24120: Rework vco function to remove xxyyzz variable
Jemma Denson [Sun, 3 May 2015 11:55:15 +0000 (08:55 -0300)]
[media] cx24120: Rework vco function to remove xxyyzz variable

Change calculate_vco function to send_vco to tidy up cx24120_init
function.
xxyyzz variable is remnants of a manual div & remainder codepath
to perform a u64 rounded div; replace with kernel macro
DIV_ROUND_CLOSEST_ULL
Hex values provided to the message are mainly variables calculated
within this function, replace with these to remove hardcoding.

Signed-off-by: Jemma Denson <jdenson@gmail.com>
Signed-off-by: Patrick Boettcher <patrick.boettcher@posteo.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] cx24120: Fix hexdump length in writeregs
Jemma Denson [Fri, 1 May 2015 19:20:16 +0000 (16:20 -0300)]
[media] cx24120: Fix hexdump length in writeregs

msg.len has been ++'d so msg.len is one too many.

Signed-off-by: Jemma Denson <jdenson@gmail.com>
Signed-off-by: Patrick Boettcher <patrick.boettcher@posteo.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] cx24120: Add missing command to cx24120_check_cmd
Jemma Denson [Thu, 30 Apr 2015 20:05:14 +0000 (17:05 -0300)]
[media] cx24120: Add missing command to cx24120_check_cmd

This patch adds in a missing command to cx24120_check_cmd. This part
of the old reverse engineered driver was quite hard to follow - it's
presumed the compiler did some neat optimisation that wasn't easy to
decode. This command was checked for in that version but not copied
across to the new switch statement.

For reference, old reverse engineered code:
xxzz = cmd->id - 0x11; // look for specific message id
if ( xxzz <= 0x13 ) {
msg_cmd_mask = 1 << xxzz;
//0x0F8021 // if cmd_id 17 or 22 or 33-36, 42, 47, 57-61 etc. disable mpeg output
if ( msg_cmd_mask & 0x0F8021 ) { // 000011111000000000100001b
cx24120_msg_mpeg_output_global_config(state, 0);
msleep(100);
state->dvb_s2_mode &=  0xFD; // reset mpeg out enable flag
}
}

Signed-off-by: Jemma Denson <jdenson@gmail.com>
Signed-off-by: Patrick Boettcher <patrick.boettcher@posteo.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] cx24120: Move clock set to read_status
Jemma Denson [Thu, 30 Apr 2015 19:37:42 +0000 (16:37 -0300)]
[media] cx24120: Move clock set to read_status

This patch removes the requirement of waiting for tune in
set_frontend by moving the clock set call into read_status

Signed-off-by: Jemma Denson <jdenson@gmail.com>
Signed-off-by: Patrick Boettcher <patrick.boettcher@posteo.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] cx24120: Fix minor style typo in Kconfig
Jemma Denson [Thu, 30 Apr 2015 18:01:11 +0000 (15:01 -0300)]
[media] cx24120: Fix minor style typo in Kconfig

This patch changes DVB-S/DVB-S2 to the more commonly used
DVB-S/S2 in the description for DVB_CX24120

Signed-off-by: Jemma Denson <jdenson@gmail.com>
Signed-off-by: Patrick Boettcher <patrick.boettcher@posteo.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] cx24120: fix strict checkpatch-errors
Patrick Boettcher [Tue, 28 Apr 2015 16:39:20 +0000 (13:39 -0300)]
[media] cx24120: fix strict checkpatch-errors

This patches fixes all checkpatch-errors.
Even the ones created --strict.

Signed-off-by: Patrick Boettcher <patrick.boettcher@posteo.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] cx24120: fix codingstyle issue first round
Patrick Boettcher [Tue, 28 Apr 2015 16:18:05 +0000 (13:18 -0300)]
[media] cx24120: fix codingstyle issue first round

Mauro pointed out some coding style issues in his review.
This patch fixes them.

Signed-off-by: Patrick Boettcher <patrick.boettcher@posteo.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] MAINTAINERS: add cx24120-maintainer
Patrick Boettcher [Tue, 28 Apr 2015 05:53:13 +0000 (02:53 -0300)]
[media] MAINTAINERS: add cx24120-maintainer

Add maintainer for the cx24120 frontend-driver.

Signed-off-by: Patrick Boettcher <patrick.boettcher@posteo.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] cx24120: i2c-max-write-size is now configurable
Patrick Boettcher [Tue, 28 Apr 2015 05:47:42 +0000 (02:47 -0300)]
[media] cx24120: i2c-max-write-size is now configurable

Some i2c-hosts are quite limited regarding maximum
i2c-burst-write-sizes. This patch makes the previously
hardcoded field configurable by users of the driver.

Signed-off-by: Patrick Boettcher <patrick.boettcher@posteo.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] cx24120: minor checkpatch fixes
Patrick Boettcher [Fri, 17 Apr 2015 09:04:53 +0000 (06:04 -0300)]
[media] cx24120: minor checkpatch fixes

This patch fixes printk-related checkpatch warnings. All printks
have been converted to pr_warn or pr_info or pr_err.

Signed-off-by: Patrick.Boettcher <patrick.boettcher@posteo.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] Add support for TechniSat Skystar S2
Jemma Denson [Tue, 14 Apr 2015 12:04:50 +0000 (09:04 -0300)]
[media] Add support for TechniSat Skystar S2

This patch adds support for the Technisat Skystar S2 - this
has been tried before but the cx24120 driver was a bit out of shape
and it didn't got any further:

https://patchwork.linuxtv.org/patch/10575/

It is an old card, but currently being sold off for next to nothing,
so it's proving quite popular of late. Noticing it's quite similar
to the cx24116 and cx24117 I've rewritten the driver in a similar way.

There were a few registers and commands from those drivers
missing from this one I've tested out and found they do something so
they've been added in to speed up tuning and to make get_frontend
return something useful.

Signed-off-by: Jemma Denson <jdenson@gmail.com>
Signed-off-by: Patrick.Boettcher <patrick.boettcher@posteo.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] DocBook/media: fix syntax error
Hans Verkuil [Fri, 15 May 2015 10:28:02 +0000 (07:28 -0300)]
[media] DocBook/media: fix syntax error

Missing varlistentry tags.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] DocBook/media: improve timestamp documentation
Hans Verkuil [Fri, 8 May 2015 10:55:01 +0000 (07:55 -0300)]
[media] DocBook/media: improve timestamp documentation

Explain which clock was used to make the timestamp.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] DocBook/media: remove spurious space
Hans Verkuil [Fri, 8 May 2015 10:54:35 +0000 (07:54 -0300)]
[media] DocBook/media: remove spurious space

Looks ugly, a space before a period at the end of a sentence. Remove it.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] rcar-vin: use monotonic timestamps
Hans Verkuil [Thu, 7 May 2015 06:26:21 +0000 (03:26 -0300)]
[media] rcar-vin: use monotonic timestamps

Even though the rcar-vin driver tells userspace that it will give a monotonic
timestamp, it is actually using gettimeofday. Replace this with a proper
monotonic timestamp.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] sta2x11: use monotonic timestamp
Hans Verkuil [Thu, 7 May 2015 06:22:14 +0000 (03:22 -0300)]
[media] sta2x11: use monotonic timestamp

V4L2 drivers should use MONOTONIC timestamps instead of gettimeofday, which is
affected by daylight savings time.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Federico Vaga <federico.vaga@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] v4l2-dv-timings: fix overflow in gtf timings calculation
Prashant Laddha [Tue, 5 May 2015 13:16:27 +0000 (10:16 -0300)]
[media] v4l2-dv-timings: fix overflow in gtf timings calculation

The intermediate calculation in the expression for hblank can exceed
32 bit signed range. This overflow can lead to negative values for
hblank. Typecasting intermediate variable to higher precision.

Cc: Martin Bugge <marbugge@cisco.com>
Signed-off-by: Prashant Laddha <prladdha@cisco.com>
[hans.verkuil@cisco.com: made the denominator u32, since that's what div_u64 expects]
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] media/vivid: Code cleanout
Ricardo Ribalda [Mon, 4 May 2015 08:07:32 +0000 (05:07 -0300)]
[media] media/vivid: Code cleanout

Remove code duplication by merging two cases in a switch.

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] media/vivid: Add support for Y16 format
Ricardo Ribalda [Mon, 4 May 2015 08:07:29 +0000 (05:07 -0300)]
[media] media/vivid: Add support for Y16 format

Support for V4L2_PIX_FMT_Y16, a 16 bit greyscale format.

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] rtl28xxu: load SDR module for fc2580 based devices
Antti Palosaari [Mon, 4 May 2015 00:48:47 +0000 (21:48 -0300)]
[media] rtl28xxu: load SDR module for fc2580 based devices

Load rtl2832_sdr driver for devices having fc2580 tuner.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] rtl2832_sdr: add support for fc2580 tuner
Antti Palosaari [Mon, 4 May 2015 00:45:43 +0000 (21:45 -0300)]
[media] rtl2832_sdr: add support for fc2580 tuner

Add initial support for fc2580 tuner based devices.
Tuner is controlled via V4L2 subdevice API.
Passes v4l2-compliance tests.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] fc2580: implement V4L2 subdevice for SDR control
Antti Palosaari [Mon, 4 May 2015 00:42:02 +0000 (21:42 -0300)]
[media] fc2580: implement V4L2 subdevice for SDR control

Implement V4L2 subdevice for bandwidth and frequency controls of
SDR usage. That driver now implements both DVB frontend and V4L2
subdevice. Driver itself is I2C driver. Lets see how it works.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] fc2580: calculate filter control word dynamically
Antti Palosaari [Sun, 3 May 2015 18:16:52 +0000 (15:16 -0300)]
[media] fc2580: calculate filter control word dynamically

Calculate low-pass filter control word dynamically from given radio
channel bandwidth.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] rtl28xxu: set correct FC2580 tuner for RTL2832 demod
Antti Palosaari [Fri, 24 Apr 2015 01:54:03 +0000 (22:54 -0300)]
[media] rtl28xxu: set correct FC2580 tuner for RTL2832 demod

rtl2832 demod driver has support for FC2580 tuner config, no need to
abuse FC0012 settings anymore.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] rtl2832: add inittab for FC2580 tuner
Antti Palosaari [Fri, 24 Apr 2015 01:52:07 +0000 (22:52 -0300)]
[media] rtl2832: add inittab for FC2580 tuner

Add reg/val inittab for FC2580 tuner.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] tua9001: use div_u64() for frequency calculation
Antti Palosaari [Thu, 16 Apr 2015 10:36:51 +0000 (07:36 -0300)]
[media] tua9001: use div_u64() for frequency calculation

Use div_u64() to simplify and remove home made divides.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] tua9001: use regmap for I2C register access
Antti Palosaari [Wed, 15 Apr 2015 23:38:43 +0000 (20:38 -0300)]
[media] tua9001: use regmap for I2C register access

Use regmap for I2C register access.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] tua9001: various minor changes
Antti Palosaari [Wed, 15 Apr 2015 23:26:06 +0000 (20:26 -0300)]
[media] tua9001: various minor changes

Fix logging. Style issues. Rename things.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] tua9001: remove media attach
Antti Palosaari [Wed, 15 Apr 2015 22:33:13 +0000 (19:33 -0300)]
[media] tua9001: remove media attach

We are using I2C client binding now, so remove old media attach.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] rtl28xxu: bind tua9001 using I2C binding
Antti Palosaari [Wed, 15 Apr 2015 22:25:32 +0000 (19:25 -0300)]
[media] rtl28xxu: bind tua9001 using I2C binding

Change tua9001 driver from media binding to I2C client binding.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] af9035: bind tua9001 using I2C binding
Antti Palosaari [Wed, 15 Apr 2015 22:18:40 +0000 (19:18 -0300)]
[media] af9035: bind tua9001 using I2C binding

Change tua9001 driver from media binding to I2C client binding.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] tua9001: add I2C bindings
Antti Palosaari [Wed, 15 Apr 2015 22:12:34 +0000 (19:12 -0300)]
[media] tua9001: add I2C bindings

Add I2C bindings.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] af9035: fix device order in ID list
Antti Palosaari [Wed, 15 Apr 2015 18:01:22 +0000 (15:01 -0300)]
[media] af9035: fix device order in ID list

Driver supports multiple chipset versions. Devices are ordered to
ID table per used chipset type. "ITE 9303 Generic" device uses IT9303
chipset and was added mistakenly between IT9135 IDs.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] fc2580: use regmap for register I2C access
Antti Palosaari [Wed, 15 Apr 2015 16:51:29 +0000 (13:51 -0300)]
[media] fc2580: use regmap for register I2C access

Replace home made register access routines with regmap.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] fc2580: cleanups and variable renames
Antti Palosaari [Wed, 15 Apr 2015 15:35:47 +0000 (12:35 -0300)]
[media] fc2580: cleanups and variable renames

Rename driver state from priv to dev.
Remove legacy i2c-gate control.
Use I2C client for proper dev_() logging.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] fc2580: improve set params logic
Antti Palosaari [Wed, 15 Apr 2015 15:10:54 +0000 (12:10 -0300)]
[media] fc2580: improve set params logic

Calculate PLL dividers slightly differently, most likely it is now
correct. Move some register values to innitab. Use jiffies to poll
filter lock. Fix logging.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] fc2580: remove obsolete media attach
Antti Palosaari [Tue, 14 Apr 2015 23:15:09 +0000 (20:15 -0300)]
[media] fc2580: remove obsolete media attach

All users are using driver via I2C client binding so lets remove
unneeded media binding.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] af9035: bind fc2580 using I2C binding
Antti Palosaari [Tue, 14 Apr 2015 23:07:16 +0000 (20:07 -0300)]
[media] af9035: bind fc2580 using I2C binding

Change fc2580 driver from media binding to I2C client binding.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] rtl28xxu: bind fc2580 using I2C binding
Antti Palosaari [Tue, 14 Apr 2015 22:55:51 +0000 (19:55 -0300)]
[media] rtl28xxu: bind fc2580 using I2C binding

Change fc2580 driver from media binding to I2C client binding.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] fc2580: implement I2C client bindings
Antti Palosaari [Tue, 14 Apr 2015 22:52:16 +0000 (19:52 -0300)]
[media] fc2580: implement I2C client bindings

Add I2C client bindings to driver.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] dib0700: avoid the risk of forgetting to add the adapter's size
Mauro Carvalho Chehab [Wed, 13 May 2015 21:51:19 +0000 (18:51 -0300)]
[media] dib0700: avoid the risk of forgetting to add the adapter's size

For every frontend entry, we need to add the adapter's size. There
are already two patches fixing it. So, it doesn't seem trivial to
keep it there at the right place.

Also, currently, the indentation is wrong on all places.

So, it seems that keeping it right is not too trivial.

Better to use a macro that would do it for us, at least while
this is not converted to dvb-usb-v2.

Compile-tested only.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] saa7164: use an MSI interrupt when available
Brendan McGrath [Fri, 10 Apr 2015 06:39:22 +0000 (03:39 -0300)]
[media] saa7164: use an MSI interrupt when available

Enhances driver to use an MSI interrupt when available.

Adds the module option 'enable_msi' (type bool) which by default is
enabled. Can be set to 'N' to disable.

Fixes (or can reduce the occurrence of) a crash which is most commonly
reported when both digital tuners of the saa7164 chip is in use. A
reported example can be found here:
http://permalink.gmane.org/gmane.linux.drivers.video-input-infrastructure/83948

Reviewed-by: Steven Toth <stoth@kernellabs.com>
Signed-off-by: Brendan McGrath <redmcg@redmandi.dyndns.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] dvb: Document FE_SCALE_DECIBEL units consistently
David Howells [Thu, 9 Apr 2015 19:36:49 +0000 (16:36 -0300)]
[media] dvb: Document FE_SCALE_DECIBEL units consistently

In comments and in the documentation, the units of properties marked
with the FE_SCALE_DECIBEL scale are specified in terms of 1/1000 dB
or 0.0001 dB.  This is inconsistent, however, as 1/1000 is 0.001,
not 0.0001.

Note that the v4l-utils divide the value by 1000 for the signal
strength suggesting that the 1/1000 is correct.

Settle on millidecibels, ie. 1/1000dB or 0.001dB.

Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] fc0013: remove unneeded test
Laurent Navet [Thu, 2 Apr 2015 20:33:28 +0000 (17:33 -0300)]
[media] fc0013: remove unneeded test

The same code is executed if ret is true or false, so this test can
be removed.
Fix Coverity CID 1268782.

Signed-off-by: Laurent Navet <laurent.navet@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] rc: nuvoton-cir: Add support for writing wakeup samples via sysfs filter...
Antti Seppälä [Tue, 31 Mar 2015 17:48:12 +0000 (14:48 -0300)]
[media] rc: nuvoton-cir: Add support for writing wakeup samples via sysfs filter callback

Nuvoton-cir utilizes the encoding capabilities of rc-core to convert
scancodes from user space to pulse/space format understood by the
underlying hardware.

Converted samples are then written to the wakeup fifo along with other
necessary configuration to enable wake up functionality.

Signed-off-by: Antti Seppälä <a.seppala@gmail.com>
Signed-off-by: James Hogan <james@albanarts.com>
Cc: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] rc: rc-loopback: Add loopback of filter scancodes
James Hogan [Tue, 31 Mar 2015 17:48:11 +0000 (14:48 -0300)]
[media] rc: rc-loopback: Add loopback of filter scancodes

Add the s_wakeup_filter callback to the rc-loopback driver, which instead of
setting the filter just feeds the scancode back through the input device
so that it can be verified.

Signed-off-by: James Hogan <james@albanarts.com>
Signed-off-by: Antti Seppälä <a.seppala@gmail.com>
Cc: David Härdeman <david@hardeman.nu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] rc: rc-core: Add support for encode_wakeup drivers
James Hogan [Tue, 31 Mar 2015 17:48:10 +0000 (14:48 -0300)]
[media] rc: rc-core: Add support for encode_wakeup drivers

Add support in rc-core for drivers which implement the wakeup scancode
filter by encoding the scancode using the raw IR encoders. This is by
way of rc_dev::encode_wakeup which should be set to true to make the
allowed wakeup protocols the same as the set of raw IR encoders.

As well as updating the sysfs interface to know which wakeup protocols
are allowed for encode_wakeup drivers, also ensure that the IR
decoders/encoders are loaded when an encode_wakeup driver is registered.

Signed-off-by: James Hogan <james@albanarts.com>
Signed-off-by: Antti Seppälä <a.seppala@gmail.com>
Cc: David Härdeman <david@hardeman.nu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] rc: ir-rc6-decoder: Add encode capability
Antti Seppälä [Tue, 31 Mar 2015 17:48:09 +0000 (14:48 -0300)]
[media] rc: ir-rc6-decoder: Add encode capability

Add the capability to encode RC-6 and RC-6A scancodes as raw events.
The protocol is chosen based on the specified protocol mask, and
whether all the required bits are set in the scancode mask, and none of
the unused bits are set in the scancode data.

The Manchester modulation helper is used several times with various
timings so that RC-6 header preamble, the header, header trailing bit
and the data itself can be modulated correctly.

Signed-off-by: Antti Seppälä <a.seppala@gmail.com>
Cc: James Hogan <james@albanarts.com>
Cc: David Härdeman <david@hardeman.nu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] rc: ir-rc5-decoder: Add encode capability
James Hogan [Tue, 31 Mar 2015 17:48:08 +0000 (14:48 -0300)]
[media] rc: ir-rc5-decoder: Add encode capability

Add the capability to encode RC-5, RC-5X and RC-5-SZ scancodes as raw
events. The protocol is chosen based on the specified protocol mask,
and whether all the required bits are set in the scancode mask, and
none of the unused bits are set in the scancode data. For example a
scancode filter with bit 16 set in both data and mask is unambiguously
RC-5X.

The Manchester modulation helper is used, and for RC-5X it is used twice
with two sets of timings, the first with a short trailer space for the
space in the middle, and the second with no leader so that it can
continue the space.

The encoding in RC-5-SZ first inserts a pulse and then simply utilizes
the generic Manchester encoder available in rc-core.

Signed-off-by: James Hogan <james@albanarts.com>
Signed-off-by: Antti Seppälä <a.seppala@gmail.com>
Cc: David Härdeman <david@hardeman.nu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] rc: rc-ir-raw: Add Manchester encoder (phase encoder) helper
Antti Seppälä [Tue, 31 Mar 2015 17:48:07 +0000 (14:48 -0300)]
[media] rc: rc-ir-raw: Add Manchester encoder (phase encoder) helper

Adding a simple Manchester encoder to rc-core.
Manchester coding is used by at least RC-5 and RC-6 protocols and their
variants.

Signed-off-by: Antti Seppälä <a.seppala@gmail.com>
Signed-off-by: James Hogan <james@albanarts.com>
Cc: David Härdeman <david@hardeman.nu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] rc: rc-ir-raw: Add scancode encoder callback
James Hogan [Tue, 31 Mar 2015 17:48:06 +0000 (14:48 -0300)]
[media] rc: rc-ir-raw: Add scancode encoder callback

Add a callback to raw ir handlers for encoding and modulating a scancode
to a set of raw events. This could be used for transmit, or for
converting a wakeup scancode filter to a form that is more suitable for
raw hardware wake up filters.

Signed-off-by: James Hogan <james@albanarts.com>
Signed-off-by: Antti Seppälä <a.seppala@gmail.com>
Cc: David Härdeman <david@hardeman.nu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] msi2500: cleanups
Antti Palosaari [Wed, 29 Apr 2015 16:37:34 +0000 (13:37 -0300)]
[media] msi2500: cleanups

Rename state to dev.
Correct some indentations.
Remove FSF address.
Fix some style issues reported by checkpatch.pl.
Correct some style issues I liked.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] msi2500: revise synthesizer calculation
Antti Palosaari [Wed, 29 Apr 2015 16:13:31 +0000 (13:13 -0300)]
[media] msi2500: revise synthesizer calculation

Update synthesizer calculation to model I prefer nowadays. It is mostly
just renaming some variables, but also minor functionality change how
integer and fractional part are divided (using div_u64_rem()). Also, add
'schematic' of synthesizer following my current understanding.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>