devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] media: i2c: ths8200: Feature enhancement
@ 2013-06-22  9:46 Prabhakar Lad
  2013-06-22  9:46 ` [PATCH 1/2] media: i2c: ths8200: support asynchronous probing Prabhakar Lad
  2013-06-22  9:46 ` [PATCH 2/2] media: i2c: ths8200: add OF support Prabhakar Lad
  0 siblings, 2 replies; 3+ messages in thread
From: Prabhakar Lad @ 2013-06-22  9:46 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, LMML, Hans Verkuil, Laurent Pinchart
  Cc: DLOS, LKML, Grant Likely, Rob Herring, Rob Landley,
	devicetree-discuss, linux-doc, Lad, Prabhakar

From: "Lad, Prabhakar" <prabhakar.csengg@gmail.com>

The first patch of the series adds supports for asynchronous subdev
registration for ths8200 driver, and the second patch of the series
adds OF support the driver.

Lad, Prabhakar (2):
  media: i2c: ths8200: support asynchronous probing
  media: i2c: ths8200: add OF support

 .../devicetree/bindings/media/i2c/ths8200.txt      |   19 +++++++++++++++++++
 drivers/media/i2c/ths8200.c                        |   18 +++++++++++++++++-
 2 files changed, 36 insertions(+), 1 deletion(-)
 create mode 100644 Documentation/devicetree/bindings/media/i2c/ths8200.txt

-- 
1.7.9.5


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 1/2] media: i2c: ths8200: support asynchronous probing
  2013-06-22  9:46 [PATCH 0/2] media: i2c: ths8200: Feature enhancement Prabhakar Lad
@ 2013-06-22  9:46 ` Prabhakar Lad
  2013-06-22  9:46 ` [PATCH 2/2] media: i2c: ths8200: add OF support Prabhakar Lad
  1 sibling, 0 replies; 3+ messages in thread
From: Prabhakar Lad @ 2013-06-22  9:46 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, LMML, Hans Verkuil, Laurent Pinchart
  Cc: DLOS, LKML, Grant Likely, Rob Herring, Rob Landley,
	devicetree-discuss, linux-doc, Lad, Prabhakar

From: "Lad, Prabhakar" <prabhakar.csengg@gmail.com>

This patch supports both synchronous and asynchronous
ths8200 subdevice probing.

Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
---
 drivers/media/i2c/ths8200.c |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/media/i2c/ths8200.c b/drivers/media/i2c/ths8200.c
index a24f90c..cc1339a 100644
--- a/drivers/media/i2c/ths8200.c
+++ b/drivers/media/i2c/ths8200.c
@@ -21,6 +21,7 @@
 #include <linux/module.h>
 #include <linux/v4l2-dv-timings.h>
 
+#include <media/v4l2-async.h>
 #include <media/v4l2-device.h>
 
 #include "ths8200_regs.h"
@@ -500,6 +501,7 @@ static int ths8200_probe(struct i2c_client *client,
 {
 	struct ths8200_state *state;
 	struct v4l2_subdev *sd;
+	int error;
 
 	/* Check if the adapter supports the needed features */
 	if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE_DATA))
@@ -517,6 +519,10 @@ static int ths8200_probe(struct i2c_client *client,
 
 	ths8200_core_init(sd);
 
+	error = v4l2_async_register_subdev(&state->sd);
+	if (error)
+		return error;
+
 	v4l2_info(sd, "%s found @ 0x%x (%s)\n", client->name,
 		  client->addr << 1, client->adapter->name);
 
@@ -526,12 +532,13 @@ static int ths8200_probe(struct i2c_client *client,
 static int ths8200_remove(struct i2c_client *client)
 {
 	struct v4l2_subdev *sd = i2c_get_clientdata(client);
+	struct ths8200_state *decoder = to_state(sd);
 
 	v4l2_dbg(1, debug, sd, "%s removed @ 0x%x (%s)\n", client->name,
 		 client->addr << 1, client->adapter->name);
 
 	ths8200_s_power(sd, false);
-
+	v4l2_async_unregister_subdev(&decoder->sd);
 	v4l2_device_unregister_subdev(sd);
 
 	return 0;
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] media: i2c: ths8200: add OF support
  2013-06-22  9:46 [PATCH 0/2] media: i2c: ths8200: Feature enhancement Prabhakar Lad
  2013-06-22  9:46 ` [PATCH 1/2] media: i2c: ths8200: support asynchronous probing Prabhakar Lad
@ 2013-06-22  9:46 ` Prabhakar Lad
  1 sibling, 0 replies; 3+ messages in thread
From: Prabhakar Lad @ 2013-06-22  9:46 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, LMML, Hans Verkuil, Laurent Pinchart
  Cc: DLOS, LKML, Grant Likely, Rob Herring, Rob Landley,
	devicetree-discuss, linux-doc, Lad, Prabhakar

From: "Lad, Prabhakar" <prabhakar.csengg@gmail.com>

add OF support for the ths8200 driver.

Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
---
 .../devicetree/bindings/media/i2c/ths8200.txt      |   19 +++++++++++++++++++
 drivers/media/i2c/ths8200.c                        |    9 +++++++++
 2 files changed, 28 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/media/i2c/ths8200.txt

diff --git a/Documentation/devicetree/bindings/media/i2c/ths8200.txt b/Documentation/devicetree/bindings/media/i2c/ths8200.txt
new file mode 100644
index 0000000..285f6ae
--- /dev/null
+++ b/Documentation/devicetree/bindings/media/i2c/ths8200.txt
@@ -0,0 +1,19 @@
+* Texas Instruments THS8200 video encoder
+
+The ths8200 device is a digital to analog converter used in DVD players, video
+recorders, set-top boxes.
+
+Required Properties :
+- compatible : value must be "ti,ths8200"
+
+Example:
+
+	i2c0@1c22000 {
+		...
+		...
+		ths8200@5c {
+			compatible = "ti,ths8200";
+			reg = <0x5c>;
+		};
+		...
+	};
diff --git a/drivers/media/i2c/ths8200.c b/drivers/media/i2c/ths8200.c
index cc1339a..8a29810 100644
--- a/drivers/media/i2c/ths8200.c
+++ b/drivers/media/i2c/ths8200.c
@@ -550,10 +550,19 @@ static struct i2c_device_id ths8200_id[] = {
 };
 MODULE_DEVICE_TABLE(i2c, ths8200_id);
 
+#if IS_ENABLED(CONFIG_OF)
+static const struct of_device_id ths8200_of_match[] = {
+	{ .compatible = "ti,ths8200", },
+	{ /* sentinel */ },
+};
+MODULE_DEVICE_TABLE(of, ths8200_of_match);
+#endif
+
 static struct i2c_driver ths8200_driver = {
 	.driver = {
 		.owner = THIS_MODULE,
 		.name = "ths8200",
+		.of_match_table = of_match_ptr(ths8200_of_match),
 	},
 	.probe = ths8200_probe,
 	.remove = ths8200_remove,
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-06-22  9:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-22  9:46 [PATCH 0/2] media: i2c: ths8200: Feature enhancement Prabhakar Lad
2013-06-22  9:46 ` [PATCH 1/2] media: i2c: ths8200: support asynchronous probing Prabhakar Lad
2013-06-22  9:46 ` [PATCH 2/2] media: i2c: ths8200: add OF support Prabhakar Lad

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).