···2233Required properties:44- compatible: must be "brcm,iproc-touchscreen"55-- reg: physical base address of the controller and length of memory mapped66- region.55+- ts_syscon: handler of syscon node defining physical base66+ address of the controller and length of memory mapped region.77+ If this property is selected please make sure MFD_SYSCON config88+ is enabled in the defconfig file.79- clocks: The clock provided by the SOC to driver the tsc88-- clock-name: name for the clock1010+- clock-names: name for the clock911- interrupts: The touchscreen controller's interrupt1212+- address-cells: Specify the number of u32 entries needed in child nodes.1313+ Should set to 1.1414+- size-cells: Specify number of u32 entries needed to specify child nodes size1515+ in reg property. Should set to 1.10161117Optional properties:1218- scanning_period: Time between scans. Each step is 1024 us. Valid 1-256.···5953- touchscreen-inverted-x: X axis is inverted (boolean)6054- touchscreen-inverted-y: Y axis is inverted (boolean)61556262-Example:5656+Example: An example of touchscreen node63576464- touchscreen: tsc@0x180A6000 {5858+ ts_adc_syscon: ts_adc_syscon@180a6000 {5959+ compatible = "brcm,iproc-ts-adc-syscon","syscon";6060+ reg = <0x180a6000 0xc30>;6161+ };6262+6363+ touchscreen: touchscreen@180A6000 {6564 compatible = "brcm,iproc-touchscreen";6665 #address-cells = <1>;6766 #size-cells = <1>;6868- reg = <0x180A6000 0x40>;6767+ ts_syscon = <&ts_adc_syscon>;6968 clocks = <&adc_clk>;7069 clock-names = "tsc_clk";7170 interrupts = <GIC_SPI 164 IRQ_TYPE_LEVEL_HIGH>;
···6464static unsigned int *row_gpios;6565static unsigned int *col_gpios;66666767-#ifdef CONFIG_ARCH_OMAP26868-static void set_col_gpio_val(struct omap_kp *omap_kp, u8 value)6969-{7070- int col;7171-7272- for (col = 0; col < omap_kp->cols; col++)7373- gpio_set_value(col_gpios[col], value & (1 << col));7474-}7575-7676-static u8 get_row_gpio_val(struct omap_kp *omap_kp)7777-{7878- int row;7979- u8 value = 0;8080-8181- for (row = 0; row < omap_kp->rows; row++) {8282- if (gpio_get_value(row_gpios[row]))8383- value |= (1 << row);8484- }8585- return value;8686-}8787-#else8888-#define set_col_gpio_val(x, y) do {} while (0)8989-#define get_row_gpio_val(x) 09090-#endif9191-9267static irqreturn_t omap_kp_interrupt(int irq, void *dev_id)9368{9469 /* disable keyboard interrupt and schedule for handling */···108133 unsigned int row_shift = get_count_order(omap_kp_data->cols);109134 unsigned char new_state[8], changed, key_down = 0;110135 int col, row;111111- int spurious = 0;112136113137 /* check for any changes */114138 omap_kp_scan_keypad(omap_kp_data, new_state);···144170 memcpy(keypad_state, new_state, sizeof(keypad_state));145171146172 if (key_down) {147147- int delay = HZ / 20;148173 /* some key is pressed - keep irq disabled and use timer149174 * to poll the keypad */150150- if (spurious)151151- delay = 2 * HZ;152152- mod_timer(&omap_kp_data->timer, jiffies + delay);175175+ mod_timer(&omap_kp_data->timer, jiffies + HZ / 20);153176 } else {154177 /* enable interrupts */155178 omap_writew(0, OMAP1_MPUIO_BASE + OMAP_MPUIO_KBD_MASKIT);···186215}187216188217static DEVICE_ATTR(enable, S_IRUGO | S_IWUSR, omap_kp_enable_show, omap_kp_enable_store);189189-190190-#ifdef CONFIG_PM191191-static int omap_kp_suspend(struct platform_device *dev, pm_message_t state)192192-{193193- /* Nothing yet */194194-195195- return 0;196196-}197197-198198-static int omap_kp_resume(struct platform_device *dev)199199-{200200- /* Nothing yet */201201-202202- return 0;203203-}204204-#else205205-#define omap_kp_suspend NULL206206-#define omap_kp_resume NULL207207-#endif208218209219static int omap_kp_probe(struct platform_device *pdev)210220{···323371static struct platform_driver omap_kp_driver = {324372 .probe = omap_kp_probe,325373 .remove = omap_kp_remove,326326- .suspend = omap_kp_suspend,327327- .resume = omap_kp_resume,328374 .driver = {329375 .name = "omap-keypad",330376 },
+16-12
drivers/input/keyboard/twl4030_keypad.c
···6161 unsigned short keymap[TWL4030_KEYMAP_SIZE];6262 u16 kp_state[TWL4030_MAX_ROWS];6363 bool autorepeat;6464- unsigned n_rows;6565- unsigned n_cols;6666- unsigned irq;6464+ unsigned int n_rows;6565+ unsigned int n_cols;6666+ unsigned int irq;67676868 struct device *dbg_dev;6969 struct input_dev *input;···110110#define KEYP_CTRL_KBD_ON BIT(6)111111112112/* KEYP_DEB, KEYP_LONG_KEY, KEYP_TIMEOUT_x*/113113-#define KEYP_PERIOD_US(t, prescale) ((t) / (31 << (prescale + 1)) - 1)113113+#define KEYP_PERIOD_US(t, prescale) ((t) / (31 << ((prescale) + 1)) - 1)114114115115/* KEYP_LK_PTV_REG Fields */116116#define KEYP_LK_PTV_PTV_SHIFT 5···162162163163static inline u16 twl4030_col_xlate(struct twl4030_keypad *kp, u8 col)164164{165165- /* If all bits in a row are active for all coloumns then165165+ /*166166+ * If all bits in a row are active for all columns then166167 * we have that row line connected to gnd. Mark this167167- * key on as if it was on matrix position n_cols (ie168168+ * key on as if it was on matrix position n_cols (i.e.168169 * one higher than the size of the matrix).169170 */170171 if (col == 0xFF)···210209 u16 new_state[TWL4030_MAX_ROWS];211210 int col, row;212211213213- if (release_all)212212+ if (release_all) {214213 memset(new_state, 0, sizeof(new_state));215215- else {214214+ } else {216215 /* check for any changes */217216 int ret = twl4030_read_kp_matrix_state(kp, new_state);218217···263262 /* Read & Clear TWL4030 pending interrupt */264263 ret = twl4030_kpread(kp, ®, KEYP_ISR1, 1);265264266266- /* Release all keys if I2C has gone bad or267267- * the KEYP has gone to idle state */265265+ /*266266+ * Release all keys if I2C has gone bad or267267+ * the KEYP has gone to idle state.268268+ */268269 if (ret >= 0 && (reg & KEYP_IMR1_KP))269270 twl4030_kp_scan(kp, false);270271 else···286283 if (twl4030_kpwrite_u8(kp, reg, KEYP_CTRL) < 0)287284 return -EIO;288285289289- /* NOTE: we could use sih_setup() here to package keypad286286+ /*287287+ * NOTE: we could use sih_setup() here to package keypad290288 * event sources as four different IRQs ... but we don't.291289 */292290···316312317313 /*318314 * Enable Clear-on-Read; disable remembering events that fire319319- * after the IRQ but before our handler acks (reads) them,315315+ * after the IRQ but before our handler acks (reads) them.320316 */321317 reg = TWL4030_SIH_CTRL_COR_MASK | TWL4030_SIH_CTRL_PENDDIS_MASK;322318 if (twl4030_kpwrite_u8(kp, reg, KEYP_SIH_CTRL) < 0)
+36-11
drivers/input/misc/cm109.c
···76767777 BUZZER_ON = 1 << 5,78787979- /* up to 256 normal keys, up to 16 special keys */8080- KEYMAP_SIZE = 256 + 16,7979+ /* up to 256 normal keys, up to 15 special key combinations */8080+ KEYMAP_SIZE = 256 + 15,8181};82828383/* CM109 protocol packet */···139139{140140 if (code > 0xff) {141141 switch (code - 0xff) {142142- case RECORD_MUTE: return KEY_MUTE;142142+ case RECORD_MUTE: return KEY_MICMUTE;143143 case PLAYBACK_MUTE: return KEY_MUTE;144144 case VOLUME_DOWN: return KEY_VOLUMEDOWN;145145 case VOLUME_UP: return KEY_VOLUMEUP;···312312 input_sync(idev);313313}314314315315+/*316316+ * Converts data of special key presses (volume, mute) into events317317+ * for the input subsystem, sends press-n-release for mute keys.318318+ */319319+static void cm109_report_special(struct cm109_dev *dev)320320+{321321+ static const u8 autorelease = RECORD_MUTE | PLAYBACK_MUTE;322322+ struct input_dev *idev = dev->idev;323323+ u8 data = dev->irq_data->byte[HID_IR0];324324+ unsigned short keycode;325325+ int i;326326+327327+ for (i = 0; i < 4; i++) {328328+ keycode = dev->keymap[0xff + BIT(i)];329329+ if (keycode == KEY_RESERVED)330330+ continue;331331+332332+ input_report_key(idev, keycode, data & BIT(i));333333+ if (data & autorelease & BIT(i)) {334334+ input_sync(idev);335335+ input_report_key(idev, keycode, 0);336336+ }337337+ }338338+ input_sync(idev);339339+}340340+315341/******************************************************************************316342 * CM109 usb communication interface317343 *****************************************************************************/···366340 struct cm109_dev *dev = urb->context;367341 const int status = urb->status;368342 int error;343343+ unsigned long flags;369344370345 dev_dbg(&dev->intf->dev, "### URB IRQ: [0x%02x 0x%02x 0x%02x 0x%02x] keybit=0x%02x\n",371346 dev->irq_data->byte[0],···384357 }385358386359 /* Special keys */387387- if (dev->irq_data->byte[HID_IR0] & 0x0f) {388388- const int code = (dev->irq_data->byte[HID_IR0] & 0x0f);389389- report_key(dev, dev->keymap[0xff + code]);390390- }360360+ cm109_report_special(dev);391361392362 /* Scan key column */393363 if (dev->keybit == 0xf) {···405381406382 out:407383408408- spin_lock(&dev->ctl_submit_lock);384384+ spin_lock_irqsave(&dev->ctl_submit_lock, flags);409385410386 dev->irq_urb_pending = 0;411387···429405 __func__, error);430406 }431407432432- spin_unlock(&dev->ctl_submit_lock);408408+ spin_unlock_irqrestore(&dev->ctl_submit_lock, flags);433409}434410435411static void cm109_urb_ctl_callback(struct urb *urb)···437413 struct cm109_dev *dev = urb->context;438414 const int status = urb->status;439415 int error;416416+ unsigned long flags;440417441418 dev_dbg(&dev->intf->dev, "### URB CTL: [0x%02x 0x%02x 0x%02x 0x%02x]\n",442419 dev->ctl_data->byte[0],···452427 __func__, status);453428 }454429455455- spin_lock(&dev->ctl_submit_lock);430430+ spin_lock_irqsave(&dev->ctl_submit_lock, flags);456431457432 dev->ctl_urb_pending = 0;458433···473448 }474449 }475450476476- spin_unlock(&dev->ctl_submit_lock);451451+ spin_unlock_irqrestore(&dev->ctl_submit_lock, flags);477452}478453479454static void cm109_toggle_buzzer_async(struct cm109_dev *dev)
+4-4
drivers/input/misc/rotary_encoder.c
···4747 bool armed;4848 signed char dir; /* 1 - clockwise, -1 - CCW */49495050- unsigned last_stable;5050+ unsigned int last_stable;5151};52525353-static unsigned rotary_encoder_get_state(struct rotary_encoder *encoder)5353+static unsigned int rotary_encoder_get_state(struct rotary_encoder *encoder)5454{5555 int i;5656- unsigned ret = 0;5656+ unsigned int ret = 0;57575858 for (i = 0; i < encoder->gpios->ndescs; ++i) {5959 int val = gpiod_get_value_cansleep(encoder->gpios->desc[i]);···100100static irqreturn_t rotary_encoder_irq(int irq, void *dev_id)101101{102102 struct rotary_encoder *encoder = dev_id;103103- unsigned state;103103+ unsigned int state;104104105105 mutex_lock(&encoder->access_mutex);106106