1 /*	$NetBSD: i2c.h,v 1.3 2021/12/18 23:45:33 riastradh Exp $	*/
2 
3 /* SPDX-License-Identifier: MIT */
4 #ifndef __NVBIOS_I2C_H__
5 #define __NVBIOS_I2C_H__
6 enum dcb_i2c_type {
7 	/* matches bios type field prior to ccb 4.1 */
8 	DCB_I2C_NV04_BIT = 0x00,
9 	DCB_I2C_NV4E_BIT = 0x04,
10 	DCB_I2C_NVIO_BIT = 0x05,
11 	DCB_I2C_NVIO_AUX = 0x06,
12 	/* made up - mostly */
13 	DCB_I2C_PMGR     = 0x80,
14 	DCB_I2C_UNUSED   = 0xff
15 };
16 
17 struct dcb_i2c_entry {
18 	enum dcb_i2c_type type;
19 	u8 drive;
20 	u8 sense;
21 	u8 share;
22 	u8 auxch;
23 };
24 
25 u16 dcb_i2c_table(struct nvkm_bios *, u8 *ver, u8 *hdr, u8 *cnt, u8 *len);
26 u16 dcb_i2c_entry(struct nvkm_bios *, u8 index, u8 *ver, u8 *len);
27 int dcb_i2c_parse(struct nvkm_bios *, u8 index, struct dcb_i2c_entry *);
28 #endif
29