Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

iio: amplifiers: ad8366: update device support

Add support for the following digital step attenuators:
- HMC271A: 1dB LSB 5-Bit Digital Attenuator SMT, 0.7 - 3.7 GHz
- ADRF5720: 0.5 dB LSB, 6-Bit, Digital Attenuator, 9 kHz to 40 GHz
- ADRF5730: 0.5 dB LSB, 6-Bit, Digital Attenuator, 100 MHz to 40 GHz
- ADRF5731: 2 dB LSB, 4-Bit, Digital Attenuator, 100 MHz to 40 GHz
- HMC1018A: 1.0 dB LSB GaAs MMIC 5-BIT DIGITAL ATTENUATOR, 0.1 - 30 GHz
- HMC1019A: 0.5 dB LSB GaAs MMIC 5-BIT DIGITAL ATTENUATOR, 0.1 - 30 GHz

Additionally, copyright notice was updated with current year.

Co-developed-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Co-developed-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Rodrigo Alencar <rodrigo.alencar@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

Rodrigo Alencar and committed by
Jonathan Cameron
76878a38 d99a03d6

+89 -1
+6
drivers/iio/amplifiers/Kconfig
··· 18 18 AD8366 Dual-Digital Variable Gain Amplifier (VGA) 19 19 ADA4961 BiCMOS RF Digital Gain Amplifier (DGA) 20 20 ADL5240 Digitally controlled variable gain amplifier (VGA) 21 + ADRF5720: 0.5 dB LSB, 6-Bit, Silicon Digital Attenuator 22 + ADRF5730: 0.5 dB LSB, 6-Bit, Silicon Digital Attenuator 23 + ADRF5731: 2 dB LSB, 4-Bit, Silicon Digital Attenuator 24 + HMC271A: 1dB LSB 5-Bit Digital Attenuator SMT 21 25 HMC792A 0.25 dB LSB GaAs MMIC 6-Bit Digital Attenuator 26 + HMC1018A: 1.0 dB LSB GaAs MMIC 5-BIT Digital Attenuator 27 + HMC1019A: 0.5 dB LSB GaAs MMIC 5-BIT Digital Attenuator 22 28 HMC1119 0.25 dB LSB, 7-Bit, Silicon Digital Attenuator 23 29 24 30 To compile this driver as a module, choose M here: the
+83 -1
drivers/iio/amplifiers/ad8366.c
··· 5 5 * AD8366 Dual-Digital Variable Gain Amplifier (VGA) 6 6 * ADA4961 BiCMOS RF Digital Gain Amplifier (DGA) 7 7 * ADL5240 Digitally controlled variable gain amplifier (VGA) 8 + * ADRF5720: 0.5 dB LSB, 6-Bit, Silicon Digital Attenuator, 9 kHz to 40 GHz 9 + * ADRF5730: 0.5 dB LSB, 6-Bit, Silicon Digital Attenuator, 100 MHz to 40 GHz 10 + * ADRF5731: 2 dB LSB, 4-Bit, Silicon Digital Attenuator, 100 MHz to 40 GHz 11 + * HMC271A: 1dB LSB 5-Bit Digital Attenuator SMT, 0.7 - 3.7 GHz 8 12 * HMC792A 0.25 dB LSB GaAs MMIC 6-Bit Digital Attenuator 13 + * HMC1018A: 1.0 dB LSB GaAs MMIC 5-BIT DIGITAL ATTENUATOR, 0.1 - 30 GHz 14 + * HMC1019A: 0.5 dB LSB GaAs MMIC 5-BIT DIGITAL ATTENUATOR, 0.1 - 30 GHz 9 15 * HMC1119 0.25 dB LSB, 7-Bit, Silicon Digital Attenuator 10 16 * 11 - * Copyright 2012-2019 Analog Devices Inc. 17 + * Copyright 2012-2026 Analog Devices Inc. 12 18 */ 13 19 14 20 #include <linux/bitrev.h> ··· 67 61 return sizeof(__be16); 68 62 } 69 63 64 + static size_t adrf5731_pack_code(const unsigned char *code, size_t num_channels, 65 + unsigned char *data) 66 + { 67 + data[0] = code[0] << 2; 68 + return 1; 69 + } 70 + 71 + static size_t hmc271_pack_code(const unsigned char *code, size_t num_channels, 72 + unsigned char *data) 73 + { 74 + data[0] = bitrev8(code[0]) >> 3; 75 + return 1; 76 + } 77 + 70 78 static const struct ad8366_info ad8366_chip_info = { 71 79 .name = "ad8366", 72 80 .gain_min = 4500, ··· 106 86 .num_channels = 1, 107 87 }; 108 88 89 + static const struct ad8366_info adrf5720_chip_info = { 90 + .name = "adrf5720", 91 + .gain_min = -31500, 92 + .gain_max = 0, 93 + .gain_step = -500, 94 + .num_channels = 1, 95 + }; 96 + 97 + static const struct ad8366_info adrf5730_chip_info = { 98 + .name = "adrf5730", 99 + .gain_min = -31500, 100 + .gain_max = 0, 101 + .gain_step = -500, 102 + .num_channels = 1, 103 + }; 104 + 105 + static const struct ad8366_info adrf5731_chip_info = { 106 + .name = "adrf5731", 107 + .gain_min = -30000, 108 + .gain_max = 0, 109 + .gain_step = -2000, 110 + .num_channels = 1, 111 + .pack_code = adrf5731_pack_code, 112 + }; 113 + 114 + static const struct ad8366_info hmc271_chip_info = { 115 + .name = "hmc271a", 116 + .gain_min = -31000, 117 + .gain_max = 0, 118 + .gain_step = 1000, 119 + .num_channels = 1, 120 + .pack_code = hmc271_pack_code, 121 + }; 122 + 109 123 static const struct ad8366_info hmc792_chip_info = { 110 124 .name = "hmc792a", 111 125 .gain_min = -15750, 112 126 .gain_max = 0, 113 127 .gain_step = 250, 128 + .num_channels = 1, 129 + }; 130 + 131 + static const struct ad8366_info hmc1018_chip_info = { 132 + .name = "hmc1018a", 133 + .gain_min = -31000, 134 + .gain_max = 0, 135 + .gain_step = 1000, 136 + .num_channels = 1, 137 + }; 138 + 139 + static const struct ad8366_info hmc1019_chip_info = { 140 + .name = "hmc1019a", 141 + .gain_min = -15500, 142 + .gain_max = 0, 143 + .gain_step = 500, 114 144 .num_channels = 1, 115 145 }; 116 146 ··· 337 267 { "ad8366", (kernel_ulong_t)&ad8366_chip_info }, 338 268 { "ada4961", (kernel_ulong_t)&ada4961_chip_info }, 339 269 { "adl5240", (kernel_ulong_t)&adl5240_chip_info }, 270 + { "adrf5720", (kernel_ulong_t)&adrf5720_chip_info }, 271 + { "adrf5730", (kernel_ulong_t)&adrf5730_chip_info }, 272 + { "adrf5731", (kernel_ulong_t)&adrf5731_chip_info }, 273 + { "hmc271a", (kernel_ulong_t)&hmc271_chip_info }, 340 274 { "hmc792a", (kernel_ulong_t)&hmc792_chip_info }, 275 + { "hmc1018a", (kernel_ulong_t)&hmc1018_chip_info }, 276 + { "hmc1019a", (kernel_ulong_t)&hmc1019_chip_info }, 341 277 { "hmc1119", (kernel_ulong_t)&hmc1119_chip_info }, 342 278 { } 343 279 }; ··· 353 277 { .compatible = "adi,ad8366", .data = &ad8366_chip_info }, 354 278 { .compatible = "adi,ada4961", .data = &ada4961_chip_info }, 355 279 { .compatible = "adi,adl5240", .data = &adl5240_chip_info }, 280 + { .compatible = "adi,adrf5720", .data = &adrf5720_chip_info }, 281 + { .compatible = "adi,adrf5730", .data = &adrf5730_chip_info }, 282 + { .compatible = "adi,adrf5731", .data = &adrf5731_chip_info }, 283 + { .compatible = "adi,hmc271a", .data = &hmc271_chip_info }, 356 284 { .compatible = "adi,hmc792a", .data = &hmc792_chip_info }, 285 + { .compatible = "adi,hmc1018a", .data = &hmc1018_chip_info }, 286 + { .compatible = "adi,hmc1019a", .data = &hmc1019_chip_info }, 357 287 { .compatible = "adi,hmc1119", .data = &hmc1119_chip_info }, 358 288 { } 359 289 };