diff options
author | Linus Torvalds <torvalds@woody.osdl.org> | 2006-12-17 22:08:11 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.osdl.org> | 2006-12-17 22:08:11 -0500 |
commit | e25db641c0e6dd49c5db24dbe154048d4a466727 (patch) | |
tree | 1e0cd6a728a405aa5b2e73e8d6d55dcb684416ea /arch | |
parent | 7686fcf7304eebd2228ec47045cb28ee3c58b1f1 (diff) | |
parent | 928ee513c2fc39799cb13302bc02344a849fa37c (diff) |
Merge master.kernel.org:/pub/scm/linux/kernel/git/davej/cpufreq
* master.kernel.org:/pub/scm/linux/kernel/git/davej/cpufreq:
[CPUFREQ] longhaul compile fix.
[CPUFREQ] Advise not to use longhaul on VIA C7.
[CPUFREQ] set policy->curfreq on initialization
[CPUFREQ] Trivial cleanup for acpi read/write port in acpi-cpufreq.c
[CPUFREQ] fixes typo in cpufreq.c
Diffstat (limited to 'arch')
-rw-r--r-- | arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c | 33 | ||||
-rw-r--r-- | arch/i386/kernel/cpu/cpufreq/longhaul.c | 4 |
2 files changed, 11 insertions, 26 deletions
diff --git a/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c b/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c index 18f4715c655d..b735458c6e3a 100644 --- a/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c +++ b/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c | |||
@@ -126,27 +126,6 @@ static unsigned extract_freq(u32 val, struct acpi_cpufreq_data *data) | |||
126 | } | 126 | } |
127 | } | 127 | } |
128 | 128 | ||
129 | static void wrport(u16 port, u8 bit_width, u32 value) | ||
130 | { | ||
131 | if (bit_width <= 8) | ||
132 | outb(value, port); | ||
133 | else if (bit_width <= 16) | ||
134 | outw(value, port); | ||
135 | else if (bit_width <= 32) | ||
136 | outl(value, port); | ||
137 | } | ||
138 | |||
139 | static void rdport(u16 port, u8 bit_width, u32 * ret) | ||
140 | { | ||
141 | *ret = 0; | ||
142 | if (bit_width <= 8) | ||
143 | *ret = inb(port); | ||
144 | else if (bit_width <= 16) | ||
145 | *ret = inw(port); | ||
146 | else if (bit_width <= 32) | ||
147 | *ret = inl(port); | ||
148 | } | ||
149 | |||
150 | struct msr_addr { | 129 | struct msr_addr { |
151 | u32 reg; | 130 | u32 reg; |
152 | }; | 131 | }; |
@@ -177,7 +156,9 @@ static void do_drv_read(struct drv_cmd *cmd) | |||
177 | rdmsr(cmd->addr.msr.reg, cmd->val, h); | 156 | rdmsr(cmd->addr.msr.reg, cmd->val, h); |
178 | break; | 157 | break; |
179 | case SYSTEM_IO_CAPABLE: | 158 | case SYSTEM_IO_CAPABLE: |
180 | rdport(cmd->addr.io.port, cmd->addr.io.bit_width, &cmd->val); | 159 | acpi_os_read_port((acpi_io_address)cmd->addr.io.port, |
160 | &cmd->val, | ||
161 | (u32)cmd->addr.io.bit_width); | ||
181 | break; | 162 | break; |
182 | default: | 163 | default: |
183 | break; | 164 | break; |
@@ -193,7 +174,9 @@ static void do_drv_write(struct drv_cmd *cmd) | |||
193 | wrmsr(cmd->addr.msr.reg, cmd->val, h); | 174 | wrmsr(cmd->addr.msr.reg, cmd->val, h); |
194 | break; | 175 | break; |
195 | case SYSTEM_IO_CAPABLE: | 176 | case SYSTEM_IO_CAPABLE: |
196 | wrport(cmd->addr.io.port, cmd->addr.io.bit_width, cmd->val); | 177 | acpi_os_write_port((acpi_io_address)cmd->addr.io.port, |
178 | cmd->val, | ||
179 | (u32)cmd->addr.io.bit_width); | ||
197 | break; | 180 | break; |
198 | default: | 181 | default: |
199 | break; | 182 | break; |
@@ -699,14 +682,14 @@ static int acpi_cpufreq_cpu_init(struct cpufreq_policy *policy) | |||
699 | if (result) | 682 | if (result) |
700 | goto err_freqfree; | 683 | goto err_freqfree; |
701 | 684 | ||
702 | switch (data->cpu_feature) { | 685 | switch (perf->control_register.space_id) { |
703 | case ACPI_ADR_SPACE_SYSTEM_IO: | 686 | case ACPI_ADR_SPACE_SYSTEM_IO: |
704 | /* Current speed is unknown and not detectable by IO port */ | 687 | /* Current speed is unknown and not detectable by IO port */ |
705 | policy->cur = acpi_cpufreq_guess_freq(data, policy->cpu); | 688 | policy->cur = acpi_cpufreq_guess_freq(data, policy->cpu); |
706 | break; | 689 | break; |
707 | case ACPI_ADR_SPACE_FIXED_HARDWARE: | 690 | case ACPI_ADR_SPACE_FIXED_HARDWARE: |
708 | acpi_cpufreq_driver.get = get_cur_freq_on_cpu; | 691 | acpi_cpufreq_driver.get = get_cur_freq_on_cpu; |
709 | get_cur_freq_on_cpu(cpu); | 692 | policy->cur = get_cur_freq_on_cpu(cpu); |
710 | break; | 693 | break; |
711 | default: | 694 | default: |
712 | break; | 695 | break; |
diff --git a/arch/i386/kernel/cpu/cpufreq/longhaul.c b/arch/i386/kernel/cpu/cpufreq/longhaul.c index c548daad3476..6d9c97a690fd 100644 --- a/arch/i386/kernel/cpu/cpufreq/longhaul.c +++ b/arch/i386/kernel/cpu/cpufreq/longhaul.c | |||
@@ -787,8 +787,10 @@ static int __init longhaul_init(void) | |||
787 | switch (c->x86_model) { | 787 | switch (c->x86_model) { |
788 | case 6 ... 9: | 788 | case 6 ... 9: |
789 | return cpufreq_register_driver(&longhaul_driver); | 789 | return cpufreq_register_driver(&longhaul_driver); |
790 | case 10: | ||
791 | printk(KERN_ERR PFX "Use acpi-cpufreq driver for VIA C7\n"); | ||
790 | default: | 792 | default: |
791 | printk (KERN_INFO PFX "Unknown VIA CPU. Contact davej@codemonkey.org.uk\n"); | 793 | ;; |
792 | } | 794 | } |
793 | 795 | ||
794 | return -ENODEV; | 796 | return -ENODEV; |