aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorVenkatesh Pallipadi <venkatesh.pallipadi@intel.com>2006-12-13 13:41:16 -0500
committerDave Jones <davej@redhat.com>2006-12-13 18:12:31 -0500
commit4e581ff165f26ba3d37a4a836b2e3add47bec72f (patch)
treefaa1c83b7d9faceb41da85af970c42bb7393f901 /arch
parent4ab70df451c6183dd5474a68edac44684b0b7616 (diff)
[CPUFREQ] Trivial cleanup for acpi read/write port in acpi-cpufreq.c
Small cleanup in acpi-cpufreq. Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com> Signed-off-by: Dave Jones <davej@redhat.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c29
1 files changed, 6 insertions, 23 deletions
diff --git a/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c b/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c
index 18f4715c655d..8e0b995f79ec 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
129static 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
139static 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
150struct msr_addr { 129struct 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;