]> sigrok.org Git - libsigrok.git/blobdiff - hardware/alsa/alsa.c
sr: Make more symbols private via static/SR_PRIV.
[libsigrok.git] / hardware / alsa / alsa.c
index 5d0214bdfcc2637bd87c3a2470809f99dd0f89e3..3fa72a8c399dc11965fb5835d908ad15c9dddda1 100644 (file)
@@ -18,7 +18,8 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
  */
 
-#include "config.h" /* Must come before sigrok.h */
+/* Note: This driver doesn't compile, analog support in sigrok is WIP. */
+
 #include <stdlib.h>
 #include <unistd.h>
 #include <string.h>
 #define SAMPLE_WIDTH 16
 #define AUDIO_DEV "plughw:0,0"
 
+struct sr_analog_probe {
+       uint8_t att;
+       uint8_t res;    /* Needs to be a power of 2, FIXME */
+       uint16_t val;   /* Max hardware ADC width is 16bits */
+};
+
+struct sr_analog_sample {
+       uint8_t num_probes; /* Max hardware probes is 256 */
+       struct sr_analog_probe probes[];
+};
+
 static int capabilities[] = {
        SR_HWCAP_SAMPLERATE,
        SR_HWCAP_LIMIT_SAMPLES,
        SR_HWCAP_CONTINUOUS,
 };
 
+static const char *probe_names[NUM_PROBES + 1] = {
+       "0",
+       "1",
+       NULL,
+};
+
 static GSList *device_instances = NULL;
 
 struct alsa {
@@ -160,6 +178,9 @@ static void *hw_get_device_info(int device_index, int device_info_id)
        case SR_DI_NUM_PROBES:
                info = GINT_TO_POINTER(NUM_PROBES);
                break;
+       case SR_DI_PROBE_NAMES:
+               info = probe_names;
+               break;
        case SR_DI_CUR_SAMPLERATE:
                info = &alsa->cur_rate;
                break;
@@ -365,7 +386,7 @@ static void hw_stop_acquisition(int device_index, gpointer session_device_id)
        session_device_id = session_device_id;
 }
 
-struct sr_device_plugin alsa_plugin_info = {
+SR_PRIV struct sr_device_plugin alsa_plugin_info = {
        .name = "alsa",
        .longname = "ALSA driver",
        .api_version = 1,