hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/drivers/mfd/intel_soc_pmic_core.c
....@@ -1,51 +1,31 @@
1
+// SPDX-License-Identifier: GPL-2.0
12 /*
2
- * intel_soc_pmic_core.c - Intel SoC PMIC MFD Driver
3
+ * Intel SoC PMIC MFD Driver
34 *
45 * Copyright (C) 2013, 2014 Intel Corporation. All rights reserved.
5
- *
6
- * This program is free software; you can redistribute it and/or
7
- * modify it under the terms of the GNU General Public License version
8
- * 2 as published by the Free Software Foundation.
9
- *
10
- * This program is distributed in the hope that it will be useful,
11
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
- * GNU General Public License for more details.
146 *
157 * Author: Yang, Bin <bin.yang@intel.com>
168 * Author: Zhu, Lejun <lejun.zhu@linux.intel.com>
179 */
1810
19
-#include <linux/module.h>
20
-#include <linux/mfd/core.h>
11
+#include <linux/acpi.h>
2112 #include <linux/i2c.h>
2213 #include <linux/interrupt.h>
23
-#include <linux/gpio/consumer.h>
24
-#include <linux/acpi.h>
25
-#include <linux/regmap.h>
14
+#include <linux/module.h>
15
+#include <linux/mfd/core.h>
2616 #include <linux/mfd/intel_soc_pmic.h>
27
-#include <linux/gpio/machine.h>
2817 #include <linux/pwm.h>
18
+#include <linux/regmap.h>
19
+
2920 #include "intel_soc_pmic_core.h"
3021
3122 /* Crystal Cove PMIC shares same ACPI ID between different platforms */
3223 #define BYT_CRC_HRV 2
3324 #define CHT_CRC_HRV 3
3425
35
-/* Lookup table for the Panel Enable/Disable line as GPIO signals */
36
-static struct gpiod_lookup_table panel_gpio_table = {
37
- /* Intel GFX is consumer */
38
- .dev_id = "0000:00:02.0",
39
- .table = {
40
- /* Panel EN/DISABLE */
41
- GPIO_LOOKUP("gpio_crystalcove", 94, "panel", GPIO_ACTIVE_HIGH),
42
- { },
43
- },
44
-};
45
-
4626 /* PWM consumed by the Intel GFX */
4727 static struct pwm_lookup crc_pwm_lookup[] = {
48
- PWM_LOOKUP("crystal_cove_pwm", 0, "0000:00:02.0", "pwm_backlight", 0, PWM_POLARITY_NORMAL),
28
+ PWM_LOOKUP("crystal_cove_pwm", 0, "0000:00:02.0", "pwm_pmic_backlight", 0, PWM_POLARITY_NORMAL),
4929 };
5030
5131 static int intel_soc_pmic_i2c_probe(struct i2c_client *i2c,
....@@ -103,9 +83,6 @@
10383 if (ret)
10484 dev_warn(dev, "Can't enable IRQ as wake source: %d\n", ret);
10585
106
- /* Add lookup table binding for Panel Control to the GPIO Chip */
107
- gpiod_add_lookup_table(&panel_gpio_table);
108
-
10986 /* Add lookup table for crc-pwm */
11087 pwm_add_table(crc_pwm_lookup, ARRAY_SIZE(crc_pwm_lookup));
11188
....@@ -118,6 +95,7 @@
11895 return 0;
11996
12097 err_del_irq_chip:
98
+ pwm_remove_table(crc_pwm_lookup, ARRAY_SIZE(crc_pwm_lookup));
12199 regmap_del_irq_chip(pmic->irq, pmic->irq_chip_data);
122100 return ret;
123101 }
....@@ -127,9 +105,6 @@
127105 struct intel_soc_pmic *pmic = dev_get_drvdata(&i2c->dev);
128106
129107 regmap_del_irq_chip(pmic->irq, pmic->irq_chip_data);
130
-
131
- /* Remove lookup table for Panel Control from the GPIO Chip */
132
- gpiod_remove_lookup_table(&panel_gpio_table);
133108
134109 /* remove crc-pwm lookup table */
135110 pwm_remove_table(crc_pwm_lookup, ARRAY_SIZE(crc_pwm_lookup));