Merge tag 'block-5.11-2021-01-10' of git://git.kernel.dk/linux-block
[linux/fpc-iii.git] / drivers / input / mouse / elan_i2c_i2c.c
blob13dc097eb6c652983399c1fbefea7475a4ea0ff2
1 // SPDX-License-Identifier: GPL-2.0-only
2 /*
3 * Elan I2C/SMBus Touchpad driver - I2C interface
5 * Copyright (c) 2013 ELAN Microelectronics Corp.
7 * Author: 林政維 (Duson Lin) <dusonlin@emc.com.tw>
9 * Based on cyapa driver:
10 * copyright (c) 2011-2012 Cypress Semiconductor, Inc.
11 * copyright (c) 2011-2012 Google, Inc.
13 * Trademarks are the property of their respective owners.
16 #include <linux/completion.h>
17 #include <linux/delay.h>
18 #include <linux/i2c.h>
19 #include <linux/interrupt.h>
20 #include <linux/jiffies.h>
21 #include <linux/kernel.h>
22 #include <linux/slab.h>
23 #include <linux/sched.h>
24 #include <asm/unaligned.h>
26 #include "elan_i2c.h"
28 /* Elan i2c commands */
29 #define ETP_I2C_RESET 0x0100
30 #define ETP_I2C_WAKE_UP 0x0800
31 #define ETP_I2C_SLEEP 0x0801
32 #define ETP_I2C_DESC_CMD 0x0001
33 #define ETP_I2C_REPORT_DESC_CMD 0x0002
34 #define ETP_I2C_STAND_CMD 0x0005
35 #define ETP_I2C_PATTERN_CMD 0x0100
36 #define ETP_I2C_UNIQUEID_CMD 0x0101
37 #define ETP_I2C_FW_VERSION_CMD 0x0102
38 #define ETP_I2C_IC_TYPE_CMD 0x0103
39 #define ETP_I2C_OSM_VERSION_CMD 0x0103
40 #define ETP_I2C_NSM_VERSION_CMD 0x0104
41 #define ETP_I2C_XY_TRACENUM_CMD 0x0105
42 #define ETP_I2C_MAX_X_AXIS_CMD 0x0106
43 #define ETP_I2C_MAX_Y_AXIS_CMD 0x0107
44 #define ETP_I2C_RESOLUTION_CMD 0x0108
45 #define ETP_I2C_PRESSURE_CMD 0x010A
46 #define ETP_I2C_IAP_VERSION_CMD 0x0110
47 #define ETP_I2C_IC_TYPE_P0_CMD 0x0110
48 #define ETP_I2C_IAP_VERSION_P0_CMD 0x0111
49 #define ETP_I2C_SET_CMD 0x0300
50 #define ETP_I2C_POWER_CMD 0x0307
51 #define ETP_I2C_FW_CHECKSUM_CMD 0x030F
52 #define ETP_I2C_IAP_CTRL_CMD 0x0310
53 #define ETP_I2C_IAP_CMD 0x0311
54 #define ETP_I2C_IAP_RESET_CMD 0x0314
55 #define ETP_I2C_IAP_CHECKSUM_CMD 0x0315
56 #define ETP_I2C_CALIBRATE_CMD 0x0316
57 #define ETP_I2C_MAX_BASELINE_CMD 0x0317
58 #define ETP_I2C_MIN_BASELINE_CMD 0x0318
59 #define ETP_I2C_IAP_TYPE_REG 0x0040
60 #define ETP_I2C_IAP_TYPE_CMD 0x0304
62 #define ETP_I2C_REPORT_LEN 34
63 #define ETP_I2C_REPORT_LEN_ID2 39
64 #define ETP_I2C_REPORT_MAX_LEN 39
65 #define ETP_I2C_DESC_LENGTH 30
66 #define ETP_I2C_REPORT_DESC_LENGTH 158
67 #define ETP_I2C_INF_LENGTH 2
68 #define ETP_I2C_IAP_PASSWORD 0x1EA5
69 #define ETP_I2C_IAP_RESET 0xF0F0
70 #define ETP_I2C_MAIN_MODE_ON (1 << 9)
71 #define ETP_I2C_IAP_REG_L 0x01
72 #define ETP_I2C_IAP_REG_H 0x06
74 static int elan_i2c_read_block(struct i2c_client *client,
75 u16 reg, u8 *val, u16 len)
77 __le16 buf[] = {
78 cpu_to_le16(reg),
80 struct i2c_msg msgs[] = {
82 .addr = client->addr,
83 .flags = client->flags & I2C_M_TEN,
84 .len = sizeof(buf),
85 .buf = (u8 *)buf,
88 .addr = client->addr,
89 .flags = (client->flags & I2C_M_TEN) | I2C_M_RD,
90 .len = len,
91 .buf = val,
94 int ret;
96 ret = i2c_transfer(client->adapter, msgs, ARRAY_SIZE(msgs));
97 return ret == ARRAY_SIZE(msgs) ? 0 : (ret < 0 ? ret : -EIO);
100 static int elan_i2c_read_cmd(struct i2c_client *client, u16 reg, u8 *val)
102 int retval;
104 retval = elan_i2c_read_block(client, reg, val, ETP_I2C_INF_LENGTH);
105 if (retval < 0) {
106 dev_err(&client->dev, "reading cmd (0x%04x) fail.\n", reg);
107 return retval;
110 return 0;
113 static int elan_i2c_write_cmd(struct i2c_client *client, u16 reg, u16 cmd)
115 __le16 buf[] = {
116 cpu_to_le16(reg),
117 cpu_to_le16(cmd),
119 struct i2c_msg msg = {
120 .addr = client->addr,
121 .flags = client->flags & I2C_M_TEN,
122 .len = sizeof(buf),
123 .buf = (u8 *)buf,
125 int ret;
127 ret = i2c_transfer(client->adapter, &msg, 1);
128 if (ret != 1) {
129 if (ret >= 0)
130 ret = -EIO;
131 dev_err(&client->dev, "writing cmd (0x%04x) failed: %d\n",
132 reg, ret);
133 return ret;
136 return 0;
139 static int elan_i2c_initialize(struct i2c_client *client)
141 struct device *dev = &client->dev;
142 int error;
143 u8 val[256];
145 error = elan_i2c_write_cmd(client, ETP_I2C_STAND_CMD, ETP_I2C_RESET);
146 if (error) {
147 dev_err(dev, "device reset failed: %d\n", error);
148 return error;
151 /* Wait for the device to reset */
152 msleep(100);
154 /* get reset acknowledgement 0000 */
155 error = i2c_master_recv(client, val, ETP_I2C_INF_LENGTH);
156 if (error < 0) {
157 dev_err(dev, "failed to read reset response: %d\n", error);
158 return error;
161 error = elan_i2c_read_block(client, ETP_I2C_DESC_CMD,
162 val, ETP_I2C_DESC_LENGTH);
163 if (error) {
164 dev_err(dev, "cannot get device descriptor: %d\n", error);
165 return error;
168 error = elan_i2c_read_block(client, ETP_I2C_REPORT_DESC_CMD,
169 val, ETP_I2C_REPORT_DESC_LENGTH);
170 if (error) {
171 dev_err(dev, "fetching report descriptor failed.: %d\n", error);
172 return error;
175 return 0;
178 static int elan_i2c_sleep_control(struct i2c_client *client, bool sleep)
180 return elan_i2c_write_cmd(client, ETP_I2C_STAND_CMD,
181 sleep ? ETP_I2C_SLEEP : ETP_I2C_WAKE_UP);
184 static int elan_i2c_power_control(struct i2c_client *client, bool enable)
186 u8 val[2];
187 u16 reg;
188 int error;
190 error = elan_i2c_read_cmd(client, ETP_I2C_POWER_CMD, val);
191 if (error) {
192 dev_err(&client->dev,
193 "failed to read current power state: %d\n",
194 error);
195 return error;
198 reg = le16_to_cpup((__le16 *)val);
199 if (enable)
200 reg &= ~ETP_DISABLE_POWER;
201 else
202 reg |= ETP_DISABLE_POWER;
204 error = elan_i2c_write_cmd(client, ETP_I2C_POWER_CMD, reg);
205 if (error) {
206 dev_err(&client->dev,
207 "failed to write current power state: %d\n",
208 error);
209 return error;
212 return 0;
215 static int elan_i2c_set_mode(struct i2c_client *client, u8 mode)
217 return elan_i2c_write_cmd(client, ETP_I2C_SET_CMD, mode);
221 static int elan_i2c_calibrate(struct i2c_client *client)
223 return elan_i2c_write_cmd(client, ETP_I2C_CALIBRATE_CMD, 1);
226 static int elan_i2c_calibrate_result(struct i2c_client *client, u8 *val)
228 return elan_i2c_read_block(client, ETP_I2C_CALIBRATE_CMD, val, 1);
231 static int elan_i2c_get_baseline_data(struct i2c_client *client,
232 bool max_baseline, u8 *value)
234 int error;
235 u8 val[3];
237 error = elan_i2c_read_cmd(client,
238 max_baseline ? ETP_I2C_MAX_BASELINE_CMD :
239 ETP_I2C_MIN_BASELINE_CMD,
240 val);
241 if (error)
242 return error;
244 *value = le16_to_cpup((__le16 *)val);
246 return 0;
249 static int elan_i2c_get_pattern(struct i2c_client *client, u8 *pattern)
251 int error;
252 u8 val[3];
254 error = elan_i2c_read_cmd(client, ETP_I2C_PATTERN_CMD, val);
255 if (error) {
256 dev_err(&client->dev, "failed to get pattern: %d\n", error);
257 return error;
261 * Not all versions of firmware implement "get pattern" command.
262 * When this command is not implemented the device will respond
263 * with 0xFF 0xFF, which we will treat as "old" pattern 0.
265 *pattern = val[0] == 0xFF && val[1] == 0xFF ? 0 : val[1];
267 return 0;
270 static int elan_i2c_get_version(struct i2c_client *client,
271 u8 pattern, bool iap, u8 *version)
273 int error;
274 u16 cmd;
275 u8 val[3];
277 if (!iap)
278 cmd = ETP_I2C_FW_VERSION_CMD;
279 else if (pattern == 0)
280 cmd = ETP_I2C_IAP_VERSION_P0_CMD;
281 else
282 cmd = ETP_I2C_IAP_VERSION_CMD;
284 error = elan_i2c_read_cmd(client, cmd, val);
285 if (error) {
286 dev_err(&client->dev, "failed to get %s version: %d\n",
287 iap ? "IAP" : "FW", error);
288 return error;
291 if (pattern >= 0x01)
292 *version = iap ? val[1] : val[0];
293 else
294 *version = val[0];
295 return 0;
298 static int elan_i2c_get_sm_version(struct i2c_client *client, u8 pattern,
299 u16 *ic_type, u8 *version, u8 *clickpad)
301 int error;
302 u8 val[3];
304 if (pattern >= 0x01) {
305 error = elan_i2c_read_cmd(client, ETP_I2C_IC_TYPE_CMD, val);
306 if (error) {
307 dev_err(&client->dev, "failed to get ic type: %d\n",
308 error);
309 return error;
311 *ic_type = be16_to_cpup((__be16 *)val);
313 error = elan_i2c_read_cmd(client, ETP_I2C_NSM_VERSION_CMD,
314 val);
315 if (error) {
316 dev_err(&client->dev, "failed to get SM version: %d\n",
317 error);
318 return error;
320 *version = val[1];
321 *clickpad = val[0] & 0x10;
322 } else {
323 error = elan_i2c_read_cmd(client, ETP_I2C_OSM_VERSION_CMD, val);
324 if (error) {
325 dev_err(&client->dev, "failed to get SM version: %d\n",
326 error);
327 return error;
329 *version = val[0];
331 error = elan_i2c_read_cmd(client, ETP_I2C_IC_TYPE_P0_CMD, val);
332 if (error) {
333 dev_err(&client->dev, "failed to get ic type: %d\n",
334 error);
335 return error;
337 *ic_type = val[0];
339 error = elan_i2c_read_cmd(client, ETP_I2C_NSM_VERSION_CMD,
340 val);
341 if (error) {
342 dev_err(&client->dev, "failed to get SM version: %d\n",
343 error);
344 return error;
346 *clickpad = val[0] & 0x10;
349 return 0;
352 static int elan_i2c_get_product_id(struct i2c_client *client, u16 *id)
354 int error;
355 u8 val[3];
357 error = elan_i2c_read_cmd(client, ETP_I2C_UNIQUEID_CMD, val);
358 if (error) {
359 dev_err(&client->dev, "failed to get product ID: %d\n", error);
360 return error;
363 *id = le16_to_cpup((__le16 *)val);
364 return 0;
367 static int elan_i2c_get_checksum(struct i2c_client *client,
368 bool iap, u16 *csum)
370 int error;
371 u8 val[3];
373 error = elan_i2c_read_cmd(client,
374 iap ? ETP_I2C_IAP_CHECKSUM_CMD :
375 ETP_I2C_FW_CHECKSUM_CMD,
376 val);
377 if (error) {
378 dev_err(&client->dev, "failed to get %s checksum: %d\n",
379 iap ? "IAP" : "FW", error);
380 return error;
383 *csum = le16_to_cpup((__le16 *)val);
384 return 0;
387 static int elan_i2c_get_max(struct i2c_client *client,
388 unsigned int *max_x, unsigned int *max_y)
390 int error;
391 u8 val[3];
393 error = elan_i2c_read_cmd(client, ETP_I2C_MAX_X_AXIS_CMD, val);
394 if (error) {
395 dev_err(&client->dev, "failed to get X dimension: %d\n", error);
396 return error;
399 *max_x = le16_to_cpup((__le16 *)val);
401 error = elan_i2c_read_cmd(client, ETP_I2C_MAX_Y_AXIS_CMD, val);
402 if (error) {
403 dev_err(&client->dev, "failed to get Y dimension: %d\n", error);
404 return error;
407 *max_y = le16_to_cpup((__le16 *)val);
409 return 0;
412 static int elan_i2c_get_resolution(struct i2c_client *client,
413 u8 *hw_res_x, u8 *hw_res_y)
415 int error;
416 u8 val[3];
418 error = elan_i2c_read_cmd(client, ETP_I2C_RESOLUTION_CMD, val);
419 if (error) {
420 dev_err(&client->dev, "failed to get resolution: %d\n", error);
421 return error;
424 *hw_res_x = val[0];
425 *hw_res_y = val[1];
427 return 0;
430 static int elan_i2c_get_num_traces(struct i2c_client *client,
431 unsigned int *x_traces,
432 unsigned int *y_traces)
434 int error;
435 u8 val[3];
437 error = elan_i2c_read_cmd(client, ETP_I2C_XY_TRACENUM_CMD, val);
438 if (error) {
439 dev_err(&client->dev, "failed to get trace info: %d\n", error);
440 return error;
443 *x_traces = val[0];
444 *y_traces = val[1];
446 return 0;
449 static int elan_i2c_get_pressure_adjustment(struct i2c_client *client,
450 int *adjustment)
452 int error;
453 u8 val[3];
455 error = elan_i2c_read_cmd(client, ETP_I2C_PRESSURE_CMD, val);
456 if (error) {
457 dev_err(&client->dev, "failed to get pressure format: %d\n",
458 error);
459 return error;
462 if ((val[0] >> 4) & 0x1)
463 *adjustment = 0;
464 else
465 *adjustment = ETP_PRESSURE_OFFSET;
467 return 0;
470 static int elan_i2c_iap_get_mode(struct i2c_client *client, enum tp_mode *mode)
472 int error;
473 u16 constant;
474 u8 val[3];
476 error = elan_i2c_read_cmd(client, ETP_I2C_IAP_CTRL_CMD, val);
477 if (error) {
478 dev_err(&client->dev,
479 "failed to read iap control register: %d\n",
480 error);
481 return error;
484 constant = le16_to_cpup((__le16 *)val);
485 dev_dbg(&client->dev, "iap control reg: 0x%04x.\n", constant);
487 *mode = (constant & ETP_I2C_MAIN_MODE_ON) ? MAIN_MODE : IAP_MODE;
489 return 0;
492 static int elan_i2c_iap_reset(struct i2c_client *client)
494 int error;
496 error = elan_i2c_write_cmd(client, ETP_I2C_IAP_RESET_CMD,
497 ETP_I2C_IAP_RESET);
498 if (error) {
499 dev_err(&client->dev, "cannot reset IC: %d\n", error);
500 return error;
503 return 0;
506 static int elan_i2c_set_flash_key(struct i2c_client *client)
508 int error;
510 error = elan_i2c_write_cmd(client, ETP_I2C_IAP_CMD,
511 ETP_I2C_IAP_PASSWORD);
512 if (error) {
513 dev_err(&client->dev, "cannot set flash key: %d\n", error);
514 return error;
517 return 0;
520 static int elan_read_write_iap_type(struct i2c_client *client, u16 fw_page_size)
522 int error;
523 u16 constant;
524 u8 val[3];
525 int retry = 3;
527 do {
528 error = elan_i2c_write_cmd(client, ETP_I2C_IAP_TYPE_CMD,
529 fw_page_size / 2);
530 if (error) {
531 dev_err(&client->dev,
532 "cannot write iap type: %d\n", error);
533 return error;
536 error = elan_i2c_read_cmd(client, ETP_I2C_IAP_TYPE_CMD, val);
537 if (error) {
538 dev_err(&client->dev,
539 "failed to read iap type register: %d\n",
540 error);
541 return error;
543 constant = le16_to_cpup((__le16 *)val);
544 dev_dbg(&client->dev, "iap type reg: 0x%04x\n", constant);
546 if (constant == fw_page_size / 2)
547 return 0;
549 } while (--retry > 0);
551 dev_err(&client->dev, "cannot set iap type\n");
552 return -EIO;
555 static int elan_i2c_prepare_fw_update(struct i2c_client *client, u16 ic_type,
556 u8 iap_version, u16 fw_page_size)
558 struct device *dev = &client->dev;
559 int error;
560 enum tp_mode mode;
561 u8 val[3];
562 u16 password;
564 /* Get FW in which mode (IAP_MODE/MAIN_MODE) */
565 error = elan_i2c_iap_get_mode(client, &mode);
566 if (error)
567 return error;
569 if (mode == IAP_MODE) {
570 /* Reset IC */
571 error = elan_i2c_iap_reset(client);
572 if (error)
573 return error;
575 msleep(30);
578 /* Set flash key*/
579 error = elan_i2c_set_flash_key(client);
580 if (error)
581 return error;
583 /* Wait for F/W IAP initialization */
584 msleep(mode == MAIN_MODE ? 100 : 30);
586 /* Check if we are in IAP mode or not */
587 error = elan_i2c_iap_get_mode(client, &mode);
588 if (error)
589 return error;
591 if (mode == MAIN_MODE) {
592 dev_err(dev, "wrong mode: %d\n", mode);
593 return -EIO;
596 if (ic_type >= 0x0D && iap_version >= 1) {
597 error = elan_read_write_iap_type(client, fw_page_size);
598 if (error)
599 return error;
602 /* Set flash key again */
603 error = elan_i2c_set_flash_key(client);
604 if (error)
605 return error;
607 /* Wait for F/W IAP initialization */
608 msleep(30);
610 /* read back to check we actually enabled successfully. */
611 error = elan_i2c_read_cmd(client, ETP_I2C_IAP_CMD, val);
612 if (error) {
613 dev_err(dev, "cannot read iap password: %d\n",
614 error);
615 return error;
618 password = le16_to_cpup((__le16 *)val);
619 if (password != ETP_I2C_IAP_PASSWORD) {
620 dev_err(dev, "wrong iap password: 0x%X\n", password);
621 return -EIO;
624 return 0;
627 static int elan_i2c_write_fw_block(struct i2c_client *client, u16 fw_page_size,
628 const u8 *page, u16 checksum, int idx)
630 struct device *dev = &client->dev;
631 u8 *page_store;
632 u8 val[3];
633 u16 result;
634 int ret, error;
636 page_store = kmalloc(fw_page_size + 4, GFP_KERNEL);
637 if (!page_store)
638 return -ENOMEM;
640 page_store[0] = ETP_I2C_IAP_REG_L;
641 page_store[1] = ETP_I2C_IAP_REG_H;
642 memcpy(&page_store[2], page, fw_page_size);
643 /* recode checksum at last two bytes */
644 put_unaligned_le16(checksum, &page_store[fw_page_size + 2]);
646 ret = i2c_master_send(client, page_store, fw_page_size + 4);
647 if (ret != fw_page_size + 4) {
648 error = ret < 0 ? ret : -EIO;
649 dev_err(dev, "Failed to write page %d: %d\n", idx, error);
650 goto exit;
653 /* Wait for F/W to update one page ROM data. */
654 msleep(fw_page_size == ETP_FW_PAGE_SIZE_512 ? 50 : 35);
656 error = elan_i2c_read_cmd(client, ETP_I2C_IAP_CTRL_CMD, val);
657 if (error) {
658 dev_err(dev, "Failed to read IAP write result: %d\n", error);
659 goto exit;
662 result = le16_to_cpup((__le16 *)val);
663 if (result & (ETP_FW_IAP_PAGE_ERR | ETP_FW_IAP_INTF_ERR)) {
664 dev_err(dev, "IAP reports failed write: %04hx\n",
665 result);
666 error = -EIO;
667 goto exit;
670 exit:
671 kfree(page_store);
672 return error;
675 static int elan_i2c_finish_fw_update(struct i2c_client *client,
676 struct completion *completion)
678 struct device *dev = &client->dev;
679 int error = 0;
680 int len;
681 u8 buffer[ETP_I2C_REPORT_MAX_LEN];
683 len = i2c_master_recv(client, buffer, ETP_I2C_REPORT_MAX_LEN);
684 if (len <= 0) {
685 error = len < 0 ? len : -EIO;
686 dev_warn(dev, "failed to read I2C data after FW WDT reset: %d (%d)\n",
687 error, len);
690 reinit_completion(completion);
691 enable_irq(client->irq);
693 error = elan_i2c_write_cmd(client, ETP_I2C_STAND_CMD, ETP_I2C_RESET);
694 if (error) {
695 dev_err(dev, "device reset failed: %d\n", error);
696 } else if (!wait_for_completion_timeout(completion,
697 msecs_to_jiffies(300))) {
698 dev_err(dev, "timeout waiting for device reset\n");
699 error = -ETIMEDOUT;
702 disable_irq(client->irq);
704 if (error)
705 return error;
707 len = i2c_master_recv(client, buffer, ETP_I2C_INF_LENGTH);
708 if (len != ETP_I2C_INF_LENGTH) {
709 error = len < 0 ? len : -EIO;
710 dev_err(dev, "failed to read INT signal: %d (%d)\n",
711 error, len);
712 return error;
715 return 0;
718 static int elan_i2c_get_report_features(struct i2c_client *client, u8 pattern,
719 unsigned int *features,
720 unsigned int *report_len)
722 *features = ETP_FEATURE_REPORT_MK;
723 *report_len = pattern <= 0x01 ?
724 ETP_I2C_REPORT_LEN : ETP_I2C_REPORT_LEN_ID2;
725 return 0;
728 static int elan_i2c_get_report(struct i2c_client *client,
729 u8 *report, unsigned int report_len)
731 int len;
733 len = i2c_master_recv(client, report, report_len);
734 if (len < 0) {
735 dev_err(&client->dev, "failed to read report data: %d\n", len);
736 return len;
739 if (len != report_len) {
740 dev_err(&client->dev,
741 "wrong report length (%d vs %d expected)\n",
742 len, report_len);
743 return -EIO;
746 return 0;
749 const struct elan_transport_ops elan_i2c_ops = {
750 .initialize = elan_i2c_initialize,
751 .sleep_control = elan_i2c_sleep_control,
752 .power_control = elan_i2c_power_control,
753 .set_mode = elan_i2c_set_mode,
755 .calibrate = elan_i2c_calibrate,
756 .calibrate_result = elan_i2c_calibrate_result,
758 .get_baseline_data = elan_i2c_get_baseline_data,
760 .get_version = elan_i2c_get_version,
761 .get_sm_version = elan_i2c_get_sm_version,
762 .get_product_id = elan_i2c_get_product_id,
763 .get_checksum = elan_i2c_get_checksum,
764 .get_pressure_adjustment = elan_i2c_get_pressure_adjustment,
766 .get_max = elan_i2c_get_max,
767 .get_resolution = elan_i2c_get_resolution,
768 .get_num_traces = elan_i2c_get_num_traces,
770 .iap_get_mode = elan_i2c_iap_get_mode,
771 .iap_reset = elan_i2c_iap_reset,
773 .prepare_fw_update = elan_i2c_prepare_fw_update,
774 .write_fw_block = elan_i2c_write_fw_block,
775 .finish_fw_update = elan_i2c_finish_fw_update,
777 .get_pattern = elan_i2c_get_pattern,
779 .get_report_features = elan_i2c_get_report_features,
780 .get_report = elan_i2c_get_report,