Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/fdt Sort a bit. NFC
details: https://anonhg.NetBSD.org/src/rev/adadaeab0dfb
branches: trunk
changeset: 361999:adadaeab0dfb
user: skrll <skrll%NetBSD.org@localhost>
date: Wed Feb 23 08:56:11 2022 +0000
description:
Sort a bit. NFC
diffstat:
sys/dev/fdt/fdtvar.h | 339 ++++++++++++++++++++++++++------------------------
1 files changed, 179 insertions(+), 160 deletions(-)
diffs (truncated from 456 to 300 lines):
diff -r 9a2bb846a563 -r adadaeab0dfb sys/dev/fdt/fdtvar.h
--- a/sys/dev/fdt/fdtvar.h Wed Feb 23 07:55:55 2022 +0000
+++ b/sys/dev/fdt/fdtvar.h Wed Feb 23 08:56:11 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: fdtvar.h,v 1.75 2022/02/23 07:55:55 skrll Exp $ */
+/* $NetBSD: fdtvar.h,v 1.76 2022/02/23 08:56:11 skrll Exp $ */
/*-
* Copyright (c) 2015 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -59,95 +59,17 @@
int faa_quiet;
};
-/* flags for fdtbus_intr_establish */
-#define FDT_INTR_MPSAFE __BIT(0)
-
-/* Interrupt trigger types defined by the FDT "interrupts" bindings. */
-#define FDT_INTR_TYPE_POS_EDGE __BIT(0)
-#define FDT_INTR_TYPE_NEG_EDGE __BIT(1)
-#define FDT_INTR_TYPE_DOUBLE_EDGE (FDT_INTR_TYPE_POS_EDGE | \
- FDT_INTR_TYPE_NEG_EDGE)
-#define FDT_INTR_TYPE_HIGH_LEVEL __BIT(2)
-#define FDT_INTR_TYPE_LOW_LEVEL __BIT(3)
-
-struct fdtbus_interrupt_controller_func {
- void * (*establish)(device_t, u_int *, int, int,
- int (*)(void *), void *, const char *);
- void (*disestablish)(device_t, void *);
- bool (*intrstr)(device_t, u_int *, char *, size_t);
- void (*mask)(device_t, void *);
- void (*unmask)(device_t, void *);
-};
-
-struct fdtbus_spi_controller_func {
- struct spi_controller * (*get_controller)(device_t);
-};
-
-struct fdtbus_gpio_controller;
-
-struct fdtbus_gpio_pin {
- struct fdtbus_gpio_controller *gp_gc;
- void *gp_priv;
-};
-
-struct fdtbus_gpio_controller_func {
- void * (*acquire)(device_t, const void *, size_t, int);
- void (*release)(device_t, void *);
- int (*read)(device_t, void *, bool);
- void (*write)(device_t, void *, int, bool);
-};
-
-struct fdtbus_pinctrl_controller;
-
-struct fdtbus_pinctrl_pin {
- struct fdtbus_pinctrl_controller *pp_pc;
- void *pp_priv;
-};
-
-struct fdtbus_pinctrl_controller_func {
- int (*set_config)(device_t, const void *, size_t);
-};
-
-struct fdtbus_iommu_func {
- bus_dma_tag_t (*map)(device_t, const u_int *, bus_dma_tag_t);
-};
-
-struct fdtbus_regulator_controller;
-
-struct fdtbus_regulator {
- struct fdtbus_regulator_controller *reg_rc;
-};
-
-struct fdtbus_regulator_controller_func {
- int (*acquire)(device_t);
- void (*release)(device_t);
- int (*enable)(device_t, bool);
- int (*set_voltage)(device_t, u_int, u_int);
- int (*get_voltage)(device_t, u_int *);
-};
struct fdtbus_clock_controller_func {
struct clk * (*decode)(device_t, int, const void *, size_t);
};
-struct fdtbus_reset_controller;
-
-struct fdtbus_reset {
- struct fdtbus_reset_controller *rst_rc;
- void *rst_priv;
-};
-
-struct fdtbus_reset_controller_func {
- void * (*acquire)(device_t, const void *, size_t);
- void (*release)(device_t, void *);
- int (*reset_assert)(device_t, void *);
- int (*reset_deassert)(device_t, void *);
-};
struct fdtbus_dai_controller_func {
audio_dai_tag_t (*get_tag)(device_t, const void *, size_t);
};
+
struct fdtbus_dma_controller;
struct fdtbus_dma {
@@ -193,13 +115,58 @@
void (*halt)(device_t, void *);
};
-struct fdtbus_power_controller;
+
+struct fdtbus_gpio_controller;
+
+struct fdtbus_gpio_pin {
+ struct fdtbus_gpio_controller *gp_gc;
+ void *gp_priv;
+};
+
+struct fdtbus_gpio_controller_func {
+ void * (*acquire)(device_t, const void *, size_t, int);
+ void (*release)(device_t, void *);
+ int (*read)(device_t, void *, bool);
+ void (*write)(device_t, void *, int, bool);
+};
+
+
+/* flags for fdtbus_intr_establish */
+#define FDT_INTR_MPSAFE __BIT(0)
-struct fdtbus_power_controller_func {
- void (*reset)(device_t);
- void (*poweroff)(device_t);
+/* Interrupt trigger types defined by the FDT "interrupts" bindings. */
+#define FDT_INTR_TYPE_POS_EDGE __BIT(0)
+#define FDT_INTR_TYPE_NEG_EDGE __BIT(1)
+#define FDT_INTR_TYPE_DOUBLE_EDGE (FDT_INTR_TYPE_POS_EDGE | \
+ FDT_INTR_TYPE_NEG_EDGE)
+#define FDT_INTR_TYPE_HIGH_LEVEL __BIT(2)
+#define FDT_INTR_TYPE_LOW_LEVEL __BIT(3)
+
+struct fdtbus_interrupt_controller_func {
+ void * (*establish)(device_t, u_int *, int, int,
+ int (*)(void *), void *, const char *);
+ void (*disestablish)(device_t, void *);
+ bool (*intrstr)(device_t, u_int *, char *, size_t);
+ void (*mask)(device_t, void *);
+ void (*unmask)(device_t, void *);
};
+
+struct fdtbus_iommu_func {
+ bus_dma_tag_t (*map)(device_t, const u_int *, bus_dma_tag_t);
+};
+
+
+struct fdtbus_mmc_pwrseq;
+
+struct fdtbus_mmc_pwrseq_func {
+ void (*pre_power_on)(device_t);
+ void (*post_power_on)(device_t);
+ void (*power_off)(device_t);
+ void (*reset)(device_t);
+};
+
+
struct fdtbus_phy_controller;
struct fdtbus_phy {
@@ -213,21 +180,70 @@
int (*enable)(device_t, void *, bool);
};
+
+struct fdtbus_pinctrl_controller;
+
+struct fdtbus_pinctrl_pin {
+ struct fdtbus_pinctrl_controller *pp_pc;
+ void *pp_priv;
+};
+
+struct fdtbus_pinctrl_controller_func {
+ int (*set_config)(device_t, const void *, size_t);
+};
+
+
+struct fdtbus_power_controller;
+
+struct fdtbus_power_controller_func {
+ void (*reset)(device_t);
+ void (*poweroff)(device_t);
+};
+
+
struct fdtbus_pwm_controller_func {
pwm_tag_t (*get_tag)(device_t, const void *, size_t);
};
-struct fdtbus_mmc_pwrseq;
+
+struct fdtbus_regulator_controller;
+
+struct fdtbus_regulator {
+ struct fdtbus_regulator_controller *reg_rc;
+};
-struct fdtbus_mmc_pwrseq_func {
- void (*pre_power_on)(device_t);
- void (*post_power_on)(device_t);
- void (*power_off)(device_t);
- void (*reset)(device_t);
+struct fdtbus_regulator_controller_func {
+ int (*acquire)(device_t);
+ void (*release)(device_t);
+ int (*enable)(device_t, bool);
+ int (*set_voltage)(device_t, u_int, u_int);
+ int (*get_voltage)(device_t, u_int *);
};
+
+struct fdtbus_reset_controller;
+
+struct fdtbus_reset {
+ struct fdtbus_reset_controller *rst_rc;
+ void *rst_priv;
+};
+
+struct fdtbus_reset_controller_func {
+ void * (*acquire)(device_t, const void *, size_t);
+ void (*release)(device_t, void *);
+ int (*reset_assert)(device_t, void *);
+ int (*reset_deassert)(device_t, void *);
+};
+
+
+struct fdtbus_spi_controller_func {
+ struct spi_controller * (*get_controller)(device_t);
+};
+
+
struct syscon;
+
struct fdt_console {
int (*match)(int);
void (*consinit)(struct fdt_attach_args *, u_int);
@@ -277,36 +293,36 @@
#define FDT_BUS_SPACE_FLAG_NONPOSTED_MMIO __BIT(0)
-int fdtbus_register_interrupt_controller(device_t, int,
- const struct fdtbus_interrupt_controller_func *);
-int fdtbus_register_i2c_controller(i2c_tag_t, int);
-int fdtbus_register_spi_controller(device_t, int,
- const struct fdtbus_spi_controller_func *);
-int fdtbus_register_gpio_controller(device_t, int,
- const struct fdtbus_gpio_controller_func *);
-int fdtbus_register_pinctrl_config(device_t, int,
- const struct fdtbus_pinctrl_controller_func *);
-int fdtbus_register_regulator_controller(device_t, int,
- const struct fdtbus_regulator_controller_func *);
int fdtbus_register_clock_controller(device_t, int,
const struct fdtbus_clock_controller_func *);
-int fdtbus_register_reset_controller(device_t, int,
- const struct fdtbus_reset_controller_func *);
int fdtbus_register_dai_controller(device_t, int,
const struct fdtbus_dai_controller_func *);
int fdtbus_register_dma_controller(device_t, int,
const struct fdtbus_dma_controller_func *);
+int fdtbus_register_gpio_controller(device_t, int,
+ const struct fdtbus_gpio_controller_func *);
+int fdtbus_register_i2c_controller(i2c_tag_t, int);
+int fdtbus_register_interrupt_controller(device_t, int,
+ const struct fdtbus_interrupt_controller_func *);
+int fdtbus_register_iommu(device_t, int,
+ const struct fdtbus_iommu_func *);
+int fdtbus_register_mmc_pwrseq(device_t, int,
+ const struct fdtbus_mmc_pwrseq_func *);
+int fdtbus_register_pinctrl_config(device_t, int,
+ const struct fdtbus_pinctrl_controller_func *);
int fdtbus_register_power_controller(device_t, int,
const struct fdtbus_power_controller_func *);
int fdtbus_register_phy_controller(device_t, int,
const struct fdtbus_phy_controller_func *);
int fdtbus_register_pwm_controller(device_t, int,
const struct fdtbus_pwm_controller_func *);
-int fdtbus_register_mmc_pwrseq(device_t, int,
- const struct fdtbus_mmc_pwrseq_func *);
+int fdtbus_register_regulator_controller(device_t, int,
+ const struct fdtbus_regulator_controller_func *);
+int fdtbus_register_reset_controller(device_t, int,
+ const struct fdtbus_reset_controller_func *);
+int fdtbus_register_spi_controller(device_t, int,
+ const struct fdtbus_spi_controller_func *);
int fdtbus_register_syscon(device_t, int, struct syscon *);
-int fdtbus_register_iommu(device_t, int,
- const struct fdtbus_iommu_func *);
void fdtbus_set_decoderegprop(bool);
Home |
Main Index |
Thread Index |
Old Index