12 #include <linux/kernel.h>
14 #include <linux/stat.h>
15 #include <linux/device.h>
18 #include <linux/string.h>
32 for (i = 0; i < 16; i++) {
39 len +=
sprintf(buf + len,
"%2d: %14s %s\n",
40 channel->chan, info->
name,
49 static int __init dma_subsys_init(
void)
65 return sprintf(buf,
"%s\n", channel->dev_id);
70 const char *buf,
size_t count)
73 strcpy(channel->dev_id, buf);
81 const char *buf,
size_t count)
98 return sprintf(buf,
"0x%08x\n", channel->mode);
103 const char *buf,
size_t count)
112 #define dma_ro_attr(field, fmt) \
113 static ssize_t dma_show_##field(struct device *dev, \
114 struct device_attribute *attr, char *buf)\
116 struct dma_channel *channel = to_dma_channel(dev); \
117 return sprintf(buf, fmt, channel->field); \
119 static DEVICE_ATTR(field, S_IRUGO, dma_show_##field, NULL);
126 struct device *dev = &chan->dev;
130 dev->
id = chan->vchan;
131 dev->
bus = &dma_subsys;
144 dev_err(&info->pdev->dev,
"Failed creating attrs\n");
148 snprintf(name,
sizeof(name),
"dma%d", chan->chan);
154 struct device *dev = &chan->dev;
163 snprintf(name,
sizeof(name),
"dma%d", chan->chan);