From patchwork Thu May 30 09:34:45 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 2634681 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 4D86CDF2A1 for ; Thu, 30 May 2013 09:36:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030379Ab3E3JgE (ORCPT ); Thu, 30 May 2013 05:36:04 -0400 Received: from arroyo.ext.ti.com ([192.94.94.40]:41389 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030362Ab3E3Jfx (ORCPT ); Thu, 30 May 2013 05:35:53 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id r4U9ZrG7028983; Thu, 30 May 2013 04:35:53 -0500 Received: from DFLE72.ent.ti.com (dfle72.ent.ti.com [128.247.5.109]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id r4U9ZrBh005743; Thu, 30 May 2013 04:35:53 -0500 Received: from dlelxv22.itg.ti.com (172.17.1.197) by DFLE72.ent.ti.com (128.247.5.109) with Microsoft SMTP Server id 14.2.342.3; Thu, 30 May 2013 04:35:52 -0500 Received: from deskari.tieu.ti.com (h64-9.vpn.ti.com [172.24.64.9]) by dlelxv22.itg.ti.com (8.13.8/8.13.8) with ESMTP id r4U9ZJ1w002669; Thu, 30 May 2013 04:35:52 -0500 From: Tomi Valkeinen To: , , Archit Taneja CC: Tomi Valkeinen Subject: [PATCH 24/32] OMAPDSS: implement display sysfs without dss bus Date: Thu, 30 May 2013 12:34:45 +0300 Message-ID: <1369906493-27538-25-git-send-email-tomi.valkeinen@ti.com> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1369906493-27538-1-git-send-email-tomi.valkeinen@ti.com> References: <1369906493-27538-1-git-send-email-tomi.valkeinen@ti.com> MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org We aim to remove the custom omapdss bus totally, as it's quite a strange construct and won't be compatible with common display framework. One problem on the road is that we have sysfs files for each display, and they depend on the omapdss bus. This patch creates the display sysfs files independent of the omapdss bus. This gives us backwards compatibility without using the omapdss bus for the sysfs files. Signed-off-by: Tomi Valkeinen --- drivers/video/omap2/dss/apply.c | 15 ++-- drivers/video/omap2/dss/core.c | 28 ------- drivers/video/omap2/dss/display-sysfs.c | 125 ++++++++++++++++++-------------- drivers/video/omap2/dss/dss.h | 6 +- 4 files changed, 79 insertions(+), 95 deletions(-) diff --git a/drivers/video/omap2/dss/apply.c b/drivers/video/omap2/dss/apply.c index dbd3c2f..ced656a 100644 --- a/drivers/video/omap2/dss/apply.c +++ b/drivers/video/omap2/dss/apply.c @@ -1581,7 +1581,6 @@ static DEFINE_MUTEX(compat_init_lock); int omapdss_compat_init(void) { struct platform_device *pdev = dss_get_core_pdev(); - struct omap_dss_device *dssdev = NULL; int i, r; mutex_lock(&compat_init_lock); @@ -1627,12 +1626,9 @@ int omapdss_compat_init(void) if (r) goto err_mgr_ops; - for_each_dss_dev(dssdev) { - r = display_init_sysfs(pdev, dssdev); - /* XXX uninit sysfs files on error */ - if (r) - goto err_disp_sysfs; - } + r = display_init_sysfs(pdev); + if (r) + goto err_disp_sysfs; dispc_runtime_get(); @@ -1649,6 +1645,7 @@ out: err_init_irq: dispc_runtime_put(); + display_uninit_sysfs(pdev); err_disp_sysfs: dss_uninstall_mgr_ops(); @@ -1668,7 +1665,6 @@ EXPORT_SYMBOL(omapdss_compat_init); void omapdss_compat_uninit(void) { struct platform_device *pdev = dss_get_core_pdev(); - struct omap_dss_device *dssdev = NULL; mutex_lock(&compat_init_lock); @@ -1677,8 +1673,7 @@ void omapdss_compat_uninit(void) dss_dispc_uninitialize_irq(); - for_each_dss_dev(dssdev) - display_uninit_sysfs(pdev, dssdev); + display_uninit_sysfs(pdev); dss_uninstall_mgr_ops(); diff --git a/drivers/video/omap2/dss/core.c b/drivers/video/omap2/dss/core.c index 186bc76..e88d5f0 100644 --- a/drivers/video/omap2/dss/core.c +++ b/drivers/video/omap2/dss/core.c @@ -284,37 +284,9 @@ static int dss_bus_match(struct device *dev, struct device_driver *driver) return strcmp(dssdev->driver_name, driver->name) == 0; } -static ssize_t device_name_show(struct device *dev, - struct device_attribute *attr, char *buf) -{ - struct omap_dss_device *dssdev = to_dss_device(dev); - return snprintf(buf, PAGE_SIZE, "%s\n", - dssdev->name ? - dssdev->name : ""); -} - -static struct device_attribute default_dev_attrs[] = { - __ATTR(name, S_IRUGO, device_name_show, NULL), - __ATTR_NULL, -}; - -static ssize_t driver_name_show(struct device_driver *drv, char *buf) -{ - struct omap_dss_driver *dssdrv = to_dss_driver(drv); - return snprintf(buf, PAGE_SIZE, "%s\n", - dssdrv->driver.name ? - dssdrv->driver.name : ""); -} -static struct driver_attribute default_drv_attrs[] = { - __ATTR(name, S_IRUGO, driver_name_show, NULL), - __ATTR_NULL, -}; - static struct bus_type dss_bus_type = { .name = "omapdss", .match = dss_bus_match, - .dev_attrs = default_dev_attrs, - .drv_attrs = default_drv_attrs, }; static void dss_bus_release(struct device *dev) diff --git a/drivers/video/omap2/dss/display-sysfs.c b/drivers/video/omap2/dss/display-sysfs.c index 81d5dc6..58abbaf 100644 --- a/drivers/video/omap2/dss/display-sysfs.c +++ b/drivers/video/omap2/dss/display-sysfs.c @@ -22,17 +22,40 @@ #include #include -#include #include +#include #include