Deleted Added
full compact
pcf_ebus.c (146966) pcf_ebus.c (155921)
1/*-
2 * Copyright (c) 2004 Marius Strobl, Joerg Wunsch
3 *
4 * derived from sys/i386/isa/pcf.c which is:
5 *
6 * Copyright (c) 1998 Nicolas Souchu, Marc Bouget
7 * All rights reserved.
8 *

--- 14 unchanged lines hidden (view full) ---

23 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28 * SUCH DAMAGE.
29 */
30#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2004 Marius Strobl, Joerg Wunsch
3 *
4 * derived from sys/i386/isa/pcf.c which is:
5 *
6 * Copyright (c) 1998 Nicolas Souchu, Marc Bouget
7 * All rights reserved.
8 *

--- 14 unchanged lines hidden (view full) ---

23 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28 * SUCH DAMAGE.
29 */
30#include <sys/cdefs.h>
31__FBSDID("$FreeBSD: head/sys/dev/pcf/pcf_ebus.c 146966 2005-06-04 20:29:28Z marius $");
31__FBSDID("$FreeBSD: head/sys/dev/pcf/pcf_ebus.c 155921 2006-02-22 18:16:26Z jhb $");
32
33/*
34 * Device specific driver for the EBus i2c devices found on some sun4u
35 * systems. On systems not having a boot-bus controller the i2c devices
36 * are PCF8584.
37 *
38 * Known onboard slave devices on the primary bus are:
39 *

--- 148 unchanged lines hidden (view full) ---

188 if (bootverbose)
189 device_printf(dev, "PCF8584 address: 0x%08llx\n", (unsigned
190 long long)own_addr);
191
192 /* reset the chip */
193 pcf_rst_card(dev, IIC_FASTEST, own_addr, NULL);
194
195 if (sc->res_irq) {
32
33/*
34 * Device specific driver for the EBus i2c devices found on some sun4u
35 * systems. On systems not having a boot-bus controller the i2c devices
36 * are PCF8584.
37 *
38 * Known onboard slave devices on the primary bus are:
39 *

--- 148 unchanged lines hidden (view full) ---

188 if (bootverbose)
189 device_printf(dev, "PCF8584 address: 0x%08llx\n", (unsigned
190 long long)own_addr);
191
192 /* reset the chip */
193 pcf_rst_card(dev, IIC_FASTEST, own_addr, NULL);
194
195 if (sc->res_irq) {
196 rv = BUS_SETUP_INTR(device_get_parent(dev), dev, sc->res_irq,
196 rv = bus_setup_intr(dev, sc->res_irq,
197 INTR_TYPE_NET /* | INTR_ENTROPY */, pcf_intr, sc,
198 &sc->intr_cookie);
199 if (rv) {
200 device_printf(dev, "could not setup IRQ\n");
201 goto error;
202 }
203 }
204

--- 31 unchanged lines hidden (view full) ---

236
237 if ((rv = bus_generic_detach(dev)) != 0)
238 return (rv);
239
240 if ((rv = device_delete_child(dev, sc->iicbus)) != 0)
241 return (rv);
242
243 if (sc->res_irq != 0) {
197 INTR_TYPE_NET /* | INTR_ENTROPY */, pcf_intr, sc,
198 &sc->intr_cookie);
199 if (rv) {
200 device_printf(dev, "could not setup IRQ\n");
201 goto error;
202 }
203 }
204

--- 31 unchanged lines hidden (view full) ---

236
237 if ((rv = bus_generic_detach(dev)) != 0)
238 return (rv);
239
240 if ((rv = device_delete_child(dev, sc->iicbus)) != 0)
241 return (rv);
242
243 if (sc->res_irq != 0) {
244 BUS_TEARDOWN_INTR(device_get_parent(dev), dev, sc->res_irq,
244 bus_teardown_intr(dev, sc->res_irq,
245 sc->intr_cookie);
246 bus_deactivate_resource(dev, SYS_RES_IRQ, sc->rid_irq,
247 sc->res_irq);
248 bus_release_resource(dev, SYS_RES_IRQ, sc->rid_irq,
249 sc->res_irq);
250 }
251
252 bus_deactivate_resource(dev, SYS_RES_MEMORY, sc->rid_ioport,
253 sc->res_ioport);
254 bus_release_resource(dev, SYS_RES_MEMORY, sc->rid_ioport,
255 sc->res_ioport);
256
257 return (0);
258}
259
260DRIVER_MODULE(pcf_ebus, ebus, pcf_ebus_driver, pcf_ebus_devclass, 0, 0);
261MODULE_DEPEND(pcf_ebus, iicbus, PCF_MINVER, PCF_PREFVER, PCF_MAXVER);
262MODULE_VERSION(pcf_ebus, PCF_MODVER);
245 sc->intr_cookie);
246 bus_deactivate_resource(dev, SYS_RES_IRQ, sc->rid_irq,
247 sc->res_irq);
248 bus_release_resource(dev, SYS_RES_IRQ, sc->rid_irq,
249 sc->res_irq);
250 }
251
252 bus_deactivate_resource(dev, SYS_RES_MEMORY, sc->rid_ioport,
253 sc->res_ioport);
254 bus_release_resource(dev, SYS_RES_MEMORY, sc->rid_ioport,
255 sc->res_ioport);
256
257 return (0);
258}
259
260DRIVER_MODULE(pcf_ebus, ebus, pcf_ebus_driver, pcf_ebus_devclass, 0, 0);
261MODULE_DEPEND(pcf_ebus, iicbus, PCF_MINVER, PCF_PREFVER, PCF_MAXVER);
262MODULE_VERSION(pcf_ebus, PCF_MODVER);