imported from commit bd76729. Only minor changes to make it compile. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
bd76729