[PATCH] 3/3 Add I2C/DDC support to radeonfb

STALE8413d

2 messages, 2 authors, 2003-08-23 · open the first message on its own page

[PATCH] 3/3 Add I2C/DDC support to radeonfb

From: Kronos <hidden>
Date: 2003-08-22 16:26:24

Export EDID data through sysfs.

--- linux-2.6.vanilla/drivers/video/radeonfb.c	Fri Aug 22 17:36:29 2003
+++ linux-2.6/drivers/video/radeonfb.c	Fri Aug 22 17:36:52 2003
@@ -434,6 +434,36 @@
 };
 
 /*
+ * Sysfs
+ */
+
+ssize_t radeonfb_show_edid(struct kobject *kobj, char *buf, loff_t off, size_t count) {
+	struct device *dev = container_of(kobj, struct device, kobj);
+	struct pci_dev *pdev = to_pci_dev(dev);
+	struct radeonfb_info *rinfo = pci_get_drvdata(pdev);
+
+	if (off > EDID_LENGTH)
+		return 0;
+
+	if (off + count > EDID_LENGTH)
+		count = EDID_LENGTH - off;
+
+	memcpy(buf, rinfo->EDID + off, count);
+
+	return count;
+}
+
+static struct bin_attribute edid_attr = {
+	.attr   = {
+		.name	= "edid",
+		.owner	= THIS_MODULE,
+		.mode	= 0444,
+	},
+	.size	= EDID_LENGTH,
+	.read	= radeonfb_show_edid,
+};
+
+/*
  * IO macros
  */
 
@@ -3275,6 +3305,8 @@
 				rinfo->modedb = db;
 				rinfo->dbsize = i;
 			}
+
+			sysfs_create_bin_file(&rinfo->pdev->dev.kobj, &edid_attr);
 		}
 
 		show_edid(rinfo->EDID);


-- 
Reply-To: kronos@kronoz.cjb.net
Home: http://kronoz.cjb.net
Non capisco tutta questa eccitazione per il Multitasking: 
io sono anni che leggo in bagno.


-------------------------------------------------------
This SF.net email is sponsored by: VM Ware
With VMware you can run multiple operating systems on a single machine.
WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines
at the same time. Free trial click here:http://www.vmware.com/wl/offer/358/0

Re: [PATCH] 3/3 Add I2C/DDC support to radeonfb

From: Otto Solares <hidden>
Date: 2003-08-23 01:43:40

On Fri, Aug 22, 2003 at 06:25:14PM +0200, Kronos wrote:
Export EDID data through sysfs.
nice! hopefully fbdev drivers follow the same schema.

-solca



-------------------------------------------------------
This SF.net email is sponsored by: VM Ware
With VMware you can run multiple operating systems on a single machine.
WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines
at the same time. Free trial click here:http://www.vmware.com/wl/offer/358/0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help