From patchwork Tue Dec 22 09:37:56 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Y, Kishore" X-Patchwork-Id: 69253 X-Patchwork-Delegate: tomi.valkeinen@nokia.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.2) with ESMTP id nBM9bXsF019522 for ; Tue, 22 Dec 2009 09:37:34 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751433AbZLVJhd (ORCPT ); Tue, 22 Dec 2009 04:37:33 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751340AbZLVJhc (ORCPT ); Tue, 22 Dec 2009 04:37:32 -0500 Received: from devils.ext.ti.com ([198.47.26.153]:45848 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751291AbZLVJhb convert rfc822-to-8bit (ORCPT ); Tue, 22 Dec 2009 04:37:31 -0500 Received: from dbdp20.itg.ti.com ([172.24.170.38]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id nBM9bQZs005548 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 22 Dec 2009 03:37:29 -0600 Received: from dbde70.ent.ti.com (localhost [127.0.0.1]) by dbdp20.itg.ti.com (8.13.8/8.13.8) with ESMTP id nBM9bQba016304; Tue, 22 Dec 2009 15:07:26 +0530 (IST) Received: from dbde02.ent.ti.com ([172.24.170.145]) by dbde70.ent.ti.com ([172.24.170.148]) with mapi; Tue, 22 Dec 2009 15:07:26 +0530 From: "Y, Kishore" To: "Tomi Valkeinen (tomi.valkeinen@nokia.com)" , Kevin Hilman CC: "linux-omap@vger.kernel.org" Date: Tue, 22 Dec 2009 15:07:56 +0530 Subject: [PATCH 3/3] DSS2 sysfs enteries to export LPR enable to user Thread-Topic: [PATCH 3/3] DSS2 sysfs enteries to export LPR enable to user Thread-Index: AcqC6nDaWCoZTIFER1eSt8XlNjKCCw== Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org diff --git a/drivers/video/omap2/dss/display.c b/drivers/video/omap2/dss/display.c index 3b92b84..81fc70e 100644 --- a/drivers/video/omap2/dss/display.c +++ b/drivers/video/omap2/dss/display.c @@ -277,6 +277,28 @@ static ssize_t display_wss_store(struct device *dev, return size; } +unsigned long lpr_enable; +extern int omap_dispc_lpr_enable(void); +extern void omap_dispc_lpr_disable(void); + +static ssize_t display_lpr_store(struct device *dev, + struct device_attribute *attr, const char *buf, size_t size) +{ + lpr_enable = simple_strtoul(buf, NULL, 0); + if (lpr_enable) + omap_dispc_lpr_enable(); + else + omap_dispc_lpr_disable(); + + return size; +} + +static ssize_t display_lpr_show(struct device *dev, + struct device_attribute *attr, char *buf) +{ + return snprintf(buf, PAGE_SIZE, "%lu\n", lpr_enable); +} + static DEVICE_ATTR(enabled, S_IRUGO|S_IWUSR, display_enabled_show, display_enabled_store); static DEVICE_ATTR(update_mode, S_IRUGO|S_IWUSR, @@ -291,6 +313,8 @@ static DEVICE_ATTR(mirror, S_IRUGO|S_IWUSR, display_mirror_show, display_mirror_store); static DEVICE_ATTR(wss, S_IRUGO|S_IWUSR, display_wss_show, display_wss_store); +static DEVICE_ATTR(lpr_enable, S_IRUGO|S_IWUSR, + display_lpr_show, display_lpr_store); static struct device_attribute *display_sysfs_attrs[] = { &dev_attr_enabled, @@ -300,6 +324,7 @@ static struct device_attribute *display_sysfs_attrs[] = { &dev_attr_rotate, &dev_attr_mirror, &dev_attr_wss, + &dev_attr_lpr_enable, NULL };