Skip to content

Commit

Permalink
acpuclock: use a common definition for table size
Browse files Browse the repository at this point in the history
Signed-off-by: Paul Reioux <[email protected]>
  • Loading branch information
faux123 committed Nov 19, 2014
1 parent 20ac3e3 commit adc0ae6
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 15 deletions.
34 changes: 34 additions & 0 deletions arch/arm/mach-msm/acpuclock-common.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/* arch/arm/mach-msm/acpuclock-common.h
*
* MSM architecture cpu clock common definitions
*
* Copyright (C) 2014 Paul Reioux (faux123)
*
* 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_COMMON_H
#define __ARCH_ARM_MACH_MSM_ACPUCLOCK_COMMON_H

#ifdef CONFIG_OC_ULTIMATE
#ifdef CONFIG_LOW_CPUCLOCKS
#define FREQ_TABLE_SIZE 41
#else
#define FREQ_TABLE_SIZE 37
#endif
#else
#ifdef CONFIG_LOW_CPUCLOCKS
#define FREQ_TABLE_SIZE 39
#else
#define FREQ_TABLE_SIZE 35
#endif
#endif

#endif /* __ARCH_ARM_MACH_MSM_ACPUCLOCK_COMMON_H */
15 changes: 1 addition & 14 deletions arch/arm/mach-msm/acpuclock-krait.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@

#include "acpuclock.h"
#include "acpuclock-krait.h"
#include "acpuclock-common.h"
#include "avs.h"

/* MUX source selects. */
Expand All @@ -46,20 +47,6 @@

#define SECCLKAGD BIT(4)

#ifdef CONFIG_OC_ULTIMATE
#ifdef CONFIG_LOW_CPUCLOCKS
#define FREQ_TABLE_SIZE 41
#else
#define FREQ_TABLE_SIZE 37
#endif
#else
#ifdef CONFIG_LOW_CPUCLOCKS
#define FREQ_TABLE_SIZE 39
#else
#define FREQ_TABLE_SIZE 35
#endif
#endif

static DEFINE_MUTEX(driver_lock);
static DEFINE_SPINLOCK(l2_lock);

Expand Down
4 changes: 3 additions & 1 deletion arch/arm/mach-msm/msm_dcvs.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
#include <mach/msm_dcvs.h>
#include <trace/events/mpdcvs_trace.h>

#include "acpuclock-common.h"

#define CORE_HANDLE_OFFSET (0xA0)
#define __err(f, ...) pr_err("MSM_DCVS: %s: " f, __func__, __VA_ARGS__)
#define __info(f, ...) pr_info("MSM_DCVS: %s: " f, __func__, __VA_ARGS__)
Expand Down Expand Up @@ -146,7 +148,7 @@ static struct dcvs_core core_list[CORES_MAX];

static struct kobject *cores_kobj;

#define DCVS_MAX_NUM_FREQS 15
#define DCVS_MAX_NUM_FREQS FREQ_TABLE_SIZE
static struct msm_dcvs_freq_entry cpu_freq_tbl[DCVS_MAX_NUM_FREQS];
static unsigned num_cpu_freqs;
static struct msm_dcvs_platform_data *dcvs_pdata;
Expand Down

0 comments on commit adc0ae6

Please sign in to comment.