fpga: mgr: API change to replace fpga load functions with single function
authorAlan Tull <atull@kernel.org>
Wed, 15 Nov 2017 20:20:12 +0000 (14:20 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 28 Nov 2017 15:30:37 +0000 (16:30 +0100)
commit5cf0c7f6502f26332b46fa87914553a4d6ae75ac
tree56814a3ec0bf179797e7d9fed89136954f937d3e
parent9c1c4b2753fea36a072e78a5efc82fca0d13b455
fpga: mgr: API change to replace fpga load functions with single function

fpga-mgr has three methods for programming FPGAs, depending on
whether the image is in a scatter gather list, a contiguous
buffer, or a firmware file. This makes it difficult to write
upper layers as the caller has to assume whether the FPGA image
is in a sg table, as a single buffer, or a firmware file.
This commit moves these parameters to struct fpga_image_info
and adds a single function for programming fpgas.

New functions:
* fpga_mgr_load - given fpga manager and struct fpga_image_info,
   program the fpga.

* fpga_image_info_alloc - alloc a struct fpga_image_info.

* fpga_image_info_free - free a struct fpga_image_info.

These three functions are unexported:
* fpga_mgr_buf_load_sg
* fpga_mgr_buf_load
* fpga_mgr_firmware_load

Also use devm_kstrdup to copy firmware_name so we aren't making
assumptions about where it comes from when allocing/freeing the
struct fpga_image_info.

API documentation has been updated and a new document for
FPGA region has been added.

Signed-off-by: Alan Tull <atull@kernel.org>
Acked-by: Moritz Fischer <mdf@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Documentation/fpga/fpga-mgr.txt
Documentation/fpga/fpga-region.txt [new file with mode: 0644]
Documentation/fpga/overview.txt [new file with mode: 0644]
drivers/fpga/fpga-mgr.c
drivers/fpga/fpga-region.c
include/linux/fpga/fpga-mgr.h