2 # Copyright 2016 Michal Meloun <mmel@FreeBSD.org>
5 # Redistribution and use in source and binary forms, with or without
6 # modification, are permitted provided that the following conditions
8 # 1. Redistributions of source code must retain the above copyright
9 # notice, this list of conditions and the following disclaimer.
10 # 2. Redistributions in binary form must reproduce the above copyright
11 # notice, this list of conditions and the following disclaimer in the
12 # documentation and/or other materials provided with the distribution.
14 # THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15 # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 # ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18 # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29 #include <machine/bus.h>
34 #include <sys/systm.h>
37 clkdev_default_write_4(device_t dev, bus_addr_t addr, uint32_t val)
41 pdev = device_get_parent(dev);
45 return (CLKDEV_WRITE_4(pdev, addr, val));
49 clkdev_default_read_4(device_t dev, bus_addr_t addr, uint32_t *val)
53 pdev = device_get_parent(dev);
57 return (CLKDEV_READ_4(pdev, addr, val));
61 clkdev_default_modify_4(device_t dev, bus_addr_t addr,
62 uint32_t clear_mask, uint32_t set_mask)
66 pdev = device_get_parent(dev);
70 return (CLKDEV_MODIFY_4(pdev, addr, clear_mask, set_mask));
74 clkdev_default_device_lock(device_t dev)
78 pdev = device_get_parent(dev);
80 panic("clkdev_device_lock not implemented");
82 CLKDEV_DEVICE_LOCK(pdev);
86 clkdev_default_device_unlock(device_t dev)
90 pdev = device_get_parent(dev);
92 panic("clkdev_device_unlock not implemented");
94 CLKDEV_DEVICE_UNLOCK(pdev);
99 # Write single register
105 } DEFAULT clkdev_default_write_4;
108 # Read single register
114 } DEFAULT clkdev_default_read_4;
117 # Modify single register
119 METHOD int modify_4 {
124 } DEFAULT clkdev_default_modify_4;
127 # Get exclusive access to underlying device
129 METHOD void device_lock {
131 } DEFAULT clkdev_default_device_lock;
134 # Release exclusive access to underlying device
136 METHOD void device_unlock {
138 } DEFAULT clkdev_default_device_unlock;