platform/kernel/linux-starfive.git
6 years ago[media] dt-bindings: Document the Rockchip RGA bindings
Jacob Chen [Wed, 11 Oct 2017 07:29:34 +0000 (00:29 -0700)]
[media] dt-bindings: Document the Rockchip RGA bindings

Add DT bindings documentation for Rockchip RGA

Signed-off-by: Jacob Chen <jacob-chen@iotwrt.com>
Signed-off-by: Yakir Yang <ykk@rock-chips.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Hans Verkuil <hansverk@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
6 years agoSimplify major/minor non-dynamic logic
Mauro Carvalho Chehab [Wed, 11 Oct 2017 19:29:46 +0000 (15:29 -0400)]
Simplify major/minor non-dynamic logic

changeset 6bbf7a855d20 ("media: dvbdev: convert DVB device types into an enum")
added a new warning on gcc 6:

>> drivers/media/dvb-core/dvbdev.c:86:1: warning: control reaches end of non-void function [-Wreturn-type]

That's because gcc is not smart enough to see that all types are
present at the switch. Also, the current code is not too optimized.

So, replace it to a more optimized one, based on a static table.

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Fixes: 6bbf7a855d20 ("media: dvbdev: convert DVB device types into an enum")
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: dvb: do some coding style cleanup
Mauro Carvalho Chehab [Wed, 11 Oct 2017 17:48:57 +0000 (13:48 -0400)]
media: dvb: do some coding style cleanup

Fix a bunch of coding style issues found by checkpatch on the
part of the code that the previous patches touched.

WARNING: please, no space before tabs
+ * ^I^Icallback.$

ERROR: space required before the open parenthesis '('
+ switch(cmd) {

WARNING: line over 80 characters
+ err = dtv_property_process_get(fe, &getp, tvp + i, file);

WARNING: line over 80 characters
+ err = fe->ops.diseqc_recv_slave_reply(fe, (struct dvb_diseqc_slave_reply*) parg);

ERROR: "(foo*)" should be "(foo *)"
+ err = fe->ops.diseqc_recv_slave_reply(fe, (struct dvb_diseqc_slave_reply*) parg);

WARNING: line over 80 characters
+ err = fe->ops.read_signal_strength(fe, (__u16 *) parg);

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: dvb uAPI docs: get rid of examples section
Mauro Carvalho Chehab [Wed, 20 Sep 2017 18:42:42 +0000 (14:42 -0400)]
media: dvb uAPI docs: get rid of examples section

That section is too outdated and got superseded by DVBv5 and
by libdvbv5.

Maybe some day we'll end adding updated examples there, but
while nobody has time or interest of doing that, just mention
that there and get rid of the current examples for good.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: dvb-net.rst: document DVB network kAPI interface
Mauro Carvalho Chehab [Wed, 20 Sep 2017 17:51:06 +0000 (13:51 -0400)]
media: dvb-net.rst: document DVB network kAPI interface

That's the last DVB kAPI that misses documentation.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: dtv-demux.rst: parse other demux headers with kernel-doc
Mauro Carvalho Chehab [Tue, 19 Sep 2017 23:03:14 +0000 (19:03 -0400)]
media: dtv-demux.rst: parse other demux headers with kernel-doc

Now that we have kernel-doc markups at dvb_demux.h and dmxdev.h,
parse them.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: dmxdev.h: add kernel-doc markups for data types and functions
Mauro Carvalho Chehab [Wed, 20 Sep 2017 16:10:48 +0000 (12:10 -0400)]
media: dmxdev.h: add kernel-doc markups for data types and functions

Despite being used by DVB drivers, this header was not documented.

Document it.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: dvb_demux.h: document functions
Mauro Carvalho Chehab [Wed, 20 Sep 2017 13:08:20 +0000 (09:08 -0400)]
media: dvb_demux.h: document functions

The functions used on dvb_demux.h are largely used on DVB drivers.
Yet, none of them are documented.

No functional changes.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: dvb_demux.h: document structs defined on it
Mauro Carvalho Chehab [Tue, 19 Sep 2017 23:11:22 +0000 (19:11 -0400)]
media: dvb_demux.h: document structs defined on it

There are three structs defined inside dvb_demux.h. None
of them are currently documented.

Add documentation for them.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: dvb_frontend: get rid of dtv_get_property_dump()
Mauro Carvalho Chehab [Wed, 20 Sep 2017 11:09:15 +0000 (07:09 -0400)]
media: dvb_frontend: get rid of dtv_get_property_dump()

Simplify the get property handling and move it to the existing
code at dtv_property_process_get() directly.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: dvb_frontend: dtv_property_process_set() cleanups
Satendra Singh Thakur [Wed, 20 Sep 2017 05:15:08 +0000 (01:15 -0400)]
media: dvb_frontend: dtv_property_process_set() cleanups

Since all properties in the func dtv_property_process_set() use
at most 4 bytes arguments, change the code to pass
u32 cmd and u32 data as function arguments, instead of passing a
pointer to the entire struct dtv_property *tvp.

Instead of having a generic dtv_property_dump(), added its own
properties debug logic in the dtv_property_process_set().

Signed-off-by: Satendra Singh Thakur <satendra.t@samsung.com>
Reviewed-by: Shuah Khan <shuahkh@osg.samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: dvb_demux: document dvb_demux_filter and dvb_demux_feed
Mauro Carvalho Chehab [Tue, 19 Sep 2017 23:04:08 +0000 (19:04 -0400)]
media: dvb_demux: document dvb_demux_filter and dvb_demux_feed

Document those two structs using kernel-doc markups.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: dvb_demux: fix type of dvb_demux_feed.ts_type
Mauro Carvalho Chehab [Tue, 19 Sep 2017 23:01:09 +0000 (19:01 -0400)]
media: dvb_demux: fix type of dvb_demux_feed.ts_type

Just like pes_type, this field represents an enum. Properly
identify it as such.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: dvb_demux.h: get rid of DMX_FEED_ENTRY() macro
Mauro Carvalho Chehab [Tue, 19 Sep 2017 22:59:45 +0000 (18:59 -0400)]
media: dvb_demux.h: get rid of DMX_FEED_ENTRY() macro

This isn't used anywere. Get rid of it.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: dvb_demux: dvb_demux_feed.pusi_seen is boolean
Mauro Carvalho Chehab [Tue, 19 Sep 2017 22:57:54 +0000 (18:57 -0400)]
media: dvb_demux: dvb_demux_feed.pusi_seen is boolean

Instead of using an integer to represent it, use boolean,
as this better describes what this field really means.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: dvb_demux: mark a boolean field as such
Mauro Carvalho Chehab [Tue, 19 Sep 2017 22:10:13 +0000 (18:10 -0400)]
media: dvb_demux: mark a boolean field as such

The struct dvb_demux_filter.doneq is a boolean.

Mark it as such, as it helps to understand what it does.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: dvb_demux.h: get rid of unused timer at struct dvb_demux_filter
Mauro Carvalho Chehab [Tue, 19 Sep 2017 22:08:45 +0000 (18:08 -0400)]
media: dvb_demux.h: get rid of unused timer at struct dvb_demux_filter

This field is not used. So, get rid of it.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: dvb_demux.h: add an enum for DMX_STATE_* and document
Mauro Carvalho Chehab [Tue, 19 Sep 2017 21:44:07 +0000 (17:44 -0400)]
media: dvb_demux.h: add an enum for DMX_STATE_* and document

kernel-doc allows documenting enums. Also, it makes clearer
about the meaning of each field on structures.

So, convert DMX_STATE_* to an enum.

While here, get rid of the unused DMX_STATE_SET.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: dvb_demux.h: add an enum for DMX_TYPE_* and document
Mauro Carvalho Chehab [Tue, 19 Sep 2017 21:43:49 +0000 (17:43 -0400)]
media: dvb_demux.h: add an enum for DMX_TYPE_* and document

kernel-doc allows documenting enums. Also, it makes clearer
about the meaning of each field on structures.

So, convert DMX_TYPE_* to an enum.

While here, get rid of the unused DMX_TYPE_PES.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: dtv-demux.rst: minor markup improvements
Mauro Carvalho Chehab [Tue, 19 Sep 2017 21:05:14 +0000 (17:05 -0400)]
media: dtv-demux.rst: minor markup improvements

Add a cross-reference to a mentioned structure and split
the kernel-doc stuff on a separate chapter.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: dtv-frontend.rst fix a typo: algoritms -> algorithms
Mauro Carvalho Chehab [Wed, 11 Oct 2017 17:06:30 +0000 (13:06 -0400)]
media: dtv-frontend.rst fix a typo: algoritms -> algorithms

WARNING: 'algoritms' may be misspelled - perhaps 'algorithms'?
+responsible for tuning the device. It supports multiple algoritms to

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: dtv-core.rst: split into multiple files
Mauro Carvalho Chehab [Tue, 19 Sep 2017 20:54:15 +0000 (16:54 -0400)]
media: dtv-core.rst: split into multiple files

Instead of document all kAPI into a single file, split it
on multiple ones. That makes easier to maintain each part.

As a side effect, it will produce multiple html pages, with
is a good idea.

No changes at the text. Just some chapter levels changed.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: dtv-core.rst: add chapters and introductory tests for common parts
Mauro Carvalho Chehab [Tue, 19 Sep 2017 20:46:10 +0000 (16:46 -0400)]
media: dtv-core.rst: add chapters and introductory tests for common parts

Better document the DVB common parts by adding two sections
and an introductory text for each.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: dvb_frontend.h: improve kernel-doc markups
Mauro Carvalho Chehab [Tue, 19 Sep 2017 20:40:33 +0000 (16:40 -0400)]
media: dvb_frontend.h: improve kernel-doc markups

Several minor adjustments at the kernel-doc markups:

- some syntax fixes;
- some cross-references;
- add cross-references for the mentioned ioctls;
- some constants marked as such.

No functional changes.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: dvbdev: fully document its functions
Mauro Carvalho Chehab [Tue, 19 Sep 2017 20:11:55 +0000 (16:11 -0400)]
media: dvbdev: fully document its functions

There are several functions at the dvbdev that are common to all
digital TV device nodes with aren't documented.

Add documentation for them. No functional changes.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: dvbdev: convert DVB device types into an enum
Mauro Carvalho Chehab [Tue, 19 Sep 2017 18:22:19 +0000 (14:22 -0400)]
media: dvbdev: convert DVB device types into an enum

Enums can be documented via kernel-doc. So, convert the
DVB_DEVICE_* macros to an enum.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: dvb_frontend: fix return values for FE_SET_PROPERTY
Mauro Carvalho Chehab [Mon, 18 Sep 2017 12:21:37 +0000 (08:21 -0400)]
media: dvb_frontend: fix return values for FE_SET_PROPERTY

There are several problems with regards to the return of
FE_SET_PROPERTY. The original idea were to return per-property
return codes via tvp->result field, and to return an updated
set of values.

However, that never worked. What's actually implemented is:

- the FE_SET_PROPERTY implementation doesn't call .get_frontend
  callback in order to get the actual parameters after return;

- the tvp->result field is only filled if there's no error.
  So, it is always filled with zero;

- FE_SET_PROPERTY doesn't call memdup_user() nor any other
  copy_to_user() function. So, any changes to the properties
  will be lost;

- FE_SET_PROPERTY is declared as a write-only ioctl (IOW).

While we could fix the above, it could cause regressions.

So, let's just assume what the code really does, updating
the documentation accordingly and removing the logic that
would update the discarded tvp->result.

Reviewed-by: Shuah Khan <shuahkh@osg.samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: dvb_frontend: better document the -EPERM condition
Mauro Carvalho Chehab [Mon, 18 Sep 2017 12:05:42 +0000 (08:05 -0400)]
media: dvb_frontend: better document the -EPERM condition

Two readonly ioctls can't be allowed if the frontend device
is opened in read only mode. Explain why.

Reviewed by: Shuah Khan <shuahkh@osg.samsung.com>

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: dvb_frontend.h: fix alignment at the cache properties
Mauro Carvalho Chehab [Mon, 18 Sep 2017 11:32:44 +0000 (07:32 -0400)]
media: dvb_frontend.h: fix alignment at the cache properties

There are too much tabs on several properties, for no good
reason. That sounds confusing while reading the struct, so
adjust them.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: dvb_frontend: get rid of property cache's state
Mauro Carvalho Chehab [Mon, 18 Sep 2017 11:29:19 +0000 (07:29 -0400)]
media: dvb_frontend: get rid of property cache's state

In the past, I guess the idea was to use state in order to
allow an autofush logic. However, in the current code, it is
used only for debug messages, on a poor man's solution, as
there's already a debug message to indicate when the properties
got flushed.

So, just get rid of it for good.

Reviewed-by: Shuah Khan <shuahkg@osg.samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: dvb_frontend: cleanup ioctl handling logic
Mauro Carvalho Chehab [Mon, 18 Sep 2017 11:15:13 +0000 (07:15 -0400)]
media: dvb_frontend: cleanup ioctl handling logic

Currently, there are two handlers for ioctls:
 - dvb_frontend_ioctl_properties()
 - dvb_frontend_ioctl_legacy()

Despite their names, both handles non-legacy DVB ioctls.

Besides that, there's no reason why to not handle all ioctls
on a single handler function.

So, merge them into a single function (dvb_frontend_handle_ioctl)
and reorganize the ioctl's to indicate what's the current DVB
API and what's deprecated.

Despite the big diff, the handling logic for each ioctl is the
same as before.

Reviewed-by: Shuah Khan <shuahkh@osg.samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: dvb_frontend: cleanup dvb_frontend_ioctl_properties()
Mauro Carvalho Chehab [Mon, 18 Sep 2017 10:54:11 +0000 (06:54 -0400)]
media: dvb_frontend: cleanup dvb_frontend_ioctl_properties()

Use a switch() on this function, just like on other ioctl
handlers and handle parameters inside each part of the
switch.

That makes it easier to integrate with the already existing
ioctl handler function.

Reviewed-by: Shuah Khan <shuahkh@osg.samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: dvb_frontend: get rid of set_property() callback
Mauro Carvalho Chehab [Thu, 14 Sep 2017 11:44:22 +0000 (07:44 -0400)]
media: dvb_frontend: get rid of set_property() callback

Now that all clients of set_property() were removed, get rid
of this callback.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: dvb_frontend: get rid of get_property() callback
Mauro Carvalho Chehab [Thu, 14 Sep 2017 11:44:20 +0000 (07:44 -0400)]
media: dvb_frontend: get rid of get_property() callback

Only lg2160 implement gets_property, but there's no need for that,
as no other driver calls this callback, as get_frontend() does the
same, and set_frontend() also calls lg2160 get_frontend().

So, get rid of it.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Reviewed-by: Michael Ira Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: friio-fe: get rid of set_property()
Mauro Carvalho Chehab [Thu, 14 Sep 2017 11:44:21 +0000 (07:44 -0400)]
media: friio-fe: get rid of set_property()

This callback is not actually doing anything but making it to
return an error depending on the DTV frontend command. Well,
that could break userspace for no good reason, and, if needed,
should be implemented, instead, at set_frontend() callback.

So, get rid of it.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: stv6110: get rid of a srate dead code
Mauro Carvalho Chehab [Thu, 14 Sep 2017 11:44:19 +0000 (07:44 -0400)]
media: stv6110: get rid of a srate dead code

The stv6110 has a weird code that checks if get_property
and set_property ioctls are defined. If they're, it initializes
a "srate" var from properties cache. Otherwise, it sets to
15MBaud, with won't make any sense.

Thankfully, it seems that someone else discovered the issue in
the past, as "srate" is currently not used anywhere!

So, get rid of that really weird dead code logic.

Reported-by: Honza Petrous <jpetrous@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: stv0288: get rid of set_property boilerplate
Mauro Carvalho Chehab [Thu, 14 Sep 2017 11:44:18 +0000 (07:44 -0400)]
media: stv0288: get rid of set_property boilerplate

This driver doesn't implement support for set_property(). Yet,
it implements a boilerplate for it. Get rid of it.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: rc: ir-spi needs OF
Sean Young [Mon, 9 Oct 2017 08:30:06 +0000 (04:30 -0400)]
media: rc: ir-spi needs OF

Without device tree, there is no way to use this driver.

Signed-off-by: Sean Young <sean@mess.org>
Acked-by: Andi Shyti <andi.shyti@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: rc: check for integer overflow
Sean Young [Sun, 8 Oct 2017 18:18:52 +0000 (14:18 -0400)]
media: rc: check for integer overflow

The ioctl LIRC_SET_REC_TIMEOUT would set a timeout of 704ns if called
with a timeout of 4294968us.

Cc: <stable@vger.kernel.org>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: dt: bindings: Add binding for tango HW IR decoder
Marc Gonzalez [Fri, 6 Oct 2017 12:23:37 +0000 (08:23 -0400)]
media: dt: bindings: Add binding for tango HW IR decoder

Add DT binding for the HW IR decoder embedded in SMP86xx/SMP87xx.

Signed-off-by: Marc Gonzalez <marc_gonzalez@sigmadesigns.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: rc: Add driver for tango HW IR decoder
Mans Rullgard [Fri, 6 Oct 2017 12:37:50 +0000 (08:37 -0400)]
media: rc: Add driver for tango HW IR decoder

The tango HW IR decoder supports NEC, RC-5, RC-6 protocols.

Signed-off-by: Mans Rullgard <mans@mansr.com>
Signed-off-by: Marc Gonzalez <marc_gonzalez@sigmadesigns.com>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: rc: Add tango keymap
Marc Gonzalez [Fri, 6 Oct 2017 12:33:41 +0000 (08:33 -0400)]
media: rc: Add tango keymap

Add a keymap for the Sigma Designs Vantage (dev board) remote control.

Signed-off-by: Marc Gonzalez <marc_gonzalez@sigmadesigns.com>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: rc: hix5hd2 drivers needs OF
Sean Young [Thu, 5 Oct 2017 21:30:59 +0000 (17:30 -0400)]
media: rc: hix5hd2 drivers needs OF

Without device tree, there is no way to use this driver.

Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: rc: pwm-ir-tx needs OF
Sean Young [Thu, 5 Oct 2017 21:30:58 +0000 (17:30 -0400)]
media: rc: pwm-ir-tx needs OF

Without device tree, there is no way to use this driver.

Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: rc: gpio-ir-tx does not work without devicetree or gpiolib
Sean Young [Thu, 5 Oct 2017 21:30:57 +0000 (17:30 -0400)]
media: rc: gpio-ir-tx does not work without devicetree or gpiolib

If the kernel is built without device tree, this driver cannot be
used and without gpiolib it cannot control any gpio pin.

Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: rc: nec decoder should not send both repeat and keycode
Sean Young [Sun, 1 Oct 2017 20:38:29 +0000 (16:38 -0400)]
media: rc: nec decoder should not send both repeat and keycode

When receiving an nec repeat, rc_repeat() is called and then rc_keydown()
with the last decoded scancode. That last call is redundant.

Fixes: 265a2988d202 ("media: rc-core: consistent use of rc_repeat()")

Cc: <stable@vger.kernel.org> # v4.14
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: lirc_dev: remove min_timeout and max_timeout
David Härdeman [Sun, 25 Jun 2017 12:31:30 +0000 (08:31 -0400)]
media: lirc_dev: remove min_timeout and max_timeout

There are no users of this functionality (ir-lirc-codec.c has its own
implementation and lirc_zilog.c doesn't use it) so remove it.

This only affects users of the lirc kapi, not rc-core drivers.

Signed-off-by: David Härdeman <david@hardeman.nu>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years ago[media] media: rc: fix gpio-ir-receiver build failure
Ladislav Michl [Thu, 5 Oct 2017 12:11:06 +0000 (09:11 -0300)]
[media] media: rc: fix gpio-ir-receiver build failure

The 0-day robot reports:

   drivers/media/rc/gpio-ir-recv.c: In function 'gpio_ir_recv_irq':
>> drivers/media/rc/gpio-ir-recv.c:38:8: error: implicit declaration of function 'gpiod_get_value' [-Werror=implicit-function-declaration]

Fixes: eed008e605d1 ("[media] media: rc: gpio-ir-recv: use gpiolib API")

For some reason only partial patch was applied. Also include
gpio/consumer.h otherwise compile test fails.

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
Acked-by: Sean Young <sean@mess.org>
6 years ago[media] smiapp: Make clock control optional
Sakari Ailus [Tue, 29 Aug 2017 12:41:25 +0000 (09:41 -0300)]
[media] smiapp: Make clock control optional

The clock control is not explicitly controlled by the driver in two cases:
ACPI based systems and when the clock is part of the power sequence of the
camera module.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
6 years ago[media] smiapp: Get clock rate if it's not available through DT
Sakari Ailus [Tue, 29 Aug 2017 12:41:24 +0000 (09:41 -0300)]
[media] smiapp: Get clock rate if it's not available through DT

Obtain the clock rate from the clock framework if it's not available
through DT. The assumption is that the parent device (camera module)
defines the rate as clock control is a part of the power on and power off
sequences --- which are camera module specific.

Also use the clock rate from DT if no clock is provided.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
6 years ago[media] smiapp: Verify clock frequency after setting it, prevent changing it
Sakari Ailus [Tue, 29 Aug 2017 12:41:23 +0000 (09:41 -0300)]
[media] smiapp: Verify clock frequency after setting it, prevent changing it

The external clock frequency was set by the driver but the obtained
frequency was never verified. Do that.

Being able to obtain the exact frequency is important as the value is used
for PLL calculations which may result in frequencies that violate the PLL
tree limits.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
6 years ago[media] smiapp: Fix error handling in power on sequence
Sakari Ailus [Tue, 29 Aug 2017 12:41:22 +0000 (09:41 -0300)]
[media] smiapp: Fix error handling in power on sequence

The error handling code in smiapp_power_on() returned in case of a failed
I2C write instead of cleaning up the mess. Fix this.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
6 years ago[media] ov13858: Use do_div() for dividing a 64-bit number
Sakari Ailus [Thu, 21 Sep 2017 14:24:53 +0000 (11:24 -0300)]
[media] ov13858: Use do_div() for dividing a 64-bit number

ov13858 contained a 64-bit division. Use do_div() for calculating it.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Tested-by: Chiranjeevi Rapolu <chiranjeevi.rapolu@intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
6 years ago[media] media: ov13858: Fix 4224x3136 video flickering at some vblanks
Chiranjeevi Rapolu [Mon, 18 Sep 2017 22:47:43 +0000 (19:47 -0300)]
[media] media: ov13858: Fix 4224x3136 video flickering at some vblanks

Previously, with crop (0, 0), (4255, 3167), VTS < 0xC9E was resulting in
blank frames sometimes. This appeared as video flickering. But we need VTS
< 0xC9E to get ~30fps.

Omni Vision recommends to use crop (0,8), (4255, 3159) for 4224x3136. With
this crop, VTS 0xC8E is supported and yields ~30fps.

Signed-off-by: Chiranjeevi Rapolu <chiranjeevi.rapolu@intel.com>
Reviewed-by: Tomasz Figa <tfiga@chromium.org>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
6 years ago[media] media: ov13858: Calculate pixel-rate at runtime, use mode
Chiranjeevi Rapolu [Mon, 18 Sep 2017 20:43:40 +0000 (17:43 -0300)]
[media] media: ov13858: Calculate pixel-rate at runtime, use mode

Calculate pixel-rate at run time instead of compile time.

Instead of using hardcoded pixels-per-line, extract it from current sensor
mode.

Signed-off-by: Chiranjeevi Rapolu <chiranjeevi.rapolu@intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
6 years ago[media] ov2640: make array reset_seq static, reduces object code size
Colin Ian King [Tue, 12 Sep 2017 09:11:15 +0000 (06:11 -0300)]
[media] ov2640: make array reset_seq static, reduces object code size

Don't populate the array reset_seq on the stack, instead make it
static.  Makes the object code smaller by over 50 bytes:

Before:
   text    data     bss     dec     hex filename
  11737    6000      64   17801    4589 drivers/media/i2c/ov2640.o

After:
   text    data     bss     dec     hex filename
  11582    6096      64   17742    454e drivers/media/i2c/ov2640.o

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
6 years ago[media] media: Check for active and has_no_links overrun
Sakari Ailus [Mon, 5 Oct 2015 15:45:29 +0000 (12:45 -0300)]
[media] media: Check for active and has_no_links overrun

The active and has_no_links arrays will overrun in
media_entity_pipeline_start() if there's an entity which has more than
MEDIA_ENTITY_MAX_PAD pads. Ensure in media_entity_init() that there are
fewer pads than that.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
6 years ago[media] i2c: Improve a size determination
Markus Elfring [Sat, 2 Sep 2017 14:09:35 +0000 (11:09 -0300)]
[media] i2c: Improve a size determination

Replace the specification of a data structure by pointer dereferences
as the parameter for the operator "sizeof" to make size
determination a bit safer according to the Linux coding style convention.

This issue was detected by using the Coccinelle software.

[mchehab@s-opensource.com: merged similar patches]
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
6 years ago[media] i2c: Delete an error messages for failed memory allocation
Markus Elfring [Sat, 2 Sep 2017 14:07:31 +0000 (11:07 -0300)]
[media] i2c: Delete an error messages for failed memory allocation

Omit extra messages for memory allocation failures.

This issue was detected by using the Coccinelle software.

[mchehab@s-opensource.com: merged similar patches]
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
6 years ago[media] media: ov5670: Fix not streaming issue after resume
Chiranjeevi Rapolu [Fri, 1 Sep 2017 22:08:31 +0000 (19:08 -0300)]
[media] media: ov5670: Fix not streaming issue after resume

Previously, the sensor was not streaming after resume from suspend,
i.e. on S0->S3->S0 transition. Due to this, camera app preview appeared
as stuck.

Now, handle streaming state correctly in case of suspend-resume.

Signed-off-by: Chiranjeevi Rapolu <chiranjeevi.rapolu@intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
6 years ago[media] dw9714: Set the v4l2 focus ctrl step as 1
Rajmohan Mani [Wed, 30 Aug 2017 17:48:52 +0000 (14:48 -0300)]
[media] dw9714: Set the v4l2 focus ctrl step as 1

Current v4l2 focus ctrl step value of 16, limits the minimum granularity
of focus positions to 16. Setting this value as 1, enables more accurate
focus positions.

Signed-off-by: Rajmohan Mani <rajmohan.mani@intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
6 years ago[media] ov2640: Check the return value from clk_prepare_enable()
Fabio Estevam [Sun, 27 Aug 2017 16:30:38 +0000 (13:30 -0300)]
[media] ov2640: Check the return value from clk_prepare_enable()

clk_prepare_enable() may fail, so we should better check its return value
and propagate it in the case of error.

Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
6 years ago[media] ov2640: Propagate the real error on devm_clk_get() failure
Fabio Estevam [Sun, 27 Aug 2017 16:30:37 +0000 (13:30 -0300)]
[media] ov2640: Propagate the real error on devm_clk_get() failure

devm_clk_get() may return different error codes other than -EPROBE_DEFER,
so it is better to return the real error code instead.

Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
6 years ago[media] mt9m111: Propagate the real error on v4l2_clk_get() failure
Fabio Estevam [Sun, 27 Aug 2017 16:30:36 +0000 (13:30 -0300)]
[media] mt9m111: Propagate the real error on v4l2_clk_get() failure

v4l2_clk_get() may return different error codes other than -EPROBE_DEFER,
so it is better to return the real error code instead.

Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
6 years ago[media] media: ov5670: Use recommended black level and output bias
Chiranjeevi Rapolu [Fri, 25 Aug 2017 04:20:55 +0000 (01:20 -0300)]
[media] media: ov5670: Use recommended black level and output bias

Previously, images were relatively darker due to non-optimal
settings for black target level and bias.

Now, use recommended settings for black target level and output bias
as default values. The same default settings apply to all the resolutions.
Given these recommeneded settings do not change dynamically, add these to
existing mode register settings.

Signed-off-by: Chiranjeevi Rapolu <chiranjeevi.rapolu@intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
6 years ago[media] v4l2-ctrls.c: allow empty control handlers
Hans Verkuil [Mon, 25 Sep 2017 09:41:02 +0000 (06:41 -0300)]
[media] v4l2-ctrls.c: allow empty control handlers

If you have a control handler that does not contain any controls, then
currently calling VIDIOC_G/S/TRY_EXT_CTRLS with count == 0 will return
-EINVAL in the class_check() function.

This is not correct, there is no reason why this should return an error.

The purpose of setting count to 0 is to test if the ioctl can mix controls
from different control classes. And this is possible. The fact that there
are not actually any controls defined is another matter that is unrelated
to this test.

This caused v4l2-compliance to fail, so that is fixed with this patch applied.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Reported-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
Tested-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
6 years ago[media] cec-gpio: don't generate spurious HPD events
Hans Verkuil [Mon, 25 Sep 2017 08:02:57 +0000 (05:02 -0300)]
[media] cec-gpio: don't generate spurious HPD events

Only send HPD_LOW/HIGH event if the gpio actually changed value.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
6 years ago[media] cx231xx-cards: fix NULL-deref on missing association descriptor
Johan Hovold [Thu, 21 Sep 2017 08:40:18 +0000 (05:40 -0300)]
[media] cx231xx-cards: fix NULL-deref on missing association descriptor

Make sure to check that we actually have an Interface Association
Descriptor before dereferencing it during probe to avoid dereferencing a
NULL-pointer.

Fixes: e0d3bafd0258 ("V4L/DVB (10954): Add cx231xx USB driver")

Cc: stable <stable@vger.kernel.org> # 2.6.30
Reported-by: Andrey Konovalov <andreyknvl@google.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Tested-by: Andrey Konovalov <andreyknvl@google.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
6 years ago[media] media/i2c/tc358743: Initialize timer
Kees Cook [Wed, 20 Sep 2017 23:27:41 +0000 (20:27 -0300)]
[media] media/i2c/tc358743: Initialize timer

This converts to use setup_timer() to set callback and data, though it
doesn't look like this would have worked with timer checking enabled
since no init_timer() was ever called before.

Cc: Mats Randgaard <matrandg@cisco.com>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
6 years ago[media] vivid: add support for Y10 and Y12
Hans Verkuil [Fri, 15 Sep 2017 14:51:45 +0000 (11:51 -0300)]
[media] vivid: add support for Y10 and Y12

Add support for 10 and 12 bit luma formats.

Signed-off-by: Hans Verkuil <hansverk@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
6 years ago[media] v4l2-tpg: add Y10 and Y12 support
Hans Verkuil [Fri, 15 Sep 2017 14:51:44 +0000 (11:51 -0300)]
[media] v4l2-tpg: add Y10 and Y12 support

Support the 10 and 12 bit luma formats.

Signed-off-by: Hans Verkuil <hansverk@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
6 years ago[media] rcar_drif: fix potential uninitialized variable use
Arnd Bergmann [Thu, 14 Sep 2017 11:07:27 +0000 (08:07 -0300)]
[media] rcar_drif: fix potential uninitialized variable use

Older compilers like gcc-4.6 may run into a case that returns
an uninitialized variable from rcar_drif_enable_rx() if that
function was ever called with an empty cur_ch_mask:

drivers/media/platform/rcar_drif.c:658:2: error: ‘ret’ may be used uninitialized in this function [-Werror=uninitialized]

Newer compilers don't have that problem as they optimize the
'ret' variable away and just return zero in that case.

This changes the function to return -EINVAL for this particular
failure, to make it consistent across all compiler versions.
In case gcc gets changed to report a warning for it in the
future, it's also a good idea to shut it up now.

Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82203
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
6 years ago[media] saa7146: make saa7146_use_ops const
Bhumika Goyal [Wed, 13 Sep 2017 19:37:50 +0000 (16:37 -0300)]
[media] saa7146: make saa7146_use_ops const

Make these const as they are not modified in the file referencing them.
They are only used when their function pointer fields invokes a
function and therefore none of the structure fields are getting modified.
Also, add a const to the declaration in the header.

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
6 years ago[media] gspca: make arrays static, reduces object code size
Colin Ian King [Tue, 12 Sep 2017 11:08:13 +0000 (08:08 -0300)]
[media] gspca: make arrays static, reduces object code size

Don't populate const arrays on the stack, instead make them
static.  Makes the object code smaller by over 5200 bytes:

Before:
   text    data     bss     dec     hex filename
  58259    8880     128   67267   106c3 ov519.o

After:
   text    data     bss     dec     hex filename
  52155    9776     128   62059    f26b ov519.o

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
6 years ago[media] media: i2c: adv748x: Map v4l2_std_id to the internal reg value
Simon Yuan [Mon, 11 Sep 2017 22:26:53 +0000 (19:26 -0300)]
[media] media: i2c: adv748x: Map v4l2_std_id to the internal reg value

The video standard was not mapped to the corresponding value of the
internal video standard in adv748x_afe_querystd, causing the wrong
video standard to be selected.

Fixes: 3e89586a64df ("media: i2c: adv748x: add adv748x driver")
[Kieran: Obtain the std from the afe->curr_norm]

Signed-off-by: Simon Yuan <simon.yuan@navico.com>
Signed-off-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
6 years ago[media] media: v4l2-pci-skeleton: Fix error handling path in 'skeleton_probe()'
Christophe JAILLET [Mon, 11 Sep 2017 16:53:07 +0000 (13:53 -0300)]
[media] media: v4l2-pci-skeleton: Fix error handling path in 'skeleton_probe()'

If this memory allocation fails, we must release some resources, as
already done in the code below and above.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
6 years ago[media] imon: Improve a size determination in two functions
Markus Elfring [Tue, 29 Aug 2017 10:45:59 +0000 (07:45 -0300)]
[media] imon: Improve a size determination in two functions

Replace the specification of data structures by pointer dereferences
as the parameter for the operator "sizeof" to make the corresponding size
determination a bit safer according to the Linux coding style convention.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
6 years ago[media] media: rc: Delete duplicate debug message
Marc Gonzalez [Mon, 18 Sep 2017 14:31:41 +0000 (11:31 -0300)]
[media] media: rc: Delete duplicate debug message

ir_setkeytable() and ir_create_table() print the same debug message.
Delete the one in ir_setkeytable()

Signed-off-by: Marc Gonzalez <marc_gonzalez@sigmadesigns.com>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
6 years ago[media] media: default for RC_CORE should be n
Stephen Hemminger [Fri, 8 Sep 2017 16:39:29 +0000 (13:39 -0300)]
[media] media: default for RC_CORE should be n

The Linus policy on Kconfig is that the default should be no
for all new devices. I.e the user rebuild a new kernel from an
old config should not by default get a larger kernel.

Fixes: b4c184e506a4 ("[media] media: reorganize the main Kconfig items")

Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
6 years ago[media] media: rc: Use bsearch library function
Thomas Meyer [Fri, 8 Sep 2017 16:33:36 +0000 (13:33 -0300)]
[media] media: rc: Use bsearch library function

Replace self coded binary search, by existing library version.

Signed-off-by: Thomas Meyer <thomas@m3y3r.de>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
6 years ago[media] media: rc: gpio-ir-recv: use gpiolib API
Ladislav Michl [Thu, 7 Sep 2017 23:41:32 +0000 (20:41 -0300)]
[media] media: rc: gpio-ir-recv: use gpiolib API

Gpiolib API is preferred way to access gpios.

Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
6 years ago[media] media: rc: gpio-ir-recv: remove gpio_ir_recv_platform_data
Ladislav Michl [Thu, 7 Sep 2017 23:39:45 +0000 (20:39 -0300)]
[media] media: rc: gpio-ir-recv: remove gpio_ir_recv_platform_data

gpio_ir_recv_platform_data are not used anywhere in kernel tree,
so remove it.

Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
6 years ago[media] media: rc: gpio-ir-recv: use KBUILD_MODNAME
Ladislav Michl [Thu, 7 Sep 2017 23:39:14 +0000 (20:39 -0300)]
[media] media: rc: gpio-ir-recv: use KBUILD_MODNAME

There already is standard macro providing driver name, use it.

Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
6 years ago[media] media: rc: gpio-ir-recv: use devm_request_irq
Ladislav Michl [Thu, 7 Sep 2017 23:38:20 +0000 (20:38 -0300)]
[media] media: rc: gpio-ir-recv: use devm_request_irq

Use of devm_request_irq simplifies error unwinding and as
free_irq was the last user of driver remove function,
remove it too.

Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
6 years ago[media] media: rc: gpio-ir-recv: do not allow threaded interrupt handler
Ladislav Michl [Thu, 7 Sep 2017 23:37:36 +0000 (20:37 -0300)]
[media] media: rc: gpio-ir-recv: do not allow threaded interrupt handler

Requesting any context irq is not actually great idea since threaded
interrupt handler is run at too unpredictable time which turns
timing information wrong. Fix it by requesting regular interrupt.

Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
6 years ago[media] media: rc: gpio-ir-recv: use devm_rc_register_device
Ladislav Michl [Thu, 7 Sep 2017 23:37:07 +0000 (20:37 -0300)]
[media] media: rc: gpio-ir-recv: use devm_rc_register_device

Use of devm_rc_register_device simplifies error unwinding.

Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
6 years ago[media] media: rc: gpio-ir-recv: use devm_gpio_request_one
Ladislav Michl [Thu, 7 Sep 2017 23:36:39 +0000 (20:36 -0300)]
[media] media: rc: gpio-ir-recv: use devm_gpio_request_one

Use of devm_gpio_request_one simplifies error unwinding.

Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
6 years ago[media] media: rc: gpio-ir-recv: use devm_rc_allocate_device
Ladislav Michl [Thu, 7 Sep 2017 23:36:11 +0000 (20:36 -0300)]
[media] media: rc: gpio-ir-recv: use devm_rc_allocate_device

Use of devm_rc_allocate_device simplifies error unwinding.

Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
6 years ago[media] media: rc: gpio-ir-recv: use devm_kzalloc
Ladislav Michl [Thu, 7 Sep 2017 23:35:22 +0000 (20:35 -0300)]
[media] media: rc: gpio-ir-recv: use devm_kzalloc

Use of devm_kzalloc simplifies error unwinding.

Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
6 years ago[media] media: rc: gpio-ir-recv: use helper variable to access device info
Ladislav Michl [Thu, 7 Sep 2017 23:34:35 +0000 (20:34 -0300)]
[media] media: rc: gpio-ir-recv: use helper variable to access device info

Using explicit struct device variable makes code a bit more readable.

Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
6 years ago[media] media: imon: make two const arrays static, reduces object code size
Colin Ian King [Tue, 5 Sep 2017 12:07:50 +0000 (09:07 -0300)]
[media] media: imon: make two const arrays static, reduces object code size

Don't populate the const arrays vfd_packet6 and fp_packet on the
stack, instead make them static.  Makes the object code smaller
by over 600 bytes:

Before:
   text    data     bss     dec     hex filename
  43794   17920    1024   62738    f512 drivers/media/rc/imon.o

After:
   text    data     bss     dec     hex filename
  42994   18080    1024   62098    f292 drivers/media/rc/imon.o

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
6 years ago[media] media: vp7045: port TwinhanDTV Alpha to rc-core
Sean Young [Wed, 6 Sep 2017 11:19:06 +0000 (08:19 -0300)]
[media] media: vp7045: port TwinhanDTV Alpha to rc-core

Only the nec protocol is understood, but then it doesn't pass on
the full scancode and it ignores the nec repeats its own remote
sends, so holding buttons does not work.

Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
6 years ago[media] media: rc: include device name in rc udev event
Sean Young [Fri, 1 Sep 2017 14:34:23 +0000 (11:34 -0300)]
[media] media: rc: include device name in rc udev event

This name is also stored in the input's device name, but that
is not available in TX only hardware (no input device).

Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
6 years ago[media] media: rc: if protocols can't be changed, don't be writable
Sean Young [Fri, 1 Sep 2017 14:30:50 +0000 (11:30 -0300)]
[media] media: rc: if protocols can't be changed, don't be writable

If the protocols of an rc device cannot be changed, ensure the sysfs
file is not writable.

This makes it possible to detect this from userspace, so ir-keytable
can deal with case without giving an error.

Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
6 years ago[media] media: rc: dvb: use dvb device name for rc device
Sean Young [Fri, 1 Sep 2017 13:10:01 +0000 (10:10 -0300)]
[media] media: rc: dvb: use dvb device name for rc device

"IR-receiver inside an USB DVB receiver" is not descriptive and we have
a proper name available.

Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
6 years ago[media] media: rc: ensure that protocols are enabled for scancode drivers
Sean Young [Fri, 1 Sep 2017 12:55:59 +0000 (09:55 -0300)]
[media] media: rc: ensure that protocols are enabled for scancode drivers

rc scancode drivers without change_protocol should have all
protocols enabled at all time. This was only true for cec and
ir-kbd-i2c.

Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
6 years ago[media] media: rc: avermedia keymap for a800
Sean Young [Fri, 1 Sep 2017 11:34:50 +0000 (08:34 -0300)]
[media] media: rc: avermedia keymap for a800

The keymap is missing one key, and correct another.

Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
6 years ago[media] media: dvb: a800: port to rc-core
Sean Young [Fri, 1 Sep 2017 12:29:58 +0000 (09:29 -0300)]
[media] media: dvb: a800: port to rc-core

This receiver only accepts nec16 messages, I've tried many other protocols
and they're all dropped.

Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
6 years ago[media] media: img-ir: delete an error message for a failed memory allocation
Markus Elfring [Tue, 29 Aug 2017 19:04:20 +0000 (16:04 -0300)]
[media] media: img-ir: delete an error message for a failed memory allocation

Omit an extra message for a memory allocation failure in this function.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
6 years ago[media] media: imon: delete an error message for a failed memory allocation
Markus Elfring [Tue, 29 Aug 2017 10:40:07 +0000 (07:40 -0300)]
[media] media: imon: delete an error message for a failed memory allocation

Omit an extra message for a memory allocation failure in this function.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>