]> rtime.felk.cvut.cz Git - zynq/linux.git/commitdiff
v4l: xilinx: scd: Cleanup the xscd_dma_chan structure
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Wed, 3 Apr 2019 20:01:57 +0000 (13:01 -0700)
committerMichal Simek <michal.simek@xilinx.com>
Fri, 5 Apr 2019 11:05:33 +0000 (13:05 +0200)
Cleanup the xscd_dma_chan structure by

- Reordering fields to group them by category
- Renaming the en field to enabled
- Removing the unused chan_node field
- Turning the id field from u8 to unsigned int

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Satish Kumar Nagireddy <satish.nagireddy.nagireddy@xilinx.com>
Reviewed-by: Hyun Kwon <hyun.kwon@xilinx.com>
drivers/media/platform/xilinx/xilinx-scenechange-channel.c
drivers/media/platform/xilinx/xilinx-scenechange-dma.c
drivers/media/platform/xilinx/xilinx-scenechange.h

index 989ec6e44b43a3ac589a46fce969e8a5de93bfb1..aefc8e551b18dfbc43f5bdf270535a94b24ae7b7 100644 (file)
@@ -181,7 +181,7 @@ static int xscd_s_stream(struct v4l2_subdev *subdev, int enable)
        unsigned long flags;
 
        /* TODO: Re-organise shared data in a better way */
-       chan->dmachan.en = enable;
+       chan->dmachan.enabled = enable;
 
        spin_lock_irqsave(&chan->dmachan.lock, flags);
 
index 6f44744b8e1ef544cf1f17b0b52395240edf4f15..4fdcf7d80c13efd1cb55ac76fb3a211ba4e29a38 100644 (file)
@@ -34,7 +34,8 @@ void xscd_dma_irq_handler(struct xscd_device *xscd)
                        spin_lock(&chan->lock);
                        chan->idle = true;
 
-                       if (chan->en && (!list_empty(&chan->pending_list))) {
+                       if (chan->enabled &&
+                           (!list_empty(&chan->pending_list))) {
                                chan_en |= 1 << chan->id;
                                chan->valid_interrupt = true;
                        } else {
@@ -115,7 +116,7 @@ void xscd_dma_start_transfer(struct xscd_dma_chan *chan)
 {
        struct xscd_dma_tx_descriptor *desc;
 
-       if (!chan->en)
+       if (!chan->enabled)
                return;
 
        if (!chan->idle)
@@ -285,7 +286,7 @@ static void xscd_dma_issue_pending(struct dma_chan *dchan)
                spin_lock(&chan->lock);
                chan->idle = true;
 
-               if (chan->en && (!list_empty(&chan->pending_list))) {
+               if (chan->enabled && (!list_empty(&chan->pending_list))) {
                        chan_en |= 1 << chan->id;
                        chan->valid_interrupt = true;
                } else {
index 9bbe3814aa8ba8b59f9260d55fcef90bfc350d11..d5e11ac030f18bc1e4d2d83ccf1649cf6999e0d6 100644 (file)
@@ -100,35 +100,34 @@ to_xscd_dma_tx_descriptor(struct dma_async_tx_descriptor *tx)
  * struct xscd_dma_chan - DMA Channel structure
  * @xscd: SCD device
  * @iomem: I/O memory address of the channel registers
+ * @id: scene change channel ID
+ * @common: DMA common channel
+ * @tasklet: Cleanup work after irq
  * @lock: Descriptor operation lock
- * @chan_node: Member of a list of framebuffer channel instances
  * @pending_list: Descriptors waiting
  * @done_list: Complete descriptors
  * @staged_desc: Next buffer to be programmed
  * @active_desc: Currently active buffer being read/written to
- * @common: DMA common channel
  * @idle: Channel idle state
- * @tasklet: Cleanup work after irq
- * @id: scene change channel ID
- * @en: Channel is enabled
+ * @enabled: Channel is enabled
  * @valid_interrupt: Valid interrupt for the channel
  */
 struct xscd_dma_chan {
        struct xscd_device *xscd;
        void __iomem *iomem;
+       unsigned int id;
+
+       struct dma_chan common;
+       struct tasklet_struct tasklet;
 
        /* Descriptor operation Lock */
        spinlock_t lock;
-       struct list_head chan_node;
        struct list_head pending_list;
        struct list_head done_list;
        struct xscd_dma_tx_descriptor *staged_desc;
        struct xscd_dma_tx_descriptor *active_desc;
-       struct dma_chan common;
        bool idle;
-       struct tasklet_struct tasklet;
-       u8 id;
-       bool en;
+       unsigned int enabled;
        bool valid_interrupt;
 };