aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/cx18/cx18-gpio.c
diff options
context:
space:
mode:
authorAndy Walls <awalls@radix.net>2008-08-30 15:03:44 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2008-10-12 07:36:58 -0400
commitb1526421eac9a912b2cda7e147f1da2aa31be278 (patch)
tree5c21474d865bd43dc00514f0a55a84bdf05ba440 /drivers/media/video/cx18/cx18-gpio.c
parent4519064c1c7ccdd319d26181bdd12ee2df6e336e (diff)
V4L/DVB (8913): cx18: Create cx18_ specific wrappers for all pci mmio accessesors.
cx18: Create cx18_ specific wrappers for all pci mmio accessesors. This is a first step in instrumenting all CX23418 PCI bus IO, to debug problems with accessing the CX23418's PCI memory mapped IO. Signed-off-by: Andy Walls <awalls@radix.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/cx18/cx18-gpio.c')
-rw-r--r--drivers/media/video/cx18/cx18-gpio.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/drivers/media/video/cx18/cx18-gpio.c b/drivers/media/video/cx18/cx18-gpio.c
index 3d495dba4983..3bdffbf7a96d 100644
--- a/drivers/media/video/cx18/cx18-gpio.c
+++ b/drivers/media/video/cx18/cx18-gpio.c
@@ -22,6 +22,7 @@
22 */ 22 */
23 23
24#include "cx18-driver.h" 24#include "cx18-driver.h"
25#include "cx18-io.h"
25#include "cx18-cards.h" 26#include "cx18-cards.h"
26#include "cx18-gpio.h" 27#include "cx18-gpio.h"
27#include "tuner-xc2028.h" 28#include "tuner-xc2028.h"
@@ -49,11 +50,11 @@ static void gpio_write(struct cx18 *cx)
49 u32 dir = cx->gpio_dir; 50 u32 dir = cx->gpio_dir;
50 u32 val = cx->gpio_val; 51 u32 val = cx->gpio_val;
51 52
52 write_reg((dir & 0xffff) << 16, CX18_REG_GPIO_DIR1); 53 cx18_write_reg(cx, (dir & 0xffff) << 16, CX18_REG_GPIO_DIR1);
53 write_reg(((dir & 0xffff) << 16) | (val & 0xffff), 54 cx18_write_reg(cx, ((dir & 0xffff) << 16) | (val & 0xffff),
54 CX18_REG_GPIO_OUT1); 55 CX18_REG_GPIO_OUT1);
55 write_reg(dir & 0xffff0000, CX18_REG_GPIO_DIR2); 56 cx18_write_reg(cx, dir & 0xffff0000, CX18_REG_GPIO_DIR2);
56 write_reg_sync((dir & 0xffff0000) | ((val & 0xffff0000) >> 16), 57 cx18_write_reg_sync(cx, (dir & 0xffff0000) | ((val & 0xffff0000) >> 16),
57 CX18_REG_GPIO_OUT2); 58 CX18_REG_GPIO_OUT2);
58} 59}
59 60
@@ -141,8 +142,10 @@ void cx18_gpio_init(struct cx18 *cx)
141 } 142 }
142 143
143 CX18_DEBUG_INFO("GPIO initial dir: %08x/%08x out: %08x/%08x\n", 144 CX18_DEBUG_INFO("GPIO initial dir: %08x/%08x out: %08x/%08x\n",
144 read_reg(CX18_REG_GPIO_DIR1), read_reg(CX18_REG_GPIO_DIR2), 145 cx18_read_reg(cx, CX18_REG_GPIO_DIR1),
145 read_reg(CX18_REG_GPIO_OUT1), read_reg(CX18_REG_GPIO_OUT2)); 146 cx18_read_reg(cx, CX18_REG_GPIO_DIR2),
147 cx18_read_reg(cx, CX18_REG_GPIO_OUT1),
148 cx18_read_reg(cx, CX18_REG_GPIO_OUT2));
146 149
147 gpio_write(cx); 150 gpio_write(cx);
148 mutex_unlock(&cx->gpio_lock); 151 mutex_unlock(&cx->gpio_lock);