Lines Matching defs:data
40 struct picolcd_data *data = ((struct seq_file *)f->private_data)->private;
50 picolcd_reset(data->hdev);
51 picolcd_fb_reset(data, 1);
53 picolcd_fb_reset(data, 1);
75 struct picolcd_data *data = f->private_data;
91 resp = picolcd_send_and_wait(data->hdev, REPORT_EE_READ, raw_data,
114 struct picolcd_data *data = f->private_data;
133 resp = picolcd_send_and_wait(data->hdev, REPORT_EE_WRITE, raw_data,
140 /* check if written data matches */
153 * to loop in order to get more data.
169 static int _picolcd_flash_setaddr(struct picolcd_data *data, u8 *buf, long off)
173 if (data->addr_sz == 3)
175 return data->addr_sz == 2 ? 2 : 3;
178 /* read a given size of data (bounds check to be done by caller) */
179 static ssize_t _picolcd_flash_read(struct picolcd_data *data, int report_id,
189 len_off = _picolcd_flash_setaddr(data, raw_data, *off);
191 resp = picolcd_send_and_wait(data->hdev, report_id, raw_data, len_off+1);
218 struct picolcd_data *data = f->private_data;
227 if (data->status & PICOLCD_BOOTLOADER)
228 return _picolcd_flash_read(data, REPORT_BL_READ_MEMORY, u, s, off);
230 return _picolcd_flash_read(data, REPORT_READ_MEMORY, u, s, off);
234 static ssize_t _picolcd_flash_erase64(struct picolcd_data *data, int report_id,
245 len_off = _picolcd_flash_setaddr(data, raw_data, *off);
246 resp = picolcd_send_and_wait(data->hdev, report_id, raw_data, len_off);
260 /* write a given size of data (bounds check to be done by caller) */
261 static ssize_t _picolcd_flash_write(struct picolcd_data *data, int report_id,
271 len_off = _picolcd_flash_setaddr(data, raw_data, *off);
277 resp = picolcd_send_and_wait(data->hdev, report_id, raw_data,
301 struct picolcd_data *data = f->private_data;
314 if (data->status & PICOLCD_BOOTLOADER) {
321 mutex_lock(&data->mutex_flash);
323 err = _picolcd_flash_erase64(data, report_erase, off);
326 err = _picolcd_flash_write(data, report_write, u, 64, off);
335 mutex_unlock(&data->mutex_flash);
365 "invalid command length", "invalid data length",
368 static void dump_buff_as_hex(char *dst, size_t dst_sz, const u8 *data,
373 dst[j++] = hex_asc[(data[i] >> 4) & 0x0f];
374 dst[j++] = hex_asc[data[i] & 0x0f];
384 void picolcd_debug_out_report(struct picolcd_data *data,
416 /* 1 data byte with GPO state */
424 /* 1 data byte with brightness */
432 /* 1 data byte with contrast */
440 /* 2 data bytes with reset duration in ms */
449 /* 63 data bytes with LCD commands */
456 /* 63 data bytes with LCD data */
463 /* 63 data bytes with LCD commands and data */
470 /* 3 data bytes with read area description */
481 /* 3+1..20 data bytes with write area description */
491 snprintf(buff, BUFF_SZ, "\tNo data\n");
503 /* 3 data bytes with pointer inside erase block */
507 switch (data->addr_sz) {
523 /* 4 data bytes with read area description */
527 switch (data->addr_sz) {
547 /* 4+1..32 data bytes with write adrea description */
551 switch (data->addr_sz) {
559 snprintf(buff, BUFF_SZ, "\tNo data\n");
575 snprintf(buff, BUFF_SZ, "\tNo data\n");
641 void picolcd_debug_raw_event(struct picolcd_data *data,
658 /* 2 data bytes with affected report and error code */
671 /* 2 data bytes with key state */
686 /* Up to 20 byes of IR scancode data */
691 snprintf(buff, BUFF_SZ, "\tUnexpectedly 0 data length\n");
700 snprintf(buff, BUFF_SZ, "\tOverflowing data length: %d\n",
716 snprintf(buff, BUFF_SZ, "\tNo data\n");
733 switch (data->addr_sz) {
741 snprintf(buff, BUFF_SZ, "\tNo data\n");
757 snprintf(buff, BUFF_SZ, "\tNo data\n");
837 void picolcd_init_devfs(struct picolcd_data *data,
842 struct hid_device *hdev = data->hdev;
844 mutex_init(&data->mutex_flash);
848 data->debug_reset = debugfs_create_file("reset", 0600,
849 hdev->debug_dir, data, &picolcd_debug_reset_fops);
853 data->debug_eeprom = debugfs_create_file("eeprom",
855 hdev->debug_dir, data, &picolcd_debug_eeprom_fops);
859 data->addr_sz = flash_r->field[0]->report_count - 1;
861 data->addr_sz = -1;
862 if (data->addr_sz == 2 || data->addr_sz == 3) {
863 data->debug_flash = debugfs_create_file("flash",
865 hdev->debug_dir, data, &picolcd_debug_flash_fops);
870 void picolcd_exit_devfs(struct picolcd_data *data)
874 dent = data->debug_reset;
875 data->debug_reset = NULL;
877 dent = data->debug_eeprom;
878 data->debug_eeprom = NULL;
880 dent = data->debug_flash;
881 data->debug_flash = NULL;
883 mutex_destroy(&data->mutex_flash);