/**
 * @file  gpio-fp.h
 * @brief GPIO API for Fastcall driver(Fingerprint)
 *
 * Copyright (c) 2014-2015 Samsung Electronics Co., Ltd.
 *
 * This software is proprietary of Samsung Electronics.
 * No part of this software, either material or conceptual may be copied
 * or distributed, transmitted, transcribed, stored in a retrieval system
 * or translated into any human or computer language in any form by any means,
 * electronic, mechanical, manual or otherwise, or disclosed to third parties
 * without the express written permission of Samsung Electronics.
 */

#ifndef __FP_REGISTER_H__
#define __FP_REGISTER_H__

#ifdef __cplusplus
extern "C" {
#endif

/************************************************************************/
/* TZPC control                                                         */
/************************************************************************/
#define FP_TZPC_SECURE	0x0
#define FP_TZPC_SET_ENABLE 0x7 /* USI:0x1, USI_MODE:0x2, GPIO:0x4 */

#define FP_TZPC_USI_SFR_BASE	0x10010000
#define FP_TZPC_DECPROTSTAT		0x200
#define FP_TZPC_DECPROTSET		0x204
#define FP_TZPC_DECPROTCLR		0x208
#define FP_TZPC_USI_CH0_M		(0x1 << 19)

#define FP_TZPC_USI_MODE_SFR_BASE	0x10010000
#define FP_TZPC_USI_MODE_DECPROTSTAT		0x210
#define FP_TZPC_USI_MODE_DECPROTSET		0x214
#define FP_TZPC_USI_MODE_DECPROTCLR		0x218
#define FP_TZPC_USI_MODE_M	(0x1 << 19)

#define FP_TZPC_PERIC0_0_SFR_BASE	0x10042000 // gpp0 upper
#define FP_TZPC_GPIO_DECPROT_NUM		0x0000
#define FP_TZPC_GPIO_DECSTAT_NUM		0x0000
#define FP_TZPC_GPIO_PERIC0_M		(0xFFFF00FF) // gpp0[7:4]

/************************************************************************/
/* GPIO control                                                         */
/* S5E8825 : CS(gpp0[7]),MISO(gpp0[6]),MOSI(gpp0[5]),CLK(gpp0[4])		*/
/************************************************************************/
#define FP_GPIO_PERIC0_SFR_BASE	0x10040000 // gpp0

#define FP_GPIOCON_INIT_VALUE		0x10110000 // OUTPUT|INPUT|OUTPUT|OUTPUT
#define FP_GPIODAT_INIT_VALUE		0x00 // low|undef|low|low
#define FP_GPIOPUD_INIT_VALUE		0x01000000 // NP|PD|NP|NP
#define FP_GPIODRV_INIT_VALUE		0x22220000 // 2x|2x|2x|2x
#define FP_GPIOCONPDN_POWEROFF_VALUE		0x2000 // out0|input|out0|out0
#define FP_GPIOPUDPDN_POWEROFF_VALUE		0x01000000 // NP|PD|NP|NP

#define FP_GPIOCON_POWERON_INACTIVE_VALUE		0x10110000 // OUTPUT|INPUT|OUTPUT|OUTPUT
#define FP_GPIODAT_POWERON_INACTIVE_VALUE		0x80 // high|undef|undef|undef
#define FP_GPIOPUD_POWERON_INACTIVE_VALUE		0x01000000 // NP|PD|NP|NP
#define FP_GPIODRV_POWERON_INACTIVE_VALUE		0x22220000 // 2x|2x|2x|2x
#define FP_GPIOCONPDN_POWERON_INACTIVE_VALUE	0x6000 // out1|input|out0|out0
#define FP_GPIOPUDPDN_POWERON_INACTIVE_VALUE	0x01000000 // NP|PD|NP|NP

#define FP_GPIOCON		0x0000
#define FP_GPIODAT		0x0004
#define FP_GPIOPUD		0x0008
#define FP_GPIODRV		0x000C
#define FP_GPIOCONPDN	0x0010
#define FP_GPIOPUDPDN	0x0014

#define FP_GPIOCON_MASK				0xFFFF0000 // [31:16]
#define FP_GPIODAT_MASK				0x000000F0 // [7:4]
#define FP_GPIOPUD_MASK				0xFFFF0000 // [31:16]
#define FP_GPIODRV_MASK				0xFFFF0000 // [31:16]
#define FP_GPIOCONPDN_MASK			0x0000FF00 // [15:8]
#define FP_GPIOPUDPDN_MASK			0xFFFF0000 // [31:16]

#ifdef __cplusplus
}
#endif

#endif
