// SPDX-License-Identifier: GPL-2.0-only /* * USB Driver for ALi m5602 based webcams * * Copyright (C) 2008 Erik Andrén * Copyright (C) 2007 Ilyes Gouta. Based on the m5603x Linux Driver Project. * Copyright (C) 2005 m5603x Linux Driver Project <m5602@x3ng.com.br> * * Portions of code to USB interface and ALi driver software, * Copyright (c) 2006 Willem Duinker * v4l2 interface modeled after the V4L2 driver * for SN9C10x PC Camera Controllers
*/
/* Sensors with registers that are of only
one byte width are differently read */
/* FIXME: This works with the ov9650, but has issues with the po1030 */ if (sd->sensor->i2c_regW == 1) {
err = m5602_write_bridge(sd, M5602_XB_I2C_CTRL, 1); if (err < 0) return err;
/* Special case larger sensor writes */
p = buf + 16;
/* Copy a four byte write sequence for each byte to be written to */ for (i = 0; i < len; i++) {
memcpy(p, sensor_urb_skeleton + 16, 4);
p[3] = i2c_data[i];
p += 4;
gspca_dbg(gspca_dev, D_CONF, "Writing sensor register 0x%x with 0x%x\n",
address, i2c_data[i]);
}
/* Copy the tailer */
memcpy(p, sensor_urb_skeleton + 20, 4);
/* Dump all the registers of the m5602 bridge,
unfortunately this breaks the camera until it's power cycled */ staticvoid m5602_dump_bridge(struct sd *sd)
{ int i; for (i = 0; i < 0x80; i++) { unsignedchar val = 0;
m5602_read_bridge(sd, i, &val);
pr_info("ALi m5602 address 0x%x contains 0x%x\n", i, val);
}
pr_info("Warning: The ALi m5602 webcam probably won't work until it's power cycled\n");
}
staticint m5602_probe_sensor(struct sd *sd)
{ /* Try the po1030 */
sd->sensor = &po1030; if (!sd->sensor->probe(sd)) return 0;
/* Try the mt9m111 sensor */
sd->sensor = &mt9m111; if (!sd->sensor->probe(sd)) return 0;
/* Try the s5k4aa */
sd->sensor = &s5k4aa; if (!sd->sensor->probe(sd)) return 0;
/* Try the ov9650 */
sd->sensor = &ov9650; if (!sd->sensor->probe(sd)) return 0;
/* Try the ov7660 */
sd->sensor = &ov7660; if (!sd->sensor->probe(sd)) return 0;
/* Try the s5k83a */
sd->sensor = &s5k83a; if (!sd->sensor->probe(sd)) return 0;
/* More sensor probe function goes here */
pr_info("Failed to find a sensor\n");
sd->sensor = NULL; return -ENODEV;
}
/* this function is called at probe time */ staticint m5602_configure(struct gspca_dev *gspca_dev, conststruct usb_device_id *id)
{ struct sd *sd = (struct sd *) gspca_dev; struct cam *cam; int err;
module_param(dump_bridge, bool, S_IRUGO | S_IWUSR);
MODULE_PARM_DESC(dump_bridge, "Dumps all usb bridge registers at startup");
module_param(dump_sensor, bool, S_IRUGO | S_IWUSR);
MODULE_PARM_DESC(dump_sensor, "Dumps all usb sensor registers at startup providing a sensor is found");
Messung V0.5
¤ Dauer der Verarbeitung: 0.29 Sekunden
(vorverarbeitet)
¤
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.