From patchwork Tue Jan 12 15:00:52 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Kumar, Shobhit" X-Patchwork-Id: 8018021 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 7CBA59F1C0 for ; Tue, 12 Jan 2016 15:01:16 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B0A7B203DA for ; Tue, 12 Jan 2016 15:01:15 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 5A235203C2 for ; Tue, 12 Jan 2016 15:01:06 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CE0626E41A; Tue, 12 Jan 2016 07:01:05 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by gabe.freedesktop.org (Postfix) with ESMTP id 6D1BA6E41C for ; Tue, 12 Jan 2016 07:01:04 -0800 (PST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP; 12 Jan 2016 07:01:03 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,558,1444719600"; d="scan'208";a="858946871" Received: from skumar40-mobl.iind.intel.com ([10.223.182.243]) by orsmga001.jf.intel.com with ESMTP; 12 Jan 2016 07:01:00 -0800 From: Shobhit Kumar To: intel-gfx@lists.freedesktop.org Date: Tue, 12 Jan 2016 20:30:52 +0530 Message-Id: <1452610852-30149-4-git-send-email-shobhit.kumar@intel.com> X-Mailer: git-send-email 2.4.3 In-Reply-To: <1452610852-30149-1-git-send-email-shobhit.kumar@intel.com> References: <1452610852-30149-1-git-send-email-shobhit.kumar@intel.com> Subject: [Intel-gfx] [PATCH 3/3] drm/i915: Add support for LPSS PWM on devices that support it 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=-4.2 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 Cc: cbrookes@gmail.com Cc: jani.nikula@linux.intel.com Signed-off-by: Shobhit Kumar --- drivers/gpu/drm/i915/intel_panel.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/intel_panel.c b/drivers/gpu/drm/i915/intel_panel.c index 9e24c59..16473fa 100644 --- a/drivers/gpu/drm/i915/intel_panel.c +++ b/drivers/gpu/drm/i915/intel_panel.c @@ -36,6 +36,7 @@ #include "intel_drv.h" #define CRC_PMIC_PWM_PERIOD_NS 21333 +#define LPSS_PWM_PERIOD_NS 10240 /* CRC PMIC based PWM Information */ struct intel_pwm_info crc_pwm_info = { @@ -44,6 +45,13 @@ struct intel_pwm_info crc_pwm_info = { .dev = NULL, }; +/* LPSS based PWM Information */ +struct intel_pwm_info lpss_pwm_info = { + .period_ns = LPSS_PWM_PERIOD_NS, + .name = "pwm_lpss", + .dev = NULL, +}; + void intel_fixed_panel_mode(const struct drm_display_mode *fixed_mode, struct drm_display_mode *adjusted_mode) @@ -1639,10 +1647,16 @@ static int pwm_setup_backlight(struct intel_connector *connector, enum pipe pipe) { struct drm_device *dev = connector->base.dev; + struct drm_i915_private *dev_priv = to_i915(connector->base.dev); struct intel_panel *panel = &connector->panel; - struct intel_pwm_info *pwm = &crc_pwm_info; + struct intel_pwm_info *pwm; int retval; + if (dev_priv->vbt.dsi.config->pwm_blc == PPS_BLC_PMIC) + pwm = &crc_pwm_info; + else /* PPS_BLC_SOC */ + pwm = &lpss_pwm_info; + /* Get the PWM chip for backlight control */ pwm->dev = pwm_get(dev->dev, pwm->name); if (IS_ERR(pwm->dev)) {