Skip to content

Commit

Permalink
Merge pull request torvalds#543 from analogdevicesinc/hmc7044-features
Browse files Browse the repository at this point in the history
HMC7044 features
  • Loading branch information
mhennerich authored Aug 28, 2019
2 parents bb4063b + 55e4495 commit 239d01a
Show file tree
Hide file tree
Showing 3 changed files with 17 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
11 changes: 10 additions & 1 deletion drivers/iio/frequency/hmc7044.c
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,8 @@ 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;
unsigned int driver_mode;
Expand Down Expand Up @@ -901,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 All @@ -916,6 +918,7 @@ static int hmc7044_setup(struct iio_dev *indio_dev)
hmc7044_write(indio_dev, HMC7044_REG_CH_OUT_CRTL_0(chan->num),
(chan->start_up_mode_dynamic_enable ?
HMC7044_START_UP_MODE_DYN_EN : 0) |
(chan->output_control0_rb4_enable ? BIT(4) : 0) |
(chan->high_performance_mode_dis ?
0 : HMC7044_HI_PERF_MODE) | HMC7044_SYNC_EN |
HMC7044_CH_EN);
Expand Down Expand Up @@ -1086,6 +1089,12 @@ 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");
hmc->channels[cnt].force_mute_enable =
of_property_read_bool(chan_np,
"adi,force-mute-enable");
Expand Down

0 comments on commit 239d01a

Please sign in to comment.