Antti Palosaari [Mon, 7 Nov 2016 00:00:45 +0000 (22:00 -0200)]
[media] it913x: change driver model from i2c to platform
That tuner is integrated to demodulator and communicates via
demodulators address space. We cannot register both demodulator
and tuner having same address to same I2C bus, so better to change
it platform driver in order to implement I2C adapter correctly.
Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Antti Palosaari [Mon, 7 Nov 2016 00:14:18 +0000 (22:14 -0200)]
[media] af9033: return regmap for integrated IT913x tuner driver
IT9130 series contains integrated tuner driver, which uses that
demodulator address space. Return regmap in order to allow it913x
driver communication.
Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
v4l2_subdev_{core/pad/video}_ops structures are stored in the
fields of the v4l2_subdev_ops structure which are of type const.
Also, v4l2_subdev_ops structure is passed to a function
having its argument of type const. As these structures are never
modified, so declare them as const.
Done using Coccinelle:(one of the scripts used)
Commit a006c04e6218 ("[media] exynos-gsc: Fixup clock management at
->remove()") changed the driver's .remove function logic to fist do
a pm_runtime_get_sync() to make sure the device is powered before
attempting to gate the gsc clock.
But the commit also removed a pm_runtime_disable() call that leads
to an unbalanced pm_runtime_enable() error if the driver is removed
and re-probed:
Setting GPIOs during probe causes null pointer deference when
GPIOLIB was not selected by Kconfig. Initialize driver private
field before calling set gpios.
Michael Tretter [Fri, 20 Jan 2017 14:00:25 +0000 (12:00 -0200)]
[media] coda: support YUYV output if VDOA is used
The VDOA is able to transform the NV12 custom macroblock tiled format of
the CODA to YUYV format. If and only if the VDOA is available, the
driver can also provide YUYV support.
While the driver is configured to produce YUYV output, the CODA must be
configured to produce NV12 macroblock tiled frames and the VDOA must
transform the intermediate result into the final YUYV output.
Signed-off-by: Michael Tretter <m.tretter@pengutronix.de> Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Michael Tretter [Fri, 20 Jan 2017 14:00:24 +0000 (12:00 -0200)]
[media] coda: use VDOA for un-tiling custom macroblock format
If the CODA driver is configured to produce NV12 output and the VDOA is
available, the VDOA can be used to transform the custom macroblock tiled
format to a raster-ordered format for scanout.
In this case, set the output format of the CODA to the custom macroblock
tiled format, disable the rotator, and use the VDOA to write to the v4l2
buffer. The VDOA is synchronized with the CODA to always un-tile the
frame that the CODA finished in the previous run.
Signed-off-by: Michael Tretter <m.tretter@pengutronix.de> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Michael Tretter [Fri, 20 Jan 2017 14:00:23 +0000 (12:00 -0200)]
[media] coda: fix frame index to returned error
display_idx refers to the frame that will be returned in the next round.
The currently processed frame is ctx->display_idx and errors should be
reported for this frame.
Signed-off-by: Michael Tretter <m.tretter@pengutronix.de> Acked-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Philipp Zabel [Fri, 20 Jan 2017 14:00:21 +0000 (12:00 -0200)]
[media] coda: correctly set capture compose rectangle
Correctly store the rectangle of valid video data in the destination
q_data before rounding up to macroblock size. This fixes the output
of VIDIOC_G_SELECTION for the capture side compose rectangle.
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Michael Tretter <m.tretter@pengutronix.de> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Philipp Zabel [Fri, 20 Jan 2017 14:00:20 +0000 (12:00 -0200)]
[media] coda: add i.MX6 VDOA driver
The i.MX6 Video Data Order Adapter's (VDOA) sole purpose is to convert
from a custom macroblock tiled format produced by the CODA960 decoder
into linear formats that can be used for scanout.
Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com> Signed-off-by: Michael Tretter <m.tretter@pengutronix.de> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Markus Elfring [Thu, 22 Dec 2016 18:26:52 +0000 (16:26 -0200)]
[media] pvrusb2-io: Use kmalloc_array() in pvr2_stream_buffer_count()
A multiplication for the size determination of a memory allocation
indicated that an array data structure should be processed.
Thus use the corresponding function "kmalloc_array".
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Video capture subdevs may be over I2C and may sleep during xfer, so we
cannot do IRQ-disabled locking when calling the subdev.
The IRQ-disabled locking is meant to protect the DMA queue list
throughout the rest of the driver, so update the locking in
[start|stop]_streaming to protect just this list, and update the irqlock
comment to reflect what it actually protects.
Markus Elfring [Mon, 26 Dec 2016 17:14:33 +0000 (15:14 -0200)]
[media] v4l2-async: Use kmalloc_array() in v4l2_async_notifier_unregister()
A multiplication for the size determination of a memory allocation
indicated that an array data structure should be processed.
Thus use the corresponding function "kmalloc_array".
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> 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@s-opensource.com>
Kees Cook [Sat, 17 Dec 2016 01:05:36 +0000 (23:05 -0200)]
[media] solo6x10: use designated initializers
Prepare to mark sensitive kernel structures for randomization by making
sure they're using designated initializers. These were identified during
allyesconfig builds of x86, arm, and arm64, with most initializer fixes
extracted from grsecurity.
Kees Cook [Sat, 17 Dec 2016 01:00:31 +0000 (23:00 -0200)]
[media] mtk-vcodec: use designated initializers
Prepare to mark sensitive kernel structures for randomization by making
sure they're using designated initializers. These were identified during
allyesconfig builds of x86, arm, and arm64, with most initializer fixes
extracted from grsecurity.
[media] rc/keymaps: add a keytable for the GeekBox remote control
The GeekBox ships with a 12 button remote control which seems to use the
NEC protocol. The button keycodes were captured with the "ir-keytable"
tool (ir-keytable -p $PROTOCOL -t; human_button_pusher).
Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Sean Wang [Fri, 13 Jan 2017 07:35:38 +0000 (05:35 -0200)]
[media] Documentation: devicetree: Add document bindings for mtk-cir
This patch adds documentation for devicetree bindings for
consumer Mediatek IR controller.
Signed-off-by: Sean Wang <sean.wang@mediatek.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>
Sean Wang [Fri, 13 Jan 2017 07:35:37 +0000 (05:35 -0200)]
[media] Documentation: devicetree: move shared property used by rc into a common place
Most IR drivers uses the same label to identify the
scancode/key table they used by multiple bindings and lack
explanation well. So move the shared property into a common
place and give better explanation.
Signed-off-by: Sean Wang <sean.wang@mediatek.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>
Sean Wang [Fri, 13 Jan 2017 07:35:39 +0000 (05:35 -0200)]
[media] rc: add driver for IR remote receiver on MT7623 SoC
This patch adds driver for IR controller on MT7623 SoC.
and should also work on similar Mediatek SoC. Currently
testing successfully on NEC and SONY remote controller
only but it should work on others (lirc, rc-5 and rc-6).
Signed-off-by: Sean Wang <sean.wang@mediatek.com> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Sean Young [Mon, 30 Jan 2017 19:58:19 +0000 (17:58 -0200)]
[media] rx51: broken build
As reported by kernel build test:
In file included from arch/arm/mach-omap2/pdata-quirks.c:15:0:
>> arch/arm/mach-omap2/pdata-quirks.c:536:49: error: 'rx51_lirc_data' undeclared here (not in a function)
OF_DEV_AUXDATA("nokia,n900-ir", 0, "n900-ir", &rx51_lirc_data),
^
include/linux/of_platform.h:52:21: note: in definition of macro 'OF_DEV_AUXDATA'
.platform_data = _pdata }
^~~~~~
Since "a92def1 [media] ir-rx51: port to rc-core" the build fails on
some arm configurations.
Reported-by: kbuild test robot <fengguang.wu@intel.com> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
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@s-opensource.com>
trivial fix to spelling mistake in deb_chk message
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@s-opensource.com>
trivial fix to spelling mistake in cobalt_info message. Anders Celsius
was the Swedish astronomer.
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@s-opensource.com>
Colin Ian King [Wed, 28 Dec 2016 21:35:48 +0000 (19:35 -0200)]
[media] dvb-frontends: fix spelling mistake on cx24123_pll_calcutate
trivial fix to spelling mistake of function name in err message,
should be cx24123_pll_calculate instead of cx24123_pll_calcutate.
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@s-opensource.com>
Corentin Labbe [Thu, 15 Dec 2016 14:03:24 +0000 (12:03 -0200)]
[media] media: s5p-cec: Remove references to non-existent PLAT_S5P symbol
Commit d78c16ccde96 ("ARM: SAMSUNG: Remove remaining legacy code")
removed the Kconfig symbol PLAT_S5P.
This patch remove the last occurrence of this symbol.
[media] adv7604: Initialize drive strength to default when using DT
The adv7604 driver platform data contains fields for configuring the drive
strength of the output pins. When probing the driver through DT these
fields are not explicitly initialized, which means they are left at 0. This
is a reserved setting for the drive strength configuration though and can
cause signal integrity issues.
Whether these signal integrity issues are visible depends on the PCB
specifics (e.g. the higher the load capacitance for the output the more
visible the issue). But it has been observed on existing solutions at high
pixel clock rates.
Initialize the drive strength settings to the power-on-reset value of the
device when probing through devicetree to avoid this issue.
v4l2_subdev_{core/video}_ops structures are stored in the
fields of the v4l2_subdev_ops structure which are of type const.
Also, v4l2_subdev_ops structure is passed to a function
having its argument of type const. As these structures are never
modified, so declare them as const.
Done using Coccinelle:(One of the scripts)
Sean Young [Tue, 20 Dec 2016 14:18:06 +0000 (12:18 -0200)]
[media] staging: lirc_imon: port remaining usb ids to imon and remove
The staging lirc_imon driver contains 4 usb ids. Two of those have a VFD
and two don't. The VFD code is exactly the same in the mainline imon
driver, so that part is easily ported.
The staging driver produces raw IR rather than scancodes for the four
devices, so I've ported the raw IR code from staging to mainline imon.
Now that mainline imon can handle these four devices, lirc_imon is no
longer needed.
Compile tested only.
Signed-off-by: Sean Young <sean@mess.org> Cc: Venky Raju <dev@venky.ws> Cc: Jarod Wilson <jarod@redhat.com> Cc: Alexey Khoroshilov <khoroshilov@ispras.ru> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Sean Young [Mon, 19 Dec 2016 22:20:03 +0000 (20:20 -0200)]
[media] staging: lirc_bt829: remove
This driver is for an old mach64 VT board, which also has a framebuffer
driver (atyfb) and userspace mach64 X driver.
It was merged in 2010 and noone has attempted to port it to rc-core,
which would be necessary to get it out of staging.
I have not been able to track down the hardware either.
Signed-off-by: Sean Young <sean@mess.org> Cc: Jarod Wilson <jarod@redhat.com> Cc: Leonid Froenchenko <lfroen@galileo.co.il> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Sean Young [Mon, 19 Dec 2016 22:10:41 +0000 (20:10 -0200)]
[media] staging: lirc_parallel: remove
The lirc_parallel driver was merged in 2010 and noone has attempted
to do the work necessary to get it out of staging (i.e. port it to
rc-core). I have not been able to find one of these devices, and
a machine with a parallel port is pretty rare too.
Signed-off-by: Sean Young <sean@mess.org> Cc: Jarod Wilson <jarod@redhat.com> Cc: Christoph Bartelmus <lirc@bartelmus.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Sean Young [Mon, 19 Dec 2016 22:07:08 +0000 (20:07 -0200)]
[media] staging: lirc_sir: port to rc-core
Before this driver can be moved out of staging, it should be ported
to rc-core. I've tried to make the minimum changes possible without
upsetting checkpatch.
Compile tested only.
Signed-off-by: Sean Young <sean@mess.org> Cc: Jarod Wilson <jarod@redhat.com> Cc: Christoph Bartelmus <lirc@bartelmus.de> Cc: Milan Pikula <www@fornax.sk> Cc: Frank Przybylski <mail@frankprzybylski.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Andi Shyti [Fri, 16 Dec 2016 06:12:18 +0000 (04:12 -0200)]
[media] rc: add support for IR LEDs driven through SPI
The ir-spi is a simple device driver which supports the
connection between an IR LED and the MOSI line of an SPI device.
The driver, indeed, uses the SPI framework to stream the raw data
provided by userspace through an rc character device. The chardev
is handled by the LIRC framework and its functionality basically
provides:
- write: the driver gets a pulse/space signal and translates it
to a binary signal that will be streamed to the IR led through
the SPI framework.
- set frequency: sets the frequency whith which the data should
be sent. This is handle with ioctl with the
LIRC_SET_SEND_CARRIER flag (as per lirc documentation)
- set duty cycle: this is also handled with ioctl with the
LIRC_SET_SEND_DUTY_CYCLE flag. The driver handles duty cycles
of 50%, 60%, 70%, 75%, 80% and 90%, calculated on 16bit data.
The character device is created under /dev/lircX name, where X is
and ID assigned by the LIRC framework.
Example of usage:
fd = open("/dev/lirc0", O_RDWR);
if (fd < 0)
return -1;
val = 608000;
ret = ioctl(fd, LIRC_SET_SEND_CARRIER, &val);
if (ret < 0)
return -1;
val = 60;
ret = ioctl(fd, LIRC_SET_SEND_DUTY_CYCLE, &val);
if (ret < 0)
return -1;
n = write(fd, buffer, BUF_LEN);
if (n < 0 || n != BUF_LEN)
ret = -1;
close(fd);
Signed-off-by: Andi Shyti <andi.shyti@samsung.com> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Andi Shyti [Fri, 16 Dec 2016 06:12:15 +0000 (04:12 -0200)]
[media] rc-core: add support for IR raw transmitters
IR raw transmitter driver type is specified in the enum
rc_driver_type as RC_DRIVER_IR_RAW_TX which includes all those
devices that transmit raw stream of bit to a receiver.
The data are provided by userspace applications, therefore they
don't need any input device allocation, but still they need to be
registered as raw devices.
Suggested-by: Sean Young <sean@mess.org> Signed-off-by: Andi Shyti <andi.shyti@samsung.com> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Andi Shyti [Fri, 16 Dec 2016 08:50:58 +0000 (06:50 -0200)]
[media] rc-main: assign driver type during allocation
The driver type can be assigned immediately when an RC device
requests to the framework to allocate the device.
This is an 'enum rc_driver_type' data type and specifies whether
the device is a raw receiver or scancode receiver. The type will
be given as parameter to the rc_allocate_device device.
Change accordingly all the drivers calling rc_allocate_device()
so that the device type is specified during the rc device
allocation. Whenever the device type is not specified, it will be
set as RC_DRIVER_SCANCODE which was the default '0' value.
Suggested-by: Sean Young <sean@mess.org> Signed-off-by: Andi Shyti <andi.shyti@samsung.com> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Antti Seppälä [Tue, 31 Mar 2015 17:48:12 +0000 (14:48 -0300)]
[media] rc: nuvoton-cir: Add support wakeup 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> Signed-off-by: Sean Young <sean@mess.org> Cc: Jarod Wilson <jarod@redhat.com> Cc: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
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> Signed-off-by: Sean Young <sean@mess.org> Cc: David Härdeman <david@hardeman.nu> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
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 and
rc_dev::allowed_wakeup_protocols should be set to the raw IR encoders.
We also do not permit the mask to be set as we cannot generate IR
which would match that.
Signed-off-by: James Hogan <james@albanarts.com> Signed-off-by: Antti Seppälä <a.seppala@gmail.com> Signed-off-by: Sean Young <sean@mess.org> Cc: David Härdeman <david@hardeman.nu> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
James Hogan [Fri, 14 Mar 2014 23:04:14 +0000 (20:04 -0300)]
[media] rc: ir-nec-decoder: Add encode capability
Add the capability to encode NEC scancodes as raw events. The
scancode_to_raw is pretty much taken from the img-ir NEC filter()
callback, and modulation uses the pulse distance helper added in a
previous commit.
Signed-off-by: James Hogan <james@albanarts.com> Signed-off-by: Sean Young <sean@mess.org> Cc: Antti Seppälä <a.seppala@gmail.com> Cc: David Härdeman <david@hardeman.nu> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
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 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> Signed-off-by: Sean Young <sean@mess.org> Cc: James Hogan <james@albanarts.com> Cc: David Härdeman <david@hardeman.nu> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
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 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> Signed-off-by: Sean Young <sean@mess.org> Cc: David Härdeman <david@hardeman.nu> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Add IR encoding helper for pulse-distance modulation as used by the NEC
protocol.
Signed-off-by: James Hogan <james@albanarts.com> Signed-off-by: Sean Young <sean@mess.org> Cc: Antti Seppälä <a.seppala@gmail.com> Cc: David Härdeman <david@hardeman.nu> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
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> Signed-off-by: Sean Young <sean@mess.org> Cc: David Härdeman <david@hardeman.nu> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>