From 0a6b7e5eebf71b484cb46c22bfbf5ba156b98975 Mon Sep 17 00:00:00 2001 From: Kantipudi-Supriya Date: Mon, 25 Nov 2024 17:27:54 +0530 Subject: [PATCH 1/2] "Modified the ad5754r_iio.c" Signed-off-by: Kantipudi-Supriya --- projects/ad5754r_iio/app/ad5754r_iio.c | 86 +++++++++++++------------- 1 file changed, 43 insertions(+), 43 deletions(-) diff --git a/projects/ad5754r_iio/app/ad5754r_iio.c b/projects/ad5754r_iio/app/ad5754r_iio.c index 56c10043..2262cad3 100644 --- a/projects/ad5754r_iio/app/ad5754r_iio.c +++ b/projects/ad5754r_iio/app/ad5754r_iio.c @@ -1297,63 +1297,63 @@ int32_t ad5754r_iio_init(void) #if defined(DEV_CN0586) if (hw_mezzanine_is_valid) { #endif - /* Initialize AD5754R no-os device driver interface */ - ret = ad5754r_init(&ad5754r_dev_inst, &ad5754r_init_params); - if (ret) { - return ret; - } + /* Initialize AD5754R no-os device driver interface */ + ret = ad5754r_init(&ad5754r_dev_inst, &ad5754r_init_params); + if (ret) { + return ret; + } - /* Check if descriptors have been assigned for GPIOs */ - if (ad5754r_init_params.gpio_clear_init) { - if (!ad5754r_dev_inst->gpio_clear) { - return -ENOSYS; - } + /* Check if descriptors have been assigned for GPIOs */ + if (ad5754r_init_params.gpio_clear_init) { + if (!ad5754r_dev_inst->gpio_clear) { + return -ENOSYS; } + } - if (ad5754r_init_params.gpio_ldac_init) { - if (!ad5754r_dev_inst->gpio_ldac) { - return -ENOSYS; - } + if (ad5754r_init_params.gpio_ldac_init) { + if (!ad5754r_dev_inst->gpio_ldac) { + return -ENOSYS; } + } - /* Initialize the AD5754R IIO app specific parameters */ - ret = ad5754r_iio_param_init(&ad5754r_iio_dev); + /* Initialize the AD5754R IIO app specific parameters */ + ret = ad5754r_iio_param_init(&ad5754r_iio_dev); + if (ret) { + return ret; + } + iio_init_params.nb_devs++; + +#ifdef DEV_CN0586 + if (ad5754r_dev_inst) { + ret = cn0586_init(&cn0586_dev_inst, ad5754r_dev_inst); if (ret) { return ret; } - iio_init_params.nb_devs++; - -#ifdef DEV_CN0586 - if (ad5754r_dev_inst) { - ret = cn0586_init(&cn0586_dev_inst, ad5754r_dev_inst); - if (ret) { - return ret; - } - ret = cn0586_iio_param_init(&cn0586_iio_dev); - if (ret) { - return ret; - } - iio_init_params.nb_devs++; + ret = cn0586_iio_param_init(&cn0586_iio_dev); + if (ret) { + return ret; } + iio_init_params.nb_devs++; + } #endif - /* AD5754R IIO device init parameters */ - iio_device_init_params[0].name = ACTIVE_DEVICE_NAME; - iio_device_init_params[0].raw_buf = dac_data_buffer; - iio_device_init_params[0].raw_buf_len = DATA_BUFFER_SIZE; - iio_device_init_params[0].dev = ad5754r_dev_inst; - iio_device_init_params[0].dev_descriptor = ad5754r_iio_dev; - iio_device_init_params[0].trigger_id = "trigger0"; + /* AD5754R IIO device init parameters */ + iio_device_init_params[0].name = ACTIVE_DEVICE_NAME; + iio_device_init_params[0].raw_buf = dac_data_buffer; + iio_device_init_params[0].raw_buf_len = DATA_BUFFER_SIZE; + iio_device_init_params[0].dev = ad5754r_dev_inst; + iio_device_init_params[0].dev_descriptor = ad5754r_iio_dev; + iio_device_init_params[0].trigger_id = "trigger0"; #ifdef DEV_CN0586 - /* CFTL IIO device init parameters */ - iio_device_init_params[1].name = "cn0586"; - iio_device_init_params[1].raw_buf = dac_data_buffer; - iio_device_init_params[1].raw_buf_len = DATA_BUFFER_SIZE; - iio_device_init_params[1].dev = cn0586_dev_inst; - iio_device_init_params[1].dev_descriptor = cn0586_iio_dev; - iio_device_init_params[1].trigger_id = NULL; // TODO + /* CFTL IIO device init parameters */ + iio_device_init_params[1].name = "cn0586"; + iio_device_init_params[1].raw_buf = dac_data_buffer; + iio_device_init_params[1].raw_buf_len = DATA_BUFFER_SIZE; + iio_device_init_params[1].dev = cn0586_dev_inst; + iio_device_init_params[1].dev_descriptor = cn0586_iio_dev; + iio_device_init_params[1].trigger_id = NULL; // TODO #endif #if defined(DEV_CN0586) From dd1ec1f68c1f432920577e552f17eb92176e489a Mon Sep 17 00:00:00 2001 From: Kantipudi-Supriya Date: Fri, 17 Jan 2025 16:17:00 +0530 Subject: [PATCH 2/2] Modified the device name --- projects/ad559xr_console/app/app_config.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/ad559xr_console/app/app_config.h b/projects/ad559xr_console/app/app_config.h index 1cb04548..c9ef9ce6 100644 --- a/projects/ad559xr_console/app/app_config.h +++ b/projects/ad559xr_console/app/app_config.h @@ -36,7 +36,7 @@ // The ACTIVE_DEVICE is default set to AD5592R, if device type is not defined. #if !defined(ACTIVE_DEVICE) -#define ACTIVE_DEVICE DEV_AD5592R +#define ACTIVE_DEVICE DEV_AD5593R #endif /**