Skip to content

Commit

Permalink
iio: frequency: hmc7044: Add option to control the dynamic driver mode
Browse files Browse the repository at this point in the history
It's desirable to control the dynamic driver option independent from
the start-up mode dynamic. (Pulse generator / SYSREF mode)

Signed-off-by: Michael Hennerich <[email protected]>
  • Loading branch information
mhennerich committed Aug 28, 2019
1 parent 9d6a091 commit 55e4495
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
3 changes: 3 additions & 0 deletions Documentation/devicetree/bindings/iio/frequency/hmc7044.txt
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ Adding channels:
- adi,high-performance-mode-disable: Disables the high performance mode
- adi,startup-mode-dynamic-enable: Enables pulse generator mode
(default mode is asynchronous)
- adi,dynamic-driver-enable: Driver is dynamically disabled with pulse
generator events. (only in adi,startup-mode-dynamic-enable mode)
(default driver is enabled/disabled with the channel)
- adi,force-mute-enable: When not generating pulses in dynamic mode
the output is forced to logic-0
- adi,coarse-digital-delay: Adjusts the phase of the divider signal
Expand Down
4 changes: 4 additions & 0 deletions arch/microblaze/boot/dts/adi-dual-ad9208.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
adi,driver-mode = <HMC7044_DRIVER_MODE_LVDS>; // LVDS
adi,startup-mode-dynamic-enable;
adi,high-performance-mode-disable;
adi,dynamic-driver-enable;
};
hmc7044_c2: channel@2 {
reg = <2>;
Expand All @@ -63,6 +64,7 @@
adi,driver-mode = <HMC7044_DRIVER_MODE_LVDS>; // LVDS
adi,startup-mode-dynamic-enable;
adi,high-performance-mode-disable;
adi,dynamic-driver-enable;
};
hmc7044_c8: channel@8 {
reg = <8>;
Expand All @@ -83,6 +85,7 @@
adi,driver-mode = <HMC7044_DRIVER_MODE_LVDS>; // LVDS
adi,startup-mode-dynamic-enable;
adi,high-performance-mode-disable;
adi,dynamic-driver-enable;
};
hmc7044_c11: channel@11 {
reg = <11>;
Expand All @@ -91,6 +94,7 @@
adi,driver-mode = <HMC7044_DRIVER_MODE_LVDS>; // LVDS
adi,startup-mode-dynamic-enable;
adi,high-performance-mode-disable;
adi,dynamic-driver-enable;
};

};
Expand Down
6 changes: 5 additions & 1 deletion drivers/iio/frequency/hmc7044.c
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ struct hmc7044_chan_spec {
bool disable;
bool high_performance_mode_dis;
bool start_up_mode_dynamic_enable;
bool dynamic_driver_enable;
bool output_control0_rb4_enable;
bool force_mute_enable;
unsigned int divider;
Expand Down Expand Up @@ -902,7 +903,7 @@ static int hmc7044_setup(struct iio_dev *indio_dev)
hmc7044_write(indio_dev, HMC7044_REG_CH_OUT_CRTL_8(chan->num),
HMC7044_DRIVER_MODE(chan->driver_mode) |
HMC7044_DRIVER_Z_MODE(chan->driver_impedance) |
(chan->start_up_mode_dynamic_enable ?
(chan->dynamic_driver_enable ?
HMC7044_DYN_DRIVER_EN : 0) |
(chan->force_mute_enable ?
HMC7044_FORCE_MUTE_EN : 0));
Expand Down Expand Up @@ -1088,6 +1089,9 @@ static int hmc7044_parse_dt(struct device *dev,
hmc->channels[cnt].start_up_mode_dynamic_enable =
of_property_read_bool(chan_np,
"adi,startup-mode-dynamic-enable");
hmc->channels[cnt].dynamic_driver_enable =
of_property_read_bool(chan_np,
"adi,dynamic-driver-enable");
hmc->channels[cnt].output_control0_rb4_enable =
of_property_read_bool(chan_np,
"adi,control0-rb4-enable");
Expand Down

0 comments on commit 55e4495

Please sign in to comment.