Lines Matching full:code
56 int (*gain_dB_to_code)(int gain, int *code);
57 int (*code_to_gain_dB)(int code, int *val, int *val2);
68 static int gain_dB_to_code(struct hmc425a_state *st, int val, int val2, int *code) in gain_dB_to_code() argument
83 return st->chip_info->gain_dB_to_code(gain, code); in gain_dB_to_code()
86 static int hmc425a_gain_dB_to_code(int gain, int *code) in hmc425a_gain_dB_to_code() argument
88 *code = ~((abs(gain) / 500) & 0x3F); in hmc425a_gain_dB_to_code()
92 static int hmc540s_gain_dB_to_code(int gain, int *code) in hmc540s_gain_dB_to_code() argument
94 *code = ~((abs(gain) / 1000) & 0xF); in hmc540s_gain_dB_to_code()
98 static int adrf5740_gain_dB_to_code(int gain, int *code) in adrf5740_gain_dB_to_code() argument
103 *code = temp & BIT(3) ? temp | BIT(2) : temp; in adrf5740_gain_dB_to_code()
107 static int ltc6373_gain_dB_to_code(int gain, int *code) in ltc6373_gain_dB_to_code() argument
109 *code = ~(DIV_ROUND_CLOSEST(gain, LTC6373_CONVERSION_CONSTANT) + 3) in ltc6373_gain_dB_to_code()
121 static int hmc425a_code_to_gain_dB(int code, int *val, int *val2) in hmc425a_code_to_gain_dB() argument
123 *val = (~code * -500) / 1000; in hmc425a_code_to_gain_dB()
124 *val2 = ((~code * -500) % 1000) * 1000; in hmc425a_code_to_gain_dB()
128 static int hmc540s_code_to_gain_dB(int code, int *val, int *val2) in hmc540s_code_to_gain_dB() argument
130 *val = (~code * -1000) / 1000; in hmc540s_code_to_gain_dB()
131 *val2 = ((~code * -1000) % 1000) * 1000; in hmc540s_code_to_gain_dB()
135 static int adrf5740_code_to_gain_dB(int code, int *val, int *val2) in adrf5740_code_to_gain_dB() argument
141 code = code & BIT(3) ? code & ~BIT(2) : code; in adrf5740_code_to_gain_dB()
142 *val = (code * -2000) / 1000; in adrf5740_code_to_gain_dB()
143 *val2 = ((code * -2000) % 1000) * 1000; in adrf5740_code_to_gain_dB()
147 static int ltc6373_code_to_gain_dB(int code, int *val, int *val2) in ltc6373_code_to_gain_dB() argument
149 int gain = ((~code & LTC6373_CONVERSION_MASK) - 3) * in ltc6373_code_to_gain_dB()
197 int code = 0, ret; in hmc425a_write_raw() local
202 ret = gain_dB_to_code(st, val, val2, &code); in hmc425a_write_raw()
205 st->gain = code; in hmc425a_write_raw()
253 int code, ret; in ltc6373_write_powerdown() local
261 code = (powerdown) ? LTC6373_SHUTDOWN : st->gain; in ltc6373_write_powerdown()
262 hmc425a_write(indio_dev, code); in ltc6373_write_powerdown()