arm: mvebu: clearfog: enable SATA in SPL
[oweals/u-boot.git] / include / adc.h
index d04c9c49262ded41a4ab3fea801e4202e5dcce28..5841dfb54b9fb7747d2183962f6c3680ddcc1f07 100644 (file)
@@ -218,6 +218,17 @@ int adc_channels_data(struct udevice *dev, unsigned int channel_mask,
  */
 int adc_data_mask(struct udevice *dev, unsigned int *data_mask);
 
+/**
+ * adc_channel_mask() - get channel mask for given ADC device
+ *
+ * This can be used if adc uclass platform data is filled.
+ *
+ * @dev:       ADC device to check
+ * @channel_mask: pointer to the returned channel bitmask
+ * @return: 0 if OK, -ve on error
+ */
+int adc_channel_mask(struct udevice *dev, unsigned int *channel_mask);
+
 /**
  * adc_channel_single_shot() - get output data of conversion for the ADC
  * device's channel. This function searches for the device with the given name,
@@ -284,4 +295,14 @@ int adc_vss_value(struct udevice *dev, int *uV);
  */
 int adc_stop(struct udevice *dev);
 
+/**
+ * adc_raw_to_uV() - converts raw value to microvolts for given ADC device.
+ *
+ * @dev:     ADC device used from conversion
+ * @raw:     raw value to convert
+ * @uV:             converted value in microvolts
+ * @return:  0 on success or -ve on error
+ */
+int adc_raw_to_uV(struct udevice *dev, unsigned int raw, int *uV);
+
 #endif