summaryrefslogtreecommitdiffstats
path: root/api
diff options
context:
space:
mode:
authorOliver Schinagl <oliver@schinagl.nl>2012-02-21 15:32:26 (GMT)
committerOliver Schinagl <oliver@schinagl.nl>2012-02-21 15:32:26 (GMT)
commit93553faeed1c4b0f03141bbb6791bafa8be4814d (patch)
treead2f645d26829bfee0961e980b8ba1d25d86d49c /api
parentb81b507a2fc2fffc3b46ddbbc1f2c665a6a71d53 (diff)
downloadAF903x_SRC-93553faeed1c4b0f03141bbb6791bafa8be4814d.zip
AF903x_SRC-93553faeed1c4b0f03141bbb6791bafa8be4814d.tar.gz
AF903x_SRC-93553faeed1c4b0f03141bbb6791bafa8be4814d.tar.bz2
Fix compilation errors
Thanks to Jozef Gercak <gercakj@gmail.com> some compilation errors are fixed.
Diffstat (limited to 'api')
-rw-r--r--api/driver_tua8010.c4
-rw-r--r--api/driver_tua9001.c8
-rw-r--r--api/i2c_driver.c2
-rw-r--r--api/i2c_driver.h2
-rw-r--r--api/standard.c90
-rw-r--r--api/type.h11
-rw-r--r--api/usb2impl.c13
7 files changed, 66 insertions, 64 deletions
diff --git a/api/driver_tua8010.c b/api/driver_tua8010.c
index 7c9b0ec..6f34bde 100644
--- a/api/driver_tua8010.c
+++ b/api/driver_tua8010.c
@@ -31,8 +31,8 @@ Local compiler keeys ( usage depends on the application )
============================================================================*/
#define CRYSTAL_26_MHZ
-//#define CRYSTAL_19.2_MHZ
-//#define CRYSTAL_20.48_MHZ
+//#define CRYSTAL_19_MHZ
+//#define CRYSTAL_20_MHZ
//#define AGC_BY_IIC
//#define AGC_BY_AGC_BUS
diff --git a/api/driver_tua9001.c b/api/driver_tua9001.c
index cf61fe9..04e2f76 100644
--- a/api/driver_tua9001.c
+++ b/api/driver_tua9001.c
@@ -32,8 +32,8 @@ Local compiler keeys ( usage depends on the application )
============================================================================*/
#define CRYSTAL_26_MHZ
-//#define CRYSTAL_19.2_MHZ
-//#define CRYSTAL_20.48_MHZ
+//#define CRYSTAL_19_MHZ
+//#define CRYSTAL_20_MHZ
//#define AGC_BY_IIC
#define AGC_BY_AGC_BUS
@@ -175,13 +175,13 @@ int initializeTua9001 (void)
i2cseq[1] = 0x78;
i2cBusWrite (TUNERs_TUA9001_DEVADDR, 0x40, i2cseq, 2);
-#elif defined(CRYSTAL_19.2_MHZ) /* Frequency 19.2 MHz */
+#elif defined(CRYSTAL_19_MHZ) /* Frequency 19.2 MHz */
i2cseq[0] = 0x01;
i2cseq[1] = 0xA0;
i2cBusWrite (TUNERs_TUA9001_DEVADDR, 0x1d, i2cseq, 2);
/* Note: Insert optimised register values for 0x40 / 0x41 for used crystal */
/* contact application support for further information */
-#elif defined(CRYSTAL_20.48_MHZ) /* Frequency 20,48 MHz */
+#elif defined(CRYSTAL_20_MHZ) /* Frequency 20.48 MHz */
i2cseq[0] = 0x01;
i2cseq[1] = 0xA8;
i2cBusWrite (TUNERs_TUA9001_DEVADDR, 0x1d, i2cseq, 2);
diff --git a/api/i2c_driver.c b/api/i2c_driver.c
index 5c5460d..ef6285d 100644
--- a/api/i2c_driver.c
+++ b/api/i2c_driver.c
@@ -37,7 +37,7 @@ int xc_read_i2c_data(unsigned char *bytes_received, int nb_bytes_to_receive)
return (error);
}
-int xc_reset()
+int xc_reset(void)
{
Dword error = Error_NO_ERROR;
diff --git a/api/i2c_driver.h b/api/i2c_driver.h
index 7826dce..5a76504 100644
--- a/api/i2c_driver.h
+++ b/api/i2c_driver.h
@@ -12,7 +12,7 @@ int xc_send_i2c_data(unsigned char *bytes_to_send, int nb_bytes_to_send);
int xc_read_i2c_data(unsigned char *bytes_received, int nb_bytes_to_receive);
// Does hardware reset
-int xc_reset();
+int xc_reset(void);
// Waits for wait_ms milliseconds
void xc_wait(int wait_ms);
diff --git a/api/standard.c b/api/standard.c
index bcbe2fc..c677234 100644
--- a/api/standard.c
+++ b/api/standard.c
@@ -1,8 +1,6 @@
#include "standard.h"
#include "cmd.h"
#include "user.h"
-
-
#include "firmware.h"
#ifndef Firmware_FORMAT_VER1
@@ -108,7 +106,7 @@ Dword Standard_getDriver (
/** Close the key */
RegCloseKey(hKey);
-exit :
+exit:
*handle = CreateFile (name, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL);
return (error);
@@ -231,7 +229,7 @@ Dword Standard_computeFcw (
*fcw = controlWord & 0x7FFFFF;
-exit :
+exit:
return (error);
}
@@ -269,7 +267,7 @@ Dword Standard_programFcw (
error = Standard_writeRegister (demodulator, chip, Processor_OFDM, p_reg_bfs_fcw_22_16, temp2);
if (error) goto exit;
-exit :
+exit:
return (error);
}
@@ -295,7 +293,7 @@ Dword Standard_maskDcaOutput (
User_delay (demodulator, 5);
}
-exit :
+exit:
return (error);
}
@@ -935,7 +933,7 @@ Dword Standard_selectBandwidth (
error = Standard_writeRegisters (demodulator, chip, Processor_OFDM, cfoe_NS_2048_coeff1_25_24, 36, buffer);
if (error) goto exit;
-exit :
+exit:
return (error);
}
@@ -996,7 +994,7 @@ Dword Standard_setFrequency (
ganymede->frequency[chip] = frequency;
-exit :
+exit:
return (error);
}
@@ -1077,7 +1075,7 @@ Dword Standard_loadFirmware (
if (version == 0)
error = Error_BOOT_FAIL;
-exit :
+exit:
return (error);
}
@@ -1190,7 +1188,7 @@ Dword Standard_loadScript (
if (error) goto exit;
}
-exit :
+exit:
return (error);
}
@@ -1737,7 +1735,7 @@ Dword Standard_readRegisterBits (
#endif
-exit :
+exit:
return (error);
}
@@ -1761,7 +1759,7 @@ Dword Standard_getHardwareVersion (
/** HW Version = HWVer + Top_Ver */
*version = (Dword) (hwVer1 << 8) + (Dword) hwVer0;
-exit :
+exit:
#endif
return (error);
@@ -1826,7 +1824,7 @@ Dword Standard_getFirmwareVersion (
if (error == 0x01000009) { /* Boot code*/
readBuffer[0] = readBuffer[1] = readBuffer[2] = readBuffer[3] = 0;
error = 0;
- } else if (error = 0x010000FA) { /* Firmware code*/
+ } else if (error == 0x010000FA) { /* Firmware code*/
if (processor == Processor_LINK)
{
error = Standard_readRegisters (demodulator, 0, Processor_LINK, 0x83E9, 1, readBuffer);
@@ -1861,7 +1859,7 @@ Dword Standard_getFirmwareVersion (
*version = (Dword) (((Dword) readBuffer[0] << 24) + ((Dword) readBuffer[1] << 16) + ((Dword) readBuffer[2] << 8) + (Dword) readBuffer[3]);
-exit :
+exit:
#endif
return (error);
@@ -1911,7 +1909,7 @@ Dword Standard_getPostVitBer (
*postBitCount = bitCount * 204 * 8;
}
-exit :
+exit:
return (error);
}
@@ -1995,7 +1993,7 @@ Dword Standard_getSignalStrengthDbm (
*strengthDbm = (Long) (temp * -1);
-exit :
+exit:
return (error);
}
@@ -2025,7 +2023,7 @@ Dword Standard_loadIrTable (
}
}
-exit :
+exit:
return (error);
}
@@ -2352,7 +2350,7 @@ Dword Standard_isTpsLocked (
if (error) goto exit;
if (temp) *locked = True;
-exit :
+exit:
#endif
return (error);
@@ -2376,7 +2374,7 @@ Dword Standard_isMpeg2Locked (
if (error) goto exit;
if (temp) *locked = True;
-exit :
+exit:
#endif
return (error);
@@ -2427,10 +2425,7 @@ Dword Standard_isLocked (
}
#else
Ganymede* ganymede;
-
ganymede = (Ganymede*) demodulator;
-
-
*locked = False;
if (ganymede->architecture == Architecture_DCA) {
@@ -2517,7 +2512,7 @@ Dword Standard_isLocked (
ganymede->statistic[i].signalQuality = 0;
ganymede->statistic[i].signalStrength = 20;
}
-
+ return (error);
exit:
#endif
@@ -2571,7 +2566,7 @@ Dword Standard_reset (
if (error) goto exit;
}
-exit :
+exit:
#endif
return (error);
@@ -2662,7 +2657,7 @@ Dword Standard_getChannelModulation (
/** Get frequency */
channelModulation->frequency = ganymede->frequency[chip];
-exit :
+exit:
#endif
return (error);
@@ -2687,32 +2682,29 @@ Dword Standard_acquireChannel (
BOOL result;
AcquireChannelRequest request;
Ganymede* ganymede;
-
ganymede = (Ganymede*) demodulator;
-
if (ganymede->driver != NULL) {
request.chip = chip;
request.frequency = frequency;
request.bandwidth = bandwidth;
result = DeviceIoControl (
- ganymede->driver,
- IOCTL_AFA_DEMOD_ACQUIRECHANNEL,
- &request,
- sizeof (request),
- NULL,
- 0,
- &number,
- NULL
+ ganymede->driver,
+ IOCTL_AFA_DEMOD_ACQUIRECHANNEL,
+ &request,
+ sizeof (request),
+ NULL,
+ 0,
+ &number,
+ NULL
);
error = request.error;
} else {
error = Error_DRIVER_INVALID;
}
#else
- Ganymede* ganymede;
+ Ganymede* ganymede;
ganymede = (Ganymede*) demodulator;
-
if (ganymede->architecture == Architecture_DCA) {
begin = 0;
end = ganymede->chipNumber;
@@ -2737,7 +2729,7 @@ Dword Standard_acquireChannel (
if (error) goto exit;
}
-exit :
+exit:
#endif
return (error);
@@ -2775,7 +2767,6 @@ Dword Standard_setStreamType (
error = Error_DRIVER_INVALID;
}
#else
- Dword warning = Error_NO_ERROR;
Ganymede* ganymede;
Byte i;
@@ -2917,12 +2908,14 @@ Dword Standard_setStreamType (
}
}
break;
+ default:
+ break;
}
error = User_mpegConfig (demodulator);
ganymede->streamType = streamType;
-exit :
+exit:
#endif
return (error);
@@ -3441,7 +3434,7 @@ Dword Standard_getStatistic (
*statistic = ganymede->statistic[chip];
-exit :
+exit:
#endif
return (error);
@@ -3595,7 +3588,6 @@ Dword Standard_getDatagram (
Ganymede* ganymede;
Dword length = 0;
Byte value;
- Bool ready = False;
ganymede = (Ganymede*) demodulator;
@@ -3676,7 +3668,7 @@ Dword Standard_getIrCode (
*code = (Dword) ((readBuffer[0] << 24) + (readBuffer[1] << 16) + (readBuffer[2] << 8) + readBuffer[3]);
-exit :
+exit:
return (error);
}
@@ -3722,7 +3714,7 @@ Dword Standard_reboot (
ganymede->booted = False;
-exit :
+exit:
return (error);
}
@@ -3846,7 +3838,7 @@ Dword Standard_controlPowerSaving (
}
}
-exit :
+exit:
#endif
return (error);
@@ -3939,7 +3931,7 @@ Dword Standard_resetPidFilter (
error = Standard_writeRegisterBits (demodulator, chip, Processor_OFDM, p_mp2if_pid_rst, mp2if_pid_rst_pos, mp2if_pid_rst_len, 1);
if (error) goto exit;
-exit :
+exit:
#endif
return (error);
@@ -4001,7 +3993,7 @@ Dword Standard_addPidToFilter (
error = Standard_writeRegister (demodulator, chip, Processor_OFDM, p_mp2if_pid_index, index);
if (error) goto exit;
-exit :
+exit:
#endif
return (error);
@@ -4056,7 +4048,7 @@ Dword Standard_setBurstSize (
break;
}
-exit :
+exit:
return (error);
}
@@ -4088,6 +4080,6 @@ Dword Standard_getBurstSize (
}
}
-exit :
+exit:
return (error);
}
diff --git a/api/type.h b/api/type.h
index df56aad..d7cf236 100644
--- a/api/type.h
+++ b/api/type.h
@@ -3,6 +3,17 @@
#include "userdef.h"// for Linux
+
+
+#ifdef IN
+#undef IN
+#endif
+
+#ifdef OUT
+#undef OUT
+#endif
+
+
#define IN
#define OUT
#define INOUT
diff --git a/api/usb2impl.c b/api/usb2impl.c
index 30e6265..5fb785a 100644
--- a/api/usb2impl.c
+++ b/api/usb2impl.c
@@ -1,12 +1,11 @@
// all for Linux
-#include <linux/autoconf.h>
+#include <generated/autoconf.h>
#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/init.h>
#include <linux/slab.h>
#include <linux/module.h>
#include <linux/kref.h>
-#include <linux/smp_lock.h>
#include <linux/usb.h>
#include <asm/uaccess.h>
#include <linux/device.h>
@@ -128,17 +127,17 @@ Dword Usb2_writeControlBus (
IN Byte* buffer
) {
-// Ganymede *pGanymede = (Ganymede *)demodulator;
Dword ret,act_len;
ret = 0;
+// printk("- Enter %s Function -\n",__FUNCTION__);
ret = usb_bulk_msg(usb_get_dev(udevs),
usb_sndbulkpipe(usb_get_dev(udevs), 0x02),
buffer,
bufferLength,
&act_len,
100000);
-
- if (ret) deb_data(" Usb2_writeControlBus fail : %d!\n", ret);
+
+ if (ret) printk(" Usb2_writeControlBus fail : %d!\n", (int) ret);
return (Error_NO_ERROR);
}
@@ -150,9 +149,9 @@ Dword Usb2_readControlBus (
OUT Byte* buffer
) {
-// Ganymede *pGanymede = (Ganymede *)demodulator;
Dword ret, nBytesRead;
ret = 0;
+// printk("- Enter %s Function -\n",__FUNCTION__);
ret = usb_bulk_msg(usb_get_dev(udevs),
usb_rcvbulkpipe(usb_get_dev(udevs),129),
buffer,
@@ -161,7 +160,7 @@ Dword Usb2_readControlBus (
100000);
- if (ret) deb_data(" Usb2_readControlBus fail : %d!\n", ret);
+ if (ret) printk(" Usb2_readControlBus fail : %d!\n", (int) ret);
return (Error_NO_ERROR);
}