#include <linux/bitfield.h>
#include <linux/bits.h>
#include <linux/counter.h>
#include <linux/device.h>
#include <linux/err.h>
#include <linux/io.h>
#include <linux/ioport.h>
#include <linux/interrupt.h>
#include <linux/isa.h>
#include <linux/kernel.h>
#include <linux/list.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/regmap.h>
#include <linux/spinlock.h>
#include <linux/types.h>
#include <linux/unaligned.h>
#define QUAD8_EXTENT …
static unsigned int base[max_num_isa_dev(QUAD8_EXTENT)];
static unsigned int num_quad8;
module_param_hw_array(base, uint, ioport, &num_quad8, 0);
MODULE_PARM_DESC(…) …;
static unsigned int irq[max_num_isa_dev(QUAD8_EXTENT)];
static unsigned int num_irq;
module_param_hw_array(irq, uint, irq, &num_irq, 0);
MODULE_PARM_DESC(…) …;
#define QUAD8_NUM_COUNTERS …
#define QUAD8_DATA(_channel) …
#define QUAD8_CONTROL(_channel) …
#define QUAD8_INTERRUPT_STATUS …
#define QUAD8_CHANNEL_OPERATION …
#define QUAD8_INDEX_INTERRUPT …
#define QUAD8_INDEX_INPUT_LEVELS …
#define QUAD8_CABLE_STATUS …
struct quad8 { … };
static const struct regmap_range quad8_wr_ranges[] = …;
static const struct regmap_range quad8_rd_ranges[] = …;
static const struct regmap_access_table quad8_wr_table = …;
static const struct regmap_access_table quad8_rd_table = …;
static const struct regmap_config quad8_regmap_config = …;
#define FLAG_E …
#define FLAG_UD …
#define UP …
#define REGISTER_SELECTION …
#define SELECT_RLD …
#define SELECT_CMR …
#define SELECT_IOR …
#define SELECT_IDR …
#define RESETS …
#define LOADS …
#define RESET_BP …
#define RESET_BT_CT_CPT_S_IDX …
#define RESET_E …
#define TRANSFER_PR_TO_CNTR …
#define TRANSFER_CNTR_TO_OL …
#define TRANSFER_PR0_TO_PSC …
#define COUNT_ENCODING …
#define COUNT_MODE …
#define QUADRATURE_MODE …
#define BINARY …
#define NORMAL_COUNT …
#define RANGE_LIMIT …
#define NON_RECYCLE_COUNT …
#define MODULO_N …
#define NON_QUADRATURE …
#define QUADRATURE_X1 …
#define QUADRATURE_X2 …
#define QUADRATURE_X4 …
#define AB_GATE …
#define LOAD_PIN …
#define FLG_PINS …
#define DISABLE_AB …
#define LOAD_CNTR …
#define FLG1_CARRY_FLG2_BORROW …
#define FLG1_COMPARE_FLG2_BORROW …
#define FLG1_CARRYBORROW_FLG2_UD …
#define FLG1_INDX_FLG2_E …
#define INDEX_MODE …
#define INDEX_POLARITY …
#define DISABLE_INDEX_MODE …
#define ENABLE_INDEX_MODE …
#define NEGATIVE_INDEX_POLARITY …
#define POSITIVE_INDEX_POLARITY …
#define COUNTERS_OPERATION …
#define INTERRUPT_FUNCTION …
#define ENABLE_COUNTERS …
#define RESET_COUNTERS …
#define DISABLE_INTERRUPT_FUNCTION …
#define ENABLE_INTERRUPT_FUNCTION …
#define CLEAR_PENDING_INTERRUPTS …
#define LS7267_CNTR_MAX …
static __always_inline int quad8_control_register_update(struct regmap *const map, u8 *const buf,
const size_t channel, const u8 val,
const u8 field)
{ … }
static int quad8_signal_read(struct counter_device *counter,
struct counter_signal *signal,
enum counter_signal_level *level)
{ … }
static int quad8_count_read(struct counter_device *counter,
struct counter_count *count, u64 *val)
{ … }
static int quad8_preset_register_set(struct quad8 *const priv, const size_t id,
const unsigned long preset)
{ … }
static int quad8_flag_register_reset(struct quad8 *const priv, const size_t id)
{ … }
static int quad8_count_write(struct counter_device *counter,
struct counter_count *count, u64 val)
{ … }
static const enum counter_function quad8_count_functions_list[] = …;
static int quad8_function_get(const struct quad8 *const priv, const size_t id,
enum counter_function *const function)
{ … }
static int quad8_function_read(struct counter_device *counter,
struct counter_count *count,
enum counter_function *function)
{ … }
static int quad8_function_write(struct counter_device *counter,
struct counter_count *count,
enum counter_function function)
{ … }
static int quad8_direction_read(struct counter_device *counter,
struct counter_count *count,
enum counter_count_direction *direction)
{ … }
static const enum counter_synapse_action quad8_index_actions_list[] = …;
static const enum counter_synapse_action quad8_synapse_actions_list[] = …;
static int quad8_action_read(struct counter_device *counter,
struct counter_count *count,
struct counter_synapse *synapse,
enum counter_synapse_action *action)
{ … }
static int quad8_events_configure(struct counter_device *counter)
{ … }
static int quad8_watch_validate(struct counter_device *counter,
const struct counter_watch *watch)
{ … }
static const struct counter_ops quad8_ops = …;
static const char *const quad8_index_polarity_modes[] = …;
static int quad8_index_polarity_get(struct counter_device *counter,
struct counter_signal *signal,
u32 *index_polarity)
{ … }
static int quad8_index_polarity_set(struct counter_device *counter,
struct counter_signal *signal,
u32 index_polarity)
{ … }
static int quad8_polarity_read(struct counter_device *counter,
struct counter_signal *signal,
enum counter_signal_polarity *polarity)
{ … }
static int quad8_polarity_write(struct counter_device *counter,
struct counter_signal *signal,
enum counter_signal_polarity polarity)
{ … }
static const char *const quad8_synchronous_modes[] = …;
static int quad8_synchronous_mode_get(struct counter_device *counter,
struct counter_signal *signal,
u32 *synchronous_mode)
{ … }
static int quad8_synchronous_mode_set(struct counter_device *counter,
struct counter_signal *signal,
u32 synchronous_mode)
{ … }
static int quad8_count_floor_read(struct counter_device *counter,
struct counter_count *count, u64 *floor)
{ … }
static int quad8_count_mode_read(struct counter_device *counter,
struct counter_count *count,
enum counter_count_mode *cnt_mode)
{ … }
static int quad8_count_mode_write(struct counter_device *counter,
struct counter_count *count,
enum counter_count_mode cnt_mode)
{ … }
static int quad8_count_enable_read(struct counter_device *counter,
struct counter_count *count, u8 *enable)
{ … }
static int quad8_count_enable_write(struct counter_device *counter,
struct counter_count *count, u8 enable)
{ … }
static const char *const quad8_noise_error_states[] = …;
static int quad8_error_noise_get(struct counter_device *counter,
struct counter_count *count, u32 *noise_error)
{ … }
static int quad8_count_preset_read(struct counter_device *counter,
struct counter_count *count, u64 *preset)
{ … }
static int quad8_count_preset_write(struct counter_device *counter,
struct counter_count *count, u64 preset)
{ … }
static int quad8_count_ceiling_read(struct counter_device *counter,
struct counter_count *count, u64 *ceiling)
{ … }
static int quad8_count_ceiling_write(struct counter_device *counter,
struct counter_count *count, u64 ceiling)
{ … }
static int quad8_count_preset_enable_read(struct counter_device *counter,
struct counter_count *count,
u8 *preset_enable)
{ … }
static int quad8_count_preset_enable_write(struct counter_device *counter,
struct counter_count *count,
u8 preset_enable)
{ … }
static int quad8_signal_cable_fault_read(struct counter_device *counter,
struct counter_signal *signal,
u8 *cable_fault)
{ … }
static int quad8_signal_cable_fault_enable_read(struct counter_device *counter,
struct counter_signal *signal,
u8 *enable)
{ … }
static int quad8_signal_cable_fault_enable_write(struct counter_device *counter,
struct counter_signal *signal,
u8 enable)
{ … }
static int quad8_signal_fck_prescaler_read(struct counter_device *counter,
struct counter_signal *signal,
u8 *prescaler)
{ … }
static int quad8_filter_clock_prescaler_set(struct quad8 *const priv, const size_t id,
const u8 prescaler)
{ … }
static int quad8_signal_fck_prescaler_write(struct counter_device *counter,
struct counter_signal *signal,
u8 prescaler)
{ … }
static struct counter_comp quad8_signal_ext[] = …;
static const enum counter_signal_polarity quad8_polarities[] = …;
static DEFINE_COUNTER_AVAILABLE(quad8_polarity_available, quad8_polarities);
static DEFINE_COUNTER_ENUM(quad8_index_pol_enum, quad8_index_polarity_modes);
static DEFINE_COUNTER_ENUM(quad8_synch_mode_enum, quad8_synchronous_modes);
static struct counter_comp quad8_index_ext[] = …;
#define QUAD8_QUAD_SIGNAL(_id, _name) …
#define QUAD8_INDEX_SIGNAL(_id, _name) …
static struct counter_signal quad8_signals[] = …;
#define QUAD8_COUNT_SYNAPSES(_id) …
static struct counter_synapse quad8_count_synapses[][3] = …;
static const enum counter_count_mode quad8_cnt_modes[] = …;
static DEFINE_COUNTER_AVAILABLE(quad8_count_mode_available, quad8_cnt_modes);
static DEFINE_COUNTER_ENUM(quad8_error_noise_enum, quad8_noise_error_states);
static struct counter_comp quad8_count_ext[] = …;
#define QUAD8_COUNT(_id, _cntname) …
static struct counter_count quad8_counts[] = …;
static irqreturn_t quad8_irq_handler(int irq, void *private)
{ … }
static int quad8_init_counter(struct quad8 *const priv, const size_t channel)
{ … }
static int quad8_probe(struct device *dev, unsigned int id)
{ … }
static struct isa_driver quad8_driver = …;
module_isa_driver_with_irq(quad8_driver, num_quad8, num_irq);
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;
MODULE_IMPORT_NS(…);