Skip to content

Commit def914a

Browse files
stefpopaJonathan Cameron
authored andcommitted
iio: frequency: adf4371: Add support for output stage mute
Another feature of the ADF4371/ADF4372 is that the supply current to the RF8P and RF8N output stage can shut down until the ADF4371 achieves lock as measured by the digital lock detect circuitry. The mute to lock detect bit (MUTE_LD) in REG25 enables this function. Signed-off-by: Stefan Popa <stefan.popa@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
1 parent 84ed648 commit def914a

2 files changed

Lines changed: 20 additions & 0 deletions

File tree

‎Documentation/devicetree/bindings/iio/frequency/adf4371.yaml‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,13 @@ properties:
3333
Must be "clkin"
3434
maxItems: 1
3535

36+
adi,mute-till-lock-en:
37+
type: boolean
38+
description:
39+
If this property is present, then the supply current to RF8P and RF8N
40+
output stage will shut down until the ADF4371/ADF4372 achieves lock as
41+
measured by the digital lock detect circuitry.
42+
3643
required:
3744
- compatible
3845
- reg

‎drivers/iio/frequency/adf4371.c‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@
4545
#define ADF4371_RF_DIV_SEL_MSK GENMASK(6, 4)
4646
#define ADF4371_RF_DIV_SEL(x) FIELD_PREP(ADF4371_RF_DIV_SEL_MSK, x)
4747

48+
/* ADF4371_REG25 */
49+
#define ADF4371_MUTE_LD_MSK BIT(7)
50+
#define ADF4371_MUTE_LD(x) FIELD_PREP(ADF4371_MUTE_LD_MSK, x)
51+
4852
/* ADF4371_REG32 */
4953
#define ADF4371_TIMEOUT_MSK GENMASK(1, 0)
5054
#define ADF4371_TIMEOUT(x) FIELD_PREP(ADF4371_TIMEOUT_MSK, x)
@@ -484,6 +488,15 @@ static int adf4371_setup(struct adf4371_state *st)
484488
if (ret < 0)
485489
return ret;
486490

491+
/* Mute to Lock Detect */
492+
if (device_property_read_bool(&st->spi->dev, "adi,mute-till-lock-en")) {
493+
ret = regmap_update_bits(st->regmap, ADF4371_REG(0x25),
494+
ADF4371_MUTE_LD_MSK,
495+
ADF4371_MUTE_LD(1));
496+
if (ret < 0)
497+
return ret;
498+
}
499+
487500
/* Set address in ascending order, so the bulk_write() will work */
488501
ret = regmap_update_bits(st->regmap, ADF4371_REG(0x0),
489502
ADF4371_ADDR_ASC_MSK | ADF4371_ADDR_ASC_R_MSK,

0 commit comments

Comments
 (0)