Lines Matching +full:switch +full:- +full:frequency +full:- +full:hz

1 // SPDX-License-Identifier: GPL-2.0
5 * Copyright (c) 2010-2010 Analog Devices Inc.
19 * Although chip's max frequency is 2Mhz, it needs 600ns between CS and the
20 * first falling edge of SCLK, so frequency should be at most 1 / (2 * 6e-7)
39 if (chan->type != IIO_ANGL) in ad2s90_read_raw()
40 return -EINVAL; in ad2s90_read_raw()
42 switch (m) { in ad2s90_read_raw()
49 mutex_lock(&st->lock); in ad2s90_read_raw()
50 ret = spi_read(st->sdev, st->rx, 2); in ad2s90_read_raw()
52 mutex_unlock(&st->lock); in ad2s90_read_raw()
55 *val = (((u16)(st->rx[0])) << 4) | ((st->rx[1] & 0xF0) >> 4); in ad2s90_read_raw()
57 mutex_unlock(&st->lock); in ad2s90_read_raw()
64 return -EINVAL; in ad2s90_read_raw()
83 if (spi->max_speed_hz > AD2S90_MAX_SPI_FREQ_HZ) { in ad2s90_probe()
84 dev_err(&spi->dev, "SPI CLK, %d Hz exceeds %d Hz\n", in ad2s90_probe()
85 spi->max_speed_hz, AD2S90_MAX_SPI_FREQ_HZ); in ad2s90_probe()
86 return -EINVAL; in ad2s90_probe()
89 indio_dev = devm_iio_device_alloc(&spi->dev, sizeof(*st)); in ad2s90_probe()
91 return -ENOMEM; in ad2s90_probe()
95 mutex_init(&st->lock); in ad2s90_probe()
96 st->sdev = spi; in ad2s90_probe()
97 indio_dev->info = &ad2s90_info; in ad2s90_probe()
98 indio_dev->modes = INDIO_DIRECT_MODE; in ad2s90_probe()
99 indio_dev->channels = &ad2s90_chan; in ad2s90_probe()
100 indio_dev->num_channels = 1; in ad2s90_probe()
101 indio_dev->name = spi_get_device_id(spi)->name; in ad2s90_probe()
103 return devm_iio_device_register(indio_dev->dev.parent, indio_dev); in ad2s90_probe()