aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/arv.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/arv.c')
-rw-r--r--drivers/media/video/arv.c54
1 files changed, 27 insertions, 27 deletions
diff --git a/drivers/media/video/arv.c b/drivers/media/video/arv.c
index c586f64b6b7f..dbe025170599 100644
--- a/drivers/media/video/arv.c
+++ b/drivers/media/video/arv.c
@@ -161,39 +161,39 @@ void iic(int n, unsigned long addr, unsigned long data1, unsigned long data2,
161{ 161{
162 int i; 162 int i;
163 163
164 /* Slave Address */ 164 /* Slave Address */
165 ar_outl(addr, PLDI2CDATA); 165 ar_outl(addr, PLDI2CDATA);
166 wait_for_vsync(); 166 wait_for_vsync();
167 167
168 /* Start */ 168 /* Start */
169 ar_outl(1, PLDI2CCND); 169 ar_outl(1, PLDI2CCND);
170 wait_acknowledge(); 170 wait_acknowledge();
171 171
172 /* Transfer data 1 */ 172 /* Transfer data 1 */
173 ar_outl(data1, PLDI2CDATA); 173 ar_outl(data1, PLDI2CDATA);
174 wait_for_vsync(); 174 wait_for_vsync();
175 ar_outl(PLDI2CSTEN_STEN, PLDI2CSTEN); 175 ar_outl(PLDI2CSTEN_STEN, PLDI2CSTEN);
176 wait_acknowledge(); 176 wait_acknowledge();
177 177
178 /* Transfer data 2 */ 178 /* Transfer data 2 */
179 ar_outl(data2, PLDI2CDATA); 179 ar_outl(data2, PLDI2CDATA);
180 wait_for_vsync(); 180 wait_for_vsync();
181 ar_outl(PLDI2CSTEN_STEN, PLDI2CSTEN); 181 ar_outl(PLDI2CSTEN_STEN, PLDI2CSTEN);
182 wait_acknowledge(); 182 wait_acknowledge();
183 183
184 if (n == 3) { 184 if (n == 3) {
185 /* Transfer data 3 */ 185 /* Transfer data 3 */
186 ar_outl(data3, PLDI2CDATA); 186 ar_outl(data3, PLDI2CDATA);
187 wait_for_vsync(); 187 wait_for_vsync();
188 ar_outl(PLDI2CSTEN_STEN, PLDI2CSTEN); 188 ar_outl(PLDI2CSTEN_STEN, PLDI2CSTEN);
189 wait_acknowledge(); 189 wait_acknowledge();
190 } 190 }
191 191
192 /* Stop */ 192 /* Stop */
193 for (i = 0; i < 100; i++) 193 for (i = 0; i < 100; i++)
194 cpu_relax(); 194 cpu_relax();
195 ar_outl(2, PLDI2CCND); 195 ar_outl(2, PLDI2CCND);
196 ar_outl(2, PLDI2CCND); 196 ar_outl(2, PLDI2CCND);
197 197
198 while (ar_inl(PLDI2CSTS) & PLDI2CSTS_BB) 198 while (ar_inl(PLDI2CSTS) & PLDI2CSTS_BB)
199 cpu_relax(); 199 cpu_relax();
@@ -204,24 +204,24 @@ void init_iic(void)
204{ 204{
205 DEBUG(1, "init_iic:\n"); 205 DEBUG(1, "init_iic:\n");
206 206
207 /* 207 /*
208 * ICU Setting (iic) 208 * ICU Setting (iic)
209 */ 209 */
210 /* I2C Setting */ 210 /* I2C Setting */
211 ar_outl(0x0, PLDI2CCR); /* I2CCR Disable */ 211 ar_outl(0x0, PLDI2CCR); /* I2CCR Disable */
212 ar_outl(0x0300, PLDI2CMOD); /* I2CMOD ACK/8b-data/7b-addr/auto */ 212 ar_outl(0x0300, PLDI2CMOD); /* I2CMOD ACK/8b-data/7b-addr/auto */
213 ar_outl(0x1, PLDI2CACK); /* I2CACK ACK */ 213 ar_outl(0x1, PLDI2CACK); /* I2CACK ACK */
214 214
215 /* I2C CLK */ 215 /* I2C CLK */
216 /* 50MH-100k */ 216 /* 50MH-100k */
217 if (freq == 75) { 217 if (freq == 75) {
218 ar_outl(369, PLDI2CFREQ); /* BCLK = 75MHz */ 218 ar_outl(369, PLDI2CFREQ); /* BCLK = 75MHz */
219 } else if (freq == 50) { 219 } else if (freq == 50) {
220 ar_outl(244, PLDI2CFREQ); /* BCLK = 50MHz */ 220 ar_outl(244, PLDI2CFREQ); /* BCLK = 50MHz */
221 } else { 221 } else {
222 ar_outl(244, PLDI2CFREQ); /* default: BCLK = 50MHz */ 222 ar_outl(244, PLDI2CFREQ); /* default: BCLK = 50MHz */
223 } 223 }
224 ar_outl(0x1, PLDI2CCR); /* I2CCR Enable */ 224 ar_outl(0x1, PLDI2CCR); /* I2CCR Enable */
225} 225}
226 226
227/************************************************************************** 227/**************************************************************************
@@ -253,7 +253,7 @@ static inline void wait_for_vertical_sync(int exp_line)
253 253
254 /* 254 /*
255 * check HCOUNT because we cannot check vertical sync. 255 * check HCOUNT because we cannot check vertical sync.
256 */ 256 */
257 for (; tmout >= 0; tmout--) { 257 for (; tmout >= 0; tmout--) {
258 l = ar_inl(ARVHCOUNT); 258 l = ar_inl(ARVHCOUNT);
259 if (l == exp_line) 259 if (l == exp_line)
@@ -562,8 +562,8 @@ static void ar_interrupt(int irq, void *dev, struct pt_regs *regs)
562 /* operations for interlace mode */ 562 /* operations for interlace mode */
563 if ( line_count < (AR_HEIGHT_VGA/2) ) /* even line */ 563 if ( line_count < (AR_HEIGHT_VGA/2) ) /* even line */
564 line_number = (line_count << 1); 564 line_number = (line_count << 1);
565 else /* odd line */ 565 else /* odd line */
566 line_number = 566 line_number =
567 (((line_count - (AR_HEIGHT_VGA/2)) << 1) + 1); 567 (((line_count - (AR_HEIGHT_VGA/2)) << 1) + 1);
568 } else { 568 } else {
569 line_number = line_count; 569 line_number = line_count;
@@ -651,7 +651,7 @@ static int ar_initialize(struct video_device *dev)
651 cr |= ARVCR1_NORMAL; 651 cr |= ARVCR1_NORMAL;
652 ar_outl(cr, ARVCR1); 652 ar_outl(cr, ARVCR1);
653 653
654 /* 654 /*
655 * Initialize IIC so that CPU can communicate with AR LSI, 655 * Initialize IIC so that CPU can communicate with AR LSI,
656 * and send boot commands to AR LSI. 656 * and send boot commands to AR LSI.
657 */ 657 */
@@ -846,7 +846,7 @@ static int __init ar_init(void)
846 * so register video device as a frame grabber type. 846 * so register video device as a frame grabber type.
847 * device is named "video[0-64]". 847 * device is named "video[0-64]".
848 * video_register_device() initializes h/w using ar_initialize(). 848 * video_register_device() initializes h/w using ar_initialize().
849 */ 849 */
850 if (video_register_device(ar->vdev, VFL_TYPE_GRABBER, video_nr) != 0) { 850 if (video_register_device(ar->vdev, VFL_TYPE_GRABBER, video_nr) != 0) {
851 /* return -1, -ENFILE(full) or others */ 851 /* return -1, -ENFILE(full) or others */
852 printk("arv: register video (Colour AR) failed.\n"); 852 printk("arv: register video (Colour AR) failed.\n");