Skip to content

Commit cefe6aa

Browse files
jwrdegoederafaeljw
authored andcommitted
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 <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent ed852cd commit cefe6aa

File tree

3 files changed

+52
-0
lines changed

3 files changed

+52
-0
lines changed

drivers/acpi/Kconfig

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -520,6 +520,13 @@ config BYTCRC_PMIC_OPREGION
520520
This config adds ACPI operation region support for the Bay Trail
521521
version of the Crystal Cove PMIC.
522522

523+
config CHTCRC_PMIC_OPREGION
524+
bool "ACPI operation region support for Cherry Trail Crystal Cove PMIC"
525+
depends on INTEL_SOC_PMIC
526+
help
527+
This config adds ACPI operation region support for the Cherry Trail
528+
version of the Crystal Cove PMIC.
529+
523530
config XPOWER_PMIC_OPREGION
524531
bool "ACPI operation region support for XPower AXP288 PMIC"
525532
depends on MFD_AXP20X_I2C && IOSF_MBI=y

drivers/acpi/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ obj-$(CONFIG_ACPI_EXTLOG) += acpi_extlog.o
110110

111111
obj-$(CONFIG_PMIC_OPREGION) += pmic/intel_pmic.o
112112
obj-$(CONFIG_BYTCRC_PMIC_OPREGION) += pmic/intel_pmic_bytcrc.o
113+
obj-$(CONFIG_CHTCRC_PMIC_OPREGION) += pmic/intel_pmic_chtcrc.o
113114
obj-$(CONFIG_XPOWER_PMIC_OPREGION) += pmic/intel_pmic_xpower.o
114115
obj-$(CONFIG_BXT_WC_PMIC_OPREGION) += pmic/intel_pmic_bxtwc.o
115116
obj-$(CONFIG_CHT_WC_PMIC_OPREGION) += pmic/intel_pmic_chtwc.o

drivers/acpi/pmic/intel_pmic_chtcrc.c

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
// SPDX-License-Identifier: GPL-2.0
2+
/*
3+
* Intel Cherry Trail Crystal Cove PMIC operation region driver
4+
*
5+
* Copyright (C) 2019 Hans de Goede <[email protected]>
6+
*/
7+
8+
#include <linux/acpi.h>
9+
#include <linux/init.h>
10+
#include <linux/mfd/intel_soc_pmic.h>
11+
#include <linux/platform_device.h>
12+
#include <linux/regmap.h>
13+
#include "intel_pmic.h"
14+
15+
/*
16+
* We have no docs for the CHT Crystal Cove PMIC. The Asus Zenfone-2 kernel
17+
* code has 2 Crystal Cove regulator drivers, one calls the PMIC a "Crystal
18+
* Cove Plus" PMIC and talks about Cherry Trail, so presuambly that one
19+
* could be used to get register info for the regulators if we need to
20+
* implement regulator support in the future.
21+
*
22+
* For now the sole purpose of this driver is to make
23+
* intel_soc_pmic_exec_mipi_pmic_seq_element work on devices with a
24+
* CHT Crystal Cove PMIC.
25+
*/
26+
static struct intel_pmic_opregion_data intel_chtcrc_pmic_opregion_data = {
27+
.pmic_i2c_address = 0x6e,
28+
};
29+
30+
static int intel_chtcrc_pmic_opregion_probe(struct platform_device *pdev)
31+
{
32+
struct intel_soc_pmic *pmic = dev_get_drvdata(pdev->dev.parent);
33+
return intel_pmic_install_opregion_handler(&pdev->dev,
34+
ACPI_HANDLE(pdev->dev.parent), pmic->regmap,
35+
&intel_chtcrc_pmic_opregion_data);
36+
}
37+
38+
static struct platform_driver intel_chtcrc_pmic_opregion_driver = {
39+
.probe = intel_chtcrc_pmic_opregion_probe,
40+
.driver = {
41+
.name = "cht_crystal_cove_pmic",
42+
},
43+
};
44+
builtin_platform_driver(intel_chtcrc_pmic_opregion_driver);

0 commit comments

Comments
 (0)