This is taken from the lgs8gxx driver as of 2.6.32-rc5. Signed-off-by: Ben Hutchings <ben@decadent.org.uk>