> It looks like some code duplication might be reduced this way. > int reg /* corresponding PMIC register */ > int address /* operation region address */ > and struct pmic_pwr_table are inconsistent, but is that really necessary? > I see that this is because the definitions of struct pmic_thermal_table > to struct pmic_pwr_reg, this one returns an int. While pmic_get_pwr_reg() returns a pointer > +pmic_get_thermal_reg(int address, struct pmic_thermal_table *table, int count) > + for (i = 0 i > + if (table.address = address) > +pmic_get_pwr_reg(int address, struct pmic_pwr_table *table, int count) > + struct intel_pmic_opregion_data *data > + * GNU General Public License for more details. > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. > + * but WITHOUT ANY WARRANTY without even the implied warranty of > + * This program is distributed in the hope that it will be useful, > + * 2 as published by the Free Software Foundation. > + * modify it under the terms of the GNU General Public License version > + * This program is free software you can redistribute it and/or > + * Copyright (C) 2014 Intel Corporation.
> + * intel_pmic.c - Intel PMIC operation region driver > diff -git a/drivers/acpi/pmic/intel_pmic.c b/drivers/acpi/pmic/intel_pmic.c > +obj-$(CONFIG_CRC_PMIC_OPREGION) += pmic/intel_pmic_crc.o > +obj-$(CONFIG_PMIC_OPREGION) += pmic/intel_pmic.o > obj-$(CONFIG_ACPI_EXTLOG) += acpi_extlog.o > diff -git a/drivers/acpi/Makefile b/drivers/acpi/Makefile > + This config adds ACPI operation region support for CrystalCove PMIC. > + bool "ACPI operation region support for CrystalCove PMIC" Use select for PMIC_OPREGION for all those PMIC operation region drivers,īut it seems easier to use a "if PMIC_OPREGION. Increasing list with more and more PMIC opregion support added.
It is not the only possible choice, currently we have two(see patch 2/3):ĬRC_PMIC_OPREGION and XPOWER_PMIC_OPREGION.
Alternatively, PMIC_OPREGION should be selected automatically > If that is the only possible choice for PMIC_OPREGION, it should be selected > + to control power rails and sensor reading/writing on the > + Select this option to enable support for ACPI operation > + bool "PMIC (Power Management Integrated Circuit) operation region support" > tracepoint which carries that information to userspace. > driver adds support for that functionality with corresponding > diff -git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig > create mode 100644 drivers/acpi/pmic/intel_pmic_crc.c > create mode 100644 drivers/acpi/pmic/intel_pmic.h > create mode 100644 drivers/acpi/pmic/intel_pmic.c > drivers/acpi/pmic/intel_pmic.h | 34 ++++ Thaks for taking a look at them, some response below. > Thanks for resending, looks better to me. > we just need to fill those callbacks and the two register mapping tables. > for this purpose: when we need to support a new PMIC's operation region, The intel_pmic_opregion_data structure is created also
> are more PMIC drivers with ACPI operation region support coming and we can > The reason to split code into a separate file intel_pmic.c is that there This patch adds support for them on top of the existing Crystal Cove > and one is for thermal: sensor temperature reporting, trip point setting, > regions for PMIC chip Crystal Cove - one is for power resource handling > The Baytrail-T platform firmware has defined two customized operation > On Friday, Novem03:11:49 PM Aaron Lu wrote: Yegnesh Iyer Re: ACPI / PMIC: support PMIC operation region for CrystalCoveĭate: Mon, 13:55:12 +0800
Re: ACPI / PMIC: support PMIC operation region for CrystalCove - Aaron Lu archive mirror help / color / mirror / Atom feed From: Aaron Lu