};
static const struct sr_samplerates samplerates = {
- 0,
- 0,
- 0,
- supported_samplerates,
+ .low = 0,
+ .high = 0,
+ .step = 0,
+ .list = supported_samplerates,
};
SR_PRIV struct sr_dev_driver fx2lafw_driver_info;
static int hw_init(struct sr_context *sr_ctx)
{
- struct drv_context *drvc;
-
- if (!(drvc = g_try_malloc0(sizeof(struct drv_context)))) {
- sr_err("Driver context malloc failed.");
- return SR_ERR_MALLOC;
- }
-
- drvc->sr_ctx = sr_ctx;
- di->priv = drvc;
-
- return SR_OK;
+ return std_hw_init(sr_ctx, di, DRIVER_LOG_DOMAIN);
}
static GSList *hw_scan(GSList *options)
static GSList *hw_dev_list(void)
{
- struct drv_context *drvc;
-
- drvc = di->priv;
-
- return drvc->instances;
+ return ((struct drv_context *)(di->priv))->instances;
}
static int hw_dev_open(struct sr_dev_inst *sdi)
struct dev_context *devc;
switch (id) {
- case SR_DI_HWCAPS:
- *data = hwcaps;
- break;
case SR_CONF_SAMPLERATE:
if (sdi) {
devc = sdi->priv;
(void)sdi;
switch (key) {
+ case SR_CONF_DEVICE_OPTIONS:
+ *data = hwcaps;
+ break;
case SR_CONF_SAMPLERATE:
*data = &samplerates;
break;