diff options
Diffstat (limited to 'drivers/media/video/cx18/cx18-i2c.c')
-rw-r--r-- | drivers/media/video/cx18/cx18-i2c.c | 28 |
1 files changed, 1 insertions, 27 deletions
diff --git a/drivers/media/video/cx18/cx18-i2c.c b/drivers/media/video/cx18/cx18-i2c.c index 8941f58bed7f..83e1c6333126 100644 --- a/drivers/media/video/cx18/cx18-i2c.c +++ b/drivers/media/video/cx18/cx18-i2c.c | |||
@@ -242,7 +242,7 @@ int cx18_call_i2c_client(struct cx18 *cx, int addr, unsigned cmd, void *arg) | |||
242 | return retval; | 242 | return retval; |
243 | } | 243 | } |
244 | } | 244 | } |
245 | if (cmd != VIDIOC_G_CHIP_IDENT) | 245 | if (cmd != VIDIOC_DBG_G_CHIP_IDENT) |
246 | CX18_ERR("i2c addr 0x%02x not found for cmd 0x%x!\n", | 246 | CX18_ERR("i2c addr 0x%02x not found for cmd 0x%x!\n", |
247 | addr, cmd); | 247 | addr, cmd); |
248 | return -ENODEV; | 248 | return -ENODEV; |
@@ -268,17 +268,6 @@ static int cx18_i2c_id_addr(struct cx18 *cx, u32 id) | |||
268 | return retval; | 268 | return retval; |
269 | } | 269 | } |
270 | 270 | ||
271 | /* Find the i2c device name matching the DRIVERID */ | ||
272 | static const char *cx18_i2c_id_name(u32 id) | ||
273 | { | ||
274 | int i; | ||
275 | |||
276 | for (i = 0; i < ARRAY_SIZE(hw_driverids); i++) | ||
277 | if (hw_driverids[i] == id) | ||
278 | return hw_devicenames[i]; | ||
279 | return "unknown device"; | ||
280 | } | ||
281 | |||
282 | /* Find the i2c device name matching the CX18_HW_ flag */ | 271 | /* Find the i2c device name matching the CX18_HW_ flag */ |
283 | static const char *cx18_i2c_hw_name(u32 hw) | 272 | static const char *cx18_i2c_hw_name(u32 hw) |
284 | { | 273 | { |
@@ -326,21 +315,6 @@ int cx18_i2c_hw(struct cx18 *cx, u32 hw, unsigned int cmd, void *arg) | |||
326 | return cx18_call_i2c_client(cx, addr, cmd, arg); | 315 | return cx18_call_i2c_client(cx, addr, cmd, arg); |
327 | } | 316 | } |
328 | 317 | ||
329 | /* Calls i2c device based on I2C driver ID. */ | ||
330 | int cx18_i2c_id(struct cx18 *cx, u32 id, unsigned int cmd, void *arg) | ||
331 | { | ||
332 | int addr; | ||
333 | |||
334 | addr = cx18_i2c_id_addr(cx, id); | ||
335 | if (addr < 0) { | ||
336 | if (cmd != VIDIOC_G_CHIP_IDENT) | ||
337 | CX18_ERR("i2c ID 0x%08x (%s) not found for cmd 0x%x!\n", | ||
338 | id, cx18_i2c_id_name(id), cmd); | ||
339 | return addr; | ||
340 | } | ||
341 | return cx18_call_i2c_client(cx, addr, cmd, arg); | ||
342 | } | ||
343 | |||
344 | /* broadcast cmd for all I2C clients and for the gpio subsystem */ | 318 | /* broadcast cmd for all I2C clients and for the gpio subsystem */ |
345 | void cx18_call_i2c_clients(struct cx18 *cx, unsigned int cmd, void *arg) | 319 | void cx18_call_i2c_clients(struct cx18 *cx, unsigned int cmd, void *arg) |
346 | { | 320 | { |