Commit b451392c authored by Alessandro Rubini's avatar Alessandro Rubini

kernel: a few trivial things, no change in fact

Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
parent f820b71c
...@@ -112,7 +112,7 @@ void acam_writel(struct fd_dev *fd, int val, int reg) ...@@ -112,7 +112,7 @@ void acam_writel(struct fd_dev *fd, int val, int reg)
static void acam_set_bypass(struct fd_dev *fd, int on) static void acam_set_bypass(struct fd_dev *fd, int on)
{ {
/* FIXME: this zeroes all other GCR bits */ /* warning: this clears the "input enable" bit: call at init only */
fd_writel(fd, on ? FD_GCR_BYPASS : 0, FD_REG_GCR); fd_writel(fd, on ? FD_GCR_BYPASS : 0, FD_REG_GCR);
} }
......
...@@ -21,10 +21,9 @@ ...@@ -21,10 +21,9 @@
#include "hw/acam_gpx.h" #include "hw/acam_gpx.h"
#include "hw/fd_channel_regs.h" #include "hw/fd_channel_regs.h"
/* TEMP! */ /* This is the same as in ./acam.c: use only at init time */
static void acam_set_bypass(struct fd_dev *fd, int on) static void acam_set_bypass(struct fd_dev *fd, int on)
{ {
/* FIXME: this zeroes all other GCR bits */
fd_writel(fd, on ? FD_GCR_BYPASS : 0, FD_REG_GCR); fd_writel(fd, on ? FD_GCR_BYPASS : 0, FD_REG_GCR);
} }
......
...@@ -158,6 +158,9 @@ static int fd_zio_info_output(struct device *dev, struct zio_attribute *zattr, ...@@ -158,6 +158,9 @@ static int fd_zio_info_output(struct device *dev, struct zio_attribute *zattr,
static int fd_wr_mode(struct fd_dev *fd, int on) static int fd_wr_mode(struct fd_dev *fd, int on)
{ {
unsigned long flags;
spin_lock_irqsave(&fd->lock, flags);
if (on) { if (on) {
fd_writel(fd, FD_TCR_WR_ENABLE, FD_REG_TCR); fd_writel(fd, FD_TCR_WR_ENABLE, FD_REG_TCR);
set_bit(FD_FLAG_WR_MODE, &fd->flags); set_bit(FD_FLAG_WR_MODE, &fd->flags);
...@@ -165,6 +168,7 @@ static int fd_wr_mode(struct fd_dev *fd, int on) ...@@ -165,6 +168,7 @@ static int fd_wr_mode(struct fd_dev *fd, int on)
fd_writel(fd, 0, FD_REG_TCR); fd_writel(fd, 0, FD_REG_TCR);
clear_bit(FD_FLAG_WR_MODE, &fd->flags); clear_bit(FD_FLAG_WR_MODE, &fd->flags);
} }
spin_unlock_irqrestore(&fd->lock, flags);
return 0; return 0;
} }
...@@ -448,7 +452,7 @@ static int fd_read_fifo(struct fd_dev *fd, struct zio_channel *chan) ...@@ -448,7 +452,7 @@ static int fd_read_fifo(struct fd_dev *fd, struct zio_channel *chan)
if (!chan->active_block) if (!chan->active_block)
return -EAGAIN; return -EAGAIN;
/* Advance to the next fifo entry */ /* Fecth the fifo entry to registers, so we can read them */
fd_writel(fd, FD_TSBR_ADVANCE_ADV, FD_REG_TSBR_ADVANCE); fd_writel(fd, FD_TSBR_ADVANCE_ADV, FD_REG_TSBR_ADVANCE);
/* First, read input data into a local struct to fix the offset */ /* First, read input data into a local struct to fix the offset */
......
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