[PATCH v2 6/6] mmdevapi: Take the wave format validation code from the tests.