Deleted Added
full compact
cs4231.c (170873) cs4231.c (172568)
1/*-
2 * Copyright (c) 1999 Jason L. Wright (jason@thought.net)
3 * Copyright (c) 2004 Pyun YongHyeon
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

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

32 */
33
34/*
35 * Driver for CS4231 based audio found in some sun4m systems (cs4231)
36 * based on ideas from the S/Linux project and the NetBSD project.
37 */
38
39#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 1999 Jason L. Wright (jason@thought.net)
3 * Copyright (c) 2004 Pyun YongHyeon
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

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

32 */
33
34/*
35 * Driver for CS4231 based audio found in some sun4m systems (cs4231)
36 * based on ideas from the S/Linux project and the NetBSD project.
37 */
38
39#include <sys/cdefs.h>
40__FBSDID("$FreeBSD: head/sys/dev/sound/sbus/cs4231.c 170873 2007-06-17 06:10:43Z ariff $");
40__FBSDID("$FreeBSD: head/sys/dev/sound/sbus/cs4231.c 172568 2007-10-12 06:03:46Z kevlo $");
41
42#include <sys/param.h>
43#include <sys/systm.h>
44#include <sys/bus.h>
45#include <sys/kernel.h>
46#include <sys/resource.h>
47
48#include <dev/ofw/ofw_bus.h>

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

617 i && CS_READ(sc, CS4231_IADDR) == CS_IN_INIT; i--)
618 DELAY(10);
619 if (i == 0)
620 device_printf(sc->sc_dev, "timeout waiting for reset\n");
621
622 /* turn on cs4231 mode */
623 cs4231_write(sc, CS_MISC_INFO,
624 cs4231_read(sc, CS_MISC_INFO) | CS_MODE2);
41
42#include <sys/param.h>
43#include <sys/systm.h>
44#include <sys/bus.h>
45#include <sys/kernel.h>
46#include <sys/resource.h>
47
48#include <dev/ofw/ofw_bus.h>

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

617 i && CS_READ(sc, CS4231_IADDR) == CS_IN_INIT; i--)
618 DELAY(10);
619 if (i == 0)
620 device_printf(sc->sc_dev, "timeout waiting for reset\n");
621
622 /* turn on cs4231 mode */
623 cs4231_write(sc, CS_MISC_INFO,
624 cs4231_read(sc, CS_MISC_INFO) | CS_MODE2);
625 /* enable interupts & clear CSR */
625 /* enable interrupts & clear CSR */
626 cs4231_write(sc, CS_PIN_CONTROL,
627 cs4231_read(sc, CS_PIN_CONTROL) | INTERRUPT_ENABLE);
628 CS_WRITE(sc, CS4231_STATUS, 0);
629 /* enable DAC output */
630 cs4231_write(sc, CS_LEFT_OUTPUT_CONTROL,
631 cs4231_read(sc, CS_LEFT_OUTPUT_CONTROL) & ~OUTPUT_MUTE);
632 cs4231_write(sc, CS_RIGHT_OUTPUT_CONTROL,
633 cs4231_read(sc, CS_RIGHT_OUTPUT_CONTROL) & ~OUTPUT_MUTE);

--- 926 unchanged lines hidden ---
626 cs4231_write(sc, CS_PIN_CONTROL,
627 cs4231_read(sc, CS_PIN_CONTROL) | INTERRUPT_ENABLE);
628 CS_WRITE(sc, CS4231_STATUS, 0);
629 /* enable DAC output */
630 cs4231_write(sc, CS_LEFT_OUTPUT_CONTROL,
631 cs4231_read(sc, CS_LEFT_OUTPUT_CONTROL) & ~OUTPUT_MUTE);
632 cs4231_write(sc, CS_RIGHT_OUTPUT_CONTROL,
633 cs4231_read(sc, CS_RIGHT_OUTPUT_CONTROL) & ~OUTPUT_MUTE);

--- 926 unchanged lines hidden ---