diff options
Diffstat (limited to 'drivers/iio/adc/ad799x.c')
| -rw-r--r-- | drivers/iio/adc/ad799x.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/drivers/iio/adc/ad799x.c b/drivers/iio/adc/ad799x.c index e37412da15f5..b99de00e57b8 100644 --- a/drivers/iio/adc/ad799x.c +++ b/drivers/iio/adc/ad799x.c | |||
| @@ -143,9 +143,15 @@ static int ad799x_write_config(struct ad799x_state *st, u16 val) | |||
| 143 | case ad7998: | 143 | case ad7998: |
| 144 | return i2c_smbus_write_word_swapped(st->client, AD7998_CONF_REG, | 144 | return i2c_smbus_write_word_swapped(st->client, AD7998_CONF_REG, |
| 145 | val); | 145 | val); |
| 146 | default: | 146 | case ad7992: |
| 147 | case ad7993: | ||
| 148 | case ad7994: | ||
| 147 | return i2c_smbus_write_byte_data(st->client, AD7998_CONF_REG, | 149 | return i2c_smbus_write_byte_data(st->client, AD7998_CONF_REG, |
| 148 | val); | 150 | val); |
| 151 | default: | ||
| 152 | /* Will be written when doing a conversion */ | ||
| 153 | st->config = val; | ||
| 154 | return 0; | ||
| 149 | } | 155 | } |
| 150 | } | 156 | } |
| 151 | 157 | ||
| @@ -155,8 +161,13 @@ static int ad799x_read_config(struct ad799x_state *st) | |||
| 155 | case ad7997: | 161 | case ad7997: |
| 156 | case ad7998: | 162 | case ad7998: |
| 157 | return i2c_smbus_read_word_swapped(st->client, AD7998_CONF_REG); | 163 | return i2c_smbus_read_word_swapped(st->client, AD7998_CONF_REG); |
| 158 | default: | 164 | case ad7992: |
| 165 | case ad7993: | ||
| 166 | case ad7994: | ||
| 159 | return i2c_smbus_read_byte_data(st->client, AD7998_CONF_REG); | 167 | return i2c_smbus_read_byte_data(st->client, AD7998_CONF_REG); |
| 168 | default: | ||
| 169 | /* No readback support */ | ||
| 170 | return st->config; | ||
| 160 | } | 171 | } |
| 161 | } | 172 | } |
| 162 | 173 | ||
