linux/drivers/iio/common/ssp_sensors/ssp_spi.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 *  Copyright (C) 2014, Samsung Electronics Co. Ltd. All Rights Reserved.
 */

#include "ssp.h"

#define SSP_DEV
#define SSP_GET_MESSAGE_TYPE(data)

/*
 * SSP -> AP Instruction
 * They tell what packet type can be expected. In the future there will
 * be less of them. BYPASS means common sensor packets with accel, gyro,
 * hrm etc. data. LIBRARY and META are mock-up's for now.
 */
#define SSP_MSG2AP_INST_BYPASS_DATA
#define SSP_MSG2AP_INST_LIBRARY_DATA
#define SSP_MSG2AP_INST_DEBUG_DATA
#define SSP_MSG2AP_INST_BIG_DATA
#define SSP_MSG2AP_INST_META_DATA
#define SSP_MSG2AP_INST_TIME_SYNC
#define SSP_MSG2AP_INST_RESET

#define SSP_UNIMPLEMENTED

struct ssp_msg_header {} __attribute__((packed));

struct ssp_msg {};

static const int ssp_offset_map[SSP_SENSOR_MAX] =;

#define SSP_HEADER_SIZE
#define SSP_HEADER_SIZE_ALIGNED

static struct ssp_msg *ssp_create_msg(u8 cmd, u16 len, u16 opt, u32 data)
{}

/*
 * It is a bit heavy to do it this way but often the function is used to compose
 * the message from smaller chunks which are placed on the stack.  Often the
 * chunks are small so memcpy should be optimalized.
 */
static inline void ssp_fill_buffer(struct ssp_msg *m, unsigned int offset,
				   const void *src, unsigned int len)
{}

static inline void ssp_get_buffer(struct ssp_msg *m, unsigned int offset,
				  void *dest, unsigned int len)
{}

#define SSP_GET_BUFFER_AT_INDEX(m, index)
#define SSP_SET_BUFFER_AT_INDEX(m, index, val)

static void ssp_clean_msg(struct ssp_msg *m)
{}

static int ssp_print_mcu_debug(char *data_frame, int *data_index,
			       int received_len)
{}

/*
 * It was designed that way - additional lines to some kind of handshake,
 * please do not ask why - only the firmware guy can know it.
 */
static int ssp_check_lines(struct ssp_data *data, bool state)
{}

static int ssp_do_transfer(struct ssp_data *data, struct ssp_msg *msg,
			   struct completion *done, int timeout)
{}

static inline int ssp_spi_sync_command(struct ssp_data *data,
				       struct ssp_msg *msg)
{}

static int ssp_spi_sync(struct ssp_data *data, struct ssp_msg *msg,
			int timeout)
{}

static int ssp_handle_big_data(struct ssp_data *data, char *dataframe, int *idx)
{}

static int ssp_parse_dataframe(struct ssp_data *data, char *dataframe, int len)
{}

/* threaded irq */
int ssp_irq_msg(struct ssp_data *data)
{}

void ssp_clean_pending_list(struct ssp_data *data)
{}

int ssp_command(struct ssp_data *data, char command, int arg)
{}

int ssp_send_instruction(struct ssp_data *data, u8 inst, u8 sensor_type,
			 u8 *send_buf, u8 length)
{}

int ssp_get_chipid(struct ssp_data *data)
{}

int ssp_set_magnetic_matrix(struct ssp_data *data)
{}

unsigned int ssp_get_sensor_scanning_info(struct ssp_data *data)
{}

unsigned int ssp_get_firmware_rev(struct ssp_data *data)
{}