mfd: Refactor ab8500 GPADC API, add raw access
Refactor the GPADC interface to avoid bugs in calling code: - ab8500_gpadc_[convert|read_raw|ad_to_voltage] clarifies each functions use case, *convert wraps *read_raw, and we can access raw ADC values properly. - Renamed gpadc function arguments from "input" to "channel" to clarify use, so we don't get confused again. Signed-off-by: Kalle Komierowski <kalle.komierowski@stericsson.com> Reviewed-by: Mattias Wallin <mattias.wallin@stericsson.com> Reviewed-by: John Beckett <john.beckett@stericsson.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
This commit is contained in:
committed by
Samuel Ortiz
parent
981c65a9b3
commit
bd4a40b57b
@@ -27,6 +27,9 @@
|
||||
struct ab8500_gpadc;
|
||||
|
||||
struct ab8500_gpadc *ab8500_gpadc_get(char *name);
|
||||
int ab8500_gpadc_convert(struct ab8500_gpadc *gpadc, u8 input);
|
||||
int ab8500_gpadc_convert(struct ab8500_gpadc *gpadc, u8 channel);
|
||||
int ab8500_gpadc_read_raw(struct ab8500_gpadc *gpadc, u8 channel);
|
||||
int ab8500_gpadc_ad_to_voltage(struct ab8500_gpadc *gpadc,
|
||||
u8 channel, int ad_value);
|
||||
|
||||
#endif /* _AB8500_GPADC_H */
|
||||
|
||||
Reference in New Issue
Block a user