Searched refs:gsmi_dev (Results 1 - 1 of 1) sorted by relevance

/linux-4.4.14/drivers/firmware/google/
H A Dgsmi.c96 } gsmi_dev; variable in typeref:struct:gsmi_device
147 smibuf->start = dma_pool_alloc(gsmi_dev.dma_pool, GFP_KERNEL, gsmi_buf_alloc()
166 dma_pool_free(gsmi_dev.dma_pool, smibuf->start, gsmi_buf_free()
190 if (gsmi_dev.handshake_type == GSMI_HANDSHAKE_CF) { gsmi_exec()
204 "d" (gsmi_dev.smi_cmd), gsmi_exec()
205 "b" (gsmi_dev.param_buf->address) gsmi_exec()
208 } else if (gsmi_dev.handshake_type == GSMI_HANDSHAKE_SPIN) { gsmi_exec()
218 "d" (gsmi_dev.smi_cmd), gsmi_exec()
219 "b" (gsmi_dev.param_buf->address), gsmi_exec()
233 "d" (gsmi_dev.smi_cmd), gsmi_exec()
234 "b" (gsmi_dev.param_buf->address) gsmi_exec()
298 .name_ptr = gsmi_dev.name_buf->address, gsmi_get_variable()
299 .data_ptr = gsmi_dev.data_buf->address, gsmi_get_variable()
310 spin_lock_irqsave(&gsmi_dev.lock, flags); gsmi_get_variable()
316 memset(gsmi_dev.name_buf->start, 0, gsmi_dev.name_buf->length); gsmi_get_variable()
317 memcpy(gsmi_dev.name_buf->start, name, name_len * 2); gsmi_get_variable()
320 memset(gsmi_dev.data_buf->start, 0, gsmi_dev.data_buf->length); gsmi_get_variable()
323 memset(gsmi_dev.param_buf->start, 0, gsmi_dev.param_buf->length); gsmi_get_variable()
324 memcpy(gsmi_dev.param_buf->start, &param, sizeof(param)); gsmi_get_variable()
335 memcpy(&param, gsmi_dev.param_buf->start, sizeof(param)); gsmi_get_variable()
339 gsmi_dev.data_buf->length); gsmi_get_variable()
343 memcpy(data, gsmi_dev.data_buf->start, *data_size); gsmi_get_variable()
351 spin_unlock_irqrestore(&gsmi_dev.lock, flags); gsmi_get_variable()
361 .name_ptr = gsmi_dev.name_buf->address, gsmi_get_next_variable()
362 .name_len = gsmi_dev.name_buf->length, gsmi_get_next_variable()
376 spin_lock_irqsave(&gsmi_dev.lock, flags); gsmi_get_next_variable()
382 memcpy(gsmi_dev.name_buf->start, name, *name_size); gsmi_get_next_variable()
385 memset(gsmi_dev.param_buf->start, 0, gsmi_dev.param_buf->length); gsmi_get_next_variable()
386 memcpy(gsmi_dev.param_buf->start, &param, sizeof(param)); gsmi_get_next_variable()
397 memcpy(&param, gsmi_dev.param_buf->start, sizeof(param)); gsmi_get_next_variable()
400 memcpy(name, gsmi_dev.name_buf->start, GSMI_BUF_SIZE); gsmi_get_next_variable()
408 spin_unlock_irqrestore(&gsmi_dev.lock, flags); gsmi_get_next_variable()
420 .name_ptr = gsmi_dev.name_buf->address, gsmi_set_variable()
421 .data_ptr = gsmi_dev.data_buf->address, gsmi_set_variable()
435 spin_lock_irqsave(&gsmi_dev.lock, flags); gsmi_set_variable()
441 memset(gsmi_dev.name_buf->start, 0, gsmi_dev.name_buf->length); gsmi_set_variable()
442 memcpy(gsmi_dev.name_buf->start, name, name_len * 2); gsmi_set_variable()
445 memset(gsmi_dev.data_buf->start, 0, gsmi_dev.data_buf->length); gsmi_set_variable()
446 memcpy(gsmi_dev.data_buf->start, data, data_size); gsmi_set_variable()
449 memset(gsmi_dev.param_buf->start, 0, gsmi_dev.param_buf->length); gsmi_set_variable()
450 memcpy(gsmi_dev.param_buf->start, &param, sizeof(param)); gsmi_set_variable()
458 spin_unlock_irqrestore(&gsmi_dev.lock, flags); gsmi_set_variable()
474 .data_ptr = gsmi_dev.data_buf->address, eventlog_write()
487 if (count > gsmi_dev.data_buf->length) eventlog_write()
491 spin_lock_irqsave(&gsmi_dev.lock, flags); eventlog_write()
494 memset(gsmi_dev.data_buf->start, 0, gsmi_dev.data_buf->length); eventlog_write()
495 memcpy(gsmi_dev.data_buf->start, buf, param.data_len); eventlog_write()
498 memset(gsmi_dev.param_buf->start, 0, gsmi_dev.param_buf->length); eventlog_write()
499 memcpy(gsmi_dev.param_buf->start, &param, sizeof(param)); eventlog_write()
505 spin_unlock_irqrestore(&gsmi_dev.lock, flags); eventlog_write()
543 spin_lock_irqsave(&gsmi_dev.lock, flags); gsmi_clear_eventlog_store()
546 memset(gsmi_dev.param_buf->start, 0, gsmi_dev.param_buf->length); gsmi_clear_eventlog_store()
547 memcpy(gsmi_dev.param_buf->start, &param, sizeof(param)); gsmi_clear_eventlog_store()
551 spin_unlock_irqrestore(&gsmi_dev.lock, flags); gsmi_clear_eventlog_store()
570 spin_lock_irqsave(&gsmi_dev.lock, flags); gsmi_clear_config_store()
573 memset(gsmi_dev.param_buf->start, 0, gsmi_dev.param_buf->length); gsmi_clear_config_store()
577 spin_unlock_irqrestore(&gsmi_dev.lock, flags); gsmi_clear_config_store()
613 spin_lock_irqsave(&gsmi_dev.lock, flags); gsmi_shutdown_reason()
618 memset(gsmi_dev.data_buf->start, 0, gsmi_dev.data_buf->length); gsmi_shutdown_reason()
619 memcpy(gsmi_dev.data_buf->start, &entry, sizeof(entry)); gsmi_shutdown_reason()
622 param.data_ptr = gsmi_dev.data_buf->address; gsmi_shutdown_reason()
623 memset(gsmi_dev.param_buf->start, 0, gsmi_dev.param_buf->length); gsmi_shutdown_reason()
624 memcpy(gsmi_dev.param_buf->start, &param, sizeof(param)); gsmi_shutdown_reason()
628 spin_unlock_irqrestore(&gsmi_dev.lock, flags); gsmi_shutdown_reason()
783 gsmi_dev.smi_cmd = acpi_gbl_FADT.smi_command; gsmi_init()
786 gsmi_dev.pdev = platform_device_register_full(&gsmi_dev_info); gsmi_init()
787 if (IS_ERR(gsmi_dev.pdev)) { gsmi_init()
789 return PTR_ERR(gsmi_dev.pdev); gsmi_init()
793 spin_lock_init(&gsmi_dev.lock); gsmi_init()
796 gsmi_dev.dma_pool = dma_pool_create("gsmi", &gsmi_dev.pdev->dev, gsmi_init()
798 if (!gsmi_dev.dma_pool) gsmi_init()
805 gsmi_dev.name_buf = gsmi_buf_alloc(); gsmi_init()
806 if (!gsmi_dev.name_buf) { gsmi_init()
811 gsmi_dev.data_buf = gsmi_buf_alloc(); gsmi_init()
812 if (!gsmi_dev.data_buf) { gsmi_init()
817 gsmi_dev.param_buf = gsmi_buf_alloc(); gsmi_init()
818 if (!gsmi_dev.param_buf) { gsmi_init()
851 spin_lock_irqsave(&gsmi_dev.lock, flags); gsmi_init()
852 gsmi_dev.handshake_type = GSMI_HANDSHAKE_SPIN; gsmi_init()
853 gsmi_dev.handshake_type = gsmi_init()
855 if (gsmi_dev.handshake_type == -ENOSYS) gsmi_init()
856 gsmi_dev.handshake_type = GSMI_HANDSHAKE_NONE; gsmi_init()
857 spin_unlock_irqrestore(&gsmi_dev.lock, flags); gsmi_init()
860 if (gsmi_dev.handshake_type == -ENXIO) { gsmi_init()
910 gsmi_buf_free(gsmi_dev.param_buf); gsmi_init()
911 gsmi_buf_free(gsmi_dev.data_buf); gsmi_init()
912 gsmi_buf_free(gsmi_dev.name_buf); gsmi_init()
913 if (gsmi_dev.dma_pool) gsmi_init()
914 dma_pool_destroy(gsmi_dev.dma_pool); gsmi_init()
915 platform_device_unregister(gsmi_dev.pdev); gsmi_init()
931 gsmi_buf_free(gsmi_dev.param_buf); gsmi_exit()
932 gsmi_buf_free(gsmi_dev.data_buf); gsmi_exit()
933 gsmi_buf_free(gsmi_dev.name_buf); gsmi_exit()
934 dma_pool_destroy(gsmi_dev.dma_pool); gsmi_exit()
935 platform_device_unregister(gsmi_dev.pdev); gsmi_exit()

Completed in 251 milliseconds