Commit e7ba5f1d authored by Padmavathi Venna's avatar Padmavathi Venna Committed by Mark Brown

ARM: SAMSUNG: Make dma request compatible to generic dma bindings.

This patch make the dma dev request operation compatible for both
DT and non-DT cases. It takes the all the arguments required for
dma_request_slave_channel and dma_request_channel. If the driver
is initiated via DT or non-DT the corresponding call will be made.
Signed-off-by: default avatarPadmavathi Venna <padma.v@samsung.com>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent 40476f61
...@@ -19,7 +19,8 @@ ...@@ -19,7 +19,8 @@
#include <mach/dma.h> #include <mach/dma.h>
static unsigned samsung_dmadev_request(enum dma_ch dma_ch, static unsigned samsung_dmadev_request(enum dma_ch dma_ch,
struct samsung_dma_req *param) struct samsung_dma_req *param,
struct device *dev, char *ch_name)
{ {
dma_cap_mask_t mask; dma_cap_mask_t mask;
void *filter_param; void *filter_param;
...@@ -33,7 +34,12 @@ static unsigned samsung_dmadev_request(enum dma_ch dma_ch, ...@@ -33,7 +34,12 @@ static unsigned samsung_dmadev_request(enum dma_ch dma_ch,
*/ */
filter_param = (dma_ch == DMACH_DT_PROP) ? filter_param = (dma_ch == DMACH_DT_PROP) ?
(void *)param->dt_dmach_prop : (void *)dma_ch; (void *)param->dt_dmach_prop : (void *)dma_ch;
return (unsigned)dma_request_channel(mask, pl330_filter, filter_param);
if (dev->of_node)
return (unsigned)dma_request_slave_channel(dev, ch_name);
else
return (unsigned)dma_request_channel(mask, pl330_filter,
filter_param);
} }
static int samsung_dmadev_release(unsigned ch, void *param) static int samsung_dmadev_release(unsigned ch, void *param)
......
...@@ -39,7 +39,8 @@ struct samsung_dma_config { ...@@ -39,7 +39,8 @@ struct samsung_dma_config {
}; };
struct samsung_dma_ops { struct samsung_dma_ops {
unsigned (*request)(enum dma_ch ch, struct samsung_dma_req *param); unsigned (*request)(enum dma_ch ch, struct samsung_dma_req *param,
struct device *dev, char *ch_name);
int (*release)(unsigned ch, void *param); int (*release)(unsigned ch, void *param);
int (*config)(unsigned ch, struct samsung_dma_config *param); int (*config)(unsigned ch, struct samsung_dma_config *param);
int (*prepare)(unsigned ch, struct samsung_dma_prep *param); int (*prepare)(unsigned ch, struct samsung_dma_prep *param);
......
...@@ -36,7 +36,8 @@ static void s3c_dma_cb(struct s3c2410_dma_chan *channel, void *param, ...@@ -36,7 +36,8 @@ static void s3c_dma_cb(struct s3c2410_dma_chan *channel, void *param,
} }
static unsigned s3c_dma_request(enum dma_ch dma_ch, static unsigned s3c_dma_request(enum dma_ch dma_ch,
struct samsung_dma_req *param) struct samsung_dma_req *param,
struct device *dev, char *ch_name)
{ {
struct cb_data *data; struct cb_data *data;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment