Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 310325
b: refs/heads/master
c: 0aca3c6
h: refs/heads/master
i:
  310323: 39bd903
v: v3
  • Loading branch information
Grazvydas Ignotas authored and Tomi Valkeinen committed May 11, 2012
1 parent fecb29d commit e4f95c5
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 2 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: 9b71fb5cbcdd83c65e5fe6db9cd12246f7ea0262
refs/heads/master: 0aca3c63e068e47616bdd54b9d19e4771db86e8e
1 change: 1 addition & 0 deletions trunk/Documentation/arm/OMAP/DSS
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ timings Display timings (pixclock,xres/hfp/hbp/hsw,yres/vfp/vbp/vsw)
"pal" and "ntsc"
panel_name
tear_elim Tearing elimination 0=off, 1=on
output_type Output type (video encoder only): "composite" or "svideo"

There are also some debugfs files at <debugfs>/omapdss/ which show information
about clocks and registers.
Expand Down
54 changes: 53 additions & 1 deletion trunk/drivers/video/omap2/dss/venc.c
Original file line number Diff line number Diff line change
Expand Up @@ -490,16 +490,68 @@ unsigned long venc_get_pixel_clock(void)
return 13500000;
}

static ssize_t display_output_type_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
struct omap_dss_device *dssdev = to_dss_device(dev);
const char *ret;

switch (dssdev->phy.venc.type) {
case OMAP_DSS_VENC_TYPE_COMPOSITE:
ret = "composite";
break;
case OMAP_DSS_VENC_TYPE_SVIDEO:
ret = "svideo";
break;
default:
return -EINVAL;
}

return snprintf(buf, PAGE_SIZE, "%s\n", ret);
}

static ssize_t display_output_type_store(struct device *dev,
struct device_attribute *attr, const char *buf, size_t size)
{
struct omap_dss_device *dssdev = to_dss_device(dev);
enum omap_dss_venc_type new_type;

if (sysfs_streq("composite", buf))
new_type = OMAP_DSS_VENC_TYPE_COMPOSITE;
else if (sysfs_streq("svideo", buf))
new_type = OMAP_DSS_VENC_TYPE_SVIDEO;
else
return -EINVAL;

mutex_lock(&venc.venc_lock);

if (dssdev->phy.venc.type != new_type) {
dssdev->phy.venc.type = new_type;
if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE) {
venc_power_off(dssdev);
venc_power_on(dssdev);
}
}

mutex_unlock(&venc.venc_lock);

return size;
}

static DEVICE_ATTR(output_type, S_IRUGO | S_IWUSR,
display_output_type_show, display_output_type_store);

/* driver */
static int venc_panel_probe(struct omap_dss_device *dssdev)
{
dssdev->panel.timings = omap_dss_pal_timings;

return 0;
return device_create_file(&dssdev->dev, &dev_attr_output_type);
}

static void venc_panel_remove(struct omap_dss_device *dssdev)
{
device_remove_file(&dssdev->dev, &dev_attr_output_type);
}

static int venc_panel_enable(struct omap_dss_device *dssdev)
Expand Down

0 comments on commit e4f95c5

Please sign in to comment.