linux/drivers/pps/pps.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * PPS core file
 *
 * Copyright (C) 2005-2009   Rodolfo Giometti <[email protected]>
 */

#define pr_fmt(fmt)

#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/sched.h>
#include <linux/uaccess.h>
#include <linux/idr.h>
#include <linux/mutex.h>
#include <linux/cdev.h>
#include <linux/poll.h>
#include <linux/pps_kernel.h>
#include <linux/slab.h>

#include "kc.h"

/*
 * Local variables
 */

static dev_t pps_devt;
static struct class *pps_class;

static DEFINE_MUTEX(pps_idr_lock);
static DEFINE_IDR(pps_idr);

/*
 * Char device methods
 */

static __poll_t pps_cdev_poll(struct file *file, poll_table *wait)
{}

static int pps_cdev_fasync(int fd, struct file *file, int on)
{}

static int pps_cdev_pps_fetch(struct pps_device *pps, struct pps_fdata *fdata)
{}

static long pps_cdev_ioctl(struct file *file,
		unsigned int cmd, unsigned long arg)
{}

#ifdef CONFIG_COMPAT
static long pps_cdev_compat_ioctl(struct file *file,
		unsigned int cmd, unsigned long arg)
{}
#else
#define pps_cdev_compat_ioctl
#endif

static int pps_cdev_open(struct inode *inode, struct file *file)
{}

static int pps_cdev_release(struct inode *inode, struct file *file)
{}

/*
 * Char device stuff
 */

static const struct file_operations pps_cdev_fops =;

static void pps_device_destruct(struct device *dev)
{}

int pps_register_cdev(struct pps_device *pps)
{}

void pps_unregister_cdev(struct pps_device *pps)
{}

/*
 * Look up a pps device by magic cookie.
 * The cookie is usually a pointer to some enclosing device, but this
 * code doesn't care; you should never be dereferencing it.
 *
 * This is a bit of a kludge that is currently used only by the PPS
 * serial line discipline.  It may need to be tweaked when a second user
 * is found.
 *
 * There is no function interface for setting the lookup_cookie field.
 * It's initialized to NULL when the pps device is created, and if a
 * client wants to use it, just fill it in afterward.
 *
 * The cookie is automatically set to NULL in pps_unregister_source()
 * so that it will not be used again, even if the pps device cannot
 * be removed from the idr due to pending references holding the minor
 * number in use.
 */
struct pps_device *pps_lookup_dev(void const *cookie)
{}
EXPORT_SYMBOL();

/*
 * Module stuff
 */

static void __exit pps_exit(void)
{}

static int __init pps_init(void)
{}

subsys_initcall(pps_init);
module_exit(pps_exit);

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