Home | History | Annotate | Line # | Download | only in iccsense
      1 /*	$NetBSD: priv.h,v 1.2 2021/12/18 23:45:40 riastradh Exp $	*/
      2 
      3 /* SPDX-License-Identifier: MIT */
      4 #ifndef __NVKM_ICCSENSE_PRIV_H__
      5 #define __NVKM_ICCSENSE_PRIV_H__
      6 #define nvkm_iccsense(p) container_of((p), struct nvkm_iccsense, subdev)
      7 #include <subdev/iccsense.h>
      8 #include <subdev/bios/extdev.h>
      9 
     10 struct nvkm_iccsense_sensor {
     11 	struct list_head head;
     12 	int id;
     13 	enum nvbios_extdev_type type;
     14 	struct i2c_adapter *i2c;
     15 	u8 addr;
     16 	u16 config;
     17 };
     18 
     19 struct nvkm_iccsense_rail {
     20 	struct list_head head;
     21 	int (*read)(struct nvkm_iccsense *, struct nvkm_iccsense_rail *);
     22 	struct nvkm_iccsense_sensor *sensor;
     23 	u8 idx;
     24 	u8 mohm;
     25 };
     26 
     27 void nvkm_iccsense_ctor(struct nvkm_device *, int, struct nvkm_iccsense *);
     28 int nvkm_iccsense_new_(struct nvkm_device *, int, struct nvkm_iccsense **);
     29 #endif
     30