hwcontext: add a function for opening devices