From patchwork Wed May 31 09:27:50 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Kumar, Shobhit" X-Patchwork-Id: 9756403 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 B0EB5602BF for ; Wed, 31 May 2017 09:28:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AFA2928481 for ; Wed, 31 May 2017 09:28:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A32AC28497; Wed, 31 May 2017 09:28:16 +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 657FC28481 for ; Wed, 31 May 2017 09:28:16 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 79DEF6E1B8; 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 B6E6B6E1B5 for ; Wed, 31 May 2017 09:28:07 +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:01 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.38,422,1491289200"; d="scan'208";a="108623460" Received: from skumar40-mobl1.iind.intel.com ([10.66.192.168]) by fmsmga005.fm.intel.com with ESMTP; 31 May 2017 02:27:58 -0700 From: Shobhit Kumar To: intel-gfx@lists.freedesktop.org Date: Wed, 31 May 2017 14:57:50 +0530 Message-Id: <1496222871-12996-3-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 2/3] pwm: lpss: Add intel-gfx as consumer device in lookup table 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: Rebase on latest code and correct the device name in lookup table (viric) Remove lookup table on driver remove 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/pwm/pwm-lpss-platform.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/pwm/pwm-lpss-platform.c b/drivers/pwm/pwm-lpss-platform.c index 5d6ed15..f157a6d 100644 --- a/drivers/pwm/pwm-lpss-platform.c +++ b/drivers/pwm/pwm-lpss-platform.c @@ -40,6 +40,11 @@ static const struct pwm_lpss_boardinfo pwm_lpss_bxt_info = { .bypass = true, }; +/* PWM consumed by the Intel GFX */ +static struct pwm_lookup lpss_pwm_lookup[] = { + PWM_LOOKUP("80860F09:00", 0, "0000:00:02.0", "pwm_lpss", 0, PWM_POLARITY_NORMAL), +}; + static int pwm_lpss_probe_platform(struct platform_device *pdev) { const struct pwm_lpss_boardinfo *info; @@ -60,6 +65,9 @@ static int pwm_lpss_probe_platform(struct platform_device *pdev) platform_set_drvdata(pdev, lpwm); + /* Register intel-gfx device as allowed consumer */ + pwm_add_table(lpss_pwm_lookup, ARRAY_SIZE(lpss_pwm_lookup)); + pm_runtime_set_active(&pdev->dev); pm_runtime_enable(&pdev->dev); @@ -71,6 +79,10 @@ static int pwm_lpss_remove_platform(struct platform_device *pdev) struct pwm_lpss_chip *lpwm = platform_get_drvdata(pdev); pm_runtime_disable(&pdev->dev); + + /* remove lookup table */ + pwm_remove_table(lpss_pwm_lookup, ARRAY_SIZE(lpss_pwm_lookup)); + return pwm_lpss_remove(lpwm); }