aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/omap2/displays/panel-taal.c
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2011-03-24 08:06:51 -0400
committerTomi Valkeinen <tomi.valkeinen@ti.com>2011-05-11 07:20:47 -0400
commit1f8fa452afe88b33cbfac6a82b0edd77a0644804 (patch)
treeb5a50fa60e40842c70b24117d3637f7c2efb2dbd /drivers/video/omap2/displays/panel-taal.c
parent1663d2f70a9404b822fb0e8fbc40d42fdfeed0bd (diff)
OMAP: DSS2: Taal: Add sysfs file for ESD interval
Implement sysfs support to configure the ESD interval. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/video/omap2/displays/panel-taal.c')
-rw-r--r--drivers/video/omap2/displays/panel-taal.c42
1 files changed, 42 insertions, 0 deletions
diff --git a/drivers/video/omap2/displays/panel-taal.c b/drivers/video/omap2/displays/panel-taal.c
index bbfd5feed33f..3f766035f885 100644
--- a/drivers/video/omap2/displays/panel-taal.c
+++ b/drivers/video/omap2/displays/panel-taal.c
@@ -635,18 +635,60 @@ static ssize_t show_cabc_available_modes(struct device *dev,
635 return len < PAGE_SIZE ? len : PAGE_SIZE - 1; 635 return len < PAGE_SIZE ? len : PAGE_SIZE - 1;
636} 636}
637 637
638static ssize_t taal_store_esd_interval(struct device *dev,
639 struct device_attribute *attr,
640 const char *buf, size_t count)
641{
642 struct omap_dss_device *dssdev = to_dss_device(dev);
643 struct taal_data *td = dev_get_drvdata(&dssdev->dev);
644
645 unsigned long t;
646 int r;
647
648 r = strict_strtoul(buf, 10, &t);
649 if (r)
650 return r;
651
652 mutex_lock(&td->lock);
653 taal_cancel_esd_work(dssdev);
654 td->esd_interval = t;
655 if (td->enabled)
656 taal_queue_esd_work(dssdev);
657 mutex_unlock(&td->lock);
658
659 return count;
660}
661
662static ssize_t taal_show_esd_interval(struct device *dev,
663 struct device_attribute *attr,
664 char *buf)
665{
666 struct omap_dss_device *dssdev = to_dss_device(dev);
667 struct taal_data *td = dev_get_drvdata(&dssdev->dev);
668 unsigned t;
669
670 mutex_lock(&td->lock);
671 t = td->esd_interval;
672 mutex_unlock(&td->lock);
673
674 return snprintf(buf, PAGE_SIZE, "%u\n", t);
675}
676
638static DEVICE_ATTR(num_dsi_errors, S_IRUGO, taal_num_errors_show, NULL); 677static DEVICE_ATTR(num_dsi_errors, S_IRUGO, taal_num_errors_show, NULL);
639static DEVICE_ATTR(hw_revision, S_IRUGO, taal_hw_revision_show, NULL); 678static DEVICE_ATTR(hw_revision, S_IRUGO, taal_hw_revision_show, NULL);
640static DEVICE_ATTR(cabc_mode, S_IRUGO | S_IWUSR, 679static DEVICE_ATTR(cabc_mode, S_IRUGO | S_IWUSR,
641 show_cabc_mode, store_cabc_mode); 680 show_cabc_mode, store_cabc_mode);
642static DEVICE_ATTR(cabc_available_modes, S_IRUGO, 681static DEVICE_ATTR(cabc_available_modes, S_IRUGO,
643 show_cabc_available_modes, NULL); 682 show_cabc_available_modes, NULL);
683static DEVICE_ATTR(esd_interval, S_IRUGO | S_IWUSR,
684 taal_show_esd_interval, taal_store_esd_interval);
644 685
645static struct attribute *taal_attrs[] = { 686static struct attribute *taal_attrs[] = {
646 &dev_attr_num_dsi_errors.attr, 687 &dev_attr_num_dsi_errors.attr,
647 &dev_attr_hw_revision.attr, 688 &dev_attr_hw_revision.attr,
648 &dev_attr_cabc_mode.attr, 689 &dev_attr_cabc_mode.attr,
649 &dev_attr_cabc_available_modes.attr, 690 &dev_attr_cabc_available_modes.attr,
691 &dev_attr_esd_interval.attr,
650 NULL, 692 NULL,
651}; 693};
652 694