Commit 18349f40 authored by Matthias Schwarzott's avatar Matthias Schwarzott Committed by Mauro Carvalho Chehab

[media] si2165: fix checkpatch issues

Signed-off-by: default avatarMatthias Schwarzott <zzam@gentoo.org>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
parent 599bedb7
/* /*
Driver for Silicon Labs Si2161 DVB-T and Si2165 DVB-C/-T Demodulator * Driver for Silicon Labs Si2161 DVB-T and Si2165 DVB-C/-T Demodulator
*
Copyright (C) 2013-2014 Matthias Schwarzott <zzam@gentoo.org> * Copyright (C) 2013-2014 Matthias Schwarzott <zzam@gentoo.org>
*
This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
(at your option) any later version. * (at your option) any later version.
*
This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. * GNU General Public License for more details.
*
References: * References:
http://www.silabs.com/Support%20Documents/TechnicalDocs/Si2165-short.pdf * http://www.silabs.com/Support%20Documents/TechnicalDocs/Si2165-short.pdf
*/ */
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/errno.h> #include <linux/errno.h>
...@@ -31,11 +31,13 @@ ...@@ -31,11 +31,13 @@
#include "si2165_priv.h" #include "si2165_priv.h"
#include "si2165.h" #include "si2165.h"
/* Hauppauge WinTV-HVR-930C-HD B130 / PCTV QuatroStick 521e 1113xx /*
* uses 16 MHz xtal */ * Hauppauge WinTV-HVR-930C-HD B130 / PCTV QuatroStick 521e 1113xx
* uses 16 MHz xtal
/* Hauppauge WinTV-HVR-930C-HD B131 / PCTV QuatroStick 522e 1114xx *
* uses 24 MHz clock provided by tuner */ * Hauppauge WinTV-HVR-930C-HD B131 / PCTV QuatroStick 522e 1114xx
* uses 24 MHz clock provided by tuner
*/
struct si2165_state { struct si2165_state {
struct i2c_adapter *i2c; struct i2c_adapter *i2c;
...@@ -258,8 +260,10 @@ static int si2165_init_pll(struct si2165_state *state) ...@@ -258,8 +260,10 @@ static int si2165_init_pll(struct si2165_state *state)
u8 divl = 12; u8 divl = 12;
u8 buf[4]; u8 buf[4];
/* hardcoded values can be deleted if calculation is verified /*
* or it yields the same values as the windows driver */ * hardcoded values can be deleted if calculation is verified
* or it yields the same values as the windows driver
*/
switch (ref_freq_Hz) { switch (ref_freq_Hz) {
case 16000000u: case 16000000u:
divn = 56; divn = 56;
...@@ -274,8 +278,10 @@ static int si2165_init_pll(struct si2165_state *state) ...@@ -274,8 +278,10 @@ static int si2165_init_pll(struct si2165_state *state)
if (ref_freq_Hz > 16000000u) if (ref_freq_Hz > 16000000u)
divr = 2; divr = 2;
/* now select divn and divp such that /*
* fvco is in 1624..1824 MHz */ * now select divn and divp such that
* fvco is in 1624..1824 MHz
*/
if (1624000000u * divr > ref_freq_Hz * 2u * 63u) if (1624000000u * divr > ref_freq_Hz * 2u * 63u)
divp = 4; divp = 4;
...@@ -341,10 +347,12 @@ static int si2165_upload_firmware_block(struct si2165_state *state, ...@@ -341,10 +347,12 @@ static int si2165_upload_firmware_block(struct si2165_state *state,
if (len % 4 != 0) if (len % 4 != 0)
return -EINVAL; return -EINVAL;
deb_fw_load("si2165_upload_firmware_block called with len=0x%x offset=0x%x blockcount=0x%x\n", deb_fw_load(
"si2165_upload_firmware_block called with len=0x%x offset=0x%x blockcount=0x%x\n",
len, offset, block_count); len, offset, block_count);
while (offset+12 <= len && cur_block < block_count) { while (offset+12 <= len && cur_block < block_count) {
deb_fw_load("si2165_upload_firmware_block in while len=0x%x offset=0x%x cur_block=0x%x blockcount=0x%x\n", deb_fw_load(
"si2165_upload_firmware_block in while len=0x%x offset=0x%x cur_block=0x%x blockcount=0x%x\n",
len, offset, cur_block, block_count); len, offset, cur_block, block_count);
wordcount = data[offset]; wordcount = data[offset];
if (wordcount < 1 || data[offset+1] || if (wordcount < 1 || data[offset+1] ||
...@@ -383,7 +391,8 @@ static int si2165_upload_firmware_block(struct si2165_state *state, ...@@ -383,7 +391,8 @@ static int si2165_upload_firmware_block(struct si2165_state *state,
cur_block++; cur_block++;
} }
deb_fw_load("si2165_upload_firmware_block after while len=0x%x offset=0x%x cur_block=0x%x blockcount=0x%x\n", deb_fw_load(
"si2165_upload_firmware_block after while len=0x%x offset=0x%x cur_block=0x%x blockcount=0x%x\n",
len, offset, cur_block, block_count); len, offset, cur_block, block_count);
if (poffset) if (poffset)
...@@ -633,7 +642,7 @@ static int si2165_init(struct dvb_frontend *fe) ...@@ -633,7 +642,7 @@ static int si2165_init(struct dvb_frontend *fe)
goto error; goto error;
/* ber_pkt */ /* ber_pkt */
ret = si2165_writereg16(state, 0x0470 , 0x7530); ret = si2165_writereg16(state, 0x0470, 0x7530);
if (ret < 0) if (ret < 0)
goto error; goto error;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment