diff options
-rw-r--r-- | drivers/acpi/pmic/intel_pmic_xpower.c | 30 |
1 files changed, 26 insertions, 4 deletions
diff --git a/drivers/acpi/pmic/intel_pmic_xpower.c b/drivers/acpi/pmic/intel_pmic_xpower.c index f8853e5eb838..6a082d4de12c 100644 --- a/drivers/acpi/pmic/intel_pmic_xpower.c +++ b/drivers/acpi/pmic/intel_pmic_xpower.c | |||
@@ -220,13 +220,35 @@ static struct intel_pmic_opregion_data intel_xpower_pmic_opregion_data = { | |||
220 | .thermal_table_count = ARRAY_SIZE(thermal_table), | 220 | .thermal_table_count = ARRAY_SIZE(thermal_table), |
221 | }; | 221 | }; |
222 | 222 | ||
223 | static acpi_status intel_xpower_pmic_gpio_handler(u32 function, | ||
224 | acpi_physical_address address, u32 bit_width, u64 *value, | ||
225 | void *handler_context, void *region_context) | ||
226 | { | ||
227 | return AE_OK; | ||
228 | } | ||
223 | 229 | ||
224 | static int intel_xpower_pmic_opregion_probe(struct platform_device *pdev) | 230 | static int intel_xpower_pmic_opregion_probe(struct platform_device *pdev) |
225 | { | 231 | { |
226 | struct axp20x_dev *axp20x = dev_get_drvdata(pdev->dev.parent); | 232 | struct device *parent = pdev->dev.parent; |
227 | return intel_pmic_install_opregion_handler(&pdev->dev, | 233 | struct axp20x_dev *axp20x = dev_get_drvdata(parent); |
228 | ACPI_HANDLE(pdev->dev.parent), axp20x->regmap, | 234 | acpi_status status; |
229 | &intel_xpower_pmic_opregion_data); | 235 | int result; |
236 | |||
237 | status = acpi_install_address_space_handler(ACPI_HANDLE(parent), | ||
238 | ACPI_ADR_SPACE_GPIO, intel_xpower_pmic_gpio_handler, | ||
239 | NULL, NULL); | ||
240 | if (ACPI_FAILURE(status)) | ||
241 | return -ENODEV; | ||
242 | |||
243 | result = intel_pmic_install_opregion_handler(&pdev->dev, | ||
244 | ACPI_HANDLE(parent), axp20x->regmap, | ||
245 | &intel_xpower_pmic_opregion_data); | ||
246 | if (result) | ||
247 | acpi_remove_address_space_handler(ACPI_HANDLE(parent), | ||
248 | ACPI_ADR_SPACE_GPIO, | ||
249 | intel_xpower_pmic_gpio_handler); | ||
250 | |||
251 | return result; | ||
230 | } | 252 | } |
231 | 253 | ||
232 | static struct platform_driver intel_xpower_pmic_opregion_driver = { | 254 | static struct platform_driver intel_xpower_pmic_opregion_driver = { |