Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 366889
b: refs/heads/master
c: 0af0b25
h: refs/heads/master
i:
  366887: 6e7c541
v: v3
  • Loading branch information
Frank Schaefer authored and Mauro Carvalho Chehab committed Mar 29, 2013
1 parent efec0d6 commit b92bc30
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 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: 176013b19e848204895bfcaea8b9b39fba5b26dd
refs/heads/master: 0af0b25a64458c3ee002efe6e7542013b94a268a
23 changes: 19 additions & 4 deletions trunk/drivers/media/usb/em28xx/em28xx-camera.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@ static int em28xx_initialize_mt9m001(struct em28xx *dev)


/*
* This method works for webcams with Micron sensors
* Probes Micron sensors with 8 bit address and 16 bit register width
*/
int em28xx_detect_sensor(struct em28xx *dev)
static int em28xx_probe_sensor_micron(struct em28xx *dev)
{
int ret, i;
char *name;
Expand All @@ -96,7 +96,6 @@ int em28xx_detect_sensor(struct em28xx *dev)
struct i2c_client client = dev->i2c_client[dev->def_i2c_bus];

dev->em28xx_sensor = EM28XX_NOSENSOR;
/* Probe Micron sensors with 8 bit address and 16 bit register width */
for (i = 0; micron_sensor_addrs[i] != I2C_CLIENT_END; i++) {
client.addr = micron_sensor_addrs[i];
/* NOTE: i2c_smbus_read_word_data() doesn't work with BE data */
Expand Down Expand Up @@ -167,7 +166,7 @@ int em28xx_detect_sensor(struct em28xx *dev)
default:
em28xx_info("unknown Micron sensor detected: 0x%04x\n",
id);
return -EINVAL;
return 0;
}

if (dev->em28xx_sensor == EM28XX_NOSENSOR)
Expand All @@ -182,6 +181,22 @@ int em28xx_detect_sensor(struct em28xx *dev)
return -ENODEV;
}

/*
* This method works for webcams with Micron sensors
*/
int em28xx_detect_sensor(struct em28xx *dev)
{
int ret;

ret = em28xx_probe_sensor_micron(dev);
if (dev->em28xx_sensor == EM28XX_NOSENSOR && ret < 0) {
em28xx_info("No sensor detected\n");
return -ENODEV;
}

return 0;
}

int em28xx_init_camera(struct em28xx *dev)
{
switch (dev->em28xx_sensor) {
Expand Down

0 comments on commit b92bc30

Please sign in to comment.