diff options
Diffstat (limited to 'drivers/misc/mei/init.c')
-rw-r--r-- | drivers/misc/mei/init.c | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/drivers/misc/mei/init.c b/drivers/misc/mei/init.c index 510f378b1f06..006929222481 100644 --- a/drivers/misc/mei/init.c +++ b/drivers/misc/mei/init.c | |||
@@ -330,7 +330,28 @@ bool mei_write_is_idle(struct mei_device *dev) | |||
330 | } | 330 | } |
331 | EXPORT_SYMBOL_GPL(mei_write_is_idle); | 331 | EXPORT_SYMBOL_GPL(mei_write_is_idle); |
332 | 332 | ||
333 | void mei_device_init(struct mei_device *dev) | 333 | int mei_fw_status(struct mei_device *dev, struct mei_fw_status *fw_status) |
334 | { | ||
335 | int i; | ||
336 | const struct mei_fw_status *fw_src = &dev->cfg->fw_status; | ||
337 | |||
338 | if (!fw_status) | ||
339 | return -EINVAL; | ||
340 | |||
341 | fw_status->count = fw_src->count; | ||
342 | for (i = 0; i < fw_src->count && i < MEI_FW_STATUS_MAX; i++) { | ||
343 | int ret; | ||
344 | ret = pci_read_config_dword(dev->pdev, | ||
345 | fw_src->status[i], &fw_status->status[i]); | ||
346 | if (ret) | ||
347 | return ret; | ||
348 | } | ||
349 | |||
350 | return 0; | ||
351 | } | ||
352 | EXPORT_SYMBOL_GPL(mei_fw_status); | ||
353 | |||
354 | void mei_device_init(struct mei_device *dev, const struct mei_cfg *cfg) | ||
334 | { | 355 | { |
335 | /* setup our list array */ | 356 | /* setup our list array */ |
336 | INIT_LIST_HEAD(&dev->file_list); | 357 | INIT_LIST_HEAD(&dev->file_list); |
@@ -368,6 +389,7 @@ void mei_device_init(struct mei_device *dev) | |||
368 | bitmap_set(dev->host_clients_map, 0, 1); | 389 | bitmap_set(dev->host_clients_map, 0, 1); |
369 | 390 | ||
370 | dev->pg_event = MEI_PG_EVENT_IDLE; | 391 | dev->pg_event = MEI_PG_EVENT_IDLE; |
392 | dev->cfg = cfg; | ||
371 | } | 393 | } |
372 | EXPORT_SYMBOL_GPL(mei_device_init); | 394 | EXPORT_SYMBOL_GPL(mei_device_init); |
373 | 395 | ||