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

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

#include <linux/iio/iio.h>
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/mfd/core.h>
#include <linux/mod_devicetable.h>
#include <linux/module.h>
#include <linux/property.h>

#include "ssp.h"

#define SSP_WDT_TIME
#define SSP_LIMIT_RESET_CNT
#define SSP_LIMIT_TIMEOUT_CNT

/* It is possible that it is max clk rate for version 1.0 of bootcode */
#define SSP_BOOT_SPI_HZ

/*
 * These fields can look enigmatic but this structure is used mainly to flat
 * some values and depends on command type.
 */
struct ssp_instruction {} __attribute__((packed));

static const u8 ssp_magnitude_table[] =;

static const struct ssp_sensorhub_info ssp_rinato_info =;

static const struct ssp_sensorhub_info ssp_thermostat_info =;

static const struct mfd_cell sensorhub_sensor_devs[] =;

static void ssp_toggle_mcu_reset_gpio(struct ssp_data *data)
{}

static void ssp_sync_available_sensors(struct ssp_data *data)
{}

static void ssp_enable_mcu(struct ssp_data *data, bool enable)
{}

/*
 * This function is the first one which communicates with the mcu so it is
 * possible that the first attempt will fail
 */
static int ssp_check_fwbl(struct ssp_data *data)
{}

static void ssp_reset_mcu(struct ssp_data *data)
{}

static void ssp_wdt_work_func(struct work_struct *work)
{}

static void ssp_wdt_timer_func(struct timer_list *t)
{}

static void ssp_enable_wdt_timer(struct ssp_data *data)
{}

static void ssp_disable_wdt_timer(struct ssp_data *data)
{}

/**
 * ssp_get_sensor_delay() - gets sensor data acquisition period
 * @data:	sensorhub structure
 * @type:	SSP sensor type
 *
 * Returns acquisition period in ms
 */
u32 ssp_get_sensor_delay(struct ssp_data *data, enum ssp_sensor_type type)
{}
EXPORT_SYMBOL_NS();

/**
 * ssp_enable_sensor() - enables data acquisition for sensor
 * @data:	sensorhub structure
 * @type:	SSP sensor type
 * @delay:	delay in ms
 *
 * Returns 0 or negative value in case of error
 */
int ssp_enable_sensor(struct ssp_data *data, enum ssp_sensor_type type,
		      u32 delay)
{}
EXPORT_SYMBOL_NS();

/**
 * ssp_change_delay() - changes data acquisition for sensor
 * @data:	sensorhub structure
 * @type:	SSP sensor type
 * @delay:	delay in ms
 *
 * Returns 0 or negative value in case of error
 */
int ssp_change_delay(struct ssp_data *data, enum ssp_sensor_type type,
		     u32 delay)
{}
EXPORT_SYMBOL_NS();

/**
 * ssp_disable_sensor() - disables sensor
 *
 * @data:	sensorhub structure
 * @type:	SSP sensor type
 *
 * Returns 0 or negative value in case of error
 */
int ssp_disable_sensor(struct ssp_data *data, enum ssp_sensor_type type)
{}
EXPORT_SYMBOL_NS();

static irqreturn_t ssp_irq_thread_fn(int irq, void *dev_id)
{}

static int ssp_initialize_mcu(struct ssp_data *data)
{}

/*
 * sensorhub can request its reinitialization as some brutal and rare error
 * handling. It can be requested from the MCU.
 */
static void ssp_refresh_task(struct work_struct *work)
{}

int ssp_queue_ssp_refresh_task(struct ssp_data *data, unsigned int delay)
{}

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

static struct ssp_data *ssp_parse_dt(struct device *dev)
{}

/**
 * ssp_register_consumer() - registers iio consumer in ssp framework
 *
 * @indio_dev:	consumer iio device
 * @type:	ssp sensor type
 */
void ssp_register_consumer(struct iio_dev *indio_dev, enum ssp_sensor_type type)
{}
EXPORT_SYMBOL_NS();

static int ssp_probe(struct spi_device *spi)
{}

static void ssp_remove(struct spi_device *spi)
{}

static int ssp_suspend(struct device *dev)
{}

static int ssp_resume(struct device *dev)
{}

static DEFINE_SIMPLE_DEV_PM_OPS(ssp_pm_ops, ssp_suspend, ssp_resume);

static struct spi_driver ssp_driver =;

module_spi_driver();

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