Mercurial > pt1
changeset 36:65c8ac567074
cleaning up:
- eliminate warnings
- remove dangling white spaces
- changed new line code in Makefile from CR+LF to LF
author | Yoshiki Yazawa <yaz@honeyplanet.jp> |
---|---|
date | Fri, 13 Mar 2009 14:32:44 +0900 |
parents | b17f95181af4 |
children | c359e7adf700 |
files | driver/Makefile driver/pt1_pci.c driver/pt1_tuner_data.c |
diffstat | 3 files changed, 73 insertions(+), 73 deletions(-) [+] |
line wrap: on
line diff
--- a/driver/Makefile Fri Mar 13 14:29:56 2009 +0900 +++ b/driver/Makefile Fri Mar 13 14:32:44 2009 +0900 @@ -1,20 +1,18 @@ -# - -TARGET:= pt1_drv.ko - -all: ${TARGET} - -pt1_drv.ko: pt1_pci.c pt1_i2c.c pt1_tuner.c pt1_tuner_data.c - make -C /lib/modules/`uname -r`/build M=`pwd` V=1 modules - -clean: - make -C /lib/modules/`uname -r`/build M=`pwd` V=1 clean - -obj-m:= pt1_drv.o - -pt1_drv-objs := pt1_pci.o pt1_i2c.o pt1_tuner.o pt1_tuner_data.o - -clean-files := *.o *.ko *.mod.[co] *~ - -install: $(TARGET) - install -m 644 $(TARGET) /lib/modules/`uname -r`/kernel/drivers/video +TARGET:= pt1_drv.ko + +all: ${TARGET} + +pt1_drv.ko: pt1_pci.c pt1_i2c.c pt1_tuner.c pt1_tuner_data.c + make -C /lib/modules/`uname -r`/build M=`pwd` V=1 modules + +clean: + make -C /lib/modules/`uname -r`/build M=`pwd` V=1 clean + +obj-m:= pt1_drv.o + +pt1_drv-objs := pt1_pci.o pt1_i2c.o pt1_tuner.o pt1_tuner_data.o + +clean-files := *.o *.ko *.mod.[co] *~ + +install: $(TARGET) + install -m 644 $(TARGET) /lib/modules/`uname -r`/kernel/drivers/video
--- a/driver/pt1_pci.c Fri Mar 13 14:29:56 2009 +0900 +++ b/driver/pt1_pci.c Fri Mar 13 14:32:44 2009 +0900 @@ -17,11 +17,11 @@ #include <asm/uaccess.h> #include <linux/version.h> #include <linux/mutex.h> -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,23) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,23) #include <linux/freezer.h> #else #define set_freezable() -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,11) +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,11) typedef struct pm_message { int event; } pm_message_t; @@ -69,7 +69,7 @@ #define MAX_READ_BLOCK 4 // 1度に読み出す最大DMAバッファ数 #define MAX_PCI_DEVICE 128 // 最大64枚 #define DMA_SIZE 4096 // DMAバッファサイズ -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22) #define DMA_RING_SIZE 128 // RINGサイズ #define DMA_RING_MAX 511 // 1RINGにいくつ詰めるか(1023はNGで511まで) #define CHANEL_DMA_SIZE (2*1024*1024) // 地デジ用(16Mbps) @@ -182,7 +182,6 @@ int lp ; int chno ; int lp2 ; - __u32 addr ; __u32 *dataptr ; __u32 *curdataptr ; __u32 val ; @@ -328,7 +327,6 @@ } static int pt1_release(struct inode *inode, struct file *file) { - int minor = iminor(inode); PT1_CHANNEL *channel = file->private_data; mutex_lock(&channel->ptr->lock); @@ -353,7 +351,7 @@ { PT1_CHANNEL *channel = file->private_data; __u32 size ; - + unsigned long dummy; // 4K単位で起こされるのを待つ(CPU負荷対策) if(channel->size < DMA_SIZE){ @@ -367,12 +365,12 @@ if(cnt < channel->size){ // バッファが足りない場合は残りを移動する size = cnt ; - copy_to_user(buf, channel->buf, cnt); + dummy = copy_to_user(buf, channel->buf, cnt); memmove(channel->buf, &channel->buf[cnt], (channel->size - cnt)); channel->size -= cnt ; }else{ size = channel->size ; - copy_to_user(buf, channel->buf, size); + dummy = copy_to_user(buf, channel->buf, size); channel->size = 0 ; } } @@ -433,16 +431,18 @@ } return 0 ; } -static int pt1_ioctl(struct inode *inode, struct file *file, unsigned int cmd, void *arg) +static int pt1_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg0) { PT1_CHANNEL *channel = file->private_data; - int signal ; + int signal ; + unsigned long dummy; + void *arg = (void *)arg0; switch(cmd){ case SET_CHANNEL: { FREQUENCY freq ; - copy_from_user(&freq, arg, sizeof(FREQUENCY)); + dummy = copy_from_user(&freq, arg, sizeof(FREQUENCY)); return SetFreq(channel, &freq); } case START_REC: @@ -462,11 +462,11 @@ break ; case CHANNEL_TYPE_ISDB_T: // calc C/N - signal = isdb_t_read_signal_strength(channel->ptr->regs, + signal = isdb_t_read_signal_strength(channel->ptr->regs, &channel->ptr->lock, channel->address); break ; } - copy_to_user(arg, &signal, sizeof(int)); + dummy = copy_to_user(arg, &signal, sizeof(int)); return 0 ; case LNB_ENABLE: if(lnb){ @@ -578,6 +578,7 @@ u16 cmd ; PT1_DEVICE *dev_conf ; PT1_CHANNEL *channel ; + struct resource *dummy; rc = pci_enable_device(pdev); if (rc) @@ -608,8 +609,8 @@ // PCIアドレスをマップする dev_conf->mmio_start = pci_resource_start(pdev, 0); dev_conf->mmio_len = pci_resource_len(pdev, 0); - rc = request_mem_region(dev_conf->mmio_start, dev_conf->mmio_len, DEV_NAME); - if (!rc) { + dummy = request_mem_region(dev_conf->mmio_start, dev_conf->mmio_len, DEV_NAME); + if (!dummy) { printk(KERN_ERR "PT1: cannot request iomem (0x%llx).\n", (unsigned long long) dev_conf->mmio_start); goto out_err_regbase; } @@ -642,9 +643,9 @@ } // 初期化完了 for(lp = 0 ; lp < MAX_CHANNEL ; lp++){ - set_sleepmode(dev_conf->regs, &dev_conf->lock, + set_sleepmode(dev_conf->regs, &dev_conf->lock, i2c_address[lp], channeltype[lp], TYPE_SLEEP); - + schedule_timeout_interruptible(msecs_to_jiffies(50)); } rc = alloc_chrdev_region(&dev_conf->dev, 0, MAX_CHANNEL, DEV_NAME); @@ -839,6 +840,7 @@ static int __init pt1_pci_init(void) { + printk(version); pt1video_class = class_create(THIS_MODULE, DRIVERNAME); if (IS_ERR(pt1video_class)) return PTR_ERR(pt1video_class);
--- a/driver/pt1_tuner_data.c Fri Mar 13 14:29:56 2009 +0900 +++ b/driver/pt1_tuner_data.c Fri Mar 13 14:32:44 2009 +0900 @@ -1030,42 +1030,42 @@ /* BS-周波数テーブル */ /***************************************************************************/ WBLOCK_BS_PLL bs_pll[MAX_BS_CHANNEL] = { - {&bs_1_step1, &bs_com_step2, &bs_1_step3}, - {&bs_3_step1, &bs_com_step2, &bs_3_step3}, - {&bs_5_step1, &bs_com_step2, &bs_5_step3}, - {&bs_7_step1, &bs_com_step2, &bs_7_step3}, - {&bs_9_step1, &bs_com_step2, &bs_9_step3}, - {&bs_11_step1, &bs_com_step2, &bs_11_step3}, - {&bs_13_step1, &bs_com_step2, &bs_13_step3}, - {&bs_15_step1, &bs_com_step2, &bs_15_step3}, - {&bs_17_step1, &bs_com_step2, &bs_17_step3}, - {&bs_19_step1, &bs_com_step2, &bs_19_step3}, - {&bs_21_step1, &bs_com_step2, &bs_21_step3}, - {&bs_23_step1, &bs_com_step2, &bs_21_step3}, - {&nd_2_step1, &bs_com_step2, &nd_2_step3}, - {&nd_4_step1, &bs_com_step2, &nd_4_step3}, - {&nd_6_step1, &bs_com_step2, &nd_6_step3}, - {&nd_8_step1, &bs_com_step2, &nd_8_step3}, - {&nd_10_step1, &bs_com_step2, &nd_10_step3}, - {&nd_12_step1, &bs_com_step2, &nd_12_step3}, - {&nd_14_step1, &bs_com_step2, &nd_14_step3}, - {&nd_16_step1, &bs_com_step2, &nd_16_step3}, - {&nd_18_step1, &bs_com_step2, &nd_18_step3}, - {&nd_20_step1, &bs_com_step2, &nd_20_step3}, - {&nd_22_step1, &bs_com_step2, &nd_22_step3}, - {&nd_24_step1, &bs_com_step2, &nd_24_step3}, - {&nd_1_step1, &bs_com_step2, &nd_1_step3}, - {&nd_3_step1, &bs_com_step2, &nd_3_step3}, - {&nd_5_step1, &bs_com_step2, &nd_5_step3}, - {&nd_7_step1, &bs_com_step2, &nd_7_step3}, - {&nd_9_step1, &bs_com_step2, &nd_9_step3}, - {&nd_11_step1, &bs_com_step2, &nd_11_step3}, - {&nd_13_step1, &bs_com_step2, &nd_13_step3}, - {&nd_15_step1, &bs_com_step2, &nd_15_step3}, - {&nd_17_step1, &bs_com_step2, &nd_17_step3}, - {&nd_19_step1, &bs_com_step2, &nd_19_step3}, - {&nd_21_step1, &bs_com_step2, &nd_21_step3}, - {&nd_23_step1, &bs_com_step2, &nd_23_step3} + {{&bs_1_step1, &bs_com_step2, &bs_1_step3}}, + {{&bs_3_step1, &bs_com_step2, &bs_3_step3}}, + {{&bs_5_step1, &bs_com_step2, &bs_5_step3}}, + {{&bs_7_step1, &bs_com_step2, &bs_7_step3}}, + {{&bs_9_step1, &bs_com_step2, &bs_9_step3}}, + {{&bs_11_step1, &bs_com_step2, &bs_11_step3}}, + {{&bs_13_step1, &bs_com_step2, &bs_13_step3}}, + {{&bs_15_step1, &bs_com_step2, &bs_15_step3}}, + {{&bs_17_step1, &bs_com_step2, &bs_17_step3}}, + {{&bs_19_step1, &bs_com_step2, &bs_19_step3}}, + {{&bs_21_step1, &bs_com_step2, &bs_21_step3}}, + {{&bs_23_step1, &bs_com_step2, &bs_21_step3}}, + {{&nd_2_step1, &bs_com_step2, &nd_2_step3}}, + {{&nd_4_step1, &bs_com_step2, &nd_4_step3}}, + {{&nd_6_step1, &bs_com_step2, &nd_6_step3}}, + {{&nd_8_step1, &bs_com_step2, &nd_8_step3}}, + {{&nd_10_step1, &bs_com_step2, &nd_10_step3}}, + {{&nd_12_step1, &bs_com_step2, &nd_12_step3}}, + {{&nd_14_step1, &bs_com_step2, &nd_14_step3}}, + {{&nd_16_step1, &bs_com_step2, &nd_16_step3}}, + {{&nd_18_step1, &bs_com_step2, &nd_18_step3}}, + {{&nd_20_step1, &bs_com_step2, &nd_20_step3}}, + {{&nd_22_step1, &bs_com_step2, &nd_22_step3}}, + {{&nd_24_step1, &bs_com_step2, &nd_24_step3}}, + {{&nd_1_step1, &bs_com_step2, &nd_1_step3}}, + {{&nd_3_step1, &bs_com_step2, &nd_3_step3}}, + {{&nd_5_step1, &bs_com_step2, &nd_5_step3}}, + {{&nd_7_step1, &bs_com_step2, &nd_7_step3}}, + {{&nd_9_step1, &bs_com_step2, &nd_9_step3}}, + {{&nd_11_step1, &bs_com_step2, &nd_11_step3}}, + {{&nd_13_step1, &bs_com_step2, &nd_13_step3}}, + {{&nd_15_step1, &bs_com_step2, &nd_15_step3}}, + {{&nd_17_step1, &bs_com_step2, &nd_17_step3}}, + {{&nd_19_step1, &bs_com_step2, &nd_19_step3}}, + {{&nd_21_step1, &bs_com_step2, &nd_21_step3}}, + {{&nd_23_step1, &bs_com_step2, &nd_23_step3}} }; WBLOCK *bs_get_ts_id[(MAX_BS_TS_ID / 2)] = { &bs_get_slot_ts_id_1,