diff options
author | Terry Lv <r65388@freescale.com> | 2011-02-16 01:07:28 +0800 |
---|---|---|
committer | Jason Liu <r64343@freescale.com> | 2012-01-09 20:07:57 +0800 |
commit | 7f70ead9e81e88942c5e3e693d301bab3771c2b1 (patch) | |
tree | 35b42b9767f96f3568c010acf52304f016248a39 /drivers/char | |
parent | 1f3c7579a5c1c4e8e9fbdfd6964489c35f73663a (diff) |
ENGR00139119: mxc_iim: add console output for iim value
Add console output for iim value.
Signed-off-by: Terry Lv <r65388@freescale.com>
Diffstat (limited to 'drivers/char')
-rw-r--r-- | drivers/char/mxc_iim.c | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/drivers/char/mxc_iim.c b/drivers/char/mxc_iim.c index ea5929536ac2..4d1429a95e81 100644 --- a/drivers/char/mxc_iim.c +++ b/drivers/char/mxc_iim.c @@ -107,9 +107,9 @@ static inline void fuse_op_start(void) dev_dbg(iim_data->dev, "<= %s\n", __func__); } -static u32 sense_fuse(s32 bank, s32 row, s32 bit) +static u32 sense_fuse(u32 bank, u32 row, u32 bit) { - s32 addr, addr_l, addr_h; + u32 addr, addr_l, addr_h; s32 err = 0; struct iim_regs *iim_reg_base = (struct iim_regs *)iim_data->virt_base; @@ -151,7 +151,7 @@ static u32 sense_fuse(s32 bank, s32 row, s32 bit) /* Blow fuses based on the bank, row and bit positions (all 0-based) */ -static s32 fuse_blow_bit(s32 bank, s32 row, s32 bit) +static s32 fuse_blow_bit(u32 bank, u32 row, u32 bit) { int addr, addr_l, addr_h, err; struct iim_regs *iim_reg_base = (struct iim_regs *)iim_data->virt_base; @@ -198,7 +198,7 @@ static s32 fuse_blow_bit(s32 bank, s32 row, s32 bit) return err; } -static void fuse_blow_row(s32 bank, s32 row, s32 value) +static void fuse_blow_row(u32 bank, u32 row, u32 value) { u32 i; @@ -326,8 +326,7 @@ invald_arg_out: static ssize_t mxc_iim_read(struct file *filp, char __user *buf, size_t count, loff_t *f_pos) { - s32 bank; - s8 row, fuse_val; + u32 bank, row, fuse_val; ssize_t retval = 0; dev_dbg(iim_data->dev, "=> %s\n", __func__); @@ -350,9 +349,9 @@ static ssize_t mxc_iim_read(struct file *filp, char __user *buf, dev_dbg(iim_data->dev, "Read fuse at bank:%d row:%d\n", bank, row); mutex_lock(&iim_data->mutex); - fuse_val = (s8)sense_fuse(bank, row, 0); + fuse_val = sense_fuse(bank, row, 0); mutex_unlock(&iim_data->mutex); - dev_dbg(iim_data->dev, "fuses at (bank:%d, row:%d) = 0x%x\n", + dev_info(iim_data->dev, "fuses at (bank:%d, row:%d) = 0x%x\n", bank, row, fuse_val); if (copy_to_user(buf, &fuse_val, count)) { retval = -EFAULT; @@ -371,10 +370,10 @@ invald_arg_out: static ssize_t mxc_iim_write(struct file *filp, const char __user *buf, size_t count, loff_t *f_pos) { - s32 bank; + u32 bank; ulong fuse_val; - s8 row; - s8 *tmp_buf = NULL; + u8 row; + u8 *tmp_buf = NULL; loff_t file_pos = *f_pos; ssize_t retval = 0; @@ -384,7 +383,7 @@ static ssize_t mxc_iim_write(struct file *filp, const char __user *buf, tmp_buf = kmalloc(count + 1, GFP_KERNEL); if (unlikely(!tmp_buf)) { retval = -ENOMEM; - goto out; + goto out; } memset(tmp_buf, 0, count + 1); if (copy_from_user(tmp_buf, buf, count)) { @@ -433,7 +432,7 @@ static ssize_t mxc_iim_write(struct file *filp, const char __user *buf, "bank_start: 0x%08x, bank_end: 0x%08x\n", iim_data->bank_start, iim_data->bank_end); dev_info(iim_data->dev, - "file pos out of range: 0x%08x\n", file_pos); + "file pos out of range: 0x%08x\n", (u32)file_pos); retval = -EINVAL; goto out; } @@ -441,13 +440,13 @@ static ssize_t mxc_iim_write(struct file *filp, const char __user *buf, bank = (file_pos - iim_data->bank_start) >> 10; row = ((file_pos - iim_data->bank_start) & 0x3ff) >> 2; - dev_dbg(iim_data->dev, "Blowing fuse at bank:%d row:%d value:%d\n", + dev_info(iim_data->dev, "Blowing fuse at bank:%d row:%d value:%d\n", bank, row, (int)fuse_val); mutex_lock(&iim_data->mutex); fuse_blow_row(bank, row, fuse_val); fuse_val = sense_fuse(bank, row, 0); mutex_unlock(&iim_data->mutex); - dev_dbg(iim_data->dev, "fuses at (bank:%d, row:%d) = 0x%x\n", + dev_info(iim_data->dev, "fuses at (bank:%d, row:%d) = 0x%x\n", bank, row, (unsigned int)fuse_val); retval = count; |