[media] v4l2-mem2mem: support events in v4l2_m2m_poll

v4l2_m2m_poll didn't support events, but that's essential if you want to
be able to use control events for example.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
[media] mem2mem_testdev: add control events support

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
[media] mem2mem_testdev: set default size and fix colorspace

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
[media] v4l2-dev: G_PARM was incorrectly enabled for all video nodes

G_PARM should only be enabled if:

- vidioc_g_parm is present
- or: it is a video node and vidioc_g_std or tvnorms are set.

Without this additional check v4l2-compliance would complain about
being able to use g_parm when it didn't expect it.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
[media] s5p-fimc: Remove V4L2_FL_LOCK_ALL_FOPS flag

This patch adds locking for open(), close(), poll() and mmap()
file operations in the driver as a follow up to the changes
done in commit 5126f2590bee412e3053de851cb07f531
"v4l2-dev: add flag to have the core lock all file operations".

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
[media] s5p-fimc: Replace custom err() macro with v4l2_err() macro

Replace custom err() macro with v4l2_err() macro.

[s.nawrocki: added missing end-of-line at the log print]

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
[media] s5p-fimc: Use switch statement for better readability

Use switch statement rather than multiple 'else if'.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
[media] m5mols: Correct reported ISO values

The V4L2_CID_ISO_SENSITIVITY control menu values should be
standard ISO values multiplied by 1000. Multiply all menu
items by 1000 so ISO is properly reported as 50...3200 range.

This applies to kernels 3.5+.

Cc: stable@vger.kernel.org
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
[media] V4L: Add capability flags for memory-to-memory devices

This patch adds new V4L2_CAP_VIDEO_M2M and V4L2_CAP_VIDEO_M2M_MPLANE
capability flags that are intended to be used for memory-to-memory (M2M)
devices, instead of ORed V4L2_CAP_VIDEO_CAPTURE and V4L2_CAP_VIDEO_OUTPUT.

V4L2_CAP_VIDEO_M2M flag is added at the drivers, CAPTURE and OUTPUT
capability flags are left untouched and will be removed in future,
after a transition period required for existing applications to be
adapted to check only for V4L2_CAP_VIDEO_M2M.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Acked-by: Kamil Debski <k.debski@samsung.com>
Acked-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
[media] Feature removal: using capture and output capabilities for m2m devices

Identifying a memory-to-memory video device through an ORed output and
capture capability flags is not reliable. Schedule this for removal.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
regulator: Fix an s5m8767 build failure

Due to a merge conflict we are getting this:

drivers/regulator/s5m8767.c: In function ‘s5m8767_pmic_probe’:
drivers/regulator/s5m8767.c:575:2: error: implicit declaration of function
‘s5m_reg_write’ [-Werror=implicit-function-declaration]

This is fixed by fully converting this driver to the new s5m API.

Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
pnfsblock: bail out partial page IO

Current block layout driver read/write code assumes page
aligned IO in many places. Add a checker to validate the assumption.
Otherwise there would be data corruption like when application does
open(O_WRONLY) and page unaliged write.

Signed-off-by: Peng Tao <tao.peng@emc.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
[media] saa7164: Remove useless struct i2c_algo_bit_data

The field 'struct i2c_algo_bit_data i2c_algo' is wrongly confused with
struct i2c_algorithm. Moreover, i2c_algo field is not used since
i2c is registered using i2c_add_adpater() and not i2c_bit_add_bus().
Therefore, it's safe to remove it.
Tested by compilation only.

Signed-off-by: Ezequiel Garcia <elezegarcia@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
[media] cx23885: Remove useless struct i2c_algo_bit_data

The field 'struct i2c_algo_bit_data i2c_algo' is wrongly confused with
struct i2c_algorithm. Moreover, i2c_algo field is not used since
i2c is registered using i2c_add_adpater() and not i2c_bit_add_bus().
Therefore, it's safe to remove it.
Tested by compilation only.

Signed-off-by: Ezequiel Garcia <elezegarcia@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
[media] cx231xx: Remove useless struct i2c_algo_bit_data

The field 'struct i2c_algo_bit_data i2c_algo' is wrongly confused with
struct i2c_algorithm. Moreover, i2c_algo field is not used since
i2c is registered using i2c_add_adpater() and not i2c_bit_add_bus().
Therefore, it's safe to remove it.
Tested by compilation only.

Signed-off-by: Ezequiel Garcia <elezegarcia@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
[media] cx25821: Remove useless struct i2c_algo_bit_data

The field 'struct i2c_algo_bit_data i2c_algo' is wrongly confused with
struct i2c_algorithm. Moreover, i2c_algo field is not used since
i2c is registered using i2c_add_adpater() and not i2c_bit_add_bus().
Therefore, it's safe to remove it.
Tested by compilation only.

Signed-off-by: Ezequiel Garcia <elezegarcia@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
[media] saa7164: Remove unused saa7164_call_i2c_clients()

This function has no users, so it's safe to remove it.
Tested by compilation only.

Signed-off-by: Ezequiel Garcia <elezegarcia@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
[media] saa7164: Replace struct memcpy with struct assignment

Copying structs by assignment is type safe.
Plus, is shorter and easier to read.

Signed-off-by: Ezequiel Garcia <elezegarcia@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
[media] cx23885: Replace struct memcpy with struct assignment

Copying structs by assignment is type safe.
Plus, is shorter and easier to read.

Signed-off-by: Ezequiel Garcia <elezegarcia@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
[media] cx231xx: Replace struct memcpy with struct assignment

Copying structs by assignment is type safe.
Plus, is shorter and easier to read.

Signed-off-by: Ezequiel Garcia <elezegarcia@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>