diff options
Diffstat (limited to 'wctdm.c')
-rwxr-xr-x | wctdm.c | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -843,6 +843,7 @@ static int wcfxs_ioctl(struct zt_chan *chan, unsigned int cmd, unsigned long dat { struct wcfxs_stats stats; struct wcfxs_regs regs; + struct wcfxs_regop regop; struct wcfxs *wc = chan->pvt; int x; switch (cmd) { @@ -861,6 +862,18 @@ static int wcfxs_ioctl(struct zt_chan *chan, unsigned int cmd, unsigned long dat if (copy_to_user((struct wcfxs_regs *)data, ®s, sizeof(regs))) return -EFAULT; break; + case WCFXS_SET_REG: + if (copy_from_user(®op, (struct wcfxs_regop *)data, sizeof(regop))) + return -EFAULT; + if (regop.indirect) { + printk("Setting indirect %d to 0x%04x on %d\n", regop.reg, regop.val, chan->chanpos); + wcfxs_setreg_indirect(wc, chan->chanpos - 1, regop.reg, regop.val); + } else { + regop.val &= 0xff; + printk("Setting direct %d to %04x on %d\n", regop.reg, regop.val, chan->chanpos); + wcfxs_setreg(wc, chan->chanpos - 1, regop.reg, regop.val); + } + break; default: return -ENOTTY; } |