Initial work done by Aleksandar Zivkovic at http://patchwork.ozlabs.org/patch/171109/. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>