Merge tag 'pinctrl-v5.1-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw...
[sfrench/cifs-2.6.git] / drivers / pinctrl / sunxi / pinctrl-sunxi.h
index 034c0317c8d61694c39e8afc127e34dbe5e4c931..ee15ab067b5fd0692e5ba4c010f1db1d88bd4d85 100644 (file)
 #define IRQ_LEVEL_LOW          0x03
 #define IRQ_EDGE_BOTH          0x04
 
+#define GRP_CFG_REG            0x300
+
+#define IO_BIAS_MASK           GENMASK(3, 0)
+
 #define SUN4I_FUNC_INPUT       0
 #define SUN4I_FUNC_IRQ         6
 
@@ -113,6 +117,7 @@ struct sunxi_pinctrl_desc {
        const unsigned int              *irq_bank_map;
        bool                            irq_read_needs_mux;
        bool                            disable_strict_mode;
+       bool                            has_io_bias_cfg;
 };
 
 struct sunxi_pinctrl_function {
@@ -338,6 +343,13 @@ static inline u32 sunxi_irq_status_offset(u16 irq)
        return irq_num * IRQ_STATUS_IRQ_BITS;
 }
 
+static inline u32 sunxi_grp_config_reg(u16 pin)
+{
+       u8 bank = pin / PINS_PER_BANK;
+
+       return GRP_CFG_REG + bank * 0x4;
+}
+
 int sunxi_pinctrl_init_with_variant(struct platform_device *pdev,
                                    const struct sunxi_pinctrl_desc *desc,
                                    unsigned long variant);