summaryrefslogtreecommitdiffstats
path: root/sys/dev/atkbdc
Commit message (Collapse)AuthorAgeFilesLines
* Only use the BIOS-supplied IRQ for the atkbdc device for a child atkbdjhb2010-12-211-8/+10
| | | | | | device. Specifically, do not reuse it for a child psm device. Tested by: many
* Merge amd64 and i386 bus.h and move the resulting header to x86. Replacetijl2010-12-201-4/+2
| | | | | | | | | the original amd64 and i386 headers with stubs. Rename (AMD64|I386)_BUS_SPACE_* to X86_BUS_SPACE_* everywhere. Reviewed by: imp (previous version), jhb Approved by: kib (mentor)
* - If the atkbdc device is assigned an IRQ resource by ACPI or the PnPBIOS,jhb2010-12-163-14/+55
| | | | | | | | | | allow the child atkbd device to reuse that IRQ resource instead of reallocating the same IRQ from the parent bus inside the atkbd driver. - Don't allocate a shared IRQ for the atkbd driver. For AT keyboard devices on an ISA bus the IRQ is not shareable. Instead, the bus driver should mark the IRQ shareable if the bus supports shared IRQs. - Don't identify child devices until after the atkbdc device itself has attached.
* - When moving the IRQ resource from the psmcpnp device to the psm device,jhb2010-12-161-15/+5
| | | | | | | delete the IRQ resource from the psmcpnp device completely. - Don't allocate the IRQ resource shared. It is not a shareable interrupt on ISA. The bus driver can set RF_SHAREABLE if the IRQ is actually shareable on a non-ISA bus.
* Various small typos and grammar nits in comments.jhb2010-11-181-4/+4
|
* bus_add_child: change type of order parameter to u_intavg2010-09-101-2/+2
| | | | | | | | | | This reflects actual type used to store and compare child device orders. Change is mostly done via a Coccinelle (soon to be devel/coccinelle) semantic patch. Verified by LINT+modules kernel builds. Followup to: r212213 MFC after: 10 days
* Let psm(4) use si_drv1 to refer to its softc.ed2010-09-091-28/+22
|
* On certain chipsets AT keyboard controller isn't present and issobomax2010-04-294-16/+69
| | | | | | | | | | | | | | | | | | | | emulated by BIOS using SMI interrupt. On those chipsets reading from the status port may be thousand times slower than usually. Sometimes this emilation is not working properly resulting in commands timing out and since we assume that inb() operation takes very little time to complete we need to adjust number of retries to keep waiting time within a designed limits (100ms). Measure time it takes to make read_status() call and adjust number of retries accordingly. To keep it simple, use TSC to measure inb() performance and keep it to amd64-only, since TSC may not available on older CPUs. Also enable detection of the AT controller absence on amd64. Reviewed by: jhb MFC after: 1 month
* Add new "hw.psm.tap_enabled" tunable and sysctl.dumbbell2009-12-181-0/+35
| | | | | | | | | | | | | This tunable allows one to enable (1) or disable (0) gestures like tap and tap-hold on Synaptics TouchPad when the Extended mode isn't enabled (ie. "hw.psm.synaptics_support" not set). By default, the value is -1 in order to keep the current behaviour of not enabling/disabling gestures explicitly. PR: kern/139272 Submitted by: David Horn <dhorn2000 AT gmail DOT com> Reviewed by: David Horn <dhorn2000 AT gmail DOT com>
* Rewrite x86bios and update its dependent drivers.jkim2009-10-191-6/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Do not map entire real mode memory (1MB). Instead, we map IVT/BDA and ROM area separately. Most notably, ROM area is mapped as device memory (uncacheable) as it should be. User memory is dynamically allocated and free'ed with contigmalloc(9) and contigfree(9). Remove now redundant and potentially dangerous x86bios_alloc.c. If this emulator ever grows to support non-PC hardware, we may implement it with rman(9) later. - Move all host-specific initializations from x86emu_util.c to x86bios.c and remove now unnecessary x86emu_util.c. Currently, non-PC hardware is not supported. We may use bus_space(9) later when the KPI is fixed. - Replace all bzero() calls for emulated registers with more obviously named x86bios_init_regs(). This function also initializes DS and SS properly. - Add x86bios_get_intr(). This function checks if the interrupt vector is available for the platform. It is not necessary for PC-compatible hardware but it may be needed later. ;-) - Do not try turning off monitor if DPMS does not support the state. - Allocate stable memory for VESA OEM strings instead of just holding pointers to them. They may or may not be accessible always. Fix a memory leak of video mode table while I am here. - Add (experimental) BIOS POST call for vesa(4). This function calls VGA BIOS POST code from the current VGA option ROM. Some video controllers cannot save and restore the state properly even if it is claimed to be supported. Usually the symptom is blank display after resuming from suspend state. If the video mode does not match the previous mode after restoring, we try BIOS POST and force the known good initial state. Some magic was taken from NetBSD (and it was taken from vbetool, I believe.) - Add a loader tunable for vgapci(4) to give a hint to dpms(4) and vesa(4) to identify who owns the VESA BIOS. This is very useful for multi-display adapter setup. By default, the POST video controller is automatically probed and the tunable "hw.pci.default_vgapci_unit" is set to corresponding vgapci unit number. You may override it from loader but it is very unlikely to be necessary. Unfortunately only AGP/PCI/PCI-E controllers can be matched because ISA controller does not have necessary device IDs. - Fix a long standing bug in state save/restore function. The state buffer pointer should be ES:BX, not ES:DI according to VBE 3.0. If it ever worked, that's because BX was always zero. :-) - Clean up register initializations more clearer per VBE 3.0. - Fix a lot of style issues with vesa(4).
* Fix couple of style nits missed in the previous commit.jkim2009-09-251-1/+1
|
* - Use x86bios_offset() instead of BIOS_PADDRTOVADDR() macro.[1]jkim2009-09-251-14/+23
| | | | | | | | | | | | | | | - Clear all registers before calling real mode interrupt handlers as we did for dpms and vesa and re-enable the function as it should be fixed by this. - Tidy up register access. For example, when we call INT 0x15, AH=0xc0, we used to initialize AX=0xc000 to clear AL at the same time but it is very confusing. We don't have to do this any more because we are explicitly clearing all registers now. - Check size of system configuration table although it is almost always 8. This is to make sure we are not reading some random low physical memory. Hopefully it is just zero in that case. :-) - Fix some style nits and add more comments. Submitted by: paradox (ddkprog yahoo com)[1]
* - Use FreeBSD function naming convention.jkim2009-09-241-3/+3
| | | | | | | - Change x86biosCall() to more appropriate x86bios_intr().[1] Discussed with: delphij, paradox (ddkprog yahoo com) Submitted by: paradox (ddkprog yahoo com)[1]
* Move sys/dev/x86bios to sys/compat/x86bios.jkim2009-09-231-1/+1
| | | | | | It may not be optimal but it is clearly better than the old place. OK'ed by: delphij, paradox (ddkprog yahoo com)
* Temporarily disable typematic retrieving code until we get a real fix,delphij2009-09-221-2/+2
| | | | | | | which currently causes hangs in some configurations. Reported by: joel Submitted by: swell.k at gmail.com
* Allow atkbd to obtain keyboard repeat rate from BIOS on amd64.delphij2009-09-211-19/+18
| | | | Submitted by: swell.k at gmail.com
* Temporarily revert the new-bus locking for 8.0 release. It will bejhb2009-08-201-4/+0
| | | | | | reintroduced after HEAD is reopened for commits by re@. Approved by: re (kib), attilio
* Make the newbus subsystem Giant free by adding the new newbus sxlock.attilio2009-08-021-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The newbus lock is responsible for protecting newbus internIal structures, device states and devclass flags. It is necessary to hold it when all such datas are accessed. For the other operations, softc locking should ensure enough protection to avoid races. Newbus lock is automatically held when virtual operations on the device and bus are invoked when loading the driver or when the suspend/resume take place. For other 'spourious' operations trying to access/modify the newbus topology, newbus lock needs to be automatically acquired and dropped. For the moment Giant is also acquired in some key point (modules subsystem) in order to avoid problems before the 8.0 release as module handlers could make assumptions about it. This Giant locking should go just after the release happens. Please keep in mind that the public interface can be expanded in order to provide more support, if there are really necessities at some point and also some bugs could arise as long as the patch needs a bit of further testing. Bump __FreeBSD_version in order to reflect the newbus lock introduction. Reviewed by: ed, hps, jhb, imp, mav, scottl No answer by: ariff, thompsa, yongari Tested by: pho, G. Trematerra <giovanni dot trematerra at gmail dot com>, Brandon Gooch <jamesbrandongooch at gmail dot com> Sponsored by: Yahoo! Incorporated Approved by: re (ksmith)
* Prevent atkbd(4) interrupt handler from calling keyboard callback functionemax2009-04-171-2/+4
| | | | | | | | | | when polled mode is enabled. This should help with duplicated/missing characters problem at mountroot, geli, etc. prompts on multi CPU systems while kbdmux(4) is enabled. Tested by: Tobias Grosser <grosser -at- fim -dot- uni-passau -dot- de> Tested by: Fabian Keil <freebsd-listen -at- fabiankeil -dot- de> MFC after: 3 days
* Teach psm about O_ASYNCrnoland2009-03-161-0/+23
| | | | | | This makes Xorg happy if you aren't using moused. MFC after: 3 days
* bus_add_child takes a const char *.imp2009-02-051-3/+3
|
* Synaptics touchpads must be reinitialized after suspend/resume.dumbbell2008-12-171-1/+9
| | | | | | This fixes touchpad resume on Asus EeePC among others. Submitted by: rpaulo
* Rephrase and/or fix some comments in Synaptics touchpad initializationdumbbell2008-12-161-10/+15
| | | | function.
* Rewrite Synaptics touchpads support with the following goals in mind:dumbbell2008-10-141-175/+982
| | | | | | | | | | | | | | | | | o better quality of the movement smoothing o more features such as tap-hold and virtual scrolling Support must still be enabled with this line in your /boot/loader.conf: hw.psm.synaptics_support="1" The following sysctls were removed: hw.psm.synaptics.low_speed_threshold hw.psm.synaptics.min_movement hw.psm.synaptics.squelch_level An overview of this new driver and a short documentation about the added sysctls is available on the wiki: http://wiki.freebsd.org/SynapticsTouchpad
* Replace all calls to minor() with dev2unit().ed2008-09-271-2/+2
| | | | | | | | | | | | | | | After I removed all the unit2minor()/minor2unit() calls from the kernel yesterday, I realised calling minor() everywhere is quite confusing. Character devices now only have the ability to store a unit number, not a minor number. Remove the confusion by using dev2unit() everywhere. This commit could also be considered as a bug fix. A lot of drivers call minor(), while they should actually be calling dev2unit(). In -CURRENT this isn't a problem, but it turns out we never had any problem reports related to that issue in the past. I suspect not many people connect more than 256 pieces of the same hardware. Reviewed by: kib
* Fill in sysctl descriptions.trhodes2008-07-261-10/+18
| | | | Approved by: philip
* Try to detect a Synaptics touchpad before IntelliMouse. Some touchpads willphilip2008-06-011-2/+2
| | | | | | | | | | | | | pretend to be IntelliMouse (which have a few more features than generic mice) causing the IntelliMouse probe to work and the Synaptics code never to be called. This should not break "real" IntelliMouse because the Synaptics detection code is fairly specific. PR: kern/120833 Submitted by: Eygene Ryabinkin <rea-fbsd -at- codelabs.ru> MFC after: 1 week
* Clean up and fix style(9) nits.jkim2008-04-081-2852/+2938
|
* - Add write(2) support for psm(4) in native operation level. Now arbitraryjkim2008-04-081-7/+53
| | | | | | | commands can be written to /dev/psm%d and status can be read back from it. - Reflect the change in psm(4) and bump version for ports. MFC after: 1 week
* Some PS/2 mice (at least the A4Tech X-7xx) need to be set to Intelli moderink2008-02-251-0/+7
| | | | | | | | | first before they can be set to Explorer mode. PR: kern/118578 Submitted by: Andriy Gapon <avg@icyb.net.ua> (I added some comments) Reviewed by: philip MFC after: 1 month
* Remove explicit calls to keyboard methods with their respective variantswkoszek2007-12-292-8/+8
| | | | | | | | | | | | | | | implemented with macros. This patch improves code readability. Reasoning behind kbdd_* is a "keyboard discipline". List of macros is supposed to be complete--all methods of keyboard_switch should have their respective macros from now on. Functionally, this code should be no-op. My intention is to leave current behaviour of code as is. Glanced at by: rwatson Reviewed by: emax, marcel Approved by: cognet
* Initialize mouse resolution to zero if converting frommjacob2007-06-171-0/+2
| | | | OLD to NEW.
* o break newbus api: add a new argument of type driver_filter_t topiso2007-02-232-2/+2
| | | | | | | | | | | | | bus_setup_intr() o add an int return code to all fast handlers o retire INTR_FAST/IH_FAST For more info: http://docs.freebsd.org/cgi/getmsg.cgi?fetch=465712+0+current/freebsd-current Reviewed by: many Approved by: re@
* Synaptics TouchPad seems to go back to Relative Mode after the calldumbbell2007-02-041-0/+10
| | | | | | | to set_controller_command_byte() call; by issueing a Read Mode Byte command, the touchpad is in Absolute Mode again. This problem occursed at least on Asus V6V laptops.
* Spell "Kensington Thinking Mouse" correctly.keramida2006-12-181-1/+1
|
* Fix LEDs not working when atkbd is an active keyboard and the physicalru2006-10-251-16/+16
| | | | | | | | | | | | | | | | | | | | keyboard is attached only after the system has already booted. If USB keyboard is also present, and there's no kbdmux(4), the problem has been hiding itself because as soon as we get to multi-user, the USB keyboard becomes an active keyboard (see devd.conf), thus marking atkbd inactive and letting the old code initialize the keyboard. With kbdmux(4), or if there's no USB keyboard, the atkbd keyboard is always active, whether it's physically attached or not, thus it never initialized itself properly on a physical attach. To fix this, move block that initialized the keyboard on attach upper so it doesn't depend on the (KBD_IS_ACTIVE(kbd) && KBD_IS_BUSY(kbd)) condition. Also move KBD_FOUND_DEVICE() a few lines upper so that KDSETLED and KDSETREPEAT that follow it propagate to the controller. MFC after: 3 days
* Fix our ioctl(2) implementation when the argument is "int". Newru2006-09-271-0/+33
| | | | | | | | | | | | | ioctls passing integer arguments should use the _IOWINT() macro. This fixes a lot of ioctl's not working on sparc64, most notable being keyboard/syscons ioctls. Full ABI compatibility is provided, with the bonus of fixing the handling of old ioctls on sparc64. Reviewed by: bde (with contributions) Tested by: emax, marius MFC after: 1 week
* Avoid an infinite loop in empty_both_buffers() by adding a timeout.dwhite2006-09-041-0/+11
| | | | | | | | | | | This helps systems that don't actually have atkbd controllers, such as the Intel SBX82 blade, boot without device.hints hacks. Hardware for this fix provided by iXsystems. PR: 94822 Submitted by: Devon H. O'Dell <devon.odell@coyotepoint.com> MFC After: 3 days
* Make sure command/data port (0x60) and status port (0x64) are in correctjkim2006-07-031-4/+10
| | | | order. Some brain-damaged ACPI BIOS has reversed resources.
* MFp4: need machine/bus.h here since we use bus space macros. It used toimp2006-06-121-0/+1
| | | | | | be brought in by name-space polluted sys/rman.h. Pointy hat to: imp
* Send the pcvt(4) driver off to retirement.phk2006-05-171-3/+0
|
* Remove various bits of conditional Alpha code and fixup a few comments.jhb2006-05-122-3/+1
|
* Use the same method for detecting actual presence of AT-style keyboardsobomax2006-04-263-5/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | controller as we use in boot blocks (querying status register until bit 1 goes off). If that doesn't happed during reasonable period assume that the hardware doesn't have AT-style keyboard controller. This makes FreeBSD working almost OOB on MacBook Pro (still there are issues with putting second CPU core on-line, but since installation CD comes with UP kernel with this change one should be able to install FreeBSD without playing tricks with hints). Other legacy-free hardware (e.g. IBM NetVista S40) should benefit from this as well, but since I don't have any I can't verify. It should make no difference on the ordinary i386 hardware (since in that case that hardware already would be having an issues with A20 routines in boot blocks). I don't know much about AT-style keyboard controller on other platforms (and don't have dedicated access to one), therefore, the code is restricted to i386 for now. I suspect that amd64 may need this as well, but I would rather leave this decision to someone who knows better about the platform(s) in question. I have tested this change on as many "ordinary i386 boxes" as I can get my hands on, and it doesn't create any false negatives on hardware with AT-style keyboard present. MFC after: 1 month
* Add ALPS glide point ID and some compatibility IDs.takawata2006-03-151-0/+3
| | | | PR: kern/75008
* Fix a bug in Synaptics Touchapd support where psm(4) will enter an infinitedumbbell2006-01-051-1/+2
| | | | | | | loop if it receives an out of sync packet. Reviewed by: mux (mentor) MFC after: 4 days
* Fix -Wundef.ru2005-12-042-2/+2
|
* - Hook up the new locations of the atkbdc(4), atkbd(4) and psm(4) sourcemarius2005-06-1011-453/+555
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | files after they were repo-copied to sys/dev/atkbdc. The sources of atkbdc(4) and its children were moved to the new location in preparation for adding an EBus front-end to atkbdc(4) for use on sparc64; i.e. in order to not further scatter them over the whole tree which would have been the result of adding atkbdc_ebus.c in e.g. sys/sparc64/ebus. Another reason for the repo-copies was that some of the sources were misfiled, e.g. sys/isa/atkbd_isa.c wasn't ISA-specific at all but for hanging atkbd(4) off of atkbdc(4) and was renamed to atkbd_atkbdc.c accordingly. Most of sys/isa/psm.c, i.e. expect for its PSMC PNP part, also isn't ISA-specific. - Separate the parts of atkbdc_isa.c which aren't actually ISA-specific but are shareable between different atkbdc(4) bus front-ends into atkbdc_subr.c (repo-copied from atkbdc_isa.c). While here use bus_generic_rl_alloc_resource() and bus_generic_rl_release_resource() respectively in atkbdc_isa.c instead of rolling own versions. - Add sparc64 MD bits to atkbdc(4) and atkbd(4) and an EBus front-end for atkbdc(4). PS/2 controllers and input devices are used on a couple of Sun OEM boards and occur on either the EBus or the ISA bus. Depending on the board it's either the only on-board mean to connect a keyboard and mouse or an alternative to either RS232 or USB devices. - Wrap the PSMC PNP part of psm.c in #ifdef DEV_ISA so it can be compiled without isa(4) (e.g. for EBus-only machines). This ISA-specific part isn't separated into its own source file, yet, as it requires more work than was feasible for 6.0 in order to do it in a clean way. Actually philip@ is working on a rewrite of psm(4) so a more comprehensive clean-up and separation of hardware dependent and independent parts is expected to happen after 6.0. Tested on: i386, sparc64 (AX1105, AXe and AXi boards) Reviewed by: philip
* Delete a file that was meant to be renamed while repo-copying it butmarius2005-06-101-180/+0
| | | | wasn't and now is superfluous.
* Remove bus_{mem,p}io.h and related code for a micro-optimization on i386nyan2005-05-293-5/+0
| | | | | | and amd64. The optimization is a trivial on recent machines. Reviewed by: -arch (imp, marcel, dfr)
* Backout previous diffs - this functionality is already provided by thesobomax2005-04-071-15/+0
| | | | | | | hints to the atkbd(4). PR: Submitted by: jhb
OpenPOWER on IntegriCloud