Skip to content

Commit

Permalink
drivers: adc: adc_ad559x: add invernal vref value
Browse files Browse the repository at this point in the history
Add configuration of internal refference voltage value so raw ADC
readings can be converted to mV utilizing adc_raw_to_millivolts()
ADC API function.

(cherry picked from commit 5523571)

Original-Signed-off-by: Lukasz Madej <l.madej@grinn-global.com>
GitOrigin-RevId: 5523571
Change-Id: Icaa5cbd529dc5aa4d60a6f940a5db05e23987aad
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/zephyr/+/5488596
Commit-Queue: Dawid Niedźwiecki <dawidn@google.com>
Tested-by: ChromeOS Prod (Robot) <chromeos-ci-prod@chromeos-bot.iam.gserviceaccount.com>
Tested-by: Dawid Niedźwiecki <dawidn@google.com>
Reviewed-by: Dawid Niedźwiecki <dawidn@google.com>
  • Loading branch information
LukaszMadejGrinn authored and Chromeos LUCI committed Apr 25, 2024
1 parent b025f90 commit cb72512
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/adc/adc_ad559x.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ LOG_MODULE_REGISTER(adc_ad559x, CONFIG_ADC_LOG_LEVEL);
#define AD559X_ADC_RD_POINTER 0x40

#define AD559X_ADC_RESOLUTION 12U
#define AD559X_ADC_VREF_MV 2500U

struct adc_ad559x_config {
const struct device *mfd_dev;
Expand Down Expand Up @@ -257,6 +258,7 @@ static const struct adc_driver_api adc_ad559x_api = {
#ifdef CONFIG_ADC_ASYNC
.read_async = adc_ad559x_read_async,
#endif
.ref_internal = AD559X_ADC_VREF_MV,
};

#define ADC_AD559X_DEFINE(inst) \
Expand Down

0 comments on commit cb72512

Please sign in to comment.