diff options
author | merge <null@invalid> | 2009-01-22 13:55:32 +0000 |
---|---|---|
committer | Andy Green <agreen@octopus.localdomain> | 2009-01-22 13:55:32 +0000 |
commit | aa6f5ffbdba45aa8e19e5048648fc6c7b25376d3 (patch) | |
tree | fbb786d0ac6f8a774fd834e9ce951197e60fbffa /drivers/staging/meilhaus/me8255.h | |
parent | f2d78193eae5dccd3d588d2c8ea0866efc368332 (diff) |
MERGE-via-pending-tracking-hist-MERGE-via-stable-tracking-MERGE-via-mokopatches-tracking-fix-stray-endmenu-patch-1232632040-1232632141
pending-tracking-hist top was MERGE-via-stable-tracking-MERGE-via-mokopatches-tracking-fix-stray-endmenu-patch-1232632040-1232632141 / fdf777a63bcb59e0dfd78bfe2c6242e01f6d4eb9 ... parent commitmessage:
From: merge <null@invalid>
MERGE-via-stable-tracking-hist-MERGE-via-mokopatches-tracking-fix-stray-endmenu-patch-1232632040
stable-tracking-hist top was MERGE-via-mokopatches-tracking-fix-stray-endmenu-patch-1232632040 / 90463bfd2d5a3c8b52f6e6d71024a00e052b0ced ... parent commitmessage:
From: merge <null@invalid>
MERGE-via-mokopatches-tracking-hist-fix-stray-endmenu-patch
mokopatches-tracking-hist top was fix-stray-endmenu-patch / 3630e0be570de8057e7f8d2fe501ed353cdf34e6 ... parent commitmessage:
From: Andy Green <andy@openmoko.com>
fix-stray-endmenu.patch
Signed-off-by: Andy Green <andy@openmoko.com>
Diffstat (limited to 'drivers/staging/meilhaus/me8255.h')
-rw-r--r-- | drivers/staging/meilhaus/me8255.h | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/drivers/staging/meilhaus/me8255.h b/drivers/staging/meilhaus/me8255.h new file mode 100644 index 00000000000..338230052b3 --- /dev/null +++ b/drivers/staging/meilhaus/me8255.h @@ -0,0 +1,59 @@ +/** + * @file me8255.h + * + * @brief Meilhaus PIO 8255 implementation. + * @note Copyright (C) 2006 Meilhaus Electronic GmbH (support@meilhaus.de) + * @author Guenter Gebhardt + */ + +#ifndef _ME8255_H_ +#define _ME8255_H_ + +#include "mesubdevice.h" +#include "meslock.h" + +#ifdef __KERNEL__ + +/** + * @brief The 8255 subdevice class. + */ +typedef struct me8255_subdevice { + /* Inheritance */ + me_subdevice_t base; /**< The subdevice base class. */ + + /* Attributes */ + spinlock_t subdevice_lock; /**< Spin lock to protect the subdevice from concurrent access. */ + + int *ctrl_reg_mirror; /**< Pointer to mirror of the control register. */ + spinlock_t *ctrl_reg_lock; /**< Spin lock to protect #ctrl_reg and #ctrl_reg_mirror from concurrent access. */ + + uint32_t device_id; /**< The PCI device id of the device holding the 8255 chip. */ + int me8255_idx; /**< The index of the 8255 chip on the device. */ + int dio_idx; /**< The index of the DIO port on the 8255 chip. */ + + unsigned long port_reg; /**< Register to read or write a value from or to the port respectively. */ + unsigned long ctrl_reg; /**< Register to configure the 8255 modes. */ +} me8255_subdevice_t; + +/** + * @brief The constructor to generate a 8255 instance. + * + * @param device_id The kind of Meilhaus device holding the 8255. + * @param reg_base The register base address of the device as returned by the PCI BIOS. + * @param me8255_idx The index of the 8255 chip on the Meilhaus device. + * @param dio_idx The index of the counter inside a 8255 chip. + * @param ctr_reg_mirror Pointer to mirror of control register. + * @param ctrl_reg_lock Pointer to spin lock protecting the 8255 control register and #ctrl_reg_mirror from concurrent access. + * + * @return Pointer to new instance on success.\n + * NULL on error. + */ +me8255_subdevice_t *me8255_constructor(uint32_t device_id, + uint32_t reg_base, + unsigned int me8255_idx, + unsigned int dio_idx, + int *ctrl_reg_mirror, + spinlock_t * ctrl_reg_lock); + +#endif +#endif |