SUMMARY: This is the third part of the conversion to a new I²C interface. Thanks to Kyösti Mälkki for his help with this (his contributions have a '*'). PER-FILE CHANGES: - Makefile: - ovsensor.c needs ov511.h as dependency - ov511.c: - Remove OV8600 and KS0127 stuff, since these won't be supported anytime soon - Convert designated structure initializers to ISO C99 standard * Rewrite i2c_r(), i2c_w(), and i2c_w_mask() to use kernel I2C interface - Remove obsolete i2c_r_p() and ov51x_set_slave_ids() - Work around bug in smbus_xfer (it treats positive return value as an error) - Use unique (unoffocial) IDs for OV511/OV518 I2C adapter - Create I2C client for internal use (ov->internal_client). This obsoletes ov->primary_i2c_slave - Set internal client address (slave) from init_ov_sensor() - Remove some irrelevant comments - Set sensor min/max width/height vars from here instead of in sensor drivers - ov51x_init_i2c() must be called before sensor probing, but after ov51x init * Remove obsolete ov->i2c and ov->i2c_lock stuff * Fix memory leak: call ov->sops->unconfigure() on disconnect - ov511.h: * Move I2C address defines to ovsensor.h - Add OV511/OV518 I2C IDs - Remove i2c_lock and *_i2c_slave from struct usb_ov511 - Add internal_client to struct usb_ov511 - ov511_decomp.c: - ov518_decomp.c: - Convert designated structure initializers to ISO C99 standard - [All sensor drivers]: * Remove references to struct ov_i2c - Move setting of sensor min/max width/height vars to ov511.c * Use ov_write_regvals() instead of ovsensor_write_regvals() * Add unconfigure function * Use ov_write(), etc... instead of i2c->w(), etc... - Convert designated structure initializers to ISO C99 standard - ovsensor.c: * Replace ovsensor_write_regvals() with ov_write_regvals() * Add ov_write_mask() - ovsensor.h: - Add preliminary (unofficial) I2C driver ID - Remove OV8600 and KS0127 stuff * Move I2C address defines here, and shift out direction bit * Remove struct ov_i2c * Add unconfigure() to struct ovsensor_ops * Add ov_read() and ov_write() inline functions - saa7111-new: - Fix unlikely, but possible, memory leak - Return error if reg writes fail in attach(). This keeps SAA7111 from always attaching to OV511. - Convert designated structure initializers to ISO C99 standard