xref: /illumos-gate/usr/src/uts/sun4u/sys/ppm_plat.h (revision 1159df0b)
15cff7825Smh /*
25cff7825Smh  * CDDL HEADER START
35cff7825Smh  *
45cff7825Smh  * The contents of this file are subject to the terms of the
55cff7825Smh  * Common Development and Distribution License (the "License").
65cff7825Smh  * You may not use this file except in compliance with the License.
75cff7825Smh  *
85cff7825Smh  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
95cff7825Smh  * or http://www.opensolaris.org/os/licensing.
105cff7825Smh  * See the License for the specific language governing permissions
115cff7825Smh  * and limitations under the License.
125cff7825Smh  *
135cff7825Smh  * When distributing Covered Code, include this CDDL HEADER in each
145cff7825Smh  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
155cff7825Smh  * If applicable, add the following below this CDDL HEADER, with the
165cff7825Smh  * fields enclosed by brackets "[]" replaced with your own identifying
175cff7825Smh  * information: Portions Copyright [yyyy] [name of copyright owner]
185cff7825Smh  *
195cff7825Smh  * CDDL HEADER END
205cff7825Smh  */
215cff7825Smh /*
22*1159df0bSmh  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
235cff7825Smh  * Use is subject to license terms.
245cff7825Smh  */
255cff7825Smh 
265cff7825Smh #ifndef _SYS_PPM_PLAT_H
275cff7825Smh #define	_SYS_PPM_PLAT_H
285cff7825Smh 
295cff7825Smh #pragma ident	"%Z%%M%	%I%	%E% SMI"
305cff7825Smh 
315cff7825Smh #include <sys/i2c/clients/i2c_gpio.h>
325cff7825Smh 
335cff7825Smh #ifdef  __cplusplus
345cff7825Smh extern "C" {
355cff7825Smh #endif
365cff7825Smh 
375cff7825Smh #define	PPM_GET_IO_DELAY(dc, delay) { \
385cff7825Smh 	if (dc->method == PPMDC_I2CKIO) \
395cff7825Smh 		delay = dc->m_un.i2c.delay; \
405cff7825Smh 	else if (dc->method == PPMDC_KIO) \
415cff7825Smh 		delay = dc->m_un.kio.delay; \
425cff7825Smh }
435cff7825Smh 
44*1159df0bSmh #define	PPM_GET_IO_POST_DELAY(dc, delay) { \
45*1159df0bSmh 	if (dc->method == PPMDC_I2CKIO) \
46*1159df0bSmh 		delay = dc->m_un.i2c.post_delay; \
47*1159df0bSmh 	else if (dc->method == PPMDC_KIO) \
48*1159df0bSmh 		delay = dc->m_un.kio.post_delay; \
49*1159df0bSmh }
50*1159df0bSmh 
515cff7825Smh #ifdef  __cplusplus
525cff7825Smh }
535cff7825Smh #endif
545cff7825Smh 
555cff7825Smh #endif /* _SYS_PPM_PLAT_H */
56