Home | History | Annotate | Line # | Download | only in i2c
ds2482owvar.h revision 1.2
      1 /*	$NetBSD: ds2482owvar.h,v 1.2 2024/11/06 15:49:36 riastradh Exp $	*/
      2 
      3 /*
      4  * Copyright (c) 2024 Brad Spencer <brad (at) anduin.eldar.org>
      5  *
      6  * Permission to use, copy, modify, and distribute this software for any
      7  * purpose with or without fee is hereby granted, provided that the above
      8  * copyright notice and this permission notice appear in all copies.
      9  *
     10  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
     11  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
     12  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
     13  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
     14  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
     15  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
     16  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
     17  */
     18 
     19 #ifndef _DEV_I2C_DS2482VAR_H_
     20 #define _DEV_I2C_DS2482VAR_H_
     21 
     22 #define DS2482_NUM_INSTANCES	8
     23 
     24 struct ds2482ow_sc;
     25 
     26 struct ds2482_instance {
     27 	int				sc_i_channel;
     28 	struct onewire_bus		sc_i_ow_bus;
     29 	device_t			sc_i_ow_dev;
     30 	struct ds2482ow_sc		*sc;
     31 };
     32 
     33 struct ds2482ow_sc {
     34 	int 		sc_ds2482debug;
     35 	device_t 	sc_dev;
     36 	i2c_tag_t 	sc_tag;
     37 	i2c_addr_t 	sc_addr;
     38 	kmutex_t 	sc_mutex;
     39 	struct sysctllog *sc_ds2482log;
     40 	bool		sc_activepullup;
     41 	bool		sc_strongpullup;
     42 	bool		sc_is_800;
     43 	struct		ds2482_instance	sc_instances[DS2482_NUM_INSTANCES];
     44 };
     45 
     46 #endif	/* _DEV_I2C_DS2482VAR_H_ */
     47