blob: efb5dabb9c9410662b51d214d664fd1e040ff4fb [file] [log] [blame]
Mario Sixab88bd22018-10-04 09:00:55 +02001/* SPDX-License-Identifier: GPL-2.0+ */
2/*
3 * (C) Copyright 2018
4 * Mario Six, Guntermann & Drunck GmbH, mario.six@gdsys.cc
5 */
6
7/**
8 * struct ihs_fpga_regs - IHS FPGA register map structure
9 * @reflection_low: Lower reflection register
10 * @versions: PCB versions register
11 * @fpga_version: FPGA versions register
12 * @features: FPGA features register
13 * @extended_features: FPGA extended features register
14 * @top_interrupt: Top interrupt register
15 * @top_interrupt_enable: Top interrupt enable register
16 * @status: FPGA status register
17 * @control: FPGA control register
18 * @extended_control: FPGA extended control register
19 */
20struct ihs_fpga_regs {
21 u16 reflection_low;
22 u16 versions;
23 u16 fpga_version;
24 u16 features;
25 u16 extended_features;
26 u16 top_interrupt;
27 u16 top_interrupt_enable;
28 u16 status;
29 u16 control;
30 u16 extended_control;
31};
32
33/**
34 * ihs_fpga_set() - Convenience macro to set values in FPGA register map
35 * @map: Register map to set a value in
36 * @member: Name of member (described by ihs_fpga_regs) to set
37 * @val: Value to set the member to
38 */
39#define ihs_fpga_set(map, member, val) \
40 regmap_set(map, struct ihs_fpga_regs, member, val)
41
42/**
43 * ihs_fpga_get() - Convenience macro to get values from FPGA register map
44 * @map: Register map to read value from
45 * @member: Name of member (described by ihs_fpga_regs) to get
46 * @valp: Pointe to variable to receive the value read
47 */
48#define ihs_fpga_get(map, member, valp) \
49 regmap_get(map, struct ihs_fpga_regs, member, valp)