]> git.baikalelectronics.ru Git - kernel.git/commit
hwmon: (applesmc) Introduce a register lookup table
authorHenrik Rydberg <rydberg@euromail.se>
Wed, 10 Nov 2010 10:58:03 +0000 (10:58 +0000)
committerGuenter Roeck <guenter.roeck@ericsson.com>
Sat, 8 Jan 2011 18:55:38 +0000 (10:55 -0800)
commit982230652b01a7bc006ad6e342ed3c30c7194764
tree4f2ccb1b543674d183469cb562f8f2b0cce00c53
parent9b69465d6c21c567b902b6eef44152ad390a6b8c
hwmon: (applesmc) Introduce a register lookup table

One main problem with the current driver is the inability to quickly
search for supported keys, resulting in detailed feature maps per
machine model which are cumbersome to maintain.

This patch adds a register lookup table, which enables binary search
for supported keys. The lookup also reduces the io frequency, so the
original mutex is replaced by locks around the actual io.

Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
[guenter.roeck@ericsson.com: Added value range check to key_at_index_store()]
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
drivers/hwmon/applesmc.c