Skip to contentSkip to conversation

ACPI / PMIC: Add opregion driver for Intel CHT WhiskeyCove PMIC

PATCH Superseded Hans de Goede 3 participants 4 messages Feb 27, 2017 – Feb 28, 2017

Subsystems (2)

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 ACPI / PMIC: Add opregion driver for Intel CHT WhiskeyCove PMIC

Add opregion driver for Intel CHT WhiskeyCove PMIC, based on various non upstreamed CHT WhiskeyCove PMIC patches. This does not include support for the Thermal opregion (DPTF) due to lacking documentation.

Cc Bin Gao <[email protected]>
Cc Felipe Balbi <[email protected]>
Cc Andy Shevchenko <[email protected]>

---
Changes in v2:
-s/WhiskeyCove/Whiskey Cove/
-Some minor style tweaks
-Allow building as module

---
 drivers/acpi/Kconfig                 |   6 +
 drivers/acpi/Makefile                |   1 +
 drivers/acpi/pmic/intel_pmic_chtwc.c | 232 +++++++++++++++++++++++++++++++++++
 3 files changed, 239 insertions(+)
 create mode 100644 drivers/acpi/pmic/intel_pmic_chtwc.c
drivers/acpi/Kconfig +6 -0
index 83e5f7e..56e8b48 100644
@@ -516,6 +516,12 @@ config BXT_WC_PMIC_OPREGION
 	help
 	  This config adds ACPI operation region support for BXT WhiskeyCove PMIC.
 
+config CHT_WC_PMIC_OPREGION
+	tristate "ACPI operation region support for CHT Whiskey Cove PMIC"
+	depends on MFD_INTEL_CHT_WC
+	help
+	  This config adds ACPI operation region support for CHT Whiskey Cove PMIC.
+
 endif
 
 config ACPI_CONFIGFS
drivers/acpi/Makefile +1 -0
index 9ed0878..1256830 100644
@@ -102,6 +102,7 @@ obj-$(CONFIG_PMIC_OPREGION)	+= pmic/intel_pmic.o
 obj-$(CONFIG_CRC_PMIC_OPREGION) += pmic/intel_pmic_crc.o
 obj-$(CONFIG_XPOWER_PMIC_OPREGION) += pmic/intel_pmic_xpower.o
 obj-$(CONFIG_BXT_WC_PMIC_OPREGION) += pmic/intel_pmic_bxtwc.o
+obj-$(CONFIG_CHT_WC_PMIC_OPREGION) += pmic/intel_pmic_chtwc.o
 
 obj-$(CONFIG_ACPI_CONFIGFS)	+= acpi_configfs.o
 
drivers/acpi/pmic/intel_pmic_chtwc.c new file +232 -0

232 lines not on this page · raw message

Signature · 1 line
2.9.3
#1 lore raw
Quoted 3 lines · Hans de Goede

Add opregion driver for Intel CHT WhiskeyCove PMIC, based on various non upstreamed CHT WhiskeyCove PMIC patches. This does not include support for the Thermal opregion (DPTF) due to lacking documentation.

Couple of nitpicks.

drivers/acpi/pmic/intel_pmic_chtwc.c line 2

Quoted 3 lines
drivers/acpi/pmic/intel_pmic_chtwc.c new file +2 -0
@@ -0,0 +1,232 @@
+/*
+ * intel_pmic_chtwc.c - Intel CHT Whiskey Cove PMIC operation region driver

I would remove file name. You never know if it's going to be renamed or not.

drivers/acpi/pmic/intel_pmic_chtwc.c line 191

Quoted 7 lines
drivers/acpi/pmic/intel_pmic_chtwc.c new file +6 -0
+static int intel_cht_wc_pmic_update_power(struct regmap *regmap, int reg,
+               int bit, bool on)
+{
 
+       u8 mask = bit;
+
+       return regmap_update_bits(regmap, reg, mask, on ? 1 : 0);

Hmm... Just leave one line?

Quoted 1 line

+}

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#2 lore raw

Hi,

Thnak you for the review.

Quoted 17 lines · Andy Shevchenko
Quoted 3 lines · Hans de Goede

Add opregion driver for Intel CHT WhiskeyCove PMIC, based on various non upstreamed CHT WhiskeyCove PMIC patches. This does not include support for the Thermal opregion (DPTF) due to lacking documentation.

Couple of nitpicks.

drivers/acpi/pmic/intel_pmic_chtwc.c line 2

Quoted 3 lines
drivers/acpi/pmic/intel_pmic_chtwc.c new file +2 -0
@@ -0,0 +1,232 @@
+/*
+ * intel_pmic_chtwc.c - Intel CHT Whiskey Cove PMIC operation region driver

I would remove file name. You never know if it's going to be renamed or not.

Quoted 3 lines
drivers/acpi/pmic/intel_pmic_chtwc.c new file +3 -0
+static int intel_cht_wc_pmic_update_power(struct regmap *regmap, int reg,
+               int bit, bool on)
+{
Quoted 5 lines

drivers/acpi/pmic/intel_pmic_chtwc.c line 191

Quoted 3 lines
drivers/acpi/pmic/intel_pmic_chtwc.c new file +3 -0
+       u8 mask = bit;
+
+       return regmap_update_bits(regmap, reg, mask, on ? 1 : 0);

Hmm... Just leave one line?

Both fixed. I will send a new version together with a new version of the Intel CHT WhiskeyCove PMIC mfd driver.

Since this patch relies on defines from the generic mfd header that one needs to be merged first. Given the dependency it is probably best of both are merged through the mfd tree. Rafael, is that ok with you ?

Regards,

Hans

Reviewed-by
#3 lore raw
Quoted 33 lines · Hans de Goede

Hi,

Thnak you for the review.

Quoted 18 lines · Andy Shevchenko

On Mon, Feb 27, 2017 at 10:26 PM, Hans de Goede <[email protected]

Quoted 6 lines

wrote:
Add opregion driver for Intel CHT WhiskeyCove PMIC, based on various
non upstreamed CHT WhiskeyCove PMIC patches. This does not include support for the Thermal opregion (DPTF) due to lacking documentation.

Couple of nitpicks.

Quoted 4 lines
(quoted diff) +2 -0
@@ -0,0 +1,232 @@
+/*
+ * intel_pmic_chtwc.c - Intel CHT Whiskey Cove PMIC operation

region driver

I would remove file name. You never know if it's going to be renamed or not.

Quoted 9 lines

drivers/acpi/pmic/intel_pmic_chtwc.c line 191

Quoted 7 lines

+static int intel_cht_wc_pmic_update_power(struct regmap *regmap, int reg,
+               int bit, bool on)

drivers/acpi/pmic/intel_pmic_chtwc.c new file +4 -0
+{
+       u8 mask = bit;
+
+       return regmap_update_bits(regmap, reg, mask, on ? 1 : 0);

Hmm... Just leave one line?

Quoted 2 lines

Both fixed. I will send a new version together with a new version of the Intel CHT WhiskeyCove PMIC mfd driver.

Please add my

Signature · 2 lines
Andy Shevchenko <[email protected]>
Intel Finland Oy