From patchwork Tue Jul 28 10:01:08 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Deepak M X-Patchwork-Id: 6882171 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id CABE69F749 for ; Tue, 28 Jul 2015 09:57:11 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D906F20684 for ; Tue, 28 Jul 2015 09:57:10 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 032DC20490 for ; Tue, 28 Jul 2015 09:57:10 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 50BA172071; Tue, 28 Jul 2015 02:57:09 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by gabe.freedesktop.org (Postfix) with ESMTP id 1AB657206E for ; Tue, 28 Jul 2015 02:57:08 -0700 (PDT) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga102.fm.intel.com with ESMTP; 28 Jul 2015 02:56:47 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,562,1432623600"; d="scan'208";a="614329504" Received: from mdeepakubuntudesk01-desktop.iind.intel.com ([10.223.25.91]) by orsmga003.jf.intel.com with ESMTP; 28 Jul 2015 02:56:46 -0700 From: Deepak M To: intel-gfx@lists.freedesktop.org Date: Tue, 28 Jul 2015 15:31:08 +0530 Message-Id: <1438077670-12953-8-git-send-email-m.deepak@intel.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1438077670-12953-1-git-send-email-m.deepak@intel.com> References: <1438077670-12953-1-git-send-email-m.deepak@intel.com> Cc: Deepak M Subject: [Intel-gfx] [MIPI SEQ PARSING v1 PATCH 7/9] drm: Add few more wrapper functions for drm panel X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Spam-Status: No, score=-5.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Currently there are few pair of functions which are called during the panel enable/disable sequence. To improve the granularity, adding few more wrapper functions so that the functions are more specific on what they are doing and also in some cases some specific operations have to be done between these functions. Signed-off-by: Deepak M Signed-off-by: Gaurav K Singh --- include/drm/drm_panel.h | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/include/drm/drm_panel.h b/include/drm/drm_panel.h index 13ff44b..c729f6d 100644 --- a/include/drm/drm_panel.h +++ b/include/drm/drm_panel.h @@ -73,6 +73,12 @@ struct drm_panel_funcs { int (*get_modes)(struct drm_panel *panel); int (*get_timings)(struct drm_panel *panel, unsigned int num_timings, struct display_timing *timings); + int (*power_on)(struct drm_panel *panel); + int (*power_off)(struct drm_panel *panel); + int (*backlight_on)(struct drm_panel *panel); + int (*backlight_off)(struct drm_panel *panel); + int (*get_info)(struct drm_panel *panel, + struct drm_connector *connector); }; struct drm_panel { @@ -117,6 +123,47 @@ static inline int drm_panel_enable(struct drm_panel *panel) return panel ? -ENOSYS : -EINVAL; } +static inline int drm_panel_power_on(struct drm_panel *panel) +{ + if (panel && panel->funcs && panel->funcs->power_on) + return panel->funcs->power_on(panel); + + return panel ? -ENOSYS : -EINVAL; +} + +static inline int drm_panel_power_off(struct drm_panel *panel) +{ + if (panel && panel->funcs && panel->funcs->power_off) + return panel->funcs->power_off(panel); + + return panel ? -ENOSYS : -EINVAL; +} + +static inline int drm_panel_backlight_on(struct drm_panel *panel) +{ + if (panel && panel->funcs && panel->funcs->backlight_on) + return panel->funcs->backlight_on(panel); + + return panel ? -ENOSYS : -EINVAL; +} + +static inline int drm_panel_backlight_off(struct drm_panel *panel) +{ + if (panel && panel->funcs && panel->funcs->backlight_off) + return panel->funcs->backlight_off(panel); + + return panel ? -ENOSYS : -EINVAL; +} + +static inline int drm_panel_get_info(struct drm_panel *panel, + struct drm_connector *connector) +{ + if (connector && panel && panel->funcs && panel->funcs->get_info) + return panel->funcs->get_info(panel, connector); + + return panel ? -ENOSYS : -EINVAL; +} + static inline int drm_panel_get_modes(struct drm_panel *panel) { if (panel && panel->funcs && panel->funcs->get_modes)