diff options
author | Pali Rohár <pali.rohar@gmail.com> | 2013-02-15 17:56:49 -0500 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2013-04-08 10:36:23 -0400 |
commit | a5055d5d683605210f77d46614bbdb389c1e4a07 (patch) | |
tree | 8d0ce2d4580687da450c5e2dc351c3ec096cd869 /include/linux/i2c | |
parent | d955cba86d32e9b4b6fe7611b4c41b7bbe286183 (diff) |
mfd: twl4030-madc: Add support for raw value in twl4030_madc_conversion
Driver twl4030-madc has hardcoded channel types (10 - battery current,
1 - battery temperature) and also conversation data in variable
twl4030_divider_ratios. These hardcoded channels are incorrect for
Nokia RX-51 board (where is channel 0 - battery temperature).
For Nokia RX-51 there is rx51_battery power_supply driver which reporting
battery information via twl4030_madc_conversion. But this driver needs
raw values (not converted via some hardcoded functions). So this patch
adding new parameter "raw" to struct twl4030_madc_request which tell
twl4030-madc driver to not convert values, but rather return raw.
Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
Reviewed-by: Anton Vorontsov <anton@enomsg.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'include/linux/i2c')
-rw-r--r-- | include/linux/i2c/twl4030-madc.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/i2c/twl4030-madc.h b/include/linux/i2c/twl4030-madc.h index 530e11ba0738..01f595107048 100644 --- a/include/linux/i2c/twl4030-madc.h +++ b/include/linux/i2c/twl4030-madc.h | |||
@@ -39,6 +39,7 @@ struct twl4030_madc_conversion_method { | |||
39 | * @do_avgP: sample the input channel for 4 consecutive cycles | 39 | * @do_avgP: sample the input channel for 4 consecutive cycles |
40 | * @method: RT, SW1, SW2 | 40 | * @method: RT, SW1, SW2 |
41 | * @type: Polling or interrupt based method | 41 | * @type: Polling or interrupt based method |
42 | * @raw: Return raw value, do not convert it | ||
42 | */ | 43 | */ |
43 | 44 | ||
44 | struct twl4030_madc_request { | 45 | struct twl4030_madc_request { |
@@ -48,6 +49,7 @@ struct twl4030_madc_request { | |||
48 | u16 type; | 49 | u16 type; |
49 | bool active; | 50 | bool active; |
50 | bool result_pending; | 51 | bool result_pending; |
52 | bool raw; | ||
51 | int rbuf[TWL4030_MADC_MAX_CHANNELS]; | 53 | int rbuf[TWL4030_MADC_MAX_CHANNELS]; |
52 | void (*func_cb)(int len, int channels, int *buf); | 54 | void (*func_cb)(int len, int channels, int *buf); |
53 | }; | 55 | }; |