Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 271851
b: refs/heads/master
c: 096b703
h: refs/heads/master
i:
  271849: db73343
  271847: f43da2f
v: v3
  • Loading branch information
Michael Grzeschik authored and Mauro Carvalho Chehab committed Sep 21, 2011
1 parent 9f0e6c0 commit e5bb17c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 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: e553000a14ead0e265a8aa4d241c7b3221e233e3
refs/heads/master: 096b703fb6cc9c9e4a188b80932c467b96985fcf
9 changes: 6 additions & 3 deletions trunk/drivers/media/video/mt9m111.c
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ struct mt9m111 {
struct mutex power_lock; /* lock to protect power_count */
int power_count;
const struct mt9m111_datafmt *fmt;
int lastpage; /* PageMap cache value */
unsigned int gain;
unsigned char autoexposure;
unsigned char datawidth;
Expand All @@ -202,17 +203,17 @@ static int reg_page_map_set(struct i2c_client *client, const u16 reg)
{
int ret;
u16 page;
static int lastpage = -1; /* PageMap cache value */
struct mt9m111 *mt9m111 = to_mt9m111(client);

page = (reg >> 8);
if (page == lastpage)
if (page == mt9m111->lastpage)
return 0;
if (page > 2)
return -EINVAL;

ret = i2c_smbus_write_word_data(client, MT9M111_PAGE_MAP, swab16(page));
if (!ret)
lastpage = page;
mt9m111->lastpage = page;
return ret;
}

Expand Down Expand Up @@ -932,6 +933,8 @@ static int mt9m111_video_probe(struct soc_camera_device *icd,
BUG_ON(!icd->parent ||
to_soc_camera_host(icd->parent)->nr != icd->iface);

mt9m111->lastpage = -1;

mt9m111->autoexposure = 1;
mt9m111->autowhitebalance = 1;

Expand Down

0 comments on commit e5bb17c

Please sign in to comment.