/*****************************************************************************/
/* Copyright (c) 2009 NXP B.V.                                               */
/*                                                                           */
/* 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      */
/* the Free Software Foundation, using version 2 of the License.             */
/*                                                                           */
/* This program is distributed in the hope that it will be useful,           */
/* but WITHOUT ANY WARRANTY; without even the implied warranty of            */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the              */
/* GNU General Public License for more details.                              */
/*                                                                           */
/* You should have received a copy of the GNU General Public License         */
/* along with this program; if not, write to the Free Software               */
/* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307       */
/* USA.                                                                      */
/*                                                                           */
/*****************************************************************************/

/******************************************************************************************
File name   : tdhl5.h

Description : Header file - TDHL5 Driver

Date          Modification                              Name
----          ------------                              ----
01 Jun 2007   Created                                   Anastacio Cavalcante Lucas Cordeiro
23 Jul 2007   Changing driver name to TDHL5				Lucas Cordeiro
******************************************************************************************/
#include <linux/types.h>

#ifndef _TDHL5_H
#define _TDHL5_H

/*********************************** Structs ************************************/

/**
 * @brief struct that contains the list of the channels that are programmed
 *		  during the auto scan operation.
 */
typedef struct {

   __u8  IsChannelLocked;
   __s32 channel;

} channels_table;

/**
 * @brief struct that contains information about the channels range.
 */
typedef struct{

   __s32 first_channel;
   __s32 last_channel;	

} channels;
/******************************************************************************/

/*******************************Signal definitions*****************************/
#define SIG_TDHL5 SIGIO
/******************************************************************************/

/********************************IOCTL Commands********************************/
#define TDHL5_IOCBASE             242 /* Base IOCTL:0xF2. It is free in "kernel-tree path"/Documentation/ioctl-number.txt */
#define TDHL5_IOC_INIT            		_IO  (TDHL5_IOCBASE, 0)
#define TDHL5_IOC_SETOFFSET           	_IOW (TDHL5_IOCBASE, 1, __s32)
#define TDHL5_IOC_GETOFFSET         	_IOR (TDHL5_IOCBASE, 2, __s32)
#define TDHL5_IOC_SETCHANNEL        	_IOW (TDHL5_IOCBASE, 3, __s32)
#define TDHL5_IOC_SETFREQUENCY       	_IOWR (TDHL5_IOCBASE, 4, __s32) 
#define TDHL5_IOC_CHANNELSCAN      		_IO (TDHL5_IOCBASE, 5) 
#define TDHL5_IOC_GETLOCKSTATUS      	_IOR (TDHL5_IOCBASE, 6, __s32) 
#define TDHL5_IOC_SCANCANCEL    		_IO (TDHL5_IOCBASE, 7) 
#define TDHL5_IOC_GETCHANNELS    		_IOR (TDHL5_IOCBASE, 8, __s32) 
#define TDHL5_IOC_GETBANDWIDTH    		_IOR (TDHL5_IOCBASE, 9, __s32)
#define TDHL5_IOC_SETCHANNELS    		_IOW (TDHL5_IOCBASE, 10, __s32) 
#define TDHL5_IOC_GETCHANNELSTABLE    	_IOR (TDHL5_IOCBASE, 11, __s32) 
#define TDHL5_IOC_CHANNELUP	    		_IOWR (TDHL5_IOCBASE, 12, __s32) 
#define TDHL5_IOC_CHANNELDOWN    		_IOWR (TDHL5_IOCBASE, 13, __s32) 
#define TDHL5_IOC_GETCURRCHAN         	_IOR (TDHL5_IOCBASE, 14, __s32)
#define TDHL5_IOC_GETSTANDBY			_IOR (TDHL5_IOCBASE, 15, __s32)
#define TDHL5_IOC_SETSLEEPWAKEUP		_IOW (TDHL5_IOCBASE, 16, __s32)
#define TDHL5_IOC_GETSLEEPWAKEUP		_IOR (TDHL5_IOCBASE, 17, __s32)
#define TDHL5_IOC_GETTUNERSTATUS      	_IOR (TDHL5_IOCBASE, 18, __s32)
#define TDHL5_IOC_SETSTANDBYMODE		_IOW (TDHL5_IOCBASE, 19, __s32)
#define TDHL5_IOC_GETSTANDBYMODE		_IOR (TDHL5_IOCBASE, 20, __s32)
#define TDHL5_IOC_GETTIMEOUT			_IOR (TDHL5_IOCBASE, 21, __s32)
#define TDHL5_IOC_SETTIMEOUT			_IOW (TDHL5_IOCBASE, 22, __s32)
#define TDHL5_IOC_SETTRANSMISSIONMODE	_IOW (TDHL5_IOCBASE, 23, __s32)
#define TDHL5_IOC_GETTRANSMISSIONMODE	_IOR (TDHL5_IOCBASE, 24, __s32)
#define TDHL5_IOC_SETGUARDINTERVAL		_IOW (TDHL5_IOCBASE, 25, __s32)
#define TDHL5_IOC_GETGUARDINTERVAL		_IOR (TDHL5_IOCBASE, 26, __s32)
#define TDHL5_IOC_SETFFTSIZE			_IOW (TDHL5_IOCBASE, 27, __s32)
#define TDHL5_IOC_GETFFTSIZE			_IOR (TDHL5_IOCBASE, 28, __s32)
#define TDHL5_IOC_SETERRORCORRECTION	_IOW (TDHL5_IOCBASE, 29, __s32)
#define TDHL5_IOC_GETERRORCORRECTION	_IOR (TDHL5_IOCBASE, 30, __s32)
#define TDHL5_IOC_SETSLOTMODE			_IOW (TDHL5_IOCBASE, 31, __s32)
#define TDHL5_IOC_GETSLOTMODE			_IOR (TDHL5_IOCBASE, 32, __s32)
#define TDHL5_IOC_GETPER				_IOWR(TDHL5_IOCBASE, 33, __s32)
#define TDHL5_IOC_GETBER				_IOWR(TDHL5_IOCBASE, 34, __s32)

/******************************************************************************/

__s32 chan2freq(__s32 channel);

#endif /*_TUV1236D_H */
