/* SPDX-License-Identifier: LGPL-2.1-only OR BSD-3-Clause */
/******************************************************************************
 *
 * This file is provided under a dual license.  When you use or
 * distribute this software, you may choose to be licensed under
 * version 2.1 of the GNU Lesser General Public License
 * ("LGPLv2.1 License") or BSD License.
 *
 * LGPLv2.1 License
 *
 * Copyright(C) 2019 MediaTek Inc.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of version 2.1 of the GNU Lesser General Public
 * License as published by the Free Software Foundation.
 *
 * 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 https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html for more
 * details.
 *
 * BSD LICENSE
 *
 * Copyright(C) 2019 MediaTek Inc.
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 *  * Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 *  * Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in
 *    the documentation and/or other materials provided with the
 *    distribution.
 *  * Neither the name of the copyright holder nor the names of its
 *    contributors may be used to endorse or promote products derived
 *    from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 *****************************************************************************/

/*----------------------------------------------------------------------------*/
/*! @file u_rrctx_vchip_eng.h 
 *  $RCSfile: $
 *  $Revision: #1 $
 *  $Date: 2015/11/10 $
 *  $Author: dtvbm11 $
 *  
 *  @par Description:
 *         This header file contains exported definitions and delcarations of
 *         VCHIP engine of RRCTX.
 */
/*----------------------------------------------------------------------------*/
 
#ifndef _U_RRCTX_VCHIP_ENG_H_
#define _U_RRCTX_VCHIP_ENG_H_

/*-----------------------------------------------------------------------------
                    include files
 ----------------------------------------------------------------------------*/
#include "u_common.h"
 
/*----------------------------------------------------------------------------*/
/*! @defgroup groupMW_RRCTX_VCHIP_ENG RRCTX VCHIP Engine
 *
 *  @ingroup groupMW_RRCTX
 *  @brief The RRCTX RRT engine module is used to get rating information.
 *
 *  %MW Application API would be used by Application, lot of these APIs would
 *   be wrapped from Exported API. Using these APIs, application could get rating infromation
 *   from the exported API of RRCTX VCHIP engine.
 *
 *  @see groupMW_RRCTX_VCHIP_ENG
 *  @{ 
 */
/*----------------------------------------------------------------------------*/

/*-----------------------------------------------------------------------------
                    macros, defines, typedefs, enums
 ----------------------------------------------------------------------------*/

/* Rating Region */
#define VCHIP_REGION_UNKNOWN         ((UINT8)    0xff)    /**< Region index	*/
#define VCHIP_REGION_US              ((UINT8)    0x01)    /**< Region index     */
#define VCHIP_REGION_CAN             ((UINT8)    0x02)    /**< Region index     */

/* MPAA Rating */
#define RRCTX_ENG_VCHIP_US_MPAA_G     ((UINT8)   0)    /**<   MPAA rating type     */
#define RRCTX_ENG_VCHIP_US_MPAA_PG    ((UINT8)   1)    /**<   MPAA rating type      */
#define RRCTX_ENG_VCHIP_US_MPAA_PG_13 ((UINT8)   2)    /**<   MPAA rating type      */
#define RRCTX_ENG_VCHIP_US_MPAA_R     ((UINT8)   3)    /**<   MPAA rating type     */
#define RRCTX_ENG_VCHIP_US_MPAA_NC_17 ((UINT8)   4)    /**<   MPAA rating type      */
#define RRCTX_ENG_VCHIP_US_MPAA_X     ((UINT8)   5)    /**<   MPAA rating type     */
#define RRCTX_ENG_VCHIP_US_MPAA_OFF   ((UINT8)   6)    /**<   MPAA rating type      */

/* TV Age-based */
#define RRCTX_ENG_VCHIP_US_AGE_TV_Y   ((UINT8)   0)    /**<    TV Age-based type    */
#define RRCTX_ENG_VCHIP_US_AGE_TV_Y7  ((UINT8)   1)    /**<    TV Age-based type    */
#define RRCTX_ENG_VCHIP_US_AGE_TV_G   ((UINT8)   2)    /**<    TV Age-based type    */
#define RRCTX_ENG_VCHIP_US_AGE_TV_PG  ((UINT8)   3)    /**<    TV Age-based type    */
#define RRCTX_ENG_VCHIP_US_AGE_TV_14  ((UINT8)   4)    /**<    TV Age-based type   */
#define RRCTX_ENG_VCHIP_US_AGE_TV_MA  ((UINT8)   5)    /**<    TV Age-based type    */
#define RRCTX_ENG_VCHIP_US_AGE_OFF    ((UINT8)   6)    /**<    TV Age-based type    */

/* TV Content-based */
#define RRCTX_ENG_VCHIP_US_CNT_TV_Y       MAKE_BIT_MASK_64((8 * 2 + 2))    /**<   TV Content-based type     */
#define RRCTX_ENG_VCHIP_US_CNT_TV_Y7      MAKE_BIT_MASK_64((8 * 2 + 3))    /**<   TV Content-based type     */
#define RRCTX_ENG_VCHIP_US_CNT_TV_Y7_FV   MAKE_BIT_MASK_64((8 * 2 + 4))    /**<   TV Content-based type     */
#define RRCTX_ENG_VCHIP_US_CNT_TV_PG_D    MAKE_BIT_MASK_64((8 * 3 + 0))    /**<   TV Content-based type     */
#define RRCTX_ENG_VCHIP_US_CNT_TV_PG_L    MAKE_BIT_MASK_64((8 * 3 + 1))    /**<   TV Content-based type    */
#define RRCTX_ENG_VCHIP_US_CNT_TV_PG_S    MAKE_BIT_MASK_64((8 * 3 + 2))    /**<   TV Content-based type     */
#define RRCTX_ENG_VCHIP_US_CNT_TV_PG_V    MAKE_BIT_MASK_64((8 * 3 + 3))    /**<   TV Content-based type     */
#define RRCTX_ENG_VCHIP_US_CNT_TV_14_D    MAKE_BIT_MASK_64((8 * 4 + 0))    /**<   TV Content-based type    */
#define RRCTX_ENG_VCHIP_US_CNT_TV_14_L    MAKE_BIT_MASK_64((8 * 4 + 1))    /**<   TV Content-based type     */
#define RRCTX_ENG_VCHIP_US_CNT_TV_14_S    MAKE_BIT_MASK_64((8 * 4 + 2))    /**<   TV Content-based type    */
#define RRCTX_ENG_VCHIP_US_CNT_TV_14_V    MAKE_BIT_MASK_64((8 * 4 + 3))    /**<   TV Content-based type    */
#define RRCTX_ENG_VCHIP_US_CNT_TV_MA_L    MAKE_BIT_MASK_64((8 * 5 + 1))    /**<   TV Content-based type    */
#define RRCTX_ENG_VCHIP_US_CNT_TV_MA_S    MAKE_BIT_MASK_64((8 * 5 + 2))    /**<   TV Content-based type     */
#define RRCTX_ENG_VCHIP_US_CNT_TV_MA_V    MAKE_BIT_MASK_64((8 * 5 + 3))    /**<   TV Content-based type     */

/* VCHIP-Canada English */
#define RRCTX_ENG_VCHIP_CA_EN_E         ((UINT8)    0)    /**<   VCHIP-Canada English rating type     */
#define RRCTX_ENG_VCHIP_CA_EN_C         ((UINT8)    1)    /**<   VCHIP-Canada English rating type    */
#define RRCTX_ENG_VCHIP_CA_EN_C8        ((UINT8)    2)    /**<   VCHIP-Canada English rating type     */
#define RRCTX_ENG_VCHIP_CA_EN_G         ((UINT8)    3)    /**<   VCHIP-Canada English rating type     */
#define RRCTX_ENG_VCHIP_CA_EN_PG        ((UINT8)    4)    /**<   VCHIP-Canada English rating type     */
#define RRCTX_ENG_VCHIP_CA_EN_14        ((UINT8)    5)    /**<   VCHIP-Canada English rating type    */
#define RRCTX_ENG_VCHIP_CA_EN_18        ((UINT8)    6)    /**<   VCHIP-Canada English rating type     */
#define RRCTX_ENG_VCHIP_CA_EN_OFF       ((UINT8)    7)    /**<   VCHIP-Canada English rating type     */

/* VCHIP-Canada French */
#define RRCTX_ENG_VCHIP_CA_FR_E         ((UINT8)    0)    /**<    VCHIP-Canada French rating type   */
#define RRCTX_ENG_VCHIP_CA_FR_G         ((UINT8)    1)    /**<    VCHIP-Canada French rating type    */
#define RRCTX_ENG_VCHIP_CA_FR_8         ((UINT8)    2)    /**<    VCHIP-Canada French rating type    */
#define RRCTX_ENG_VCHIP_CA_FR_13        ((UINT8)    3)    /**<    VCHIP-Canada French rating type    */
#define RRCTX_ENG_VCHIP_CA_FR_16        ((UINT8)    4)    /**<    VCHIP-Canada French rating type    */
#define RRCTX_ENG_VCHIP_CA_FR_18        ((UINT8)    5)    /**<    VCHIP-Canada French rating type    */
#define RRCTX_ENG_VCHIP_CA_FR_OFF       ((UINT8)    6)    /**<    VCHIP-Canada French rating type    */

/* VCHIP-Canada */
#define RRCTX_ENG_VCHIP_CA_CNT_OFF      ((UINT32)  0)    /**<   VCHIP-Canada rating type     */
#define RRCTX_ENG_VCHIP_CA_CNT_EN_C     MAKE_BIT_MASK_32((8 * 2 + 1))    /**<    VCHIP-Canada rating type     */
#define RRCTX_ENG_VCHIP_CA_CNT_EN_C8    MAKE_BIT_MASK_32((8 * 2 + 2))    /**<    VCHIP-Canada rating type    */
#define RRCTX_ENG_VCHIP_CA_CNT_EN_G     MAKE_BIT_MASK_32((8 * 2 + 3))    /**<    VCHIP-Canada rating type     */
#define RRCTX_ENG_VCHIP_CA_CNT_EN_PG    MAKE_BIT_MASK_32((8 * 2 + 4))    /**<    VCHIP-Canada rating type     */
#define RRCTX_ENG_VCHIP_CA_CNT_EN_14    MAKE_BIT_MASK_32((8 * 2 + 5))    /**<    VCHIP-Canada rating type     */
#define RRCTX_ENG_VCHIP_CA_CNT_EN_18    MAKE_BIT_MASK_32((8 * 2 + 6))    /**<    VCHIP-Canada rating type     */
#define RRCTX_ENG_VCHIP_CA_CNT_FR_G     MAKE_BIT_MASK_32((8 * 3 + 1))    /**<    VCHIP-Canada rating type     */
#define RRCTX_ENG_VCHIP_CA_CNT_FR_8     MAKE_BIT_MASK_32((8 * 3 + 2))    /**<    VCHIP-Canada rating type     */
#define RRCTX_ENG_VCHIP_CA_CNT_FR_13    MAKE_BIT_MASK_32((8 * 3 + 3))    /**<    VCHIP-Canada rating type     */
#define RRCTX_ENG_VCHIP_CA_CNT_FR_16    MAKE_BIT_MASK_32((8 * 3 + 4))    /**<    VCHIP-Canada rating type     */
#define RRCTX_ENG_VCHIP_CA_CNT_FR_18    MAKE_BIT_MASK_32((8 * 3 + 5))    /**<    VCHIP-Canada rating type     */

/*------------------------------------------------------------------*/
/*! @enum	RRCTX_VCHIP_KEY_TYPE_T
 *  @brief		Key type of VCHIP
 
 *  @code
 *	typedef enum _RRCTX_VCHIP_KEY_TYPE_T
 *	{
 *		RRCTX_VCHIP_KEY_TYPE_UNKNOWN = 0,
 *		RRCTX_VCHIP_KEY_TYPE_RGN_TEXT,
 *		RRCTX_VCHIP_KEY_TYPE_RGN_ID,
 *		RRCTX_VCHIP_KEY_TYPE_TOTAL_NUMBER
 *	}RRCTX_VCHIP_KEY_TYPE_T; 
 *  @endcode
 
 *  @li@c	RRCTX_VCHIP_KEY_TYPE_UNKNOWN			- Unknown key type
 *  @li@c	RRCTX_VCHIP_KEY_TYPE_RGN_TEXT			- Key type of VCHIP region text
 *  @li@c	RRCTX_VCHIP_KEY_TYPE_RGN_ID			- Key type of VCHIP region index
 *  @li@c	RRCTX_VCHIP_KEY_TYPE_TOTAL_NUMBER		- Total number of key types
 */
/*------------------------------------------------------------------*/

typedef enum _RRCTX_VCHIP_KEY_TYPE_T
{
    RRCTX_VCHIP_KEY_TYPE_UNKNOWN = 0,
    RRCTX_VCHIP_KEY_TYPE_RGN_TEXT,
    RRCTX_VCHIP_KEY_TYPE_RGN_ID,
    RRCTX_VCHIP_KEY_TYPE_TOTAL_NUMBER
} RRCTX_VCHIP_KEY_TYPE_T;


/*------------------------------------------------------------------*/
/*! @struct	RRCTX_VCHIP_KEY_PARAM_T
 *  @brief		Key parameters structure
 
 *  @code
 *	typedef struct _RRCTX_VCHIP_KEY_PARAM_T
 *	{
 *		RRCTX_VCHIP_KEY_TYPE_T      	e_vchip_key_type;
 *		VOID*      					pv_vchip_key_param;
 *	} RRCTX_VCHIP_KEY_PARAM_T;  
 *  @endcode
 
 *  @li@c	e_vchip_key_type			-Key type of the VCHIP
 *  @li@c	pv_vchip_key_param		-Parameters of key type
 */
/*------------------------------------------------------------------*/

typedef struct _RRCTX_VCHIP_KEY_PARAM_T
{
    RRCTX_VCHIP_KEY_TYPE_T   e_vchip_key_type;
    VOID*                    pv_vchip_key_param;
} RRCTX_VCHIP_KEY_PARAM_T;


#endif /* _U_RRCTX_VCHIP_ENG_H_ */

/*----------------------------------------------------------------------------*/
/*! @} */                               /* end of groupMW_RRCTX_VCHIP_ENG         */
/*----------------------------------------------------------------------------*/

