forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-31 f70575805708cabdedea7498aaa3f710fde4d920
kernel/drivers/iio/dac/cio-dac.c
....@@ -1,15 +1,7 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * IIO driver for the Measurement Computing CIO-DAC
34 * Copyright (C) 2016 William Breathitt Gray
4
- *
5
- * This program is free software; you can redistribute it and/or modify
6
- * it under the terms of the GNU General Public License, version 2, as
7
- * published by the Free Software Foundation.
8
- *
9
- * This program is distributed in the hope that it will be useful, but
10
- * WITHOUT ANY WARRANTY; without even the implied warranty of
11
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
- * General Public License for more details.
135 *
146 * This driver supports the following Measurement Computing devices: CIO-DAC16,
157 * CIO-DAC06, and PC104-DAC06.
....@@ -74,8 +66,8 @@
7466 if (mask != IIO_CHAN_INFO_RAW)
7567 return -EINVAL;
7668
77
- /* DAC can only accept up to a 16-bit value */
78
- if ((unsigned int)val > 65535)
69
+ /* DAC can only accept up to a 12-bit value */
70
+ if ((unsigned int)val > 4095)
7971 return -EINVAL;
8072
8173 priv->chan_out_states[chan->channel] = val;
....@@ -118,7 +110,6 @@
118110 indio_dev->channels = cio_dac_channels;
119111 indio_dev->num_channels = CIO_DAC_NUM_CHAN;
120112 indio_dev->name = dev_name(dev);
121
- indio_dev->dev.parent = dev;
122113
123114 priv = iio_priv(indio_dev);
124115 priv->base = base[id];