linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] 3/3 Add I2C/DDC support to radeonfb
@ 2003-08-22 16:25 Kronos
  2003-08-23  1:37 ` Otto Solares
  0 siblings, 1 reply; 2+ messages in thread
From: Kronos @ 2003-08-22 16:25 UTC (permalink / raw)
  To: linux-fbdev-devel; +Cc: Benjamin Herrenschmidt, James Simmons

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

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

* Re: [PATCH] 3/3 Add I2C/DDC support to radeonfb
  2003-08-22 16:25 [PATCH] 3/3 Add I2C/DDC support to radeonfb Kronos
@ 2003-08-23  1:37 ` Otto Solares
  0 siblings, 0 replies; 2+ messages in thread
From: Otto Solares @ 2003-08-23  1:37 UTC (permalink / raw)
  To: Kronos; +Cc: linux-fbdev-devel, Benjamin Herrenschmidt, James Simmons

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

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

end of thread, other threads:[~2003-08-23  1:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-08-22 16:25 [PATCH] 3/3 Add I2C/DDC support to radeonfb Kronos
2003-08-23  1:37 ` Otto Solares

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).