xref: /linux/drivers/gpu/drm/nouveau/nvkm/subdev/iccsense/priv.h (revision d0034a7a4ac7fae708146ac0059b9c47a1543f0d)
1b7019ac5SIlia Mirkin /* SPDX-License-Identifier: MIT */
2dc06e366SMartin Peres #ifndef __NVKM_ICCSENSE_PRIV_H__
3dc06e366SMartin Peres #define __NVKM_ICCSENSE_PRIV_H__
4dc06e366SMartin Peres #define nvkm_iccsense(p) container_of((p), struct nvkm_iccsense, subdev)
5dc06e366SMartin Peres #include <subdev/iccsense.h>
65f1f07deSKarol Herbst #include <subdev/bios/extdev.h>
75f1f07deSKarol Herbst 
85f1f07deSKarol Herbst struct nvkm_iccsense_sensor {
95f1f07deSKarol Herbst 	struct list_head head;
105f1f07deSKarol Herbst 	int id;
115f1f07deSKarol Herbst 	enum nvbios_extdev_type type;
125f1f07deSKarol Herbst 	struct i2c_adapter *i2c;
135f1f07deSKarol Herbst 	u8 addr;
14a8c119a4SKarol Herbst 	u16 config;
155f1f07deSKarol Herbst };
16dc06e366SMartin Peres 
17b71c0892SKarol Herbst struct nvkm_iccsense_rail {
1892224e75SKarol Herbst 	struct list_head head;
19b71c0892SKarol Herbst 	int (*read)(struct nvkm_iccsense *, struct nvkm_iccsense_rail *);
205f1f07deSKarol Herbst 	struct nvkm_iccsense_sensor *sensor;
215f1f07deSKarol Herbst 	u8 idx;
22b71c0892SKarol Herbst 	u8 mohm;
23b71c0892SKarol Herbst };
24b71c0892SKarol Herbst 
25*4dea1a96SBen Skeggs void nvkm_iccsense_ctor(struct nvkm_device *, enum nvkm_subdev_type, int, struct nvkm_iccsense *);
26*4dea1a96SBen Skeggs int nvkm_iccsense_new_(struct nvkm_device *, enum nvkm_subdev_type, int, struct nvkm_iccsense **);
27dc06e366SMartin Peres #endif
28