dma: xilinx: vdma: Remove unused variables

Remove sg_waiting, max_len, and is_lite variables in struct xilinx_vdma_chan
which are not used anywhere.

Signed-off-by: Hyun Kwon <hyunk@xilinx.com>
dma: xilinx: vdma: Add free_irq()

Add free_irq().

Signed-off-by: Hyun Kwon <hyunk@xilinx.com>
dma: xilinx: vdma: Register DMA controller to DT

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
dma: xilinx: vdma: Don't reconfigure channel after reset

VDMA users usually don't supply channel configuration parameter when
requesting a reset. The driver would then reconfigure the channel with
random parameters. Avoid this by returning immediately after resetting
the channel. Users will reconfigure it afterwards anyway.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
dma: xilinx: vdma: Remove disable_intr support

The client must not control whether interrupts should be enabled. Remove
that.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
dma: xilinx: vdma: Replace I/O accessor macros with static inlines

Beside improving type-safety, this will help debugging by allowing easy
logging on register read and write.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
dma: xilinx: vdma: Use register offsets

Clean up all the register-related macros and replace the register data
structures with register offsets.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
dma: xilinx: vdma: Use devm_* managers allocators

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Srikanth Thokala <srikanth.thokala@xilinx.com>
dma: xilinx: vdma: Used managed I/O mapping function

Replace the of_iomap() call with a combination of
platform_get_resource() and devm_request_and_ioremap().

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Srikanth Thokala <srikanth.thokala@xilinx.com>
dma: xilinx: vdma: Remove unused struct xilinx_vdma_device irq field

The field is unused, remove it.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Srikanth Thokala <srikanth.thokala@xilinx.com>
dma: xilinx: vdma: Reorder headers alphabetically

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Srikanth Thokala <srikanth.thokala@xilinx.com>
dma: xilinx: vdma: Replace custom my_log() function with fls()

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Srikanth Thokala <srikanth.thokala@xilinx.com>
dma: xilinx: vdma: Make boolean DT properties real bools

Turn the xlnx,include-sg, xlnx,genlock-mode and xlnx,include-dre DT
properties into bool properties and use of_property_read_bool() to parse
them.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Srikanth Thokala <srikanth.thokala@xilinx.com>
dma: xilinx: vdma: Use of_property_read_u32() to read u32 DT properties

Replace the of_get_property() calls with of_property_read_u32() DT
properties that store a single unsigned integer.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
dma: xilinx: vdma: Device is always compatible with xlnx,axi-vdma

The xilinx-axivdma driver only supports VDMA devices. There is no need
to test for compatibility.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Srikanth Thokala <srikanth.thokala@xilinx.com>
dma: xilinx: vdma: Deconstruct feature fields

Store features in dedicated fields or process them directly instead of
storing them in a bitfield only to read them back right afterwards.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Srikanth Thokala <srikanth.thokala@xilinx.com>
dma: xilinx: vdma: Remove unnecessary braces

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
dma: xilinx: vdma: Turn channel flush_fsync field into a bool

The field stores a boolean, make it bool.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Srikanth Thokala <srikanth.thokala@xilinx.com>
dma: xilinx: vdma: Turn the channel has_dre field into a local variable

The field value is assigned and used locally only, replace it with a
local variable.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Srikanth Thokala <srikanth.thokala@xilinx.com>
dma: xilinx: vdma: Don't increment the DMA engine channel count

The counter is updated by dma_async_device_register(), don't increment
it manually.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Srikanth Thokala <srikanth.thokala@xilinx.com>