Lines Matching refs:raw_val
132 static inline int da9150_gpadc_gpio_6v_voltage_now(int raw_val) in da9150_gpadc_gpio_6v_voltage_now() argument
135 return (6 * ((raw_val * 1000) + 500)) / 1024; in da9150_gpadc_gpio_6v_voltage_now()
138 static inline int da9150_gpadc_ibus_current_avg(int raw_val) in da9150_gpadc_ibus_current_avg() argument
141 return (4 * ((raw_val * 1000) + 500)) / 2048; in da9150_gpadc_ibus_current_avg()
144 static inline int da9150_gpadc_vbus_21v_voltage_now(int raw_val) in da9150_gpadc_vbus_21v_voltage_now() argument
147 return (21 * ((raw_val * 1000) + 500)) / 1024; in da9150_gpadc_vbus_21v_voltage_now()
150 static inline int da9150_gpadc_vsys_6v_voltage_now(int raw_val) in da9150_gpadc_vsys_6v_voltage_now() argument
153 return (3 * ((raw_val * 1000) + 500)) / 512; in da9150_gpadc_vsys_6v_voltage_now()
159 int raw_val; in da9150_gpadc_read_processed() local
161 raw_val = da9150_gpadc_read_adc(gpadc, hw_chan); in da9150_gpadc_read_processed()
162 if (raw_val < 0) in da9150_gpadc_read_processed()
163 return raw_val; in da9150_gpadc_read_processed()
170 *val = da9150_gpadc_gpio_6v_voltage_now(raw_val); in da9150_gpadc_read_processed()
173 *val = da9150_gpadc_ibus_current_avg(raw_val); in da9150_gpadc_read_processed()
176 *val = da9150_gpadc_vbus_21v_voltage_now(raw_val); in da9150_gpadc_read_processed()
179 *val = da9150_gpadc_vsys_6v_voltage_now(raw_val); in da9150_gpadc_read_processed()
183 *val = raw_val; in da9150_gpadc_read_processed()