/* Enables/Disables watchdog timer and sets the timeout period.  */
void ad5755_watch_dog_setup(struct ad5755_dev *dev, uint8_t wtd_enable, uint8_t timeout)
/* Enables/Disables watchdog timer and sets the timeout period.  */
void ad5755_watch_dog_setup(struct ad5755_dev *dev, uint8_t wtd_enable, uint8_t timeout)
{
	uint32_t old_main_ctrl_reg = 0;
	uint32_t new_main_ctrl_reg = 0;
	old_main_ctrl_reg = ad5755_get_register_value(dev,
			    AD5755_RD_MAIN_CTRL_REG);
	old_main_ctrl_reg &= ~(AD5755_MAIN_EWD | AD5755_MAIN_WD(3));
	new_main_ctrl_reg = old_main_ctrl_reg |
			    (AD5755_MAIN_EWD * wtd_enable) |
			    AD5755_MAIN_WD(timeout);
	ad5755_set_control_registers(dev,
				     AD5755_CREG_MAIN,
				     0,
				     new_main_ctrl_reg);
}