GNU Linux-libre 4.14.262-gnu1
[releases.git] / drivers / input / keyboard / cros_ec_keyb.c
1 /*
2  * ChromeOS EC keyboard driver
3  *
4  * Copyright (C) 2012 Google, Inc
5  *
6  * This software is licensed under the terms of the GNU General Public
7  * License version 2, as published by the Free Software Foundation, and
8  * may be copied, distributed, and modified under those terms.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  *
15  * This driver uses the Chrome OS EC byte-level message-based protocol for
16  * communicating the keyboard state (which keys are pressed) from a keyboard EC
17  * to the AP over some bus (such as i2c, lpc, spi).  The EC does debouncing,
18  * but everything else (including deghosting) is done here.  The main
19  * motivation for this is to keep the EC firmware as simple as possible, since
20  * it cannot be easily upgraded and EC flash/IRAM space is relatively
21  * expensive.
22  */
23
24 #include <linux/module.h>
25 #include <linux/bitops.h>
26 #include <linux/i2c.h>
27 #include <linux/input.h>
28 #include <linux/interrupt.h>
29 #include <linux/kernel.h>
30 #include <linux/notifier.h>
31 #include <linux/platform_device.h>
32 #include <linux/slab.h>
33 #include <linux/sysrq.h>
34 #include <linux/input/matrix_keypad.h>
35 #include <linux/mfd/cros_ec.h>
36 #include <linux/mfd/cros_ec_commands.h>
37
38 #include <asm/unaligned.h>
39
40 /*
41  * @rows: Number of rows in the keypad
42  * @cols: Number of columns in the keypad
43  * @row_shift: log2 or number of rows, rounded up
44  * @keymap_data: Matrix keymap data used to convert to keyscan values
45  * @ghost_filter: true to enable the matrix key-ghosting filter
46  * @valid_keys: bitmap of existing keys for each matrix column
47  * @old_kb_state: bitmap of keys pressed last scan
48  * @dev: Device pointer
49  * @ec: Top level ChromeOS device to use to talk to EC
50  * @idev: The input device for the matrix keys.
51  * @bs_idev: The input device for non-matrix buttons and switches (or NULL).
52  * @notifier: interrupt event notifier for transport devices
53  */
54 struct cros_ec_keyb {
55         unsigned int rows;
56         unsigned int cols;
57         int row_shift;
58         const struct matrix_keymap_data *keymap_data;
59         bool ghost_filter;
60         uint8_t *valid_keys;
61         uint8_t *old_kb_state;
62
63         struct device *dev;
64         struct cros_ec_device *ec;
65
66         struct input_dev *idev;
67         struct input_dev *bs_idev;
68         struct notifier_block notifier;
69 };
70
71
72 /**
73  * cros_ec_bs_map - Struct mapping Linux keycodes to EC button/switch bitmap
74  * #defines
75  *
76  * @ev_type: The type of the input event to generate (e.g., EV_KEY).
77  * @code: A linux keycode
78  * @bit: A #define like EC_MKBP_POWER_BUTTON or EC_MKBP_LID_OPEN
79  * @inverted: If the #define and EV_SW have opposite meanings, this is true.
80  *            Only applicable to switches.
81  */
82 struct cros_ec_bs_map {
83         unsigned int ev_type;
84         unsigned int code;
85         u8 bit;
86         bool inverted;
87 };
88
89 /* cros_ec_keyb_bs - Map EC button/switch #defines into kernel ones */
90 static const struct cros_ec_bs_map cros_ec_keyb_bs[] = {
91         /* Buttons */
92         {
93                 .ev_type        = EV_KEY,
94                 .code           = KEY_POWER,
95                 .bit            = EC_MKBP_POWER_BUTTON,
96         },
97         {
98                 .ev_type        = EV_KEY,
99                 .code           = KEY_VOLUMEUP,
100                 .bit            = EC_MKBP_VOL_UP,
101         },
102         {
103                 .ev_type        = EV_KEY,
104                 .code           = KEY_VOLUMEDOWN,
105                 .bit            = EC_MKBP_VOL_DOWN,
106         },
107
108         /* Switches */
109         {
110                 .ev_type        = EV_SW,
111                 .code           = SW_LID,
112                 .bit            = EC_MKBP_LID_OPEN,
113                 .inverted       = true,
114         },
115         {
116                 .ev_type        = EV_SW,
117                 .code           = SW_TABLET_MODE,
118                 .bit            = EC_MKBP_TABLET_MODE,
119         },
120 };
121
122 /*
123  * Returns true when there is at least one combination of pressed keys that
124  * results in ghosting.
125  */
126 static bool cros_ec_keyb_has_ghosting(struct cros_ec_keyb *ckdev, uint8_t *buf)
127 {
128         int col1, col2, buf1, buf2;
129         struct device *dev = ckdev->dev;
130         uint8_t *valid_keys = ckdev->valid_keys;
131
132         /*
133          * Ghosting happens if for any pressed key X there are other keys
134          * pressed both in the same row and column of X as, for instance,
135          * in the following diagram:
136          *
137          * . . Y . g .
138          * . . . . . .
139          * . . . . . .
140          * . . X . Z .
141          *
142          * In this case only X, Y, and Z are pressed, but g appears to be
143          * pressed too (see Wikipedia).
144          */
145         for (col1 = 0; col1 < ckdev->cols; col1++) {
146                 buf1 = buf[col1] & valid_keys[col1];
147                 for (col2 = col1 + 1; col2 < ckdev->cols; col2++) {
148                         buf2 = buf[col2] & valid_keys[col2];
149                         if (hweight8(buf1 & buf2) > 1) {
150                                 dev_dbg(dev, "ghost found at: B[%02d]:0x%02x & B[%02d]:0x%02x",
151                                         col1, buf1, col2, buf2);
152                                 return true;
153                         }
154                 }
155         }
156
157         return false;
158 }
159
160
161 /*
162  * Compares the new keyboard state to the old one and produces key
163  * press/release events accordingly.  The keyboard state is 13 bytes (one byte
164  * per column)
165  */
166 static void cros_ec_keyb_process(struct cros_ec_keyb *ckdev,
167                          uint8_t *kb_state, int len)
168 {
169         struct input_dev *idev = ckdev->idev;
170         int col, row;
171         int new_state;
172         int old_state;
173         int num_cols;
174
175         num_cols = len;
176
177         if (ckdev->ghost_filter && cros_ec_keyb_has_ghosting(ckdev, kb_state)) {
178                 /*
179                  * Simple-minded solution: ignore this state. The obvious
180                  * improvement is to only ignore changes to keys involved in
181                  * the ghosting, but process the other changes.
182                  */
183                 dev_dbg(ckdev->dev, "ghosting found\n");
184                 return;
185         }
186
187         for (col = 0; col < ckdev->cols; col++) {
188                 for (row = 0; row < ckdev->rows; row++) {
189                         int pos = MATRIX_SCAN_CODE(row, col, ckdev->row_shift);
190                         const unsigned short *keycodes = idev->keycode;
191
192                         new_state = kb_state[col] & (1 << row);
193                         old_state = ckdev->old_kb_state[col] & (1 << row);
194                         if (new_state != old_state) {
195                                 dev_dbg(ckdev->dev,
196                                         "changed: [r%d c%d]: byte %02x\n",
197                                         row, col, new_state);
198
199                                 input_event(idev, EV_MSC, MSC_SCAN, pos);
200                                 input_report_key(idev, keycodes[pos],
201                                                  new_state);
202                         }
203                 }
204                 ckdev->old_kb_state[col] = kb_state[col];
205         }
206         input_sync(ckdev->idev);
207 }
208
209 /**
210  * cros_ec_keyb_report_bs - Report non-matrixed buttons or switches
211  *
212  * This takes a bitmap of buttons or switches from the EC and reports events,
213  * syncing at the end.
214  *
215  * @ckdev: The keyboard device.
216  * @ev_type: The input event type (e.g., EV_KEY).
217  * @mask: A bitmap of buttons from the EC.
218  */
219 static void cros_ec_keyb_report_bs(struct cros_ec_keyb *ckdev,
220                                    unsigned int ev_type, u32 mask)
221
222 {
223         struct input_dev *idev = ckdev->bs_idev;
224         int i;
225
226         for (i = 0; i < ARRAY_SIZE(cros_ec_keyb_bs); i++) {
227                 const struct cros_ec_bs_map *map = &cros_ec_keyb_bs[i];
228
229                 if (map->ev_type != ev_type)
230                         continue;
231
232                 input_event(idev, ev_type, map->code,
233                             !!(mask & BIT(map->bit)) ^ map->inverted);
234         }
235         input_sync(idev);
236 }
237
238 static int cros_ec_keyb_work(struct notifier_block *nb,
239                              unsigned long queued_during_suspend, void *_notify)
240 {
241         struct cros_ec_keyb *ckdev = container_of(nb, struct cros_ec_keyb,
242                                                   notifier);
243         u32 val;
244         unsigned int ev_type;
245
246         switch (ckdev->ec->event_data.event_type) {
247         case EC_MKBP_EVENT_KEY_MATRIX:
248                 /*
249                  * If EC is not the wake source, discard key state changes
250                  * during suspend.
251                  */
252                 if (queued_during_suspend)
253                         return NOTIFY_OK;
254
255                 if (ckdev->ec->event_size != ckdev->cols) {
256                         dev_err(ckdev->dev,
257                                 "Discarded incomplete key matrix event.\n");
258                         return NOTIFY_OK;
259                 }
260                 cros_ec_keyb_process(ckdev,
261                                      ckdev->ec->event_data.data.key_matrix,
262                                      ckdev->ec->event_size);
263                 break;
264
265         case EC_MKBP_EVENT_SYSRQ:
266                 val = get_unaligned_le32(&ckdev->ec->event_data.data.sysrq);
267                 dev_dbg(ckdev->dev, "sysrq code from EC: %#x\n", val);
268                 handle_sysrq(val);
269                 break;
270
271         case EC_MKBP_EVENT_BUTTON:
272         case EC_MKBP_EVENT_SWITCH:
273                 /*
274                  * If EC is not the wake source, discard key state
275                  * changes during suspend. Switches will be re-checked in
276                  * cros_ec_keyb_resume() to be sure nothing is lost.
277                  */
278                 if (queued_during_suspend)
279                         return NOTIFY_OK;
280
281                 if (ckdev->ec->event_data.event_type == EC_MKBP_EVENT_BUTTON) {
282                         val = get_unaligned_le32(
283                                         &ckdev->ec->event_data.data.buttons);
284                         ev_type = EV_KEY;
285                 } else {
286                         val = get_unaligned_le32(
287                                         &ckdev->ec->event_data.data.switches);
288                         ev_type = EV_SW;
289                 }
290                 cros_ec_keyb_report_bs(ckdev, ev_type, val);
291                 break;
292
293         default:
294                 return NOTIFY_DONE;
295         }
296
297         return NOTIFY_OK;
298 }
299
300 /*
301  * Walks keycodes flipping bit in buffer COLUMNS deep where bit is ROW.  Used by
302  * ghosting logic to ignore NULL or virtual keys.
303  */
304 static void cros_ec_keyb_compute_valid_keys(struct cros_ec_keyb *ckdev)
305 {
306         int row, col;
307         int row_shift = ckdev->row_shift;
308         unsigned short *keymap = ckdev->idev->keycode;
309         unsigned short code;
310
311         BUG_ON(ckdev->idev->keycodesize != sizeof(*keymap));
312
313         for (col = 0; col < ckdev->cols; col++) {
314                 for (row = 0; row < ckdev->rows; row++) {
315                         code = keymap[MATRIX_SCAN_CODE(row, col, row_shift)];
316                         if (code && (code != KEY_BATTERY))
317                                 ckdev->valid_keys[col] |= 1 << row;
318                 }
319                 dev_dbg(ckdev->dev, "valid_keys[%02d] = 0x%02x\n",
320                         col, ckdev->valid_keys[col]);
321         }
322 }
323
324 /**
325  * cros_ec_keyb_info - Wrap the EC command EC_CMD_MKBP_INFO
326  *
327  * This wraps the EC_CMD_MKBP_INFO, abstracting out all of the marshalling and
328  * unmarshalling and different version nonsense into something simple.
329  *
330  * @ec_dev: The EC device
331  * @info_type: Either EC_MKBP_INFO_SUPPORTED or EC_MKBP_INFO_CURRENT.
332  * @event_type: Either EC_MKBP_EVENT_BUTTON or EC_MKBP_EVENT_SWITCH.  Actually
333  *              in some cases this could be EC_MKBP_EVENT_KEY_MATRIX or
334  *              EC_MKBP_EVENT_HOST_EVENT too but we don't use in this driver.
335  * @result: Where we'll store the result; a union
336  * @result_size: The size of the result.  Expected to be the size of one of
337  *               the elements in the union.
338  *
339  * Returns 0 if no error or -error upon error.
340  */
341 static int cros_ec_keyb_info(struct cros_ec_device *ec_dev,
342                              enum ec_mkbp_info_type info_type,
343                              enum ec_mkbp_event event_type,
344                              union ec_response_get_next_data *result,
345                              size_t result_size)
346 {
347         struct ec_params_mkbp_info *params;
348         struct cros_ec_command *msg;
349         int ret;
350
351         msg = kzalloc(sizeof(*msg) + max_t(size_t, result_size,
352                                            sizeof(*params)), GFP_KERNEL);
353         if (!msg)
354                 return -ENOMEM;
355
356         msg->command = EC_CMD_MKBP_INFO;
357         msg->version = 1;
358         msg->outsize = sizeof(*params);
359         msg->insize = result_size;
360         params = (struct ec_params_mkbp_info *)msg->data;
361         params->info_type = info_type;
362         params->event_type = event_type;
363
364         ret = cros_ec_cmd_xfer(ec_dev, msg);
365         if (ret < 0) {
366                 dev_warn(ec_dev->dev, "Transfer error %d/%d: %d\n",
367                          (int)info_type, (int)event_type, ret);
368         } else if (msg->result == EC_RES_INVALID_VERSION) {
369                 /* With older ECs we just return 0 for everything */
370                 memset(result, 0, result_size);
371                 ret = 0;
372         } else if (msg->result != EC_RES_SUCCESS) {
373                 dev_warn(ec_dev->dev, "Error getting info %d/%d: %d\n",
374                          (int)info_type, (int)event_type, msg->result);
375                 ret = -EPROTO;
376         } else if (ret != result_size) {
377                 dev_warn(ec_dev->dev, "Wrong size %d/%d: %d != %zu\n",
378                          (int)info_type, (int)event_type,
379                          ret, result_size);
380                 ret = -EPROTO;
381         } else {
382                 memcpy(result, msg->data, result_size);
383                 ret = 0;
384         }
385
386         kfree(msg);
387
388         return ret;
389 }
390
391 /**
392  * cros_ec_keyb_query_switches - Query the state of switches and report
393  *
394  * This will ask the EC about the current state of switches and report to the
395  * kernel.  Note that we don't query for buttons because they are more
396  * transitory and we'll get an update on the next release / press.
397  *
398  * @ckdev: The keyboard device
399  *
400  * Returns 0 if no error or -error upon error.
401  */
402 static int cros_ec_keyb_query_switches(struct cros_ec_keyb *ckdev)
403 {
404         struct cros_ec_device *ec_dev = ckdev->ec;
405         union ec_response_get_next_data event_data = {};
406         int ret;
407
408         ret = cros_ec_keyb_info(ec_dev, EC_MKBP_INFO_CURRENT,
409                                 EC_MKBP_EVENT_SWITCH, &event_data,
410                                 sizeof(event_data.switches));
411         if (ret)
412                 return ret;
413
414         cros_ec_keyb_report_bs(ckdev, EV_SW,
415                                get_unaligned_le32(&event_data.switches));
416
417         return 0;
418 }
419
420 /**
421  * cros_ec_keyb_resume - Resume the keyboard
422  *
423  * We use the resume notification as a chance to query the EC for switches.
424  *
425  * @dev: The keyboard device
426  *
427  * Returns 0 if no error or -error upon error.
428  */
429 static __maybe_unused int cros_ec_keyb_resume(struct device *dev)
430 {
431         struct cros_ec_keyb *ckdev = dev_get_drvdata(dev);
432
433         if (ckdev->bs_idev)
434                 return cros_ec_keyb_query_switches(ckdev);
435
436         return 0;
437 }
438
439 /**
440  * cros_ec_keyb_register_bs - Register non-matrix buttons/switches
441  *
442  * Handles all the bits of the keyboard driver related to non-matrix buttons
443  * and switches, including asking the EC about which are present and telling
444  * the kernel to expect them.
445  *
446  * If this device has no support for buttons and switches we'll return no error
447  * but the ckdev->bs_idev will remain NULL when this function exits.
448  *
449  * @ckdev: The keyboard device
450  *
451  * Returns 0 if no error or -error upon error.
452  */
453 static int cros_ec_keyb_register_bs(struct cros_ec_keyb *ckdev)
454 {
455         struct cros_ec_device *ec_dev = ckdev->ec;
456         struct device *dev = ckdev->dev;
457         struct input_dev *idev;
458         union ec_response_get_next_data event_data = {};
459         const char *phys;
460         u32 buttons;
461         u32 switches;
462         int ret;
463         int i;
464
465         ret = cros_ec_keyb_info(ec_dev, EC_MKBP_INFO_SUPPORTED,
466                                 EC_MKBP_EVENT_BUTTON, &event_data,
467                                 sizeof(event_data.buttons));
468         if (ret)
469                 return ret;
470         buttons = get_unaligned_le32(&event_data.buttons);
471
472         ret = cros_ec_keyb_info(ec_dev, EC_MKBP_INFO_SUPPORTED,
473                                 EC_MKBP_EVENT_SWITCH, &event_data,
474                                 sizeof(event_data.switches));
475         if (ret)
476                 return ret;
477         switches = get_unaligned_le32(&event_data.switches);
478
479         if (!buttons && !switches)
480                 return 0;
481
482         /*
483          * We call the non-matrix buttons/switches 'input1', if present.
484          * Allocate phys before input dev, to ensure correct tear-down
485          * ordering.
486          */
487         phys = devm_kasprintf(dev, GFP_KERNEL, "%s/input1", ec_dev->phys_name);
488         if (!phys)
489                 return -ENOMEM;
490
491         idev = devm_input_allocate_device(dev);
492         if (!idev)
493                 return -ENOMEM;
494
495         idev->name = "cros_ec_buttons";
496         idev->phys = phys;
497         __set_bit(EV_REP, idev->evbit);
498
499         idev->id.bustype = BUS_VIRTUAL;
500         idev->id.version = 1;
501         idev->id.product = 0;
502         idev->dev.parent = dev;
503
504         input_set_drvdata(idev, ckdev);
505         ckdev->bs_idev = idev;
506
507         for (i = 0; i < ARRAY_SIZE(cros_ec_keyb_bs); i++) {
508                 const struct cros_ec_bs_map *map = &cros_ec_keyb_bs[i];
509
510                 if ((map->ev_type == EV_KEY && (buttons & BIT(map->bit))) ||
511                     (map->ev_type == EV_SW && (switches & BIT(map->bit))))
512                         input_set_capability(idev, map->ev_type, map->code);
513         }
514
515         ret = cros_ec_keyb_query_switches(ckdev);
516         if (ret) {
517                 dev_err(dev, "cannot query switches\n");
518                 return ret;
519         }
520
521         ret = input_register_device(ckdev->bs_idev);
522         if (ret) {
523                 dev_err(dev, "cannot register input device\n");
524                 return ret;
525         }
526
527         return 0;
528 }
529
530 /**
531  * cros_ec_keyb_register_bs - Register matrix keys
532  *
533  * Handles all the bits of the keyboard driver related to matrix keys.
534  *
535  * @ckdev: The keyboard device
536  *
537  * Returns 0 if no error or -error upon error.
538  */
539 static int cros_ec_keyb_register_matrix(struct cros_ec_keyb *ckdev)
540 {
541         struct cros_ec_device *ec_dev = ckdev->ec;
542         struct device *dev = ckdev->dev;
543         struct input_dev *idev;
544         const char *phys;
545         int err;
546
547         err = matrix_keypad_parse_properties(dev, &ckdev->rows, &ckdev->cols);
548         if (err)
549                 return err;
550
551         ckdev->valid_keys = devm_kzalloc(dev, ckdev->cols, GFP_KERNEL);
552         if (!ckdev->valid_keys)
553                 return -ENOMEM;
554
555         ckdev->old_kb_state = devm_kzalloc(dev, ckdev->cols, GFP_KERNEL);
556         if (!ckdev->old_kb_state)
557                 return -ENOMEM;
558
559         /*
560          * We call the keyboard matrix 'input0'. Allocate phys before input
561          * dev, to ensure correct tear-down ordering.
562          */
563         phys = devm_kasprintf(dev, GFP_KERNEL, "%s/input0", ec_dev->phys_name);
564         if (!phys)
565                 return -ENOMEM;
566
567         idev = devm_input_allocate_device(dev);
568         if (!idev)
569                 return -ENOMEM;
570
571         idev->name = CROS_EC_DEV_NAME;
572         idev->phys = phys;
573         __set_bit(EV_REP, idev->evbit);
574
575         idev->id.bustype = BUS_VIRTUAL;
576         idev->id.version = 1;
577         idev->id.product = 0;
578         idev->dev.parent = dev;
579
580         ckdev->ghost_filter = of_property_read_bool(dev->of_node,
581                                         "google,needs-ghost-filter");
582
583         err = matrix_keypad_build_keymap(NULL, NULL, ckdev->rows, ckdev->cols,
584                                          NULL, idev);
585         if (err) {
586                 dev_err(dev, "cannot build key matrix\n");
587                 return err;
588         }
589
590         ckdev->row_shift = get_count_order(ckdev->cols);
591
592         input_set_capability(idev, EV_MSC, MSC_SCAN);
593         input_set_drvdata(idev, ckdev);
594         ckdev->idev = idev;
595         cros_ec_keyb_compute_valid_keys(ckdev);
596
597         err = input_register_device(ckdev->idev);
598         if (err) {
599                 dev_err(dev, "cannot register input device\n");
600                 return err;
601         }
602
603         return 0;
604 }
605
606 static int cros_ec_keyb_probe(struct platform_device *pdev)
607 {
608         struct cros_ec_device *ec = dev_get_drvdata(pdev->dev.parent);
609         struct device *dev = &pdev->dev;
610         struct cros_ec_keyb *ckdev;
611         int err;
612
613         if (!dev->of_node)
614                 return -ENODEV;
615
616         ckdev = devm_kzalloc(dev, sizeof(*ckdev), GFP_KERNEL);
617         if (!ckdev)
618                 return -ENOMEM;
619
620         ckdev->ec = ec;
621         ckdev->dev = dev;
622         dev_set_drvdata(dev, ckdev);
623
624         err = cros_ec_keyb_register_matrix(ckdev);
625         if (err) {
626                 dev_err(dev, "cannot register matrix inputs: %d\n", err);
627                 return err;
628         }
629
630         err = cros_ec_keyb_register_bs(ckdev);
631         if (err) {
632                 dev_err(dev, "cannot register non-matrix inputs: %d\n", err);
633                 return err;
634         }
635
636         ckdev->notifier.notifier_call = cros_ec_keyb_work;
637         err = blocking_notifier_chain_register(&ckdev->ec->event_notifier,
638                                                &ckdev->notifier);
639         if (err) {
640                 dev_err(dev, "cannot register notifier: %d\n", err);
641                 return err;
642         }
643
644         return 0;
645 }
646
647 static int cros_ec_keyb_remove(struct platform_device *pdev)
648 {
649         struct cros_ec_keyb *ckdev = dev_get_drvdata(&pdev->dev);
650
651         blocking_notifier_chain_unregister(&ckdev->ec->event_notifier,
652                                            &ckdev->notifier);
653
654         return 0;
655 }
656
657 #ifdef CONFIG_OF
658 static const struct of_device_id cros_ec_keyb_of_match[] = {
659         { .compatible = "google,cros-ec-keyb" },
660         {},
661 };
662 MODULE_DEVICE_TABLE(of, cros_ec_keyb_of_match);
663 #endif
664
665 static SIMPLE_DEV_PM_OPS(cros_ec_keyb_pm_ops, NULL, cros_ec_keyb_resume);
666
667 static struct platform_driver cros_ec_keyb_driver = {
668         .probe = cros_ec_keyb_probe,
669         .remove = cros_ec_keyb_remove,
670         .driver = {
671                 .name = "cros-ec-keyb",
672                 .of_match_table = of_match_ptr(cros_ec_keyb_of_match),
673                 .pm = &cros_ec_keyb_pm_ops,
674         },
675 };
676
677 module_platform_driver(cros_ec_keyb_driver);
678
679 MODULE_LICENSE("GPL");
680 MODULE_DESCRIPTION("ChromeOS EC keyboard driver");
681 MODULE_ALIAS("platform:cros-ec-keyb");