Commit Graph

7 Commits

Author SHA1 Message Date
Sakari Ailus 586248a75b [media] ad5820: unregister async sub-device
The async sub-device was not unregistered in ad5820_remove() as it should
have been; do it now. Also remove the now-redundant
v4l2_device_unregister_subdev().

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-06-08 12:34:17 -03:00
Dmitry Torokhov 78cea55c60 [media] ad5820: remove incorrect __exit markups
Even if bus is not hot-pluggable, devices can be unbound from the
driver via sysfs, so we should not be using __exit annotations on
remove() methods. The only exception is drivers registered with
platform_driver_probe() which specifically disables sysfs bind/unbind
attributes.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-03-22 10:14:12 -03:00
Sakari Ailus 1ff52fa0f1 [media] ad5820: Fix sparse warning
Use a type with explicit endianness in machine to big endian conversion.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-10-24 17:37:12 -02:00
Arnd Bergmann 37f0644f3a [media] ad5820: use __maybe_unused for PM functions
The new ad5820 driver uses #ifdef to hide the suspend/resume functions,
but gets it wrong when CONFIG_PM_SLEEP is disabled:

drivers/media/i2c/ad5820.c:286:12: error: 'ad5820_resume' defined but not used [-Werror=unused-function]
drivers/media/i2c/ad5820.c:274:12: error: 'ad5820_suspend' defined but not used [-Werror=unused-function]

This replaces the #ifdef with a __maybe_unused annotation that is
simpler and harder to get wrong, avoiding the warning.

Fixes: bee3d51156 ("[media] ad5820: Add driver for auto-focus coil")

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-09-19 16:25:13 -03:00
Sakari Ailus 3933186aec [media] ad5820: Use bool for boolean values
The driver used integers for what boolean would have been a better fit.
Use boolean instead.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-09-09 11:22:02 -03:00
Mauro Carvalho Chehab 1ee6dd5a91 [media] ad5820: fix one smatch warning
drivers/media/i2c/ad5820.c:61:24: error: dubious one-bit signed bitfield

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-08-24 08:21:38 -03:00
Pavel Machek bee3d51156 [media] ad5820: Add driver for auto-focus coil
This adds support for AD5820 autofocus coil, found for example in
Nokia N900 smartphone.

Signed-off-by: Pavel Machek <pavel@ucw.cz>
Acked-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-08-24 08:09:41 -03:00