linux/drivers/iio/trigger/stm32-timer-trigger.c

// SPDX-License-Identifier: GPL-2.0
/*
 * Copyright (C) STMicroelectronics 2016
 *
 * Author: Benjamin Gaignard <[email protected]>
 *
 */

#include <linux/iio/iio.h>
#include <linux/iio/sysfs.h>
#include <linux/iio/timer/stm32-timer-trigger.h>
#include <linux/iio/trigger.h>
#include <linux/mfd/stm32-timers.h>
#include <linux/mod_devicetable.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/property.h>

#define MAX_TRIGGERS
#define MAX_VALIDS

/* List the triggers created by each timer */
static const void *triggers_table[][MAX_TRIGGERS] =;

/* List the triggers accepted by each timer */
static const void *valids_table[][MAX_VALIDS] =;

static const void *stm32h7_valids_table[][MAX_VALIDS] =;

struct stm32_timer_trigger_regs {};

struct stm32_timer_trigger {};

struct stm32_timer_trigger_cfg {};

static bool stm32_timer_is_trgo2_name(const char *name)
{}

static bool stm32_timer_is_trgo_name(const char *name)
{}

static int stm32_timer_start(struct stm32_timer_trigger *priv,
			     struct iio_trigger *trig,
			     unsigned int frequency)
{}

static void stm32_timer_stop(struct stm32_timer_trigger *priv,
			     struct iio_trigger *trig)
{}

static ssize_t stm32_tt_store_frequency(struct device *dev,
					struct device_attribute *attr,
					const char *buf, size_t len)
{}

static ssize_t stm32_tt_read_frequency(struct device *dev,
				       struct device_attribute *attr, char *buf)
{}

static IIO_DEV_ATTR_SAMP_FREQ(0660,
			      stm32_tt_read_frequency,
			      stm32_tt_store_frequency);

#define MASTER_MODE_MAX
#define MASTER_MODE2_MAX

static char *master_mode_table[] =;

static ssize_t stm32_tt_show_master_mode(struct device *dev,
					 struct device_attribute *attr,
					 char *buf)
{}

static ssize_t stm32_tt_store_master_mode(struct device *dev,
					  struct device_attribute *attr,
					  const char *buf, size_t len)
{}

static ssize_t stm32_tt_show_master_mode_avail(struct device *dev,
					       struct device_attribute *attr,
					       char *buf)
{}

static IIO_DEVICE_ATTR(master_mode_available, 0444,
		       stm32_tt_show_master_mode_avail, NULL, 0);

static IIO_DEVICE_ATTR(master_mode, 0660,
		       stm32_tt_show_master_mode,
		       stm32_tt_store_master_mode,
		       0);

static struct attribute *stm32_trigger_attrs[] =;

static const struct attribute_group stm32_trigger_attr_group =;

static const struct attribute_group *stm32_trigger_attr_groups[] =;

static const struct iio_trigger_ops timer_trigger_ops =;

static void stm32_unregister_iio_triggers(struct stm32_timer_trigger *priv)
{}

static int stm32_register_iio_triggers(struct stm32_timer_trigger *priv)
{}

static int stm32_counter_read_raw(struct iio_dev *indio_dev,
				  struct iio_chan_spec const *chan,
				  int *val, int *val2, long mask)
{}

static int stm32_counter_write_raw(struct iio_dev *indio_dev,
				   struct iio_chan_spec const *chan,
				   int val, int val2, long mask)
{}

static int stm32_counter_validate_trigger(struct iio_dev *indio_dev,
					  struct iio_trigger *trig)
{}

static const struct iio_info stm32_trigger_info =;

static const char *const stm32_trigger_modes[] =;

static int stm32_set_trigger_mode(struct iio_dev *indio_dev,
				  const struct iio_chan_spec *chan,
				  unsigned int mode)
{}

static int stm32_get_trigger_mode(struct iio_dev *indio_dev,
				  const struct iio_chan_spec *chan)
{}

static const struct iio_enum stm32_trigger_mode_enum =;

static const char *const stm32_enable_modes[] =;

static int stm32_enable_mode2sms(int mode)
{}

static int stm32_set_enable_mode(struct iio_dev *indio_dev,
				 const struct iio_chan_spec *chan,
				 unsigned int mode)
{}

static int stm32_sms2enable_mode(int mode)
{}

static int stm32_get_enable_mode(struct iio_dev *indio_dev,
				 const struct iio_chan_spec *chan)
{}

static const struct iio_enum stm32_enable_mode_enum =;

static ssize_t stm32_count_get_preset(struct iio_dev *indio_dev,
				      uintptr_t private,
				      const struct iio_chan_spec *chan,
				      char *buf)
{}

static ssize_t stm32_count_set_preset(struct iio_dev *indio_dev,
				      uintptr_t private,
				      const struct iio_chan_spec *chan,
				      const char *buf, size_t len)
{}

static const struct iio_chan_spec_ext_info stm32_trigger_count_info[] =;

static const struct iio_chan_spec stm32_trigger_channel =;

static struct stm32_timer_trigger *stm32_setup_counter_device(struct device *dev)
{}

/**
 * is_stm32_timer_trigger
 * @trig: trigger to be checked
 *
 * return true if the trigger is a valid stm32 iio timer trigger
 * either return false
 */
bool is_stm32_timer_trigger(struct iio_trigger *trig)
{}
EXPORT_SYMBOL();

static void stm32_timer_detect_trgo2(struct stm32_timer_trigger *priv)
{}

static int stm32_timer_trigger_probe(struct platform_device *pdev)
{}

static void stm32_timer_trigger_remove(struct platform_device *pdev)
{}

static int stm32_timer_trigger_suspend(struct device *dev)
{}

static int stm32_timer_trigger_resume(struct device *dev)
{}

static DEFINE_SIMPLE_DEV_PM_OPS(stm32_timer_trigger_pm_ops,
				stm32_timer_trigger_suspend,
				stm32_timer_trigger_resume);

static const struct stm32_timer_trigger_cfg stm32_timer_trg_cfg =;

static const struct stm32_timer_trigger_cfg stm32h7_timer_trg_cfg =;

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

static struct platform_driver stm32_timer_trigger_driver =;
module_platform_driver();

MODULE_ALIAS();
MODULE_DESCRIPTION();
MODULE_LICENSE();