[Intel-gfx] [PATCH 2/3] pwm: lpss: Add intel-gfx as consumer device in lookup table

Shobhit Kumar shobhit.kumar at intel.com
Wed May 31 09:27:50 UTC 2017


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 at gmail.com
Cc: jani.nikula at linux.intel.com
Tested-by: LluĂ­s Batlle i Rossell <viric at viric.name>
Signed-off-by: Shobhit Kumar <shobhit.kumar at intel.com>
---
 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);
 }
 
-- 
2.7.4



More information about the Intel-gfx mailing list