Lines Matching +full:vcca +full:- +full:supply

1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * powr1220.c - Driver for the Lattice POWR1220 programmable power supply
17 #include <linux/hwmon-sysfs.h>
71 VCCA, enumerator
102 [VCCA] = "vcca",
114 mutex_lock(&data->update_lock); in powr1220_read_adc()
116 if (time_after(jiffies, data->adc_last_updated[ch_num] + HZ) || in powr1220_read_adc()
117 !data->adc_valid[ch_num]) { in powr1220_read_adc()
124 if (data->adc_maxes[ch_num] > ADC_MAX_LOW_MEASUREMENT_MV || in powr1220_read_adc()
125 data->adc_maxes[ch_num] == 0) in powr1220_read_adc()
129 result = i2c_smbus_write_byte_data(data->client, ADC_MUX, in powr1220_read_adc()
141 result = i2c_smbus_read_byte_data(data->client, ADC_VALUE_LOW); in powr1220_read_adc()
148 result = i2c_smbus_read_byte_data(data->client, ADC_VALUE_HIGH); in powr1220_read_adc()
156 data->adc_values[ch_num] = reading; in powr1220_read_adc()
157 data->adc_valid[ch_num] = true; in powr1220_read_adc()
158 data->adc_last_updated[ch_num] = jiffies; in powr1220_read_adc()
161 if (reading > data->adc_maxes[ch_num]) in powr1220_read_adc()
162 data->adc_maxes[ch_num] = reading; in powr1220_read_adc()
164 result = data->adc_values[ch_num]; in powr1220_read_adc()
168 mutex_unlock(&data->update_lock); in powr1220_read_adc()
179 if (channel >= chip_data->max_channels) in powr1220_is_visible()
211 return -EOPNOTSUPP; in powr1220_read_string()
215 return -EOPNOTSUPP; in powr1220_read_string()
218 return -EOPNOTSUPP; in powr1220_read_string()
238 *val = data->adc_maxes[channel]; in powr1220_read()
241 return -EOPNOTSUPP; in powr1220_read()
245 return -EOPNOTSUPP; in powr1220_read()
288 if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE_DATA)) in powr1220_probe()
289 return -ENODEV; in powr1220_probe()
291 data = devm_kzalloc(&client->dev, sizeof(*data), GFP_KERNEL); in powr1220_probe()
293 return -ENOMEM; in powr1220_probe()
298 data->max_channels = 10; in powr1220_probe()
301 data->max_channels = 12; in powr1220_probe()
305 mutex_init(&data->update_lock); in powr1220_probe()
306 data->client = client; in powr1220_probe()
308 hwmon_dev = devm_hwmon_device_register_with_info(&client->dev, in powr1220_probe()
309 client->name, in powr1220_probe()