Commit Graph

77431 Commits

Author SHA1 Message Date
Jiri Kosina 85c985f460 HID: MS Presenter mapping for PID 0x0701
0x045e/0x0701 also needs the hid-input mapping quirk established by
quirk_microsoft_presenter_8k().

Reported-by: Jonas Delrue <jonas_delrue@hotmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-01-28 14:51:22 +01:00
Robert Schedel fe56caa97e HID: Support Samsung IR remote
Samsung USB remotes (0419:0001) are rejected by kernel 2.6.23, because the
report descriptor from the remote contains a 48 bit HID report field. HID 1.11
states: Fields may span at most 4 bytes.

This patch, based on 2.6.23, fixes this by modifying the internal report
descriptor in hid-quirks.c. Additional user space support (e.g. LIRC) is
required to fetch the information from the hiddev interface.

The burden to reconstruct the data is moved into userspace (lirc through hiddev).
There is no need to set HID_QUIRK_HIDDEV quirk, as the device has also output
applications, which trigger the creation of hiddev device automatically.

Signed-off-by: Robert Schedel <r.schedel@yahoo.de>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-01-28 14:51:22 +01:00
Jiri Kosina b0e6682409 HID: fix compilation of hidbp drivers without usbhid
We can use the blacklist only if usbhid code is compiled.

Reported-by: jurriaan <thunder7@xs4all.nl>
Cc: Pascal Terjan <pterjan@mandriva.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-01-28 14:51:22 +01:00
Nicolas Mailhot 15b55fb879 HID: Blacklist the Gretag-Macbeth Huey display colorimeter
The Gretag-Macbeth Huey display colorimeter claims to be an HID device but
isn't. As a result the linux HID device will claim it, preventing FLOSS
software like Argyll CMS from talking to it.

Tested-by: Frederic Crozat <fcrozat@mandriva.com>
Signed-off-by: Nicolas Mailhot <nicolas.mailhot@laposte.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-01-28 14:51:22 +01:00
Fengguang Wu 70d215c4a7 HID: the `bit' in hidinput_mapping_quirks() is an out parameter
Fix a panic, by changing
	hidinput_mapping_quirks(,, unsigned long *bit,)
to
	hidinput_mapping_quirks(,, unsigned long **bit,)

The `bit' in this function is an out parameter.

Signed-off-by: Fengguang Wu <wfg@mail.ustc.edu.cn>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-01-28 14:51:22 +01:00
Jiri Kosina c4124c9b68 HID: remove redundant WARN_ON()s in order not to scare users
The WARN_ON() in implement() and extract() spit out stacktraces and
a lot of other information that might make users think that there is
something seriously wrong with the system. WARN_ON() should not be
deliberately triggerable by userspace application, which these can be.
Usually this WARN_ON() triggers when hid2hci utility is sending the
data that don't correspond to the device's report descriptor.

Convert these messages to more friendly printk().

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-01-28 14:51:22 +01:00
Bastien Nocera 0887b4cb21 HID: force hiddev creation for SONY PS3 controller
The device is not discoverable, and needs to be poked to set its master, the
Bluetooth device it will try to connect to when the "Home" button is pressed
without a cable plugged in.

Using libusb means disconnecting the device from its driver to get the report
descriptor. Using hiddev, we can poke it without relinquishing control over it,
so when you plug it in, it would still work as a pad.

This could be then used by sixpair program, after it is rewritten to use
hiddev instead of libusb.

Signed-off-by: Bastien Nocera <hadess@hadess.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-01-28 14:51:21 +01:00
Pascal Terjan 9f6b37275a HID: Use hid blacklist in usbmouse/usbkbd
This fixes wacom tablets not working if usbmouse is loaded.

Signed-off-by: Pascal Terjan <pterjan@mandriva.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-01-28 14:51:21 +01:00
Jiri Kosina 628edcde87 HID: proper handling of MS 4k and 6k devices
This removes ugly macros IS_* to distinguish devices that
need special handling in hid-input, and establish proper
quirks for them.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-01-28 14:51:21 +01:00
Jiri Kosina 9a15c99714 HID: remove unused variable in quirk event handler
Remove unused variable in quirk event handler.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-01-28 14:51:21 +01:00
Jiri Kosina 36ccaad640 HID: hid-input quirk for BTC 8193
BTC 8193 keyboard handles its scrollwheel in very non-standard way.
It produces two non-standard usages for scrolling up and down, in
both cases with postive value equaling to 1. We handle this by temporary
mapping, which we then catch in quirk event handler, and remap to
negative HWHEEL even in order to introduce correct behavior.

Also the button requires special mapping, as it triggers standard-violating
usage code.

Reported in kernel.org bugzilla #9385

Reported-by: Kir Kolyshkin <kir@sacred.ru>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-01-28 14:51:21 +01:00
Jiri Kosina 87bc2aa993 HID: separate hid-input event quirks from generic code
This patch separates also the hid-input quirks that have to be
applied at the time the event occurs, so that the generic code
handling HUT-compliant devices is not messed up by them too much.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-01-28 14:51:20 +01:00
Jiri Kosina 10bd065fac HID: refactor mapping to input subsystem for quirky devices
Currently, the handling of mapping between hid and input for devices
that don't conform to HUT 1.12 specification is very messy -- no per-device
handling, no blacklists, conditions on idVendor and idProduct placed
all over the code.

This patch moves all the device-specific input mapping to a separate
file, and introduces a blacklist-style handling for non-standard
device-specific mappings.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-01-28 14:51:20 +01:00
Drew Fisher 8dcd5afabf HID: Microsoft Wireless Optical Desktop 3.0 quirk
Make the Microsoft Wireless Optical Desktop 3.0 work as a mouse.

Microsoft Wireless Optical Desktop 3.0 doesn't properly describe its interface
class.  Specifically, since it doesn't mark the second interface as a mouse
(bInterfaceSubclass = 0), it doesn't get HID_QUIRK_NOGET applied to the
interface, and then acts broken when polled.

Signed-off-by: Drew Fisher <drew.m.fisher@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-01-28 14:51:20 +01:00
Carlos Corbacho bc3707335c HID: Add support for Logitech Elite keyboards
Reuse the quirks from the Cordless Desktop LX500 - stops some of the extra
keys being reported as mouse buttons.

Signed-off-by: Carlos Corbacho <cathectic@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-01-28 14:51:20 +01:00
Jiri Kosina af9e0eacdc HID: add full support for Genius KB-29E
Genius KB-29E has broken report descriptor, which causes some of the
Consumer usages to appear incorrectly as Button usages. We fix it by
fixing the report descriptor before it is being parsed.

Also a few of the keys violate the HUT standard, so they need a special
handling. They currently fall into "Reserved" range as per HUT 1.12.

Reported-by: Szekeres Istvan <szekeres@iii.hu>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-01-28 14:51:20 +01:00
Li Zefan 3ba5619f06 HID: fix a potential bug in pointer casting
Don't directly cast list_head * to foo *, this works only when list
is the first member of struct foo, and we should not make the assumption
how members are ordered in the structure.

i.e. struct *f = (struct *f)pos will work if:
	struct foo {
		struct list_head list;
		int i;
	};

but will fail if:
	struct foo {
		int i;
		struct list_head list;
	}

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-01-28 14:51:19 +01:00
Pavel Troller c80e5ffac0 HID: Implement horizontal wheel handling for A4 Tech X5-005D
This mouse distinguishes horizontal wheel from vertical by a special "pseudo
event" GenericDesktop.00b8, with values of 0 for vertical and 8 for horizontal
wheel. Because this event is supplied by the parser too late, we need to delay
a wheel event, wait for this one and send either REL_WHEEL or REL_HWHEEL to
input depending on the event value.

Signed-off-by: Pavel Troller <patrol@sinus.cz>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-01-28 14:51:19 +01:00
Michel Daenzer a45d82d19a HID: Add support for Apple aluminum USB keyboards.
Reuse the existing quirks for Apple laptop USB keyboards.

Signed-off-by: Michel Daenzer <michel@tungstengraphics.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-01-28 14:51:19 +01:00
Michel Daenzer 81e1a87550 HID: Rename some code identifiers from PowerBook specific to Apple generic
Preserve identifiers exposed in build and run time configuration though in
order not to break existing configurations.

This is in preparation for adding support for Apple aluminum USB keyboards.

Signed-off-by: Michel Daenzer <michel@tungstengraphics.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-01-28 14:51:19 +01:00
Jan Kiszka 3c684c8cd4 HID: Map MS Presenter 8000 bottom-side buttons
The MS Presenter 8000 bluetooth mouse is a "dual-use" device: If you
press a button on the top, you can turn it around and find special keys
on the other side, useful for presentations. This patch maps those three
bottom-keys that are not already detected to the intended functions. The
magic bottom on the top is mapped to F5 when we switch from mouse to
presenter mode in order to activate the presentation mode in the related
software (e.g. OpenOffice).

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-01-28 14:51:19 +01:00
Linus Torvalds 91525300ba Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/cooloney/blackfin-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/cooloney/blackfin-2.6: (54 commits)
  MAINTIANERS: just use Mike gmail e-mail for contact and pawn the serial driver off onto Sonic
  [Blackfin] arch: remove old I2C BF54x porting.
  [Blackfin] arch: Add the semtimedop syscall.  Upstream uClibc doesn't compile without it.
  [Blackfin] arch: fix bug kernel boot message: memory information is not reasonable
  [Blackfin] arch: use common flash driver to setup partitions rather than the bf5xx-flash driver
  [Blackfin] arch: Fix bug - kernel build with Debug option enabled fails to boot up
  [Blackfin] arch: Fix bug Only RTC interrupt can wake up deeper sleep core.
  [Blackfin] arch: Add proper SW System Reset delay sequence
  [Blackfin] arch: Update copyright date
  [Blackfin] arch: GPIO API cleanup and anomaly update
  [Blackfin] arch: Fix BUG gpio_direction_output API is not compatitable with GENERIC_GPIO API interface
  [Blackfin] arch: Initial checkin of the memory protection support.
  [Blackfin] arch: set_bfin_dma_config shouldnt set SYNC or RESTART by default - add argument or option
  [Blackfin] arch: Add some comments - fix semicolons
  [Blackfin] arch: move all code related to CPLB handling into a new subdirectory under kernel/
  [Blackfin] arch: print out list of modules if kernel is crashing and tell people if the kernel is tainted 
  [Blackfin] arch: enable generic GPIO based I2C driver in STAMP-BF533, EZKIT-BF533 and EZKIT-BF561 boards
  [Blackfin] arch: Don't oops_in_progress if single step is comming from the kernel
  [Blackfin] arch: Fix BUG - kernel sometimes would stuck with KEYBOARD_GPIO on
  [Blackfin] arch: update to latest anomaly sheets
  ...
2008-01-28 08:15:24 +11:00
Kalle Pokki 991dee591a i2c-bfin-twi: Register adapter with a specific bus number
All the users of this driver explicitly specify the I2C bus numbers
to be used in their platform data. Make the driver respect that.

Signed-off-by: Kalle Pokki <kalle.pokki@eke.fi>
Cc: Bryan Wu <bryan.wu@analog.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
2008-01-27 18:14:52 +01:00
Manuel Lauss 8b798c4d16 i2c-au1550: Convert to platform driver
Convert the i2c-au1550 bus driver to platform driver, and
register a platform device for the Alchemy Db/Pb series of
boards.

Signed-off-by: Manuel Lauss <mano@roarinelk.homelinux.net>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
2008-01-27 18:14:52 +01:00
Manuel Lauss 91f27958d6 i2c-au1550: properly terminate zero-byte transfers
Zero-bytes transfers would leave the bus transaction unfinished
(no i2c stop is sent), with the following transfer actually
sending the slave address to the previously addressed device,
resulting in weird device failures (e.g. reset minute register
values in my RTC).
This patch instructs the controller to send an I2C STOP right after
the slave address in case of a zero-byte transfer.

Signed-off-by: Manuel Lauss <mano@roarinelk.homelinux.net>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
2008-01-27 18:14:52 +01:00
Jon Smirl 4bd28ebda2 mpc-i2c: Propagate error values properly
Propagate the error values returned by i2c_wait() instead of overriding
them with a meaningless -1.

Signed-off-by: Jon Smirl <jonsmirl@gmail.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
2008-01-27 18:14:52 +01:00
David Brownell e9f1373b64 i2c: Add i2c_new_dummy() utility
This adds a i2c_new_dummy() primitive to help work with devices
that consume multiple addresses, which include many I2C eeproms
and at least one RTC.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
2008-01-27 18:14:52 +01:00
Jean Delvare 0b987dcd3a i2c: Drop legacy locking in i2c_new_probed_device
It is no longer required to hold adapter->clist_lock to call
i2c_check_addr.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: David Brownell <david-b@pacbell.net>
2008-01-27 18:14:52 +01:00
Jean Delvare 9ddced16bb i2c: Limit locking scope in i2c_detach_client
We only need to hold adapter->clist_lock when we touch the client list.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
2008-01-27 18:14:51 +01:00
David Brownell 86ec5ec872 i2c-remove-redundant-i2c_client-list.patch
This goes on top of the patch removing most i2c_adapter.clients usage,
updating i2c_attach_client:

 - Don't call device_register() while holding clist_lock.  This
   removes a self-deadlock when on the i2c_driver.probe() path,
   for drivers that need to attach new devices (e.g. dummies).

 - Remove a redundant address check.  The driver model core does
   this as a consequence of guaranteeing unique names.

 - Move the "device registered" diagnostic so that it never lies;
   previously, on error paths it would falsely report success.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
2008-01-27 18:14:51 +01:00
Jean Delvare 961f80f9c0 i2c: Drivers stop using the redundant client list
The redundant i2c client list maintained by i2c-core is going away
soon, so drivers should stop using it now. Instead, they can use the
standard iterator provided by the device driver model
(device_for_each_child).

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: David Brownell <david-b@pacbell.net>
Cc: Michael Hunold <michael@mihu.de>
2008-01-27 18:14:51 +01:00
David Brownell 9b766b814d i2c: Stop using the redundant client list
The i2c_adapter.clients list of i2c_client nodes duplicates driver
model state.  This patch starts removing that list, letting us remove
most existing users of those i2c-core lists.

 * The core I2C code now iterates over the driver model's list instead
   of the i2c-internal one in some places where it's safe:
      - Passing a command/ioctl to each client, a mechanims
        used almost exclusively by DVB adapters;
      - Device address checking, in both i2c-core and i2c-dev.

 * Provide i2c_verify_client() to use with driver model iterators.

 * Flag the relevant i2c_adapter and i2c_client fields as deprecated,
   to help prevent new users from appearing.

For the moment the list needs to stick around, since some issues show
up when deleting devices created by legacy I2C drivers.  (They don't
follow standard driver model rules.  Removing those devices can cause
self-deadlocks.)

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
2008-01-27 18:14:51 +01:00
Jean Delvare 0d227a7e72 i2c-viapro: Add support for the VT8237S
Add support for another variant of the VT8237. I couldn't test
I2C block support but I assume it is present as well.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
2008-01-27 18:14:51 +01:00
Jean Delvare 9b7389c0ed i2c-piix4: Drop redundant PCI function number check
Checking the PCI function number doesn't add any value, and it makes
adding dynamic IDs to the driver more difficult. Drop this check.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
2008-01-27 18:14:51 +01:00
Jean Delvare 0f07a24b4b i2c: Let the user specify PCI driver data through new_id
The i2c-amd756 and i2c-viapro drivers make use of the driver_data
field of the PCI device ID. When adding device IDs dynamically (by
writing to the new_id sysfs file) you cannot set the value of this
field by default. It has to be allowed explicitly. Do that, and
check the value so that the user can't crash the kernel accidentally.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-01-27 18:14:51 +01:00
Mike Rapoport b7a3670131 i2c-pxa: Add polling transfer
Add polling I2C transfer implementation for PXA I2C. This is needed
for cases where I2C transactions have to occur at times interrups are
disabled.

Signed-off-by: Mike Rapoport <mike@compulab.co.il>
Acked-by: eric miao <eric.miao@marvell.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
2008-01-27 18:14:50 +01:00
Mike Rapoport cea443a81c i2c: Support i2c_transfer in atomic contexts
Allow i2c_transfer to be called in contexts where sleeping is not allowed.
It is the reponsability of the caller to ensure that the underlying i2c bus
driver will not sleep either.

Signed-off-by: Mike Rapoport <mike@compulab.co.il>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
2008-01-27 18:14:50 +01:00
Jean Delvare 5271071b20 i2c-sibyte: Remove the bus scan module parameter
The implementation is unsafe, and anyway one can achieve the same from
userspace using i2c-dev + i2cdetect.

Also tag i2c_sibyte_add_bus __init.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Ralf Baechle <ralf@linux-mips.org>
2008-01-27 18:14:50 +01:00
Jean Delvare 7bca0871ca i2c: Discard unused driver IDs
Discard all I2C driver IDs that aren't used anywhere. That's not just a
couple of them, but more like 49 or one quarter of all defined IDs! And
this is just a first pass, next will come all IDs that are set but
never used, or used but never set.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
2008-01-27 18:14:50 +01:00
Jean Delvare 6342064cad i2c-i801: Implement I2C block read support
I2C block read is supported since the ICH5. I couldn't get it to work
using the block buffer, so it's using the old-style byte-by-byte mode
for now.

Note: I'm also updating the driver author... The i2c-i801 driver was
really written by Mark Studebaker, even though he based his work on
the i2c-piix4 driver which was written by Philip Edelbrock.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
2008-01-27 18:14:50 +01:00
Jean Delvare a0921b6c07 i2c-i801: Clear special mode bits as needed
Clear special mode bits (PEC, block buffer) at driver load time,
you never know in which state the device was left by its last user.

Also make sure that we reset the block buffer mode at the end of every
transaction, not only when PEC was used.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
2008-01-27 18:14:50 +01:00
Jean Delvare 369f6f4aec i2c-i801: More explicit names for chip features
Use separate flags with explicit names to describe the features of
the ICH chip.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
2008-01-27 18:14:50 +01:00
Jean Delvare ae7b0497b8 i2c-i801: Document which chip support what feature
Provide a clearer documentation of which additional features each
ICH chip support, and which of these the driver supports.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
2008-01-27 18:14:49 +01:00
David Brownell 6d16bfb5e8 i2c/tps65010: move header to <linux/i2c/...>
Move the tps65010 header file from the OMAP arch directory to the
more generic <linux/i2c/...> directory, and remove the spurious
dependency of this driver on OMAP.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
2008-01-27 18:14:49 +01:00
Jean Delvare caada32afe i2c: Rename main mutex
Rename the main mutex in i2c-core from core_lists to core_lock. This
makes more sense now that the redundant lists are gone.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
2008-01-27 18:14:49 +01:00
Jean Delvare 026526f5af i2c: Drop redundant i2c_driver.list
i2c_driver.list is superfluous, this list duplicates the one
maintained by the driver core. Drop it.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>
2008-01-27 18:14:49 +01:00
Jean Delvare 87c6c22945 i2c: Drop redundant i2c_adapter.list
i2c_adapter.list is superfluous, this list duplicates the one
maintained by the driver core. Drop it.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>
2008-01-27 18:14:48 +01:00
Jean Delvare e48d33193d i2c: Change prototypes of refcounting functions
Use more standard prototypes for i2c_use_client() and
i2c_release_client(). The former now returns a pointer to the client,
and the latter no longer returns anything. This matches what all other
subsystems do.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: David Brownell <david-b@pacbell.net>
2008-01-27 18:14:48 +01:00
Jean Delvare bdc511f438 i2c: Use the driver model reference counting
Don't implement our own reference counting mechanism for i2c clients
when the driver model already has one.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: David Brownell <david-b@pacbell.net>
2008-01-27 18:14:48 +01:00
Jean Delvare 0f79b72e45 i2c: Deprecate drivers for I2C buses on video adapters
The framebuffer drivers for these pieces of hardware include support
for the DDC/I2C buses, so there is no need for separate drivers.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
2008-01-27 18:14:47 +01:00