aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc/mei/init.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/misc/mei/init.c')
-rw-r--r--drivers/misc/mei/init.c24
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}
331EXPORT_SYMBOL_GPL(mei_write_is_idle); 331EXPORT_SYMBOL_GPL(mei_write_is_idle);
332 332
333void mei_device_init(struct mei_device *dev) 333int 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}
352EXPORT_SYMBOL_GPL(mei_fw_status);
353
354void 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}
372EXPORT_SYMBOL_GPL(mei_device_init); 394EXPORT_SYMBOL_GPL(mei_device_init);
373 395