summaryrefslogtreecommitdiff
path: root/linux/drivers
diff options
context:
space:
mode:
authorGuennadi Liakhovetski <g.liakhovetski@gmx.de>2009-04-24 17:53:51 +0200
committerGuennadi Liakhovetski <g.liakhovetski@gmx.de>2009-04-24 17:53:51 +0200
commit4958205a8529a672cec383a02fa7d7c53c12ff0d (patch)
tree45b996448d893d53ad48ae4f526f1a52a697da9f /linux/drivers
parente43ba95be5ac0fe8418aba4306208274c734dd30 (diff)
downloadmediapointer-dvb-s2-4958205a8529a672cec383a02fa7d7c53c12ff0d.tar.gz
mediapointer-dvb-s2-4958205a8529a672cec383a02fa7d7c53c12ff0d.tar.bz2
soc-camera: add a free_bus method to struct soc_camera_link
From: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Currently pcm990 camera bus-width management functions request a GPIO and never free it again. With this approach the GPIO extender driver cannot be unloaded once camera drivers have been loaded, also unloading theb i2c-pxa bus driver produces errors, because the GPIO extender driver cannot unregister properly. Another problem is, that if camera drivers are once loaded before the GPIO extender driver, the platform code marks the GPIO unavailable and only a reboot helps to recover. Adding an explicit free_bus method and using it in mt9m001 and mt9v022 drivers fixes these problems. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Acked-by: Eric Miao <eric.miao@marvell.com> --- arch/arm/mach-pxa/pcm990-baseboard.c | 23 ++++++++++++++++------- drivers/media/video/mt9m001.c | 3 +++ drivers/media/video/mt9v022.c | 3 +++ include/media/soc_camera.h | 1 + 4 files changed, 23 insertions(+), 7 deletions(-)
Diffstat (limited to 'linux/drivers')
-rw-r--r--linux/drivers/media/video/mt9m001.c3
-rw-r--r--linux/drivers/media/video/mt9v022.c3
2 files changed, 6 insertions, 0 deletions
diff --git a/linux/drivers/media/video/mt9m001.c b/linux/drivers/media/video/mt9m001.c
index 83f3cae47..959edc760 100644
--- a/linux/drivers/media/video/mt9m001.c
+++ b/linux/drivers/media/video/mt9m001.c
@@ -604,10 +604,13 @@ ei2c:
static void mt9m001_video_remove(struct soc_camera_device *icd)
{
struct mt9m001 *mt9m001 = container_of(icd, struct mt9m001, icd);
+ struct soc_camera_link *icl = mt9m001->client->dev.platform_data;
dev_dbg(&icd->dev, "Video %x removed: %p, %p\n", mt9m001->client->addr,
icd->dev.parent, icd->vdev);
soc_camera_video_stop(icd);
+ if (icl->free_bus)
+ icl->free_bus(icl);
}
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 26)
diff --git a/linux/drivers/media/video/mt9v022.c b/linux/drivers/media/video/mt9v022.c
index 3bee30caa..07ffd967e 100644
--- a/linux/drivers/media/video/mt9v022.c
+++ b/linux/drivers/media/video/mt9v022.c
@@ -735,10 +735,13 @@ ei2c:
static void mt9v022_video_remove(struct soc_camera_device *icd)
{
struct mt9v022 *mt9v022 = container_of(icd, struct mt9v022, icd);
+ struct soc_camera_link *icl = mt9v022->client->dev.platform_data;
dev_dbg(&icd->dev, "Video %x removed: %p, %p\n", mt9v022->client->addr,
icd->dev.parent, icd->vdev);
soc_camera_video_stop(icd);
+ if (icl->free_bus)
+ icl->free_bus(icl);
}
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 26)