Hi Rafael, Are there any more suggestions for this patch series? I noticed a compiler warning, which was strangely hidden before I sent v9. Will fix and resend if there isnt anything else. On 9 September 2015 at 16:27, Ashwin Chaugule <ashwin.chaugule@xxxxxxxxxx> wrote: > CPPC stands for Collaborative Processor Performance Controls > and is defined in the ACPI v5.0+ spec. It describes CPU > performance controls on an abstract and continuous scale > allowing the platform (e.g. remote power processor) to flexibly > optimize CPU performance with its knowledge of power budgets > and other architecture specific knowledge. > > This patch adds a shim which exports commonly used functions > to get and set CPPC specific controls for each CPU. This enables > CPUFreq drivers to gather per CPU performance data and use > with exisiting governors or even allows for customized governors > which are implemented inside CPUFreq drivers. > > Signed-off-by: Ashwin Chaugule <ashwin.chaugule@xxxxxxxxxx> > Reviewed-by: Al Stone <al.stone@xxxxxxxxxx> > --- > drivers/acpi/Kconfig | 14 + > drivers/acpi/Makefile | 1 + > drivers/acpi/cppc_acpi.c | 755 +++++++++++++++++++++++++++++++++++++++++++++++ > include/acpi/cppc_acpi.h | 138 +++++++++ > 4 files changed, 908 insertions(+) > create mode 100644 drivers/acpi/cppc_acpi.c > create mode 100644 include/acpi/cppc_acpi.h > [..] > + > +static u64 get_phys_pcc_addr(struct cpc_reg *reg) > +{ > + /* PCC communication addr space begins at byte offset 0x8. */ > + return (u64)comm_base_addr + 0x8 + reg->address; > +} > + > +static void cpc_read(struct cpc_reg *reg, u64 *val) > +{ > + u64 addr; Default addr = reg->address; That'll enable sys mem type read/write ops. > + > + if (reg->space_id == ACPI_ADR_SPACE_PLATFORM_COMM) > + addr = get_phys_pcc_addr(reg); Or alternately, fold this into a function get_phys_addr() which parses for type PCC, sys mem. etc. and returns address. > + > + acpi_os_read_memory((acpi_physical_address)addr, > + val, reg->bit_width); > + > + /* TODO:Add FFH, SYSTEM_IO support later. */ Will add a pr_err() if type is FFH/Sys IO. Likewise below. > +} > + > +static void cpc_write(struct cpc_reg *reg, u64 val) > +{ > + u64 addr; > + > + if (reg->space_id == ACPI_ADR_SPACE_PLATFORM_COMM) > + addr = get_phys_pcc_addr(reg); > + > + acpi_os_write_memory((acpi_physical_address)addr, > + val, reg->bit_width); > + > + /* TODO:Add FFH, SYSTEM_IO support later. */ > +} > + Regards, Ashwin. -- To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html