platform/kernel/linux-starfive.git
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 years ago[media] media: rc: make device_type const
Bhumika Goyal [Sat, 19 Aug 2017 08:22:15 +0000 (05:22 -0300)]
[media] media: rc: make device_type const

Make this const as it is only stored in the type field of a device
structure, which is const.
Done using Coccinelle.

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
7 years ago[media] media: rc: constify usb_device_id
Arvind Yadav [Sun, 13 Aug 2017 08:54:44 +0000 (05:54 -0300)]
[media] media: rc: constify usb_device_id

usb_device_id are not supposed to change at runtime. All functions
working with usb_device_id provided by <linux/usb.h> work with
const usb_device_id. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
7 years ago[media] media: lirc_dev: merge struct irctl into struct lirc_dev
David Härdeman [Sun, 25 Jun 2017 12:32:36 +0000 (09:32 -0300)]
[media] media: lirc_dev: merge struct irctl into struct lirc_dev

The use of two separate structs (lirc_dev aka lirc_driver and irctl) makes
it much harder to follow the proper lifetime of the various structs and
necessitates hacks such as keeping a copy of struct lirc_dev inside
struct irctl.

Merging the two structs means that lirc_dev can properly manage the
lifetime of the resulting struct and simplifies the code at the same time.

[mchehab@s-opensource.com: fix merge conflict]
Signed-off-by: David Härdeman <david@hardeman.nu>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
7 years ago[media] media: lirc_zilog: use a dynamically allocated lirc_dev
David Härdeman [Sun, 25 Jun 2017 12:32:31 +0000 (09:32 -0300)]
[media] media: lirc_zilog: use a dynamically allocated lirc_dev

lirc_zilog currently embeds a struct lirc_dev in its own struct IR,
but subsequent patches will make the lifetime of struct lirc_dev
dynamic (i.e.  it will be free():d once lirc_dev is sure there are
no users of the struct).

Therefore, change lirc_zilog to use a pointer to a dynamically
allocated struct lirc_dev.

Signed-off-by: David Härdeman <david@hardeman.nu>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
7 years ago[media] media: lirc_zilog: add a pointer to the parent device to struct IR
David Härdeman [Sun, 25 Jun 2017 12:32:25 +0000 (09:32 -0300)]
[media] media: lirc_zilog: add a pointer to the parent device to struct IR

lirc_zilog stashes a pointer to the parent device in struct lirc_dev
and uses it for logging. It makes more sense to let lirc_zilog keep
track of that pointer in its own struct (this is in preparation for
subsequent patches which will remodel struct lirc_dev).

Signed-off-by: David Härdeman <david@hardeman.nu>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
7 years ago[media] media: lirc_dev: introduce lirc_allocate_device and lirc_free_device
David Härdeman [Sun, 25 Jun 2017 12:32:15 +0000 (09:32 -0300)]
[media] media: lirc_dev: introduce lirc_allocate_device and lirc_free_device

Introduce two new functions so that the API for lirc_dev matches that
of the rc-core and input subsystems.

This means that lirc_dev structs are managed using the usual four
functions:

lirc_allocate_device
lirc_free_device
lirc_register_device
lirc_unregister_device

The functions are pretty simplistic at this point, later patches will put
more flesh on the bones of both.

Signed-off-by: David Härdeman <david@hardeman.nu>
Signed-off-by: Sean Young <sean@mess.org>
7 years ago[media] media: rename struct lirc_driver to struct lirc_dev
David Härdeman [Thu, 21 Sep 2017 19:13:34 +0000 (16:13 -0300)]
[media] media: rename struct lirc_driver to struct lirc_dev

This is in preparation for the later patches which do away with
struct irctl entirely.

Signed-off-by: David Härdeman <david@hardeman.nu>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
7 years ago[media] media: lirc_dev: use an IDA instead of an array to keep track of registered...
David Härdeman [Sun, 25 Jun 2017 12:32:05 +0000 (09:32 -0300)]
[media] media: lirc_dev: use an IDA instead of an array to keep track of registered devices

Using the kernel-provided IDA simplifies the code and makes it possible
to remove the lirc_dev_lock mutex.

Signed-off-by: David Härdeman <david@hardeman.nu>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
7 years ago[media] media: lirc_dev: sanitize locking
David Härdeman [Fri, 30 Jun 2017 08:41:57 +0000 (05:41 -0300)]
[media] media: lirc_dev: sanitize locking

Use the irctl mutex for all device operations and only use lirc_dev_lock
to protect the irctls array. Also, make sure that the device is alive
early in each fops function before doing anything else.

Since this patch touches nearly every line where the irctl mutex is
taken/released, it also renames the mutex at the same time (the name
irctl_lock will be misleading once struct irctl goes away in later
patches).

[mchehab@s-opensource.com: fix a merge conflict]
Signed-off-by: David Härdeman <david@hardeman.nu>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
7 years ago[media] media: lirc_dev: change irctl->attached to be a boolean
David Härdeman [Sun, 25 Jun 2017 12:31:55 +0000 (09:31 -0300)]
[media] media: lirc_dev: change irctl->attached to be a boolean

The "attached" member of struct irctl is a boolean value, so let the code
reflect that.

Signed-off-by: David Härdeman <david@hardeman.nu>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
7 years ago[media] media: lirc_dev: make chunk_size and buffer_size mandatory
David Härdeman [Sun, 25 Jun 2017 12:31:45 +0000 (09:31 -0300)]
[media] media: lirc_dev: make chunk_size and buffer_size mandatory

Make setting chunk_size and buffer_size mandatory for drivers which
expect lirc_dev to allocate the lirc_buffer (i.e. ir-lirc-codec) and
don't set them in lirc-zilog (which creates its own buffer).

Also remove an unnecessary copy of chunk_size in struct irctl (the
same information is already available from struct lirc_buffer).

Signed-off-by: David Härdeman <david@hardeman.nu>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
7 years ago[media] media: lirc_dev: make better use of file->private_data
David Härdeman [Sun, 25 Jun 2017 12:31:40 +0000 (09:31 -0300)]
[media] media: lirc_dev: make better use of file->private_data

By making better use of file->private_data in lirc_dev we can avoid
digging around in the irctls[] array, thereby simplifying the code.

External drivers need to use lirc_get_pdata() instead of mucking around
in file->private_data.

The newly introduced lirc_init_pdata() function isn't very elegant, but
it's a stopgap measure which can be removed once lirc_zilog is converted
to rc-core.

Signed-off-by: David Härdeman <david@hardeman.nu>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
7 years ago[media] media: lirc_dev: use cdev_device_add() helper function
David Härdeman [Sun, 25 Jun 2017 12:31:35 +0000 (09:31 -0300)]
[media] media: lirc_dev: use cdev_device_add() helper function

Replace calls to cdev_add() and device_add() with the cdev_device_add()
helper function.

Signed-off-by: David Härdeman <david@hardeman.nu>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
7 years ago[media] media: lirc_dev: remove support for manually specifying minor number
David Härdeman [Sun, 25 Jun 2017 12:31:24 +0000 (09:31 -0300)]
[media] media: lirc_dev: remove support for manually specifying minor number

All users of lirc_register_driver() uses dynamic minor allocation,
therefore we can remove the ability to explicitly request a given number.

This changes the function prototype of lirc_unregister_driver() to also
take a struct lirc_driver pointer as the sole argument.

Signed-off-by: David Härdeman <david@hardeman.nu>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
7 years ago[media] media: lirc_dev: clarify error handling
David Härdeman [Sun, 25 Jun 2017 12:31:19 +0000 (09:31 -0300)]
[media] media: lirc_dev: clarify error handling

If an error is generated, it is more logical to error out ASAP.

Signed-off-by: David Härdeman <david@hardeman.nu>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
7 years agoMerge tag 'v4.14-rc2' into patchwork
Mauro Carvalho Chehab [Fri, 29 Sep 2017 09:24:10 +0000 (05:24 -0400)]
Merge tag 'v4.14-rc2' into patchwork

Linux 4.14-rc2

* tag 'v4.14-rc2': (12066 commits)
  Linux 4.14-rc2
  tpm: ibmvtpm: simplify crq initialization and document crq format
  tpm: replace msleep() with  usleep_range() in TPM 1.2/2.0 generic drivers
  Documentation: tpm: add powered-while-suspended binding documentation
  tpm: tpm_crb: constify acpi_device_id.
  tpm: vtpm: constify vio_device_id
  security: fix description of values returned by cap_inode_need_killpriv
  x86/asm: Fix inline asm call constraints for Clang
  objtool: Handle another GCC stack pointer adjustment bug
  inet: fix improper empty comparison
  net: use inet6_rcv_saddr to compare sockets
  net: set tb->fast_sk_family
  net: orphan frags on stand-alone ptype in dev_queue_xmit_nit
  MAINTAINERS: update git tree locations for ieee802154 subsystem
  SMB3: Don't ignore O_SYNC/O_DSYNC and O_DIRECT flags
  SMB3: handle new statx fields
  arch: remove unused *_segments() macros/functions
  parisc: Unbreak bootloader due to gcc-7 optimizations
  parisc: Reintroduce option to gzip-compress the kernel
  apparmor: fix apparmorfs DAC access permissions
  ...

7 years agoLinux 4.14-rc2
Linus Torvalds [Sun, 24 Sep 2017 23:38:56 +0000 (16:38 -0700)]
Linux 4.14-rc2

7 years agoMerge tag 'devicetree-fixes-for-4.14' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Sun, 24 Sep 2017 23:04:12 +0000 (16:04 -0700)]
Merge tag 'devicetree-fixes-for-4.14' of git://git./linux/kernel/git/robh/linux

Pull DeviceTree fixes from Rob Herring:

 - fix build for !OF providing empty of_find_device_by_node

 - fix Abracon vendor prefix

 - sync dtx_diff include paths (again)

 - a stm32h7 clock binding doc fix

* tag 'devicetree-fixes-for-4.14' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux:
  dt-bindings: clk: stm32h7: fix clock-cell size
  scripts/dtc: dtx_diff - 2nd update of include dts paths to match build
  dt-bindings: fix vendor prefix for Abracon
  of: provide inline helper for of_find_device_by_node

7 years agoMerge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Sun, 24 Sep 2017 19:33:58 +0000 (12:33 -0700)]
Merge branch 'x86-urgent-for-linus' of git://git./linux/kernel/git/tip/tip

Pull x86 fixes from Ingo Molnar:
 "Another round of CR3/PCID related fixes (I think this addresses all
  but one of the known problems with PCID support), an objtool fix plus
  a Clang fix that (finally) solves all Clang quirks to build a bootable
  x86 kernel as-is"

* 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86/asm: Fix inline asm call constraints for Clang
  objtool: Handle another GCC stack pointer adjustment bug
  x86/mm/32: Load a sane CR3 before cpu_init() on secondary CPUs
  x86/mm/32: Move setup_clear_cpu_cap(X86_FEATURE_PCID) earlier
  x86/mm/64: Stop using CR3.PCID == 0 in ASID-aware code
  x86/mm: Factor out CR3-building code

7 years agoMerge branch 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Sun, 24 Sep 2017 19:28:55 +0000 (12:28 -0700)]
Merge branch 'timers-urgent-for-linus' of git://git./linux/kernel/git/tip/tip

Pull timer fix from Ingo Molnar:
 "A clocksource driver section mismatch fix"

* 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  clocksource/integrator: Fix section mismatch warning

7 years agoMerge branch 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Sun, 24 Sep 2017 18:57:07 +0000 (11:57 -0700)]
Merge branch 'irq-urgent-for-linus' of git://git./linux/kernel/git/tip/tip

Pull irq fixes from Ingo Molnar:
 "Three irqchip driver fixes, and an affinity mask helper function bug
  fix affecting x86"

* 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  Revert "genirq: Restrict effective affinity to interrupts actually using it"
  irqchip.mips-gic: Fix shared interrupt mask writes
  irqchip/gic-v4: Fix building with ancient gcc
  irqchip/gic-v3: Iterate over possible CPUs by for_each_possible_cpu()

7 years agoMerge branch 'core-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Sun, 24 Sep 2017 18:53:13 +0000 (11:53 -0700)]
Merge branch 'core-urgent-for-linus' of git://git./linux/kernel/git/tip/tip

Pull address-limit checking fixes from Ingo Molnar:
 "This fixes a number of bugs in the address-limit (USER_DS) checks that
  got introduced in the merge window, (mostly) affecting the ARM and
  ARM64 platforms"

* 'core-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  arm64/syscalls: Move address limit check in loop
  arm/syscalls: Optimize address limit check
  Revert "arm/syscalls: Check address limit on user-mode return"
  syscalls: Use CHECK_DATA_CORRUPTION for addr_limit_user_check

7 years agoMerge branch 'next-general' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris...
Linus Torvalds [Sun, 24 Sep 2017 18:40:41 +0000 (11:40 -0700)]
Merge branch 'next-general' of git://git./linux/kernel/git/jmorris/linux-security

Pull misc security layer update from James Morris:
 "This is the remaining 'general' change in the security tree for v4.14,
  following the direct merging of SELinux (+ TOMOYO), AppArmor, and
  seccomp.

  That's everything now for the security tree except IMA, which will
  follow shortly (I've been traveling for the past week with patchy
  internet)"

* 'next-general' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security:
  security: fix description of values returned by cap_inode_need_killpriv

7 years agoMerge branch 'next-tpm' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris...
Linus Torvalds [Sun, 24 Sep 2017 18:34:28 +0000 (11:34 -0700)]
Merge branch 'next-tpm' of git://git./linux/kernel/git/jmorris/linux-security

Pull TPM updates from James Morris:
 "Here are the TPM updates from Jarkko for v4.14, which I've placed in
  their own branch (next-tpm). I ended up cherry-picking them as other
  changes had been made in Jarkko's branch after he sent me his original
  pull request.

  I plan on maintaining a separate branch for TPM (and other security
  subsystems) from now on.

  From Jarkko: 'Not much this time except a few fixes'"

* 'next-tpm' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security:
  tpm: ibmvtpm: simplify crq initialization and document crq format
  tpm: replace msleep() with  usleep_range() in TPM 1.2/2.0 generic drivers
  Documentation: tpm: add powered-while-suspended binding documentation
  tpm: tpm_crb: constify acpi_device_id.
  tpm: vtpm: constify vio_device_id

7 years agotpm: ibmvtpm: simplify crq initialization and document crq format
Michal Suchanek [Fri, 24 Feb 2017 19:35:16 +0000 (20:35 +0100)]
tpm: ibmvtpm: simplify crq initialization and document crq format

The crq is passed in registers and is the same on BE and LE hosts.
However, current implementation allocates a structure on-stack to
represent the crq, initializes the members swapping them to BE, and
loads the structure swapping it from BE. This is pointless and causes
GCC warnings about ununitialized members. Get rid of the structure and
the warnings.

Signed-off-by: Michal Suchanek <msuchanek@suse.de>
Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Signed-off-by: James Morris <james.l.morris@oracle.com>
7 years agotpm: replace msleep() with usleep_range() in TPM 1.2/2.0 generic drivers
Hamza Attak [Mon, 14 Aug 2017 18:09:16 +0000 (19:09 +0100)]
tpm: replace msleep() with  usleep_range() in TPM 1.2/2.0 generic drivers

The patch simply replaces all msleep function calls with usleep_range calls
in the generic drivers.

Tested with an Infineon TPM 1.2, using the generic tpm-tis module, for a
thousand PCR extends, we see results going from 1m57s unpatched to 40s
with the new patch. We obtain similar results when using the original and
patched tpm_infineon driver, which is also part of the patch.
Similarly with a STM TPM 2.0, using the CRB driver, it takes about 20ms per
extend unpatched and around 7ms with the new patch.

Note that the PCR consistency is untouched with this patch, each TPM has
been tested with 10 million extends and the aggregated PCR value is
continuously verified to be correct.

As an extension of this work, this could potentially and easily be applied
to other vendor's drivers. Still, these changes are not included in the
proposed patch as they are untested.

Signed-off-by: Hamza Attak <hamza@hpe.com>
Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Tested-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Signed-off-by: James Morris <james.l.morris@oracle.com>
7 years agoDocumentation: tpm: add powered-while-suspended binding documentation
Enric Balletbo i Serra [Tue, 27 Jun 2017 10:27:23 +0000 (12:27 +0200)]
Documentation: tpm: add powered-while-suspended binding documentation

Add a new powered-while-suspended property to control the behavior of the
TPM suspend/resume.

Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Signed-off-by: Sonny Rao <sonnyrao@chromium.org>
Reviewed-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Signed-off-by: James Morris <james.l.morris@oracle.com>
7 years agotpm: tpm_crb: constify acpi_device_id.
Arvind Yadav [Thu, 6 Jul 2017 17:48:39 +0000 (23:18 +0530)]
tpm: tpm_crb: constify acpi_device_id.

acpi_device_id are not supposed to change at runtime. All functions
working with acpi_device_id provided by <acpi/acpi_bus.h> work with
const acpi_device_id. So mark the non-const structs as const.

File size before:
   text    data     bss     dec     hex filename
   4198     608       0    4806    12c6 drivers/char/tpm/tpm_crb.o

File size After adding 'const':
   text    data     bss     dec     hex filename
   4262     520       0    4782    12ae drivers/char/tpm/tpm_crb.o

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Tested-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Signed-off-by: James Morris <james.l.morris@oracle.com>
7 years agotpm: vtpm: constify vio_device_id
Arvind Yadav [Thu, 17 Aug 2017 17:34:21 +0000 (23:04 +0530)]
tpm: vtpm: constify vio_device_id

vio_device_id are not supposed to change at runtime. All functions
working with vio_device_id provided by <asm/vio.h> work with
const vio_device_id. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Reviewed-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Signed-off-by: James Morris <james.l.morris@oracle.com>
7 years agosecurity: fix description of values returned by cap_inode_need_killpriv
Stefan Berger [Thu, 27 Jul 2017 02:27:05 +0000 (22:27 -0400)]
security: fix description of values returned by cap_inode_need_killpriv

cap_inode_need_killpriv returns 1 if security.capability exists and
has a value and inode_killpriv() is required, 0 otherwise. Fix the
description of the return value to reflect this.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Reviewed-by: Serge Hallyn <serge@hallyn.com>
Signed-off-by: James Morris <james.l.morris@oracle.com>
7 years agomedia: staging: atomisp: use clock framework for camera clocks
Pierre-Louis Bossart [Wed, 20 Sep 2017 20:53:58 +0000 (16:53 -0400)]
media: staging: atomisp: use clock framework for camera clocks

The Atom ISP driver initializes and configures PMC clocks which are
already handled by the clock framework.

Remove all legacy vlv2_platform_clock stuff and move to the clk API to
avoid conflicts, e.g. with audio machine drivers enabling the MCLK for
external codecs

Fixes: a49d25364dfb ("staging/atomisp: Add support for the Intel IPU v2")

Tested-by: Carlo Caione <carlo@endlessm.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years agomedia: Staging: media: atomisp: Use kcalloc instead of kzalloc
Srishti Sharma [Thu, 14 Sep 2017 10:18:40 +0000 (06:18 -0400)]
media: Staging: media: atomisp: Use kcalloc instead of kzalloc

Use kcalloc instead of kzalloc to check for an overflow before
multiplication. Done using the following semantic patch by
coccinelle.

http://coccinelle.lip6.fr/rules/kzalloc.cocci

Signed-off-by: Srishti Sharma <srishtishar@gmail.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years agomedia: atomisp:use ARRAY_SIZE() instead of open coding
Allen Pais [Wed, 13 Sep 2017 09:15:58 +0000 (05:15 -0400)]
media: atomisp:use ARRAY_SIZE() instead of open coding

The array_length() macro just duplicates ARRAY_SIZE(), so we can
delete it.

Signed-off-by: Allen Pais <allen.lkml@gmail.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years agomedia: Staging: media: atomisp: Merge assignment with return
Srishti Sharma [Tue, 12 Sep 2017 14:12:29 +0000 (10:12 -0400)]
media: Staging: media: atomisp: Merge assignment with return

Merge the assignment and the return statements to return the value
directly. Done using the following semantic patch by coccinelle.

@@
local idexpression ret;
expression e;
@@

-ret =
+return
     e;
-return ret;

Signed-off-by: Srishti Sharma <srishtishar@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years agomedia: Staging: atomisp: fix alloc_cast.cocci warnings
Branislav Radocaj [Thu, 7 Sep 2017 16:26:42 +0000 (12:26 -0400)]
media: Staging: atomisp: fix alloc_cast.cocci warnings

Remove casting the values returned by memory allocation functions
like kmalloc, kzalloc, kmem_cache_alloc, kmem_cache_zalloc etc.

Semantic patch information:
This makes an effort to find cases of casting of values returned by
kmalloc, kzalloc, kcalloc, kmem_cache_alloc, kmem_cache_zalloc,
kmem_cache_alloc_node, kmalloc_node and kzalloc_node and removes
the casting as it is not required. The result in the patch case may
need some reformatting.

Generated by: scripts/coccinelle/api/alloc/alloc_cast.cocci

Signed-off-by: Branislav Radocaj <branislav@radocaj.org>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years agomedia: staging/atomisp: Use ARRAY_SIZE macro
Thomas Meyer [Sun, 3 Sep 2017 12:19:31 +0000 (08:19 -0400)]
media: staging/atomisp: Use ARRAY_SIZE macro

Use ARRAY_SIZE macro, rather than explicitly coding some variant of it
yourself.
Found with: find -type f -name "*.c" -o -name "*.h" | xargs perl -p -i -e
's/\bsizeof\s*\(\s*(\w+)\s*\)\s*\ /\s*sizeof\s*\(\s*\1\s*\[\s*0\s*\]\s*\)
/ARRAY_SIZE(\1)/g' and manual check/verification.

Signed-off-by: Thomas Meyer <thomas@m3y3r.de>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years agomedia: staging/atomisp: fix header guards
Nicolas Iooss [Sun, 3 Sep 2017 12:05:26 +0000 (08:05 -0400)]
media: staging/atomisp: fix header guards

Files input_formatter_subsystem_defs.h begin with:

    #ifndef _if_subsystem_defs_h
    #define _if_subsystem_defs_h__

and end with:

    #endif /* _if_subsystem_defs_h__ */

The intent seems to have been to use _if_subsystem_defs_h__ everywhere
but two underscores are missing in the initial #ifndef.

Fixes: a49d25364dfb ("staging/atomisp: Add support for the Intel IPU v2")

Signed-off-by: Nicolas Iooss <nicolas.iooss_linux@m4x.org>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>