Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 285406
b: refs/heads/master
c: 69eb180
h: refs/heads/master
v: v3
  • Loading branch information
Sylwester Nawrocki authored and Mauro Carvalho Chehab committed Dec 30, 2011
1 parent 7ff3c57 commit 14e3547
Show file tree
Hide file tree
Showing 4 changed files with 103 additions and 154 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: dafb9c70abb7896a43288fbec2a9f2ed6e915d18
refs/heads/master: 69eb18032017082bb1c54236290c7e3578e0a3d3
2 changes: 1 addition & 1 deletion trunk/drivers/media/video/m5mols/m5mols.h
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ int m5mols_read_u8(struct v4l2_subdev *sd, u32 reg_comb, u8 *val);
int m5mols_read_u16(struct v4l2_subdev *sd, u32 reg_comb, u16 *val);
int m5mols_read_u32(struct v4l2_subdev *sd, u32 reg_comb, u32 *val);
int m5mols_write(struct v4l2_subdev *sd, u32 reg_comb, u32 val);
int m5mols_busy(struct v4l2_subdev *sd, u8 category, u8 cmd, u8 value);
int m5mols_busy(struct v4l2_subdev *sd, u32 reg, u8 value);

/*
* Mode operation of the M-5MOLS
Expand Down
9 changes: 4 additions & 5 deletions trunk/drivers/media/video/m5mols/m5mols_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -272,14 +272,14 @@ int m5mols_write(struct v4l2_subdev *sd, u32 reg, u32 val)
return 0;
}

int m5mols_busy(struct v4l2_subdev *sd, u8 category, u8 cmd, u8 mask)
int m5mols_busy(struct v4l2_subdev *sd, u32 reg, u8 mask)
{
u8 busy;
int i;
int ret;

for (i = 0; i < M5MOLS_I2C_CHECK_RETRY; i++) {
ret = m5mols_read_u8(sd, I2C_REG(category, cmd, 1), &busy);
ret = m5mols_read_u8(sd, reg, &busy);
if (ret < 0)
return ret;
if ((busy & mask) == mask)
Expand Down Expand Up @@ -317,7 +317,7 @@ static int m5mols_reg_mode(struct v4l2_subdev *sd, u8 mode)
{
int ret = m5mols_write(sd, SYSTEM_SYSMODE, mode);

return ret ? ret : m5mols_busy(sd, CAT_SYSTEM, CAT0_SYSMODE, mode);
return ret ? ret : m5mols_busy(sd, mode, SYSTEM_SYSMODE);
}

/**
Expand Down Expand Up @@ -829,8 +829,7 @@ static int m5mols_s_power(struct v4l2_subdev *sd, int on)
if (!ret)
ret = m5mols_write(sd, AF_MODE, REG_AF_POWEROFF);
if (!ret)
ret = m5mols_busy(sd, CAT_SYSTEM, CAT0_STATUS,
REG_AF_IDLE);
ret = m5mols_busy(sd, SYSTEM_STATUS, REG_AF_IDLE);
if (!ret)
v4l2_info(sd, "Success soft-landing lens\n");
}
Expand Down
Loading

0 comments on commit 14e3547

Please sign in to comment.