linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kronos <kronos@kronoz.cjb.net>
To: linux-fbdev-devel@lists.sourceforge.net
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	James Simmons <jsimmons@infradead.org>
Subject: [PATCH] 3/3 Add I2C/DDC support to radeonfb
Date: Fri, 22 Aug 2003 18:25:14 +0200	[thread overview]
Message-ID: <20030822162513.GD4279@dreamland.darkstar.lan> (raw)

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

             reply	other threads:[~2003-08-22 16:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-08-22 16:25 Kronos [this message]
2003-08-23  1:37 ` [PATCH] 3/3 Add I2C/DDC support to radeonfb Otto Solares

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030822162513.GD4279@dreamland.darkstar.lan \
    --to=kronos@kronoz.cjb.net \
    --cc=benh@kernel.crashing.org \
    --cc=jsimmons@infradead.org \
    --cc=linux-fbdev-devel@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).