diff options
| author | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2016-11-13 06:46:11 -0500 |
|---|---|---|
| committer | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2016-11-18 05:09:36 -0500 |
| commit | e39682b5d96ae7a33a0f6b5578911913be8f14b6 (patch) | |
| tree | b7aa9b903756aca9e874e132e0a604e307ef71b0 | |
| parent | f1dc10b6e18df849429c1625bbcdf04ecc25d5c3 (diff) | |
[media] cx23885: convert it to use pr_foo() macros
Instead of calling printk() directly, use pr_foo()
macros, as suggested at the Kernel's coding style.
Please notice that a conversion to dev_foo() is not trivial,
as several parts on this driver uses pr_cont().
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
| -rw-r--r-- | drivers/media/pci/cx23885/altera-ci.c | 15 | ||||
| -rw-r--r-- | drivers/media/pci/cx23885/altera-ci.h | 14 | ||||
| -rw-r--r-- | drivers/media/pci/cx23885/cimax2.c | 8 | ||||
| -rw-r--r-- | drivers/media/pci/cx23885/cx23885-417.c | 57 | ||||
| -rw-r--r-- | drivers/media/pci/cx23885/cx23885-alsa.c | 21 | ||||
| -rw-r--r-- | drivers/media/pci/cx23885/cx23885-cards.c | 49 | ||||
| -rw-r--r-- | drivers/media/pci/cx23885/cx23885-core.c | 137 | ||||
| -rw-r--r-- | drivers/media/pci/cx23885/cx23885-dvb.c | 40 | ||||
| -rw-r--r-- | drivers/media/pci/cx23885/cx23885-f300.c | 2 | ||||
| -rw-r--r-- | drivers/media/pci/cx23885/cx23885-i2c.c | 25 | ||||
| -rw-r--r-- | drivers/media/pci/cx23885/cx23885-input.c | 6 | ||||
| -rw-r--r-- | drivers/media/pci/cx23885/cx23885-ir.c | 4 | ||||
| -rw-r--r-- | drivers/media/pci/cx23885/cx23885-vbi.c | 7 | ||||
| -rw-r--r-- | drivers/media/pci/cx23885/cx23885-video.c | 23 | ||||
| -rw-r--r-- | drivers/media/pci/cx23885/cx23885.h | 2 | ||||
| -rw-r--r-- | drivers/media/pci/cx23885/cx23888-ir.c | 6 | ||||
| -rw-r--r-- | drivers/media/pci/cx23885/netup-eeprom.c | 4 | ||||
| -rw-r--r-- | drivers/media/pci/cx23885/netup-init.c | 8 |
18 files changed, 209 insertions, 219 deletions
diff --git a/drivers/media/pci/cx23885/altera-ci.c b/drivers/media/pci/cx23885/altera-ci.c index aaf4e46ff3e9..5c94e312cba3 100644 --- a/drivers/media/pci/cx23885/altera-ci.c +++ b/drivers/media/pci/cx23885/altera-ci.c | |||
| @@ -48,6 +48,9 @@ | |||
| 48 | * | DATA7| DATA6| DATA5| DATA4| DATA3| DATA2| DATA1| DATA0| | 48 | * | DATA7| DATA6| DATA5| DATA4| DATA3| DATA2| DATA1| DATA0| |
| 49 | * +-------+-------+-------+-------+-------+-------+-------+-------+ | 49 | * +-------+-------+-------+-------+-------+-------+-------+-------+ |
| 50 | */ | 50 | */ |
| 51 | |||
| 52 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
| 53 | |||
| 51 | #include <dvb_demux.h> | 54 | #include <dvb_demux.h> |
| 52 | #include <dvb_frontend.h> | 55 | #include <dvb_frontend.h> |
| 53 | #include "altera-ci.h" | 56 | #include "altera-ci.h" |
| @@ -84,16 +87,18 @@ MODULE_DESCRIPTION("altera FPGA CI module"); | |||
| 84 | MODULE_AUTHOR("Igor M. Liplianin <liplianin@netup.ru>"); | 87 | MODULE_AUTHOR("Igor M. Liplianin <liplianin@netup.ru>"); |
| 85 | MODULE_LICENSE("GPL"); | 88 | MODULE_LICENSE("GPL"); |
| 86 | 89 | ||
| 87 | #define ci_dbg_print(args...) \ | 90 | #define ci_dbg_print(fmt, args...) \ |
| 88 | do { \ | 91 | do { \ |
| 89 | if (ci_dbg) \ | 92 | if (ci_dbg) \ |
| 90 | printk(KERN_DEBUG args); \ | 93 | printk(KERN_DEBUG pr_fmt("%s: " fmt), \ |
| 94 | __func__, ##args); \ | ||
| 91 | } while (0) | 95 | } while (0) |
| 92 | 96 | ||
| 93 | #define pid_dbg_print(args...) \ | 97 | #define pid_dbg_print(fmt, args...) \ |
| 94 | do { \ | 98 | do { \ |
| 95 | if (pid_dbg) \ | 99 | if (pid_dbg) \ |
| 96 | printk(KERN_DEBUG args); \ | 100 | printk(KERN_DEBUG pr_fmt("%s: " fmt), \ |
| 101 | __func__, ##args); \ | ||
| 97 | } while (0) | 102 | } while (0) |
| 98 | 103 | ||
| 99 | struct altera_ci_state; | 104 | struct altera_ci_state; |
| @@ -718,7 +723,7 @@ int altera_ci_init(struct altera_ci_config *config, int ci_nr) | |||
| 718 | if (temp_int != NULL) { | 723 | if (temp_int != NULL) { |
| 719 | inter = temp_int->internal; | 724 | inter = temp_int->internal; |
| 720 | (inter->cis_used)++; | 725 | (inter->cis_used)++; |
| 721 | inter->fpga_rw = config->fpga_rw; | 726 | inter->fpga_rw = config->fpga_rw; |
| 722 | ci_dbg_print("%s: Find Internal Structure!\n", __func__); | 727 | ci_dbg_print("%s: Find Internal Structure!\n", __func__); |
| 723 | } else { | 728 | } else { |
| 724 | inter = kzalloc(sizeof(struct fpga_internal), GFP_KERNEL); | 729 | inter = kzalloc(sizeof(struct fpga_internal), GFP_KERNEL); |
diff --git a/drivers/media/pci/cx23885/altera-ci.h b/drivers/media/pci/cx23885/altera-ci.h index 57a40c84b46e..ababd80fee93 100644 --- a/drivers/media/pci/cx23885/altera-ci.h +++ b/drivers/media/pci/cx23885/altera-ci.h | |||
| @@ -48,24 +48,24 @@ extern int altera_ci_tuner_reset(void *dev, int ci_nr); | |||
| 48 | 48 | ||
| 49 | static inline int altera_ci_init(struct altera_ci_config *config, int ci_nr) | 49 | static inline int altera_ci_init(struct altera_ci_config *config, int ci_nr) |
| 50 | { | 50 | { |
| 51 | printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__); | 51 | pr_warn("%s: driver disabled by Kconfig\n", __func__); |
| 52 | return 0; | 52 | return 0; |
| 53 | } | 53 | } |
| 54 | 54 | ||
| 55 | static inline void altera_ci_release(void *dev, int ci_nr) | 55 | static inline void altera_ci_release(void *dev, int ci_nr) |
| 56 | { | 56 | { |
| 57 | printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__); | 57 | pr_warn("%s: driver disabled by Kconfig\n", __func__); |
| 58 | } | 58 | } |
| 59 | 59 | ||
| 60 | static inline int altera_ci_irq(void *dev) | 60 | static inline int altera_ci_irq(void *dev) |
| 61 | { | 61 | { |
| 62 | printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__); | 62 | pr_warn("%s: driver disabled by Kconfig\n", __func__); |
| 63 | return 0; | 63 | return 0; |
| 64 | } | 64 | } |
| 65 | 65 | ||
| 66 | static inline int altera_ci_tuner_reset(void *dev, int ci_nr) | 66 | static inline int altera_ci_tuner_reset(void *dev, int ci_nr) |
| 67 | { | 67 | { |
| 68 | printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__); | 68 | pr_warn("%s: driver disabled by Kconfig\n", __func__); |
| 69 | return 0; | 69 | return 0; |
| 70 | } | 70 | } |
| 71 | 71 | ||
| @@ -74,19 +74,19 @@ static inline int altera_ci_tuner_reset(void *dev, int ci_nr) | |||
| 74 | static inline int altera_hw_filt_init(struct altera_ci_config *config, | 74 | static inline int altera_hw_filt_init(struct altera_ci_config *config, |
| 75 | int hw_filt_nr) | 75 | int hw_filt_nr) |
| 76 | { | 76 | { |
| 77 | printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__); | 77 | pr_warn("%s: driver disabled by Kconfig\n", __func__); |
| 78 | return 0; | 78 | return 0; |
| 79 | } | 79 | } |
| 80 | 80 | ||
| 81 | static inline void altera_hw_filt_release(void *dev, int filt_nr) | 81 | static inline void altera_hw_filt_release(void *dev, int filt_nr) |
| 82 | { | 82 | { |
| 83 | printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__); | 83 | pr_warn("%s: driver disabled by Kconfig\n", __func__); |
| 84 | } | 84 | } |
| 85 | 85 | ||
| 86 | static inline int altera_pid_feed_control(void *dev, int filt_nr, | 86 | static inline int altera_pid_feed_control(void *dev, int filt_nr, |
| 87 | struct dvb_demux_feed *dvbdmxfeed, int onoff) | 87 | struct dvb_demux_feed *dvbdmxfeed, int onoff) |
| 88 | { | 88 | { |
| 89 | printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__); | 89 | pr_warn("%s: driver disabled by Kconfig\n", __func__); |
| 90 | return 0; | 90 | return 0; |
| 91 | } | 91 | } |
| 92 | 92 | ||
diff --git a/drivers/media/pci/cx23885/cimax2.c b/drivers/media/pci/cx23885/cimax2.c index d644c65622e2..5e8e134d81c2 100644 --- a/drivers/media/pci/cx23885/cimax2.c +++ b/drivers/media/pci/cx23885/cimax2.c | |||
| @@ -65,10 +65,11 @@ static unsigned int ci_irq_enable; | |||
| 65 | module_param(ci_irq_enable, int, 0644); | 65 | module_param(ci_irq_enable, int, 0644); |
| 66 | MODULE_PARM_DESC(ci_irq_enable, "Enable IRQ from CAM"); | 66 | MODULE_PARM_DESC(ci_irq_enable, "Enable IRQ from CAM"); |
| 67 | 67 | ||
| 68 | #define ci_dbg_print(args...) \ | 68 | #define ci_dbg_print(fmt, args...) \ |
| 69 | do { \ | 69 | do { \ |
| 70 | if (ci_dbg) \ | 70 | if (ci_dbg) \ |
| 71 | printk(KERN_DEBUG args); \ | 71 | printk(KERN_DEBUG pr_fmt("%s: " fmt), \ |
| 72 | __func__, ##args); \ | ||
| 72 | } while (0) | 73 | } while (0) |
| 73 | 74 | ||
| 74 | #define ci_irq_flags() (ci_irq_enable ? NETUP_IRQ_IRQAM : 0) | 75 | #define ci_irq_flags() (ci_irq_enable ? NETUP_IRQ_IRQAM : 0) |
| @@ -135,8 +136,7 @@ static int netup_write_i2c(struct i2c_adapter *i2c_adap, u8 addr, u8 reg, | |||
| 135 | }; | 136 | }; |
| 136 | 137 | ||
| 137 | if (1 + len > sizeof(buffer)) { | 138 | if (1 + len > sizeof(buffer)) { |
| 138 | printk(KERN_WARNING | 139 | pr_warn("%s: i2c wr reg=%04x: len=%d is too big!\n", |
| 139 | "%s: i2c wr reg=%04x: len=%d is too big!\n", | ||
| 140 | KBUILD_MODNAME, reg, len); | 140 | KBUILD_MODNAME, reg, len); |
| 141 | return -EINVAL; | 141 | return -EINVAL; |
| 142 | } | 142 | } |
diff --git a/drivers/media/pci/cx23885/cx23885-417.c b/drivers/media/pci/cx23885/cx23885-417.c index 0c122585a1f0..2ff1d1e274be 100644 --- a/drivers/media/pci/cx23885/cx23885-417.c +++ b/drivers/media/pci/cx23885/cx23885-417.c | |||
| @@ -20,6 +20,9 @@ | |||
| 20 | * GNU General Public License for more details. | 20 | * GNU General Public License for more details. |
| 21 | */ | 21 | */ |
| 22 | 22 | ||
| 23 | #include "cx23885.h" | ||
| 24 | #include "cx23885-ioctl.h" | ||
| 25 | |||
| 23 | #include <linux/module.h> | 26 | #include <linux/module.h> |
| 24 | #include <linux/moduleparam.h> | 27 | #include <linux/moduleparam.h> |
| 25 | #include <linux/init.h> | 28 | #include <linux/init.h> |
| @@ -32,9 +35,6 @@ | |||
| 32 | #include <media/v4l2-ioctl.h> | 35 | #include <media/v4l2-ioctl.h> |
| 33 | #include <media/drv-intf/cx2341x.h> | 36 | #include <media/drv-intf/cx2341x.h> |
| 34 | 37 | ||
| 35 | #include "cx23885.h" | ||
| 36 | #include "cx23885-ioctl.h" | ||
| 37 | |||
| 38 | #define CX23885_FIRM_IMAGE_SIZE 376836 | 38 | #define CX23885_FIRM_IMAGE_SIZE 376836 |
| 39 | #define CX23885_FIRM_IMAGE_NAME "v4l-cx23885-enc.fw" | 39 | #define CX23885_FIRM_IMAGE_NAME "v4l-cx23885-enc.fw" |
| 40 | 40 | ||
| @@ -55,8 +55,8 @@ MODULE_PARM_DESC(v4l_debug, "enable V4L debug messages"); | |||
| 55 | 55 | ||
| 56 | #define dprintk(level, fmt, arg...)\ | 56 | #define dprintk(level, fmt, arg...)\ |
| 57 | do { if (v4l_debug >= level) \ | 57 | do { if (v4l_debug >= level) \ |
| 58 | printk(KERN_DEBUG "%s: " fmt, \ | 58 | printk(KERN_DEBUG pr_fmt("%s: 417:" fmt), \ |
| 59 | (dev) ? dev->name : "cx23885[?]", ## arg); \ | 59 | __func__, ##arg); \ |
| 60 | } while (0) | 60 | } while (0) |
| 61 | 61 | ||
| 62 | static struct cx23885_tvnorm cx23885_tvnorms[] = { | 62 | static struct cx23885_tvnorm cx23885_tvnorms[] = { |
| @@ -769,8 +769,7 @@ static int cx23885_mbox_func(void *priv, | |||
| 769 | without side effects */ | 769 | without side effects */ |
| 770 | mc417_memory_read(dev, dev->cx23417_mailbox - 4, &value); | 770 | mc417_memory_read(dev, dev->cx23417_mailbox - 4, &value); |
| 771 | if (value != 0x12345678) { | 771 | if (value != 0x12345678) { |
| 772 | printk(KERN_ERR | 772 | pr_err("Firmware and/or mailbox pointer not initialized or corrupted, signature = 0x%x, cmd = %s\n", |
| 773 | "Firmware and/or mailbox pointer not initialized or corrupted, signature = 0x%x, cmd = %s\n", | ||
| 774 | value, cmd_to_str(command)); | 773 | value, cmd_to_str(command)); |
| 775 | return -1; | 774 | return -1; |
| 776 | } | 775 | } |
| @@ -780,7 +779,7 @@ static int cx23885_mbox_func(void *priv, | |||
| 780 | */ | 779 | */ |
| 781 | mc417_memory_read(dev, dev->cx23417_mailbox, &flag); | 780 | mc417_memory_read(dev, dev->cx23417_mailbox, &flag); |
| 782 | if (flag) { | 781 | if (flag) { |
| 783 | printk(KERN_ERR "ERROR: Mailbox appears to be in use (%x), cmd = %s\n", | 782 | pr_err("ERROR: Mailbox appears to be in use (%x), cmd = %s\n", |
| 784 | flag, cmd_to_str(command)); | 783 | flag, cmd_to_str(command)); |
| 785 | return -1; | 784 | return -1; |
| 786 | } | 785 | } |
| @@ -810,7 +809,7 @@ static int cx23885_mbox_func(void *priv, | |||
| 810 | if (0 != (flag & 4)) | 809 | if (0 != (flag & 4)) |
| 811 | break; | 810 | break; |
| 812 | if (time_after(jiffies, timeout)) { | 811 | if (time_after(jiffies, timeout)) { |
| 813 | printk(KERN_ERR "ERROR: API Mailbox timeout\n"); | 812 | pr_err("ERROR: API Mailbox timeout\n"); |
| 814 | return -1; | 813 | return -1; |
| 815 | } | 814 | } |
| 816 | udelay(10); | 815 | udelay(10); |
| @@ -887,7 +886,7 @@ static int cx23885_find_mailbox(struct cx23885_dev *dev) | |||
| 887 | return i+1; | 886 | return i+1; |
| 888 | } | 887 | } |
| 889 | } | 888 | } |
| 890 | printk(KERN_ERR "Mailbox signature values not found!\n"); | 889 | pr_err("Mailbox signature values not found!\n"); |
| 891 | return -1; | 890 | return -1; |
| 892 | } | 891 | } |
| 893 | 892 | ||
| @@ -922,7 +921,7 @@ static int cx23885_load_firmware(struct cx23885_dev *dev) | |||
| 922 | IVTV_REG_APU, 0); | 921 | IVTV_REG_APU, 0); |
| 923 | 922 | ||
| 924 | if (retval != 0) { | 923 | if (retval != 0) { |
| 925 | printk(KERN_ERR "%s: Error with mc417_register_write\n", | 924 | pr_err("%s: Error with mc417_register_write\n", |
| 926 | __func__); | 925 | __func__); |
| 927 | return -1; | 926 | return -1; |
| 928 | } | 927 | } |
| @@ -931,23 +930,21 @@ static int cx23885_load_firmware(struct cx23885_dev *dev) | |||
| 931 | &dev->pci->dev); | 930 | &dev->pci->dev); |
| 932 | 931 | ||
| 933 | if (retval != 0) { | 932 | if (retval != 0) { |
| 934 | printk(KERN_ERR | 933 | pr_err("ERROR: Hotplug firmware request failed (%s).\n", |
| 935 | "ERROR: Hotplug firmware request failed (%s).\n", | 934 | CX23885_FIRM_IMAGE_NAME); |
| 936 | CX23885_FIRM_IMAGE_NAME); | 935 | pr_err("Please fix your hotplug setup, the board will not work without firmware loaded!\n"); |
| 937 | printk(KERN_ERR "Please fix your hotplug setup, the board will not work without firmware loaded!\n"); | ||
| 938 | return -1; | 936 | return -1; |
| 939 | } | 937 | } |
| 940 | 938 | ||
| 941 | if (firmware->size != CX23885_FIRM_IMAGE_SIZE) { | 939 | if (firmware->size != CX23885_FIRM_IMAGE_SIZE) { |
| 942 | printk(KERN_ERR "ERROR: Firmware size mismatch (have %zu, expected %d)\n", | 940 | pr_err("ERROR: Firmware size mismatch (have %zu, expected %d)\n", |
| 943 | firmware->size, CX23885_FIRM_IMAGE_SIZE); | 941 | firmware->size, CX23885_FIRM_IMAGE_SIZE); |
| 944 | release_firmware(firmware); | 942 | release_firmware(firmware); |
| 945 | return -1; | 943 | return -1; |
| 946 | } | 944 | } |
| 947 | 945 | ||
| 948 | if (0 != memcmp(firmware->data, magic, 8)) { | 946 | if (0 != memcmp(firmware->data, magic, 8)) { |
| 949 | printk(KERN_ERR | 947 | pr_err("ERROR: Firmware magic mismatch, wrong file?\n"); |
| 950 | "ERROR: Firmware magic mismatch, wrong file?\n"); | ||
| 951 | release_firmware(firmware); | 948 | release_firmware(firmware); |
| 952 | return -1; | 949 | return -1; |
| 953 | } | 950 | } |
| @@ -959,7 +956,7 @@ static int cx23885_load_firmware(struct cx23885_dev *dev) | |||
| 959 | value = *dataptr; | 956 | value = *dataptr; |
| 960 | checksum += ~value; | 957 | checksum += ~value; |
| 961 | if (mc417_memory_write(dev, i, value) != 0) { | 958 | if (mc417_memory_write(dev, i, value) != 0) { |
| 962 | printk(KERN_ERR "ERROR: Loading firmware failed!\n"); | 959 | pr_err("ERROR: Loading firmware failed!\n"); |
| 963 | release_firmware(firmware); | 960 | release_firmware(firmware); |
| 964 | return -1; | 961 | return -1; |
| 965 | } | 962 | } |
| @@ -970,15 +967,14 @@ static int cx23885_load_firmware(struct cx23885_dev *dev) | |||
| 970 | dprintk(1, "Verifying firmware ...\n"); | 967 | dprintk(1, "Verifying firmware ...\n"); |
| 971 | for (i--; i >= 0; i--) { | 968 | for (i--; i >= 0; i--) { |
| 972 | if (mc417_memory_read(dev, i, &value) != 0) { | 969 | if (mc417_memory_read(dev, i, &value) != 0) { |
| 973 | printk(KERN_ERR "ERROR: Reading firmware failed!\n"); | 970 | pr_err("ERROR: Reading firmware failed!\n"); |
| 974 | release_firmware(firmware); | 971 | release_firmware(firmware); |
| 975 | return -1; | 972 | return -1; |
| 976 | } | 973 | } |
| 977 | checksum -= ~value; | 974 | checksum -= ~value; |
| 978 | } | 975 | } |
| 979 | if (checksum) { | 976 | if (checksum) { |
| 980 | printk(KERN_ERR | 977 | pr_err("ERROR: Firmware load failed (checksum mismatch).\n"); |
| 981 | "ERROR: Firmware load failed (checksum mismatch).\n"); | ||
| 982 | release_firmware(firmware); | 978 | release_firmware(firmware); |
| 983 | return -1; | 979 | return -1; |
| 984 | } | 980 | } |
| @@ -1003,7 +999,7 @@ static int cx23885_load_firmware(struct cx23885_dev *dev) | |||
| 1003 | mc417_register_read(dev, 0x900C, &gpio_value); | 999 | mc417_register_read(dev, 0x900C, &gpio_value); |
| 1004 | 1000 | ||
| 1005 | if (retval < 0) | 1001 | if (retval < 0) |
| 1006 | printk(KERN_ERR "%s: Error with mc417_register_write\n", | 1002 | pr_err("%s: Error with mc417_register_write\n", |
| 1007 | __func__); | 1003 | __func__); |
| 1008 | return 0; | 1004 | return 0; |
| 1009 | } | 1005 | } |
| @@ -1055,26 +1051,25 @@ static int cx23885_initialize_codec(struct cx23885_dev *dev, int startencoder) | |||
| 1055 | dprintk(2, "%s() PING OK\n", __func__); | 1051 | dprintk(2, "%s() PING OK\n", __func__); |
| 1056 | retval = cx23885_load_firmware(dev); | 1052 | retval = cx23885_load_firmware(dev); |
| 1057 | if (retval < 0) { | 1053 | if (retval < 0) { |
| 1058 | printk(KERN_ERR "%s() f/w load failed\n", __func__); | 1054 | pr_err("%s() f/w load failed\n", __func__); |
| 1059 | return retval; | 1055 | return retval; |
| 1060 | } | 1056 | } |
| 1061 | retval = cx23885_find_mailbox(dev); | 1057 | retval = cx23885_find_mailbox(dev); |
| 1062 | if (retval < 0) { | 1058 | if (retval < 0) { |
| 1063 | printk(KERN_ERR "%s() mailbox < 0, error\n", | 1059 | pr_err("%s() mailbox < 0, error\n", |
| 1064 | __func__); | 1060 | __func__); |
| 1065 | return -1; | 1061 | return -1; |
| 1066 | } | 1062 | } |
| 1067 | dev->cx23417_mailbox = retval; | 1063 | dev->cx23417_mailbox = retval; |
| 1068 | retval = cx23885_api_cmd(dev, CX2341X_ENC_PING_FW, 0, 0); | 1064 | retval = cx23885_api_cmd(dev, CX2341X_ENC_PING_FW, 0, 0); |
| 1069 | if (retval < 0) { | 1065 | if (retval < 0) { |
| 1070 | printk(KERN_ERR | 1066 | pr_err("ERROR: cx23417 firmware ping failed!\n"); |
| 1071 | "ERROR: cx23417 firmware ping failed!\n"); | ||
| 1072 | return -1; | 1067 | return -1; |
| 1073 | } | 1068 | } |
| 1074 | retval = cx23885_api_cmd(dev, CX2341X_ENC_GET_VERSION, 0, 1, | 1069 | retval = cx23885_api_cmd(dev, CX2341X_ENC_GET_VERSION, 0, 1, |
| 1075 | &version); | 1070 | &version); |
| 1076 | if (retval < 0) { | 1071 | if (retval < 0) { |
| 1077 | printk(KERN_ERR "ERROR: cx23417 firmware get encoder :version failed!\n"); | 1072 | pr_err("ERROR: cx23417 firmware get encoder :version failed!\n"); |
| 1078 | return -1; | 1073 | return -1; |
| 1079 | } | 1074 | } |
| 1080 | dprintk(1, "cx23417 firmware version is 0x%08x\n", version); | 1075 | dprintk(1, "cx23417 firmware version is 0x%08x\n", version); |
| @@ -1559,11 +1554,11 @@ int cx23885_417_register(struct cx23885_dev *dev) | |||
| 1559 | err = video_register_device(dev->v4l_device, | 1554 | err = video_register_device(dev->v4l_device, |
| 1560 | VFL_TYPE_GRABBER, -1); | 1555 | VFL_TYPE_GRABBER, -1); |
| 1561 | if (err < 0) { | 1556 | if (err < 0) { |
| 1562 | printk(KERN_INFO "%s: can't register mpeg device\n", dev->name); | 1557 | pr_info("%s: can't register mpeg device\n", dev->name); |
| 1563 | return err; | 1558 | return err; |
| 1564 | } | 1559 | } |
| 1565 | 1560 | ||
| 1566 | printk(KERN_INFO "%s: registered device %s [mpeg]\n", | 1561 | pr_info("%s: registered device %s [mpeg]\n", |
| 1567 | dev->name, video_device_node_name(dev->v4l_device)); | 1562 | dev->name, video_device_node_name(dev->v4l_device)); |
| 1568 | 1563 | ||
| 1569 | /* ST: Configure the encoder paramaters, but don't begin | 1564 | /* ST: Configure the encoder paramaters, but don't begin |
diff --git a/drivers/media/pci/cx23885/cx23885-alsa.c b/drivers/media/pci/cx23885/cx23885-alsa.c index 9d2a4e2dc54f..c148f9a4a9ac 100644 --- a/drivers/media/pci/cx23885/cx23885-alsa.c +++ b/drivers/media/pci/cx23885/cx23885-alsa.c | |||
| @@ -17,6 +17,9 @@ | |||
| 17 | * GNU General Public License for more details. | 17 | * GNU General Public License for more details. |
| 18 | */ | 18 | */ |
| 19 | 19 | ||
| 20 | #include "cx23885.h" | ||
| 21 | #include "cx23885-reg.h" | ||
| 22 | |||
| 20 | #include <linux/module.h> | 23 | #include <linux/module.h> |
| 21 | #include <linux/init.h> | 24 | #include <linux/init.h> |
| 22 | #include <linux/device.h> | 25 | #include <linux/device.h> |
| @@ -35,20 +38,14 @@ | |||
| 35 | 38 | ||
| 36 | #include <sound/tlv.h> | 39 | #include <sound/tlv.h> |
| 37 | 40 | ||
| 38 | |||
| 39 | #include "cx23885.h" | ||
| 40 | #include "cx23885-reg.h" | ||
| 41 | |||
| 42 | #define AUDIO_SRAM_CHANNEL SRAM_CH07 | 41 | #define AUDIO_SRAM_CHANNEL SRAM_CH07 |
| 43 | 42 | ||
| 44 | #define dprintk(level, fmt, arg...) do { \ | 43 | #define dprintk(level, fmt, arg...) do { \ |
| 45 | if (audio_debug + 1 > level) \ | 44 | if (audio_debug + 1 > level) \ |
| 46 | printk(KERN_INFO "%s: " fmt, chip->dev->name , ## arg); \ | 45 | printk(KERN_DEBUG pr_fmt("%s: alsa: " fmt), \ |
| 46 | chip->dev->name, ##arg); \ | ||
| 47 | } while(0) | 47 | } while(0) |
| 48 | 48 | ||
| 49 | #define dprintk_core(level, fmt, arg...) if (audio_debug >= level) \ | ||
| 50 | printk(KERN_DEBUG "%s: " fmt, chip->dev->name , ## arg) | ||
| 51 | |||
| 52 | /**************************************************************************** | 49 | /**************************************************************************** |
| 53 | Module global static vars | 50 | Module global static vars |
| 54 | ****************************************************************************/ | 51 | ****************************************************************************/ |
| @@ -247,7 +244,7 @@ int cx23885_audio_irq(struct cx23885_dev *dev, u32 status, u32 mask) | |||
| 247 | 244 | ||
| 248 | /* risc op code error */ | 245 | /* risc op code error */ |
| 249 | if (status & AUD_INT_OPC_ERR) { | 246 | if (status & AUD_INT_OPC_ERR) { |
| 250 | printk(KERN_WARNING "%s/1: Audio risc op code error\n", | 247 | pr_warn("%s/1: Audio risc op code error\n", |
| 251 | dev->name); | 248 | dev->name); |
| 252 | cx_clear(AUD_INT_DMA_CTL, 0x11); | 249 | cx_clear(AUD_INT_DMA_CTL, 0x11); |
| 253 | cx23885_sram_channel_dump(dev, | 250 | cx23885_sram_channel_dump(dev, |
| @@ -327,7 +324,7 @@ static int snd_cx23885_pcm_open(struct snd_pcm_substream *substream) | |||
| 327 | int err; | 324 | int err; |
| 328 | 325 | ||
| 329 | if (!chip) { | 326 | if (!chip) { |
| 330 | printk(KERN_ERR "BUG: cx23885 can't find device struct. Can't proceed with open\n"); | 327 | pr_err("BUG: cx23885 can't find device struct. Can't proceed with open\n"); |
| 331 | return -ENODEV; | 328 | return -ENODEV; |
| 332 | } | 329 | } |
| 333 | 330 | ||
| @@ -554,7 +551,7 @@ struct cx23885_audio_dev *cx23885_audio_register(struct cx23885_dev *dev) | |||
| 554 | return NULL; | 551 | return NULL; |
| 555 | 552 | ||
| 556 | if (dev->sram_channels[AUDIO_SRAM_CHANNEL].cmds_start == 0) { | 553 | if (dev->sram_channels[AUDIO_SRAM_CHANNEL].cmds_start == 0) { |
| 557 | printk(KERN_WARNING "%s(): Missing SRAM channel configuration for analog TV Audio\n", | 554 | pr_warn("%s(): Missing SRAM channel configuration for analog TV Audio\n", |
| 558 | __func__); | 555 | __func__); |
| 559 | return NULL; | 556 | return NULL; |
| 560 | } | 557 | } |
| @@ -589,7 +586,7 @@ struct cx23885_audio_dev *cx23885_audio_register(struct cx23885_dev *dev) | |||
| 589 | 586 | ||
| 590 | error: | 587 | error: |
| 591 | snd_card_free(card); | 588 | snd_card_free(card); |
| 592 | printk(KERN_ERR "%s(): Failed to register analog audio adapter\n", | 589 | pr_err("%s(): Failed to register analog audio adapter\n", |
| 593 | __func__); | 590 | __func__); |
| 594 | 591 | ||
| 595 | return NULL; | 592 | return NULL; |
diff --git a/drivers/media/pci/cx23885/cx23885-cards.c b/drivers/media/pci/cx23885/cx23885-cards.c index e2c4edbfbdb7..0350f13c5a9f 100644 --- a/drivers/media/pci/cx23885/cx23885-cards.c +++ b/drivers/media/pci/cx23885/cx23885-cards.c | |||
| @@ -15,6 +15,8 @@ | |||
| 15 | * GNU General Public License for more details. | 15 | * GNU General Public License for more details. |
| 16 | */ | 16 | */ |
| 17 | 17 | ||
| 18 | #include "cx23885.h" | ||
| 19 | |||
| 18 | #include <linux/init.h> | 20 | #include <linux/init.h> |
| 19 | #include <linux/module.h> | 21 | #include <linux/module.h> |
| 20 | #include <linux/pci.h> | 22 | #include <linux/pci.h> |
| @@ -23,7 +25,6 @@ | |||
| 23 | #include <linux/firmware.h> | 25 | #include <linux/firmware.h> |
| 24 | #include <misc/altera.h> | 26 | #include <misc/altera.h> |
| 25 | 27 | ||
| 26 | #include "cx23885.h" | ||
| 27 | #include "tuner-xc2028.h" | 28 | #include "tuner-xc2028.h" |
| 28 | #include "netup-eeprom.h" | 29 | #include "netup-eeprom.h" |
| 29 | #include "netup-init.h" | 30 | #include "netup-init.h" |
| @@ -1096,26 +1097,24 @@ void cx23885_card_list(struct cx23885_dev *dev) | |||
| 1096 | 1097 | ||
| 1097 | if (0 == dev->pci->subsystem_vendor && | 1098 | if (0 == dev->pci->subsystem_vendor && |
| 1098 | 0 == dev->pci->subsystem_device) { | 1099 | 0 == dev->pci->subsystem_device) { |
| 1099 | printk(KERN_INFO | 1100 | pr_info("%s: Board has no valid PCIe Subsystem ID and can't\n" |
| 1100 | "%s: Board has no valid PCIe Subsystem ID and can't\n" | 1101 | "%s: be autodetected. Pass card=<n> insmod option\n" |
| 1101 | "%s: be autodetected. Pass card=<n> insmod option\n" | 1102 | "%s: to workaround that. Redirect complaints to the\n" |
| 1102 | "%s: to workaround that. Redirect complaints to the\n" | 1103 | "%s: vendor of the TV card. Best regards,\n" |
| 1103 | "%s: vendor of the TV card. Best regards,\n" | 1104 | "%s: -- tux\n", |
| 1104 | "%s: -- tux\n", | 1105 | dev->name, dev->name, dev->name, dev->name, dev->name); |
| 1105 | dev->name, dev->name, dev->name, dev->name, dev->name); | ||
| 1106 | } else { | 1106 | } else { |
| 1107 | printk(KERN_INFO | 1107 | pr_info("%s: Your board isn't known (yet) to the driver.\n" |
| 1108 | "%s: Your board isn't known (yet) to the driver.\n" | 1108 | "%s: Try to pick one of the existing card configs via\n" |
| 1109 | "%s: Try to pick one of the existing card configs via\n" | 1109 | "%s: card=<n> insmod option. Updating to the latest\n" |
| 1110 | "%s: card=<n> insmod option. Updating to the latest\n" | 1110 | "%s: version might help as well.\n", |
| 1111 | "%s: version might help as well.\n", | 1111 | dev->name, dev->name, dev->name, dev->name); |
| 1112 | dev->name, dev->name, dev->name, dev->name); | ||
| 1113 | } | 1112 | } |
| 1114 | printk(KERN_INFO "%s: Here is a list of valid choices for the card=<n> insmod option:\n", | 1113 | pr_info("%s: Here is a list of valid choices for the card=<n> insmod option:\n", |
| 1115 | dev->name); | 1114 | dev->name); |
| 1116 | for (i = 0; i < cx23885_bcount; i++) | 1115 | for (i = 0; i < cx23885_bcount; i++) |
| 1117 | printk(KERN_INFO "%s: card=%d -> %s\n", | 1116 | pr_info("%s: card=%d -> %s\n", |
| 1118 | dev->name, i, cx23885_boards[i].name); | 1117 | dev->name, i, cx23885_boards[i].name); |
| 1119 | } | 1118 | } |
| 1120 | 1119 | ||
| 1121 | static void viewcast_eeprom(struct cx23885_dev *dev, u8 *eeprom_data) | 1120 | static void viewcast_eeprom(struct cx23885_dev *dev, u8 *eeprom_data) |
| @@ -1304,13 +1303,13 @@ static void hauppauge_eeprom(struct cx23885_dev *dev, u8 *eeprom_data) | |||
| 1304 | */ | 1303 | */ |
| 1305 | break; | 1304 | break; |
| 1306 | default: | 1305 | default: |
| 1307 | printk(KERN_WARNING "%s: warning: unknown hauppauge model #%d\n", | 1306 | pr_warn("%s: warning: unknown hauppauge model #%d\n", |
| 1308 | dev->name, tv.model); | 1307 | dev->name, tv.model); |
| 1309 | break; | 1308 | break; |
| 1310 | } | 1309 | } |
| 1311 | 1310 | ||
| 1312 | printk(KERN_INFO "%s: hauppauge eeprom: model=%d\n", | 1311 | pr_info("%s: hauppauge eeprom: model=%d\n", |
| 1313 | dev->name, tv.model); | 1312 | dev->name, tv.model); |
| 1314 | } | 1313 | } |
| 1315 | 1314 | ||
| 1316 | /* Some TBS cards require initing a chip using a bitbanged SPI attached | 1315 | /* Some TBS cards require initing a chip using a bitbanged SPI attached |
| @@ -1352,8 +1351,8 @@ int cx23885_tuner_callback(void *priv, int component, int command, int arg) | |||
| 1352 | return 0; | 1351 | return 0; |
| 1353 | 1352 | ||
| 1354 | if (command != 0) { | 1353 | if (command != 0) { |
| 1355 | printk(KERN_ERR "%s(): Unknown command 0x%x.\n", | 1354 | pr_err("%s(): Unknown command 0x%x.\n", |
| 1356 | __func__, command); | 1355 | __func__, command); |
| 1357 | return -EINVAL; | 1356 | return -EINVAL; |
| 1358 | } | 1357 | } |
| 1359 | 1358 | ||
| @@ -2336,12 +2335,12 @@ void cx23885_card_setup(struct cx23885_dev *dev) | |||
| 2336 | filename = "dvb-netup-altera-01.fw"; | 2335 | filename = "dvb-netup-altera-01.fw"; |
| 2337 | break; | 2336 | break; |
| 2338 | } | 2337 | } |
| 2339 | printk(KERN_INFO "NetUP card rev=0x%x fw_filename=%s\n", | 2338 | pr_info("NetUP card rev=0x%x fw_filename=%s\n", |
| 2340 | cinfo.rev, filename); | 2339 | cinfo.rev, filename); |
| 2341 | 2340 | ||
| 2342 | ret = request_firmware(&fw, filename, &dev->pci->dev); | 2341 | ret = request_firmware(&fw, filename, &dev->pci->dev); |
| 2343 | if (ret != 0) | 2342 | if (ret != 0) |
| 2344 | printk(KERN_ERR "did not find the firmware file. (%s) Please see linux/Documentation/dvb/ for more details on firmware-problems.", | 2343 | pr_err("did not find the firmware file. (%s) Please see linux/Documentation/dvb/ for more details on firmware-problems.", |
| 2345 | filename); | 2344 | filename); |
| 2346 | else | 2345 | else |
| 2347 | altera_init(&netup_config, fw); | 2346 | altera_init(&netup_config, fw); |
diff --git a/drivers/media/pci/cx23885/cx23885-core.c b/drivers/media/pci/cx23885/cx23885-core.c index 0d97da3be90b..02b5ec549369 100644 --- a/drivers/media/pci/cx23885/cx23885-core.c +++ b/drivers/media/pci/cx23885/cx23885-core.c | |||
| @@ -15,6 +15,8 @@ | |||
| 15 | * GNU General Public License for more details. | 15 | * GNU General Public License for more details. |
| 16 | */ | 16 | */ |
| 17 | 17 | ||
| 18 | #include "cx23885.h" | ||
| 19 | |||
| 18 | #include <linux/init.h> | 20 | #include <linux/init.h> |
| 19 | #include <linux/list.h> | 21 | #include <linux/list.h> |
| 20 | #include <linux/module.h> | 22 | #include <linux/module.h> |
| @@ -27,7 +29,6 @@ | |||
| 27 | #include <asm/div64.h> | 29 | #include <asm/div64.h> |
| 28 | #include <linux/firmware.h> | 30 | #include <linux/firmware.h> |
| 29 | 31 | ||
| 30 | #include "cx23885.h" | ||
| 31 | #include "cimax2.h" | 32 | #include "cimax2.h" |
| 32 | #include "altera-ci.h" | 33 | #include "altera-ci.h" |
| 33 | #include "cx23888-ir.h" | 34 | #include "cx23888-ir.h" |
| @@ -50,7 +51,8 @@ MODULE_PARM_DESC(card, "card type"); | |||
| 50 | 51 | ||
| 51 | #define dprintk(level, fmt, arg...)\ | 52 | #define dprintk(level, fmt, arg...)\ |
| 52 | do { if (debug >= level)\ | 53 | do { if (debug >= level)\ |
| 53 | printk(KERN_DEBUG "%s: " fmt, dev->name, ## arg);\ | 54 | printk(KERN_DEBUG pr_fmt("%s: " fmt), \ |
| 55 | __func__, ##arg); \ | ||
| 54 | } while (0) | 56 | } while (0) |
| 55 | 57 | ||
| 56 | static unsigned int cx23885_devcount; | 58 | static unsigned int cx23885_devcount; |
| @@ -411,15 +413,14 @@ static int cx23885_risc_decode(u32 risc) | |||
| 411 | instr[risc >> 28] ? instr[risc >> 28] : "INVALID"); | 413 | instr[risc >> 28] ? instr[risc >> 28] : "INVALID"); |
| 412 | for (i = ARRAY_SIZE(bits) - 1; i >= 0; i--) | 414 | for (i = ARRAY_SIZE(bits) - 1; i >= 0; i--) |
| 413 | if (risc & (1 << (i + 12))) | 415 | if (risc & (1 << (i + 12))) |
| 414 | printk(KERN_CONT " %s", bits[i]); | 416 | pr_cont(" %s", bits[i]); |
| 415 | printk(KERN_CONT " count=%d ]\n", risc & 0xfff); | 417 | pr_cont(" count=%d ]\n", risc & 0xfff); |
| 416 | return incr[risc >> 28] ? incr[risc >> 28] : 1; | 418 | return incr[risc >> 28] ? incr[risc >> 28] : 1; |
| 417 | } | 419 | } |
| 418 | 420 | ||
| 419 | static void cx23885_wakeup(struct cx23885_tsport *port, | 421 | static void cx23885_wakeup(struct cx23885_tsport *port, |
| 420 | struct cx23885_dmaqueue *q, u32 count) | 422 | struct cx23885_dmaqueue *q, u32 count) |
| 421 | { | 423 | { |
| 422 | struct cx23885_dev *dev = port->dev; | ||
| 423 | struct cx23885_buffer *buf; | 424 | struct cx23885_buffer *buf; |
| 424 | 425 | ||
| 425 | if (list_empty(&q->active)) | 426 | if (list_empty(&q->active)) |
| @@ -530,44 +531,44 @@ void cx23885_sram_channel_dump(struct cx23885_dev *dev, | |||
| 530 | u32 risc; | 531 | u32 risc; |
| 531 | unsigned int i, j, n; | 532 | unsigned int i, j, n; |
| 532 | 533 | ||
| 533 | printk(KERN_WARNING "%s: %s - dma channel status dump\n", | 534 | pr_warn("%s: %s - dma channel status dump\n", |
| 534 | dev->name, ch->name); | 535 | dev->name, ch->name); |
| 535 | for (i = 0; i < ARRAY_SIZE(name); i++) | 536 | for (i = 0; i < ARRAY_SIZE(name); i++) |
| 536 | printk(KERN_WARNING "%s: cmds: %-15s: 0x%08x\n", | 537 | pr_warn("%s: cmds: %-15s: 0x%08x\n", |
| 537 | dev->name, name[i], | 538 | dev->name, name[i], |
| 538 | cx_read(ch->cmds_start + 4*i)); | 539 | cx_read(ch->cmds_start + 4*i)); |
| 539 | 540 | ||
| 540 | for (i = 0; i < 4; i++) { | 541 | for (i = 0; i < 4; i++) { |
| 541 | risc = cx_read(ch->cmds_start + 4 * (i + 14)); | 542 | risc = cx_read(ch->cmds_start + 4 * (i + 14)); |
| 542 | printk(KERN_WARNING "%s: risc%d: ", dev->name, i); | 543 | pr_warn("%s: risc%d: ", dev->name, i); |
| 543 | cx23885_risc_decode(risc); | 544 | cx23885_risc_decode(risc); |
| 544 | } | 545 | } |
| 545 | for (i = 0; i < (64 >> 2); i += n) { | 546 | for (i = 0; i < (64 >> 2); i += n) { |
| 546 | risc = cx_read(ch->ctrl_start + 4 * i); | 547 | risc = cx_read(ch->ctrl_start + 4 * i); |
| 547 | /* No consideration for bits 63-32 */ | 548 | /* No consideration for bits 63-32 */ |
| 548 | 549 | ||
| 549 | printk(KERN_WARNING "%s: (0x%08x) iq %x: ", dev->name, | 550 | pr_warn("%s: (0x%08x) iq %x: ", dev->name, |
| 550 | ch->ctrl_start + 4 * i, i); | 551 | ch->ctrl_start + 4 * i, i); |
| 551 | n = cx23885_risc_decode(risc); | 552 | n = cx23885_risc_decode(risc); |
| 552 | for (j = 1; j < n; j++) { | 553 | for (j = 1; j < n; j++) { |
| 553 | risc = cx_read(ch->ctrl_start + 4 * (i + j)); | 554 | risc = cx_read(ch->ctrl_start + 4 * (i + j)); |
| 554 | printk(KERN_WARNING "%s: iq %x: 0x%08x [ arg #%d ]\n", | 555 | pr_warn("%s: iq %x: 0x%08x [ arg #%d ]\n", |
| 555 | dev->name, i+j, risc, j); | 556 | dev->name, i+j, risc, j); |
| 556 | } | 557 | } |
| 557 | } | 558 | } |
| 558 | 559 | ||
| 559 | printk(KERN_WARNING "%s: fifo: 0x%08x -> 0x%x\n", | 560 | pr_warn("%s: fifo: 0x%08x -> 0x%x\n", |
| 560 | dev->name, ch->fifo_start, ch->fifo_start+ch->fifo_size); | 561 | dev->name, ch->fifo_start, ch->fifo_start+ch->fifo_size); |
| 561 | printk(KERN_WARNING "%s: ctrl: 0x%08x -> 0x%x\n", | 562 | pr_warn("%s: ctrl: 0x%08x -> 0x%x\n", |
| 562 | dev->name, ch->ctrl_start, ch->ctrl_start + 6*16); | 563 | dev->name, ch->ctrl_start, ch->ctrl_start + 6*16); |
| 563 | printk(KERN_WARNING "%s: ptr1_reg: 0x%08x\n", | 564 | pr_warn("%s: ptr1_reg: 0x%08x\n", |
| 564 | dev->name, cx_read(ch->ptr1_reg)); | 565 | dev->name, cx_read(ch->ptr1_reg)); |
| 565 | printk(KERN_WARNING "%s: ptr2_reg: 0x%08x\n", | 566 | pr_warn("%s: ptr2_reg: 0x%08x\n", |
| 566 | dev->name, cx_read(ch->ptr2_reg)); | 567 | dev->name, cx_read(ch->ptr2_reg)); |
| 567 | printk(KERN_WARNING "%s: cnt1_reg: 0x%08x\n", | 568 | pr_warn("%s: cnt1_reg: 0x%08x\n", |
| 568 | dev->name, cx_read(ch->cnt1_reg)); | 569 | dev->name, cx_read(ch->cnt1_reg)); |
| 569 | printk(KERN_WARNING "%s: cnt2_reg: 0x%08x\n", | 570 | pr_warn("%s: cnt2_reg: 0x%08x\n", |
| 570 | dev->name, cx_read(ch->cnt2_reg)); | 571 | dev->name, cx_read(ch->cnt2_reg)); |
| 571 | } | 572 | } |
| 572 | 573 | ||
| 573 | static void cx23885_risc_disasm(struct cx23885_tsport *port, | 574 | static void cx23885_risc_disasm(struct cx23885_tsport *port, |
| @@ -576,14 +577,14 @@ static void cx23885_risc_disasm(struct cx23885_tsport *port, | |||
| 576 | struct cx23885_dev *dev = port->dev; | 577 | struct cx23885_dev *dev = port->dev; |
| 577 | unsigned int i, j, n; | 578 | unsigned int i, j, n; |
| 578 | 579 | ||
| 579 | printk(KERN_INFO "%s: risc disasm: %p [dma=0x%08lx]\n", | 580 | pr_info("%s: risc disasm: %p [dma=0x%08lx]\n", |
| 580 | dev->name, risc->cpu, (unsigned long)risc->dma); | 581 | dev->name, risc->cpu, (unsigned long)risc->dma); |
| 581 | for (i = 0; i < (risc->size >> 2); i += n) { | 582 | for (i = 0; i < (risc->size >> 2); i += n) { |
| 582 | printk(KERN_INFO "%s: %04d: ", dev->name, i); | 583 | pr_info("%s: %04d: ", dev->name, i); |
| 583 | n = cx23885_risc_decode(le32_to_cpu(risc->cpu[i])); | 584 | n = cx23885_risc_decode(le32_to_cpu(risc->cpu[i])); |
| 584 | for (j = 1; j < n; j++) | 585 | for (j = 1; j < n; j++) |
| 585 | printk(KERN_INFO "%s: %04d: 0x%08x [ arg #%d ]\n", | 586 | pr_info("%s: %04d: 0x%08x [ arg #%d ]\n", |
| 586 | dev->name, i + j, risc->cpu[i + j], j); | 587 | dev->name, i + j, risc->cpu[i + j], j); |
| 587 | if (risc->cpu[i] == cpu_to_le32(RISC_JUMP)) | 588 | if (risc->cpu[i] == cpu_to_le32(RISC_JUMP)) |
| 588 | break; | 589 | break; |
| 589 | } | 590 | } |
| @@ -674,8 +675,8 @@ static int get_resources(struct cx23885_dev *dev) | |||
| 674 | dev->name)) | 675 | dev->name)) |
| 675 | return 0; | 676 | return 0; |
| 676 | 677 | ||
| 677 | printk(KERN_ERR "%s: can't get MMIO memory @ 0x%llx\n", | 678 | pr_err("%s: can't get MMIO memory @ 0x%llx\n", |
| 678 | dev->name, (unsigned long long)pci_resource_start(dev->pci, 0)); | 679 | dev->name, (unsigned long long)pci_resource_start(dev->pci, 0)); |
| 679 | 680 | ||
| 680 | return -EBUSY; | 681 | return -EBUSY; |
| 681 | } | 682 | } |
| @@ -793,15 +794,15 @@ static void cx23885_dev_checkrevision(struct cx23885_dev *dev) | |||
| 793 | dev->hwrevision = 0xb1; | 794 | dev->hwrevision = 0xb1; |
| 794 | break; | 795 | break; |
| 795 | default: | 796 | default: |
| 796 | printk(KERN_ERR "%s() New hardware revision found 0x%x\n", | 797 | pr_err("%s() New hardware revision found 0x%x\n", |
| 797 | __func__, dev->hwrevision); | 798 | __func__, dev->hwrevision); |
| 798 | } | 799 | } |
| 799 | if (dev->hwrevision) | 800 | if (dev->hwrevision) |
| 800 | printk(KERN_INFO "%s() Hardware revision = 0x%02x\n", | 801 | pr_info("%s() Hardware revision = 0x%02x\n", |
| 801 | __func__, dev->hwrevision); | 802 | __func__, dev->hwrevision); |
| 802 | else | 803 | else |
| 803 | printk(KERN_ERR "%s() Hardware revision unknown 0x%x\n", | 804 | pr_err("%s() Hardware revision unknown 0x%x\n", |
| 804 | __func__, dev->hwrevision); | 805 | __func__, dev->hwrevision); |
| 805 | } | 806 | } |
| 806 | 807 | ||
| 807 | /* Find the first v4l2_subdev member of the group id in hw */ | 808 | /* Find the first v4l2_subdev member of the group id in hw */ |
| @@ -915,7 +916,7 @@ static int cx23885_dev_setup(struct cx23885_dev *dev) | |||
| 915 | cx23885_init_tsport(dev, &dev->ts2, 2); | 916 | cx23885_init_tsport(dev, &dev->ts2, 2); |
| 916 | 917 | ||
| 917 | if (get_resources(dev) < 0) { | 918 | if (get_resources(dev) < 0) { |
| 918 | printk(KERN_ERR "CORE %s No more PCIe resources for subsystem: %04x:%04x\n", | 919 | pr_err("CORE %s No more PCIe resources for subsystem: %04x:%04x\n", |
| 919 | dev->name, dev->pci->subsystem_vendor, | 920 | dev->name, dev->pci->subsystem_vendor, |
| 920 | dev->pci->subsystem_device); | 921 | dev->pci->subsystem_device); |
| 921 | 922 | ||
| @@ -929,11 +930,11 @@ static int cx23885_dev_setup(struct cx23885_dev *dev) | |||
| 929 | 930 | ||
| 930 | dev->bmmio = (u8 __iomem *)dev->lmmio; | 931 | dev->bmmio = (u8 __iomem *)dev->lmmio; |
| 931 | 932 | ||
| 932 | printk(KERN_INFO "CORE %s: subsystem: %04x:%04x, board: %s [card=%d,%s]\n", | 933 | pr_info("CORE %s: subsystem: %04x:%04x, board: %s [card=%d,%s]\n", |
| 933 | dev->name, dev->pci->subsystem_vendor, | 934 | dev->name, dev->pci->subsystem_vendor, |
| 934 | dev->pci->subsystem_device, cx23885_boards[dev->board].name, | 935 | dev->pci->subsystem_device, cx23885_boards[dev->board].name, |
| 935 | dev->board, card[dev->nr] == dev->board ? | 936 | dev->board, card[dev->nr] == dev->board ? |
| 936 | "insmod option" : "autodetected"); | 937 | "insmod option" : "autodetected"); |
| 937 | 938 | ||
| 938 | cx23885_pci_quirks(dev); | 939 | cx23885_pci_quirks(dev); |
| 939 | 940 | ||
| @@ -979,7 +980,7 @@ static int cx23885_dev_setup(struct cx23885_dev *dev) | |||
| 979 | 980 | ||
| 980 | if (cx23885_boards[dev->board].porta == CX23885_ANALOG_VIDEO) { | 981 | if (cx23885_boards[dev->board].porta == CX23885_ANALOG_VIDEO) { |
| 981 | if (cx23885_video_register(dev) < 0) { | 982 | if (cx23885_video_register(dev) < 0) { |
| 982 | printk(KERN_ERR "%s() Failed to register analog video adapters on VID_A\n", | 983 | pr_err("%s() Failed to register analog video adapters on VID_A\n", |
| 983 | __func__); | 984 | __func__); |
| 984 | } | 985 | } |
| 985 | } | 986 | } |
| @@ -989,14 +990,13 @@ static int cx23885_dev_setup(struct cx23885_dev *dev) | |||
| 989 | dev->ts1.num_frontends = | 990 | dev->ts1.num_frontends = |
| 990 | cx23885_boards[dev->board].num_fds_portb; | 991 | cx23885_boards[dev->board].num_fds_portb; |
| 991 | if (cx23885_dvb_register(&dev->ts1) < 0) { | 992 | if (cx23885_dvb_register(&dev->ts1) < 0) { |
| 992 | printk(KERN_ERR "%s() Failed to register dvb adapters on VID_B\n", | 993 | pr_err("%s() Failed to register dvb adapters on VID_B\n", |
| 993 | __func__); | 994 | __func__); |
| 994 | } | 995 | } |
| 995 | } else | 996 | } else |
| 996 | if (cx23885_boards[dev->board].portb == CX23885_MPEG_ENCODER) { | 997 | if (cx23885_boards[dev->board].portb == CX23885_MPEG_ENCODER) { |
| 997 | if (cx23885_417_register(dev) < 0) { | 998 | if (cx23885_417_register(dev) < 0) { |
| 998 | printk(KERN_ERR | 999 | pr_err("%s() Failed to register 417 on VID_B\n", |
| 999 | "%s() Failed to register 417 on VID_B\n", | ||
| 1000 | __func__); | 1000 | __func__); |
| 1001 | } | 1001 | } |
| 1002 | } | 1002 | } |
| @@ -1006,15 +1006,13 @@ static int cx23885_dev_setup(struct cx23885_dev *dev) | |||
| 1006 | dev->ts2.num_frontends = | 1006 | dev->ts2.num_frontends = |
| 1007 | cx23885_boards[dev->board].num_fds_portc; | 1007 | cx23885_boards[dev->board].num_fds_portc; |
| 1008 | if (cx23885_dvb_register(&dev->ts2) < 0) { | 1008 | if (cx23885_dvb_register(&dev->ts2) < 0) { |
| 1009 | printk(KERN_ERR | 1009 | pr_err("%s() Failed to register dvb on VID_C\n", |
| 1010 | "%s() Failed to register dvb on VID_C\n", | ||
| 1011 | __func__); | 1010 | __func__); |
| 1012 | } | 1011 | } |
| 1013 | } else | 1012 | } else |
| 1014 | if (cx23885_boards[dev->board].portc == CX23885_MPEG_ENCODER) { | 1013 | if (cx23885_boards[dev->board].portc == CX23885_MPEG_ENCODER) { |
| 1015 | if (cx23885_417_register(dev) < 0) { | 1014 | if (cx23885_417_register(dev) < 0) { |
| 1016 | printk(KERN_ERR | 1015 | pr_err("%s() Failed to register 417 on VID_C\n", |
| 1017 | "%s() Failed to register 417 on VID_C\n", | ||
| 1018 | __func__); | 1016 | __func__); |
| 1019 | } | 1017 | } |
| 1020 | } | 1018 | } |
| @@ -1343,7 +1341,7 @@ int cx23885_start_dma(struct cx23885_tsport *port, | |||
| 1343 | 1341 | ||
| 1344 | if ((!(cx23885_boards[dev->board].portb & CX23885_MPEG_DVB)) && | 1342 | if ((!(cx23885_boards[dev->board].portb & CX23885_MPEG_DVB)) && |
| 1345 | (!(cx23885_boards[dev->board].portc & CX23885_MPEG_DVB))) { | 1343 | (!(cx23885_boards[dev->board].portc & CX23885_MPEG_DVB))) { |
| 1346 | printk("%s() Unsupported .portb/c (0x%08x)/(0x%08x)\n", | 1344 | pr_err("%s() Unsupported .portb/c (0x%08x)/(0x%08x)\n", |
| 1347 | __func__, | 1345 | __func__, |
| 1348 | cx23885_boards[dev->board].portb, | 1346 | cx23885_boards[dev->board].portb, |
| 1349 | cx23885_boards[dev->board].portc); | 1347 | cx23885_boards[dev->board].portc); |
| @@ -1530,7 +1528,6 @@ void cx23885_buf_queue(struct cx23885_tsport *port, struct cx23885_buffer *buf) | |||
| 1530 | 1528 | ||
| 1531 | static void do_cancel_buffers(struct cx23885_tsport *port, char *reason) | 1529 | static void do_cancel_buffers(struct cx23885_tsport *port, char *reason) |
| 1532 | { | 1530 | { |
| 1533 | struct cx23885_dev *dev = port->dev; | ||
| 1534 | struct cx23885_dmaqueue *q = &port->mpegq; | 1531 | struct cx23885_dmaqueue *q = &port->mpegq; |
| 1535 | struct cx23885_buffer *buf; | 1532 | struct cx23885_buffer *buf; |
| 1536 | unsigned long flags; | 1533 | unsigned long flags; |
| @@ -1550,8 +1547,6 @@ static void do_cancel_buffers(struct cx23885_tsport *port, char *reason) | |||
| 1550 | 1547 | ||
| 1551 | void cx23885_cancel_buffers(struct cx23885_tsport *port) | 1548 | void cx23885_cancel_buffers(struct cx23885_tsport *port) |
| 1552 | { | 1549 | { |
| 1553 | struct cx23885_dev *dev = port->dev; | ||
| 1554 | |||
| 1555 | dprintk(1, "%s()\n", __func__); | 1550 | dprintk(1, "%s()\n", __func__); |
| 1556 | cx23885_stop_dma(port); | 1551 | cx23885_stop_dma(port); |
| 1557 | do_cancel_buffers(port, "cancel"); | 1552 | do_cancel_buffers(port, "cancel"); |
| @@ -1578,7 +1573,7 @@ int cx23885_irq_417(struct cx23885_dev *dev, u32 status) | |||
| 1578 | (status & VID_B_MSK_VBI_SYNC) || | 1573 | (status & VID_B_MSK_VBI_SYNC) || |
| 1579 | (status & VID_B_MSK_OF) || | 1574 | (status & VID_B_MSK_OF) || |
| 1580 | (status & VID_B_MSK_VBI_OF)) { | 1575 | (status & VID_B_MSK_VBI_OF)) { |
| 1581 | printk(KERN_ERR "%s: V4L mpeg risc op code error, status = 0x%x\n", | 1576 | pr_err("%s: V4L mpeg risc op code error, status = 0x%x\n", |
| 1582 | dev->name, status); | 1577 | dev->name, status); |
| 1583 | if (status & VID_B_MSK_BAD_PKT) | 1578 | if (status & VID_B_MSK_BAD_PKT) |
| 1584 | dprintk(1, " VID_B_MSK_BAD_PKT\n"); | 1579 | dprintk(1, " VID_B_MSK_BAD_PKT\n"); |
| @@ -1640,7 +1635,7 @@ static int cx23885_irq_ts(struct cx23885_tsport *port, u32 status) | |||
| 1640 | dprintk(7, " (VID_BC_MSK_OF 0x%08x)\n", | 1635 | dprintk(7, " (VID_BC_MSK_OF 0x%08x)\n", |
| 1641 | VID_BC_MSK_OF); | 1636 | VID_BC_MSK_OF); |
| 1642 | 1637 | ||
| 1643 | printk(KERN_ERR "%s: mpeg risc op code error\n", dev->name); | 1638 | pr_err("%s: mpeg risc op code error\n", dev->name); |
| 1644 | 1639 | ||
| 1645 | cx_clear(port->reg_dma_ctl, port->dma_ctl_val); | 1640 | cx_clear(port->reg_dma_ctl, port->dma_ctl_val); |
| 1646 | cx23885_sram_channel_dump(dev, | 1641 | cx23885_sram_channel_dump(dev, |
| @@ -1880,15 +1875,14 @@ void cx23885_gpio_set(struct cx23885_dev *dev, u32 mask) | |||
| 1880 | 1875 | ||
| 1881 | if (mask & 0x0007fff8) { | 1876 | if (mask & 0x0007fff8) { |
| 1882 | if (encoder_on_portb(dev) || encoder_on_portc(dev)) | 1877 | if (encoder_on_portb(dev) || encoder_on_portc(dev)) |
| 1883 | printk(KERN_ERR | 1878 | pr_err("%s: Setting GPIO on encoder ports\n", |
| 1884 | "%s: Setting GPIO on encoder ports\n", | ||
| 1885 | dev->name); | 1879 | dev->name); |
| 1886 | cx_set(MC417_RWD, (mask & 0x0007fff8) >> 3); | 1880 | cx_set(MC417_RWD, (mask & 0x0007fff8) >> 3); |
| 1887 | } | 1881 | } |
| 1888 | 1882 | ||
| 1889 | /* TODO: 23-19 */ | 1883 | /* TODO: 23-19 */ |
| 1890 | if (mask & 0x00f80000) | 1884 | if (mask & 0x00f80000) |
| 1891 | printk(KERN_INFO "%s: Unsupported\n", dev->name); | 1885 | pr_info("%s: Unsupported\n", dev->name); |
| 1892 | } | 1886 | } |
| 1893 | 1887 | ||
| 1894 | void cx23885_gpio_clear(struct cx23885_dev *dev, u32 mask) | 1888 | void cx23885_gpio_clear(struct cx23885_dev *dev, u32 mask) |
| @@ -1898,15 +1892,14 @@ void cx23885_gpio_clear(struct cx23885_dev *dev, u32 mask) | |||
| 1898 | 1892 | ||
| 1899 | if (mask & 0x0007fff8) { | 1893 | if (mask & 0x0007fff8) { |
| 1900 | if (encoder_on_portb(dev) || encoder_on_portc(dev)) | 1894 | if (encoder_on_portb(dev) || encoder_on_portc(dev)) |
| 1901 | printk(KERN_ERR | 1895 | pr_err("%s: Clearing GPIO moving on encoder ports\n", |
| 1902 | "%s: Clearing GPIO moving on encoder ports\n", | ||
| 1903 | dev->name); | 1896 | dev->name); |
| 1904 | cx_clear(MC417_RWD, (mask & 0x7fff8) >> 3); | 1897 | cx_clear(MC417_RWD, (mask & 0x7fff8) >> 3); |
| 1905 | } | 1898 | } |
| 1906 | 1899 | ||
| 1907 | /* TODO: 23-19 */ | 1900 | /* TODO: 23-19 */ |
| 1908 | if (mask & 0x00f80000) | 1901 | if (mask & 0x00f80000) |
| 1909 | printk(KERN_INFO "%s: Unsupported\n", dev->name); | 1902 | pr_info("%s: Unsupported\n", dev->name); |
| 1910 | } | 1903 | } |
| 1911 | 1904 | ||
| 1912 | u32 cx23885_gpio_get(struct cx23885_dev *dev, u32 mask) | 1905 | u32 cx23885_gpio_get(struct cx23885_dev *dev, u32 mask) |
| @@ -1916,15 +1909,14 @@ u32 cx23885_gpio_get(struct cx23885_dev *dev, u32 mask) | |||
| 1916 | 1909 | ||
| 1917 | if (mask & 0x0007fff8) { | 1910 | if (mask & 0x0007fff8) { |
| 1918 | if (encoder_on_portb(dev) || encoder_on_portc(dev)) | 1911 | if (encoder_on_portb(dev) || encoder_on_portc(dev)) |
| 1919 | printk(KERN_ERR | 1912 | pr_err("%s: Reading GPIO moving on encoder ports\n", |
| 1920 | "%s: Reading GPIO moving on encoder ports\n", | ||
| 1921 | dev->name); | 1913 | dev->name); |
| 1922 | return (cx_read(MC417_RWD) & ((mask & 0x7fff8) >> 3)) << 3; | 1914 | return (cx_read(MC417_RWD) & ((mask & 0x7fff8) >> 3)) << 3; |
| 1923 | } | 1915 | } |
| 1924 | 1916 | ||
| 1925 | /* TODO: 23-19 */ | 1917 | /* TODO: 23-19 */ |
| 1926 | if (mask & 0x00f80000) | 1918 | if (mask & 0x00f80000) |
| 1927 | printk(KERN_INFO "%s: Unsupported\n", dev->name); | 1919 | pr_info("%s: Unsupported\n", dev->name); |
| 1928 | 1920 | ||
| 1929 | return 0; | 1921 | return 0; |
| 1930 | } | 1922 | } |
| @@ -1938,8 +1930,7 @@ void cx23885_gpio_enable(struct cx23885_dev *dev, u32 mask, int asoutput) | |||
| 1938 | 1930 | ||
| 1939 | if (mask & 0x0007fff8) { | 1931 | if (mask & 0x0007fff8) { |
| 1940 | if (encoder_on_portb(dev) || encoder_on_portc(dev)) | 1932 | if (encoder_on_portb(dev) || encoder_on_portc(dev)) |
| 1941 | printk(KERN_ERR | 1933 | pr_err("%s: Enabling GPIO on encoder ports\n", |
| 1942 | "%s: Enabling GPIO on encoder ports\n", | ||
| 1943 | dev->name); | 1934 | dev->name); |
| 1944 | } | 1935 | } |
| 1945 | 1936 | ||
| @@ -1994,7 +1985,7 @@ static int cx23885_initdev(struct pci_dev *pci_dev, | |||
| 1994 | /* print pci info */ | 1985 | /* print pci info */ |
| 1995 | dev->pci_rev = pci_dev->revision; | 1986 | dev->pci_rev = pci_dev->revision; |
| 1996 | pci_read_config_byte(pci_dev, PCI_LATENCY_TIMER, &dev->pci_lat); | 1987 | pci_read_config_byte(pci_dev, PCI_LATENCY_TIMER, &dev->pci_lat); |
| 1997 | printk(KERN_INFO "%s/0: found at %s, rev: %d, irq: %d, latency: %d, mmio: 0x%llx\n", | 1988 | pr_info("%s/0: found at %s, rev: %d, irq: %d, latency: %d, mmio: 0x%llx\n", |
| 1998 | dev->name, | 1989 | dev->name, |
| 1999 | pci_name(pci_dev), dev->pci_rev, pci_dev->irq, | 1990 | pci_name(pci_dev), dev->pci_rev, pci_dev->irq, |
| 2000 | dev->pci_lat, | 1991 | dev->pci_lat, |
| @@ -2003,14 +1994,14 @@ static int cx23885_initdev(struct pci_dev *pci_dev, | |||
| 2003 | pci_set_master(pci_dev); | 1994 | pci_set_master(pci_dev); |
| 2004 | err = pci_set_dma_mask(pci_dev, 0xffffffff); | 1995 | err = pci_set_dma_mask(pci_dev, 0xffffffff); |
| 2005 | if (err) { | 1996 | if (err) { |
| 2006 | printk(KERN_ERR "%s/0: Oops: no 32bit PCI DMA ???\n", dev->name); | 1997 | pr_err("%s/0: Oops: no 32bit PCI DMA ???\n", dev->name); |
| 2007 | goto fail_ctrl; | 1998 | goto fail_ctrl; |
| 2008 | } | 1999 | } |
| 2009 | 2000 | ||
| 2010 | err = request_irq(pci_dev->irq, cx23885_irq, | 2001 | err = request_irq(pci_dev->irq, cx23885_irq, |
| 2011 | IRQF_SHARED, dev->name, dev); | 2002 | IRQF_SHARED, dev->name, dev); |
| 2012 | if (err < 0) { | 2003 | if (err < 0) { |
| 2013 | printk(KERN_ERR "%s: can't get IRQ %d\n", | 2004 | pr_err("%s: can't get IRQ %d\n", |
| 2014 | dev->name, pci_dev->irq); | 2005 | dev->name, pci_dev->irq); |
| 2015 | goto fail_irq; | 2006 | goto fail_irq; |
| 2016 | } | 2007 | } |
| @@ -2096,7 +2087,7 @@ static struct pci_driver cx23885_pci_driver = { | |||
| 2096 | 2087 | ||
| 2097 | static int __init cx23885_init(void) | 2088 | static int __init cx23885_init(void) |
| 2098 | { | 2089 | { |
| 2099 | printk(KERN_INFO "cx23885 driver version %s loaded\n", | 2090 | pr_info("cx23885 driver version %s loaded\n", |
| 2100 | CX23885_VERSION); | 2091 | CX23885_VERSION); |
| 2101 | return pci_register_driver(&cx23885_pci_driver); | 2092 | return pci_register_driver(&cx23885_pci_driver); |
| 2102 | } | 2093 | } |
diff --git a/drivers/media/pci/cx23885/cx23885-dvb.c b/drivers/media/pci/cx23885/cx23885-dvb.c index 42413fa423b4..589a168d1df4 100644 --- a/drivers/media/pci/cx23885/cx23885-dvb.c +++ b/drivers/media/pci/cx23885/cx23885-dvb.c | |||
| @@ -15,6 +15,8 @@ | |||
| 15 | * GNU General Public License for more details. | 15 | * GNU General Public License for more details. |
| 16 | */ | 16 | */ |
| 17 | 17 | ||
| 18 | #include "cx23885.h" | ||
| 19 | |||
| 18 | #include <linux/module.h> | 20 | #include <linux/module.h> |
| 19 | #include <linux/init.h> | 21 | #include <linux/init.h> |
| 20 | #include <linux/device.h> | 22 | #include <linux/device.h> |
| @@ -23,7 +25,6 @@ | |||
| 23 | #include <linux/file.h> | 25 | #include <linux/file.h> |
| 24 | #include <linux/suspend.h> | 26 | #include <linux/suspend.h> |
| 25 | 27 | ||
| 26 | #include "cx23885.h" | ||
| 27 | #include <media/v4l2-common.h> | 28 | #include <media/v4l2-common.h> |
| 28 | 29 | ||
| 29 | #include "dvb_ca_en50221.h" | 30 | #include "dvb_ca_en50221.h" |
| @@ -80,7 +81,8 @@ static unsigned int debug; | |||
| 80 | 81 | ||
| 81 | #define dprintk(level, fmt, arg...)\ | 82 | #define dprintk(level, fmt, arg...)\ |
| 82 | do { if (debug >= level)\ | 83 | do { if (debug >= level)\ |
| 83 | printk(KERN_DEBUG "%s/0: " fmt, dev->name, ## arg);\ | 84 | printk(KERN_DEBUG pr_fmt("%s dvb: " fmt), \ |
| 85 | __func__, ##arg); \ | ||
| 84 | } while (0) | 86 | } while (0) |
| 85 | 87 | ||
| 86 | /* ------------------------------------------------------------------ */ | 88 | /* ------------------------------------------------------------------ */ |
| @@ -1101,7 +1103,7 @@ static int dvb_register_ci_mac(struct cx23885_tsport *port) | |||
| 1101 | netup_get_card_info(&dev->i2c_bus[0].i2c_adap, &cinfo); | 1103 | netup_get_card_info(&dev->i2c_bus[0].i2c_adap, &cinfo); |
| 1102 | memcpy(port->frontends.adapter.proposed_mac, | 1104 | memcpy(port->frontends.adapter.proposed_mac, |
| 1103 | cinfo.port[port->nr - 1].mac, 6); | 1105 | cinfo.port[port->nr - 1].mac, 6); |
| 1104 | printk(KERN_INFO "NetUP Dual DVB-S2 CI card port%d MAC=%pM\n", | 1106 | pr_info("NetUP Dual DVB-S2 CI card port%d MAC=%pM\n", |
| 1105 | port->nr, port->frontends.adapter.proposed_mac); | 1107 | port->nr, port->frontends.adapter.proposed_mac); |
| 1106 | 1108 | ||
| 1107 | netup_ci_init(port); | 1109 | netup_ci_init(port); |
| @@ -1127,7 +1129,7 @@ static int dvb_register_ci_mac(struct cx23885_tsport *port) | |||
| 1127 | /* Read entire EEPROM */ | 1129 | /* Read entire EEPROM */ |
| 1128 | dev->i2c_bus[0].i2c_client.addr = 0xa0 >> 1; | 1130 | dev->i2c_bus[0].i2c_client.addr = 0xa0 >> 1; |
| 1129 | tveeprom_read(&dev->i2c_bus[0].i2c_client, eeprom, sizeof(eeprom)); | 1131 | tveeprom_read(&dev->i2c_bus[0].i2c_client, eeprom, sizeof(eeprom)); |
| 1130 | printk(KERN_INFO "TeVii S470 MAC= %pM\n", eeprom + 0xa0); | 1132 | pr_info("TeVii S470 MAC= %pM\n", eeprom + 0xa0); |
| 1131 | memcpy(port->frontends.adapter.proposed_mac, eeprom + 0xa0, 6); | 1133 | memcpy(port->frontends.adapter.proposed_mac, eeprom + 0xa0, 6); |
| 1132 | return 0; | 1134 | return 0; |
| 1133 | } | 1135 | } |
| @@ -1144,7 +1146,7 @@ static int dvb_register_ci_mac(struct cx23885_tsport *port) | |||
| 1144 | dev->i2c_bus[0].i2c_client.addr = 0xa0 >> 1; | 1146 | dev->i2c_bus[0].i2c_client.addr = 0xa0 >> 1; |
| 1145 | tveeprom_read(&dev->i2c_bus[0].i2c_client, eeprom, | 1147 | tveeprom_read(&dev->i2c_bus[0].i2c_client, eeprom, |
| 1146 | sizeof(eeprom)); | 1148 | sizeof(eeprom)); |
| 1147 | printk(KERN_INFO "%s port %d MAC address: %pM\n", | 1149 | pr_info("%s port %d MAC address: %pM\n", |
| 1148 | cx23885_boards[dev->board].name, port->nr, | 1150 | cx23885_boards[dev->board].name, port->nr, |
| 1149 | eeprom + 0xc0 + (port->nr-1) * 8); | 1151 | eeprom + 0xc0 + (port->nr-1) * 8); |
| 1150 | memcpy(port->frontends.adapter.proposed_mac, eeprom + 0xc0 + | 1152 | memcpy(port->frontends.adapter.proposed_mac, eeprom + 0xc0 + |
| @@ -1185,7 +1187,7 @@ static int dvb_register_ci_mac(struct cx23885_tsport *port) | |||
| 1185 | dev->i2c_bus[0].i2c_client.addr = 0xa0 >> 1; | 1187 | dev->i2c_bus[0].i2c_client.addr = 0xa0 >> 1; |
| 1186 | tveeprom_read(&dev->i2c_bus[0].i2c_client, eeprom, | 1188 | tveeprom_read(&dev->i2c_bus[0].i2c_client, eeprom, |
| 1187 | sizeof(eeprom)); | 1189 | sizeof(eeprom)); |
| 1188 | printk(KERN_INFO "%s MAC address: %pM\n", | 1190 | pr_info("%s MAC address: %pM\n", |
| 1189 | cx23885_boards[dev->board].name, eeprom + 0xc0); | 1191 | cx23885_boards[dev->board].name, eeprom + 0xc0); |
| 1190 | memcpy(port->frontends.adapter.proposed_mac, eeprom + 0xc0, 6); | 1192 | memcpy(port->frontends.adapter.proposed_mac, eeprom + 0xc0, 6); |
| 1191 | return 0; | 1193 | return 0; |
| @@ -1464,7 +1466,7 @@ static int dvb_register(struct cx23885_tsport *port) | |||
| 1464 | return -ENODEV; | 1466 | return -ENODEV; |
| 1465 | 1467 | ||
| 1466 | if (dib7000p_ops.i2c_enumeration(&i2c_bus->i2c_adap, 1, 0x12, &dib7070p_dib7000p_config) < 0) { | 1468 | if (dib7000p_ops.i2c_enumeration(&i2c_bus->i2c_adap, 1, 0x12, &dib7070p_dib7000p_config) < 0) { |
| 1467 | printk(KERN_WARNING "Unable to enumerate dib7000p\n"); | 1469 | pr_warn("Unable to enumerate dib7000p\n"); |
| 1468 | return -ENODEV; | 1470 | return -ENODEV; |
| 1469 | } | 1471 | } |
| 1470 | fe0->dvb.frontend = dib7000p_ops.init(&i2c_bus->i2c_adap, 0x80, &dib7070p_dib7000p_config); | 1472 | fe0->dvb.frontend = dib7000p_ops.init(&i2c_bus->i2c_adap, 0x80, &dib7070p_dib7000p_config); |
| @@ -1524,7 +1526,7 @@ static int dvb_register(struct cx23885_tsport *port) | |||
| 1524 | fe = dvb_attach(xc4000_attach, fe0->dvb.frontend, | 1526 | fe = dvb_attach(xc4000_attach, fe0->dvb.frontend, |
| 1525 | &dev->i2c_bus[1].i2c_adap, &cfg); | 1527 | &dev->i2c_bus[1].i2c_adap, &cfg); |
| 1526 | if (!fe) { | 1528 | if (!fe) { |
| 1527 | printk(KERN_ERR "%s/2: xc4000 attach failed\n", | 1529 | pr_err("%s/2: xc4000 attach failed\n", |
| 1528 | dev->name); | 1530 | dev->name); |
| 1529 | goto frontend_detach; | 1531 | goto frontend_detach; |
| 1530 | } | 1532 | } |
| @@ -1597,8 +1599,7 @@ static int dvb_register(struct cx23885_tsport *port) | |||
| 1597 | &i2c_bus->i2c_adap, | 1599 | &i2c_bus->i2c_adap, |
| 1598 | LNBH24_PCL | LNBH24_TTX, | 1600 | LNBH24_PCL | LNBH24_TTX, |
| 1599 | LNBH24_TEN, 0x09)) | 1601 | LNBH24_TEN, 0x09)) |
| 1600 | printk(KERN_ERR | 1602 | pr_err("No LNBH24 found!\n"); |
| 1601 | "No LNBH24 found!\n"); | ||
| 1602 | 1603 | ||
| 1603 | } | 1604 | } |
| 1604 | } | 1605 | } |
| @@ -1618,8 +1619,7 @@ static int dvb_register(struct cx23885_tsport *port) | |||
| 1618 | &i2c_bus->i2c_adap, | 1619 | &i2c_bus->i2c_adap, |
| 1619 | LNBH24_PCL | LNBH24_TTX, | 1620 | LNBH24_PCL | LNBH24_TTX, |
| 1620 | LNBH24_TEN, 0x0a)) | 1621 | LNBH24_TEN, 0x0a)) |
| 1621 | printk(KERN_ERR | 1622 | pr_err("No LNBH24 found!\n"); |
| 1622 | "No LNBH24 found!\n"); | ||
| 1623 | 1623 | ||
| 1624 | } | 1624 | } |
| 1625 | } | 1625 | } |
| @@ -2482,13 +2482,13 @@ static int dvb_register(struct cx23885_tsport *port) | |||
| 2482 | break; | 2482 | break; |
| 2483 | 2483 | ||
| 2484 | default: | 2484 | default: |
| 2485 | printk(KERN_INFO "%s: The frontend of your DVB/ATSC card isn't supported yet\n", | 2485 | pr_info("%s: The frontend of your DVB/ATSC card isn't supported yet\n", |
| 2486 | dev->name); | 2486 | dev->name); |
| 2487 | break; | 2487 | break; |
| 2488 | } | 2488 | } |
| 2489 | 2489 | ||
| 2490 | if ((NULL == fe0->dvb.frontend) || (fe1 && NULL == fe1->dvb.frontend)) { | 2490 | if ((NULL == fe0->dvb.frontend) || (fe1 && NULL == fe1->dvb.frontend)) { |
| 2491 | printk(KERN_ERR "%s: frontend initialization failed\n", | 2491 | pr_err("%s: frontend initialization failed\n", |
| 2492 | dev->name); | 2492 | dev->name); |
| 2493 | goto frontend_detach; | 2493 | goto frontend_detach; |
| 2494 | } | 2494 | } |
| @@ -2569,7 +2569,7 @@ int cx23885_dvb_register(struct cx23885_tsport *port) | |||
| 2569 | * are for safety, and should provide a good foundation for the | 2569 | * are for safety, and should provide a good foundation for the |
| 2570 | * future addition of any multi-frontend cx23885 based boards. | 2570 | * future addition of any multi-frontend cx23885 based boards. |
| 2571 | */ | 2571 | */ |
| 2572 | printk(KERN_INFO "%s() allocating %d frontend(s)\n", __func__, | 2572 | pr_info("%s() allocating %d frontend(s)\n", __func__, |
| 2573 | port->num_frontends); | 2573 | port->num_frontends); |
| 2574 | 2574 | ||
| 2575 | for (i = 1; i <= port->num_frontends; i++) { | 2575 | for (i = 1; i <= port->num_frontends; i++) { |
| @@ -2577,7 +2577,7 @@ int cx23885_dvb_register(struct cx23885_tsport *port) | |||
| 2577 | 2577 | ||
| 2578 | if (vb2_dvb_alloc_frontend( | 2578 | if (vb2_dvb_alloc_frontend( |
| 2579 | &port->frontends, i) == NULL) { | 2579 | &port->frontends, i) == NULL) { |
| 2580 | printk(KERN_ERR "%s() failed to alloc\n", __func__); | 2580 | pr_err("%s() failed to alloc\n", __func__); |
| 2581 | return -ENOMEM; | 2581 | return -ENOMEM; |
| 2582 | } | 2582 | } |
| 2583 | 2583 | ||
| @@ -2596,7 +2596,7 @@ int cx23885_dvb_register(struct cx23885_tsport *port) | |||
| 2596 | 2596 | ||
| 2597 | /* dvb stuff */ | 2597 | /* dvb stuff */ |
| 2598 | /* We have to init the queue for each frontend on a port. */ | 2598 | /* We have to init the queue for each frontend on a port. */ |
| 2599 | printk(KERN_INFO "%s: cx23885 based dvb card\n", dev->name); | 2599 | pr_info("%s: cx23885 based dvb card\n", dev->name); |
| 2600 | q = &fe0->dvb.dvbq; | 2600 | q = &fe0->dvb.dvbq; |
| 2601 | q->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; | 2601 | q->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; |
| 2602 | q->io_modes = VB2_MMAP | VB2_USERPTR | VB2_DMABUF | VB2_READ; | 2602 | q->io_modes = VB2_MMAP | VB2_USERPTR | VB2_DMABUF | VB2_READ; |
| @@ -2616,8 +2616,8 @@ int cx23885_dvb_register(struct cx23885_tsport *port) | |||
| 2616 | } | 2616 | } |
| 2617 | err = dvb_register(port); | 2617 | err = dvb_register(port); |
| 2618 | if (err != 0) | 2618 | if (err != 0) |
| 2619 | printk(KERN_ERR "%s() dvb_register failed err = %d\n", | 2619 | pr_err("%s() dvb_register failed err = %d\n", |
| 2620 | __func__, err); | 2620 | __func__, err); |
| 2621 | 2621 | ||
| 2622 | return err; | 2622 | return err; |
| 2623 | } | 2623 | } |
diff --git a/drivers/media/pci/cx23885/cx23885-f300.c b/drivers/media/pci/cx23885/cx23885-f300.c index a6c45eb0a105..460cb8f314b2 100644 --- a/drivers/media/pci/cx23885/cx23885-f300.c +++ b/drivers/media/pci/cx23885/cx23885-f300.c | |||
| @@ -122,7 +122,7 @@ static u8 f300_xfer(struct dvb_frontend *fe, u8 *buf) | |||
| 122 | } | 122 | } |
| 123 | 123 | ||
| 124 | if (i > 7) { | 124 | if (i > 7) { |
| 125 | printk(KERN_ERR "%s: timeout, the slave no response\n", | 125 | pr_err("%s: timeout, the slave no response\n", |
| 126 | __func__); | 126 | __func__); |
| 127 | ret = 1; /* timeout, the slave no response */ | 127 | ret = 1; /* timeout, the slave no response */ |
| 128 | } else { /* the slave not busy, prepare for getting data */ | 128 | } else { /* the slave not busy, prepare for getting data */ |
diff --git a/drivers/media/pci/cx23885/cx23885-i2c.c b/drivers/media/pci/cx23885/cx23885-i2c.c index 19faf9a611ed..8528032090f2 100644 --- a/drivers/media/pci/cx23885/cx23885-i2c.c +++ b/drivers/media/pci/cx23885/cx23885-i2c.c | |||
| @@ -15,14 +15,14 @@ | |||
| 15 | * GNU General Public License for more details. | 15 | * GNU General Public License for more details. |
| 16 | */ | 16 | */ |
| 17 | 17 | ||
| 18 | #include "cx23885.h" | ||
| 19 | |||
| 18 | #include <linux/module.h> | 20 | #include <linux/module.h> |
| 19 | #include <linux/moduleparam.h> | 21 | #include <linux/moduleparam.h> |
| 20 | #include <linux/init.h> | 22 | #include <linux/init.h> |
| 21 | #include <linux/delay.h> | 23 | #include <linux/delay.h> |
| 22 | #include <asm/io.h> | 24 | #include <asm/io.h> |
| 23 | 25 | ||
| 24 | #include "cx23885.h" | ||
| 25 | |||
| 26 | #include <media/v4l2-common.h> | 26 | #include <media/v4l2-common.h> |
| 27 | 27 | ||
| 28 | static unsigned int i2c_debug; | 28 | static unsigned int i2c_debug; |
| @@ -35,7 +35,8 @@ MODULE_PARM_DESC(i2c_scan, "scan i2c bus at insmod time"); | |||
| 35 | 35 | ||
| 36 | #define dprintk(level, fmt, arg...)\ | 36 | #define dprintk(level, fmt, arg...)\ |
| 37 | do { if (i2c_debug >= level)\ | 37 | do { if (i2c_debug >= level)\ |
| 38 | printk(KERN_DEBUG "%s/0: " fmt, dev->name, ## arg);\ | 38 | printk(KERN_DEBUG pr_fmt("%s: i2c:" fmt), \ |
| 39 | __func__, ##arg); \ | ||
| 39 | } while (0) | 40 | } while (0) |
| 40 | 41 | ||
| 41 | #define I2C_WAIT_DELAY 32 | 42 | #define I2C_WAIT_DELAY 32 |
| @@ -121,7 +122,7 @@ static int i2c_sendbytes(struct i2c_adapter *i2c_adap, | |||
| 121 | if (i2c_debug) { | 122 | if (i2c_debug) { |
| 122 | printk(KERN_DEBUG " <W %02x %02x", msg->addr << 1, msg->buf[0]); | 123 | printk(KERN_DEBUG " <W %02x %02x", msg->addr << 1, msg->buf[0]); |
| 123 | if (!(ctrl & I2C_NOSTOP)) | 124 | if (!(ctrl & I2C_NOSTOP)) |
| 124 | printk(KERN_CONT " >\n"); | 125 | pr_cont(" >\n"); |
| 125 | } | 126 | } |
| 126 | 127 | ||
| 127 | for (cnt = 1; cnt < msg->len; cnt++) { | 128 | for (cnt = 1; cnt < msg->len; cnt++) { |
| @@ -141,9 +142,9 @@ static int i2c_sendbytes(struct i2c_adapter *i2c_adap, | |||
| 141 | if (!i2c_wait_done(i2c_adap)) | 142 | if (!i2c_wait_done(i2c_adap)) |
| 142 | goto eio; | 143 | goto eio; |
| 143 | if (i2c_debug) { | 144 | if (i2c_debug) { |
| 144 | printk(KERN_CONT " %02x", msg->buf[cnt]); | 145 | pr_cont(" %02x", msg->buf[cnt]); |
| 145 | if (!(ctrl & I2C_NOSTOP)) | 146 | if (!(ctrl & I2C_NOSTOP)) |
| 146 | printk(KERN_CONT " >\n"); | 147 | pr_cont(" >\n"); |
| 147 | } | 148 | } |
| 148 | } | 149 | } |
| 149 | return msg->len; | 150 | return msg->len; |
| @@ -151,7 +152,7 @@ static int i2c_sendbytes(struct i2c_adapter *i2c_adap, | |||
| 151 | eio: | 152 | eio: |
| 152 | retval = -EIO; | 153 | retval = -EIO; |
| 153 | if (i2c_debug) | 154 | if (i2c_debug) |
| 154 | printk(KERN_ERR " ERR: %d\n", retval); | 155 | pr_err(" ERR: %d\n", retval); |
| 155 | return retval; | 156 | return retval; |
| 156 | } | 157 | } |
| 157 | 158 | ||
| @@ -212,15 +213,13 @@ static int i2c_readbytes(struct i2c_adapter *i2c_adap, | |||
| 212 | eio: | 213 | eio: |
| 213 | retval = -EIO; | 214 | retval = -EIO; |
| 214 | if (i2c_debug) | 215 | if (i2c_debug) |
| 215 | printk(KERN_ERR " ERR: %d\n", retval); | 216 | pr_err(" ERR: %d\n", retval); |
| 216 | return retval; | 217 | return retval; |
| 217 | } | 218 | } |
| 218 | 219 | ||
| 219 | static int i2c_xfer(struct i2c_adapter *i2c_adap, | 220 | static int i2c_xfer(struct i2c_adapter *i2c_adap, |
| 220 | struct i2c_msg *msgs, int num) | 221 | struct i2c_msg *msgs, int num) |
| 221 | { | 222 | { |
| 222 | struct cx23885_i2c *bus = i2c_adap->algo_data; | ||
| 223 | struct cx23885_dev *dev = bus->dev; | ||
| 224 | int i, retval = 0; | 223 | int i, retval = 0; |
| 225 | 224 | ||
| 226 | dprintk(1, "%s(num = %d)\n", __func__, num); | 225 | dprintk(1, "%s(num = %d)\n", __func__, num); |
| @@ -302,7 +301,7 @@ static void do_i2c_scan(char *name, struct i2c_client *c) | |||
| 302 | rc = i2c_master_recv(c, &buf, 0); | 301 | rc = i2c_master_recv(c, &buf, 0); |
| 303 | if (rc < 0) | 302 | if (rc < 0) |
| 304 | continue; | 303 | continue; |
| 305 | printk(KERN_INFO "%s: i2c scan: found device @ 0x%04x [%s]\n", | 304 | pr_info("%s: i2c scan: found device @ 0x%04x [%s]\n", |
| 306 | name, i, i2c_devs[i] ? i2c_devs[i] : "???"); | 305 | name, i, i2c_devs[i] ? i2c_devs[i] : "???"); |
| 307 | } | 306 | } |
| 308 | } | 307 | } |
| @@ -330,12 +329,12 @@ int cx23885_i2c_register(struct cx23885_i2c *bus) | |||
| 330 | if (0 == bus->i2c_rc) { | 329 | if (0 == bus->i2c_rc) { |
| 331 | dprintk(1, "%s: i2c bus %d registered\n", dev->name, bus->nr); | 330 | dprintk(1, "%s: i2c bus %d registered\n", dev->name, bus->nr); |
| 332 | if (i2c_scan) { | 331 | if (i2c_scan) { |
| 333 | printk(KERN_INFO "%s: scan bus %d:\n", | 332 | pr_info("%s: scan bus %d:\n", |
| 334 | dev->name, bus->nr); | 333 | dev->name, bus->nr); |
| 335 | do_i2c_scan(dev->name, &bus->i2c_client); | 334 | do_i2c_scan(dev->name, &bus->i2c_client); |
| 336 | } | 335 | } |
| 337 | } else | 336 | } else |
| 338 | printk(KERN_WARNING "%s: i2c bus %d register FAILED\n", | 337 | pr_warn("%s: i2c bus %d register FAILED\n", |
| 339 | dev->name, bus->nr); | 338 | dev->name, bus->nr); |
| 340 | 339 | ||
| 341 | /* Instantiate the IR receiver device, if present */ | 340 | /* Instantiate the IR receiver device, if present */ |
diff --git a/drivers/media/pci/cx23885/cx23885-input.c b/drivers/media/pci/cx23885/cx23885-input.c index 410c3141c163..1f092febdbd1 100644 --- a/drivers/media/pci/cx23885/cx23885-input.c +++ b/drivers/media/pci/cx23885/cx23885-input.c | |||
| @@ -30,13 +30,13 @@ | |||
| 30 | * GNU General Public License for more details. | 30 | * GNU General Public License for more details. |
| 31 | */ | 31 | */ |
| 32 | 32 | ||
| 33 | #include "cx23885.h" | ||
| 34 | #include "cx23885-input.h" | ||
| 35 | |||
| 33 | #include <linux/slab.h> | 36 | #include <linux/slab.h> |
| 34 | #include <media/rc-core.h> | 37 | #include <media/rc-core.h> |
| 35 | #include <media/v4l2-subdev.h> | 38 | #include <media/v4l2-subdev.h> |
| 36 | 39 | ||
| 37 | #include "cx23885.h" | ||
| 38 | #include "cx23885-input.h" | ||
| 39 | |||
| 40 | #define MODULE_NAME "cx23885" | 40 | #define MODULE_NAME "cx23885" |
| 41 | 41 | ||
| 42 | static void cx23885_input_process_measurements(struct cx23885_dev *dev, | 42 | static void cx23885_input_process_measurements(struct cx23885_dev *dev, |
diff --git a/drivers/media/pci/cx23885/cx23885-ir.c b/drivers/media/pci/cx23885/cx23885-ir.c index 89dc4cc3e1ce..2cd5ac41ab75 100644 --- a/drivers/media/pci/cx23885/cx23885-ir.c +++ b/drivers/media/pci/cx23885/cx23885-ir.c | |||
| @@ -16,12 +16,12 @@ | |||
| 16 | * GNU General Public License for more details. | 16 | * GNU General Public License for more details. |
| 17 | */ | 17 | */ |
| 18 | 18 | ||
| 19 | #include <media/v4l2-device.h> | ||
| 20 | |||
| 21 | #include "cx23885.h" | 19 | #include "cx23885.h" |
| 22 | #include "cx23885-ir.h" | 20 | #include "cx23885-ir.h" |
| 23 | #include "cx23885-input.h" | 21 | #include "cx23885-input.h" |
| 24 | 22 | ||
| 23 | #include <media/v4l2-device.h> | ||
| 24 | |||
| 25 | #define CX23885_IR_RX_FIFO_SERVICE_REQ 0 | 25 | #define CX23885_IR_RX_FIFO_SERVICE_REQ 0 |
| 26 | #define CX23885_IR_RX_END_OF_RX_DETECTED 1 | 26 | #define CX23885_IR_RX_END_OF_RX_DETECTED 1 |
| 27 | #define CX23885_IR_RX_HW_FIFO_OVERRUN 2 | 27 | #define CX23885_IR_RX_HW_FIFO_OVERRUN 2 |
diff --git a/drivers/media/pci/cx23885/cx23885-vbi.c b/drivers/media/pci/cx23885/cx23885-vbi.c index 75e7fa7b1121..369e545cac04 100644 --- a/drivers/media/pci/cx23885/cx23885-vbi.c +++ b/drivers/media/pci/cx23885/cx23885-vbi.c | |||
| @@ -15,13 +15,13 @@ | |||
| 15 | * GNU General Public License for more details. | 15 | * GNU General Public License for more details. |
| 16 | */ | 16 | */ |
| 17 | 17 | ||
| 18 | #include "cx23885.h" | ||
| 19 | |||
| 18 | #include <linux/kernel.h> | 20 | #include <linux/kernel.h> |
| 19 | #include <linux/module.h> | 21 | #include <linux/module.h> |
| 20 | #include <linux/moduleparam.h> | 22 | #include <linux/moduleparam.h> |
| 21 | #include <linux/init.h> | 23 | #include <linux/init.h> |
| 22 | 24 | ||
| 23 | #include "cx23885.h" | ||
| 24 | |||
| 25 | static unsigned int vbibufs = 4; | 25 | static unsigned int vbibufs = 4; |
| 26 | module_param(vbibufs, int, 0644); | 26 | module_param(vbibufs, int, 0644); |
| 27 | MODULE_PARM_DESC(vbibufs, "number of vbi buffers, range 2-32"); | 27 | MODULE_PARM_DESC(vbibufs, "number of vbi buffers, range 2-32"); |
| @@ -32,7 +32,8 @@ MODULE_PARM_DESC(vbi_debug, "enable debug messages [vbi]"); | |||
| 32 | 32 | ||
| 33 | #define dprintk(level, fmt, arg...)\ | 33 | #define dprintk(level, fmt, arg...)\ |
| 34 | do { if (vbi_debug >= level)\ | 34 | do { if (vbi_debug >= level)\ |
| 35 | printk(KERN_DEBUG "%s/0: " fmt, dev->name, ## arg);\ | 35 | printk(KERN_DEBUG pr_fmt("%s: vbi:" fmt), \ |
| 36 | __func__, ##arg); \ | ||
| 36 | } while (0) | 37 | } while (0) |
| 37 | 38 | ||
| 38 | /* ------------------------------------------------------------------ */ | 39 | /* ------------------------------------------------------------------ */ |
diff --git a/drivers/media/pci/cx23885/cx23885-video.c b/drivers/media/pci/cx23885/cx23885-video.c index 92ff452e5886..ecc580af0148 100644 --- a/drivers/media/pci/cx23885/cx23885-video.c +++ b/drivers/media/pci/cx23885/cx23885-video.c | |||
| @@ -15,6 +15,9 @@ | |||
| 15 | * GNU General Public License for more details. | 15 | * GNU General Public License for more details. |
| 16 | */ | 16 | */ |
| 17 | 17 | ||
| 18 | #include "cx23885.h" | ||
| 19 | #include "cx23885-video.h" | ||
| 20 | |||
| 18 | #include <linux/init.h> | 21 | #include <linux/init.h> |
| 19 | #include <linux/list.h> | 22 | #include <linux/list.h> |
| 20 | #include <linux/module.h> | 23 | #include <linux/module.h> |
| @@ -27,8 +30,6 @@ | |||
| 27 | #include <linux/kthread.h> | 30 | #include <linux/kthread.h> |
| 28 | #include <asm/div64.h> | 31 | #include <asm/div64.h> |
| 29 | 32 | ||
| 30 | #include "cx23885.h" | ||
| 31 | #include "cx23885-video.h" | ||
| 32 | #include <media/v4l2-common.h> | 33 | #include <media/v4l2-common.h> |
| 33 | #include <media/v4l2-ioctl.h> | 34 | #include <media/v4l2-ioctl.h> |
| 34 | #include <media/v4l2-event.h> | 35 | #include <media/v4l2-event.h> |
| @@ -66,7 +67,8 @@ MODULE_PARM_DESC(vid_limit, "capture memory limit in megabytes"); | |||
| 66 | 67 | ||
| 67 | #define dprintk(level, fmt, arg...)\ | 68 | #define dprintk(level, fmt, arg...)\ |
| 68 | do { if (video_debug >= level)\ | 69 | do { if (video_debug >= level)\ |
| 69 | printk(KERN_DEBUG "%s: " fmt, dev->name, ## arg);\ | 70 | printk(KERN_DEBUG pr_fmt("%s: video:" fmt), \ |
| 71 | __func__, ##arg); \ | ||
| 70 | } while (0) | 72 | } while (0) |
| 71 | 73 | ||
| 72 | /* ------------------------------------------------------------------- */ | 74 | /* ------------------------------------------------------------------- */ |
| @@ -194,7 +196,7 @@ u8 cx23885_flatiron_read(struct cx23885_dev *dev, u8 reg) | |||
| 194 | 196 | ||
| 195 | ret = i2c_transfer(&dev->i2c_bus[2].i2c_adap, &msg[0], 2); | 197 | ret = i2c_transfer(&dev->i2c_bus[2].i2c_adap, &msg[0], 2); |
| 196 | if (ret != 2) | 198 | if (ret != 2) |
| 197 | printk(KERN_ERR "%s() error\n", __func__); | 199 | pr_err("%s() error\n", __func__); |
| 198 | 200 | ||
| 199 | return b1[0]; | 201 | return b1[0]; |
| 200 | } | 202 | } |
| @@ -811,7 +813,6 @@ static int vidioc_log_status(struct file *file, void *priv) | |||
| 811 | static int cx23885_query_audinput(struct file *file, void *priv, | 813 | static int cx23885_query_audinput(struct file *file, void *priv, |
| 812 | struct v4l2_audio *i) | 814 | struct v4l2_audio *i) |
| 813 | { | 815 | { |
| 814 | struct cx23885_dev *dev = video_drvdata(file); | ||
| 815 | static const char *iname[] = { | 816 | static const char *iname[] = { |
| 816 | [0] = "Baseband L/R 1", | 817 | [0] = "Baseband L/R 1", |
| 817 | [1] = "Baseband L/R 2", | 818 | [1] = "Baseband L/R 2", |
| @@ -1000,7 +1001,7 @@ static int cx23885_set_freq_via_ops(struct cx23885_dev *dev, | |||
| 1000 | fe->ops.tuner_ops.set_analog_params(fe, ¶ms); | 1001 | fe->ops.tuner_ops.set_analog_params(fe, ¶ms); |
| 1001 | } | 1002 | } |
| 1002 | else | 1003 | else |
| 1003 | printk(KERN_ERR "%s() No analog tuner, aborting\n", __func__); | 1004 | pr_err("%s() No analog tuner, aborting\n", __func__); |
| 1004 | 1005 | ||
| 1005 | /* When changing channels it is required to reset TVAUDIO */ | 1006 | /* When changing channels it is required to reset TVAUDIO */ |
| 1006 | msleep(100); | 1007 | msleep(100); |
| @@ -1058,7 +1059,7 @@ int cx23885_video_irq(struct cx23885_dev *dev, u32 status) | |||
| 1058 | if (status & VID_BC_MSK_OPC_ERR) { | 1059 | if (status & VID_BC_MSK_OPC_ERR) { |
| 1059 | dprintk(7, " (VID_BC_MSK_OPC_ERR 0x%08x)\n", | 1060 | dprintk(7, " (VID_BC_MSK_OPC_ERR 0x%08x)\n", |
| 1060 | VID_BC_MSK_OPC_ERR); | 1061 | VID_BC_MSK_OPC_ERR); |
| 1061 | printk(KERN_WARNING "%s: video risc op code error\n", | 1062 | pr_warn("%s: video risc op code error\n", |
| 1062 | dev->name); | 1063 | dev->name); |
| 1063 | cx23885_sram_channel_dump(dev, | 1064 | cx23885_sram_channel_dump(dev, |
| 1064 | &dev->sram_channels[SRAM_CH01]); | 1065 | &dev->sram_channels[SRAM_CH01]); |
| @@ -1296,11 +1297,11 @@ int cx23885_video_register(struct cx23885_dev *dev) | |||
| 1296 | err = video_register_device(dev->video_dev, VFL_TYPE_GRABBER, | 1297 | err = video_register_device(dev->video_dev, VFL_TYPE_GRABBER, |
| 1297 | video_nr[dev->nr]); | 1298 | video_nr[dev->nr]); |
| 1298 | if (err < 0) { | 1299 | if (err < 0) { |
| 1299 | printk(KERN_INFO "%s: can't register video device\n", | 1300 | pr_info("%s: can't register video device\n", |
| 1300 | dev->name); | 1301 | dev->name); |
| 1301 | goto fail_unreg; | 1302 | goto fail_unreg; |
| 1302 | } | 1303 | } |
| 1303 | printk(KERN_INFO "%s: registered device %s [v4l2]\n", | 1304 | pr_info("%s: registered device %s [v4l2]\n", |
| 1304 | dev->name, video_device_node_name(dev->video_dev)); | 1305 | dev->name, video_device_node_name(dev->video_dev)); |
| 1305 | 1306 | ||
| 1306 | /* register VBI device */ | 1307 | /* register VBI device */ |
| @@ -1310,11 +1311,11 @@ int cx23885_video_register(struct cx23885_dev *dev) | |||
| 1310 | err = video_register_device(dev->vbi_dev, VFL_TYPE_VBI, | 1311 | err = video_register_device(dev->vbi_dev, VFL_TYPE_VBI, |
| 1311 | vbi_nr[dev->nr]); | 1312 | vbi_nr[dev->nr]); |
| 1312 | if (err < 0) { | 1313 | if (err < 0) { |
| 1313 | printk(KERN_INFO "%s: can't register vbi device\n", | 1314 | pr_info("%s: can't register vbi device\n", |
| 1314 | dev->name); | 1315 | dev->name); |
| 1315 | goto fail_unreg; | 1316 | goto fail_unreg; |
| 1316 | } | 1317 | } |
| 1317 | printk(KERN_INFO "%s: registered device %s\n", | 1318 | pr_info("%s: registered device %s\n", |
| 1318 | dev->name, video_device_node_name(dev->vbi_dev)); | 1319 | dev->name, video_device_node_name(dev->vbi_dev)); |
| 1319 | 1320 | ||
| 1320 | /* Register ALSA audio device */ | 1321 | /* Register ALSA audio device */ |
diff --git a/drivers/media/pci/cx23885/cx23885.h b/drivers/media/pci/cx23885/cx23885.h index a6735afe2269..cb714ab60d69 100644 --- a/drivers/media/pci/cx23885/cx23885.h +++ b/drivers/media/pci/cx23885/cx23885.h | |||
| @@ -15,6 +15,8 @@ | |||
| 15 | * GNU General Public License for more details. | 15 | * GNU General Public License for more details. |
| 16 | */ | 16 | */ |
| 17 | 17 | ||
| 18 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
| 19 | |||
| 18 | #include <linux/pci.h> | 20 | #include <linux/pci.h> |
| 19 | #include <linux/i2c.h> | 21 | #include <linux/i2c.h> |
| 20 | #include <linux/kdev_t.h> | 22 | #include <linux/kdev_t.h> |
diff --git a/drivers/media/pci/cx23885/cx23888-ir.c b/drivers/media/pci/cx23885/cx23888-ir.c index 3115cfddab95..040323b0f945 100644 --- a/drivers/media/pci/cx23885/cx23888-ir.c +++ b/drivers/media/pci/cx23885/cx23888-ir.c | |||
| @@ -16,15 +16,15 @@ | |||
| 16 | * GNU General Public License for more details. | 16 | * GNU General Public License for more details. |
| 17 | */ | 17 | */ |
| 18 | 18 | ||
| 19 | #include "cx23885.h" | ||
| 20 | #include "cx23888-ir.h" | ||
| 21 | |||
| 19 | #include <linux/kfifo.h> | 22 | #include <linux/kfifo.h> |
| 20 | #include <linux/slab.h> | 23 | #include <linux/slab.h> |
| 21 | 24 | ||
| 22 | #include <media/v4l2-device.h> | 25 | #include <media/v4l2-device.h> |
| 23 | #include <media/rc-core.h> | 26 | #include <media/rc-core.h> |
| 24 | 27 | ||
| 25 | #include "cx23885.h" | ||
| 26 | #include "cx23888-ir.h" | ||
| 27 | |||
| 28 | static unsigned int ir_888_debug; | 28 | static unsigned int ir_888_debug; |
| 29 | module_param(ir_888_debug, int, 0644); | 29 | module_param(ir_888_debug, int, 0644); |
| 30 | MODULE_PARM_DESC(ir_888_debug, "enable debug messages [CX23888 IR controller]"); | 30 | MODULE_PARM_DESC(ir_888_debug, "enable debug messages [CX23888 IR controller]"); |
diff --git a/drivers/media/pci/cx23885/netup-eeprom.c b/drivers/media/pci/cx23885/netup-eeprom.c index b6542ee4385b..6384c12aa38e 100644 --- a/drivers/media/pci/cx23885/netup-eeprom.c +++ b/drivers/media/pci/cx23885/netup-eeprom.c | |||
| @@ -52,7 +52,7 @@ int netup_eeprom_read(struct i2c_adapter *i2c_adap, u8 addr) | |||
| 52 | ret = i2c_transfer(i2c_adap, msg, 2); | 52 | ret = i2c_transfer(i2c_adap, msg, 2); |
| 53 | 53 | ||
| 54 | if (ret != 2) { | 54 | if (ret != 2) { |
| 55 | printk(KERN_ERR "eeprom i2c read error, status=%d\n", ret); | 55 | pr_err("eeprom i2c read error, status=%d\n", ret); |
| 56 | return -1; | 56 | return -1; |
| 57 | } | 57 | } |
| 58 | 58 | ||
| @@ -80,7 +80,7 @@ int netup_eeprom_write(struct i2c_adapter *i2c_adap, u8 addr, u8 data) | |||
| 80 | ret = i2c_transfer(i2c_adap, msg, 1); | 80 | ret = i2c_transfer(i2c_adap, msg, 1); |
| 81 | 81 | ||
| 82 | if (ret != 1) { | 82 | if (ret != 1) { |
| 83 | printk(KERN_ERR "eeprom i2c write error, status=%d\n", ret); | 83 | pr_err("eeprom i2c write error, status=%d\n", ret); |
| 84 | return -1; | 84 | return -1; |
| 85 | } | 85 | } |
| 86 | 86 | ||
diff --git a/drivers/media/pci/cx23885/netup-init.c b/drivers/media/pci/cx23885/netup-init.c index 76d9487aafc8..6a27ef5d9ec2 100644 --- a/drivers/media/pci/cx23885/netup-init.c +++ b/drivers/media/pci/cx23885/netup-init.c | |||
| @@ -40,7 +40,7 @@ static void i2c_av_write(struct i2c_adapter *i2c, u16 reg, u8 val) | |||
| 40 | ret = i2c_transfer(i2c, &msg, 1); | 40 | ret = i2c_transfer(i2c, &msg, 1); |
| 41 | 41 | ||
| 42 | if (ret != 1) | 42 | if (ret != 1) |
| 43 | printk(KERN_ERR "%s: i2c write error!\n", __func__); | 43 | pr_err("%s: i2c write error!\n", __func__); |
| 44 | } | 44 | } |
| 45 | 45 | ||
| 46 | static void i2c_av_write4(struct i2c_adapter *i2c, u16 reg, u32 val) | 46 | static void i2c_av_write4(struct i2c_adapter *i2c, u16 reg, u32 val) |
| @@ -64,7 +64,7 @@ static void i2c_av_write4(struct i2c_adapter *i2c, u16 reg, u32 val) | |||
| 64 | ret = i2c_transfer(i2c, &msg, 1); | 64 | ret = i2c_transfer(i2c, &msg, 1); |
| 65 | 65 | ||
| 66 | if (ret != 1) | 66 | if (ret != 1) |
| 67 | printk(KERN_ERR "%s: i2c write error!\n", __func__); | 67 | pr_err("%s: i2c write error!\n", __func__); |
| 68 | } | 68 | } |
| 69 | 69 | ||
| 70 | static u8 i2c_av_read(struct i2c_adapter *i2c, u16 reg) | 70 | static u8 i2c_av_read(struct i2c_adapter *i2c, u16 reg) |
| @@ -84,7 +84,7 @@ static u8 i2c_av_read(struct i2c_adapter *i2c, u16 reg) | |||
| 84 | ret = i2c_transfer(i2c, &msg, 1); | 84 | ret = i2c_transfer(i2c, &msg, 1); |
| 85 | 85 | ||
| 86 | if (ret != 1) | 86 | if (ret != 1) |
| 87 | printk(KERN_ERR "%s: i2c write error!\n", __func__); | 87 | pr_err("%s: i2c write error!\n", __func__); |
| 88 | 88 | ||
| 89 | msg.flags = I2C_M_RD; | 89 | msg.flags = I2C_M_RD; |
| 90 | msg.len = 1; | 90 | msg.len = 1; |
| @@ -92,7 +92,7 @@ static u8 i2c_av_read(struct i2c_adapter *i2c, u16 reg) | |||
| 92 | ret = i2c_transfer(i2c, &msg, 1); | 92 | ret = i2c_transfer(i2c, &msg, 1); |
| 93 | 93 | ||
| 94 | if (ret != 1) | 94 | if (ret != 1) |
| 95 | printk(KERN_ERR "%s: i2c read error!\n", __func__); | 95 | pr_err("%s: i2c read error!\n", __func__); |
| 96 | 96 | ||
| 97 | return buf[0]; | 97 | return buf[0]; |
| 98 | } | 98 | } |
