diff options
-rw-r--r-- | Documentation/arm/OMAP/DSS | 1 | ||||
-rw-r--r-- | drivers/video/omap2/dss/venc.c | 54 |
2 files changed, 54 insertions, 1 deletions
diff --git a/Documentation/arm/OMAP/DSS b/Documentation/arm/OMAP/DSS index 888ae7b83ae4..d0aea9192204 100644 --- a/Documentation/arm/OMAP/DSS +++ b/Documentation/arm/OMAP/DSS | |||
@@ -156,6 +156,7 @@ timings Display timings (pixclock,xres/hfp/hbp/hsw,yres/vfp/vbp/vsw) | |||
156 | "pal" and "ntsc" | 156 | "pal" and "ntsc" |
157 | panel_name | 157 | panel_name |
158 | tear_elim Tearing elimination 0=off, 1=on | 158 | tear_elim Tearing elimination 0=off, 1=on |
159 | output_type Output type (video encoder only): "composite" or "svideo" | ||
159 | 160 | ||
160 | There are also some debugfs files at <debugfs>/omapdss/ which show information | 161 | There are also some debugfs files at <debugfs>/omapdss/ which show information |
161 | about clocks and registers. | 162 | about clocks and registers. |
diff --git a/drivers/video/omap2/dss/venc.c b/drivers/video/omap2/dss/venc.c index e2374645a442..9475e6edce68 100644 --- a/drivers/video/omap2/dss/venc.c +++ b/drivers/video/omap2/dss/venc.c | |||
@@ -490,16 +490,68 @@ unsigned long venc_get_pixel_clock(void) | |||
490 | return 13500000; | 490 | return 13500000; |
491 | } | 491 | } |
492 | 492 | ||
493 | static ssize_t display_output_type_show(struct device *dev, | ||
494 | struct device_attribute *attr, char *buf) | ||
495 | { | ||
496 | struct omap_dss_device *dssdev = to_dss_device(dev); | ||
497 | const char *ret; | ||
498 | |||
499 | switch (dssdev->phy.venc.type) { | ||
500 | case OMAP_DSS_VENC_TYPE_COMPOSITE: | ||
501 | ret = "composite"; | ||
502 | break; | ||
503 | case OMAP_DSS_VENC_TYPE_SVIDEO: | ||
504 | ret = "svideo"; | ||
505 | break; | ||
506 | default: | ||
507 | return -EINVAL; | ||
508 | } | ||
509 | |||
510 | return snprintf(buf, PAGE_SIZE, "%s\n", ret); | ||
511 | } | ||
512 | |||
513 | static ssize_t display_output_type_store(struct device *dev, | ||
514 | struct device_attribute *attr, const char *buf, size_t size) | ||
515 | { | ||
516 | struct omap_dss_device *dssdev = to_dss_device(dev); | ||
517 | enum omap_dss_venc_type new_type; | ||
518 | |||
519 | if (sysfs_streq("composite", buf)) | ||
520 | new_type = OMAP_DSS_VENC_TYPE_COMPOSITE; | ||
521 | else if (sysfs_streq("svideo", buf)) | ||
522 | new_type = OMAP_DSS_VENC_TYPE_SVIDEO; | ||
523 | else | ||
524 | return -EINVAL; | ||
525 | |||
526 | mutex_lock(&venc.venc_lock); | ||
527 | |||
528 | if (dssdev->phy.venc.type != new_type) { | ||
529 | dssdev->phy.venc.type = new_type; | ||
530 | if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE) { | ||
531 | venc_power_off(dssdev); | ||
532 | venc_power_on(dssdev); | ||
533 | } | ||
534 | } | ||
535 | |||
536 | mutex_unlock(&venc.venc_lock); | ||
537 | |||
538 | return size; | ||
539 | } | ||
540 | |||
541 | static DEVICE_ATTR(output_type, S_IRUGO | S_IWUSR, | ||
542 | display_output_type_show, display_output_type_store); | ||
543 | |||
493 | /* driver */ | 544 | /* driver */ |
494 | static int venc_panel_probe(struct omap_dss_device *dssdev) | 545 | static int venc_panel_probe(struct omap_dss_device *dssdev) |
495 | { | 546 | { |
496 | dssdev->panel.timings = omap_dss_pal_timings; | 547 | dssdev->panel.timings = omap_dss_pal_timings; |
497 | 548 | ||
498 | return 0; | 549 | return device_create_file(&dssdev->dev, &dev_attr_output_type); |
499 | } | 550 | } |
500 | 551 | ||
501 | static void venc_panel_remove(struct omap_dss_device *dssdev) | 552 | static void venc_panel_remove(struct omap_dss_device *dssdev) |
502 | { | 553 | { |
554 | device_remove_file(&dssdev->dev, &dev_attr_output_type); | ||
503 | } | 555 | } |
504 | 556 | ||
505 | static int venc_panel_enable(struct omap_dss_device *dssdev) | 557 | static int venc_panel_enable(struct omap_dss_device *dssdev) |