···1919adi,adt7476 +/-1C TDM Extended Temp Range I.C2020adi,adt7490 +/-1C TDM Extended Temp Range I.C2121adi,adxl345 Three-Axis Digital Accelerometer2222-adi,adxl346 Three-Axis Digital Accelerometer2323-adi,adxl34x Three-Axis Digital Accelerometer2222+adi,adxl346 Three-Axis Digital Accelerometer (backward-compatibility value "adi,adxl345" must be listed too)2423at,24c08 i2c serial eeprom (24cxx)2524atmel,24c00 i2c serial eeprom (24cxx)2625atmel,24c01 i2c serial eeprom (24cxx)
···11+* Texas Instruments - drv2665 Haptics driver22+33+Required properties:44+ - compatible - "ti,drv2665" - DRV266555+ - reg - I2C slave address66+ - vbat-supply - Required supply regulator77+88+Example:99+1010+haptics: haptics@59 {1111+ compatible = "ti,drv2665";1212+ reg = <0x59>;1313+ vbat-supply = <&vbat>;1414+};1515+1616+For more product information please see the link below:1717+http://www.ti.com/product/drv2665
-3
Documentation/leds/leds-class.txt
···22LED handling under Linux33========================4455-If you're reading this and thinking about keyboard leds, these are66-handled by the input subsystem and the led class is *not* needed.77-85In its simplest form, the LED class just allows control of LEDs from96userspace. LEDs appear in /sys/class/leds/. The maximum brightness of the107LED is defined in max_brightness file. The brightness file will set the brightness
···25252626if INPUT27272828+config INPUT_LEDS2929+ tristate "Export input device LEDs in sysfs"3030+ depends on LEDS_CLASS3131+ default INPUT3232+ help3333+ Say Y here if you would like to export LEDs on input devices3434+ as standard LED class devices in sysfs.3535+3636+ If unsure, say Y.3737+3838+ To compile this driver as a module, choose M here: the3939+ module will be called input-leds.4040+2841config INPUT_FF_MEMLESS2942 tristate "Support for memoryless force-feedback devices"3043 help
···422422423423 evdev_detach_client(evdev, client);424424425425- if (is_vmalloc_addr(client))426426- vfree(client);427427- else428428- kfree(client);425425+ kvfree(client);429426430427 evdev_close_device(evdev);431428
+2-2
drivers/input/ff-core.c
···7070 return -EINVAL;71717272 /*7373- * calculate manginude of sine wave as average of rumble's7373+ * calculate magnitude of sine wave as average of rumble's7474 * 2/3 of strong magnitude and 1/3 of weak magnitude7575 */7676 magnitude = effect->u.rumble.strong_magnitude / 3 +···213213/**214214 * input_ff_erase - erase a force-feedback effect from device215215 * @dev: input device to erase effect from216216- * @effect_id: id of the ffect to be erased216216+ * @effect_id: id of the effect to be erased217217 * @file: purported owner of the request218218 *219219 * This function erases a force-feedback effect from specified device.
+212
drivers/input/input-leds.c
···11+/*22+ * LED support for the input layer33+ *44+ * Copyright 2010-2015 Samuel Thibault <samuel.thibault@ens-lyon.org>55+ *66+ * This program is free software; you can redistribute it and/or modify77+ * it under the terms of the GNU General Public License version 2 as88+ * published by the Free Software Foundation.99+ */1010+1111+#include <linux/kernel.h>1212+#include <linux/slab.h>1313+#include <linux/module.h>1414+#include <linux/init.h>1515+#include <linux/leds.h>1616+#include <linux/input.h>1717+1818+#if IS_ENABLED(CONFIG_VT)1919+#define VT_TRIGGER(_name) .trigger = _name2020+#else2121+#define VT_TRIGGER(_name) .trigger = NULL2222+#endif2323+2424+static const struct {2525+ const char *name;2626+ const char *trigger;2727+} input_led_info[LED_CNT] = {2828+ [LED_NUML] = { "numlock", VT_TRIGGER("kbd-numlock") },2929+ [LED_CAPSL] = { "capslock", VT_TRIGGER("kbd-capslock") },3030+ [LED_SCROLLL] = { "scrolllock", VT_TRIGGER("kbd-scrolllock") },3131+ [LED_COMPOSE] = { "compose" },3232+ [LED_KANA] = { "kana", VT_TRIGGER("kbd-kanalock") },3333+ [LED_SLEEP] = { "sleep" } ,3434+ [LED_SUSPEND] = { "suspend" },3535+ [LED_MUTE] = { "mute" },3636+ [LED_MISC] = { "misc" },3737+ [LED_MAIL] = { "mail" },3838+ [LED_CHARGING] = { "charging" },3939+};4040+4141+struct input_led {4242+ struct led_classdev cdev;4343+ struct input_handle *handle;4444+ unsigned int code; /* One of LED_* constants */4545+};4646+4747+struct input_leds {4848+ struct input_handle handle;4949+ unsigned int num_leds;5050+ struct input_led leds[];5151+};5252+5353+static enum led_brightness input_leds_brightness_get(struct led_classdev *cdev)5454+{5555+ struct input_led *led = container_of(cdev, struct input_led, cdev);5656+ struct input_dev *input = led->handle->dev;5757+5858+ return test_bit(led->code, input->led) ? cdev->max_brightness : 0;5959+}6060+6161+static void input_leds_brightness_set(struct led_classdev *cdev,6262+ enum led_brightness brightness)6363+{6464+ struct input_led *led = container_of(cdev, struct input_led, cdev);6565+6666+ input_inject_event(led->handle, EV_LED, led->code, !!brightness);6767+}6868+6969+static void input_leds_event(struct input_handle *handle, unsigned int type,7070+ unsigned int code, int value)7171+{7272+}7373+7474+static int input_leds_connect(struct input_handler *handler,7575+ struct input_dev *dev,7676+ const struct input_device_id *id)7777+{7878+ struct input_leds *leds;7979+ unsigned int num_leds;8080+ unsigned int led_code;8181+ int led_no;8282+ int error;8383+8484+ num_leds = bitmap_weight(dev->ledbit, LED_CNT);8585+ if (!num_leds)8686+ return -ENXIO;8787+8888+ leds = kzalloc(sizeof(*leds) + num_leds * sizeof(*leds->leds),8989+ GFP_KERNEL);9090+ if (!leds)9191+ return -ENOMEM;9292+9393+ leds->num_leds = num_leds;9494+9595+ leds->handle.dev = dev;9696+ leds->handle.handler = handler;9797+ leds->handle.name = "leds";9898+ leds->handle.private = leds;9999+100100+ error = input_register_handle(&leds->handle);101101+ if (error)102102+ goto err_free_mem;103103+104104+ error = input_open_device(&leds->handle);105105+ if (error)106106+ goto err_unregister_handle;107107+108108+ led_no = 0;109109+ for_each_set_bit(led_code, dev->ledbit, LED_CNT) {110110+ struct input_led *led = &leds->leds[led_no];111111+112112+ led->handle = &leds->handle;113113+ led->code = led_code;114114+115115+ if (WARN_ON(!input_led_info[led_code].name))116116+ continue;117117+118118+ led->cdev.name = kasprintf(GFP_KERNEL, "%s::%s",119119+ dev_name(&dev->dev),120120+ input_led_info[led_code].name);121121+ if (!led->cdev.name) {122122+ error = -ENOMEM;123123+ goto err_unregister_leds;124124+ }125125+126126+ led->cdev.max_brightness = 1;127127+ led->cdev.brightness_get = input_leds_brightness_get;128128+ led->cdev.brightness_set = input_leds_brightness_set;129129+ led->cdev.default_trigger = input_led_info[led_code].trigger;130130+131131+ error = led_classdev_register(&dev->dev, &led->cdev);132132+ if (error) {133133+ dev_err(&dev->dev, "failed to register LED %s: %d\n",134134+ led->cdev.name, error);135135+ kfree(led->cdev.name);136136+ goto err_unregister_leds;137137+ }138138+139139+ led_no++;140140+ }141141+142142+ return 0;143143+144144+err_unregister_leds:145145+ while (--led_no >= 0) {146146+ struct input_led *led = &leds->leds[led_no];147147+148148+ led_classdev_unregister(&led->cdev);149149+ kfree(led->cdev.name);150150+ }151151+152152+ input_close_device(&leds->handle);153153+154154+err_unregister_handle:155155+ input_unregister_handle(&leds->handle);156156+157157+err_free_mem:158158+ kfree(leds);159159+ return error;160160+}161161+162162+static void input_leds_disconnect(struct input_handle *handle)163163+{164164+ struct input_leds *leds = handle->private;165165+ int i;166166+167167+ for (i = 0; i < leds->num_leds; i++) {168168+ struct input_led *led = &leds->leds[i];169169+170170+ led_classdev_unregister(&led->cdev);171171+ kfree(led->cdev.name);172172+ }173173+174174+ input_close_device(handle);175175+ input_unregister_handle(handle);176176+177177+ kfree(leds);178178+}179179+180180+static const struct input_device_id input_leds_ids[] = {181181+ {182182+ .flags = INPUT_DEVICE_ID_MATCH_EVBIT,183183+ .evbit = { BIT_MASK(EV_LED) },184184+ },185185+ { },186186+};187187+MODULE_DEVICE_TABLE(input, input_leds_ids);188188+189189+static struct input_handler input_leds_handler = {190190+ .event = input_leds_event,191191+ .connect = input_leds_connect,192192+ .disconnect = input_leds_disconnect,193193+ .name = "leds",194194+ .id_table = input_leds_ids,195195+};196196+197197+static int __init input_leds_init(void)198198+{199199+ return input_register_handler(&input_leds_handler);200200+}201201+module_init(input_leds_init);202202+203203+static void __exit input_leds_exit(void)204204+{205205+ input_unregister_handler(&input_leds_handler);206206+}207207+module_exit(input_leds_exit);208208+209209+MODULE_AUTHOR("Samuel Thibault <samuel.thibault@ens-lyon.org>");210210+MODULE_AUTHOR("Dmitry Torokhov <dmitry.torokhov@gmail.com>");211211+MODULE_DESCRIPTION("Input -> LEDs Bridge");212212+MODULE_LICENSE("GPL v2");
+1-1
drivers/input/input.c
···22622262 *22632263 * Iterate over @bus's list of devices, and call @fn for each, passing22642264 * it @data and stop when @fn returns a non-zero value. The function is22652265- * using RCU to traverse the list and therefore may be usind in atonic22652265+ * using RCU to traverse the list and therefore may be using in atomic22662266 * contexts. The @fn callback is invoked from RCU critical section and22672267 * thus must not sleep.22682268 */
+1
drivers/input/keyboard/Kconfig
···367367368368config KEYBOARD_MAX7359369369 tristate "Maxim MAX7359 Key Switch Controller"370370+ select INPUT_MATRIXKMAP370371 depends on I2C371372 help372373 If you say yes here you get support for the Maxim MAX7359 Key
+3-3
drivers/input/keyboard/adp5589-keys.c
···180180#define LOGIC2_STAT (1 << 7) /* ADP5589 only */181181#define LOGIC1_STAT (1 << 6)182182#define LOCK_STAT (1 << 5) /* ADP5589 only */183183-#define KEC 0xF183183+#define KEC 0x1F184184185185/* PIN_CONFIG_D Register */186186#define C4_EXTEND_CFG (1 << 6) /* RESET2 */···726726727727 pull_mask |= val << (2 * (i & 0x3));728728729729- if (i == 3 || i == kpad->var->max_row_num) {729729+ if (i % 4 == 3 || i == kpad->var->max_row_num) {730730 ret |= adp5589_write(client, reg(ADP5585_RPULL_CONFIG_A)731731 + (i >> 2), pull_mask);732732 pull_mask = 0;···746746747747 pull_mask |= val << (2 * (i & 0x3));748748749749- if (i == 3 || i == kpad->var->max_col_num) {749749+ if (i % 4 == 3 || i == kpad->var->max_col_num) {750750 ret |= adp5589_write(client,751751 reg(ADP5585_RPULL_CONFIG_C) +752752 (i >> 2), pull_mask);
+1-6
drivers/input/keyboard/clps711x-keypad.c
···120120 for (i = 0; i < priv->row_count; i++) {121121 struct clps711x_gpio_data *data = &priv->gpio_data[i];122122123123- data->desc = devm_gpiod_get_index(dev, "row", i);124124- if (!data->desc)125125- return -EINVAL;126126-123123+ data->desc = devm_gpiod_get_index(dev, "row", i, GPIOD_IN);127124 if (IS_ERR(data->desc))128125 return PTR_ERR(data->desc);129129-130130- gpiod_direction_input(data->desc);131126 }132127133128 err = of_property_read_u32(np, "poll-interval", &poll_interval);
+9-22
drivers/input/keyboard/max7359_keypad.c
···8484 return ret;8585}86868787-static void max7359_build_keycode(struct max7359_keypad *keypad,8888- const struct matrix_keymap_data *keymap_data)8989-{9090- struct input_dev *input_dev = keypad->input_dev;9191- int i;9292-9393- for (i = 0; i < keymap_data->keymap_size; i++) {9494- unsigned int key = keymap_data->keymap[i];9595- unsigned int row = KEY_ROW(key);9696- unsigned int col = KEY_COL(key);9797- unsigned int scancode = MATRIX_SCAN_CODE(row, col,9898- MAX7359_ROW_SHIFT);9999- unsigned short keycode = KEY_VAL(key);100100-101101- keypad->keycodes[scancode] = keycode;102102- __set_bit(keycode, input_dev->keybit);103103- }104104- __clear_bit(KEY_RESERVED, input_dev->keybit);105105-}106106-10787/* runs in an IRQ thread -- can (and will!) sleep */10888static irqreturn_t max7359_interrupt(int irq, void *dev_id)10989{···146166static void max7359_initialize(struct i2c_client *client)147167{148168 max7359_write_reg(client, MAX7359_REG_CONFIG,149149- MAX7359_CFG_INTERRUPT | /* Irq clears after host read */150169 MAX7359_CFG_KEY_RELEASE | /* Key release enable */151170 MAX7359_CFG_WAKEUP); /* Key press wakeup enable */152171···212233 input_set_capability(input_dev, EV_MSC, MSC_SCAN);213234 input_set_drvdata(input_dev, keypad);214235215215- max7359_build_keycode(keypad, keymap_data);236236+ error = matrix_keypad_build_keymap(keymap_data, NULL,237237+ MAX7359_MAX_KEY_ROWS,238238+ MAX7359_MAX_KEY_COLS,239239+ keypad->keycodes,240240+ input_dev);241241+ if (error) {242242+ dev_err(&client->dev, "failed to build keymap\n");243243+ return error;244244+ }216245217246 error = devm_request_threaded_irq(&client->dev, client->irq, NULL,218247 max7359_interrupt,
···33 * Based on omap-keypad driver44 *55 * Copyright (C) 2010 ST Microelectronics66- * Rajeev Kumar<rajeev-dlh.kumar@st.com>66+ * Rajeev Kumar <rajeevkumar.linux@gmail.com>77 *88 * This file is licensed under the terms of the GNU General Public99 * License version 2. This program is licensed "as is" without any
+22-1
drivers/input/misc/Kconfig
···610610 To compile this driver as a module, choose M here: the module611611 will be called da9055_onkey.612612613613+config INPUT_DA9063_ONKEY614614+ tristate "Dialog DA9063 OnKey"615615+ depends on MFD_DA9063616616+ help617617+ Support the ONKEY of Dialog DA9063 Power Management IC as an618618+ input device reporting power button statue.619619+620620+ To compile this driver as a module, choose M here: the module621621+ will be called da9063_onkey.622622+613623config INPUT_DM355EVM614624 tristate "TI DaVinci DM355 EVM Keypad and IR Remote"615625 depends on MFD_DM355EVM_MSP···785775 To compile this driver as a module, choose M here: the786776 module will be called drv260x-haptics.787777778778+config INPUT_DRV2665_HAPTICS779779+ tristate "TI DRV2665 haptics support"780780+ depends on INPUT && I2C781781+ select INPUT_FF_MEMLESS782782+ select REGMAP_I2C783783+ help784784+ Say Y to enable support for the TI DRV2665 haptics driver.785785+786786+ To compile this driver as a module, choose M here: the787787+ module will be called drv2665-haptics.788788+788789config INPUT_DRV2667_HAPTICS789790 tristate "TI DRV2667 haptics support"790791 depends on INPUT && I2C···805784 Say Y to enable support for the TI DRV2667 haptics driver.806785807786 To compile this driver as a module, choose M here: the808808- module will be called drv260x-haptics.787787+ module will be called drv2667-haptics.809788810789endif
···1818#include <linux/gpio/consumer.h>1919#include <linux/gpio_keys.h>2020#include <linux/platform_device.h>2121-#include <linux/acpi.h>22212322/*2423 * Definition of buttons on the tablet. The ACPI index of each button
···9999 wm831x_on->dev->dev.parent = &pdev->dev;100100101101 ret = request_threaded_irq(irq, NULL, wm831x_on_irq,102102- IRQF_TRIGGER_RISING, "wm831x_on",102102+ IRQF_TRIGGER_RISING | IRQF_ONESHOT,103103+ "wm831x_on",103104 wm831x_on);104105 if (ret < 0) {105106 dev_err(&pdev->dev, "Unable to request IRQ: %d\n", ret);
+126-118
drivers/input/mouse/alps.c
···159159160160static void alps_set_abs_params_st(struct alps_data *priv,161161 struct input_dev *dev1);162162-static void alps_set_abs_params_mt(struct alps_data *priv,163163- struct input_dev *dev1);162162+static void alps_set_abs_params_semi_mt(struct alps_data *priv,163163+ struct input_dev *dev1);164164static void alps_set_abs_params_v7(struct alps_data *priv,165165 struct input_dev *dev1);166166static void alps_set_abs_params_ss4_v2(struct alps_data *priv,···310310 input_sync(dev);311311}312312313313-/*314314- * Process bitmap data for V5 protocols. Return value is null.315315- *316316- * The bitmaps don't have enough data to track fingers, so this function317317- * only generates points representing a bounding box of at most two contacts.318318- * These two points are returned in fields->mt.319319- */320320-static void alps_process_bitmap_dolphin(struct alps_data *priv,321321- struct alps_fields *fields)322322-{323323- int box_middle_x, box_middle_y;324324- unsigned int x_map, y_map;325325- unsigned char start_bit, end_bit;326326- unsigned char x_msb, x_lsb, y_msb, y_lsb;327327-328328- x_map = fields->x_map;329329- y_map = fields->y_map;330330-331331- if (!x_map || !y_map)332332- return;333333-334334- /* Get Most-significant and Least-significant bit */335335- x_msb = fls(x_map);336336- x_lsb = ffs(x_map);337337- y_msb = fls(y_map);338338- y_lsb = ffs(y_map);339339-340340- /* Most-significant bit should never exceed max sensor line number */341341- if (x_msb > priv->x_bits || y_msb > priv->y_bits)342342- return;343343-344344- if (fields->fingers > 1) {345345- start_bit = priv->x_bits - x_msb;346346- end_bit = priv->x_bits - x_lsb;347347- box_middle_x = (priv->x_max * (start_bit + end_bit)) /348348- (2 * (priv->x_bits - 1));349349-350350- start_bit = y_lsb - 1;351351- end_bit = y_msb - 1;352352- box_middle_y = (priv->y_max * (start_bit + end_bit)) /353353- (2 * (priv->y_bits - 1));354354- fields->mt[0] = fields->st;355355- fields->mt[1].x = 2 * box_middle_x - fields->mt[0].x;356356- fields->mt[1].y = 2 * box_middle_y - fields->mt[0].y;357357- }358358-}359359-360313static void alps_get_bitmap_points(unsigned int map,361314 struct alps_bitmap_point *low,362315 struct alps_bitmap_point *high,···337384}338385339386/*340340- * Process bitmap data from v3 and v4 protocols. Returns the number of387387+ * Process bitmap data from semi-mt protocols. Returns the number of341388 * fingers detected. A return value of 0 means at least one of the342389 * bitmaps was empty.343390 *···349396static int alps_process_bitmap(struct alps_data *priv,350397 struct alps_fields *fields)351398{352352- int i, fingers_x = 0, fingers_y = 0, fingers;399399+ int i, fingers_x = 0, fingers_y = 0, fingers, closest;353400 struct alps_bitmap_point x_low = {0,}, x_high = {0,};354401 struct alps_bitmap_point y_low = {0,}, y_high = {0,};402402+ struct input_mt_pos corner[4];355403356404 if (!fields->x_map || !fields->y_map)357405 return 0;···383429 y_high.num_bits = max(i, 1);384430 }385431386386- fields->mt[0].x =432432+ /* top-left corner */433433+ corner[0].x =387434 (priv->x_max * (2 * x_low.start_bit + x_low.num_bits - 1)) /388435 (2 * (priv->x_bits - 1));389389- fields->mt[0].y =436436+ corner[0].y =390437 (priv->y_max * (2 * y_low.start_bit + y_low.num_bits - 1)) /391438 (2 * (priv->y_bits - 1));392439393393- fields->mt[1].x =440440+ /* top-right corner */441441+ corner[1].x =394442 (priv->x_max * (2 * x_high.start_bit + x_high.num_bits - 1)) /395443 (2 * (priv->x_bits - 1));396396- fields->mt[1].y =444444+ corner[1].y =445445+ (priv->y_max * (2 * y_low.start_bit + y_low.num_bits - 1)) /446446+ (2 * (priv->y_bits - 1));447447+448448+ /* bottom-right corner */449449+ corner[2].x =450450+ (priv->x_max * (2 * x_high.start_bit + x_high.num_bits - 1)) /451451+ (2 * (priv->x_bits - 1));452452+ corner[2].y =397453 (priv->y_max * (2 * y_high.start_bit + y_high.num_bits - 1)) /398454 (2 * (priv->y_bits - 1));399455400400- /* y-bitmap order is reversed, except on rushmore */401401- if (priv->proto_version != ALPS_PROTO_V3_RUSHMORE) {402402- fields->mt[0].y = priv->y_max - fields->mt[0].y;403403- fields->mt[1].y = priv->y_max - fields->mt[1].y;456456+ /* bottom-left corner */457457+ corner[3].x =458458+ (priv->x_max * (2 * x_low.start_bit + x_low.num_bits - 1)) /459459+ (2 * (priv->x_bits - 1));460460+ corner[3].y =461461+ (priv->y_max * (2 * y_high.start_bit + y_high.num_bits - 1)) /462462+ (2 * (priv->y_bits - 1));463463+464464+ /* x-bitmap order is reversed on v5 touchpads */465465+ if (priv->proto_version == ALPS_PROTO_V5) {466466+ for (i = 0; i < 4; i++)467467+ corner[i].x = priv->x_max - corner[i].x;404468 }469469+470470+ /* y-bitmap order is reversed on v3 and v4 touchpads */471471+ if (priv->proto_version == ALPS_PROTO_V3 ||472472+ priv->proto_version == ALPS_PROTO_V4) {473473+ for (i = 0; i < 4; i++)474474+ corner[i].y = priv->y_max - corner[i].y;475475+ }476476+477477+ /*478478+ * We only select a corner for the second touch once per 2 finger479479+ * touch sequence to avoid the chosen corner (and thus the coordinates)480480+ * jumping around when the first touch is in the middle.481481+ */482482+ if (priv->second_touch == -1) {483483+ /* Find corner closest to our st coordinates */484484+ closest = 0x7fffffff;485485+ for (i = 0; i < 4; i++) {486486+ int dx = fields->st.x - corner[i].x;487487+ int dy = fields->st.y - corner[i].y;488488+ int distance = dx * dx + dy * dy;489489+490490+ if (distance < closest) {491491+ priv->second_touch = i;492492+ closest = distance;493493+ }494494+ }495495+ /* And select the opposite corner to use for the 2nd touch */496496+ priv->second_touch = (priv->second_touch + 2) % 4;497497+ }498498+499499+ fields->mt[0] = fields->st;500500+ fields->mt[1] = corner[priv->second_touch];405501406502 return fingers;407503}···489485 f->mt[0].x = f->st.x;490486 f->mt[0].y = f->st.y;491487 fingers = f->pressure > 0 ? 1 : 0;488488+ priv->second_touch = -1;492489 }493490494494- alps_report_mt_data(psmouse, (fingers <= 2) ? fingers : 2);491491+ if (fingers >= 1)492492+ alps_set_slot(dev, 0, f->mt[0].x, f->mt[0].y);493493+ if (fingers >= 2)494494+ alps_set_slot(dev, 1, f->mt[1].x, f->mt[1].y);495495+ input_mt_sync_frame(dev);495496496497 input_mt_report_finger_count(dev, fingers);497498···593584 f->first_mp = !!(p[4] & 0x40);594585 f->is_mp = !!(p[0] & 0x40);595586596596- f->fingers = (p[5] & 0x3) + 1;597597- f->x_map = ((p[4] & 0x7e) << 8) |598598- ((p[1] & 0x7f) << 2) |599599- ((p[0] & 0x30) >> 4);600600- f->y_map = ((p[3] & 0x70) << 4) |601601- ((p[2] & 0x7f) << 1) |602602- (p[4] & 0x01);587587+ if (f->is_mp) {588588+ f->fingers = (p[5] & 0x3) + 1;589589+ f->x_map = ((p[4] & 0x7e) << 8) |590590+ ((p[1] & 0x7f) << 2) |591591+ ((p[0] & 0x30) >> 4);592592+ f->y_map = ((p[3] & 0x70) << 4) |593593+ ((p[2] & 0x7f) << 1) |594594+ (p[4] & 0x01);595595+ } else {596596+ f->st.x = ((p[1] & 0x7f) << 4) | ((p[4] & 0x30) >> 2) |597597+ ((p[0] & 0x30) >> 4);598598+ f->st.y = ((p[2] & 0x7f) << 4) | (p[4] & 0x0f);599599+ f->pressure = p[5] & 0x7f;603600604604- f->st.x = ((p[1] & 0x7f) << 4) | ((p[4] & 0x30) >> 2) |605605- ((p[0] & 0x30) >> 4);606606- f->st.y = ((p[2] & 0x7f) << 4) | (p[4] & 0x0f);607607- f->pressure = p[5] & 0x7f;608608-609609- alps_decode_buttons_v3(f, p);601601+ alps_decode_buttons_v3(f, p);602602+ }610603611604 return 0;612605}···616605static int alps_decode_rushmore(struct alps_fields *f, unsigned char *p,617606 struct psmouse *psmouse)618607{619619- alps_decode_pinnacle(f, p, psmouse);620620-621621- /* Rushmore's packet decode has a bit difference with Pinnacle's */608608+ f->first_mp = !!(p[4] & 0x40);622609 f->is_mp = !!(p[5] & 0x40);623623- f->fingers = max((p[5] & 0x3), ((p[5] >> 2) & 0x3)) + 1;624624- f->x_map |= (p[5] & 0x10) << 11;625625- f->y_map |= (p[5] & 0x20) << 6;610610+611611+ if (f->is_mp) {612612+ f->fingers = max((p[5] & 0x3), ((p[5] >> 2) & 0x3)) + 1;613613+ f->x_map = ((p[5] & 0x10) << 11) |614614+ ((p[4] & 0x7e) << 8) |615615+ ((p[1] & 0x7f) << 2) |616616+ ((p[0] & 0x30) >> 4);617617+ f->y_map = ((p[5] & 0x20) << 6) |618618+ ((p[3] & 0x70) << 4) |619619+ ((p[2] & 0x7f) << 1) |620620+ (p[4] & 0x01);621621+ } else {622622+ f->st.x = ((p[1] & 0x7f) << 4) | ((p[4] & 0x30) >> 2) |623623+ ((p[0] & 0x30) >> 4);624624+ f->st.y = ((p[2] & 0x7f) << 4) | (p[4] & 0x0f);625625+ f->pressure = p[5] & 0x7f;626626+627627+ alps_decode_buttons_v3(f, p);628628+ }626629627630 return 0;628631}···705680 */706681 if (f->is_mp) {707682 fingers = f->fingers;708708- if (priv->proto_version == ALPS_PROTO_V3 ||709709- priv->proto_version == ALPS_PROTO_V3_RUSHMORE) {710710- if (alps_process_bitmap(priv, f) == 0)711711- fingers = 0; /* Use st data */712712-713713- /* Now process position packet */714714- priv->decode_fields(f, priv->multi_data,715715- psmouse);716716- } else {717717- /*718718- * Because Dolphin uses position packet's719719- * coordinate data as Pt1 and uses it to720720- * calculate Pt2, so we need to do position721721- * packet decode first.722722- */723723- priv->decode_fields(f, priv->multi_data,724724- psmouse);725725-726726- /*727727- * Since Dolphin's finger number is reliable,728728- * there is no need to compare with bmap_fn.729729- */730730- alps_process_bitmap_dolphin(priv, f);731731- }683683+ /*684684+ * Bitmap processing uses position packet's coordinate685685+ * data, so we need to do decode it first.686686+ */687687+ priv->decode_fields(f, priv->multi_data, psmouse);688688+ if (alps_process_bitmap(priv, f) == 0)689689+ fingers = 0; /* Use st data */732690 } else {733691 priv->multi_packet = 0;734692 }···873865 priv->multi_data[offset] = packet[6];874866 priv->multi_data[offset + 1] = packet[7];875867868868+ f->left = !!(packet[4] & 0x01);869869+ f->right = !!(packet[4] & 0x02);870870+871871+ f->st.x = ((packet[1] & 0x7f) << 4) | ((packet[3] & 0x30) >> 2) |872872+ ((packet[0] & 0x30) >> 4);873873+ f->st.y = ((packet[2] & 0x7f) << 4) | (packet[3] & 0x0f);874874+ f->pressure = packet[5] & 0x7f;875875+876876 if (++priv->multi_packet > 2) {877877 priv->multi_packet = 0;878878···894878895879 f->fingers = alps_process_bitmap(priv, f);896880 }897897-898898- f->left = !!(packet[4] & 0x01);899899- f->right = !!(packet[4] & 0x02);900900-901901- f->st.x = ((packet[1] & 0x7f) << 4) | ((packet[3] & 0x30) >> 2) |902902- ((packet[0] & 0x30) >> 4);903903- f->st.y = ((packet[2] & 0x7f) << 4) | (packet[3] & 0x0f);904904- f->pressure = packet[5] & 0x7f;905881906882 alps_report_semi_mt_data(psmouse, f->fingers);907883}···25692561 case ALPS_PROTO_V3:25702562 priv->hw_init = alps_hw_init_v3;25712563 priv->process_packet = alps_process_packet_v3;25722572- priv->set_abs_params = alps_set_abs_params_mt;25642564+ priv->set_abs_params = alps_set_abs_params_semi_mt;25732565 priv->decode_fields = alps_decode_pinnacle;25742566 priv->nibble_commands = alps_v3_nibble_commands;25752567 priv->addr_command = PSMOUSE_CMD_RESET_WRAP;···25782570 case ALPS_PROTO_V3_RUSHMORE:25792571 priv->hw_init = alps_hw_init_rushmore_v3;25802572 priv->process_packet = alps_process_packet_v3;25812581- priv->set_abs_params = alps_set_abs_params_mt;25732573+ priv->set_abs_params = alps_set_abs_params_semi_mt;25822574 priv->decode_fields = alps_decode_rushmore;25832575 priv->nibble_commands = alps_v3_nibble_commands;25842576 priv->addr_command = PSMOUSE_CMD_RESET_WRAP;···25942586 case ALPS_PROTO_V4:25952587 priv->hw_init = alps_hw_init_v4;25962588 priv->process_packet = alps_process_packet_v4;25972597- priv->set_abs_params = alps_set_abs_params_mt;25892589+ priv->set_abs_params = alps_set_abs_params_semi_mt;25982590 priv->nibble_commands = alps_v4_nibble_commands;25992591 priv->addr_command = PSMOUSE_CMD_DISABLE;26002592 break;···26032595 priv->hw_init = alps_hw_init_dolphin_v1;26042596 priv->process_packet = alps_process_touchpad_packet_v3_v5;26052597 priv->decode_fields = alps_decode_dolphin;26062606- priv->set_abs_params = alps_set_abs_params_mt;25982598+ priv->set_abs_params = alps_set_abs_params_semi_mt;26072599 priv->nibble_commands = alps_v3_nibble_commands;26082600 priv->addr_command = PSMOUSE_CMD_RESET_WRAP;26092601 priv->x_bits = 23;···27852777 set_bit(BTN_TOOL_QUADTAP, dev1->keybit);27862778}2787277927882788-static void alps_set_abs_params_mt(struct alps_data *priv,27892789- struct input_dev *dev1)27802780+static void alps_set_abs_params_semi_mt(struct alps_data *priv,27812781+ struct input_dev *dev1)27902782{27912783 alps_set_abs_params_mt_common(priv, dev1);27922784 input_set_abs_params(dev1, ABS_PRESSURE, 0, 127, 0, 0);2793278527942786 input_mt_init_slots(dev1, MAX_TOUCHES,27952787 INPUT_MT_POINTER | INPUT_MT_DROP_UNUSED |27962796- INPUT_MT_TRACK | INPUT_MT_SEMI_MT);27882788+ INPUT_MT_SEMI_MT);27972789}2798279027992791static void alps_set_abs_params_v7(struct alps_data *priv,
+1
drivers/input/mouse/alps.h
···278278279279 int prev_fin;280280 int multi_packet;281281+ int second_touch;281282 unsigned char multi_data[6];282283 struct alps_fields f;283284 u8 quirks;
+1-2
drivers/input/mouse/cyapa_gen3.c
···950950 * Device power mode can only be set when device is in operational mode.951951 */952952static int cyapa_gen3_set_power_mode(struct cyapa *cyapa, u8 power_mode,953953- u16 always_unused)953953+ u16 always_unused)954954{955955 int ret;956956 u8 power;957957 int tries;958958 u16 sleep_time;959959960960- always_unused = 0;961960 if (cyapa->state != CYAPA_STATE_OP)962961 return 0;963962
+9-14
drivers/input/mouse/cyapa_gen5.c
···352352 u8 parameter_data[0]; /* Parameter data variable based on cmd_code */353353} __packed;354354355355-/* Applicaton get/set parameter command data structure */355355+/* Application get/set parameter command data structure */356356struct gen5_app_set_parameter_data {357357 u8 parameter_id;358358 u8 parameter_size;···832832 int ret;833833834834 /* 0x20 0x00 0xF7 is Gen5 Application HID Description Header;835835- * 0x20 0x00 0xFF is Gen5 Booloader HID Description Header.835835+ * 0x20 0x00 0xFF is Gen5 Bootloader HID Description Header.836836 *837837 * Must read HID Description content through out,838838 * otherwise Gen5 trackpad cannot response next command···16541654 * that trackpad unable to report signal to wake system up16551655 * in the special situation that system is in suspending, and16561656 * at the same time, user touch trackpad to wake system up.16571657- * This function can avoid the data to be buffured when system16581658- * is suspending which may cause interrput line unable to be16571657+ * This function can avoid the data to be buffered when system16581658+ * is suspending which may cause interrupt line unable to be16591659 * asserted again.16601660 */16611661 cyapa_empty_pip_output_data(cyapa, NULL, NULL, NULL);···25462546 gen5_pip->resp_sort_func(cyapa,25472547 gen5_pip->irq_cmd_buf, length))) {25482548 /*25492549- * Cover the Gen5 V1 firmware issue.25502550- * The issue is there is no interrut will be25512551- * asserted to notityf host to read a command25522552- * data out when always has finger touch on25532553- * trackpad during the command is issued to25542554- * trackad device.25552555- * This issue has the scenario is that,25562556- * user always has his fingers touched on25572557- * trackpad device when booting/rebooting25582558- * their chrome book.25492549+ * Work around the Gen5 V1 firmware25502550+ * that does not assert interrupt signalling25512551+ * that command response is ready if user25522552+ * keeps touching the trackpad while command25532553+ * is sent to the device.25592554 */25602555 length = 0;25612556 if (gen5_pip->resp_len)
···44 * Copyright (c) 2013 ELAN Microelectronics Corp.55 *66 * Author: 林政維 (Duson Lin) <dusonlin@emc.com.tw>77- * Version: 1.5.777+ * Version: 1.5.988 *99 * Based on cyapa driver:1010 * copyright (c) 2011-2012 Cypress Semiconductor, Inc.···4040#include "elan_i2c.h"41414242#define DRIVER_NAME "elan_i2c"4343-#define ELAN_DRIVER_VERSION "1.5.7"4343+#define ELAN_DRIVER_VERSION "1.5.9"4444#define ETP_MAX_PRESSURE 2554545#define ETP_FWIDTH_REDUCE 904646#define ETP_FINGER_WIDTH 15···8383 u16 fw_checksum;8484 int pressure_adjustment;8585 u8 mode;8686+ u8 ic_type;8787+ u16 fw_vaildpage_count;8888+ u16 fw_signature_address;86898790 bool irq_wake;8891···9390 u8 max_baseline;9491 bool baseline_ready;9592};9393+9494+static int elan_get_fwinfo(u8 ic_type, u16 *vaildpage_count,9595+ u16 *signature_address)9696+{9797+ switch(ic_type) {9898+ case 0x09:9999+ *vaildpage_count = 768;100100+ break;101101+ case 0x0D:102102+ *vaildpage_count = 896;103103+ break;104104+ default:105105+ /* unknown ic type clear value */106106+ *vaildpage_count = 0;107107+ *signature_address = 0;108108+ return -ENXIO;109109+ }110110+111111+ *signature_address =112112+ (*vaildpage_count * ETP_FW_PAGE_SIZE) - ETP_FW_SIGNATURE_SIZE;113113+114114+ return 0;115115+}9611697117static int elan_enable_power(struct elan_tp_data *data)98118{···247221 if (error)248222 return error;249223250250- error = data->ops->get_sm_version(data->client, &data->sm_version);224224+ error = data->ops->get_sm_version(data->client, &data->ic_type,225225+ &data->sm_version);251226 if (error)252227 return error;253228···260233 &data->pressure_adjustment);261234 if (error)262235 return error;236236+237237+ error = elan_get_fwinfo(data->ic_type, &data->fw_vaildpage_count,238238+ &data->fw_signature_address);239239+ if (error) {240240+ dev_err(&data->client->dev,241241+ "unknown ic type %d\n", data->ic_type);242242+ return error;243243+ }263244264245 return 0;265246}···353318 iap_start_addr = get_unaligned_le16(&fw->data[ETP_IAP_START_ADDR * 2]);354319355320 boot_page_count = (iap_start_addr * 2) / ETP_FW_PAGE_SIZE;356356- for (i = boot_page_count; i < ETP_FW_VAILDPAGE_COUNT; i++) {321321+ for (i = boot_page_count; i < data->fw_vaildpage_count; i++) {357322 u16 checksum = 0;358323 const u8 *page = &fw->data[i * ETP_FW_PAGE_SIZE];359324···438403 struct i2c_client *client = to_i2c_client(dev);439404 struct elan_tp_data *data = i2c_get_clientdata(client);440405441441- return sprintf(buf, "%d.0\n", data->product_id);406406+ return sprintf(buf, ETP_PRODUCT_ID_FORMAT_STRING "\n",407407+ data->product_id);442408}443409444410static ssize_t elan_sysfs_read_fw_ver(struct device *dev,···478442{479443 struct elan_tp_data *data = dev_get_drvdata(dev);480444 const struct firmware *fw;445445+ char *fw_name;481446 int error;482447 const u8 *fw_signature;483448 static const u8 signature[] = {0xAA, 0x55, 0xCC, 0x33, 0xFF, 0xFF};484449485485- error = request_firmware(&fw, ETP_FW_NAME, dev);450450+ /* Look for a firmware with the product id appended. */451451+ fw_name = kasprintf(GFP_KERNEL, ETP_FW_NAME, data->product_id);452452+ if (!fw_name) {453453+ dev_err(dev, "failed to allocate memory for firmware name\n");454454+ return -ENOMEM;455455+ }456456+457457+ dev_info(dev, "requesting fw '%s'\n", fw_name);458458+ error = request_firmware(&fw, fw_name, dev);459459+ kfree(fw_name);486460 if (error) {487487- dev_err(dev, "cannot load firmware %s: %d\n",488488- ETP_FW_NAME, error);461461+ dev_err(dev, "failed to request firmware: %d\n", error);489462 return error;490463 }491464492465 /* Firmware file must match signature data */493493- fw_signature = &fw->data[ETP_FW_SIGNATURE_ADDRESS];466466+ fw_signature = &fw->data[data->fw_signature_address];494467 if (memcmp(fw_signature, signature, sizeof(signature)) != 0) {495468 dev_err(dev, "signature mismatch (expected %*ph, got %*ph)\n",496469 (int)sizeof(signature), signature,
+3-1
drivers/input/mouse/elan_i2c_i2c.c
···259259 return 0;260260}261261262262-static int elan_i2c_get_sm_version(struct i2c_client *client, u8 *version)262262+static int elan_i2c_get_sm_version(struct i2c_client *client,263263+ u8 *ic_type, u8 *version)263264{264265 int error;265266 u8 val[3];···272271 }273272274273 *version = val[0];274274+ *ic_type = val[1];275275 return 0;276276}277277
+4-2
drivers/input/mouse/elan_i2c_smbus.c
···165165 return 0;166166}167167168168-static int elan_smbus_get_sm_version(struct i2c_client *client, u8 *version)168168+static int elan_smbus_get_sm_version(struct i2c_client *client,169169+ u8 *ic_type, u8 *version)169170{170171 int error;171172 u8 val[3];···178177 return error;179178 }180179181181- *version = val[0]; /* XXX Why 0 and not 2 as in IAP/FW versions? */180180+ *version = val[0];181181+ *ic_type = val[1];182182 return 0;183183}184184
+13
drivers/input/mouse/focaltech.c
···103103 */104104 struct focaltech_finger_state fingers[FOC_MAX_FINGERS];105105106106+ /*107107+ * Finger width 0-7 and 15 for a very big contact area.108108+ * 15 value stays until the finger is released.109109+ * Width is reported only in absolute packets.110110+ * Since hardware reports width only for last touching finger,111111+ * there is no need to store width for every specific finger,112112+ * so we keep only last value reported.113113+ */114114+ unsigned int width;115115+106116 /* True if the clickpad has been pressed. */107117 bool pressed;108118};···147137 input_report_abs(dev, ABS_MT_POSITION_X, clamped_x);148138 input_report_abs(dev, ABS_MT_POSITION_Y,149139 priv->y_max - clamped_y);140140+ input_report_abs(dev, ABS_TOOL_WIDTH, state->width);150141 }151142 }152143 input_mt_report_pointer_emulation(dev, true);···198187199188 state->fingers[finger].x = ((packet[1] & 0xf) << 8) | packet[2];200189 state->fingers[finger].y = (packet[3] << 8) | packet[4];190190+ state->width = packet[5] >> 4;201191 state->fingers[finger].valid = true;202192}203193···343331 __set_bit(EV_ABS, dev->evbit);344332 input_set_abs_params(dev, ABS_MT_POSITION_X, 0, priv->x_max, 0, 0);345333 input_set_abs_params(dev, ABS_MT_POSITION_Y, 0, priv->y_max, 0, 0);334334+ input_set_abs_params(dev, ABS_TOOL_WIDTH, 0, 15, 0, 0);346335 input_mt_init_slots(dev, 5, INPUT_MT_POINTER);347336 __set_bit(INPUT_PROP_BUTTONPAD, dev->propbit);348337}
···123123extern int fsp_detect(struct psmouse *psmouse, bool set_properties);124124extern int fsp_init(struct psmouse *psmouse);125125#else126126-inline int fsp_detect(struct psmouse *psmouse, bool set_properties)126126+static inline int fsp_detect(struct psmouse *psmouse, bool set_properties)127127{128128 return -ENOSYS;129129}130130-inline int fsp_init(struct psmouse *psmouse)130130+static inline int fsp_init(struct psmouse *psmouse)131131{132132 return -ENOSYS;133133}
+3-3
drivers/input/mouse/synaptics_i2c.c
···185185#define NO_DATA_SLEEP_MSECS (MSEC_PER_SEC / 4)186186187187/* Control touchpad's No Deceleration option */188188-static bool no_decel = 1;188188+static bool no_decel = true;189189module_param(no_decel, bool, 0644);190190MODULE_PARM_DESC(no_decel, "No Deceleration. Default = 1 (on)");191191···340340 s32 data;341341 s8 x_delta, y_delta;342342343343- /* Deal with spontanious resets and errors */343343+ /* Deal with spontaneous resets and errors */344344 if (synaptics_i2c_check_error(touch->client))345345- return 0;345345+ return false;346346347347 /* Get Gesture Bit */348348 data = synaptics_i2c_reg_get(touch->client, DATA_REG0);
+1
drivers/input/touchscreen/Kconfig
···958958config TOUCHSCREEN_STMPE959959 tristate "STMicroelectronics STMPE touchscreens"960960 depends on MFD_STMPE961961+ depends on (OF || COMPILE_TEST)961962 help962963 Say Y here if you want support for STMicroelectronics963964 STMPE touchscreen controllers.
···1111 Say Y to enable Linux LED support. This allows control of supported1212 LEDs from both userspace and optionally, by kernel events (triggers).13131414- This is not related to standard keyboard LEDs which are controlled1515- via the input system.1616-1714if NEW_LEDS18151916config LEDS_CLASS
+1-18
drivers/tty/sysrq.c
···5555static int __read_mostly sysrq_enabled = CONFIG_MAGIC_SYSRQ_DEFAULT_ENABLE;5656static bool __read_mostly sysrq_always_enabled;57575858-unsigned short platform_sysrq_reset_seq[] __weak = { KEY_RESERVED };5959-int sysrq_reset_downtime_ms __weak;6060-6158static bool sysrq_on(void)6259{6360 return sysrq_enabled || sysrq_always_enabled;···565568EXPORT_SYMBOL(handle_sysrq);566569567570#ifdef CONFIG_INPUT571571+static int sysrq_reset_downtime_ms;568572569573/* Simple translation table for the SysRq keys */570574static const unsigned char sysrq_xlate[KEY_CNT] =···946948947949static inline void sysrq_register_handler(void)948950{949949- unsigned short key;950951 int error;951951- int i;952952953953- /* First check if a __weak interface was instantiated. */954954- for (i = 0; i < ARRAY_SIZE(sysrq_reset_seq); i++) {955955- key = platform_sysrq_reset_seq[i];956956- if (key == KEY_RESERVED || key > KEY_MAX)957957- break;958958-959959- sysrq_reset_seq[sysrq_reset_seq_len++] = key;960960- }961961-962962- /*963963- * DT configuration takes precedence over anything that would964964- * have been defined via the __weak interface.965965- */966953 sysrq_of_get_keyreset_config();967954968955 error = input_register_handler(&sysrq_handler);
+130-26
drivers/tty/vt/keyboard.c
···3333#include <linux/string.h>3434#include <linux/init.h>3535#include <linux/slab.h>3636+#include <linux/leds.h>36373738#include <linux/kbd_kern.h>3839#include <linux/kbd_diacr.h>···130129131130static int shift_state = 0;132131133133-static unsigned char ledstate = 0xff; /* undefined */132132+static unsigned int ledstate = -1U; /* undefined */134133static unsigned char ledioctl;135134136135/*···962961 }963962}964963964964+#if IS_ENABLED(CONFIG_INPUT_LEDS) && IS_ENABLED(CONFIG_LEDS_TRIGGERS)965965+966966+struct kbd_led_trigger {967967+ struct led_trigger trigger;968968+ unsigned int mask;969969+};970970+971971+static void kbd_led_trigger_activate(struct led_classdev *cdev)972972+{973973+ struct kbd_led_trigger *trigger =974974+ container_of(cdev->trigger, struct kbd_led_trigger, trigger);975975+976976+ tasklet_disable(&keyboard_tasklet);977977+ if (ledstate != -1U)978978+ led_trigger_event(&trigger->trigger,979979+ ledstate & trigger->mask ?980980+ LED_FULL : LED_OFF);981981+ tasklet_enable(&keyboard_tasklet);982982+}983983+984984+#define KBD_LED_TRIGGER(_led_bit, _name) { \985985+ .trigger = { \986986+ .name = _name, \987987+ .activate = kbd_led_trigger_activate, \988988+ }, \989989+ .mask = BIT(_led_bit), \990990+ }991991+992992+#define KBD_LOCKSTATE_TRIGGER(_led_bit, _name) \993993+ KBD_LED_TRIGGER((_led_bit) + 8, _name)994994+995995+static struct kbd_led_trigger kbd_led_triggers[] = {996996+ KBD_LED_TRIGGER(VC_SCROLLOCK, "kbd-scrollock"),997997+ KBD_LED_TRIGGER(VC_NUMLOCK, "kbd-numlock"),998998+ KBD_LED_TRIGGER(VC_CAPSLOCK, "kbd-capslock"),999999+ KBD_LED_TRIGGER(VC_KANALOCK, "kbd-kanalock"),10001000+10011001+ KBD_LOCKSTATE_TRIGGER(VC_SHIFTLOCK, "kbd-shiftlock"),10021002+ KBD_LOCKSTATE_TRIGGER(VC_ALTGRLOCK, "kbd-altgrlock"),10031003+ KBD_LOCKSTATE_TRIGGER(VC_CTRLLOCK, "kbd-ctrllock"),10041004+ KBD_LOCKSTATE_TRIGGER(VC_ALTLOCK, "kbd-altlock"),10051005+ KBD_LOCKSTATE_TRIGGER(VC_SHIFTLLOCK, "kbd-shiftllock"),10061006+ KBD_LOCKSTATE_TRIGGER(VC_SHIFTRLOCK, "kbd-shiftrlock"),10071007+ KBD_LOCKSTATE_TRIGGER(VC_CTRLLLOCK, "kbd-ctrlllock"),10081008+ KBD_LOCKSTATE_TRIGGER(VC_CTRLRLOCK, "kbd-ctrlrlock"),10091009+};10101010+10111011+static void kbd_propagate_led_state(unsigned int old_state,10121012+ unsigned int new_state)10131013+{10141014+ struct kbd_led_trigger *trigger;10151015+ unsigned int changed = old_state ^ new_state;10161016+ int i;10171017+10181018+ for (i = 0; i < ARRAY_SIZE(kbd_led_triggers); i++) {10191019+ trigger = &kbd_led_triggers[i];10201020+10211021+ if (changed & trigger->mask)10221022+ led_trigger_event(&trigger->trigger,10231023+ new_state & trigger->mask ?10241024+ LED_FULL : LED_OFF);10251025+ }10261026+}10271027+10281028+static int kbd_update_leds_helper(struct input_handle *handle, void *data)10291029+{10301030+ unsigned int led_state = *(unsigned int *)data;10311031+10321032+ if (test_bit(EV_LED, handle->dev->evbit))10331033+ kbd_propagate_led_state(~led_state, led_state);10341034+10351035+ return 0;10361036+}10371037+10381038+static void kbd_init_leds(void)10391039+{10401040+ int error;10411041+ int i;10421042+10431043+ for (i = 0; i < ARRAY_SIZE(kbd_led_triggers); i++) {10441044+ error = led_trigger_register(&kbd_led_triggers[i].trigger);10451045+ if (error)10461046+ pr_err("error %d while registering trigger %s\n",10471047+ error, kbd_led_triggers[i].trigger.name);10481048+ }10491049+}10501050+10511051+#else10521052+10531053+static int kbd_update_leds_helper(struct input_handle *handle, void *data)10541054+{10551055+ unsigned int leds = *(unsigned int *)data;10561056+10571057+ if (test_bit(EV_LED, handle->dev->evbit)) {10581058+ input_inject_event(handle, EV_LED, LED_SCROLLL, !!(leds & 0x01));10591059+ input_inject_event(handle, EV_LED, LED_NUML, !!(leds & 0x02));10601060+ input_inject_event(handle, EV_LED, LED_CAPSL, !!(leds & 0x04));10611061+ input_inject_event(handle, EV_SYN, SYN_REPORT, 0);10621062+ }10631063+10641064+ return 0;10651065+}10661066+10671067+static void kbd_propagate_led_state(unsigned int old_state,10681068+ unsigned int new_state)10691069+{10701070+ input_handler_for_each_handle(&kbd_handler, &new_state,10711071+ kbd_update_leds_helper);10721072+}10731073+10741074+static void kbd_init_leds(void)10751075+{10761076+}10771077+10781078+#endif10791079+9651080/*9661081 * The leds display either (i) the status of NumLock, CapsLock, ScrollLock,9671082 * or (ii) whatever pattern of lights people want to show using KDSETLED,···1085968 */1086969static unsigned char getledstate(void)1087970{10881088- return ledstate;971971+ return ledstate & 0xff;1089972}10909731091974void setledstate(struct kbd_struct *kb, unsigned int led)···1110993 return ledioctl;11119941112995 return kb->ledflagstate;11131113-}11141114-11151115-static int kbd_update_leds_helper(struct input_handle *handle, void *data)11161116-{11171117- unsigned char leds = *(unsigned char *)data;11181118-11191119- if (test_bit(EV_LED, handle->dev->evbit)) {11201120- input_inject_event(handle, EV_LED, LED_SCROLLL, !!(leds & 0x01));11211121- input_inject_event(handle, EV_LED, LED_NUML, !!(leds & 0x02));11221122- input_inject_event(handle, EV_LED, LED_CAPSL, !!(leds & 0x04));11231123- input_inject_event(handle, EV_SYN, SYN_REPORT, 0);11241124- }11251125-11261126- return 0;1127996}11289971129998/**···11881085}1189108611901087/*11911191- * This is the tasklet that updates LED state on all keyboards11921192- * attached to the box. The reason we use tasklet is that we11931193- * need to handle the scenario when keyboard handler is not11941194- * registered yet but we already getting updates from the VT to11951195- * update led state.10881088+ * This is the tasklet that updates LED state of LEDs using standard10891089+ * keyboard triggers. The reason we use tasklet is that we need to10901090+ * handle the scenario when keyboard handler is not registered yet10911091+ * but we already getting updates from the VT to update led state.11961092 */11971093static void kbd_bh(unsigned long dummy)11981094{11991199- unsigned char leds;10951095+ unsigned int leds;12001096 unsigned long flags;12011201-10971097+12021098 spin_lock_irqsave(&led_lock, flags);12031099 leds = getleds();11001100+ leds |= (unsigned int)kbd->lockstate << 8;12041101 spin_unlock_irqrestore(&led_lock, flags);1205110212061103 if (leds != ledstate) {12071207- input_handler_for_each_handle(&kbd_handler, &leds,12081208- kbd_update_leds_helper);11041104+ kbd_propagate_led_state(ledstate, leds);12091105 ledstate = leds;12101106 }12111107}···15521450{15531451 tasklet_disable(&keyboard_tasklet);1554145215551555- if (ledstate != 0xff)14531453+ if (ledstate != -1U)15561454 kbd_update_leds_helper(handle, &ledstate);1557145515581456 tasklet_enable(&keyboard_tasklet);···15981496 kbd_table[i].modeflags = KBD_DEFMODE;15991497 kbd_table[i].kbdmode = default_utf8 ? VC_UNICODE : VC_XLATE;16001498 }14991499+15001500+ kbd_init_leds();1601150116021502 error = input_register_handler(&kbd_handler);16031503 if (error)
+1
include/linux/mfd/da9063/pdata.h
···103103struct da9063_pdata {104104 int (*init)(struct da9063 *da9063);105105 int irq_base;106106+ bool key_power;106107 unsigned flags;107108 struct da9063_regulators_pdata *regulators_pdata;108109 struct led_platform_data *leds_pdata;
-44
include/linux/mfd/stmpe.h
···118118#define STMPE_GPIO_NOREQ_811_TOUCH (0xf0)119119120120/**121121- * struct stmpe_ts_platform_data - stmpe811 touch screen controller platform122122- * data123123- * @sample_time: ADC converstion time in number of clock.124124- * (0 -> 36 clocks, 1 -> 44 clocks, 2 -> 56 clocks, 3 -> 64 clocks,125125- * 4 -> 80 clocks, 5 -> 96 clocks, 6 -> 144 clocks),126126- * recommended is 4.127127- * @mod_12b: ADC Bit mode (0 -> 10bit ADC, 1 -> 12bit ADC)128128- * @ref_sel: ADC reference source129129- * (0 -> internal reference, 1 -> external reference)130130- * @adc_freq: ADC Clock speed131131- * (0 -> 1.625 MHz, 1 -> 3.25 MHz, 2 || 3 -> 6.5 MHz)132132- * @ave_ctrl: Sample average control133133- * (0 -> 1 sample, 1 -> 2 samples, 2 -> 4 samples, 3 -> 8 samples)134134- * @touch_det_delay: Touch detect interrupt delay135135- * (0 -> 10 us, 1 -> 50 us, 2 -> 100 us, 3 -> 500 us,136136- * 4-> 1 ms, 5 -> 5 ms, 6 -> 10 ms, 7 -> 50 ms)137137- * recommended is 3138138- * @settling: Panel driver settling time139139- * (0 -> 10 us, 1 -> 100 us, 2 -> 500 us, 3 -> 1 ms,140140- * 4 -> 5 ms, 5 -> 10 ms, 6 for 50 ms, 7 -> 100 ms)141141- * recommended is 2142142- * @fraction_z: Length of the fractional part in z143143- * (fraction_z ([0..7]) = Count of the fractional part)144144- * recommended is 7145145- * @i_drive: current limit value of the touchscreen drivers146146- * (0 -> 20 mA typical 35 mA max, 1 -> 50 mA typical 80 mA max)147147- *148148- * */149149-struct stmpe_ts_platform_data {150150- u8 sample_time;151151- u8 mod_12b;152152- u8 ref_sel;153153- u8 adc_freq;154154- u8 ave_ctrl;155155- u8 touch_det_delay;156156- u8 settling;157157- u8 fraction_z;158158- u8 i_drive;159159-};160160-161161-/**162121 * struct stmpe_platform_data - STMPE platform data163122 * @id: device id to distinguish between multiple STMPEs on the same board164123 * @blocks: bitmask of blocks to enable (use STMPE_BLOCK_*)···127168 * @irq_over_gpio: true if gpio is used to get irq128169 * @irq_gpio: gpio number over which irq will be requested (significant only if129170 * irq_over_gpio is true)130130- * @ts: touchscreen-specific platform data131171 */132172struct stmpe_platform_data {133173 int id;···136178 bool irq_over_gpio;137179 int irq_gpio;138180 int autosleep_timeout;139139-140140- struct stmpe_ts_platform_data *ts;141181};142182143183#endif
+1-1
include/linux/platform_data/keyboard-spear.h
···11/*22 * Copyright (C) 2010 ST Microelectronics33- * Rajeev Kumar<rajeev-dlh.kumar@st.com>33+ * Rajeev Kumar <rajeevkumar.linux@gmail.com>44 *55 * This file is licensed under the terms of the GNU General Public66 * License version 2. This program is licensed "as is" without any