Lines Matching +full:adc +full:- +full:dev
1 // SPDX-License-Identifier: GPL-2.0+
9 #include <adc.h>
14 struct udevice *dev; in do_adc_list() local
17 ret = uclass_first_device_err(UCLASS_ADC, &dev); in do_adc_list()
19 printf("No available ADC device\n"); in do_adc_list()
24 printf("- %s\n", dev->name); in do_adc_list()
26 ret = uclass_next_device(&dev); in do_adc_list()
29 } while (dev); in do_adc_list()
37 struct udevice *dev; in do_adc_info() local
44 ret = uclass_get_device_by_name(UCLASS_ADC, argv[1], &dev); in do_adc_info()
46 printf("Unknown ADC device %s\n", argv[1]); in do_adc_info()
50 printf("ADC Device '%s' :\n", argv[1]); in do_adc_info()
52 ret = adc_channel_mask(dev, &ch_mask); in do_adc_info()
56 ret = adc_data_mask(dev, &data_mask); in do_adc_info()
60 ret = adc_vdd_value(dev, &vdd); in do_adc_info()
64 ret = adc_vss_value(dev, &vss); in do_adc_info()
74 struct udevice *dev; in do_adc_single() local
89 ret = uclass_get_device_by_name(UCLASS_ADC, argv[1], &dev); in do_adc_single()
90 if (!ret && !adc_raw_to_uV(dev, data, &uV)) in do_adc_single()
102 struct udevice *dev; in do_adc_scan() local
109 ret = uclass_get_device_by_name(UCLASS_ADC, argv[1], &dev); in do_adc_scan()
111 pr_err("Can't get the ADC %s: %d\n", argv[1], ret); in do_adc_scan()
121 ret = adc_channel_mask(dev, &ch_mask); in do_adc_scan()
123 pr_err("Can't get mask for %s: %d\n", dev->name, ret); in do_adc_scan()
129 ret = adc_channels_single_shot(dev->name, ch_mask, ch); in do_adc_scan()
132 dev->name, ch_mask, ret); in do_adc_scan()
139 if (!adc_raw_to_uV(dev, ch[i].data, &uV)) in do_adc_scan()
150 "list - list ADC devices\n"
151 "adc info <name> - Get ADC device info\n"
152 "adc single <name> <channel> - Get Single data of ADC device channel\n"
153 "adc scan <name> [channel mask] - Scan all [or masked] ADC channels";
155 U_BOOT_CMD_WITH_SUBCMDS(adc, "ADC sub-system", adc_help_text,