aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <m.chehab@samsung.com>2014-05-21 12:23:27 -0400
committerMauro Carvalho Chehab <m.chehab@samsung.com>2014-05-25 16:50:14 -0400
commit303ddd9286b604c0c3b8c8761d4ffeed9f5732ae (patch)
treea26bc96fcc76b741b03be93a45546e8ab4442275
parente5bf4a11078d4ed1fa10574ccce325cad2f067c7 (diff)
[media] xc5000: fix CamelCase
There are several CamelCase non-codingstyle compliances here. Fix them. Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
-rw-r--r--drivers/media/tuners/xc5000.c138
1 files changed, 69 insertions, 69 deletions
diff --git a/drivers/media/tuners/xc5000.c b/drivers/media/tuners/xc5000.c
index a5dff9714836..da4c29ed48bd 100644
--- a/drivers/media/tuners/xc5000.c
+++ b/drivers/media/tuners/xc5000.c
@@ -145,16 +145,16 @@ struct xc5000_priv {
145 145
146*/ 146*/
147struct XC_TV_STANDARD { 147struct XC_TV_STANDARD {
148 char *Name; 148 char *name;
149 u16 AudioMode; 149 u16 audio_mode;
150 u16 VideoMode; 150 u16 video_mode;
151}; 151};
152 152
153/* Tuner standards */ 153/* Tuner standards */
154#define MN_NTSC_PAL_BTSC 0 154#define MN_NTSC_PAL_BTSC 0
155#define MN_NTSC_PAL_A2 1 155#define MN_NTSC_PAL_A2 1
156#define MN_NTSC_PAL_EIAJ 2 156#define MN_NTSC_PAL_EIAJ 2
157#define MN_NTSC_PAL_Mono 3 157#define MN_NTSC_PAL_MONO 3
158#define BG_PAL_A2 4 158#define BG_PAL_A2 4
159#define BG_PAL_NICAM 5 159#define BG_PAL_NICAM 5
160#define BG_PAL_MONO 6 160#define BG_PAL_MONO 6
@@ -172,11 +172,11 @@ struct XC_TV_STANDARD {
172#define DTV8 18 172#define DTV8 18
173#define DTV7_8 19 173#define DTV7_8 19
174#define DTV7 20 174#define DTV7 20
175#define FM_Radio_INPUT2 21 175#define FM_RADIO_INPUT2 21
176#define FM_Radio_INPUT1 22 176#define FM_RADIO_INPUT1 22
177#define FM_Radio_INPUT1_MONO 23 177#define FM_RADIO_INPUT1_MONO 23
178 178
179static struct XC_TV_STANDARD XC5000_Standard[MAX_TV_STANDARD] = { 179static struct XC_TV_STANDARD xc5000_standard[MAX_TV_STANDARD] = {
180 {"M/N-NTSC/PAL-BTSC", 0x0400, 0x8020}, 180 {"M/N-NTSC/PAL-BTSC", 0x0400, 0x8020},
181 {"M/N-NTSC/PAL-A2", 0x0600, 0x8020}, 181 {"M/N-NTSC/PAL-A2", 0x0600, 0x8020},
182 {"M/N-NTSC/PAL-EIAJ", 0x0440, 0x8020}, 182 {"M/N-NTSC/PAL-EIAJ", 0x0440, 0x8020},
@@ -242,7 +242,7 @@ static inline const struct xc5000_fw_cfg *xc5000_assign_firmware(int chip_id)
242static int xc_load_fw_and_init_tuner(struct dvb_frontend *fe, int force); 242static int xc_load_fw_and_init_tuner(struct dvb_frontend *fe, int force);
243static int xc5000_is_firmware_loaded(struct dvb_frontend *fe); 243static int xc5000_is_firmware_loaded(struct dvb_frontend *fe);
244static int xc5000_readreg(struct xc5000_priv *priv, u16 reg, u16 *val); 244static int xc5000_readreg(struct xc5000_priv *priv, u16 reg, u16 *val);
245static int xc5000_TunerReset(struct dvb_frontend *fe); 245static int xc5000_tuner_reset(struct dvb_frontend *fe);
246 246
247static int xc_send_i2c_data(struct xc5000_priv *priv, u8 *buf, int len) 247static int xc_send_i2c_data(struct xc5000_priv *priv, u8 *buf, int len)
248{ 248{
@@ -293,7 +293,7 @@ static int xc5000_readreg(struct xc5000_priv *priv, u16 reg, u16 *val)
293 return 0; 293 return 0;
294} 294}
295 295
296static int xc5000_TunerReset(struct dvb_frontend *fe) 296static int xc5000_tuner_reset(struct dvb_frontend *fe)
297{ 297{
298 struct xc5000_priv *priv = fe->tuner_priv; 298 struct xc5000_priv *priv = fe->tuner_priv;
299 int ret; 299 int ret;
@@ -317,20 +317,20 @@ static int xc5000_TunerReset(struct dvb_frontend *fe)
317 return 0; 317 return 0;
318} 318}
319 319
320static int xc_write_reg(struct xc5000_priv *priv, u16 regAddr, u16 i2cData) 320static int xc_write_reg(struct xc5000_priv *priv, u16 reg_addr, u16 i2c_data)
321{ 321{
322 u8 buf[4]; 322 u8 buf[4];
323 int WatchDogTimer = 100; 323 int watch_dog_timer = 100;
324 int result; 324 int result;
325 325
326 buf[0] = (regAddr >> 8) & 0xFF; 326 buf[0] = (reg_addr >> 8) & 0xFF;
327 buf[1] = regAddr & 0xFF; 327 buf[1] = reg_addr & 0xFF;
328 buf[2] = (i2cData >> 8) & 0xFF; 328 buf[2] = (i2c_data >> 8) & 0xFF;
329 buf[3] = i2cData & 0xFF; 329 buf[3] = i2c_data & 0xFF;
330 result = xc_send_i2c_data(priv, buf, 4); 330 result = xc_send_i2c_data(priv, buf, 4);
331 if (result == 0) { 331 if (result == 0) {
332 /* wait for busy flag to clear */ 332 /* wait for busy flag to clear */
333 while ((WatchDogTimer > 0) && (result == 0)) { 333 while ((watch_dog_timer > 0) && (result == 0)) {
334 result = xc5000_readreg(priv, XREG_BUSY, (u16 *)buf); 334 result = xc5000_readreg(priv, XREG_BUSY, (u16 *)buf);
335 if (result == 0) { 335 if (result == 0) {
336 if ((buf[0] == 0) && (buf[1] == 0)) { 336 if ((buf[0] == 0) && (buf[1] == 0)) {
@@ -338,12 +338,12 @@ static int xc_write_reg(struct xc5000_priv *priv, u16 regAddr, u16 i2cData)
338 break; 338 break;
339 } else { 339 } else {
340 msleep(5); /* wait 5 ms */ 340 msleep(5); /* wait 5 ms */
341 WatchDogTimer--; 341 watch_dog_timer--;
342 } 342 }
343 } 343 }
344 } 344 }
345 } 345 }
346 if (WatchDogTimer <= 0) 346 if (watch_dog_timer <= 0)
347 result = -EREMOTEIO; 347 result = -EREMOTEIO;
348 348
349 return result; 349 return result;
@@ -363,7 +363,7 @@ static int xc_load_i2c_sequence(struct dvb_frontend *fe, const u8 *i2c_sequence)
363 len = i2c_sequence[index] * 256 + i2c_sequence[index+1]; 363 len = i2c_sequence[index] * 256 + i2c_sequence[index+1];
364 if (len == 0x0000) { 364 if (len == 0x0000) {
365 /* RESET command */ 365 /* RESET command */
366 result = xc5000_TunerReset(fe); 366 result = xc5000_tuner_reset(fe);
367 index += 2; 367 index += 2;
368 if (result != 0) 368 if (result != 0)
369 return result; 369 return result;
@@ -409,29 +409,29 @@ static int xc_initialize(struct xc5000_priv *priv)
409 return xc_write_reg(priv, XREG_INIT, 0); 409 return xc_write_reg(priv, XREG_INIT, 0);
410} 410}
411 411
412static int xc_SetTVStandard(struct xc5000_priv *priv, 412static int xc_set_tv_standard(struct xc5000_priv *priv,
413 u16 VideoMode, u16 AudioMode, u8 RadioMode) 413 u16 video_mode, u16 audio_mode, u8 radio_mode)
414{ 414{
415 int ret; 415 int ret;
416 dprintk(1, "%s(0x%04x,0x%04x)\n", __func__, VideoMode, AudioMode); 416 dprintk(1, "%s(0x%04x,0x%04x)\n", __func__, video_mode, audio_mode);
417 if (RadioMode) { 417 if (radio_mode) {
418 dprintk(1, "%s() Standard = %s\n", 418 dprintk(1, "%s() Standard = %s\n",
419 __func__, 419 __func__,
420 XC5000_Standard[RadioMode].Name); 420 xc5000_standard[radio_mode].name);
421 } else { 421 } else {
422 dprintk(1, "%s() Standard = %s\n", 422 dprintk(1, "%s() Standard = %s\n",
423 __func__, 423 __func__,
424 XC5000_Standard[priv->video_standard].Name); 424 xc5000_standard[priv->video_standard].name);
425 } 425 }
426 426
427 ret = xc_write_reg(priv, XREG_VIDEO_MODE, VideoMode); 427 ret = xc_write_reg(priv, XREG_VIDEO_MODE, video_mode);
428 if (ret == 0) 428 if (ret == 0)
429 ret = xc_write_reg(priv, XREG_AUDIO_MODE, AudioMode); 429 ret = xc_write_reg(priv, XREG_AUDIO_MODE, audio_mode);
430 430
431 return ret; 431 return ret;
432} 432}
433 433
434static int xc_SetSignalSource(struct xc5000_priv *priv, u16 rf_mode) 434static int xc_set_signal_source(struct xc5000_priv *priv, u16 rf_mode)
435{ 435{
436 dprintk(1, "%s(%d) Source = %s\n", __func__, rf_mode, 436 dprintk(1, "%s(%d) Source = %s\n", __func__, rf_mode,
437 rf_mode == XC_RF_MODE_AIR ? "ANTENNA" : "CABLE"); 437 rf_mode == XC_RF_MODE_AIR ? "ANTENNA" : "CABLE");
@@ -447,7 +447,7 @@ static int xc_SetSignalSource(struct xc5000_priv *priv, u16 rf_mode)
447 447
448static const struct dvb_tuner_ops xc5000_tuner_ops; 448static const struct dvb_tuner_ops xc5000_tuner_ops;
449 449
450static int xc_set_RF_frequency(struct xc5000_priv *priv, u32 freq_hz) 450static int xc_set_rf_frequency(struct xc5000_priv *priv, u32 freq_hz)
451{ 451{
452 u16 freq_code; 452 u16 freq_code;
453 453
@@ -476,7 +476,7 @@ static int xc_set_IF_frequency(struct xc5000_priv *priv, u32 freq_khz)
476} 476}
477 477
478 478
479static int xc_get_ADC_Envelope(struct xc5000_priv *priv, u16 *adc_envelope) 479static int xc_get_adc_envelope(struct xc5000_priv *priv, u16 *adc_envelope)
480{ 480{
481 return xc5000_readreg(priv, XREG_ADC_ENV, adc_envelope); 481 return xc5000_readreg(priv, XREG_ADC_ENV, adc_envelope);
482} 482}
@@ -484,14 +484,14 @@ static int xc_get_ADC_Envelope(struct xc5000_priv *priv, u16 *adc_envelope)
484static int xc_get_frequency_error(struct xc5000_priv *priv, u32 *freq_error_hz) 484static int xc_get_frequency_error(struct xc5000_priv *priv, u32 *freq_error_hz)
485{ 485{
486 int result; 486 int result;
487 u16 regData; 487 u16 reg_data;
488 u32 tmp; 488 u32 tmp;
489 489
490 result = xc5000_readreg(priv, XREG_FREQ_ERROR, &regData); 490 result = xc5000_readreg(priv, XREG_FREQ_ERROR, &reg_data);
491 if (result != 0) 491 if (result != 0)
492 return result; 492 return result;
493 493
494 tmp = (u32)regData; 494 tmp = (u32)reg_data;
495 (*freq_error_hz) = (tmp * 15625) / 1000; 495 (*freq_error_hz) = (tmp * 15625) / 1000;
496 return result; 496 return result;
497} 497}
@@ -527,14 +527,14 @@ static int xc_get_buildversion(struct xc5000_priv *priv, u16 *buildrev)
527 527
528static int xc_get_hsync_freq(struct xc5000_priv *priv, u32 *hsync_freq_hz) 528static int xc_get_hsync_freq(struct xc5000_priv *priv, u32 *hsync_freq_hz)
529{ 529{
530 u16 regData; 530 u16 reg_data;
531 int result; 531 int result;
532 532
533 result = xc5000_readreg(priv, XREG_HSYNC_FREQ, &regData); 533 result = xc5000_readreg(priv, XREG_HSYNC_FREQ, &reg_data);
534 if (result != 0) 534 if (result != 0)
535 return result; 535 return result;
536 536
537 (*hsync_freq_hz) = ((regData & 0x0fff) * 763)/100; 537 (*hsync_freq_hz) = ((reg_data & 0x0fff) * 763)/100;
538 return result; 538 return result;
539} 539}
540 540
@@ -558,19 +558,19 @@ static int xc_get_totalgain(struct xc5000_priv *priv, u16 *totalgain)
558 return xc5000_readreg(priv, XREG_TOTALGAIN, totalgain); 558 return xc5000_readreg(priv, XREG_TOTALGAIN, totalgain);
559} 559}
560 560
561static u16 WaitForLock(struct xc5000_priv *priv) 561static u16 wait_for_lock(struct xc5000_priv *priv)
562{ 562{
563 u16 lockState = 0; 563 u16 lock_state = 0;
564 int watchDogCount = 40; 564 int watch_dog_count = 40;
565 565
566 while ((lockState == 0) && (watchDogCount > 0)) { 566 while ((lock_state == 0) && (watch_dog_count > 0)) {
567 xc_get_lock_status(priv, &lockState); 567 xc_get_lock_status(priv, &lock_state);
568 if (lockState != 1) { 568 if (lock_state != 1) {
569 msleep(5); 569 msleep(5);
570 watchDogCount--; 570 watch_dog_count--;
571 } 571 }
572 } 572 }
573 return lockState; 573 return lock_state;
574} 574}
575 575
576#define XC_TUNE_ANALOG 0 576#define XC_TUNE_ANALOG 0
@@ -581,11 +581,11 @@ static int xc_tune_channel(struct xc5000_priv *priv, u32 freq_hz, int mode)
581 581
582 dprintk(1, "%s(%u)\n", __func__, freq_hz); 582 dprintk(1, "%s(%u)\n", __func__, freq_hz);
583 583
584 if (xc_set_RF_frequency(priv, freq_hz) != 0) 584 if (xc_set_rf_frequency(priv, freq_hz) != 0)
585 return 0; 585 return 0;
586 586
587 if (mode == XC_TUNE_ANALOG) { 587 if (mode == XC_TUNE_ANALOG) {
588 if (WaitForLock(priv) == 1) 588 if (wait_for_lock(priv) == 1)
589 found = 1; 589 found = 1;
590 } 590 }
591 591
@@ -684,7 +684,7 @@ static void xc_debug_dump(struct xc5000_priv *priv)
684 */ 684 */
685 msleep(100); 685 msleep(100);
686 686
687 xc_get_ADC_Envelope(priv, &adc_envelope); 687 xc_get_adc_envelope(priv, &adc_envelope);
688 dprintk(1, "*** ADC envelope (0-1023) = %d\n", adc_envelope); 688 dprintk(1, "*** ADC envelope (0-1023) = %d\n", adc_envelope);
689 689
690 xc_get_frequency_error(priv, &freq_error_hz); 690 xc_get_frequency_error(priv, &freq_error_hz);
@@ -807,19 +807,19 @@ static int xc5000_set_params(struct dvb_frontend *fe)
807 dprintk(1, "%s() frequency=%d (compensated to %d)\n", 807 dprintk(1, "%s() frequency=%d (compensated to %d)\n",
808 __func__, freq, priv->freq_hz); 808 __func__, freq, priv->freq_hz);
809 809
810 ret = xc_SetSignalSource(priv, priv->rf_mode); 810 ret = xc_set_signal_source(priv, priv->rf_mode);
811 if (ret != 0) { 811 if (ret != 0) {
812 printk(KERN_ERR 812 printk(KERN_ERR
813 "xc5000: xc_SetSignalSource(%d) failed\n", 813 "xc5000: xc_set_signal_source(%d) failed\n",
814 priv->rf_mode); 814 priv->rf_mode);
815 return -EREMOTEIO; 815 return -EREMOTEIO;
816 } 816 }
817 817
818 ret = xc_SetTVStandard(priv, 818 ret = xc_set_tv_standard(priv,
819 XC5000_Standard[priv->video_standard].VideoMode, 819 xc5000_standard[priv->video_standard].video_mode,
820 XC5000_Standard[priv->video_standard].AudioMode, 0); 820 xc5000_standard[priv->video_standard].audio_mode, 0);
821 if (ret != 0) { 821 if (ret != 0) {
822 printk(KERN_ERR "xc5000: xc_SetTVStandard failed\n"); 822 printk(KERN_ERR "xc5000: xc_set_tv_standard failed\n");
823 return -EREMOTEIO; 823 return -EREMOTEIO;
824 } 824 }
825 825
@@ -923,19 +923,19 @@ static int xc5000_set_tv_freq(struct dvb_frontend *fe,
923 } 923 }
924 924
925tune_channel: 925tune_channel:
926 ret = xc_SetSignalSource(priv, priv->rf_mode); 926 ret = xc_set_signal_source(priv, priv->rf_mode);
927 if (ret != 0) { 927 if (ret != 0) {
928 printk(KERN_ERR 928 printk(KERN_ERR
929 "xc5000: xc_SetSignalSource(%d) failed\n", 929 "xc5000: xc_set_signal_source(%d) failed\n",
930 priv->rf_mode); 930 priv->rf_mode);
931 return -EREMOTEIO; 931 return -EREMOTEIO;
932 } 932 }
933 933
934 ret = xc_SetTVStandard(priv, 934 ret = xc_set_tv_standard(priv,
935 XC5000_Standard[priv->video_standard].VideoMode, 935 xc5000_standard[priv->video_standard].video_mode,
936 XC5000_Standard[priv->video_standard].AudioMode, 0); 936 xc5000_standard[priv->video_standard].audio_mode, 0);
937 if (ret != 0) { 937 if (ret != 0) {
938 printk(KERN_ERR "xc5000: xc_SetTVStandard failed\n"); 938 printk(KERN_ERR "xc5000: xc_set_tv_standard failed\n");
939 return -EREMOTEIO; 939 return -EREMOTEIO;
940 } 940 }
941 941
@@ -980,11 +980,11 @@ static int xc5000_set_radio_freq(struct dvb_frontend *fe,
980 } 980 }
981 981
982 if (priv->radio_input == XC5000_RADIO_FM1) 982 if (priv->radio_input == XC5000_RADIO_FM1)
983 radio_input = FM_Radio_INPUT1; 983 radio_input = FM_RADIO_INPUT1;
984 else if (priv->radio_input == XC5000_RADIO_FM2) 984 else if (priv->radio_input == XC5000_RADIO_FM2)
985 radio_input = FM_Radio_INPUT2; 985 radio_input = FM_RADIO_INPUT2;
986 else if (priv->radio_input == XC5000_RADIO_FM1_MONO) 986 else if (priv->radio_input == XC5000_RADIO_FM1_MONO)
987 radio_input = FM_Radio_INPUT1_MONO; 987 radio_input = FM_RADIO_INPUT1_MONO;
988 else { 988 else {
989 dprintk(1, "%s() unknown radio input %d\n", __func__, 989 dprintk(1, "%s() unknown radio input %d\n", __func__,
990 priv->radio_input); 990 priv->radio_input);
@@ -995,18 +995,18 @@ static int xc5000_set_radio_freq(struct dvb_frontend *fe,
995 995
996 priv->rf_mode = XC_RF_MODE_AIR; 996 priv->rf_mode = XC_RF_MODE_AIR;
997 997
998 ret = xc_SetTVStandard(priv, XC5000_Standard[radio_input].VideoMode, 998 ret = xc_set_tv_standard(priv, xc5000_standard[radio_input].video_mode,
999 XC5000_Standard[radio_input].AudioMode, radio_input); 999 xc5000_standard[radio_input].audio_mode, radio_input);
1000 1000
1001 if (ret != 0) { 1001 if (ret != 0) {
1002 printk(KERN_ERR "xc5000: xc_SetTVStandard failed\n"); 1002 printk(KERN_ERR "xc5000: xc_set_tv_standard failed\n");
1003 return -EREMOTEIO; 1003 return -EREMOTEIO;
1004 } 1004 }
1005 1005
1006 ret = xc_SetSignalSource(priv, priv->rf_mode); 1006 ret = xc_set_signal_source(priv, priv->rf_mode);
1007 if (ret != 0) { 1007 if (ret != 0) {
1008 printk(KERN_ERR 1008 printk(KERN_ERR
1009 "xc5000: xc_SetSignalSource(%d) failed\n", 1009 "xc5000: xc_set_signal_source(%d) failed\n",
1010 priv->rf_mode); 1010 priv->rf_mode);
1011 return -EREMOTEIO; 1011 return -EREMOTEIO;
1012 } 1012 }
@@ -1177,7 +1177,7 @@ static int xc5000_sleep(struct dvb_frontend *fe)
1177 /* According to Xceive technical support, the "powerdown" register 1177 /* According to Xceive technical support, the "powerdown" register
1178 was removed in newer versions of the firmware. The "supported" 1178 was removed in newer versions of the firmware. The "supported"
1179 way to sleep the tuner is to pull the reset pin low for 10ms */ 1179 way to sleep the tuner is to pull the reset pin low for 10ms */
1180 ret = xc5000_TunerReset(fe); 1180 ret = xc5000_tuner_reset(fe);
1181 if (ret != 0) { 1181 if (ret != 0) {
1182 printk(KERN_ERR 1182 printk(KERN_ERR
1183 "xc5000: %s() unable to shutdown tuner\n", 1183 "xc5000: %s() unable to shutdown tuner\n",