[media] Kconfig reorganization

Reorganize the Kconfig order, for it to be a little more intuitive.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
[media] Put the test devices together

Vivi is not that important to appear at the main menu, so move it
to its own submenu. Also, the mem2mem test device driver is
similar to vivi. So, put both at the same menu.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
[media] Cleanup media Kconfig files

- get rid of ridden V4L2_COMMON symbol

  This symbol is not needed anymore; it can be folded with V4L2
  one, simplifying the Kconfig a little bit;

- Comment why some Kconfig items are needed;

- Remove if test for MEDIA_CAMERA_SUPPORT, replacing it by
  depends on.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
[media] Kconfig: use menuconfig instead of menu

This allows disabling all drivers of a certain type as a hole

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
[media] Kconfig: merge all customise options into just one

Instead of having 3 options to allow customizing the media
sub-drivers (tuners, I2C drivers, frontends), merge all of
them into just one.

That simplifies the life for users, as they can just keep
this untouched.

Life for developers is also simpler, as there's now just
one Kconfig item to remember, for the ancillary sub-drivers
providing supports for chips that could change from one
board design to another.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
[media] flexcop: Show the item to enable debug after the driver

Instead of showing the option to show debug at the end, show
it after each driver.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
[media] Add missing help for some menuconfig items

Help was missing during some items reorganization. Add them.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
gpio: bt8xx: Fix build error due to missing include file

This patch fixes below build error:

  CC [M]  drivers/gpio/gpio-bt8xx.o
drivers/gpio/gpio-bt8xx.c:53:40: fatal error: ../media/video/bt8xx/bt848.h: No such file or directory
compilation terminated.
make[2]: *** [drivers/gpio/gpio-bt8xx.o] Error 1
make[1]: *** [drivers/gpio] Error 2
make: *** [drivers] Error 2

drivers/media/video/bt8xx/bt848.h is moved to drivers/media/pci/bt8xx/bt848.h
by commit 68de959f773a1d49096835c411390bceff5d1549
"[media] bt8xx: move analog TV part to be together with DTV one".

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
[media] Fix vino compilation

A trivial fix so that vino can find the saa7191.h header.

[mchehab@redhat.com: Fix merge conflict]
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
[media] Kconfig: Fix b2c2 common code selection

As reported by Randy:

> flexcop-pci.c:(.text+0x19af63): undefined reference to `flexcop_device_exit'
> flexcop-pci.c:(.text+0x19af77): undefined reference to `flexcop_device_kfree'
> flexcop-pci.c:(.text+0x19b10f): undefined reference to `flexcop_pass_dmx_packets'
> flexcop-pci.c:(.text+0x19b182): undefined reference to `flexcop_pass_dmx_data'
> flexcop-pci.c:(.text+0x19b1ae): undefined reference to `flexcop_pass_dmx_data'
> flexcop-pci.c:(.text+0x19b1f8): undefined reference to `flexcop_device_kmalloc'
> flexcop-pci.c:(.text+0x19b256): undefined reference to `flexcop_i2c_request'
> flexcop-pci.c:(.text+0x19b261): undefined reference to `flexcop_eeprom_check_mac_addr'
> flexcop-pci.c:(.text+0x19b2c6): undefined reference to `flexcop_device_initialize'
> flexcop-pci.c:(.text+0x19b332): undefined reference to `flexcop_sram_set_dest'
> flexcop-pci.c:(.text+0x19b348): undefined reference to `flexcop_sram_set_dest'
> flexcop-pci.c:(.text+0x19b3f8): undefined reference to `flexcop_device_exit'
> flexcop-pci.c:(.text+0x19b408): undefined reference to `flexcop_device_kfree'
> flexcop-pci.c:(.text+0x19b4a2): undefined reference to `flexcop_pid_feed_control'
> flexcop-pci.c:(.text+0x19b4d7): undefined reference to `flexcop_pid_feed_control'
>
> since it is possible to enable DVB_B2C2_FLEXCOP_PCI
> when CONFIG_I2C is not enabled, but then DVB_B2C2_FLEXCOP
> is not enabled because I2C is not enabled.

Reported-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
[media] saa7164: Add dependency for V4L2 core

As Reported by Randy:

> drivers/built-in.o: In function `fops_open':
> saa7164-encoder.c:(.text+0x68ed6f): undefined reference to `video_devdata'
> drivers/built-in.o: In function `fill_queryctrl.clone.4':
> saa7164-encoder.c:(.text+0x68f657): undefined reference to `v4l2_ctrl_query_fill'
> saa7164-encoder.c:(.text+0x68f6a9): undefined reference to `v4l2_ctrl_query_fill'
> saa7164-encoder.c:(.text+0x68f6e0): undefined reference to `v4l2_ctrl_query_fill'
> saa7164-encoder.c:(.text+0x68f71a): undefined reference to `v4l2_ctrl_query_fill'
> saa7164-encoder.c:(.text+0x68f73a): undefined reference to `v4l2_ctrl_query_fill'
> drivers/built-in.o:saa7164-encoder.c:(.text+0x68f757): more undefined references to `v4l2_ctrl_query_fill' follow
> drivers/built-in.o: In function `saa7164_encoder_register':
> (.text+0x68fff7): undefined reference to `video_device_alloc'
> drivers/built-in.o: In function `saa7164_encoder_register':
> (.text+0x690073): undefined reference to `video_device_release'
> drivers/built-in.o: In function `saa7164_encoder_register':
> (.text+0x6900a1): undefined reference to `__video_register_device'
> drivers/built-in.o: In function `saa7164_encoder_unregister':
> (.text+0x690243): undefined reference to `video_unregister_device'
> drivers/built-in.o: In function `saa7164_encoder_unregister':
> (.text+0x690269): undefined reference to `video_device_release'
> drivers/built-in.o: In function `fops_open':
> saa7164-vbi.c:(.text+0x69125f): undefined reference to `video_devdata'
> drivers/built-in.o: In function `fill_queryctrl.clone.4':
> saa7164-vbi.c:(.text+0x6919b4): undefined reference to `v4l2_ctrl_query_fill'
> saa7164-vbi.c:(.text+0x6919ee): undefined reference to `v4l2_ctrl_query_fill'
> saa7164-vbi.c:(.text+0x691a23): undefined reference to `v4l2_ctrl_query_fill'
> saa7164-vbi.c:(.text+0x691a47): undefined reference to `v4l2_ctrl_query_fill'
> saa7164-vbi.c:(.text+0x691a6a): undefined reference to `v4l2_ctrl_query_fill'
> drivers/built-in.o:saa7164-vbi.c:(.text+0x691a87): more undefined references to `v4l2_ctrl_query_fill' follow
> drivers/built-in.o: In function `saa7164_vbi_register':
> (.text+0x69220e): undefined reference to `video_device_alloc'
> drivers/built-in.o: In function `saa7164_vbi_register':
> (.text+0x69228a): undefined reference to `video_device_release'
> drivers/built-in.o: In function `saa7164_vbi_register':
> (.text+0x6922bb): undefined reference to `__video_register_device'
> drivers/built-in.o: In function `saa7164_vbi_unregister':
> (.text+0x6923de): undefined reference to `video_unregister_device'
> drivers/built-in.o: In function `saa7164_vbi_unregister':
> (.text+0x6923f9): undefined reference to `video_device_release'
> drivers/built-in.o:(.rodata+0xb1054): undefined reference to `video_ioctl2'
> drivers/built-in.o:(.rodata+0xb17d4): undefined reference to `video_ioctl2'

That's due to the lack of an explicit Kconfig dependency for the V4L2 core.

Reported-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Makefile: Add missing soc_camera/ directory

drivers/built-in.o: In function `imx074_s_power':
imx074.c:(.text+0x1de93d0): undefined reference to `soc_camera_power_on'
imx074.c:(.text+0x1de93f3): undefined reference to `soc_camera_power_off'
drivers/built-in.o: In function `mt9m001_s_mbus_config':

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
ab8500_charger: Fix error return code

Initialize return variable before exiting on an error path.

A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
(
if@p1 (\(ret < 0\|ret != 0\))
 { ... return ret; }
|
ret@p1 = 0
)
... when != ret = e1
    when != &ret
*if(...)
{
  ... when != ret = e2
      when forall
 return ret;
}

// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
wm97xx_battery: Fix error return code

Initialize return variable before exiting on an error path.

A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
(
if@p1 (\(ret < 0\|ret != 0\))
 { ... return ret; }
|
ret@p1 = 0
)
... when != ret = e1
    when != &ret
*if(...)
{
  ... when != ret = e2
      when forall
 return ret;
}

// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
ab8500_btemp: Fix error return code

Initialize return variable before exiting on an error path.

A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
(
if@p1 (\(ret < 0\|ret != 0\))
 { ... return ret; }
|
ret@p1 = 0
)
... when != ret = e1
    when != &ret
*if(...)
{
  ... when != ret = e2
      when forall
 return ret;
}

// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
ab8500_fg: Fix error return code

Initialize return variable before exiting on an error path.

A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
(
if@p1 (\(ret < 0\|ret != 0\))
 { ... return ret; }
|
ret@p1 = 0
)
... when != ret = e1
    when != &ret
*if(...)
{
  ... when != ret = e2
      when forall
 return ret;
}

// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
bq27x00_battery: Fix error return code

Initialize return variable before exiting on an error path.

A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
(
if@p1 (\(ret < 0\|ret != 0\))
 { ... return ret; }
|
ret@p1 = 0
)
... when != ret = e1
    when != &ret
*if(...)
{
  ... when != ret = e2
      when forall
 return ret;
}

// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
lp8727_charger: Unregister power supply at error path of lp8727_register_psy

if usb power supply registration fails,
	we wont unregister the ac power supply
if battery power supply registration fails,
	we wont unregister the usb, and ac supply,

take care of those things and also no need of goto -err_mem: at the fail case of
kzalloc simply can have return -ENOMEM

Signed-off-by: Devendra Naga <develkernel412222@gmail.com>
Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
da9052-battery: Fix da9052_determine_vc_tbl_index's return value

The patch fixes the following warnings:

  CHECK   drivers/power/da9052-battery.c
drivers/power/da9052-battery.c:330:15: warning: symbol 'da9052_determine_vc_tbl_index' was not declared. Should it be static?
  CC      drivers/power/da9052-battery.o
drivers/power/da9052-battery.c: In function 'da9052_determine_vc_tbl_index':
drivers/power/da9052-battery.c:348:1: warning: control reaches end of non-void function [-Wreturn-type]

Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
power_supply: Remove broken mark for da9052-battery

The fix for MFD part is already merged so we can remove the broken mark
for da9052-battery.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>