-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ACPI / PMIC: Add Cherry Trail Crystal Cove PMIC OpRegion driver
We have no docs for the CHT Crystal Cove PMIC. The Asus Zenfone-2 kernel code has 2 Crystal Cove regulator drivers, one calls the PMIC a "Crystal Cove Plus" PMIC and talks about Cherry Trail, so presuambly that one could be used to get register info for the regulators if we need to implement regulator support in the future. For now the sole purpose of this driver is to make intel_soc_pmic_exec_mipi_pmic_seq_element work on devices with a CHT Crystal Cove PMIC. Specifically this fixes the following MIPI PMIC sequence related errors on e.g. an Asus T100HA: [ 178.211801] intel_soc_pmic_exec_mipi_pmic_seq_element: No PMIC registered [ 178.211897] [drm:intel_dsi_dcs_init_backlight_funcs [i915]] *ERROR* mipi_exec_pmic failed, error: -6 Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
- Loading branch information
Hans de Goede
authored and
Rafael J. Wysocki
committed
Oct 25, 2019
1 parent
ed852cd
commit cefe6aa
Showing
3 changed files
with
52 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// SPDX-License-Identifier: GPL-2.0 | ||
/* | ||
* Intel Cherry Trail Crystal Cove PMIC operation region driver | ||
* | ||
* Copyright (C) 2019 Hans de Goede <hdegoede@redhat.com> | ||
*/ | ||
|
||
#include <linux/acpi.h> | ||
#include <linux/init.h> | ||
#include <linux/mfd/intel_soc_pmic.h> | ||
#include <linux/platform_device.h> | ||
#include <linux/regmap.h> | ||
#include "intel_pmic.h" | ||
|
||
/* | ||
* We have no docs for the CHT Crystal Cove PMIC. The Asus Zenfone-2 kernel | ||
* code has 2 Crystal Cove regulator drivers, one calls the PMIC a "Crystal | ||
* Cove Plus" PMIC and talks about Cherry Trail, so presuambly that one | ||
* could be used to get register info for the regulators if we need to | ||
* implement regulator support in the future. | ||
* | ||
* For now the sole purpose of this driver is to make | ||
* intel_soc_pmic_exec_mipi_pmic_seq_element work on devices with a | ||
* CHT Crystal Cove PMIC. | ||
*/ | ||
static struct intel_pmic_opregion_data intel_chtcrc_pmic_opregion_data = { | ||
.pmic_i2c_address = 0x6e, | ||
}; | ||
|
||
static int intel_chtcrc_pmic_opregion_probe(struct platform_device *pdev) | ||
{ | ||
struct intel_soc_pmic *pmic = dev_get_drvdata(pdev->dev.parent); | ||
return intel_pmic_install_opregion_handler(&pdev->dev, | ||
ACPI_HANDLE(pdev->dev.parent), pmic->regmap, | ||
&intel_chtcrc_pmic_opregion_data); | ||
} | ||
|
||
static struct platform_driver intel_chtcrc_pmic_opregion_driver = { | ||
.probe = intel_chtcrc_pmic_opregion_probe, | ||
.driver = { | ||
.name = "cht_crystal_cove_pmic", | ||
}, | ||
}; | ||
builtin_platform_driver(intel_chtcrc_pmic_opregion_driver); |