Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 261310
b: refs/heads/master
c: 67a8dbb
h: refs/heads/master
v: v3
  • Loading branch information
Jonathan Corbet authored and Mauro Carvalho Chehab committed Jul 27, 2011
1 parent f6062f3 commit c17201b
Show file tree
Hide file tree
Showing 8 changed files with 387 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 595a93a47a3b7dc1be84160fbd73b1406074f411
refs/heads/master: 67a8dbbc4e04cd256987b189352472a59aff73be
1 change: 1 addition & 0 deletions trunk/drivers/media/video/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ obj-$(CONFIG_VIDEO_M32R_AR_M64278) += arv.o
obj-$(CONFIG_VIDEO_CX2341X) += cx2341x.o

obj-$(CONFIG_VIDEO_CAFE_CCIC) += marvell-ccic/
obj-$(CONFIG_VIDEO_MMP_CAMERA) += marvell-ccic/

obj-$(CONFIG_VIDEO_VIA_CAMERA) += via-camera.o

Expand Down
11 changes: 11 additions & 0 deletions trunk/drivers/media/video/marvell-ccic/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,14 @@ config VIDEO_CAFE_CCIC
CMOS camera controller. This is the controller found on first-
generation OLPC systems.

config VIDEO_MMP_CAMERA
tristate "Marvell Armada 610 integrated camera controller support"
depends on ARCH_MMP && I2C && VIDEO_V4L2
select VIDEO_OV7670
select I2C_GPIO
---help---
This is a Video4Linux2 driver for the integrated camera
controller found on Marvell Armada 610 application
processors (and likely beyond). This is the controller found
in OLPC XO 1.75 systems.

4 changes: 4 additions & 0 deletions trunk/drivers/media/video/marvell-ccic/Makefile
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
obj-$(CONFIG_VIDEO_CAFE_CCIC) += cafe_ccic.o
cafe_ccic-y := cafe-driver.o mcam-core.o

obj-$(CONFIG_VIDEO_MMP_CAMERA) += mmp_camera.o
mmp_camera-y := mmp-driver.o mcam-core.o

28 changes: 20 additions & 8 deletions trunk/drivers/media/video/marvell-ccic/mcam-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ static void mcam_set_config_needed(struct mcam_camera *cam, int needed)


/*
* Debugging and related. FIXME these are broken
* Debugging and related.
*/
#define cam_err(cam, fmt, arg...) \
dev_err((cam)->dev, fmt, ##arg);
Expand Down Expand Up @@ -202,7 +202,8 @@ static void mcam_ctlr_dma(struct mcam_camera *cam)
mcam_reg_clear_bit(cam, REG_CTRL1, C1_TWOBUFS);
} else
mcam_reg_set_bit(cam, REG_CTRL1, C1_TWOBUFS);
mcam_reg_write(cam, REG_UBAR, 0); /* 32 bits only for now */
if (cam->chip_id == V4L2_IDENT_CAFE)
mcam_reg_write(cam, REG_UBAR, 0); /* 32 bits only */
}

static void mcam_ctlr_image(struct mcam_camera *cam)
Expand Down Expand Up @@ -358,8 +359,8 @@ static void mcam_ctlr_power_up(struct mcam_camera *cam)
unsigned long flags;

spin_lock_irqsave(&cam->dev_lock, flags);
mcam_reg_clear_bit(cam, REG_CTRL1, C1_PWRDWN);
cam->plat_power_up(cam);
mcam_reg_clear_bit(cam, REG_CTRL1, C1_PWRDWN);
spin_unlock_irqrestore(&cam->dev_lock, flags);
msleep(5); /* Just to be sure */
}
Expand All @@ -369,8 +370,13 @@ static void mcam_ctlr_power_down(struct mcam_camera *cam)
unsigned long flags;

spin_lock_irqsave(&cam->dev_lock, flags);
cam->plat_power_down(cam);
/*
* School of hard knocks department: be sure we do any register
* twiddling on the controller *before* calling the platform
* power down routine.
*/
mcam_reg_set_bit(cam, REG_CTRL1, C1_PWRDWN);
cam->plat_power_down(cam);
spin_unlock_irqrestore(&cam->dev_lock, flags);
}

Expand Down Expand Up @@ -1622,14 +1628,20 @@ int mccic_register(struct mcam_camera *cam)

void mccic_shutdown(struct mcam_camera *cam)
{
if (cam->users > 0)
/*
* If we have no users (and we really, really should have no
* users) the device will already be powered down. Trying to
* take it down again will wedge the machine, which is frowned
* upon.
*/
if (cam->users > 0) {
cam_warn(cam, "Removing a device with users!\n");
mcam_ctlr_power_down(cam);
}
mcam_free_dma_bufs(cam);
if (cam->n_sbufs > 0)
/* What if they are still mapped? Shouldn't be, but... */
mcam_free_sio_buffers(cam);
mcam_ctlr_stop_dma(cam);
mcam_ctlr_power_down(cam);
mcam_free_dma_bufs(cam);
video_unregister_device(&cam->vdev);
v4l2_device_unregister(&cam->v4l2_dev);
}
Expand Down
Loading

0 comments on commit c17201b

Please sign in to comment.