Skip to content

Instantly share code, notes, and snippets.

@checko
Created March 18, 2014 01:40
Show Gist options
  • Save checko/9611991 to your computer and use it in GitHub Desktop.
Save checko/9611991 to your computer and use it in GitHub Desktop.
#include <fcntl.h>
#include <sys/ioctl.h>
#include <hwdep.h>
#include <error.h>
#include <stdio.h>
#include "rt56xx_ioctl.h"
int main()
{
snd_hwdep_t *hwdep;
int err;
int i;
struct rt56xx_cmd cmd;
int buf[0x80];
cmd.buf = &buf;
if ((err = snd_hwdep_open(&hwdep, "hw:3,0", O_RDWR)) < 0) {
printf("snd_hwdep open failed! %s\n",snd_strerror(err));
return -1;
}
if ((err = snd_hwdep_ioctl(hwdep,RT_READ_ALL_CODEC_REG_IOCTL, &cmd)) < 0 ) {
printf("snd_hwdep ioctl failed! %s\n",snd_strerror(err));
return -1;
}
for(i=0;i<0x80;i++){
printf("%03X, %08X\n",i,buf[i]);
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment