xref: /netbsd-src/sys/arch/arm/imx/imxpwmvar.h (revision 2bd1432c88573054d9e5d00b69e495cb3aaef816)
1 /*	$NetBSD: imxpwmvar.h,v 1.2 2020/05/20 05:10:42 hkenken Exp $	*/
2 
3 /*
4  * Copyright (c) 2014  Genetec Corporation.  All rights reserved.
5  * Written by Hashimoto Kenichi for Genetec Corporation.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  * 1. Redistributions of source code must retain the above copyright
11  *    notice, this list of conditions and the following disclaimer.
12  * 2. Redistributions in binary form must reproduce the above copyright
13  *    notice, this list of conditions and the following disclaimer in the
14  *    documentation and/or other materials provided with the distribution.
15  *
16  * THIS SOFTWARE IS PROVIDED BY GENETEC CORPORATION ``AS IS'' AND
17  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
18  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL GENETEC CORPORATION
20  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26  * POSSIBILITY OF SUCH DAMAGE.
27  */
28 
29 #ifndef	_ARM_IMX_IMXPWMVAR_H_
30 #define	_ARM_IMX_IMXPWMVAR_H_
31 
32 #include <dev/pwm/pwmvar.h>
33 
34 struct imxpwm_softc {
35 	device_t sc_dev;
36 	bus_space_tag_t sc_iot;
37 	bus_space_handle_t sc_ioh;
38 	int sc_intr;
39 	void *sc_ih;
40 
41 	struct clk *sc_clk;
42 	u_int sc_freq;
43 
44 	struct pwm_controller sc_pwm;
45 	struct pwm_config sc_conf;
46 
47 	int (*sc_handler)(void *);
48 	void *sc_cookie;
49 };
50 
51 int imxpwm_match(device_t, cfdata_t, void *);
52 void imxpwm_attach(struct imxpwm_softc *, void *);
53 void imxpwm_attach_common(struct imxpwm_softc *);
54 
55 int imxpwm_intr(void *);
56 
57 #endif	/* _ARM_IMX_IMXPWMVAR_H_ */
58