/*
 * ltc4266.h
 *
 * LTC4266 driver header
 *
 * Author: Cradlepoint Technology, Inc.  <source@cradlepoint.com>
 *         Kyle Swenson <kswenson@cradlepoint.com>
 *
 * Copyright 2019 Cradlepoint Technology, Inc.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2
 * 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 the
 * GNU General Public License for more details.
 *
 */
#ifndef __LTC4266_DRIVER_H__
#define __LTC4266_DRIVER_H__

enum {
	READ_CURRENT = 0,
	READ_VOLTAGE = 2
};
#define LTC4266_NPORTS 4

struct pse_port_device;

uint32_t ltc4266_read_iv(struct pse_port_device *port, uint8_t iv);
uint8_t ltc4266_port_stat(struct pse_port_device *port);

int ltc4266_port_disconnect_detect_enable(struct pse_port_device *port, int enable);
int ltc4266_port_class_enable(struct pse_port_device *port, int enable);
int ltc4266_port_detect_enable(struct pse_port_device *port, int enable);
int ltc4266_port_mode(struct pse_port_device *port, uint8_t opmd);
int ltc4266_port_power(struct pse_port_device *port, int enabled);
int ltc4266_port_highpower(struct pse_port_device *port, uint8_t enable);
int ltc4266_port_set_icut(struct pse_port_device *port, int icut);
int ltc4266_port_set_ilim(struct pse_port_device *port, int icut);
int ltc4266_port_legacy_enable(struct pse_port_device *port, uint8_t enable);
int ltc4266_port_init(struct pse_port_device *port);


int ltc4266_port_powered(struct pse_port_device *port);
uint8_t ltc4266_port_stat(struct pse_port_device *port);
int ltc4266_port_get_icut(struct pse_port_device *port);
int ltc4266_port_get_ilim(struct pse_port_device *port);

uint8_t class_map(uint8_t);
uint8_t detect_map(uint8_t);



/* This is the port operations structure that is registered with the pse class
 * on a per-port basis.  The structure and the functions that implement it are
 * defined in ltc4266-ops
 */
extern struct pse_port_ops ltc4266_port_ops;


/* LTC4266 specific values for the disconnect event */
enum {
	LTC4266_DISCONNECT_UNDERCURRENT,
	LTC4266_DISCONNECT_OVERCURRENT,
	LTC4266_DISCONNECT_STARTUP_OVERCURRENT,
};
/* LTC4266 specific values for the classification result */
enum {
	LTC4266_CLASS_UNKNOWN = 0,
	LTC4266_CLASS_1,
	LTC4266_CLASS_2,
	LTC4266_CLASS_3,
	LTC4266_CLASS_4,
	LTC4266_CLASS_ERR,
	LTC4266_CLASS_0,
	LTC4266_CLASS_OVERCURRENT
};

/* LTC4266 specific values for the detection result */
enum {
	LTC4266_DETECT_INCOMPLETE = 0,
	LTC4266_DETECT_SHORT,
	LTC4266_DETECT_HIGHCAP,
	LTC4266_DETECT_RSIG_LOW,
	LTC4266_DETECT_RSIG_GOOD,
	LTC4266_DETECT_RSIG_HIGH,
	LTC4266_DETECT_OPEN,
	LTC4266_DETECT_BAD_PORT_VOLTAGE
};
/* LTC4266 port operation mode. OPMD_SEMI is the only supported mode at this time */
enum {
	OPMD_SHUTDOWN = 0,
	OPMD_MANUAL,
	OPMD_SEMI,
	OPMD_AUTO
};
/* LTC4266 (global) Tstart time.  Controls the length of the "Inrush" startup phase.*/
enum {
	LTC4266_TSTART_60_MS = 0,
	LTC4266_TSTART_30_MS,
	LTC4266_TSTART_120_MS,
	LTC4266_TSTART_240_MS
};
/* LTC4266- Controls the length of time for which a port may exceed icut*/
enum {
	LTC4266_TCUT_60_MS = 0,
	LTC4266_TCUT_30_MS,
	LTC4266_TCUT_120_MS,
	LTC4266_TCUT_240_MS
};
/* LTC4266- Controls the length time for which a may be in undercurrent without being considered "disconnected"*/
enum {
	LTC4266_TDIS_360_MS = 0,
	LTC4266_TDIS_90_MS,
	LTC4266_TDIS_180_MS,
	LTC4266_TDIS_720_MS
};

struct ltc4266_device {
	struct pse_port_device *pse_ports[LTC4266_NPORTS];
	struct i2c_client *client; /* I2C Client */
	struct mutex lock; /* Protect Read-Modify-Write Sequences */
	struct work_struct work_struct;
	struct timer_list timer;
};
int ltc4266_write_reg(struct ltc4266_device *ltc4266, uint8_t reg, uint8_t value, uint8_t mask);

void ltc4266_enable_interrupts(struct i2c_client *client);
int ltc4266_disable_interrupts(struct i2c_client *client);
uint32_t ltc4266_read_iv(struct pse_port_device *port, uint8_t iv);
#endif
