Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 219772
b: refs/heads/master
c: 8ef8cc4
h: refs/heads/master
v: v3
  • Loading branch information
Bernie Thompson authored and Greg Kroah-Hartman committed Sep 5, 2010
1 parent 6987709 commit 23a9ac7
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1572f91cffd7c0d64ab4e0cec71e1d2d1a3349e1
refs/heads/master: 8ef8cc4fca4a92e77c0b5aa7a852a6c3d2fba844
28 changes: 26 additions & 2 deletions trunk/drivers/staging/udlfb/udlfb.c
Original file line number Diff line number Diff line change
Expand Up @@ -1306,6 +1306,29 @@ static ssize_t edid_show(
return count;
}

static ssize_t edid_store(
struct file *filp,
struct kobject *kobj, struct bin_attribute *a,
char *src, loff_t src_off, size_t src_size) {
struct device *fbdev = container_of(kobj, struct device, kobj);
struct fb_info *fb_info = dev_get_drvdata(fbdev);
struct dlfb_data *dev = fb_info->par;

/* We only support write of entire EDID at once, no offset*/
if ((src_size < MIN_EDID_SIZE) ||
(src_size > MAX_EDID_SIZE) ||
(src_off != 0))
return 0;

dlfb_setup_modes(dev, fb_info, src, src_size);

if (dev->edid && (memcmp(src, dev->edid, src_size) == 0)) {
dl_info("sysfs written EDID is new default\n");
dlfb_ops_set_par(fb_info);
return src_size;
} else
return 0;
}

static ssize_t metrics_reset_store(struct device *fbdev,
struct device_attribute *attr,
Expand Down Expand Up @@ -1348,9 +1371,10 @@ static ssize_t use_defio_store(struct device *fbdev,

static struct bin_attribute edid_attr = {
.attr.name = "edid",
.attr.mode = 0444,
.size = 128,
.attr.mode = 0666,
.size = MAX_EDID_SIZE,
.read = edid_show,
.write = edid_store
};

static struct device_attribute fb_device_attrs[] = {
Expand Down

0 comments on commit 23a9ac7

Please sign in to comment.