Lines Matching +full:vdet +full:- +full:disable

1 // SPDX-License-Identifier: GPL-2.0-only
97 st->data[0] = 0x80 | (reg << 1); in __adrf6780_spi_read()
98 st->data[1] = 0x0; in __adrf6780_spi_read()
99 st->data[2] = 0x0; in __adrf6780_spi_read()
101 t.rx_buf = &st->data[0]; in __adrf6780_spi_read()
102 t.tx_buf = &st->data[0]; in __adrf6780_spi_read()
105 ret = spi_sync_transfer(st->spi, &t, 1); in __adrf6780_spi_read()
109 *val = (get_unaligned_be24(&st->data[0]) >> 1) & GENMASK(15, 0); in __adrf6780_spi_read()
119 mutex_lock(&st->lock); in adrf6780_spi_read()
121 mutex_unlock(&st->lock); in adrf6780_spi_read()
130 put_unaligned_be24((val << 1) | (reg << 17), &st->data[0]); in __adrf6780_spi_write()
132 return spi_write(st->spi, &st->data[0], 3); in __adrf6780_spi_write()
140 mutex_lock(&st->lock); in adrf6780_spi_write()
142 mutex_unlock(&st->lock); in adrf6780_spi_write()
168 mutex_lock(&st->lock); in adrf6780_spi_update_bits()
170 mutex_unlock(&st->lock); in adrf6780_spi_update_bits()
179 mutex_lock(&st->lock); in adrf6780_read_adc_raw()
199 ret = -EINVAL; in adrf6780_read_adc_raw()
212 mutex_unlock(&st->lock); in adrf6780_read_adc_raw()
247 switch (chan->channel2) { in adrf6780_read_raw()
258 return -EINVAL; in adrf6780_read_raw()
261 return -EINVAL; in adrf6780_read_raw()
275 switch (chan->channel2) { in adrf6780_write_raw()
287 return -EINVAL; in adrf6780_write_raw()
290 return -EINVAL; in adrf6780_write_raw()
349 struct spi_device *spi = st->spi; in adrf6780_reset()
355 dev_err(&spi->dev, "ADRF6780 SPI software reset failed.\n"); in adrf6780_reset()
363 dev_err(&spi->dev, "ADRF6780 SPI software reset disable failed.\n"); in adrf6780_reset()
374 struct spi_device *spi = st->spi; in adrf6780_init()
387 dev_err(&spi->dev, "ADRF6780 Invalid Chip ID.\n"); in adrf6780_init()
388 return -EINVAL; in adrf6780_init()
401 enable_reg = FIELD_PREP(ADRF6780_VGA_BUFFER_EN_MSK, st->vga_buff_en) | in adrf6780_init()
403 FIELD_PREP(ADRF6780_LO_BUFFER_EN_MSK, st->lo_buff_en) | in adrf6780_init()
404 FIELD_PREP(ADRF6780_IF_MODE_EN_MSK, st->if_mode_en) | in adrf6780_init()
405 FIELD_PREP(ADRF6780_IQ_MODE_EN_MSK, st->iq_mode_en) | in adrf6780_init()
406 FIELD_PREP(ADRF6780_LO_X2_EN_MSK, st->lo_x2_en) | in adrf6780_init()
407 FIELD_PREP(ADRF6780_LO_PPF_EN_MSK, st->lo_ppf_en) | in adrf6780_init()
408 FIELD_PREP(ADRF6780_LO_EN_MSK, st->lo_en) | in adrf6780_init()
409 FIELD_PREP(ADRF6780_UC_BIAS_EN_MSK, st->uc_bias_en); in adrf6780_init()
418 FIELD_PREP(ADRF6780_LO_SIDEBAND_MSK, st->lo_sideband)); in adrf6780_init()
424 FIELD_PREP(ADRF6780_VDET_OUTPUT_SELECT_MSK, st->vdet_out_en)); in adrf6780_init()
429 struct spi_device *spi = st->spi; in adrf6780_properties_parse()
431 st->vga_buff_en = device_property_read_bool(&spi->dev, "adi,vga-buff-en"); in adrf6780_properties_parse()
432 st->lo_buff_en = device_property_read_bool(&spi->dev, "adi,lo-buff-en"); in adrf6780_properties_parse()
433 st->if_mode_en = device_property_read_bool(&spi->dev, "adi,if-mode-en"); in adrf6780_properties_parse()
434 st->iq_mode_en = device_property_read_bool(&spi->dev, "adi,iq-mode-en"); in adrf6780_properties_parse()
435 st->lo_x2_en = device_property_read_bool(&spi->dev, "adi,lo-x2-en"); in adrf6780_properties_parse()
436 st->lo_ppf_en = device_property_read_bool(&spi->dev, "adi,lo-ppf-en"); in adrf6780_properties_parse()
437 st->lo_en = device_property_read_bool(&spi->dev, "adi,lo-en"); in adrf6780_properties_parse()
438 st->uc_bias_en = device_property_read_bool(&spi->dev, "adi,uc-bias-en"); in adrf6780_properties_parse()
439 st->lo_sideband = device_property_read_bool(&spi->dev, "adi,lo-sideband"); in adrf6780_properties_parse()
440 st->vdet_out_en = device_property_read_bool(&spi->dev, "adi,vdet-out-en"); in adrf6780_properties_parse()
445 /* Disable all components in the Enable Register */ in adrf6780_powerdown()
455 indio_dev = devm_iio_device_alloc(&spi->dev, sizeof(*st)); in adrf6780_probe()
457 return -ENOMEM; in adrf6780_probe()
461 indio_dev->info = &adrf6780_info; in adrf6780_probe()
462 indio_dev->name = "adrf6780"; in adrf6780_probe()
463 indio_dev->channels = adrf6780_channels; in adrf6780_probe()
464 indio_dev->num_channels = ARRAY_SIZE(adrf6780_channels); in adrf6780_probe()
466 st->spi = spi; in adrf6780_probe()
470 st->clkin = devm_clk_get_enabled(&spi->dev, "lo_in"); in adrf6780_probe()
471 if (IS_ERR(st->clkin)) in adrf6780_probe()
472 return dev_err_probe(&spi->dev, PTR_ERR(st->clkin), in adrf6780_probe()
475 mutex_init(&st->lock); in adrf6780_probe()
481 ret = devm_add_action_or_reset(&spi->dev, adrf6780_powerdown, st); in adrf6780_probe()
485 return devm_iio_device_register(&spi->dev, indio_dev); in adrf6780_probe()