From patchwork Wed May 31 09:27:51 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Kumar, Shobhit" X-Patchwork-Id: 9756401 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 150D9602BF for ; Wed, 31 May 2017 09:28:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 11EBC28481 for ; Wed, 31 May 2017 09:28:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0680428497; Wed, 31 May 2017 09:28:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A43FE28481 for ; Wed, 31 May 2017 09:28:14 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 471506E1B5; Wed, 31 May 2017 09:28:14 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by gabe.freedesktop.org (Postfix) with ESMTPS id 960496E1B3 for ; Wed, 31 May 2017 09:28:08 +0000 (UTC) Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 31 May 2017 02:28:04 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.38,422,1491289200"; d="scan'208";a="108623489" Received: from skumar40-mobl1.iind.intel.com ([10.66.192.168]) by fmsmga005.fm.intel.com with ESMTP; 31 May 2017 02:28:01 -0700 From: Shobhit Kumar To: intel-gfx@lists.freedesktop.org Date: Wed, 31 May 2017 14:57:51 +0530 Message-Id: <1496222871-12996-4-git-send-email-shobhit.kumar@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1496222871-12996-1-git-send-email-shobhit.kumar@intel.com> References: <1496222871-12996-1-git-send-email-shobhit.kumar@intel.com> MIME-Version: 1.0 Cc: daniel.vetter@intel.com, viric@viric.name, jari.tahvanainen@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: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP v2: Add bugzilla links Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96571 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90075 Cc: cbrookes@gmail.com Cc: jani.nikula@linux.intel.com Tested-by: LluĂ­s Batlle i Rossell 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 d56d1c2..4d84c561 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) @@ -1658,10 +1666,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)) {