Commit 0df35d87 authored by Alessandro Rubini's avatar Alessandro Rubini

massive but trivial: rename spec_fd to fd_dev

Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
parent 8e38e8d4
...@@ -83,7 +83,7 @@ static int acam_calc_pll(uint64_t tref, int bin, int *hsdiv_out, ...@@ -83,7 +83,7 @@ static int acam_calc_pll(uint64_t tref, int bin, int *hsdiv_out,
return (bin + 1) / 3; /* We are in I-Mode, R-Mode bin is 1/3 if this */ return (bin + 1) / 3; /* We are in I-Mode, R-Mode bin is 1/3 if this */
} }
static void acam_set_address(struct spec_fd *fd, int addr) static void acam_set_address(struct fd_dev *fd, int addr)
{ {
if (addr == fd->acam_addr) if (addr == fd->acam_addr)
return; return;
...@@ -96,33 +96,33 @@ static void acam_set_address(struct spec_fd *fd, int addr) ...@@ -96,33 +96,33 @@ static void acam_set_address(struct spec_fd *fd, int addr)
} }
/* Warning: acam_readl and acam_writel only work if GCR.BYPASS is set */ /* Warning: acam_readl and acam_writel only work if GCR.BYPASS is set */
uint32_t acam_readl(struct spec_fd *fd, int reg) uint32_t acam_readl(struct fd_dev *fd, int reg)
{ {
acam_set_address(fd, reg); acam_set_address(fd, reg);
fd_writel(fd, FD_TDCSR_READ, FD_REG_TDCSR); fd_writel(fd, FD_TDCSR_READ, FD_REG_TDCSR);
return fd_readl(fd, FD_REG_TDR) & ACAM_MASK; return fd_readl(fd, FD_REG_TDR) & ACAM_MASK;
} }
void acam_writel(struct spec_fd *fd, int val, int reg) void acam_writel(struct fd_dev *fd, int val, int reg)
{ {
acam_set_address(fd, reg); acam_set_address(fd, reg);
fd_writel(fd, val, FD_REG_TDR); fd_writel(fd, val, FD_REG_TDR);
fd_writel(fd, FD_TDCSR_WRITE, FD_REG_TDCSR); fd_writel(fd, FD_TDCSR_WRITE, FD_REG_TDCSR);
} }
static void acam_set_bypass(struct spec_fd *fd, int on) static void acam_set_bypass(struct fd_dev *fd, int on)
{ {
/* FIXME: this zeroes all other GCR bits */ /* 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);
} }
static inline int acam_is_pll_locked(struct spec_fd *fd) static inline int acam_is_pll_locked(struct fd_dev *fd)
{ {
return !(acam_readl(fd, 12) &AR12_NotLocked); return !(acam_readl(fd, 12) &AR12_NotLocked);
} }
/* Two test functions to verify the bus is working -- Tom */ /* Two test functions to verify the bus is working -- Tom */
static int acam_test_addr_bit(struct spec_fd *fd, int base, int bit, static int acam_test_addr_bit(struct fd_dev *fd, int base, int bit,
int data) int data)
{ {
int addr1 = base; int addr1 = base;
...@@ -156,7 +156,7 @@ out: ...@@ -156,7 +156,7 @@ out:
return -EIO; return -EIO;
} }
static int acam_test_bus(struct spec_fd *fd) static int acam_test_bus(struct fd_dev *fd)
{ {
int err = 0, i, v; int err = 0, i, v;
...@@ -248,7 +248,7 @@ static struct acam_mode_setup fd_acam_table[] = { ...@@ -248,7 +248,7 @@ static struct acam_mode_setup fd_acam_table[] = {
}; };
/* To configure the thing, follow the table, but treat 5 and 7 as special */ /* To configure the thing, follow the table, but treat 5 and 7 as special */
static int __acam_config(struct spec_fd *fd, struct acam_mode_setup *s) static int __acam_config(struct fd_dev *fd, struct acam_mode_setup *s)
{ {
int i, hsdiv, refdiv, reg7val; int i, hsdiv, refdiv, reg7val;
struct acam_init_data *p; struct acam_init_data *p;
...@@ -289,7 +289,7 @@ static int __acam_config(struct spec_fd *fd, struct acam_mode_setup *s) ...@@ -289,7 +289,7 @@ static int __acam_config(struct spec_fd *fd, struct acam_mode_setup *s)
return 0; return 0;
} }
int fd_acam_config(struct spec_fd *fd, enum fd_acam_modes mode) int fd_acam_config(struct fd_dev *fd, enum fd_acam_modes mode)
{ {
struct acam_mode_setup *s; struct acam_mode_setup *s;
int i; int i;
...@@ -301,7 +301,7 @@ int fd_acam_config(struct spec_fd *fd, enum fd_acam_modes mode) ...@@ -301,7 +301,7 @@ int fd_acam_config(struct spec_fd *fd, enum fd_acam_modes mode)
return -EINVAL; return -EINVAL;
} }
int fd_acam_init(struct spec_fd *fd) int fd_acam_init(struct fd_dev *fd)
{ {
int ret; int ret;
fd->acam_addr = -1; /* First time must be activated */ fd->acam_addr = -1; /* First time must be activated */
...@@ -343,7 +343,7 @@ int fd_acam_init(struct spec_fd *fd) ...@@ -343,7 +343,7 @@ int fd_acam_init(struct spec_fd *fd)
return 0; return 0;
} }
void fd_acam_exit(struct spec_fd *fd) void fd_acam_exit(struct fd_dev *fd)
{ {
del_timer_sync(&fd->temp_timer); del_timer_sync(&fd->temp_timer);
} }
...@@ -22,21 +22,21 @@ ...@@ -22,21 +22,21 @@
#include "hw/fd_channel_regs.h" #include "hw/fd_channel_regs.h"
/* TEMP! */ /* TEMP! */
static void acam_set_bypass(struct spec_fd *fd, int on) static void acam_set_bypass(struct fd_dev *fd, int on)
{ {
/* FIXME: this zeroes all other GCR bits */ /* 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);
} }
static int acam_test_delay_transfer_function(struct spec_fd *fd) static int acam_test_delay_transfer_function(struct fd_dev *fd)
{ {
/* FIXME */ /* FIXME */
return 0; return 0;
} }
/* Evaluates 2nd order polynomial. Coefs have 32 fractional bits. */ /* Evaluates 2nd order polynomial. Coefs have 32 fractional bits. */
static int fd_eval_polynomial(struct spec_fd *fd) static int fd_eval_polynomial(struct fd_dev *fd)
{ {
int64_t x = fd->temp; int64_t x = fd->temp;
int64_t *coef = fd->calib.frr_poly; int64_t *coef = fd->calib.frr_poly;
...@@ -58,7 +58,7 @@ struct delay_stats { ...@@ -58,7 +58,7 @@ struct delay_stats {
}; };
/* Note: channel is the "internal" one: 0..3 */ /* Note: channel is the "internal" one: 0..3 */
static uint64_t output_delay_ps(struct spec_fd *fd, int ch, int fine, int n, static uint64_t output_delay_ps(struct fd_dev *fd, int ch, int fine, int n,
struct delay_stats *stats) struct delay_stats *stats)
{ {
int i; int i;
...@@ -145,7 +145,7 @@ static void __pr_fixed(char *head, uint64_t val, char *tail) ...@@ -145,7 +145,7 @@ static void __pr_fixed(char *head, uint64_t val, char *tail)
((int)(val & 0xffff) * 1000) >> 16, tail); ((int)(val & 0xffff) * 1000) >> 16, tail);
} }
static int fd_find_8ns_tap(struct spec_fd *fd, int ch) static int fd_find_8ns_tap(struct fd_dev *fd, int ch)
{ {
int l = 0, mid, r = FD_NUM_TAPS - 1; int l = 0, mid, r = FD_NUM_TAPS - 1;
uint64_t bias, dly; uint64_t bias, dly;
...@@ -177,7 +177,7 @@ static int fd_find_8ns_tap(struct spec_fd *fd, int ch) ...@@ -177,7 +177,7 @@ static int fd_find_8ns_tap(struct spec_fd *fd, int ch)
} }
int fd_calibrate_outputs(struct spec_fd *fd) int fd_calibrate_outputs(struct fd_dev *fd)
{ {
int ret, ch; int ret, ch;
int measured, fitted, new; int measured, fitted, new;
...@@ -211,7 +211,7 @@ int fd_calibrate_outputs(struct spec_fd *fd) ...@@ -211,7 +211,7 @@ int fd_calibrate_outputs(struct spec_fd *fd)
/* Called from a timer any few seconds */ /* Called from a timer any few seconds */
void fd_update_calibration(unsigned long arg) void fd_update_calibration(unsigned long arg)
{ {
struct spec_fd *fd = (void *)arg; struct fd_dev *fd = (void *)arg;
int ch, fitted, new; int ch, fitted, new;
fd_read_temp(fd, 0 /* not verbose */); fd_read_temp(fd, 0 /* not verbose */);
......
...@@ -58,7 +58,7 @@ static struct fd_calib fd_default_calib = { ...@@ -58,7 +58,7 @@ static struct fd_calib fd_default_calib = {
}; };
/* The reset function (by Tomasz) */ /* The reset function (by Tomasz) */
static void fd_do_reset(struct spec_fd *fd, int hw_reset) static void fd_do_reset(struct fd_dev *fd, int hw_reset)
{ {
if (hw_reset) { if (hw_reset) {
fd_writel(fd, FD_RSTR_LOCK_W(0xdead) | FD_RSTR_RST_CORE_MASK, fd_writel(fd, FD_RSTR_LOCK_W(0xdead) | FD_RSTR_RST_CORE_MASK,
...@@ -80,7 +80,7 @@ static void fd_do_reset(struct spec_fd *fd, int hw_reset) ...@@ -80,7 +80,7 @@ static void fd_do_reset(struct spec_fd *fd, int hw_reset)
} }
/* Some init procedures to be intermixed with subsystems */ /* Some init procedures to be intermixed with subsystems */
int fd_gpio_defaults(struct spec_fd *fd) int fd_gpio_defaults(struct fd_dev *fd)
{ {
fd_gpio_dir(fd, FD_GPIO_TRIG_INTERNAL, FD_GPIO_OUT); fd_gpio_dir(fd, FD_GPIO_TRIG_INTERNAL, FD_GPIO_OUT);
fd_gpio_set(fd, FD_GPIO_TRIG_INTERNAL); fd_gpio_set(fd, FD_GPIO_TRIG_INTERNAL);
...@@ -93,7 +93,7 @@ int fd_gpio_defaults(struct spec_fd *fd) ...@@ -93,7 +93,7 @@ int fd_gpio_defaults(struct spec_fd *fd)
return 0; return 0;
} }
int fd_reset_again(struct spec_fd *fd) int fd_reset_again(struct fd_dev *fd)
{ {
unsigned long j; unsigned long j;
...@@ -118,8 +118,8 @@ int fd_reset_again(struct spec_fd *fd) ...@@ -118,8 +118,8 @@ int fd_reset_again(struct spec_fd *fd)
/* This structure lists the various subsystems */ /* This structure lists the various subsystems */
struct fd_modlist { struct fd_modlist {
char *name; char *name;
int (*init)(struct spec_fd *); int (*init)(struct fd_dev *);
void (*exit)(struct spec_fd *); void (*exit)(struct fd_dev *);
}; };
...@@ -141,7 +141,7 @@ static struct fd_modlist mods[] = { ...@@ -141,7 +141,7 @@ static struct fd_modlist mods[] = {
int fd_probe(struct fmc_device *fmc) int fd_probe(struct fmc_device *fmc)
{ {
struct fd_modlist *m; struct fd_modlist *m;
struct spec_fd *fd; struct fd_dev *fd;
struct spec_dev *spec; struct spec_dev *spec;
struct device *dev = fmc->hwdev; struct device *dev = fmc->hwdev;
char *fwname; char *fwname;
...@@ -261,7 +261,7 @@ out: ...@@ -261,7 +261,7 @@ out:
int fd_remove(struct fmc_device *fmc) int fd_remove(struct fmc_device *fmc)
{ {
struct fd_modlist *m; struct fd_modlist *m;
struct spec_fd *fd = fmc->mezzanine_data; struct fd_dev *fd = fmc->mezzanine_data;
int i = ARRAY_SIZE(mods); int i = ARRAY_SIZE(mods);
if (!test_bit(FD_FLAG_INITED, &fd->flags)) /* FIXME: ditch this */ if (!test_bit(FD_FLAG_INITED, &fd->flags)) /* FIXME: ditch this */
......
...@@ -105,7 +105,7 @@ static int fd_zio_info_tdc(struct device *dev, struct zio_attribute *zattr, ...@@ -105,7 +105,7 @@ static int fd_zio_info_tdc(struct device *dev, struct zio_attribute *zattr,
uint32_t *usr_val) uint32_t *usr_val)
{ {
struct zio_cset *cset; struct zio_cset *cset;
struct spec_fd *fd; struct fd_dev *fd;
cset = to_zio_cset(dev); cset = to_zio_cset(dev);
fd = cset->zdev->private_data; fd = cset->zdev->private_data;
...@@ -130,7 +130,7 @@ static int fd_zio_info_output(struct device *dev, struct zio_attribute *zattr, ...@@ -130,7 +130,7 @@ static int fd_zio_info_output(struct device *dev, struct zio_attribute *zattr,
uint32_t *usr_val) uint32_t *usr_val)
{ {
struct zio_cset *cset; struct zio_cset *cset;
struct spec_fd *fd; struct fd_dev *fd;
int ch; int ch;
cset = to_zio_cset(dev); cset = to_zio_cset(dev);
...@@ -154,7 +154,7 @@ static int fd_zio_info_output(struct device *dev, struct zio_attribute *zattr, ...@@ -154,7 +154,7 @@ static int fd_zio_info_output(struct device *dev, struct zio_attribute *zattr,
return 0; return 0;
} }
static int fd_wr_mode(struct spec_fd *fd, int on) static int fd_wr_mode(struct fd_dev *fd, int on)
{ {
if (on) { if (on) {
fd_writel(fd, FD_TCR_WR_ENABLE, FD_REG_TCR); fd_writel(fd, FD_TCR_WR_ENABLE, FD_REG_TCR);
...@@ -166,7 +166,7 @@ static int fd_wr_mode(struct spec_fd *fd, int on) ...@@ -166,7 +166,7 @@ static int fd_wr_mode(struct spec_fd *fd, int on)
return 0; return 0;
} }
static int fd_wr_query(struct spec_fd *fd) static int fd_wr_query(struct fd_dev *fd)
{ {
int ena = test_bit(FD_FLAG_WR_MODE, &fd->flags); int ena = test_bit(FD_FLAG_WR_MODE, &fd->flags);
...@@ -184,7 +184,7 @@ static int fd_zio_info_get(struct device *dev, struct zio_attribute *zattr, ...@@ -184,7 +184,7 @@ static int fd_zio_info_get(struct device *dev, struct zio_attribute *zattr,
{ {
struct fd_time t; struct fd_time t;
struct zio_device *zdev; struct zio_device *zdev;
struct spec_fd *fd; struct fd_dev *fd;
struct zio_attribute *attr; struct zio_attribute *attr;
if (__fd_get_type(dev) == FD_TYPE_INPUT) if (__fd_get_type(dev) == FD_TYPE_INPUT)
...@@ -218,7 +218,7 @@ static int fd_zio_conf_tdc(struct device *dev, struct zio_attribute *zattr, ...@@ -218,7 +218,7 @@ static int fd_zio_conf_tdc(struct device *dev, struct zio_attribute *zattr,
uint32_t usr_val) uint32_t usr_val)
{ {
struct zio_cset *cset; struct zio_cset *cset;
struct spec_fd *fd; struct fd_dev *fd;
uint32_t reg; uint32_t reg;
int change; int change;
...@@ -281,7 +281,7 @@ static int fd_zio_conf_output(struct device *dev, struct zio_attribute *zattr, ...@@ -281,7 +281,7 @@ static int fd_zio_conf_output(struct device *dev, struct zio_attribute *zattr,
uint32_t usr_val) uint32_t usr_val)
{ {
struct zio_cset *cset; struct zio_cset *cset;
struct spec_fd *fd; struct fd_dev *fd;
int ch; int ch;
cset = to_zio_cset(dev); cset = to_zio_cset(dev);
...@@ -305,7 +305,7 @@ static int fd_zio_conf_set(struct device *dev, struct zio_attribute *zattr, ...@@ -305,7 +305,7 @@ static int fd_zio_conf_set(struct device *dev, struct zio_attribute *zattr,
{ {
struct fd_time t; struct fd_time t;
struct zio_device *zdev; struct zio_device *zdev;
struct spec_fd *fd; struct fd_dev *fd;
struct zio_attribute *attr; struct zio_attribute *attr;
if (__fd_get_type(dev) == FD_TYPE_INPUT) if (__fd_get_type(dev) == FD_TYPE_INPUT)
...@@ -435,7 +435,7 @@ static inline void __fd_apply_offset(uint32_t *a, int32_t off_pico) ...@@ -435,7 +435,7 @@ static inline void __fd_apply_offset(uint32_t *a, int32_t off_pico)
} }
} }
static int fd_read_fifo(struct spec_fd *fd, struct zio_channel *chan) static int fd_read_fifo(struct fd_dev *fd, struct zio_channel *chan)
{ {
struct zio_control *ctrl; struct zio_control *ctrl;
uint32_t *v, reg; uint32_t *v, reg;
...@@ -504,7 +504,7 @@ static int fd_timer_period_jiffies; /* converted from ms at init time */ ...@@ -504,7 +504,7 @@ static int fd_timer_period_jiffies; /* converted from ms at init time */
static void fd_timer_fn(unsigned long arg) static void fd_timer_fn(unsigned long arg)
{ {
struct spec_fd *fd = (void *)arg; struct fd_dev *fd = (void *)arg;
struct zio_channel *chan = NULL; struct zio_channel *chan = NULL;
struct zio_device *zdev = fd->zdev; struct zio_device *zdev = fd->zdev;
int i; int i;
...@@ -539,7 +539,7 @@ out: ...@@ -539,7 +539,7 @@ out:
} }
/* Internal output engine */ /* Internal output engine */
static void __fd_zio_output(struct spec_fd *fd, int index1_4, uint32_t *attrs) static void __fd_zio_output(struct fd_dev *fd, int index1_4, uint32_t *attrs)
{ {
int ch = index1_4 - 1; int ch = index1_4 - 1;
int mode = attrs[FD_ATTR_OUT_MODE]; int mode = attrs[FD_ATTR_OUT_MODE];
...@@ -609,7 +609,7 @@ static void __fd_zio_output(struct spec_fd *fd, int index1_4, uint32_t *attrs) ...@@ -609,7 +609,7 @@ static void __fd_zio_output(struct spec_fd *fd, int index1_4, uint32_t *attrs)
static int fd_zio_output(struct zio_cset *cset) static int fd_zio_output(struct zio_cset *cset)
{ {
int i; int i;
struct spec_fd *fd; struct fd_dev *fd;
struct zio_control *ctrl; struct zio_control *ctrl;
fd = cset->zdev->private_data; fd = cset->zdev->private_data;
...@@ -638,7 +638,7 @@ static int fd_zio_output(struct zio_cset *cset) ...@@ -638,7 +638,7 @@ static int fd_zio_output(struct zio_cset *cset)
*/ */
static int fd_zio_input(struct zio_cset *cset) static int fd_zio_input(struct zio_cset *cset)
{ {
struct spec_fd *fd; struct fd_dev *fd;
fd = cset->zdev->private_data; fd = cset->zdev->private_data;
/* Configure the device for input */ /* Configure the device for input */
...@@ -664,7 +664,7 @@ static int fd_zio_input(struct zio_cset *cset) ...@@ -664,7 +664,7 @@ static int fd_zio_input(struct zio_cset *cset)
*/ */
static int fd_zio_probe(struct zio_device *zdev) static int fd_zio_probe(struct zio_device *zdev)
{ {
struct spec_fd *fd; struct fd_dev *fd;
/* link the new device from the fd structure */ /* link the new device from the fd structure */
fd = zdev->private_data; fd = zdev->private_data;
...@@ -799,7 +799,7 @@ void fd_zio_unregister(void) ...@@ -799,7 +799,7 @@ void fd_zio_unregister(void)
} }
/* Init and exit are called for each FD card we have */ /* Init and exit are called for each FD card we have */
int fd_zio_init(struct spec_fd *fd) int fd_zio_init(struct fd_dev *fd)
{ {
int err = 0; int err = 0;
struct spec_dev *spec; struct spec_dev *spec;
...@@ -831,7 +831,7 @@ int fd_zio_init(struct spec_fd *fd) ...@@ -831,7 +831,7 @@ int fd_zio_init(struct spec_fd *fd)
return 0; return 0;
} }
void fd_zio_exit(struct spec_fd *fd) void fd_zio_exit(struct fd_dev *fd)
{ {
del_timer_sync(&fd->fifo_timer); del_timer_sync(&fd->fifo_timer);
zio_unregister_device(fd->hwzdev); zio_unregister_device(fd->hwzdev);
......
...@@ -163,7 +163,7 @@ struct fd_ch { ...@@ -163,7 +163,7 @@ struct fd_ch {
}; };
/* This is the device we use all around */ /* This is the device we use all around */
struct spec_fd { struct fd_dev {
spinlock_t lock; spinlock_t lock;
unsigned long flags; unsigned long flags;
struct fmc_device *fmc; struct fmc_device *fmc;
...@@ -217,11 +217,11 @@ static inline void fd_split_pico(uint64_t pico, ...@@ -217,11 +217,11 @@ static inline void fd_split_pico(uint64_t pico,
*frac = (*frac << 12) / 8000; *frac = (*frac << 12) / 8000;
} }
static inline uint32_t fd_readl(struct spec_fd *fd, unsigned long reg) static inline uint32_t fd_readl(struct fd_dev *fd, unsigned long reg)
{ {
return readl(fd->regs + reg); return readl(fd->regs + reg);
} }
static inline void fd_writel(struct spec_fd *fd, uint32_t v, unsigned long reg) static inline void fd_writel(struct fd_dev *fd, uint32_t v, unsigned long reg)
{ {
writel(v, fd->regs + reg); writel(v, fd->regs + reg);
} }
...@@ -232,14 +232,14 @@ static inline void __check_chan(int x) ...@@ -232,14 +232,14 @@ static inline void __check_chan(int x)
} }
static inline uint32_t fd_ch_readl(struct spec_fd *fd, int ch, static inline uint32_t fd_ch_readl(struct fd_dev *fd, int ch,
unsigned long reg) unsigned long reg)
{ {
__check_chan(ch); __check_chan(ch);
return fd_readl(fd, 0x100 + ch * 0x100 + reg); return fd_readl(fd, 0x100 + ch * 0x100 + reg);
} }
static inline void fd_ch_writel(struct spec_fd *fd, int ch, static inline void fd_ch_writel(struct fd_dev *fd, int ch,
uint32_t v, unsigned long reg) uint32_t v, unsigned long reg)
{ {
__check_chan(ch); __check_chan(ch);
...@@ -299,66 +299,66 @@ static inline void __check_output(int x) ...@@ -299,66 +299,66 @@ static inline void __check_output(int x)
#define FD_GPIO_CAL_DISABLE 0x0080 /* 0 enables calibration */ #define FD_GPIO_CAL_DISABLE 0x0080 /* 0 enables calibration */
/* Functions exported by spi.c */ /* Functions exported by spi.c */
extern int fd_spi_xfer(struct spec_fd *fd, int ss, int num_bits, extern int fd_spi_xfer(struct fd_dev *fd, int ss, int num_bits,
uint32_t in, uint32_t *out); uint32_t in, uint32_t *out);
extern int fd_spi_init(struct spec_fd *fd); extern int fd_spi_init(struct fd_dev *fd);
extern void fd_spi_exit(struct spec_fd *fd); extern void fd_spi_exit(struct fd_dev *fd);
/* Functions exported by pll.c */ /* Functions exported by pll.c */
extern int fd_pll_init(struct spec_fd *fd); extern int fd_pll_init(struct fd_dev *fd);
extern void fd_pll_exit(struct spec_fd *fd); extern void fd_pll_exit(struct fd_dev *fd);
/* Functions exported by onewire.c */ /* Functions exported by onewire.c */
extern int fd_onewire_init(struct spec_fd *fd); extern int fd_onewire_init(struct fd_dev *fd);
extern void fd_onewire_exit(struct spec_fd *fd); extern void fd_onewire_exit(struct fd_dev *fd);
extern int fd_read_temp(struct spec_fd *fd, int verbose); extern int fd_read_temp(struct fd_dev *fd, int verbose);
/* Functions exported by acam.c */ /* Functions exported by acam.c */
extern int fd_acam_init(struct spec_fd *fd); extern int fd_acam_init(struct fd_dev *fd);
extern void fd_acam_exit(struct spec_fd *fd); extern void fd_acam_exit(struct fd_dev *fd);
extern uint32_t acam_readl(struct spec_fd *fd, int reg); extern uint32_t acam_readl(struct fd_dev *fd, int reg);
extern void acam_writel(struct spec_fd *fd, int val, int reg); extern void acam_writel(struct fd_dev *fd, int val, int reg);
/* Functions exported by calibrate.c, called within acam.c */ /* Functions exported by calibrate.c, called within acam.c */
extern int fd_calibrate_outputs(struct spec_fd *fd); extern int fd_calibrate_outputs(struct fd_dev *fd);
extern void fd_update_calibration(unsigned long arg); extern void fd_update_calibration(unsigned long arg);
extern int fd_calib_period_s; extern int fd_calib_period_s;
/* Functions exported by gpio.c */ /* Functions exported by gpio.c */
extern int fd_gpio_init(struct spec_fd *fd); extern int fd_gpio_init(struct fd_dev *fd);
extern void fd_gpio_exit(struct spec_fd *fd); extern void fd_gpio_exit(struct fd_dev *fd);
extern void fd_gpio_dir(struct spec_fd *fd, int pin, int dir); extern void fd_gpio_dir(struct fd_dev *fd, int pin, int dir);
extern void fd_gpio_val(struct spec_fd *fd, int pin, int val); extern void fd_gpio_val(struct fd_dev *fd, int pin, int val);
extern void fd_gpio_set_clr(struct spec_fd *fd, int pin, int set); extern void fd_gpio_set_clr(struct fd_dev *fd, int pin, int set);
extern int fd_dump_mcp(struct spec_fd *fd); extern int fd_dump_mcp(struct fd_dev *fd);
#define fd_gpio_set(fd, pin) fd_gpio_set_clr((fd), (pin), 1) #define fd_gpio_set(fd, pin) fd_gpio_set_clr((fd), (pin), 1)
#define fd_gpio_clr(fd, pin) fd_gpio_set_clr((fd), (pin), 0) #define fd_gpio_clr(fd, pin) fd_gpio_set_clr((fd), (pin), 0)
/* Functions exported by time.c */ /* Functions exported by time.c */
extern int fd_time_init(struct spec_fd *fd); extern int fd_time_init(struct fd_dev *fd);
extern void fd_time_exit(struct spec_fd *fd); extern void fd_time_exit(struct fd_dev *fd);
extern int fd_time_set(struct spec_fd *fd, struct fd_time *t, extern int fd_time_set(struct fd_dev *fd, struct fd_time *t,
struct timespec *ts); struct timespec *ts);
extern int fd_time_get(struct spec_fd *fd, struct fd_time *t, extern int fd_time_get(struct fd_dev *fd, struct fd_time *t,
struct timespec *ts); struct timespec *ts);
/* Functions exported by fd-zio.c */ /* Functions exported by fd-zio.c */
extern int fd_zio_register(void); extern int fd_zio_register(void);
extern void fd_zio_unregister(void); extern void fd_zio_unregister(void);
extern int fd_zio_init(struct spec_fd *fd); extern int fd_zio_init(struct fd_dev *fd);
extern void fd_zio_exit(struct spec_fd *fd); extern void fd_zio_exit(struct fd_dev *fd);
/* Functions exported by fd-spec.c */ /* Functions exported by fd-spec.c */
extern int fd_spec_init(void); extern int fd_spec_init(void);
extern void fd_spec_exit(void); extern void fd_spec_exit(void);
/* Functions exported by i2c.c */ /* Functions exported by i2c.c */
extern int fd_i2c_init(struct spec_fd *fd); extern int fd_i2c_init(struct fd_dev *fd);
extern void fd_i2c_exit(struct spec_fd *fd); extern void fd_i2c_exit(struct fd_dev *fd);
extern int fd_eerom_read(struct spec_fd *fd, int i2c_addr, uint32_t offset, extern int fd_eerom_read(struct fd_dev *fd, int i2c_addr, uint32_t offset,
void *buf, size_t size); void *buf, size_t size);
extern int fd_eeprom_write(struct spec_fd *fd, int i2c_addr, uint32_t offset, extern int fd_eeprom_write(struct fd_dev *fd, int i2c_addr, uint32_t offset,
void *buf, size_t size); void *buf, size_t size);
......
...@@ -16,18 +16,18 @@ ...@@ -16,18 +16,18 @@
#define SPI_RETRIES 100 #define SPI_RETRIES 100
static int gpio_writel(struct spec_fd *fd, int val, int reg) static int gpio_writel(struct fd_dev *fd, int val, int reg)
{ {
int rval = fd_spi_xfer(fd, FD_CS_GPIO, 24, int rval = fd_spi_xfer(fd, FD_CS_GPIO, 24,
0x4e0000 | (reg << 8) | val, NULL); 0x4e0000 | (reg << 8) | val, NULL);
fd_spi_xfer(fd, FD_CS_NONE, 24, fd_spi_xfer(fd, FD_CS_NONE, 24,
0, NULL); 0, NULL);
return rval; return rval;
} }
static int gpio_readl(struct spec_fd *fd, int reg) static int gpio_readl(struct fd_dev *fd, int reg)
{ {
uint32_t ret; uint32_t ret;
int err; int err;
...@@ -43,7 +43,7 @@ static int gpio_readl(struct spec_fd *fd, int reg) ...@@ -43,7 +43,7 @@ static int gpio_readl(struct spec_fd *fd, int reg)
return ret & 0xff; return ret & 0xff;
} }
static int gpio_writel_with_retry(struct spec_fd *fd, int val, int reg) static int gpio_writel_with_retry(struct fd_dev *fd, int val, int reg)
{ {
int retries = SPI_RETRIES, rv; int retries = SPI_RETRIES, rv;
while(retries--) while(retries--)
...@@ -61,7 +61,7 @@ static int gpio_writel_with_retry(struct spec_fd *fd, int val, int reg) ...@@ -61,7 +61,7 @@ static int gpio_writel_with_retry(struct spec_fd *fd, int val, int reg)
return -EIO; return -EIO;
} }
void fd_gpio_dir(struct spec_fd *fd, int mask, int dir) void fd_gpio_dir(struct fd_dev *fd, int mask, int dir)
{ {
fd->mcp_iodir &= ~mask; fd->mcp_iodir &= ~mask;
if (dir == FD_GPIO_IN) if (dir == FD_GPIO_IN)
...@@ -71,7 +71,7 @@ void fd_gpio_dir(struct spec_fd *fd, int mask, int dir) ...@@ -71,7 +71,7 @@ void fd_gpio_dir(struct spec_fd *fd, int mask, int dir)
gpio_writel_with_retry(fd, (fd->mcp_iodir >> 8), FD_MCP_IODIR+1); gpio_writel_with_retry(fd, (fd->mcp_iodir >> 8), FD_MCP_IODIR+1);
} }
void fd_gpio_val(struct spec_fd *fd, int mask, int values) void fd_gpio_val(struct fd_dev *fd, int mask, int values)
{ {
fd->mcp_olat &= ~mask; fd->mcp_olat &= ~mask;
...@@ -81,7 +81,7 @@ void fd_gpio_val(struct spec_fd *fd, int mask, int values) ...@@ -81,7 +81,7 @@ void fd_gpio_val(struct spec_fd *fd, int mask, int values)
gpio_writel_with_retry(fd, (fd->mcp_olat >> 8), FD_MCP_OLAT+1); gpio_writel_with_retry(fd, (fd->mcp_olat >> 8), FD_MCP_OLAT+1);
} }
void fd_gpio_set_clr(struct spec_fd *fd, int mask, int set) void fd_gpio_set_clr(struct fd_dev *fd, int mask, int set)
{ {
if (set) if (set)
fd_gpio_val(fd, mask, mask); fd_gpio_val(fd, mask, mask);
...@@ -89,7 +89,7 @@ void fd_gpio_set_clr(struct spec_fd *fd, int mask, int set) ...@@ -89,7 +89,7 @@ void fd_gpio_set_clr(struct spec_fd *fd, int mask, int set)
fd_gpio_val(fd, mask, 0); fd_gpio_val(fd, mask, 0);
} }
int fd_gpio_init(struct spec_fd *fd) int fd_gpio_init(struct fd_dev *fd)
{ {
int i, val; int i, val;
...@@ -120,12 +120,12 @@ out: ...@@ -120,12 +120,12 @@ out:
return -EIO; return -EIO;
} }
void fd_gpio_exit(struct spec_fd *fd) void fd_gpio_exit(struct fd_dev *fd)
{ {
/* nothing to do */ /* nothing to do */
} }
int fd_dump_mcp(struct spec_fd *fd) int fd_dump_mcp(struct fd_dev *fd)
{ {
printk(KERN_DEBUG "MCP23S17 register dump\n"); printk(KERN_DEBUG "MCP23S17 register dump\n");
printk(KERN_DEBUG "IOCON: 0x%02x\n", gpio_readl(fd, FD_MCP_IOCON)); printk(KERN_DEBUG "IOCON: 0x%02x\n", gpio_readl(fd, FD_MCP_IOCON));
......
...@@ -54,7 +54,7 @@ static void dumpstruct(char *name, void *ptr, int size) ...@@ -54,7 +54,7 @@ static void dumpstruct(char *name, void *ptr, int size)
printk("\n"); printk("\n");
} }
static void set_sda(struct spec_fd *fd, int val) static void set_sda(struct fd_dev *fd, int val)
{ {
uint32_t reg; uint32_t reg;
...@@ -64,7 +64,7 @@ static void set_sda(struct spec_fd *fd, int val) ...@@ -64,7 +64,7 @@ static void set_sda(struct spec_fd *fd, int val)
fd_writel(fd, reg, FD_REG_I2CR); fd_writel(fd, reg, FD_REG_I2CR);
} }
static void set_scl(struct spec_fd *fd, int val) static void set_scl(struct fd_dev *fd, int val)
{ {
uint32_t reg; uint32_t reg;
...@@ -74,25 +74,25 @@ static void set_scl(struct spec_fd *fd, int val) ...@@ -74,25 +74,25 @@ static void set_scl(struct spec_fd *fd, int val)
fd_writel(fd, reg, FD_REG_I2CR); fd_writel(fd, reg, FD_REG_I2CR);
} }
static int get_sda(struct spec_fd *fd) static int get_sda(struct fd_dev *fd)
{ {
return fd_readl(fd, FD_REG_I2CR) & FD_I2CR_SDA_IN ? 1 : 0; return fd_readl(fd, FD_REG_I2CR) & FD_I2CR_SDA_IN ? 1 : 0;
}; };
static void mi2c_start(struct spec_fd *fd) static void mi2c_start(struct fd_dev *fd)
{ {
set_sda(fd, 0); set_sda(fd, 0);
set_scl(fd, 0); set_scl(fd, 0);
} }
static void mi2c_stop(struct spec_fd *fd) static void mi2c_stop(struct fd_dev *fd)
{ {
set_sda(fd, 0); set_sda(fd, 0);
set_scl(fd, 1); set_scl(fd, 1);
set_sda(fd, 1); set_sda(fd, 1);
} }
int mi2c_put_byte(struct spec_fd *fd, int data) int mi2c_put_byte(struct fd_dev *fd, int data)
{ {
int i; int i;
int ack; int ack;
...@@ -114,7 +114,7 @@ int mi2c_put_byte(struct spec_fd *fd, int data) ...@@ -114,7 +114,7 @@ int mi2c_put_byte(struct spec_fd *fd, int data)
return ack ? -EIO : 0; /* ack low == success */ return ack ? -EIO : 0; /* ack low == success */
} }
int mi2c_get_byte(struct spec_fd *fd, unsigned char *data, int sendack) int mi2c_get_byte(struct fd_dev *fd, unsigned char *data, int sendack)
{ {
int i; int i;
int indata = 0; int indata = 0;
...@@ -139,13 +139,13 @@ int mi2c_get_byte(struct spec_fd *fd, unsigned char *data, int sendack) ...@@ -139,13 +139,13 @@ int mi2c_get_byte(struct spec_fd *fd, unsigned char *data, int sendack)
return 0; return 0;
} }
void mi2c_init(struct spec_fd *fd) void mi2c_init(struct fd_dev *fd)
{ {
set_scl(fd, 1); set_scl(fd, 1);
set_sda(fd, 1); set_sda(fd, 1);
} }
void mi2c_scan(struct spec_fd *fd) void mi2c_scan(struct fd_dev *fd)
{ {
int i; int i;
for(i = 0; i < 256; i += 2) { for(i = 0; i < 256; i += 2) {
...@@ -158,7 +158,7 @@ void mi2c_scan(struct spec_fd *fd) ...@@ -158,7 +158,7 @@ void mi2c_scan(struct spec_fd *fd)
} }
/* FIXME: this is very inefficient: read several bytes in a row instead */ /* FIXME: this is very inefficient: read several bytes in a row instead */
int fd_eeprom_read(struct spec_fd *fd, int i2c_addr, uint32_t offset, int fd_eeprom_read(struct fd_dev *fd, int i2c_addr, uint32_t offset,
void *buf, size_t size) void *buf, size_t size)
{ {
int i; int i;
...@@ -185,7 +185,7 @@ int fd_eeprom_read(struct spec_fd *fd, int i2c_addr, uint32_t offset, ...@@ -185,7 +185,7 @@ int fd_eeprom_read(struct spec_fd *fd, int i2c_addr, uint32_t offset,
return size; return size;
} }
int fd_eeprom_write(struct spec_fd *fd, int i2c_addr, uint32_t offset, int fd_eeprom_write(struct fd_dev *fd, int i2c_addr, uint32_t offset,
void *buf, size_t size) void *buf, size_t size)
{ {
int i, busy; int i, busy;
...@@ -214,7 +214,7 @@ int fd_eeprom_write(struct spec_fd *fd, int i2c_addr, uint32_t offset, ...@@ -214,7 +214,7 @@ int fd_eeprom_write(struct spec_fd *fd, int i2c_addr, uint32_t offset,
} }
/* The user requested to load the configuration from file */ /* The user requested to load the configuration from file */
static void fd_i2c_load_calib(struct spec_fd *fd, static void fd_i2c_load_calib(struct fd_dev *fd,
struct fd_calib_on_eeprom *cal_ee) struct fd_calib_on_eeprom *cal_ee)
{ {
const struct firmware *fw; const struct firmware *fw;
...@@ -244,7 +244,7 @@ static void fd_i2c_load_calib(struct spec_fd *fd, ...@@ -244,7 +244,7 @@ static void fd_i2c_load_calib(struct spec_fd *fd,
} }
int fd_i2c_init(struct spec_fd *fd) int fd_i2c_init(struct fd_dev *fd)
{ {
struct fd_calib_on_eeprom *cal_ee; struct fd_calib_on_eeprom *cal_ee;
u32 hash; u32 hash;
...@@ -322,7 +322,7 @@ load: ...@@ -322,7 +322,7 @@ load:
return 0; return 0;
} }
void fd_i2c_exit(struct spec_fd *fd) void fd_i2c_exit(struct fd_dev *fd)
{ {
/* nothing to do */ /* nothing to do */
} }
......
...@@ -54,17 +54,17 @@ ...@@ -54,17 +54,17 @@
#define FD_OW_PORT 0 /* what is this slow? */ #define FD_OW_PORT 0 /* what is this slow? */
static void ow_writel(struct spec_fd *fd, uint32_t val, unsigned long reg) static void ow_writel(struct fd_dev *fd, uint32_t val, unsigned long reg)
{ {
writel(val, fd->ow_regs + reg); writel(val, fd->ow_regs + reg);
} }
static uint32_t ow_readl(struct spec_fd *fd, unsigned long reg) static uint32_t ow_readl(struct fd_dev *fd, unsigned long reg)
{ {
return readl(fd->ow_regs + reg); return readl(fd->ow_regs + reg);
} }
static int ow_reset(struct spec_fd *fd, int port) static int ow_reset(struct fd_dev *fd, int port)
{ {
uint32_t reg, data; uint32_t reg, data;
...@@ -77,7 +77,7 @@ static int ow_reset(struct spec_fd *fd, int port) ...@@ -77,7 +77,7 @@ static int ow_reset(struct spec_fd *fd, int port)
return ~reg & CSR_DAT_MSK; return ~reg & CSR_DAT_MSK;
} }
static int slot(struct spec_fd *fd, int port, int bit) static int slot(struct fd_dev *fd, int port, int bit)
{ {
uint32_t reg, data; uint32_t reg, data;
...@@ -90,17 +90,17 @@ static int slot(struct spec_fd *fd, int port, int bit) ...@@ -90,17 +90,17 @@ static int slot(struct spec_fd *fd, int port, int bit)
return reg & CSR_DAT_MSK; return reg & CSR_DAT_MSK;
} }
static int read_bit(struct spec_fd *fd, int port) static int read_bit(struct fd_dev *fd, int port)
{ {
return slot(fd, port, 0x1); return slot(fd, port, 0x1);
} }
static int write_bit(struct spec_fd *fd, int port, int bit) static int write_bit(struct fd_dev *fd, int port, int bit)
{ {
return slot(fd, port, bit); return slot(fd, port, bit);
} }
static int ow_read_byte(struct spec_fd *fd, int port) static int ow_read_byte(struct fd_dev *fd, int port)
{ {
int byte = 0, i; int byte = 0, i;
...@@ -109,7 +109,7 @@ static int ow_read_byte(struct spec_fd *fd, int port) ...@@ -109,7 +109,7 @@ static int ow_read_byte(struct spec_fd *fd, int port)
return byte; return byte;
} }
static int ow_write_byte(struct spec_fd *fd, int port, int byte) static int ow_write_byte(struct fd_dev *fd, int port, int byte)
{ {
int data = 0; int data = 0;
int i; int i;
...@@ -121,7 +121,7 @@ static int ow_write_byte(struct spec_fd *fd, int port, int byte) ...@@ -121,7 +121,7 @@ static int ow_write_byte(struct spec_fd *fd, int port, int byte)
return 0; /* success */ return 0; /* success */
} }
static int ow_write_block(struct spec_fd *fd, int port, uint8_t *block, int len) static int ow_write_block(struct fd_dev *fd, int port, uint8_t *block, int len)
{ {
int i; int i;
...@@ -130,7 +130,7 @@ static int ow_write_block(struct spec_fd *fd, int port, uint8_t *block, int len) ...@@ -130,7 +130,7 @@ static int ow_write_block(struct spec_fd *fd, int port, uint8_t *block, int len)
return 0; return 0;
} }
static int ow_read_block(struct spec_fd *fd, int port, uint8_t *block, int len) static int ow_read_block(struct fd_dev *fd, int port, uint8_t *block, int len)
{ {
int i; int i;
for(i = 0; i < len; i++) for(i = 0; i < len; i++)
...@@ -138,7 +138,7 @@ static int ow_read_block(struct spec_fd *fd, int port, uint8_t *block, int len) ...@@ -138,7 +138,7 @@ static int ow_read_block(struct spec_fd *fd, int port, uint8_t *block, int len)
return 0; return 0;
} }
static int ds18x_read_serial(struct spec_fd *fd) static int ds18x_read_serial(struct fd_dev *fd)
{ {
if(!ow_reset(fd, 0)) { if(!ow_reset(fd, 0)) {
pr_err("%s: Failure in resetting one-wire channel\n", pr_err("%s: Failure in resetting one-wire channel\n",
...@@ -150,7 +150,7 @@ static int ds18x_read_serial(struct spec_fd *fd) ...@@ -150,7 +150,7 @@ static int ds18x_read_serial(struct spec_fd *fd)
return ow_read_block(fd, FD_OW_PORT, fd->ds18_id, 8); return ow_read_block(fd, FD_OW_PORT, fd->ds18_id, 8);
} }
static int ds18x_access(struct spec_fd *fd) static int ds18x_access(struct fd_dev *fd)
{ {
if(!ow_reset(fd, 0)) if(!ow_reset(fd, 0))
goto out; goto out;
...@@ -169,7 +169,7 @@ out: ...@@ -169,7 +169,7 @@ out:
return -EIO; return -EIO;
} }
static void __temp_command_and_next_t(struct spec_fd *fd, int cfg_reg) static void __temp_command_and_next_t(struct fd_dev *fd, int cfg_reg)
{ {
int ms; int ms;
...@@ -180,7 +180,7 @@ static void __temp_command_and_next_t(struct spec_fd *fd, int cfg_reg) ...@@ -180,7 +180,7 @@ static void __temp_command_and_next_t(struct spec_fd *fd, int cfg_reg)
fd->next_t = jiffies + msecs_to_jiffies(ms); fd->next_t = jiffies + msecs_to_jiffies(ms);
} }
int fd_read_temp(struct spec_fd *fd, int verbose) int fd_read_temp(struct fd_dev *fd, int verbose)
{ {
int i, temp; int i, temp;
unsigned long j; unsigned long j;
...@@ -222,7 +222,7 @@ int fd_read_temp(struct spec_fd *fd, int verbose) ...@@ -222,7 +222,7 @@ int fd_read_temp(struct spec_fd *fd, int verbose)
return temp; return temp;
} }
int fd_onewire_init(struct spec_fd *fd) int fd_onewire_init(struct fd_dev *fd)
{ {
int i; int i;
...@@ -244,7 +244,7 @@ int fd_onewire_init(struct spec_fd *fd) ...@@ -244,7 +244,7 @@ int fd_onewire_init(struct spec_fd *fd)
return 0; return 0;
} }
void fd_onewire_exit(struct spec_fd *fd) void fd_onewire_exit(struct fd_dev *fd)
{ {
/* Nothing to do */ /* Nothing to do */
} }
...@@ -18,12 +18,12 @@ ...@@ -18,12 +18,12 @@
#include "fine-delay.h" #include "fine-delay.h"
#include "hw/pll_config.h" /* the table to be written */ #include "hw/pll_config.h" /* the table to be written */
static int pll_writel(struct spec_fd *fd, int val, int reg) static int pll_writel(struct fd_dev *fd, int val, int reg)
{ {
return fd_spi_xfer(fd, FD_CS_PLL, 24, (reg << 8) | val, NULL); return fd_spi_xfer(fd, FD_CS_PLL, 24, (reg << 8) | val, NULL);
} }
static int pll_readl(struct spec_fd *fd, int reg) static int pll_readl(struct fd_dev *fd, int reg)
{ {
uint32_t ret; uint32_t ret;
int err; int err;
...@@ -34,7 +34,7 @@ static int pll_readl(struct spec_fd *fd, int reg) ...@@ -34,7 +34,7 @@ static int pll_readl(struct spec_fd *fd, int reg)
return ret & 0xff; return ret & 0xff;
} }
int fd_pll_init(struct spec_fd *fd) int fd_pll_init(struct fd_dev *fd)
{ {
int i; int i;
unsigned long j; unsigned long j;
...@@ -99,7 +99,7 @@ out: ...@@ -99,7 +99,7 @@ out:
return -EIO; return -EIO;
} }
void fd_pll_exit(struct spec_fd *fd) void fd_pll_exit(struct fd_dev *fd)
{ {
/* nothing to do */ /* nothing to do */
} }
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
#include "fine-delay.h" #include "fine-delay.h"
#include "hw/fd_main_regs.h" #include "hw/fd_main_regs.h"
int fd_spi_xfer(struct spec_fd *fd, int ss, int num_bits, int fd_spi_xfer(struct fd_dev *fd, int ss, int num_bits,
uint32_t in, uint32_t *out) uint32_t in, uint32_t *out)
{ {
uint32_t scr = 0, r; uint32_t scr = 0, r;
...@@ -44,13 +44,13 @@ int fd_spi_xfer(struct spec_fd *fd, int ss, int num_bits, ...@@ -44,13 +44,13 @@ int fd_spi_xfer(struct spec_fd *fd, int ss, int num_bits,
} }
int fd_spi_init(struct spec_fd *fd) int fd_spi_init(struct fd_dev *fd)
{ {
/* nothing to do */ /* nothing to do */
return 0; return 0;
} }
void fd_spi_exit(struct spec_fd *fd) void fd_spi_exit(struct fd_dev *fd)
{ {
/* nothing to do */ /* nothing to do */
} }
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
#include "hw/fd_main_regs.h" #include "hw/fd_main_regs.h"
/* If fd_time is not null, use it. if ts is not null, use it, else current */ /* If fd_time is not null, use it. if ts is not null, use it, else current */
int fd_time_set(struct spec_fd *fd, struct fd_time *t, struct timespec *ts) int fd_time_set(struct fd_dev *fd, struct fd_time *t, struct timespec *ts)
{ {
uint32_t tcr, gcr; uint32_t tcr, gcr;
unsigned long flags; unsigned long flags;
...@@ -52,7 +52,7 @@ int fd_time_set(struct spec_fd *fd, struct fd_time *t, struct timespec *ts) ...@@ -52,7 +52,7 @@ int fd_time_set(struct spec_fd *fd, struct fd_time *t, struct timespec *ts)
} }
/* If fd_time is not null, use it. Otherwise use ts */ /* If fd_time is not null, use it. Otherwise use ts */
int fd_time_get(struct spec_fd *fd, struct fd_time *t, struct timespec *ts) int fd_time_get(struct fd_dev *fd, struct fd_time *t, struct timespec *ts)
{ {
uint32_t tcr, h, l, c; uint32_t tcr, h, l, c;
unsigned long flags; unsigned long flags;
...@@ -76,7 +76,7 @@ int fd_time_get(struct spec_fd *fd, struct fd_time *t, struct timespec *ts) ...@@ -76,7 +76,7 @@ int fd_time_get(struct spec_fd *fd, struct fd_time *t, struct timespec *ts)
return 0; return 0;
} }
int fd_time_init(struct spec_fd *fd) int fd_time_init(struct fd_dev *fd)
{ {
struct timespec ts = {0,0}; struct timespec ts = {0,0};
...@@ -84,7 +84,7 @@ int fd_time_init(struct spec_fd *fd) ...@@ -84,7 +84,7 @@ int fd_time_init(struct spec_fd *fd)
return fd_time_set(fd, NULL, &ts); return fd_time_set(fd, NULL, &ts);
} }
void fd_time_exit(struct spec_fd *fd) void fd_time_exit(struct fd_dev *fd)
{ {
/* nothing to do */ /* nothing to do */
} }
......
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