Merge 4.14-rc4 into staging-next
We want the staging/iio fixes in here as well to handle merge issues. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
@@ -177,6 +177,34 @@ out:
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(ad_sd_read_reg);
|
||||
|
||||
/**
|
||||
* ad_sd_reset() - Reset the serial interface
|
||||
*
|
||||
* @sigma_delta: The sigma delta device
|
||||
* @reset_length: Number of SCLKs with DIN = 1
|
||||
*
|
||||
* Returns 0 on success, an error code otherwise.
|
||||
**/
|
||||
int ad_sd_reset(struct ad_sigma_delta *sigma_delta,
|
||||
unsigned int reset_length)
|
||||
{
|
||||
uint8_t *buf;
|
||||
unsigned int size;
|
||||
int ret;
|
||||
|
||||
size = DIV_ROUND_UP(reset_length, 8);
|
||||
buf = kcalloc(size, sizeof(*buf), GFP_KERNEL);
|
||||
if (!buf)
|
||||
return -ENOMEM;
|
||||
|
||||
memset(buf, 0xff, size);
|
||||
ret = spi_write(sigma_delta->spi, buf, size);
|
||||
kfree(buf);
|
||||
|
||||
return ret;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(ad_sd_reset);
|
||||
|
||||
static int ad_sd_calibrate(struct ad_sigma_delta *sigma_delta,
|
||||
unsigned int mode, unsigned int channel)
|
||||
{
|
||||
|
Reference in New Issue
Block a user