ASoC: Remove duplicate ADC/DAC widgets from wm_hubs.c
[linux/fpc-iii.git] / drivers / staging / meilhaus / me8254.h
blob572b7196d5a8c555ac84843f3ed732c5a1253c4c
1 /**
2 * @file me8254.h
4 * @brief 8254 counter implementation.
5 * @note Copyright (C) 2007 Meilhaus Electronic GmbH (support@meilhaus.de)
6 * @author Guenter Gebhardt
7 */
9 /*
10 * Copyright (C) 2007 Meilhaus Electronic GmbH (support@meilhaus.de)
12 * This file is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version.
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
27 #ifndef _ME8254_H_
28 #define _ME8254_H_
30 #include "mesubdevice.h"
31 #include "meslock.h"
33 #ifdef __KERNEL__
35 /**
36 * @brief The 8254 subdevice class.
38 typedef struct me8254_subdevice {
39 /* Inheritance */
40 me_subdevice_t base; /**< The subdevice base class. */
42 /* Attributes */
43 spinlock_t subdevice_lock; /**< Spin lock to protect the subdevice from concurrent access. */
45 spinlock_t *ctrl_reg_lock; /**< Spin lock to protect the control register from concurrent access. */
46 spinlock_t *clk_src_reg_lock; /**< Spin lock to protect the clock source register from concurrent access. */
48 uint32_t device_id; /**< The Meilhaus device type carrying the 8254 chip. */
49 int me8254_idx; /**< The index of the 8254 chip on the device. */
50 int ctr_idx; /**< The index of the counter on the 8254 chip. */
52 int caps; /**< Holds the device capabilities. */
54 unsigned long val_reg; /**< Holds the actual counter value. */
55 unsigned long ctrl_reg; /**< Register to configure the 8254 modes. */
56 unsigned long clk_src_reg; /**< Register to configure the counter connections. */
57 } me8254_subdevice_t;
59 /**
60 * @brief The constructor to generate a 8254 instance.
62 * @param device_id The kind of Meilhaus device holding the 8254.
63 * @param reg_base The register base address of the device as returned by the PCI BIOS.
64 * @param me8254_idx The index of the 8254 chip on the Meilhaus device.
65 * @param ctr_idx The index of the counter inside a 8254 chip.
66 * @param ctrl_reg_lock Pointer to spin lock protecting the 8254 control register from concurrent access.
67 * @param clk_src_reg_lock Pointer to spin lock protecting the clock source register from concurrent access.
69 * @return Pointer to new instance on success.\n
70 * NULL on error.
72 me8254_subdevice_t *me8254_constructor(uint32_t device_id,
73 uint32_t reg_base,
74 unsigned int me8254_idx,
75 unsigned int ctr_idx,
76 spinlock_t * ctrl_reg_lock,
77 spinlock_t * clk_src_reg_lock);
79 #endif
80 #endif