/**************************************************************************
 * Copyright (C) 2012-2021  Unisound
 *
 * 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; either version 2 of the License, or
 * any later version.
 *
 * 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.,
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 **************************************************************************
 *
 * Description : otp.h
 * Author      : yzs.unisound.com
 * Date        : 2021.03.01
 *
 **************************************************************************/
#ifndef __OTP_H__
#define __OTP_H__

#define OTP_USER_DATA_LENGTH (64)
int uni_otp_read(unsigned int start_addr, char *data, int rd_num);
int uni_otp_write(unsigned int start_addr, char *data, int wr_num);
int otp_get_chipname(char *chip_name, unsigned int buf_len);
int otp_get_publicid(unsigned long long *public_id);
int otp_set_userdata(unsigned int index, char *data, int length);
int otp_get_userdata(unsigned int index, char *data, int length);
int otp_lock(void);
int otp_get_lock(unsigned int *lock);

#endif
