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