diff options
author | Kenneth Kwak <kkwak@nvidia.com> | 2014-04-22 18:38:29 +0900 |
---|---|---|
committer | Peter Kim <pekim@nvidia.com> | 2014-06-12 21:53:56 -0700 |
commit | e5ab87ee1c4f0c3f8557ddde3be07d43b94aae07 (patch) | |
tree | d2e690bf2e64d9f453eee523d9cba39f767ca92b | |
parent | 31223fc9c52af0713f7409cbbd7255fe287bf563 (diff) |
HID: Exporting hidinput_calc_ads_res
Export hidinput_calc_abs_res to allow us to calculate
resolution in other drivers.
Only getting exporting code from
(commit id: 37cf6e6fc34e2fca4e7c565697e7cd5c317bc316)
Bug 1466757
Change-Id: Ic07922fa53f26634c3b402d669256e03c45f4789
Signed-off-by: Kenneth Kwak <kkwak@nvidia.com>
Reviewed-on: http://git-master/r/401209
Signed-off-by: Kenneth Kwak <kkwak@nvidia.com>
Reviewed-on: http://git-master/r/417519
Reviewed-by: Peter Kim <pekim@nvidia.com>
Tested-by: Peter Kim <pekim@nvidia.com>
-rw-r--r-- | drivers/hid/hid-input.c | 3 | ||||
-rw-r--r-- | include/linux/hid.h | 1 |
2 files changed, 3 insertions, 1 deletions
diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c index 43669731afc9..89eeb6d61329 100644 --- a/drivers/hid/hid-input.c +++ b/drivers/hid/hid-input.c @@ -208,7 +208,7 @@ static int hidinput_setkeycode(struct input_dev *dev, * Only exponent 1 length units are processed. Centimeters and inches are * converted to millimeters. Degrees are converted to radians. */ -static __s32 hidinput_calc_abs_res(const struct hid_field *field, __u16 code) +__s32 hidinput_calc_abs_res(const struct hid_field *field, __u16 code) { __s32 unit_exponent = field->unit_exponent; __s32 logical_extents = field->logical_maximum - @@ -272,6 +272,7 @@ static __s32 hidinput_calc_abs_res(const struct hid_field *field, __u16 code) /* Calculate resolution */ return logical_extents / physical_extents; } +EXPORT_SYMBOL_GPL(hidinput_calc_abs_res); #ifdef CONFIG_HID_BATTERY_STRENGTH static enum power_supply_property hidinput_battery_props[] = { diff --git a/include/linux/hid.h b/include/linux/hid.h index 773b4acf344f..261ee1b99576 100644 --- a/include/linux/hid.h +++ b/include/linux/hid.h @@ -735,6 +735,7 @@ int hid_input_report(struct hid_device *, int type, u8 *, int, int); int hidinput_find_field(struct hid_device *hid, unsigned int type, unsigned int code, struct hid_field **field); struct hid_field *hidinput_get_led_field(struct hid_device *hid); unsigned int hidinput_count_leds(struct hid_device *hid); +__s32 hidinput_calc_abs_res(const struct hid_field *field, __u16 code); void hid_output_report(struct hid_report *report, __u8 *data); struct hid_device *hid_allocate_device(void); struct hid_report *hid_register_report(struct hid_device *device, unsigned type, unsigned id); |