net: xilinx_emacps: Use devm_ functions

Simplified the probe and release functions using devm_ functions.

Signed-off-by: Punnaiah Choudary Kalluri <punnaia@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
axidma: xilinx: Use pdev instead of op

Synchronize names with other drivers

Signed-off-by: Srikanth Thokala <sthokal@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
axidma: xilinx: Use devm_* calls

Updated driver to use devm_* calls

Signed-off-by: Srikanth Thokala <sthokal@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
axidma: xilinx: Proper freeing up of channel resources when driver exits/fails

This patch frees channel resources, whenever the driver probing fails or
exits normally, in a clean way.

Signed-off-by: Srikanth Thokala <sthokal@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
axidma: xilinx: Replace custom my_log() function with fls()

Replace custom my_log() function with fls()

Signed-off-by: Srikanth Thokala <sthokal@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
axidma: xilinx: Reorder headers alphabetically

Reorder headers alphabetically

Signed-off-by: Srikanth Thokala <sthokal@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
axidma: xilinx: No need to check for compatibility

There is no need to check for compatibility of axi-dma, as
the driver supports axi dma devices only.

Signed-off-by: Srikanth Thokala <sthokal@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
axidma: xilinx: renamed io read/write macros

Renamed IO macros:
DMA_OUT() -> dma_write()
DMA_IN()  -> dma_read()

Signed-off-by: Srikanth Thokala <sthokal@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
axidma: xilinx: Using of_property_*() to read dt properties

This patch replaces of_get_property() calls with of_property_read_
u32/bool() calls.

Signed-off-by: Srikanth Thokala <sthokal@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
axidma: xilinx: Check for include-sg property and enable SG feature

In some cases, DMA can be configured in SG mode with status and control
streams not connected. For example, Vivado loopback hardware design
has these streams unconnected and configured for SG Mode. This commit
fixes this issue by checking 'xlnx,include-sg' dt property and enable
the SG feature (making independent of 'xlnx,sg-include-stscntrl-strm').

Signed-off-by: Srikanth Thokala <sthokal@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
axidma: xilinx: Removed _of_ prefix in probe and remove functions

Synchronize names with other drivers.

Signed-off-by: Srikanth Thokala <sthokal@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
axidma: xilinx: Fix issue with axidmatest client running as module

Loopback test needs some of the APP words of DMA configured
and this logic is under flag TEST_DMA_WITH_LOOPBACK. So this
flag has to be enabled when running axidmatest client. This
patch fixes issue with axidmatest client running as module.

Signed-off-by: Srikanth Thokala <sthokal@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
axidma: xilinx: Already zeroed by kzalloc

No need to initialize this variable, it is kzalloc'ed

Signed-off-by: Srikanth Thokala <sthokal@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
axidma: xilinx: Remove unused constants

This patch removes unused constants

Signed-off-by: Srikanth Thokala <sthokal@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
axidma: xilinx: remove unused desc_dump function

This patch removes ununsed desc_dump() function

Signed-off-by: Srikanth Thokala <sthokal@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
axidma: xilinx: Don't increment the DMA engine channel count

Channel count will be incremented internally by dma_async_device_
register().

Signed-off-by: Srikanth Thokala <sthokal@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
axidma: xilinx: Remove unused struct xilinx_dma_device irq field

This field is unused, so removing it.

Signed-off-by: Srikanth Thokala <sthokal@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
axidma: xilinx: rename dma_init() to dma_reset()

This patch renames the dma_init() to dma_reset() API.

Signed-off-by: Srikanth Thokala <sthokal@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
axidma: xilinx: Return with proper error value in dma_reset()

This patch returns a proper error value in dma_reset()

Signed-off-by: Srikanth Thokala <sthokal@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
axidma: xilinx: Make boolean DT properties real bools

has_sg and has_dre fields of channel structure are changed
to boolean type

Signed-off-by: Srikanth Thokala <sthokal@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>