/* * Probes Omnivision sensors with 8 bit address and register width
*/ staticint em28xx_probe_sensor_omnivision(struct em28xx *dev)
{ int ret, i; char *name;
u8 reg;
u16 id; struct i2c_client *client = &dev->i2c_client[dev->def_i2c_bus];
dev->em28xx_sensor = EM28XX_NOSENSOR; /* * NOTE: these devices have the register auto incrementation disabled * by default, so we have to use single byte reads !
*/ for (i = 0; omnivision_sensor_addrs[i] != I2C_CLIENT_END; i++) {
client->addr = omnivision_sensor_addrs[i]; /* Read manufacturer ID from registers 0x1c-0x1d (BE) */
reg = 0x1c;
ret = i2c_smbus_read_byte_data(client, reg); if (ret < 0) { if (ret != -ENXIO)
dev_err(&dev->intf->dev, "couldn't read from i2c device 0x%02x: error %i\n",
client->addr << 1, ret); continue;
}
id = ret << 8;
reg = 0x1d;
ret = i2c_smbus_read_byte_data(client, reg); if (ret < 0) {
dev_err(&dev->intf->dev, "couldn't read from i2c device 0x%02x: error %i\n",
client->addr << 1, ret); continue;
}
id += ret; /* Check manufacturer ID */ if (id != 0x7fa2) continue; /* Read product ID from registers 0x0a-0x0b (BE) */
reg = 0x0a;
ret = i2c_smbus_read_byte_data(client, reg); if (ret < 0) {
dev_err(&dev->intf->dev, "couldn't read from i2c device 0x%02x: error %i\n",
client->addr << 1, ret); continue;
}
id = ret << 8;
reg = 0x0b;
ret = i2c_smbus_read_byte_data(client, reg); if (ret < 0) {
dev_err(&dev->intf->dev, "couldn't read from i2c device 0x%02x: error %i\n",
client->addr << 1, ret); continue;
}
id += ret; /* Check product ID */ switch (id) { case 0x2642:
name = "OV2640";
dev->em28xx_sensor = EM28XX_OV2640; break; case 0x7648:
name = "OV7648"; break; case 0x7660:
name = "OV7660"; break; case 0x7673:
name = "OV7670"; break; case 0x7720:
name = "OV7720"; break; case 0x7721:
name = "OV7725"; break; case 0x9648: /* Rev 2 */ case 0x9649: /* Rev 3 */
name = "OV9640"; break; case 0x9650: case 0x9652: /* OV9653 */
name = "OV9650"; break; case 0x9656: /* Rev 4 */ case 0x9657: /* Rev 5 */
name = "OV9655"; break; default:
dev_info(&dev->intf->dev, "unknown OmniVision sensor detected: 0x%04x\n",
id); return 0;
}
/* * FIXME: mt9v011 uses I2S speed as xtal clk - at least with * the Silvercrest cam I have here for testing - for higher * resolutions, a high clock cause horizontal artifacts, so we * need to use a lower xclk frequency. * Yet, it would be possible to adjust xclk depending on the * desired resolution, since this affects directly the * frame rate.
*/
dev->board.xclk = EM28XX_XCLK_FREQUENCY_4_3MHZ;
em28xx_write_reg(dev, EM28XX_R0F_XCLK, dev->board.xclk);
v4l2->sensor_xtal = 4300000;
pdata.xtal = v4l2->sensor_xtal; if (NULL ==
v4l2_i2c_new_subdev_board(&v4l2->v4l2_dev, adap,
&mt9v011_info, NULL)) return -ENODEV;
v4l2->vinmode = EM28XX_VINMODE_RGB8_GRBG;
v4l2->vinctl = 0x00;
break;
} case EM28XX_MT9M001:
v4l2->sensor_xres = 1280;
v4l2->sensor_yres = 1024;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.