aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/wm8775.c
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2006-01-09 12:32:40 -0500
committerMauro Carvalho Chehab <mchehab@brturbo.com.br>2006-01-09 12:32:40 -0500
commitfac9e89999a12f378112fe93764b30196bc03f46 (patch)
tree6daf5fee44efe3d878358d17fa9934139d0c7ade /drivers/media/video/wm8775.c
parent0e7072ef6623c3dc58faf3f7310aba77b0a5845e (diff)
V4L/DVB (3278): convert diagnostics over to the new v4l2-common.h macros.
- Convert diagnostics over to the new v4l2-common.h macros. - deprecated tuner_debug option, the new option is debug. - renamed cx25840_debug to debug. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
Diffstat (limited to 'drivers/media/video/wm8775.c')
-rw-r--r--drivers/media/video/wm8775.c20
1 files changed, 6 insertions, 14 deletions
diff --git a/drivers/media/video/wm8775.c b/drivers/media/video/wm8775.c
index a1b6a427ab74..20b4ec93d7c9 100644
--- a/drivers/media/video/wm8775.c
+++ b/drivers/media/video/wm8775.c
@@ -32,20 +32,12 @@
32#include <linux/i2c.h> 32#include <linux/i2c.h>
33#include <linux/i2c-id.h> 33#include <linux/i2c-id.h>
34#include <linux/videodev.h> 34#include <linux/videodev.h>
35#include <media/audiochip.h> 35#include <media/v4l2-common.h>
36 36
37MODULE_DESCRIPTION("wm8775 driver"); 37MODULE_DESCRIPTION("wm8775 driver");
38MODULE_AUTHOR("Ulf Eklund, Hans Verkuil"); 38MODULE_AUTHOR("Ulf Eklund, Hans Verkuil");
39MODULE_LICENSE("GPL"); 39MODULE_LICENSE("GPL");
40 40
41#define wm8775_err(fmt, arg...) do { \
42 printk(KERN_ERR "%s %d-%04x: " fmt, client->driver->driver.name, \
43 i2c_adapter_id(client->adapter), client->addr , ## arg); } while (0)
44#define wm8775_info(fmt, arg...) do { \
45 printk(KERN_INFO "%s %d-%04x: " fmt, client->driver->driver.name, \
46 i2c_adapter_id(client->adapter), client->addr , ## arg); } while (0)
47
48
49static unsigned short normal_i2c[] = { 0x36 >> 1, I2C_CLIENT_END }; 41static unsigned short normal_i2c[] = { 0x36 >> 1, I2C_CLIENT_END };
50 42
51 43
@@ -69,7 +61,7 @@ static int wm8775_write(struct i2c_client *client, int reg, u16 val)
69 int i; 61 int i;
70 62
71 if (reg < 0 || reg >= TOT_REGS) { 63 if (reg < 0 || reg >= TOT_REGS) {
72 wm8775_err("Invalid register R%d\n", reg); 64 v4l_err(client, "Invalid register R%d\n", reg);
73 return -1; 65 return -1;
74 } 66 }
75 67
@@ -79,7 +71,7 @@ static int wm8775_write(struct i2c_client *client, int reg, u16 val)
79 return 0; 71 return 0;
80 } 72 }
81 } 73 }
82 wm8775_err("I2C: cannot write %03x to register R%d\n", val, reg); 74 v4l_err(client, "I2C: cannot write %03x to register R%d\n", val, reg);
83 return -1; 75 return -1;
84} 76}
85 77
@@ -98,7 +90,7 @@ static int wm8775_command(struct i2c_client *client, unsigned int cmd,
98 If only one input is active (the normal case) then the 90 If only one input is active (the normal case) then the
99 input values 1, 2, 4 or 8 should be used. */ 91 input values 1, 2, 4 or 8 should be used. */
100 if (input->index > 15) { 92 if (input->index > 15) {
101 wm8775_err("Invalid input %d.\n", input->index); 93 v4l_err(client, "Invalid input %d.\n", input->index);
102 return -EINVAL; 94 return -EINVAL;
103 } 95 }
104 state->input = input->index; 96 state->input = input->index;
@@ -133,7 +125,7 @@ static int wm8775_command(struct i2c_client *client, unsigned int cmd,
133 break; 125 break;
134 126
135 case VIDIOC_LOG_STATUS: 127 case VIDIOC_LOG_STATUS:
136 wm8775_info("Input: %d%s\n", state->input, 128 v4l_info(client, "Input: %d%s\n", state->input,
137 state->muted ? " (muted)" : ""); 129 state->muted ? " (muted)" : "");
138 break; 130 break;
139 131
@@ -184,7 +176,7 @@ static int wm8775_attach(struct i2c_adapter *adapter, int address, int kind)
184 client->driver = &i2c_driver; 176 client->driver = &i2c_driver;
185 snprintf(client->name, sizeof(client->name) - 1, "wm8775"); 177 snprintf(client->name, sizeof(client->name) - 1, "wm8775");
186 178
187 wm8775_info("chip found @ 0x%x (%s)\n", address << 1, adapter->name); 179 v4l_info(client, "chip found @ 0x%x (%s)\n", address << 1, adapter->name);
188 180
189 state = kmalloc(sizeof(struct wm8775_state), GFP_KERNEL); 181 state = kmalloc(sizeof(struct wm8775_state), GFP_KERNEL);
190 if (state == NULL) { 182 if (state == NULL) {