Skip to contentSkip to conversation

media: i2c: add suppport for ths8200 encoder.

PATCH New Prabhakar Lad 1 participant 3 messages Jun 3, 2013 Media (V4L/DVB)

lore
Share & tools
lore
#0 lore raw

cover media: i2c: add suppport for ths8200 encoder.

From: Lad, Prabhakar <[email protected]>

The first patch of the series adds support for the THS8200 encoder The full datasheets are available from TI website[1]. The second patch of the series adds supports for v4l-async subdevice probing.

[1] http://www.ti.com/product/ths8200

Hans Verkuil (1):
media: i2c: ths8200: driver for TI video encoder.

Lad, Prabhakar (1):
media: i2c: ths8200: add support v4l-async

 drivers/media/i2c/Kconfig        |    9 +
 drivers/media/i2c/Makefile       |    1 +
 drivers/media/i2c/ths8200.c      |  568 ++++++++++++++++++++++++++++++++++++++
 drivers/media/i2c/ths8200_regs.h |  161 +++++++++++
 4 files changed, 739 insertions(+), 0 deletions(-)
 create mode 100644 drivers/media/i2c/ths8200.c
 create mode 100644 drivers/media/i2c/ths8200_regs.h
#1 lore raw

PATCH 1/2 media: i2c: ths8200: driver for TI video encoder.

From: Hans Verkuil <[email protected]>

The full datasheets are available from TI website:-

http://www.ti.com/product/ths8200

Note:- This patch adds support only for progressive format as of now.

---
 drivers/media/i2c/Kconfig        |    9 +
 drivers/media/i2c/Makefile       |    1 +
 drivers/media/i2c/ths8200.c      |  560 ++++++++++++++++++++++++++++++++++++++
 drivers/media/i2c/ths8200_regs.h |  161 +++++++++++
 4 files changed, 731 insertions(+), 0 deletions(-)
 create mode 100644 drivers/media/i2c/ths8200.c
 create mode 100644 drivers/media/i2c/ths8200_regs.h
drivers/media/i2c/Kconfig +9 -0
index f981d50..c897d42 100644
@@ -425,6 +425,15 @@ config VIDEO_AK881X
 	help
 	  Video output driver for AKM AK8813 and AK8814 TV encoders
 
+config VIDEO_THS8200
+	tristate "Texas Instruments THS8200 video encoder"
+	depends on VIDEO_V4L2 && I2C
+	---help---
+	  Support for the Texas Instruments THS8200 video encoder.
+
+	  To compile this driver as a module, choose M here: the
+	  module will be called ths8200.
+
 comment "Camera sensor devices"
 
 config VIDEO_APTINA_PLL
drivers/media/i2c/Makefile +1 -0
index 720f42d..936c4dd 100644
@@ -34,6 +34,7 @@ obj-$(CONFIG_VIDEO_BT856) += bt856.o
 obj-$(CONFIG_VIDEO_BT866) += bt866.o
 obj-$(CONFIG_VIDEO_KS0127) += ks0127.o
 obj-$(CONFIG_VIDEO_THS7303) += ths7303.o
+obj-$(CONFIG_VIDEO_THS8200) += ths8200.o
 obj-$(CONFIG_VIDEO_TVP5150) += tvp5150.o
 obj-$(CONFIG_VIDEO_TVP514X) += tvp514x.o
 obj-$(CONFIG_VIDEO_TVP7002) += tvp7002.o
drivers/media/i2c/ths8200.c new file +560 -0

560 lines not on this page · raw message

drivers/media/i2c/ths8200_regs.h new file +161 -0

161 lines not on this page · raw message

Signature · 1 line
1.7.0.4
#2 lore raw

PATCH 2/2 media: i2c: ths8200: add support v4l-async

In reply to Prabhakar Lad

From: Lad, Prabhakar <[email protected]>

This patch supports ths8200 driver for v4l-async subdevice probing.

---
 drivers/media/i2c/ths8200.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)
drivers/media/i2c/ths8200.c +9 -1
index 9396829..d1bddcc 100644
@@ -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"
@@ -504,6 +505,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))
@@ -521,6 +523,11 @@ static int ths8200_probe(struct i2c_client *client,
 
 	ths8200_core_init(sd);
 
+	state->sd.dev = &client->dev;
+	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);
 
@@ -530,12 +537,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;
Signature · 1 line
1.7.0.4