#ifndef SONY_FPGA_SIS_H
#define SONY_FPGA_SIS_H

#include <linux/types.h>
#include "sony_fpga.h"
#include "sony_fpga_cmd.h"
#include "sony_fpga_local_if_i2c.h"

// I2C Driver Address
#define SIS_PERIPHERAL_BASE_ADDR               0x00060000
#define SIS_QSFP_CONTROL_BASE_ADDR             0x00060200

#define I2C_SLAVE_ADDR_QSFP            0x50
enum {
    QSFP_SELECT_QSFP_0 = 0,   // QSFP#0 Local SISA
    QSFP_SELECT_QSFP_1,       // QSFP#1 Local SISB
    QSFP_SELECT_QSFP_2        // QSFP#2 Local ME
};

// GPIO REGISTER MAP
#define QSFP_MODESEL           0x00
#define QSFP_CONTROL_RESETL    0x04
#define QSFP_CONTROL_LPMODE    0x08
#define QSFP_CONTROL_LED       0x0c
#define QSFP_CONTROL_MODPRSL   0x20
#define QSFP_CONTROL_INTL      0x24

#define SIS_QSFP_LED_OFF       0
#define SIS_QSFP_LED_ON        1
#define SIS_QSFP_LED_BLINK     3

extern int sony_fpga_sis_fpga_probe(struct sony_fpga_ctrl* ctrl);
extern int sony_fpga_sis_i2c_request(struct sony_fpga_ctrl* ctrl, struct i2c_param* param, bool is_read);
extern int sony_fpga_pause_sis_qsfp_thread(struct sony_fpga_ctrl* ctrl);
extern int sony_fpga_resume_sis_qsfp_thread(struct sony_fpga_ctrl* ctrl);

extern int sony_fpga_sis_qsfp_setting(struct sony_fpga_ctrl* ctrl, u32 qsfp_number);
#endif
