linux/drivers/iio/chemical/sps30_serial.c

// SPDX-License-Identifier: GPL-2.0
/*
 * Sensirion SPS30 particulate matter sensor serial driver
 *
 * Copyright (c) 2021 Tomasz Duszynski <[email protected]>
 */
#include <linux/completion.h>
#include <linux/device.h>
#include <linux/errno.h>
#include <linux/iio/iio.h>
#include <linux/minmax.h>
#include <linux/mod_devicetable.h>
#include <linux/module.h>
#include <linux/serdev.h>
#include <linux/types.h>

#include "sps30.h"

#define SPS30_SERIAL_DEV_NAME

#define SPS30_SERIAL_SOF_EOF
#define SPS30_SERIAL_TIMEOUT
#define SPS30_SERIAL_MAX_BUF_SIZE
#define SPS30_SERIAL_ESCAPE_CHAR

#define SPS30_SERIAL_FRAME_MIN_SIZE
#define SPS30_SERIAL_FRAME_ADR_OFFSET
#define SPS30_SERIAL_FRAME_CMD_OFFSET
#define SPS30_SERIAL_FRAME_MOSI_LEN_OFFSET
#define SPS30_SERIAL_FRAME_MISO_STATE_OFFSET
#define SPS30_SERIAL_FRAME_MISO_LEN_OFFSET
#define SPS30_SERIAL_FRAME_MISO_DATA_OFFSET

#define SPS30_SERIAL_START_MEAS
#define SPS30_SERIAL_STOP_MEAS
#define SPS30_SERIAL_READ_MEAS
#define SPS30_SERIAL_RESET
#define SPS30_SERIAL_CLEAN_FAN
#define SPS30_SERIAL_PERIOD
#define SPS30_SERIAL_DEV_INFO
#define SPS30_SERIAL_READ_VERSION

struct sps30_serial_priv {};

static int sps30_serial_xfer(struct sps30_state *state, const unsigned char *buf, size_t size)
{}

static const struct {} sps30_serial_bytes[] =;

static int sps30_serial_put_byte(u8 *buf, u8 byte)
{}

static u8 sps30_serial_get_byte(bool escaped, u8 byte2)
{}

static unsigned char sps30_serial_calc_chksum(const unsigned char *buf, size_t num)
{}

static int sps30_serial_prep_frame(u8 *buf, u8 cmd, const u8 *arg,
				   size_t arg_size)
{}

static bool sps30_serial_frame_valid(struct sps30_state *state, const unsigned char *buf)
{}

static int sps30_serial_command(struct sps30_state *state, unsigned char cmd,
				const void *arg, size_t arg_size, void *rsp, size_t rsp_size)
{}

static size_t sps30_serial_receive_buf(struct serdev_device *serdev,
				       const u8 *buf, size_t size)
{}

static const struct serdev_device_ops sps30_serial_device_ops =;

static int sps30_serial_start_meas(struct sps30_state *state)
{}

static int sps30_serial_stop_meas(struct sps30_state *state)
{}

static int sps30_serial_reset(struct sps30_state *state)
{}

static int sps30_serial_read_meas(struct sps30_state *state, __be32 *meas, size_t num)
{}

static int sps30_serial_clean_fan(struct sps30_state *state)
{}

static int sps30_serial_read_cleaning_period(struct sps30_state *state, __be32 *period)
{}

static int sps30_serial_write_cleaning_period(struct sps30_state *state, __be32 period)
{}

static int sps30_serial_show_info(struct sps30_state *state)
{}

static const struct sps30_ops sps30_serial_ops =;

static int sps30_serial_probe(struct serdev_device *serdev)
{}

static const struct of_device_id sps30_serial_of_match[] =;
MODULE_DEVICE_TABLE(of, sps30_serial_of_match);

static struct serdev_device_driver sps30_serial_driver =;
module_serdev_device_driver();

MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_LICENSE();
MODULE_IMPORT_NS();