Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
iio_dummy_evgen.c File Reference
#include <linux/kernel.h>
#include <linux/slab.h>
#include <linux/interrupt.h>
#include <linux/irq.h>
#include <linux/mutex.h>
#include <linux/module.h>
#include <linux/sysfs.h>
#include "iio_dummy_evgen.h"
#include <linux/iio/iio.h>
#include <linux/iio/sysfs.h>

Go to the source code of this file.

Data Structures

struct  iio_dummy_eventgen
 

Macros

#define IIO_EVENTGEN_NO   10
 

Functions

int iio_dummy_evgen_get_irq (void)
 
 EXPORT_SYMBOL_GPL (iio_dummy_evgen_get_irq)
 
int iio_dummy_evgen_release_irq (int irq)
 
 EXPORT_SYMBOL_GPL (iio_dummy_evgen_release_irq)
 
 module_init (iio_dummy_evgen_init)
 
 module_exit (iio_dummy_evgen_exit)
 
 MODULE_AUTHOR ("Jonathan Cameron <[email protected]>")
 
 MODULE_DESCRIPTION ("IIO dummy driver")
 
 MODULE_LICENSE ("GPL v2")
 

Macro Definition Documentation

#define IIO_EVENTGEN_NO   10

Copyright (c) 2011 Jonathan Cameron

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation.

Companion module to the iio simple dummy example driver. The purpose of this is to generate 'fake' event interrupts thus allowing that driver's code to be as close as possible to that of a normal driver talking to hardware. The approach used here is not intended to be general and just happens to work for this particular use case.

Definition at line 29 of file iio_dummy_evgen.c.

Function Documentation

EXPORT_SYMBOL_GPL ( iio_dummy_evgen_get_irq  )
EXPORT_SYMBOL_GPL ( iio_dummy_evgen_release_irq  )
int iio_dummy_evgen_get_irq ( void  )

iio_dummy_evgen_get_irq() - get an evgen provided irq for a device

This function will give a free allocated irq to a client device. That irq can then be caused to 'fire' by using the associated sysfs file.

Definition at line 102 of file iio_dummy_evgen.c.

int iio_dummy_evgen_release_irq ( int  irq)

iio_dummy_evgen_release_irq() - give the irq back. : irq being returned to the pool

Used by client driver instances to give the irqs back when they disconnect

Definition at line 129 of file iio_dummy_evgen.c.

MODULE_AUTHOR ( "Jonathan Cameron <[email protected]>"  )
MODULE_DESCRIPTION ( "IIO dummy driver )
module_exit ( iio_dummy_evgen_exit  )
module_init ( iio_dummy_evgen_init  )
MODULE_LICENSE ( "GPL v2 )