Skip to content

Commit

Permalink
Revert "changing how POR is handled, to use a time delay to wait for …
Browse files Browse the repository at this point in the history
…device to be ready instead of polling the POR status bit which has read to clear behavior."

This reverts commit 2d0f342.
  • Loading branch information
Mircea Caprioru committed Aug 28, 2019
1 parent 2d0f342 commit 4759a01
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 15 deletions.
16 changes: 3 additions & 13 deletions drivers/adc/ad7124/ad7124.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* @devices AD7124-4, AD7124-8
*
********************************************************************************
* Copyright 2015, 2019 (c) Analog Devices, Inc.
* Copyright 2015(c) Analog Devices, Inc.
*
* All rights reserved.
*
Expand Down Expand Up @@ -47,15 +47,7 @@
/* Error codes */
#define INVALID_VAL -1 /* Invalid argument */
#define COMM_ERR -2 /* Communication error on receive */
#define TIMEOUT -3 /* A timeout has occurred */

/*
* Post reset delay required to ensure all internal config done
* A time of 2ms should be enough based on the data sheet, but 4ms
* chosen to provide enough margin, in case mdelay is not accurate.
*/
#define AD7124_POST_RESET_DELAY 4

#define TIMEOUT -3 /* A timeout has occured */

/***************************************************************************//**
* @brief Reads the value of the specified register without checking if the
Expand Down Expand Up @@ -239,12 +231,10 @@ int32_t ad7124_reset(struct ad7124_dev *dev)
wr_buf,
8);

/* Read POR bit to clear */
/* Wait for the reset to complete */
ret = ad7124_wait_to_power_on(dev,
dev->spi_rdy_poll_cnt);

mdelay(AD7124_POST_RESET_DELAY);

return ret;
}

Expand Down
3 changes: 1 addition & 2 deletions drivers/adc/ad7124/ad7124.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* @devices AD7124-4, AD7124-8
*
********************************************************************************
* Copyright 2015, 2019 (c) Analog Devices, Inc.
* Copyright 2015(c) Analog Devices, Inc.
*
* All rights reserved.
*
Expand Down Expand Up @@ -46,7 +46,6 @@
/******************************************************************************/
#include <stdint.h>
#include "spi.h"
#include "delay.h"

/******************************************************************************/
/******************* Register map and register definitions ********************/
Expand Down

0 comments on commit 4759a01

Please sign in to comment.