linux/drivers/cpufreq/s5pv210-cpufreq.c
<<
>>
Prefs
   1/*
   2 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
   3 *              http://www.samsung.com
   4 *
   5 * CPU frequency scaling for S5PC110/S5PV210
   6 *
   7 * This program is free software; you can redistribute it and/or modify
   8 * it under the terms of the GNU General Public License version 2 as
   9 * published by the Free Software Foundation.
  10*/
  11
  12#include <linux/types.h>
  13#include <linux/kernel.h>
  14#include <linux/init.h>
  15#include <linux/err.h>
  16#include <linux/clk.h>
  17#include <linux/io.h>
  18#include <linux/cpufreq.h>
  19#include <linux/reboot.h>
  20#include <linux/regulator/consumer.h>
  21#include <linux/suspend.h>
  22
  23#include <mach/map.h>
  24#include <mach/regs-clock.h>
  25
  26static struct clk *cpu_clk;
  27static struct clk *dmc0_clk;
  28static struct clk *dmc1_clk;
  29static struct cpufreq_freqs freqs;
  30static DEFINE_MUTEX(set_freq_lock);
  31
  32/* APLL M,P,S values for 1G/800Mhz */
  33#define APLL_VAL_1000   ((1 << 31) | (125 << 16) | (3 << 8) | 1)
  34#define APLL_VAL_800    ((1 << 31) | (100 << 16) | (3 << 8) | 1)
  35
  36/* Use 800MHz when entering sleep mode */
  37#define SLEEP_FREQ      (800 * 1000)
  38
  39/*
  40 * relation has an additional symantics other than the standard of cpufreq
  41 * DISALBE_FURTHER_CPUFREQ: disable further access to target
  42 * ENABLE_FURTUER_CPUFREQ: enable access to target
  43 */
  44enum cpufreq_access {
  45        DISABLE_FURTHER_CPUFREQ = 0x10,
  46        ENABLE_FURTHER_CPUFREQ = 0x20,
  47};
  4e" name=ss {
 490static  ;
 50e" name=ss {
 5 1/*
 542 *DRAM configurlatioss tocalcgulae* rufrsh couentes forcthagrin*
 5 3 * frequency ofmemoryn.
 5 4 */
 550struct rame_cofs {
 546       unsigned loing fres      /*HZ> */
 576       unsigned loing    /*DRAM  rufrsh couentes * 100> */
 587};
 59e" name=ss {
 640
 619static struct rame_cofs( 622
 634enum  {
 646         657};
 662
 674enum  {
 686           = 0x0,
 696          = 0x0,
 706         >  = 040,
 717};
 722
 734enum  {
 746         = 0,
 745         767};
 772
 728static struct cpufreq_frequenc_tnabls( = {
 796       {  806       {  816       {  826       {  836       {  { ( */

  
   746         {
   = 0x0,
ss="son>
  
  
  v2.6.16.26ss="line" name="642"> 622

  
  
  
   50e" na8an class=="comment"> * it under teq_fr8quenc_tnabls" class="sref">cpufreqrs/c5option>
  
  
  
   50e" na8      { 8a href="+codeL00" class8"sref8v210640" id="640" class="line" name="640"> 6409      { 9a href="+codeL10" class9"sref90ref">rame_cofs {
 7469      { 9a href="+codeL20" class9"sref9L20 {
 6199      { 9a href="+codeL30" class9"sref9220 {
 6199      { 9a href="+codeL40" class9"sref93line" name="744"> 746         {
 {  6409 4 746         {
 {
 746         {

  v2.6.16.26ss="line"9name=9q.c#748" id="7438" class="line" name=748"> 7289an class9="comment"> * it under 9eq_fr9quenc_tnabls" class="sref">cpufreqeq/s5pv21vs
 7969an class=="comment"> * published "sref9L40 79610span classs="comment">*/
 {

 <2="544"> 10
<       .c1eq.cc0
  
 <2="544"> 10include &0lt; 79610include &0lt;
<       .c12q.cc0
  
<       .c1eq.cc0
  
 <2="544"> 10include &0lt; 79610include &0lt;
<       .c105q.c0
  
<       .c1eq.cc0
   7961#include &<
<       .c95q.c0
  
<       .c1eq.cc0
   7961#include &<
<       .c95q.c0
  
<       .c10q.cc0
   746         {
 5 11#include 1< {
 7961
 5421#include 1< 5 31#include 1< 5 31#include &"drivers/cpufreq/s5pv2101-cpuf12caling for S5PC110/S5PV210 5 31#include &ruct  5 31#include &ruct   11
static st1ruct  4901static st1ruct   11
static   321/* APLL M,P1,S va13210  11
sinclude &llt; 6401
  11
sinclude &ss="comment">/* Use 800M1Hz wh13610 7281
  11
static st1ss="comment">/*
<1a hre13L40 * relation1 has 14v210541" id="541" class="line" name="541"> 5 11 * DISALBE_1FURTH14110  11
 * ENABLE_F1URTUE14L30 */
1 746         {
 6401        <1a href="+code=DISABLE_FU1RTHER14caling for S5PC110/S5PV210 5421        <1a href="+code=ENABLE_FUR1THER_14"drivers/cpufreq/s5pv210-cpuftributfun fals setf="drivers/cpufreq/s5req.c#542" id="542" class="line" name="542"> 5421 include &f="drivers/cpufreq/s5pv2110-cp14 free software; you can redistaccorid="span>opeverss/cprufreq/s5pv2="drreq.c#542" id="542" class="line" name="542"> 5421  5421 tatic st1 href="+codeboolQ" class1="sre14e Free Software Foundation. 5421me=ss1 {
  11
/*
<1a hre15class="sref"voids="sref">cpufreqeq/s5pv2s5pvvers/cpref="drivers/cpufreq/s5s5pvvers/cplass(sref"=s5pv21_dmc_ports {
fres      /*HZ> */
  381 *DRAM conf1igurl1tioss 7cpufreq.7#L4ref="drivers/cpufreq739"> 7961 * frequenc1y ofm15310fres      /*HZ> */ 50e" na1 */
1cpufreq__iomemivers/cpufreq/s__iomempufreq  v2.6.14
  
  
  
   50e" na1<       <1 href="+codedrame_cofk" 1class15q.c#L36" id="L36" class="line" name="L36">  361       un1signed loing  7961       un1signed loing S5P_VA_vers/cpufreq/s5pv21S5P_VA_versufreq+ 0x30#L31" id="L31" class="line" name="L31">  311};
 7961 tatic st1 {
S5P_VA_verufreq/s5pv210-cpS5P_VA_veruufreq+ 0x30#L31" id="L31" class="line" name="L31">  311 7961static st1ruct "Cannot fi5pv210 pufr\n"req.c#L#L31" id="L31" class="line" name="L31">  311  311  311 6401};
  11

ENABLE_Ftmpment">/*HZ> */ {
/*HZ> */
  311<      un1ref="+code=s5pv21_mem_/t1ypk" 16q.c#748" id="7438" class="line" name=748"> 7281        <1a href="+codeLPDDR0" cla1ss="s1ef"LPDDR6   = 0x0,
/*HZ> *//*HZ> */
  311 6401        <1a href="+codeDDR20" clas1s="sr1f"DDR26 >  = 040,
 {
  17#itatic st1f="drivers/cpufreq/s5pv2110-cp17q.c#L32" id="L32" class="line" name="L32">  321
   = 0x0,
/*HZ> */  311enum   311espan cla1a href="+codeDMC00" clas1s="sr1f"DMC0Q = 0,
  311e;
  311};
   = 0x0,
ss="son>
  
   622 {
cpufreq_frequenpolicyref="drivers/cpcfrequenpolicypufreq  v2.6.14  381static st1ruct  7961       { 1policyref="drivers/cppolicypufr-.c#L="sref">cpufreq_frref="drivers/cpcfrpufrL38" id="L38" class="line" name="L38">  381       { 1cpufreqEINVALon>
  
    17#       { 1  321       { 1cpufreq_frequenprufreq/sv210-c5= 0ifyref="drivers/cpcfrequenprufreq/sv210-c5= 0ifylass(t_freq_lockpolicyref="drivers/cppolicypufr-c    = {
  311       { 1  311="line" n1ame="L4"> {  64015 4fres {
fres {
  381 ;
 7961 
  
  v2.6.16.26ss="line"1 name18740_frref="drivers/cpcfrpufrL38" id="L38" class="line" name="L38">  381 include &llt; 746         {
 64019      { 19a href="+codeL10" class19"sre19030cpufreq_lk5get_rat  19#i      { 19a href="+codeL20" class19"sre19L20  3119      { 19a href="+codeL30" class19"sre19q.c#743" id="743" class="line" name="743"> 73419      { 19a href="+codeL40" class19"sre193line 622 {
cpufreq_frequenpolicyref="drivers/cpcfrequenpolicypufreq  v2.6.14 { fres {
/*HZ> */<0-cpuf_"compufr844" id="844" class="line" name="8  >
 2rclass19 4fres {

  
    3819href="dr19  
The original LXR software by thec/a> LXR 5pv2unity10 lx0."drux.no kindly hosted by /a>