android_kernel_google_msm/arch/arm/mach-msm/acpuclock.h
Kaushal Kumar f08399a804 msm: acpuclock-7627: Add support of 1.4GHz for 8625
For 8625 2.0 PLL4 is capable to run at 1.4GHz. Add acpuclock
table for the same and also add support to dynamically
re-program the PLL4 assuming 801.6MHz jump is fine from
H/W perspective.

Change-Id: I3712907d4aa3f4c085f874652797e9e7d4203598
Signed-off-by: Kaushal Kumar <kaushalk@codeaurora.org>
2013-02-27 18:17:30 -08:00

93 lines
2.4 KiB
C

/*
* MSM architecture CPU clock driver header
*
* Copyright (C) 2007 Google, Inc.
* Copyright (c) 2007-2012, Code Aurora Forum. All rights reserved.
* Author: San Mehat <san@android.com>
*
* This software is licensed under the terms of the GNU General Public
* License version 2, as published by the Free Software Foundation, and
* may be copied, distributed, and modified under those terms.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#ifndef __ARCH_ARM_MACH_MSM_ACPUCLOCK_H
#define __ARCH_ARM_MACH_MSM_ACPUCLOCK_H
/**
* enum setrate_reason - Reasons for use with acpuclk_set_rate()
*/
enum setrate_reason {
SETRATE_CPUFREQ = 0,
SETRATE_SWFI,
SETRATE_PC,
SETRATE_HOTPLUG,
SETRATE_INIT,
};
/**
* struct acpuclk_pdata - Platform data for acpuclk
*/
struct acpuclk_pdata {
unsigned long max_speed_delta_khz;
unsigned int max_axi_khz;
};
/**
* struct acpuclk_data - Function pointers and data for function implementations
*/
struct acpuclk_data {
unsigned long (*get_rate)(int cpu);
int (*set_rate)(int cpu, unsigned long rate, enum setrate_reason);
uint32_t switch_time_us;
unsigned long power_collapse_khz;
unsigned long wait_for_irq_khz;
};
/**
* acpulock_get_rate() - Get a CPU's clock rate in KHz
* @cpu: CPU to query the rate of
*/
unsigned long acpuclk_get_rate(int cpu);
/**
* acpuclk_set_rate() - Set a CPU's clock rate
* @cpu: CPU to set rate of
* @rate: Desired rate in KHz
* @setrate_reason: Reason for the rate switch
*
* Returns 0 for success.
*/
int acpuclk_set_rate(int cpu, unsigned long rate, enum setrate_reason);
/**
* acpuclk_get_switch_time() - Query estimated time in us for a CPU rate switch
*/
uint32_t acpuclk_get_switch_time(void);
/**
* acpuclk_power_collapse() - Prepare current CPU clocks for power-collapse
*
* Returns the previous rate of the CPU in KHz.
*/
unsigned long acpuclk_power_collapse(void);
/**
* acpuclk_wait_for_irq() - Prepare current CPU clocks for SWFI
*
* Returns the previous rate of the CPU in KHz.
*/
unsigned long acpuclk_wait_for_irq(void);
/**
* acpuclk_register() - Register acpuclk_data function implementations
* @data: acpuclock API implementations and data
*/
void acpuclk_register(struct acpuclk_data *data);
#endif /*__ARCH_ARM_MACH_MSM_ACPUCLOCK_H*/