[PATCH v2 05/19] drm: sti: add I2C client driver for HDMI

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Add I2C client driver to retrieve EDID.

Signed-off-by: Benjamin Gaignard <benjamin.gaignard@xxxxxxxxxx>
Signed-off-by: Vincent Abriou <vincent.abriou@xxxxxx>
Signed-off-by: Fabien Dessenne <fabien.dessenne@xxxxxx>
---
 drivers/gpu/drm/sti/Makefile  |  3 ++-
 drivers/gpu/drm/sti/sti_ddc.c | 56 +++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 58 insertions(+), 1 deletion(-)
 create mode 100644 drivers/gpu/drm/sti/sti_ddc.c

diff --git a/drivers/gpu/drm/sti/Makefile b/drivers/gpu/drm/sti/Makefile
index 5295fc7..6c474eb 100644
--- a/drivers/gpu/drm/sti/Makefile
+++ b/drivers/gpu/drm/sti/Makefile
@@ -2,7 +2,8 @@ ccflags-y := -Iinclude/drm
 
 stidrm-y := sti_hdmi.o \
 			sti_hdmi_tx3g0c55phy.o \
-			sti_hdmi_tx3g4c28phy.o
+			sti_hdmi_tx3g4c28phy.o \
+			sti_ddc.o
 
 obj-$(CONFIG_VTAC_STI) += sti_vtac_tx.o sti_vtac_rx.o
 obj-$(CONFIG_VTG_STI) += sti_vtg.o sti_vtg_utils.o
diff --git a/drivers/gpu/drm/sti/sti_ddc.c b/drivers/gpu/drm/sti/sti_ddc.c
new file mode 100644
index 0000000..147a704
--- /dev/null
+++ b/drivers/gpu/drm/sti/sti_ddc.c
@@ -0,0 +1,56 @@
+/*
+ * Copyright (C) STMicroelectronics SA 2013
+ * Author: Benjamin Gaignard <benjamin.gaignard@xxxxxx> for STMicroelectronics.
+ * License terms:  GNU General Public License (GPL), version 2
+ */
+#include <drm/drmP.h>
+
+#include <linux/kernel.h>
+#include <linux/i2c.h>
+#include <linux/module.h>
+
+#include "sti_hdmi.h"
+
+static int sti_hdmi_ddc_probe(struct i2c_client *client,
+			      const struct i2c_device_id *dev_id)
+{
+	sti_hdmi_attach_ddc_client(client);
+
+	DRM_INFO("%s attached %s into i2c adapter successfully\n",
+		 __func__, client->name);
+
+	return 0;
+}
+
+static int sti_hdmi_ddc_remove(struct i2c_client *client)
+{
+	DRM_INFO("%s detached %s from i2c adapter successfully\n",
+		 __func__, client->name);
+
+	return 0;
+}
+
+static struct i2c_device_id sti_ddc_idtable[] = {
+	{"sti-hdmiddc", 0},
+	{},
+};
+
+static struct of_device_id hdmiddc_match_types[] = {
+	{
+	 .compatible = "st,sti-hdmiddc",
+	 }, {
+	     /* end node */
+	     }
+};
+
+struct i2c_driver ddc_driver = {
+	.driver = {
+		   .name = "sti-hdmiddc",
+		   .owner = THIS_MODULE,
+		   .of_match_table = of_match_ptr(hdmiddc_match_types),
+		   },
+	.id_table = sti_ddc_idtable,
+	.probe = sti_hdmi_ddc_probe,
+	.remove = sti_hdmi_ddc_remove,
+	.command = NULL,
+};
-- 
1.9.1

_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux