-/* $OpenBSD: w83l784r.c,v 1.13 2022/04/06 18:59:28 naddy Exp $ */
+/* $OpenBSD: w83l784r.c,v 1.14 2022/04/08 15:02:28 naddy Exp $ */
/*
* Copyright (c) 2006 Mark Kettenis
struct ksensor sc_sensors[WBENV_MAX_SENSORS];
struct ksensordev sc_sensordev;
- struct wbenv_sensor *sc_wbenv_sensors;
+ const struct wbenv_sensor *sc_wbenv_sensors;
int sc_numsensors;
};
int wbenv_match(struct device *, void *, void *);
void wbenv_attach(struct device *, struct device *, void *);
-void wbenv_setup_sensors(struct wbenv_softc *, struct wbenv_sensor *);
+void wbenv_setup_sensors(struct wbenv_softc *, const struct wbenv_sensor *);
void wbenv_refresh(void *);
void w83l784r_refresh_volt(struct wbenv_softc *, int);
NULL, "wbenv", DV_DULL
};
-struct wbenv_sensor w83l784r_sensors[] =
+const struct wbenv_sensor w83l784r_sensors[] =
{
{ "VCore", SENSOR_VOLTS_DC, W83L784R_VCORE, w83l784r_refresh_volt, RFACT_NONE },
{ "VBAT", SENSOR_VOLTS_DC, W83L784R_VBAT, w83l784r_refresh_volt, RFACT(232, 99) },
{ NULL }
};
-struct wbenv_sensor w83l785r_sensors[] =
+const struct wbenv_sensor w83l785r_sensors[] =
{
{ "VCore", SENSOR_VOLTS_DC, W83L784R_VCORE, w83l785r_refresh_volt, RFACT_NONE },
{ "+2.5V", SENSOR_VOLTS_DC, W83L785R_2_5V, w83l785r_refresh_volt, RFACT(100, 100) },
{ NULL }
};
-struct wbenv_sensor w83l785ts_l_sensors[] =
+const struct wbenv_sensor w83l785ts_l_sensors[] =
{
{ "", SENSOR_TEMP, W83L784R_TEMP1, wbenv_refresh_temp },
}
void
-wbenv_setup_sensors(struct wbenv_softc *sc, struct wbenv_sensor *sensors)
+wbenv_setup_sensors(struct wbenv_softc *sc, const struct wbenv_sensor *sensors)
{
int i;
-/* $OpenBSD: lm78.c,v 1.25 2019/12/17 01:34:59 mortimer Exp $ */
+/* $OpenBSD: lm78.c,v 1.26 2022/04/08 15:02:28 naddy Exp $ */
/*
* Copyright (c) 2005, 2006 Mark Kettenis
int wb_match(struct lm_softc *);
int def_match(struct lm_softc *);
-void lm_setup_sensors(struct lm_softc *, struct lm_sensor *);
+void lm_setup_sensors(struct lm_softc *, const struct lm_sensor *);
void lm_refresh(void *);
void lm_refresh_sensor_data(struct lm_softc *);
int (*chip_match)(struct lm_softc *);
};
-struct lm_chip lm_chips[] = {
+const struct lm_chip lm_chips[] = {
{ wb_match },
{ lm_match },
{ def_match } /* Must be last */
};
-struct lm_sensor lm78_sensors[] = {
+const struct lm_sensor lm78_sensors[] = {
/* Voltage */
{ "VCore A", SENSOR_VOLTS_DC, 0, 0x20, lm_refresh_volt, RFACT_NONE },
{ "VCore B", SENSOR_VOLTS_DC, 0, 0x21, lm_refresh_volt, RFACT_NONE },
{ NULL }
};
-struct lm_sensor w83627hf_sensors[] = {
+const struct lm_sensor w83627hf_sensors[] = {
/* Voltage */
{ "VCore A", SENSOR_VOLTS_DC, 0, 0x20, lm_refresh_volt, RFACT_NONE },
{ "VCore B", SENSOR_VOLTS_DC, 0, 0x21, lm_refresh_volt, RFACT_NONE },
* need special treatment, also because the reference voltage is 2.048 V
* instead of the traditional 3.6 V.
*/
-struct lm_sensor w83627ehf_sensors[] = {
+const struct lm_sensor w83627ehf_sensors[] = {
/* Voltage */
{ "VCore", SENSOR_VOLTS_DC, 0, 0x20, lm_refresh_volt, RFACT_NONE / 2},
{ "+12V", SENSOR_VOLTS_DC, 0, 0x21, lm_refresh_volt, RFACT(56, 10) / 2 },
* w83627dhg is almost identical to w83627ehf, except that
* it has 9 instead of 10 voltage sensors
*/
-struct lm_sensor w83627dhg_sensors[] = {
+const struct lm_sensor w83627dhg_sensors[] = {
/* Voltage */
{ "VCore", SENSOR_VOLTS_DC, 0, 0x20, lm_refresh_volt, RFACT_NONE / 2},
{ "+12V", SENSOR_VOLTS_DC, 0, 0x21, lm_refresh_volt, RFACT(56, 10) / 2 },
{ NULL }
};
-struct lm_sensor nct6776f_sensors[] = {
+const struct lm_sensor nct6776f_sensors[] = {
/* Voltage */
{ "VCore", SENSOR_VOLTS_DC, 0, 0x20, lm_refresh_volt, RFACT_NONE / 2},
{ "+12V", SENSOR_VOLTS_DC, 0, 0x21, lm_refresh_volt, RFACT(56, 10) / 2 },
};
/* NCT6779D */
-struct lm_sensor nct6779d_sensors[] = {
+const struct lm_sensor nct6779d_sensors[] = {
/* Voltage */
{ "VCore", SENSOR_VOLTS_DC, 4, 0x80, lm_refresh_volt, RFACT_NONE },
{ "VIN1", SENSOR_VOLTS_DC, 4, 0x81, lm_refresh_volt, RFACT(56, 10) / 2 },
{ NULL }
};
-struct lm_sensor w83637hf_sensors[] = {
+const struct lm_sensor w83637hf_sensors[] = {
/* Voltage */
{ "VCore", SENSOR_VOLTS_DC, 0, 0x20, wb_w83637hf_refresh_vcore },
{ "+12V", SENSOR_VOLTS_DC, 0, 0x21, lm_refresh_volt, RFACT(28, 10) },
{ NULL }
};
-struct lm_sensor w83697hf_sensors[] = {
+const struct lm_sensor w83697hf_sensors[] = {
/* Voltage */
{ "VCore", SENSOR_VOLTS_DC, 0, 0x20, lm_refresh_volt, RFACT_NONE },
{ "+3.3V", SENSOR_VOLTS_DC, 0, 0x22, lm_refresh_volt, RFACT_NONE },
* +5V, but using the values from the W83782D datasheets seems to
* provide sensible results.
*/
-struct lm_sensor w83781d_sensors[] = {
+const struct lm_sensor w83781d_sensors[] = {
/* Voltage */
{ "VCore A", SENSOR_VOLTS_DC, 0, 0x20, lm_refresh_volt, RFACT_NONE },
{ "VCore B", SENSOR_VOLTS_DC, 0, 0x21, lm_refresh_volt, RFACT_NONE },
{ NULL }
};
-struct lm_sensor w83782d_sensors[] = {
+const struct lm_sensor w83782d_sensors[] = {
/* Voltage */
{ "VCore", SENSOR_VOLTS_DC, 0, 0x20, lm_refresh_volt, RFACT_NONE },
{ "VINR0", SENSOR_VOLTS_DC, 0, 0x21, lm_refresh_volt, RFACT_NONE },
{ NULL }
};
-struct lm_sensor w83783s_sensors[] = {
+const struct lm_sensor w83783s_sensors[] = {
/* Voltage */
{ "VCore", SENSOR_VOLTS_DC, 0, 0x20, lm_refresh_volt, RFACT_NONE },
{ "+3.3V", SENSOR_VOLTS_DC, 0, 0x22, lm_refresh_volt, RFACT_NONE },
{ NULL }
};
-struct lm_sensor w83791d_sensors[] = {
+const struct lm_sensor w83791d_sensors[] = {
/* Voltage */
{ "VCore", SENSOR_VOLTS_DC, 0, 0x20, lm_refresh_volt, 10000 },
{ "VINR0", SENSOR_VOLTS_DC, 0, 0x21, lm_refresh_volt, 10000 },
{ NULL }
};
-struct lm_sensor w83792d_sensors[] = {
+const struct lm_sensor w83792d_sensors[] = {
/* Voltage */
{ "VCore A", SENSOR_VOLTS_DC, 0, 0x20, lm_refresh_volt, RFACT_NONE },
{ "VCore B", SENSOR_VOLTS_DC, 0, 0x21, lm_refresh_volt, RFACT_NONE },
{ NULL }
};
-struct lm_sensor as99127f_sensors[] = {
+const struct lm_sensor as99127f_sensors[] = {
/* Voltage */
{ "VCore A", SENSOR_VOLTS_DC, 0, 0x20, lm_refresh_volt, RFACT_NONE },
{ "VCore B", SENSOR_VOLTS_DC, 0, 0x21, lm_refresh_volt, RFACT_NONE },
}
void
-lm_setup_sensors(struct lm_softc *sc, struct lm_sensor *sensors)
+lm_setup_sensors(struct lm_softc *sc, const struct lm_sensor *sensors)
{
int i;
-/* $OpenBSD: lm78var.h,v 1.19 2019/12/17 01:34:59 mortimer Exp $ */
+/* $OpenBSD: lm78var.h,v 1.20 2022/04/08 15:02:28 naddy Exp $ */
/*
* Copyright (c) 2005, 2006 Mark Kettenis
struct ksensor sensors[WB_MAX_SENSORS];
struct ksensordev sensordev;
struct sensor_task *sensortask;
- struct lm_sensor *lm_sensors;
+ const struct lm_sensor *lm_sensors;
u_int numsensors;
void (*refresh_sensor_data) (struct lm_softc *);
-/* $OpenBSD: fins.c,v 1.5 2022/04/06 18:59:28 naddy Exp $ */
+/* $OpenBSD: fins.c,v 1.6 2022/04/08 15:02:28 naddy Exp $ */
/*
* Copyright (c) 2005, 2006 Mark Kettenis
struct ksensor fins_ksensors[FINS_MAX_SENSORS];
struct ksensordev fins_sensordev;
struct sensor_task *fins_sensortask;
- struct fins_sensor *fins_sensors;
+ const struct fins_sensor *fins_sensors;
bus_space_handle_t sc_ioh_sens;
bus_space_handle_t sc_ioh_wdog;
static __inline u_int8_t fins_read_wdog(struct fins_softc *, int);
static __inline void fins_write_wdog(struct fins_softc *, int, u_int8_t);
-void fins_setup_sensors(struct fins_softc *, struct fins_sensor *);
+void fins_setup_sensors(struct fins_softc *, const struct fins_sensor *);
void fins_refresh(void *);
void fins_get_rpm(struct fins_softc *, int);
NULL, "fins", DV_DULL
};
-struct fins_sensor fins_71805_sensors[] = {
+const struct fins_sensor fins_71805_sensors[] = {
{ "+3.3V", fins_get_volt, SENSOR_VOLTS_DC, FRFACT(100, 100), 0x10 },
{ "Vtt", fins_get_volt, SENSOR_VOLTS_DC, FRFACT_NONE, 0x11 },
{ "Vram", fins_get_volt, SENSOR_VOLTS_DC, FRFACT(100, 100), 0x12 },
{ NULL }
};
-struct fins_sensor fins_71882_sensors[] = {
+const struct fins_sensor fins_71882_sensors[] = {
{ "+3.3V", fins_get_volt, SENSOR_VOLTS_DC, FRFACT(100, 100), 0x20 },
{ "Vcore", fins_get_volt, SENSOR_VOLTS_DC, FRFACT_NONE, 0x21 },
{ "Vram", fins_get_volt, SENSOR_VOLTS_DC, FRFACT(100, 100), 0x22 },
}
void
-fins_setup_sensors(struct fins_softc *sc, struct fins_sensor *sensors)
+fins_setup_sensors(struct fins_softc *sc, const struct fins_sensor *sensors)
{
int i;
fins_get_volt(struct fins_softc *sc, int n)
{
struct ksensor *sensor = &sc->fins_ksensors[n];
- struct fins_sensor *fs = &sc->fins_sensors[n];
+ const struct fins_sensor *fs = &sc->fins_sensors[n];
int data;
data = fins_read_sens(sc, fs->fs_reg);
fins_get_temp(struct fins_softc *sc, int n)
{
struct ksensor *sensor = &sc->fins_ksensors[n];
- struct fins_sensor *fs = &sc->fins_sensors[n];
+ const struct fins_sensor *fs = &sc->fins_sensors[n];
u_int data;
u_int max;
fins_refresh_offset(struct fins_softc *sc, int n)
{
struct ksensor *sensor = &sc->fins_ksensors[n];
- struct fins_sensor *fs = &sc->fins_sensors[n];
+ const struct fins_sensor *fs = &sc->fins_sensors[n];
u_int data;
sensor->flags &= ~SENSOR_FINVALID;
fins_get_rpm(struct fins_softc *sc, int n)
{
struct ksensor *sensor = &sc->fins_ksensors[n];
- struct fins_sensor *fs = &sc->fins_sensors[n];
+ const struct fins_sensor *fs = &sc->fins_sensors[n];
int data;
data = fins_read_sens_2(sc, fs->fs_reg);
-/* $OpenBSD: uguru.c,v 1.6 2022/04/06 18:59:29 naddy Exp $ */
+/* $OpenBSD: uguru.c,v 1.7 2022/04/08 15:02:28 naddy Exp $ */
/*
* Copyright (c) 2010 Mikko Tolmunen <oskari@sefirosu.org>
struct ksensor sc_sensors[UGURU_MAX_SENSORS];
struct ksensordev sc_sensordev;
int sc_numsensors;
- struct uguru_sensor *uguru_sensors;
+ const struct uguru_sensor *uguru_sensors;
struct {
uint8_t reading;
/* uint8_t flags; */
#define UGURU_R_VOLT uguru_refresh_volt
#define UGURU_R_FAN uguru_refresh_fan
-struct uguru_sensor abitkv_sensors[] = {
+const struct uguru_sensor abitkv_sensors[] = {
{ "CPU", SENSOR_TEMP, UGURU_R_TEMP, 0x00 },
{ "SYS", SENSOR_TEMP, UGURU_R_TEMP, 0x01 },
{ "PWM", SENSOR_TEMP, UGURU_R_TEMP, 0x0f },
{ NULL }
};
-struct uguru_sensor abitaa_sensors[] = {
+const struct uguru_sensor abitaa_sensors[] = {
{ "CPU", SENSOR_TEMP, UGURU_R_TEMP, 0x00 },
{ "SYS", SENSOR_TEMP, UGURU_R_TEMP, 0x01 },
{ "PWM1", SENSOR_TEMP, UGURU_R_TEMP, 0x0f },
{ NULL }
};
-struct uguru_sensor abitav_sensors[] = {
+const struct uguru_sensor abitav_sensors[] = {
{ "CPU", SENSOR_TEMP, UGURU_R_TEMP, 0x00 },
{ "SYS", SENSOR_TEMP, UGURU_R_TEMP, 0x01 },
{ "PWM", SENSOR_TEMP, UGURU_R_TEMP, 0x0f },
{ NULL }
};
-struct uguru_sensor abitas_sensors[] = {
+const struct uguru_sensor abitas_sensors[] = {
{ "CPU", SENSOR_TEMP, UGURU_R_TEMP, 0x00 },
{ "SYS", SENSOR_TEMP, UGURU_R_TEMP, 0x01 },
{ "PWM", SENSOR_TEMP, UGURU_R_TEMP, 0x0f },
{ NULL }
};
-struct uguru_sensor abitax_sensors[] = {
+const struct uguru_sensor abitax_sensors[] = {
{ "CPU", SENSOR_TEMP, UGURU_R_TEMP, 0x00 },
{ "SYS", SENSOR_TEMP, UGURU_R_TEMP, 0x01 },
{ "PWM", SENSOR_TEMP, UGURU_R_TEMP, 0x0f },
{ NULL }
};
-struct uguru_sensor abitm4_sensors[] = {
+const struct uguru_sensor abitm4_sensors[] = {
{ "CPU", SENSOR_TEMP, UGURU_R_TEMP, 0x00 },
{ "SYS", SENSOR_TEMP, UGURU_R_TEMP, 0x01 },
{ "PWM1", SENSOR_TEMP, UGURU_R_TEMP, 0x02 },
{ NULL }
};
-struct uguru_sensor abitan_sensors[] = {
+const struct uguru_sensor abitan_sensors[] = {
{ "CPU", SENSOR_TEMP, UGURU_R_TEMP, 0x00 },
{ "SYS", SENSOR_TEMP, UGURU_R_TEMP, 0x01 },
{ "PWM", SENSOR_TEMP, UGURU_R_TEMP, 0x0f },
{ NULL }
};
-struct uguru_sensor abital_sensors[] = {
+const struct uguru_sensor abital_sensors[] = {
{ "CPU", SENSOR_TEMP, UGURU_R_TEMP, 0x18 },
{ "SYS", SENSOR_TEMP, UGURU_R_TEMP, 0x19 },
{ "PWM", SENSOR_TEMP, UGURU_R_TEMP, 0x1a },
{ NULL }
};
-struct uguru_sensor abitaw_sensors[] = {
+const struct uguru_sensor abitaw_sensors[] = {
{ "CPU", SENSOR_TEMP, UGURU_R_TEMP, 0x18 },
{ "SYS", SENSOR_TEMP, UGURU_R_TEMP, 0x19 },
{ "PWM1", SENSOR_TEMP, UGURU_R_TEMP, 0x1a },
{ NULL }
};
-struct uguru_sensor abitni_sensors[] = {
+const struct uguru_sensor abitni_sensors[] = {
{ "CPU", SENSOR_TEMP, UGURU_R_TEMP, 0x18 },
{ "SYS", SENSOR_TEMP, UGURU_R_TEMP, 0x19 },
{ "PWM", SENSOR_TEMP, UGURU_R_TEMP, 0x1a },
{ NULL }
};
-struct uguru_sensor abitat_sensors[] = {
+const struct uguru_sensor abitat_sensors[] = {
{ "CPU", SENSOR_TEMP, UGURU_R_TEMP, 0x18 },
{ "NB", SENSOR_TEMP, UGURU_R_TEMP, 0x19 },
{ "SYS", SENSOR_TEMP, UGURU_R_TEMP, 0x1a },
{ NULL }
};
-struct uguru_sensor abitan2_sensors[] = {
+const struct uguru_sensor abitan2_sensors[] = {
{ "CPU", SENSOR_TEMP, UGURU_R_TEMP, 0x18 },
{ "SYS", SENSOR_TEMP, UGURU_R_TEMP, 0x19 },
{ "PWM", SENSOR_TEMP, UGURU_R_TEMP, 0x1a },
{ NULL }
};
-struct uguru_sensor abitab_sensors[] = {
+const struct uguru_sensor abitab_sensors[] = {
{ "CPU", SENSOR_TEMP, UGURU_R_TEMP, 0x18 },
{ "SYS", SENSOR_TEMP, UGURU_R_TEMP, 0x19 },
{ "PWM", SENSOR_TEMP, UGURU_R_TEMP, 0x1a },
{ NULL }
};
-struct uguru_sensor abitan3_sensors[] = {
+const struct uguru_sensor abitan3_sensors[] = {
{ "CPU", SENSOR_TEMP, UGURU_R_TEMP, 0x18 },
{ "SYS", SENSOR_TEMP, UGURU_R_TEMP, 0x19 },
{ "PWM", SENSOR_TEMP, UGURU_R_TEMP, 0x1a },
{ NULL }
};
-struct uguru_sensor abitaw2_sensors[] = {
+const struct uguru_sensor abitaw2_sensors[] = {
{ "CPU", SENSOR_TEMP, UGURU_R_TEMP, 0x18 },
{ "SYS", SENSOR_TEMP, UGURU_R_TEMP, 0x19 },
{ "PWM1", SENSOR_TEMP, UGURU_R_TEMP, 0x1a },
{ NULL }
};
-struct uguru_sensor abitat2_sensors[] = {
+const struct uguru_sensor abitat2_sensors[] = {
{ "CPU", SENSOR_TEMP, UGURU_R_TEMP, 0x18 },
{ "SYS", SENSOR_TEMP, UGURU_R_TEMP, 0x1a },
{ "PWM", SENSOR_TEMP, UGURU_R_TEMP, 0x1b },
{ NULL }
};
-struct uguru_sensor abitab2_sensors[] = {
+const struct uguru_sensor abitab2_sensors[] = {
{ "CPU", SENSOR_TEMP, UGURU_R_TEMP, 0x18 },
{ "SYS", SENSOR_TEMP, UGURU_R_TEMP, 0x19 },
{ "PWM1", SENSOR_TEMP, UGURU_R_TEMP, 0x1a },
{ NULL }
};
-struct uguru_sensor abitin_sensors[] = {
+const struct uguru_sensor abitin_sensors[] = {
{ "CPU", SENSOR_TEMP, UGURU_R_TEMP, 0x18 },
{ "SYS", SENSOR_TEMP, UGURU_R_TEMP, 0x19 },
{ "PWM1", SENSOR_TEMP, UGURU_R_TEMP, 0x1a },
{
struct uguru_softc *sc = (void *)self;
struct isa_attach_args *ia = aux;
- struct uguru_sensor *sensors;
+ const struct uguru_sensor *sensors;
uint8_t data[9];
uint16_t vendid, devid, sysid;
int i;