aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/hwmon/w83627ehf.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/hwmon/w83627ehf.c b/drivers/hwmon/w83627ehf.c
index bca7fbcfbece..d9a9ec7dd84a 100644
--- a/drivers/hwmon/w83627ehf.c
+++ b/drivers/hwmon/w83627ehf.c
@@ -309,18 +309,16 @@ static inline int is_word_sized(u16 reg)
309 || (reg & 0x00ff) == 0x55)); 309 || (reg & 0x00ff) == 0x55));
310} 310}
311 311
312/* We assume that the default bank is 0, thus the following two functions do 312/* Registers 0x50-0x5f are banked */
313 nothing for registers which live in bank 0. For others, they respectively
314 set the bank register to the correct value (before the register is
315 accessed), and back to 0 (afterwards). */
316static inline void w83627ehf_set_bank(struct w83627ehf_data *data, u16 reg) 313static inline void w83627ehf_set_bank(struct w83627ehf_data *data, u16 reg)
317{ 314{
318 if (reg & 0xff00) { 315 if ((reg & 0x00f0) == 0x50) {
319 outb_p(W83627EHF_REG_BANK, data->addr + ADDR_REG_OFFSET); 316 outb_p(W83627EHF_REG_BANK, data->addr + ADDR_REG_OFFSET);
320 outb_p(reg >> 8, data->addr + DATA_REG_OFFSET); 317 outb_p(reg >> 8, data->addr + DATA_REG_OFFSET);
321 } 318 }
322} 319}
323 320
321/* Not strictly necessary, but play it safe for now */
324static inline void w83627ehf_reset_bank(struct w83627ehf_data *data, u16 reg) 322static inline void w83627ehf_reset_bank(struct w83627ehf_data *data, u16 reg)
325{ 323{
326 if (reg & 0xff00) { 324 if (reg & 0xff00) {