Commit Graph

32 Commits

Author SHA1 Message Date
Martin Blapp
c2ede4b379 Remove extraneous semicolons, no functional changes.
Submitted by:	Marc Balmer <marc@msys.ch>
MFC after:	1 week
2010-01-07 21:01:37 +00:00
John Baldwin
13e3657b7b Add locking to the various iicbus(4) bridge drivers:
- Just grab Giant in the ixp425_iic(4) driver since this driver uses
  a shared address/data register window pair to access the actual
  I2C registers.  None of the other ixp425 drivers lock access to these
  shared address/data registers yet and that would need to be done before
  this could use any meaningful locking.
- Add locking to the interrupt handler and 'iicbus_reset' methods of the
  at91_twi(4) driver.
- Add locking to the pcf(4) driver.  Other pcf(4) fixes include:
  - Don't needlessly zero the softc.
  - Use bus_foo rather than bus_space_foo and remove bus space tag and
    handle from softc.
- The lpbb(4) driver just grabs Giant for now.  This will be refined later
  when ppbus(4) is locked.
- As was done with smbus earlier, move the DRIVER_MODULE() lines to match
  the bus driver (either iicbus or iicbb) to the bridge driver into the
  bridge drivers.

Tested by:	sam (arm/ixp425)
2008-08-04 20:46:15 +00:00
John Baldwin
0df8f0815a Explicitly lock Giant in smbus_if methods in the bktr_i2c and iicsmb
drivers for now.  This can be replaced with driver locks when these
drivers are locked.
2008-06-06 18:40:38 +00:00
John-Mark Gurney
5afbb3a8b1 remove delays that have been unnecessary since 2002... The iicbb driver
has the proper delays...
2006-12-31 19:42:47 +00:00
John Baldwin
7048a99c30 Minor overhaul of SMBus support:
- Change smbus_callback() to pass a void * rather than caddr_t.
- Change smbus_bread() to pass a pointer to the count and have it be an
  in/out parameter.  The input is the size of the buffer (same as before),
  but on return it will contain the actual amount of data read back from
  the bus.  Note that this value may be larger than the input value.  It
  is up to the caller to treat this as an error if desired.
- Change the SMB_BREAD ioctl to write out the updated struct smbcmd which
  will contain the actual number of bytes read in the 'count' field.  To
  preserve the previous ABI, the old ioctl value is mapped to SMB_OLD_BREAD
  which doesn't copy the updated smbcmd back out to userland.  I doubt anyone
  actually used the old BREAD anyway as it was rediculous to do a bulk-read
  but not tell the using program how much data was actually read.
- Make the smbus driver and devclass public in the smbus module and
  push all the DRIVER_MODULE()'s for attaching the smbus driver to
  various foosmb drivers out into the foosmb modules.  This makes all
  the foosmb logic centralized and allows new foosmb modules to be
  self-contained w/o having to hack smbus.c everytime a new smbus driver
  is added.
- Add a new SMB_EINVAL error bit and use it in place of EINVAL to return
  an error for bad arguments (such as invalid counts for bread and bwrite).
- Map SMB bus error bits to EIO in smbus_error().
- Make the smbus driver call bus_generic_probe() and require child drivers
  such as smb(4) to create device_t's via identify routines.  Previously,
  smbus just created one anonymous device during attach, and if you had
  multiple drivers that could attach it was just random chance as to which
  driver got to probe for the sole device_t first.
- Add a mutex to the smbus(4) softc and use it in place of dummy splhigh()
  to protect the 'owner' field and perform necessary synchronization for
  smbus_request_bus() and smbus_release_bus().
- Change the bread() and bwrite() methods of alpm(4), amdpm(4), and
  viapm(4) to only perform a single transaction and not try to use a
  loop of multiple transactions for a large request.  The framing and
  commands to use for a large transaction depend on the upper-layer
  protocol (such as SSIF for IPMI over SMBus) from what I can tell, and the
  smb(4) driver never allowed bulk read/writes of more than 32-bytes
  anyway.  The other smb drivers only performed single transactions.
- Fix buffer overflows in the bread() methods of ichsmb(4), alpm(4),
  amdpm(4), amdsmb(4), intpm(4), and nfsmb(4).
- Use SMB_xxx errors in viapm(4).
- Destroy ichsmb(4)'s mutex after bus_generic_detach() to avoid problems
  from child devices making smb upcalls that would use the mutex during
  their detach methods.

MFC after:	1 week
Reviewed by:	jmg (mostly)
2006-09-11 20:52:41 +00:00
Yoshihiro Takahashi
d4fcf3cba5 Remove bus_{mem,p}io.h and related code for a micro-optimization on i386
and amd64.  The optimization is a trivial on recent machines.

Reviewed by:	-arch (imp, marcel, dfr)
2005-05-29 04:42:30 +00:00
Warner Losh
e36e54501e Remove support for FreeBSD < 4.recent from this driver. 2005-01-08 22:52:00 +00:00
David E. O'Brien
3333c398da Move the bktr(4) <arch>/include/ioctl_{bt848,meteor}.h files to dev/bktr
as these ioctl's aren't MD.  This also means they are installed in
/usr/include/dev/bktr now.  Also provide compatability wrappers for
where these headers lived in 4.x.
2003-12-08 07:59:18 +00:00
David E. O'Brien
aad970f1fe Use __FBSDID().
Also some minor style cleanups.
2003-08-24 17:55:58 +00:00
Warner Losh
4fbd232c86 Prefer new location of pci include files (which have only been in the
tree for two or more years now), except in a few places where there's
code to be compatible with older versions of FreeBSD.
2003-08-22 05:54:52 +00:00
Peter Wemm
05e5542d97 Remove abuse of NBKTR - this was always a NOP on freebsd. We never
compiled this stuff if NBKTR was zero.
2002-07-21 05:19:03 +00:00
Nicolas Souchu
ea4122d2bf Fix bktr and pcf compilation with LINT 2002-03-25 21:22:35 +00:00
Nicolas Souchu
c17d43407f Major rework of the iicbus/smbus framework:
- VIA chipset SMBus controllers added
	- alpm driver updated
	- Support for dynamic modules added
	- bktr FreeBSD smbus updated but not tested
	- cleanup
2002-03-23 15:49:15 +00:00
Garrett Wollman
074a4a2c84 Finish deprecating <sys/select.h> in favor of <sys/selinfo.h> in kernel code. 2001-01-20 02:24:07 +00:00
Roger Hardiman
97e1cf9c1b Update to driver 2.17
Fixes bugs in devfs when unloading and reloading
Syncs with NetBSD changes

Submitted by:	Alexander Langer <alex@big.endian.de>
Submitted by:	Thomas Klausner <wiz@netbsd.org>
Submitted by:	Daniel O'Connor" <doconnor@gsoft.com.au>
2000-10-19 07:33:28 +00:00
Poul-Henning Kamp
db7e3af111 Remove unneeded #include <machine/clock.h> 2000-10-15 14:19:01 +00:00
Poul-Henning Kamp
3389ae9350 Remove ~25 unneeded #include <sys/conf.h>
Remove ~60 unneeded #include <sys/malloc.h>
2000-04-19 14:58:28 +00:00
Poul-Henning Kamp
ed6aff7387 Remove unneeded <sys/buf.h> includes.
Due to some interesting cpp tricks in lockmgr, the LINT kernel shrinks
by 924 bytes.
2000-04-18 15:15:39 +00:00
Roger Hardiman
24cf43ae21 Upgrade the bktr driver from 2.07 to 2.10.
- The driver now uses bus_space() and runs on NetBSD 1.4.2
   Submitted by Thomas Klausner <wiz@danbala.ifoer.tuwien.ac.at>

 - Remove startup quirks for video and vbi capture for PAL users.
   PAL TV users can now run FXTV and Alevt in any order.

 - Add support for cable channels >100
   Submitted by Scott Presnell <srp@zgi.com>

 - New MSP3410/3415 setup code added. This is experimental.
   Please set the sysctl hw.bt848.slow_msp_audio to 1 for this.
   Submitted by Frank Nobis<fn@radio-do.de>
2000-04-04 16:54:13 +00:00
Peter Wemm
4486cd7990 Use config's tools rather than #if's. 2000-01-29 18:54:12 +00:00
Roger Hardiman
12504d0820 Update to driver 2.07
Update i2c code to build on FreeBSD 3.x and 4.x machines.
Added GPIO audio values for the Askey/Dynalink TV card talken from postings on the V4L mailing list.
Update Australian Channel Set. Submitted by John Birrell <jb@cimlogic.com.au>
Add new Channel Set for France. Submitted by Daniel Dagneaux <dagneaux@lure.u-psud.fr>
2000-01-24 14:00:21 +00:00
Matthew N. Dodd
fe0d408987 Remove the 'ivars' arguement to device_add_child() and
device_add_child_ordered().  'ivars' may now be set using the
device_set_ivars() function.

This makes it easier for us to change how arbitrary data structures are
associated with a device_t.  Eventually we won't be modifying device_t
to add additional pointers for ivars, softc data etc.

Despite my best efforts I've probably forgotten something so let me know
if this breaks anything.  I've been running with this change for months
and its been quite involved actually isolating all the changes from
the rest of the local changes in my tree.

Reviewed by:	peter, dfr
1999-12-03 08:41:24 +00:00
Roger Hardiman
56597309fa Update to driver release 2.04
Update AverMedia GPIO values
Submitted by:	AverMedia

Add support for WinTV Theater Dolby Surround Sound DPL3518A chip
Submitted by:	Frank Nobis <fn@radio-do.de>

Make PLL mode the default for Bt878s. You no longer need options BKTR_USE_PLL
1999-10-28 13:58:17 +00:00
Roger Hardiman
ca0c4630a1 Move the bktr Bt848/Bt878 driver to /sys/dev/bktr
Phase 1) move the driver
Phase 2)
Phase 3) Profit, by splitting the driver into smaller files like
bktr_tuner, bktr_card, bktr_audio, bktr_<osname>
making it easier to maintain and understand.
1999-09-22 06:46:08 +00:00
Roger Hardiman
a8a77e3724 Add #include <sys/select.h> ready for select() support in bt848 driver 1999-08-30 09:28:47 +00:00
Peter Wemm
c3aac50f28 $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
Matthew N. Dodd
15317dd875 Alter the behavior of sys/kern/subr_bus.c:device_print_child()
- device_print_child() either lets the BUS_PRINT_CHILD
	  method produce the entire device announcement message or
	  it prints "foo0: not found\n"

Alter sys/kern/subr_bus.c:bus_generic_print_child() to take on
the previous behavior of device_print_child() (printing the
"foo0: <FooDevice 1.1>" bit of the announce message.)

Provide bus_print_child_header() and bus_print_child_footer()
to actually print the output for bus_generic_print_child().
These functions should be used whenever possible (unless you can
just use bus_generic_print_child())

The BUS_PRINT_CHILD method now returns int instead of void.

Modify everything else that defines or uses a BUS_PRINT_CHILD
method to comply with the above changes.

	- Devices are 'on' a bus, not 'at' it.
	- If a custom BUS_PRINT_CHILD method does the same thing
	  as bus_generic_print_child(), use bus_generic_print_child()
	- Use device_get_nameunit() instead of both
	  device_get_name() and device_get_unit()
	- All BUS_PRINT_CHILD methods return the number of
	  characters output.

Reviewed by: dfr, peter
1999-07-29 01:03:04 +00:00
Peter Wemm
9929d2a045 Eliminate a bunch of #include "pci.h" and #if NPCI > 0 around entire
files.  config will leave the whole file out if configured to do so.
1999-07-03 20:17:08 +00:00
Roger Hardiman
2a3fb485f9 Add #if (NSMBUS>0) checks around smbus/iicbus i2c bus code. 1999-05-10 10:08:05 +00:00
Doug Rabson
566643e39e Move the declaration of the interrupt type from the driver structure
to the BUS_SETUP_INTR call.
1999-05-08 21:59:43 +00:00
Nicolas Souchu
dec0ec9e81 Return to previous check_for_i2c_devices() behaviour.
Cast the cmd parameter to unsigned char in every smbus call.

Submitted by: Roger Hardiman <roger@cs.strath.ac.uk>
1998-11-07 14:30:48 +00:00
Nicolas Souchu
fbd78b40dd Brooktree driver ported to the new I2C framework. See iicbus(4) for more info. 1998-10-31 11:26:38 +00:00