/* SPDX-License-Identifier: GPL-2.0-only */

#ifndef SLATECOM_INTERFACE_H
#define SLATECOM_INTERFACE_H

#include <linux/soc/qcom/slatecom_intf.h>


int slate_soft_reset(void);


bool is_twm_exit(void);


bool is_slate_running(void);


void set_slate_dsp_state(bool status);


void set_slate_bt_state(bool status);

struct subsys_state_ops {
	void (*set_dsp_state)(bool status);
	void (*set_bt_state)(bool status);
};

void slatecom_state_init(void (*fn1)(bool), void (*fn2)(bool));


int set_slate_boot_mode(uint32_t boot_mode);


int get_slate_boot_mode(void);


bool is_slate_unload_only(void);


void update_s2a_status(bool s2a_status_value);


struct msg_header_t {
	uint32_t opcode;
	uint32_t payload_size;
};

struct wear_firmware_info {
	uint32_t response_status;
	uint32_t qapi_version;
	char crm_build_number[100];
	char dsp_image_ver[100];
	char bt_image_ver[100];
} __packed;


enum WMSlateCtrlChnlOpcode {
	
	GMI_MGR_ENTER_TWM = 1,

	
	GMI_MGR_SSR_MPSS_DOWN_NOTIFICATION = 2,

	
	GMI_MGR_SSR_MPSS_UP_NOTIFICATION = 3,

	
	GMI_MGR_SSR_ADSP_DOWN_INDICATION = 8,

	
	GMI_MGR_SSR_ADSP_UP_INDICATION = 9,

	
	GMI_MGR_WAKE_UP_NO_REASON = 10,

	
	GMI_MGR_ENTER_TRACKER_DS = 11,

	
	GMI_MGR_EXIT_TRACKER_DS = 12,

	
	GMI_MGR_TIME_SYNC_UPDATE = 13,	

	
	GMI_MGR_TIMEVAL_UTC = 14,		

	
	GMI_MGR_DST = 15,			

	
	GMI_MGR_WLAN_BOOT_INIT = 16,

	
	GMI_MGR_WLAN_BOOT_COMPLETE = 17,

	GMI_WLAN_5G_CONNECT = 18,

	GMI_WLAN_5G_DISCONNECT  = 19,

	
	GMI_WEAR_MGR_GET_FIRMWARE_DETAILS = 20,

	
	GMI_MGR_SSR_MPSS_DOWN_PRE_NOTIFICATION = 21,

	
	GMI_MGR_SSR_MPSS_UP_PRE_NOTIFICATION = 22,

	
	GMI_MGR_SSR_ADSP_DOWN_PRE_INDICATION = 23,

	
	GMI_MGR_SSR_ADSP_UP_PRE_INDICATION = 24,

	
	GMI_MGR_ENABLE_QCLI = 91,		

	GMI_MGR_DISABLE_QCLI = 92,		

	GMI_MGR_ENABLE_PMIC_RTC = 93,		

	GMI_MGR_DISABLE_PMIC_RTC = 94,		
};


#if IS_ENABLED(CONFIG_MSM_SLATECOM_INTERFACE)

int send_wlan_state(enum WMSlateCtrlChnlOpcode type);

#else
static inline int send_wlan_state(enum WMSlateCtrlChnlOpcode type)
{
	return 0;
}
#endif

#ifdef CONFIG_COMPAT
long compat_slate_com_ioctl(struct file *file, unsigned int cmd, unsigned long arg);
#else
#define compat_slate_com_ioctl NULL
#endif

#endif 

