struct v4l2_subdev_pad_config *cfg,
struct v4l2_subdev_format *fmt)
{
- struct xscd_chan *chan = to_chan(subdev);
+ struct xscd_chan *chan = to_xscd_chan(subdev);
fmt->format = *__xscd_get_pad_format(chan, cfg, fmt->pad, fmt->which);
return 0;
struct v4l2_subdev_pad_config *cfg,
struct v4l2_subdev_format *fmt)
{
- struct xscd_chan *chan = to_chan(subdev);
+ struct xscd_chan *chan = to_xscd_chan(subdev);
struct v4l2_mbus_framefmt *format;
format = __xscd_get_pad_format(chan, cfg, fmt->pad, fmt->which);
*/
static int xscd_s_stream(struct v4l2_subdev *subdev, int enable)
{
- struct xscd_chan *chan = to_chan(subdev);
+ struct xscd_chan *chan = to_xscd_chan(subdev);
struct xscd_shared_data *shared_data;
unsigned long flags;
u32 chan_offset;
struct v4l2_event_subscription *sub)
{
int ret;
- struct xscd_chan *chan = to_chan(sd);
+ struct xscd_chan *chan = to_xscd_chan(sd);
mutex_lock(&chan->lock);
struct v4l2_event_subscription *sub)
{
int ret;
- struct xscd_chan *chan = to_chan(sd);
+ struct xscd_chan *chan = to_xscd_chan(sd);
mutex_lock(&chan->lock);
ret = v4l2_event_unsubscribe(fh, sub);
#include "xilinx-scenechange.h"
-/**
- * struct xscd_dma_device - Scene Change DMA device
- * @regs: I/O mapped base address
- * @dev: Device Structure
- * @common: DMA device structure
- * @chan: Driver specific DMA channel
- * @numchannels: Total number of channels
- * @memory_based: Memory based or streaming based
- */
-struct xscd_dma_device {
- void __iomem *regs;
- struct device *dev;
- struct dma_device common;
- struct xscd_dma_chan **chan;
- u32 numchannels;
- bool memory_based;
-};
-
/**
* xscd_dma_irq_handler - scdma Interrupt handler
* @irq: IRQ number
*/
dma_cookie_t xscd_dma_tx_submit(struct dma_async_tx_descriptor *tx)
{
- struct xscd_dma_tx_descriptor *desc = to_dma_tx_descriptor(tx);
- struct xscd_dma_chan *chan = to_xilinx_chan(tx->chan);
+ struct xscd_dma_tx_descriptor *desc = to_xscd_dma_tx_descriptor(tx);
+ struct xscd_dma_chan *chan = to_xscd_dma_chan(tx->chan);
dma_cookie_t cookie;
unsigned long flags;
struct dma_interleaved_template *xt,
unsigned long flags)
{
- struct xscd_dma_chan *chan = to_xilinx_chan(dchan);
+ struct xscd_dma_chan *chan = to_xscd_dma_chan(dchan);
struct xscd_dma_tx_descriptor *desc;
struct xscd_dma_desc *sw;
*/
static int xscd_dma_terminate_all(struct dma_chan *dchan)
{
- struct xscd_dma_chan *chan = to_xilinx_chan(dchan);
+ struct xscd_dma_chan *chan = to_xscd_dma_chan(dchan);
xscd_dma_halt(chan);
xscd_dma_free_descriptors(chan);
*/
static void xscd_dma_issue_pending(struct dma_chan *dchan)
{
- struct xscd_dma_chan *chan = to_xilinx_chan(dchan);
+ struct xscd_dma_chan *chan = to_xscd_dma_chan(dchan);
struct xscd_dma_device *dev = chan->xdev;
u32 chan_en = 0, id;
*/
static void xscd_dma_free_chan_resources(struct dma_chan *dchan)
{
- struct xscd_dma_chan *chan = to_xilinx_chan(dchan);
+ struct xscd_dma_chan *chan = to_xscd_dma_chan(dchan);
xscd_dma_free_descriptors(chan);
}
#define XSCD_MAX_CHANNELS 8
/****************************** PROTOTYPES ************************************/
-#define to_xilinx_chan(chan) \
- container_of(chan, struct xscd_dma_chan, common)
-#define to_dma_tx_descriptor(tx) \
- container_of(tx, struct xscd_dma_tx_descriptor, async_tx)
/**
* struct xscd_shared_data - Data to be shared among v4l subdev and DMA engine
struct list_head node;
};
+static inline struct xscd_dma_tx_descriptor *
+to_xscd_dma_tx_descriptor(struct dma_async_tx_descriptor *tx)
+{
+ return container_of(tx, struct xscd_dma_tx_descriptor, async_tx);
+}
+
/**
* struct xscd_dma_chan - DMA Channel structure
* @xdev: DMA engine driver specific device structure
bool valid_interrupt;
};
+static inline struct xscd_dma_chan *to_xscd_dma_chan(struct dma_chan *chan)
+{
+ return container_of(chan, struct xscd_dma_chan, common);
+}
+
/**
* struct xscd_chan - Video Stream structure
* @irq: device IRQ
struct mutex lock;
};
-static inline struct xscd_chan *to_chan(struct v4l2_subdev *subdev)
+static inline struct xscd_chan *to_xscd_chan(struct v4l2_subdev *subdev)
{
return container_of(subdev, struct xscd_chan, subdev);
}
+/**
+ * struct xscd_dma_device - Scene Change DMA device
+ * @regs: I/O mapped base address
+ * @dev: Device Structure
+ * @common: DMA device structure
+ * @chan: Driver specific DMA channel
+ * @numchannels: Total number of channels
+ * @memory_based: Memory based or streaming based
+ */
+struct xscd_dma_device {
+ void __iomem *regs;
+ struct device *dev;
+ struct dma_device common;
+ struct xscd_dma_chan **chan;
+ u32 numchannels;
+ u8 memory_based;
+};
+
/*
* Register related operations
*/