Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[media] media: i2c: ths8200: support asynchronous probing

This patch supports both synchronous and asynchronous
ths8200 subdevice probing.

Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>

authored by

Lad, Prabhakar and committed by
Mauro Carvalho Chehab
ed29f894 9082a7c6

+8 -1
+8 -1
drivers/media/i2c/ths8200.c
··· 21 21 #include <linux/module.h> 22 22 #include <linux/v4l2-dv-timings.h> 23 23 24 + #include <media/v4l2-async.h> 24 25 #include <media/v4l2-device.h> 25 26 26 27 #include "ths8200_regs.h" ··· 501 500 { 502 501 struct ths8200_state *state; 503 502 struct v4l2_subdev *sd; 503 + int error; 504 504 505 505 /* Check if the adapter supports the needed features */ 506 506 if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE_DATA)) ··· 519 517 520 518 ths8200_core_init(sd); 521 519 520 + error = v4l2_async_register_subdev(&state->sd); 521 + if (error) 522 + return error; 523 + 522 524 v4l2_info(sd, "%s found @ 0x%x (%s)\n", client->name, 523 525 client->addr << 1, client->adapter->name); 524 526 ··· 532 526 static int ths8200_remove(struct i2c_client *client) 533 527 { 534 528 struct v4l2_subdev *sd = i2c_get_clientdata(client); 529 + struct ths8200_state *decoder = to_state(sd); 535 530 536 531 v4l2_dbg(1, debug, sd, "%s removed @ 0x%x (%s)\n", client->name, 537 532 client->addr << 1, client->adapter->name); 538 533 539 534 ths8200_s_power(sd, false); 540 - 535 + v4l2_async_unregister_subdev(&decoder->sd); 541 536 v4l2_device_unregister_subdev(sd); 542 537 543 538 return 0;