]> sigrok.org Git - libsigrok.git/blobdiff - hardware/alsa/alsa.c
sr: s/config_set/dev_config_set/.
[libsigrok.git] / hardware / alsa / alsa.c
index f730f8c80c98659ff3aa888457bf9c0250149ca9..9e33d4309be1302aee90e7b0e630e33c01348dbb 100644 (file)
@@ -42,7 +42,7 @@ struct sr_analog_sample {
        struct sr_analog_probe probes[];
 };
 
-static int capabilities[] = {
+static int hwcaps[] = {
        SR_HWCAP_SAMPLERATE,
        SR_HWCAP_LIMIT_SAMPLES,
        SR_HWCAP_CONTINUOUS,
@@ -86,12 +86,13 @@ static int hw_init(const char *devinfo)
        dev_insts = g_slist_append(dev_insts, sdi);
 
        return 1;
+
 free_alsa:
        g_free(alsa);
        return 0;
 }
 
-static int hw_opendev(int dev_index)
+static int hw_dev_open(int dev_index)
 {
        struct sr_dev_inst *sdi;
        struct alsa *alsa;
@@ -126,7 +127,7 @@ static int hw_opendev(int dev_index)
        return SR_OK;
 }
 
-static int hw_closedev(int dev_index)
+static int hw_dev_close(int dev_index)
 {
        struct sr_dev_inst *sdi;
        struct alsa *alsa;
@@ -164,7 +165,7 @@ static int hw_cleanup(void)
        return SR_OK;
 }
 
-static void *hw_get_dev_info(int dev_index, int dev_info_id)
+static void *hw_dev_info_get(int dev_index, int dev_info_id)
 {
        struct sr_dev_inst *sdi;
        struct alsa *alsa;
@@ -175,7 +176,7 @@ static void *hw_get_dev_info(int dev_index, int dev_info_id)
        alsa = sdi->priv;
 
        switch (dev_info_id) {
-       case SR_DI_INSTANCE:
+       case SR_DI_INST:
                info = sdi;
                break;
        case SR_DI_NUM_PROBES:
@@ -195,7 +196,7 @@ static void *hw_get_dev_info(int dev_index, int dev_info_id)
        return info;
 }
 
-static int hw_get_status(int dev_index)
+static int hw_dev_status_get(int dev_index)
 {
        /* Avoid compiler warnings. */
        dev_index = dev_index;
@@ -203,12 +204,12 @@ static int hw_get_status(int dev_index)
        return SR_ST_ACTIVE;
 }
 
-static int *hw_get_capabilities(void)
+static int *hw_hwcap_get_all(void)
 {
-       return capabilities;
+       return hwcaps;
 }
 
-static int hw_set_configuration(int dev_index, int capability, void *value)
+static int hw_dev_config_set(int dev_index, int hwcap, void *value)
 {
        struct sr_dev_inst *sdi;
        struct alsa *alsa;
@@ -217,7 +218,7 @@ static int hw_set_configuration(int dev_index, int capability, void *value)
                return SR_ERR;
        alsa = sdi->priv;
 
-       switch (capability) {
+       switch (hwcap) {
        case SR_HWCAP_PROBECONFIG:
                return SR_OK;
        case SR_HWCAP_SAMPLERATE:
@@ -289,7 +290,7 @@ static int receive_data(int fd, int revents, void *user_data)
        return TRUE;
 }
 
-static int hw_start_acquisition(int dev_index, gpointer session_dev_id)
+static int hw_dev_acquisition_start(int dev_index, gpointer session_dev_id)
 {
        struct sr_dev_inst *sdi;
        struct alsa *alsa;
@@ -382,7 +383,7 @@ static int hw_start_acquisition(int dev_index, gpointer session_dev_id)
        return SR_OK;
 }
 
-static int hw_stop_acquisition(int dev_index, gpointer session_dev_id)
+static int hw_dev_acquisition_stop(int dev_index, gpointer session_dev_id)
 {
        /* Avoid compiler warnings. */
        dev_index = dev_index;
@@ -397,12 +398,12 @@ SR_PRIV struct sr_dev_plugin alsa_plugin_info = {
        .api_version = 1,
        .init = hw_init,
        .cleanup = hw_cleanup,
-       .opendev = hw_opendev,
-       .closedev = hw_closedev,
-       .get_dev_info = hw_get_dev_info,
-       .get_status = hw_get_status,
-       .get_capabilities = hw_get_capabilities,
-       .set_configuration = hw_set_configuration,
-       .start_acquisition = hw_start_acquisition,
-       .stop_acquisition = hw_stop_acquisition,
+       .dev_open = hw_dev_open,
+       .dev_close = hw_dev_close,
+       .dev_info_get = hw_dev_info_get,
+       .dev_status_get = hw_dev_status_get,
+       .hwcap_get_all = hw_hwcap_get_all,
+       .dev_config_set = hw_dev_config_set,
+       .dev_acquisition_start = hw_dev_acquisition_start,
+       .dev_acquisition_stop = hw_dev_acquisition_stop,
 };