accel/ivpu: Move recovery work to system_unbound_wq
[drm/drm-misc.git] / drivers / pinctrl / intel / pinctrl-tangier.h
blob955cc967c0bc22d63cf01aa9e2c50f94e672076f
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /*
3 * Intel Tangier pinctrl functions
5 * Copyright (C) 2016, 2023 Intel Corporation
7 * Authors: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
8 * Raag Jadav <raag.jadav@intel.com>
9 */
11 #ifndef PINCTRL_TANGIER_H
12 #define PINCTRL_TANGIER_H
14 #include <linux/spinlock_types.h>
15 #include <linux/types.h>
17 #include <linux/pinctrl/pinctrl.h>
19 #include "pinctrl-intel.h"
21 struct device;
22 struct platform_device;
24 #define TNG_FAMILY_NR 64
25 #define TNG_FAMILY_LEN 0x400
27 /**
28 * struct tng_family - Tangier pin family description
29 * @barno: MMIO BAR number where registers for this family reside
30 * @pin_base: Starting pin of pins in this family
31 * @npins: Number of pins in this family
32 * @protected: True if family is protected by access
33 * @regs: Family specific common registers
35 struct tng_family {
36 unsigned int barno;
37 unsigned int pin_base;
38 size_t npins;
39 bool protected;
40 void __iomem *regs;
43 #define TNG_FAMILY(b, s, e) \
44 { \
45 .barno = (b), \
46 .pin_base = (s), \
47 .npins = (e) - (s) + 1, \
50 #define TNG_FAMILY_PROTECTED(b, s, e) \
51 { \
52 .barno = (b), \
53 .pin_base = (s), \
54 .npins = (e) - (s) + 1, \
55 .protected = true, \
58 /**
59 * struct tng_pinctrl - Tangier pinctrl private structure
60 * @dev: Pointer to the device structure
61 * @lock: Lock to serialize register access
62 * @pctldesc: Pin controller description
63 * @pctldev: Pointer to the pin controller device
64 * @families: Array of families this pinctrl handles
65 * @nfamilies: Number of families in the array
66 * @functions: Array of functions
67 * @nfunctions: Number of functions in the array
68 * @groups: Array of pin groups
69 * @ngroups: Number of groups in the array
70 * @pins: Array of pins this pinctrl controls
71 * @npins: Number of pins in the array
73 struct tng_pinctrl {
74 struct device *dev;
75 raw_spinlock_t lock;
76 struct pinctrl_desc pctldesc;
77 struct pinctrl_dev *pctldev;
79 /* Pin controller configuration */
80 const struct tng_family *families;
81 size_t nfamilies;
82 const struct intel_function *functions;
83 size_t nfunctions;
84 const struct intel_pingroup *groups;
85 size_t ngroups;
86 const struct pinctrl_pin_desc *pins;
87 size_t npins;
90 int devm_tng_pinctrl_probe(struct platform_device *pdev);
92 #endif /* PINCTRL_TANGIER_H */