~ubuntu-branches/ubuntu/precise/linux-ti-omap4/precise-security

« back to all changes in this revision

Viewing changes to drivers/input/tablet/wacom_wac.c

  • Committer: Package Import Robot
  • Author(s): Paolo Pisati, Paolo Pisati, Ubuntu: 3.2.0-25.40
  • Date: 2012-05-25 17:50:19 UTC
  • Revision ID: package-import@ubuntu.com-20120525175019-a0pei0ypf9s9brjq
Tags: 3.2.0-1414.19
* Release Tracking Bug
  - LP: #1004555

[ Paolo Pisati ]

* [Config] updateconfigs following rebase
* rebased on 3.2.0-25.40

[ Ubuntu: 3.2.0-25.40 ]

* Release Tracking Bug
  - LP: #1003534
* [Config] control.stub is an intermediate product not a dependancy
  - LP: #992414
* [Config] include include/generated/compile.h
  - LP: #942569
* SAUCE: rtc: pl031: Enable module alias autogeneration for AMBA drivers
  - LP: #1000831
* Revert "SAUCE: ite-cir: postpone ISR registration"
  - LP: #1002484
* SAUCE: async_populate_rootfs: fix build warnings
  - LP: #1003417
* [Config] add highbank flavour
  - LP: #1000831
* SAUCE: apparmor: fix long path failure due to disconnected path
  - LP: #955892
* SAUCE: apparmor: fix profile lookup for unconfined
  - LP: #978038, #987371
* SAUCE: arm highbank: add support for pl320-ipc driver
  - LP: #1000831
* SAUCE: input: add a key driver for highbank
  - LP: #1000831
* SAUCE: ARM: highbank: Add smc calls to enable/disable the L2
  - LP: #1000831
* SAUCE: force DMA buffers to non-bufferable on highbank
  - LP: #1000831
* SAUCE: net: calxedaxgmac: fix net timeout recovery
  - LP: #1000831
* [Config] perarch and indep tools builds need separate build directories
* [Config] CONFIG_XEN_ACPI_PROCESSOR=y
  - LP: #898112
* Revert "autofs: work around unhappy compat problem on x86-64"
  - LP: #1002482
* Input: wacom - cleanup feature report for bamboos
  - LP: #568064
* Input: wacom - remove unused bamboo HID parsing
  - LP: #568064
* Input: wacom - add some comments to wacom_parse_hid
  - LP: #568064
* Input: wacom - relax Bamboo stylus ID check
  - LP: #568064
* Input: wacom - read 3rd gen Bamboo Touch HID data
  - LP: #568064
* Input: wacom - 3rd gen Bamboo P&Touch packet support
  - LP: #568064
* Input: wacom - ignore unwanted bamboo packets
  - LP: #568064
* HID: wacom: Move parsing to a separate function
  - LP: #568064
* HID: wacom: Initial driver for Wacom Intuos4 Wireless (Bluetooth)
  - LP: #568064
* Input: wacom - add support for Cintiq 24HD
  - LP: #568064
* Input: wacom - add LED support for Cintiq 24HD
  - LP: #568064
* Input: wacom - add missing LEDS_CLASS to Kconfig
  - LP: #568064
* Input: wacom - fix 3rd-gen Bamboo MT when 4+ fingers are in use
  - LP: #568064
* power_supply: allow a power supply to explicitly point to powered
  device
  - LP: #568064
* power_supply: add "powers" links to self-powered HID devices
  - LP: #568064
* HID: wiimote: fix invalid power_supply_powers call
  - LP: #568064
* HID: wacom: Fix invalid power_supply_powers calls
  - LP: #568064
* ARM: 7178/1: fault.c: Port OOM changes into do_page_fault
  - LP: #951043
* ARM: 7368/1: fault.c: correct how the tsk->[maj|min]_flt gets
  incremented
  - LP: #951043
* hugepages: fix use after free bug in "quota" handling
  - LP: #990368
  - CVE-2012-2133
* provide disable_cpufreq() function to disable the API.
  - LP: #898112
* xen/acpi-processor: C and P-state driver that uploads said data to
  hypervisor.
  - LP: #898112
* xen/acpi-processor: Do not depend on CPU frequency scaling drivers.
  - LP: #898112
* xen/acpi: Fix Kconfig dependency on CPU_FREQ
  - LP: #898112
* xen/acpi: Remove the WARN's as they just create noise.
  - LP: #898112
* xen/cpufreq: Disable the cpu frequency scaling drivers from loading.
  - LP: #898112
* xen/apic: Return the APIC ID (and version) for CPU 0.
  - LP: #898112
* ARM: highbank: add xgmac ethernet devices to dts
  - LP: #1000831
* net: add calxeda xgmac ethernet driver
  - LP: #1000831
* ARM: versatile: Add missing ENDPROC to headsmp.S
  - LP: #1000831
* ARM: msm: Add missing ENDPROC to headsmp.S
  - LP: #1000831
* ARM: ux500: add missing ENDPROC to headsmp.S
  - LP: #1000831
* ARM: exynos: remove incorrect BSYM usage
  - LP: #1000831
* ARM: imx: remove incorrect BSYM usage
  - LP: #1000831
* ARM: highbank: remove incorrect BSYM usage
  - LP: #1000831
* ARM: make BSYM macro assembly only
  - LP: #1000831
* ARM: amba: Auto-generate AMBA driver module aliases during modpost
  - LP: #1000831
* ARM: amba: Move definition of struct amba_id to mod_devicetable.h
  - LP: #1000831
* dmaengine: pl330: Enable module alias autogeneration for AMBA drivers
  - LP: #1000831
* crypto: sha512 - Fix byte counter overflow in SHA-512
  - LP: #1002482
* ALSA: hda/conexant - Don't set HP pin-control bit unconditionally
  - LP: #1002482
* ALSA: hda/conexant - Set up the missing docking-station pins
  - LP: #1002482
* ARM: clps711x: serial driver hungs are a result of call disable_irq
  within ISR
  - LP: #1002482
* ARM: OMAP1: DMTIMER: fix broken timer clock source selection
  - LP: #1002482
* mmc: fixes for eMMC v4.5 discard operation
  - LP: #1002482
* mmc: fixes for eMMC v4.5 sanitize operation
  - LP: #1002482
* mmc: unbreak sdhci-esdhc-imx on i.MX25
  - LP: #1002482
* xen/gntdev: do not set VM_PFNMAP
  - LP: #1002482
* xen/xenbus: Add quirk to deal with misconfigured backends.
  - LP: #1002482
* USB: yurex: Remove allocation of coherent buffer for setup-packet
  buffer
  - LP: #1002482
* USB: yurex: Fix missing URB_NO_TRANSFER_DMA_MAP flag in urb
  - LP: #1002482
* uwb: fix use of del_timer_sync() in interrupt
  - LP: #1002482
* uwb: fix error handling
  - LP: #1002482
* davinci_mdio: Fix MDIO timeout check
  - LP: #1002482
* mwifiex: update pcie8766 scratch register addresses
  - LP: #1002482
* brcm80211: smac: resume transmit fifo upon receiving frames
  - LP: #1002482
* rc-core: set mode for winbond-cir
  - LP: #1002482
* drxk: Does not unlock mutex if sanity check failed in scu_command()
  - LP: #1002482
* cfg80211: fix interface combinations check.
  - LP: #1002482
* Fix modpost failures in fedora 17
  - LP: #1002482
* mm: fix s390 BUG by __set_page_dirty_no_writeback on swap
  - LP: #1002482
* jbd2: use GFP_NOFS for blkdev_issue_flush
  - LP: #1002482
* USB: serial: cp210x: Fixed usb_control_msg timeout values
  - LP: #1002482
* pch_uart: Fix dma channel unallocated issue
  - LP: #1002482
* drivers/tty/amiserial.c: add missing tty_unlock
  - LP: #1002482
* USB: sierra: avoid QMI/wwan interface on MC77xx
  - LP: #1002482
* EHCI: fix criterion for resuming the root hub
  - LP: #1002482
* EHCI: always clear the STS_FLR status bit
  - LP: #1002482
* USB: fix deadlock in bConfigurationValue attribute method
  - LP: #1002482
* usb: gadget: udc-core: stop UDC on device-initiated disconnect
  - LP: #1002482
* usb: gadget: udc-core: fix asymmetric calls in remove_driver
  - LP: #1002482
* usb: gadget: udc-core: fix wrong call order
  - LP: #1002482
* usb: gadget: udc-core: fix incompatibility with dummy-hcd
  - LP: #1002482
* usb: gadget: eliminate NULL pointer dereference (bugfix)
  - LP: #1002482
* usb: musb: omap: fix crash when musb glue (omap) gets initialized
  - LP: #1002482
* usb: musb: omap: fix the error check for pm_runtime_get_sync
  - LP: #1002482
* PCI: Add quirk for still enabled interrupts on Intel Sandy Bridge GPUs
  - LP: #1002482
* ext4: fix endianness breakage in ext4_split_extent_at()
  - LP: #1002482
* KVM: unmap pages from the iommu when slots are removed
  - LP: #1002482
* dell-laptop: add 3 machines that has touchpad LED
  - LP: #1002482
* dell-laptop: touchpad LED should persist its status after S3
  - LP: #1002482
* Bluetooth: Add support for Atheros [04ca:3005]
  - LP: #1002482
* Don't limit non-nested epoll paths
  - LP: #1002482
* spi: Fix device unregistration when unregistering the bus master
  - LP: #1002482
* spi/mpc83xx: fix NULL pdata dereference bug
  - LP: #1002482
* rt2800: Add support for the Fujitsu Stylistic Q550
  - LP: #1002482
* rt2x00: Identify rt2800usb chipsets.
  - LP: #1002482
* nfsd: fix b0rken error value for setattr on read-only mount
  - LP: #1002482
* nfsd: fix error values returned by nfsd4_lockt() when nfsd_open() fails
  - LP: #1002482
* nfsd: fix endianness breakage in TEST_STATEID handling
  - LP: #1002482
* nfsd: fix compose_entry_fh() failure exits
  - LP: #1002482
* btrfs: btrfs_root_readonly() broken on big-endian
  - LP: #1002482
* ocfs2: ->l_next_free_req breakage on big-endian
  - LP: #1002482
* ocfs: ->rl_used breakage on big-endian
  - LP: #1002482
* ocfs2: ->rl_count endianness breakage
  - LP: #1002482
* ocfs2: ->e_leaf_clusters endianness breakage
  - LP: #1002482
* lockd: fix the endianness bug
  - LP: #1002482
* usb: dwc3: ep0: increment "actual" on bounced ep0 case
  - LP: #1002482
* net: fix /proc/net/dev regression
  - LP: #1002482
* nfsd: don't fail unchecked creates of non-special files
  - LP: #1002482
* ppp: Don't stop and restart queue on every TX packet
  - LP: #1002482
* tcp: allow splice() to build full TSO packets
  - LP: #1002482
* sctp: Allow struct sctp_event_subscribe to grow without breaking
  binaries
  - LP: #1002482
* bridge: Do not send queries on multicast group leaves
  - LP: #1002482
* ipv6: fix array index in ip6_mc_add_src()
  - LP: #1002482
* phonet: Check input from user before allocating
  - LP: #1002482
* bonding: properly unset current_arp_slave on slave link up
  - LP: #1002482
* wimax: i2400m - prevent a possible kernel bug due to missing fw_name
  string
  - LP: #1002482
* netlink: fix races after skb queueing
  - LP: #1002482
* net: fix a race in sock_queue_err_skb()
  - LP: #1002482
* tcp: fix tcp_rcv_rtt_update() use of an unscaled RTT sample
  - LP: #1002482
* net: allow pskb_expand_head() to get maximum tailroom
  - LP: #1002482
* tcp: fix tcp_trim_head()
  - LP: #1002482
* tcp: avoid order-1 allocations on wifi and tx path
  - LP: #1002482
* atl1: fix kernel panic in case of DMA errors
  - LP: #1002482
* 8139cp: set intr mask after its handler is registered
  - LP: #1002482
* net: smsc911x: fix skb handling in receive path
  - LP: #1002482
* net/ethernet: ks8851_mll fix rx frame buffer overflow
  - LP: #1002482
* net_sched: gred: Fix oops in gred_dump() in WRED mode
  - LP: #1002482
* net: usb: smsc75xx: fix mtu
  - LP: #1002482
* dummy: Add ndo_uninit().
  - LP: #1002482
* tcp: fix tcp_grow_window() for large incoming frames
  - LP: #1002482
* netns: do not leak net_generic data on failed init
  - LP: #1002482
* ksz884x: don't copy too much in netdev_set_mac_address()
  - LP: #1002482
* net ax25: Reorder ax25_exit to remove races.
  - LP: #1002482
* tcp: fix TCP_MAXSEG for established IPv6 passive sockets
  - LP: #1002482
* nfs: Enclose hostname in brackets when needed in nfs_do_root_mount
  - LP: #1002482
* NFS: put open context on error in nfs_pagein_multi
  - LP: #1002482
* NFS: put open context on error in nfs_flush_multi
  - LP: #1002482
* x86, microcode: Fix sysfs warning during module unload on unsupported
  CPUs
  - LP: #1002482
* x86, apic: APIC code touches invalid MSR on P5 class machines
  - LP: #1002482
* xen: correctly check for pending events when restoring irq flags
  - LP: #1002482
* xen/smp: Fix crash when booting with ACPI hotplug CPUs.
  - LP: #1002482
* ASoC: dapm: Ensure power gets managed for line widgets
  - LP: #1002482
* ASoC: wm8994: Improve sequencing of AIF channel enables
  - LP: #1002482
* dmaengine: at_hdmac: remove clear-on-read in atc_dostart()
  - LP: #1002482
* sched: Fix OOPS when build_sched_domains() percpu allocation fails
  - LP: #1002482
* tracing: Fix stacktrace of latency tracers (irqsoff and friends)
  - LP: #1002482
* hwmon: fam15h_power: fix bogus values with current BIOSes
  - LP: #1002482
* hwmon: (fam15h_power) Fix pci_device_id array
  - LP: #1002482
* dell-laptop: Terminate quirks list properly
  - LP: #1002482
* drm/radeon/kms: need to set up ss on DP bridges as well
  - LP: #1002482
* drm/i915: handle input/output sdvo timings separately in mode_set
  - LP: #1002482
* drm/i915: relative_constants_mode race fix
  - LP: #1002482
* drm/i915: Force sync command ordering (Gen6+)
  - LP: #1002482
* drm/i915: Set the Stencil Cache eviction policy to non-LRA mode.
  - LP: #1002482
* drm/i915: fix integer overflow in i915_gem_execbuffer2()
  - LP: #1002482
* drm/i915: fix integer overflow in i915_gem_do_execbuffer()
  - LP: #1002482
* nl80211: ensure interface is up in various APIs
  - LP: #1002482
* ALSA: HDA: Add external mic quirk for Asus Zenbook UX31E
  - LP: #1002482, #950490
* USB: cdc-wdm: fix race leading leading to memory corruption
  - LP: #1002482
* USB: EHCI: fix crash during suspend on ASUS computers
  - LP: #1002482
* USB: gadget: storage gadgets send wrong error code for unknown commands
  - LP: #1002482
* usb: gadget: dummy: do not call pullup() on udc_stop()
  - LP: #1002482
* usb gadget: uvc: uvc_request_data::length field must be signed
  - LP: #1002482
* pipes: add a "packetized pipe" mode for writing
  - LP: #1002482
* autofs: make the autofsv5 packet file descriptor use a packetized pipe
  - LP: #1002482
* ARM: 7396/1: errata: only handle ARM erratum #326103 on affected cores
  - LP: #1002482
* ARM: 7397/1: l2x0: only apply workaround for erratum #753970 on PL310
  - LP: #1002482
* ARM: 7398/1: l2x0: only write to debug registers on PL310
  - LP: #1002482
* ARM: 7403/1: tls: remove covert channel via TPIDRURW
  - LP: #1002482
* ARM: 7406/1: hotplug: copy the affinity mask when forcefully migrating
  IRQs
  - LP: #1002482
* libsas: fix sas_find_bcast_phy() in the presence of 'vacant' phys
  - LP: #1002482
* libsas: fix false positive 'device attached' conditions
  - LP: #1002482
* efi: Add new variable attributes
  - LP: #1002482
* efi: Validate UEFI boot variables
  - LP: #1002482
* PM / Hibernate: fix the number of pages used for hibernate/thaw
  buffering
  - LP: #1002482
* drm/i915: enable dip before writing data on gen4
  - LP: #1002482
* efivars: Improve variable validation
  - LP: #1002482
* fs/cifs: fix parsing of dfs referrals
  - LP: #1002482
* Fix __read_seqcount_begin() to use ACCESS_ONCE for sequence value read
  - LP: #1002482
* hwmon: (coretemp) Increase CPU core limit
  - LP: #1002482
* nouveau: initialise has_optimus variable.
  - LP: #1002482
* hwmon: (coretemp) fix oops on cpu unplug
  - LP: #1002482
* libata: skip old error history when counting probe trials
  - LP: #1002482
* b43: only reload config after successful initialization
  - LP: #1002482, #950295
* i2c: pnx: Disable clk in suspend
  - LP: #1002482
* ipw2200: Fix race condition in the command completion acknowledge
  - LP: #1002482
* mac80211: fix AP mode EAP tx for VLAN stations
  - LP: #1002482
* rtlwifi: Fix oops on unload
  - LP: #1002482
* wl1251: fix crash on remove due to premature kfree
  - LP: #1002482
* wl1251: fix crash on remove due to leftover work item
  - LP: #1002482
* iwlwifi: do not nulify ctx->vif on reset
  - LP: #1002482
* iwlwifi: fix hardware queue programming
  - LP: #1002482
* hfsplus: Fix potential buffer overflows
  - LP: #1002482
* ASoC: tlv312aic23: unbreak resume
  - LP: #1002482
* asm-generic: Use __BITS_PER_LONG in statfs.h
  - LP: #1002482
* x86, relocs: Remove an unused variable
  - LP: #1002482
* ARM: 7410/1: Add extra clobber registers for assembly in kernel_execve
  - LP: #1002482
* ARM: 7414/1: SMP: prevent use of the console when using idmap_pgd
  - LP: #1002482
* drm/i915: disable sdvo hotplug on i945g/gm
  - LP: #1002482
* drm/i915: Do no set Stencil Cache eviction LRA w/a on gen7+
  - LP: #1002482
* xen/pte: Fix crashes when trying to see non-existent PGD/PMD/PUD/PTEs
  - LP: #1002482
* xen/pci: don't use PCI BIOS service for configuration space accesses
  - LP: #1002482
* percpu, x86: don't use PMD_SIZE as embedded atom_size on 32bit
  - LP: #1002482
* iwlagn: allow up to uCode API 6 for 6000 devices
  - LP: #1002482
* iwlwifi: use correct released ucode version
  - LP: #1002482
* iwlwifi: use 6000G2B for 6030 device series
  - LP: #1002482
* exit_signal: simplify the "we have changed execution domain" logic
  - LP: #1002482
* exit_signal: fix the "parent has changed security domain" logic
  - LP: #1002482
* staging: r8712u: Fix regression caused by commit 8c213fa
  - LP: #1002482
* smsc95xx: mark link down on startup and let PHY interrupt deal with
  carrier changes
  - LP: #1002482
* Linux 3.2.17
  - LP: #1002482
* regulator: Fix the logic to ensure new voltage setting in valid range
  - LP: #1002484
* ARM: OMAP: Revert "ARM: OMAP: ctrl: Fix CONTROL_DSIPHY register fields"
  - LP: #1002484
* ALSA: echoaudio: Remove incorrect part of assertion
  - LP: #1002484
* ARM: orion5x: Fix GPIO enable bits for MPP9
  - LP: #1002484
* ALSA: HDA: Lessen CPU usage when waiting for chip to respond
  - LP: #1002484
* percpu: pcpu_embed_first_chunk() should free unused parts after all
  allocs are complete
  - LP: #1002484
* hugetlb: prevent BUG_ON in hugetlb_fault() -> hugetlb_cow()
  - LP: #1002484
* namespaces, pid_ns: fix leakage on fork() failure
  - LP: #1002484
* mm: nobootmem: fix sign extend problem in __free_pages_memory()
  - LP: #1002484
* asix: Fix tx transfer padding for full-speed USB
  - LP: #1002484
* netem: fix possible skb leak
  - LP: #1002484
* net: In unregister_netdevice_notifier unregister the netdevices.
  - LP: #1002484
* net: l2tp: unlock socket lock before returning from l2tp_ip_sendmsg
  - LP: #1002484
* sky2: propogate rx hash when packet is copied
  - LP: #1002484
* sky2: fix receive length error in mixed non-VLAN/VLAN traffic
  - LP: #1002484
* sungem: Fix WakeOnLan
  - LP: #1002484
* tg3: Avoid panic from reserved statblk field access
  - LP: #1002484
* tcp: fix infinite cwnd in tcp_complete_cwr()
  - LP: #1002484
* tcp: change tcp_adv_win_scale and tcp_rmem[2]
  - LP: #1002484
* brcm80211: smac: pass missing argument to 'brcms_b_mute'
  - LP: #1002484
* phy:icplus:fix Auto Power Saving in ip101a_config_init.
  - LP: #1002484
* NFSv4: Revalidate uid/gid after open
  - LP: #1002484
* target: Drop incorrect se_lun_acl release for dynamic -> explict ACL
  conversion
  - LP: #1002484
* marvell-cam: fix an ARM build error
  - LP: #1002484
* rc: Postpone ISR registration
  - LP: #1002484
* cdc_ether: Ignore bogus union descriptor for RNDIS devices
  - LP: #1002484
* jffs2: Fix lock acquisition order bug in gc path
  - LP: #1002484
* s5p-fimc: Fix locking in subdev set_crop op
  - LP: #1002484
* dm mpath: check if scsi_dh module already loaded before trying to load
  - LP: #1002484
* sparc64: Do not clobber %g2 in xcall_fetch_glob_regs().
  - LP: #1002484
* gpio: Add missing spin_lock_init in gpio-ml-ioh driver
  - LP: #1002484
* spi-topcliff-pch: Modify pci-bus number dynamically to get DMA device
  info
  - LP: #1002484
* spi-topcliff-pch: Fix issue for transmitting over 4KByte
  - LP: #1002484
* spi-topcliff-pch: supports a spi mode setup and bit order setup by IO
  control
  - LP: #1002484
* spi-topcliff-pch: add recovery processing in case wait-event timeout
  - LP: #1002484
* ext4: avoid deadlock on sync-mounted FS w/o journal
  - LP: #1002484
* ia64: Add accept4() syscall
  - LP: #1002484
* brcm80211: smac: fix endless retry of A-MPDU transmissions
  - LP: #1002484
* ARM: 7417/1: vfp: ensure preemption is disabled when enabling VFP
  access
  - LP: #1002484
* target: Fix SPC-2 RELEASE bug for multi-session iSCSI client setups
  - LP: #1002484
* crypto: mv_cesa requires on CRYPTO_HASH to build
  - LP: #1002484
* ALSA: hda/idt - Fix power-map for speaker-pins with some HP laptops
  - LP: #1002484
* ASoC: wm8994: Fix AIF2ADC power down
  - LP: #1002484
* usbnet: fix skb traversing races during unlink(v2)
  - LP: #1002484
* cdc_ether: add Novatel USB551L device IDs for FLAG_WWAN
  - LP: #1002484
* ARM: prevent VM_GROWSDOWN mmaps extending below FIRST_USER_ADDRESS
  - LP: #1002484
* arch/tile: apply commit 74fca9da0 to the compat signal handling as well
  - LP: #1002484
* MD: Add del_timer_sync to mddev_suspend (fix nasty panic)
  - LP: #1002484
* target: Fix bug in handling of FILEIO + block_device resize ops
  - LP: #1002484
* tcp: do_tcp_sendpages() must try to push data out on oom conditions
  - LP: #1002484
* e1000: Prevent reset task killing itself.
  - LP: #1002484
* pktgen: fix crash at module unload
  - LP: #1002484
* pktgen: fix module unload for good
  - LP: #1002484
* Linux 3.2.18
  - LP: #1002484
* thinkpad-acpi: recognize Lenovo as version string in newer V-series
  BIOS
  - LP: #1002920
* dl2k: Clean up rio_ioctl
  - CVE-2012-2313

Show diffs side-by-side

added added

removed removed

Lines of Context:
452
452
        if ((data[1] & 0xb8) == 0xa0) {
453
453
                t = (data[6] << 2) | ((data[7] >> 6) & 3);
454
454
                if ((features->type >= INTUOS4S && features->type <= INTUOS4L) ||
455
 
                    features->type == WACOM_21UX2) {
 
455
                    features->type == WACOM_21UX2 || features->type == WACOM_24HD) {
456
456
                        t = (t << 1) | (data[1] & 1);
457
457
                }
458
458
                input_report_abs(input, ABS_PRESSURE, t);
519
519
                                input_report_key(input, wacom->tool[1], 0);
520
520
                                input_report_abs(input, ABS_MISC, 0);
521
521
                        }
 
522
                } else if (features->type == WACOM_24HD) {
 
523
                        input_report_key(input, BTN_0, (data[6] & 0x01));
 
524
                        input_report_key(input, BTN_1, (data[6] & 0x02));
 
525
                        input_report_key(input, BTN_2, (data[6] & 0x04));
 
526
                        input_report_key(input, BTN_3, (data[6] & 0x08));
 
527
                        input_report_key(input, BTN_4, (data[6] & 0x10));
 
528
                        input_report_key(input, BTN_5, (data[6] & 0x20));
 
529
                        input_report_key(input, BTN_6, (data[6] & 0x40));
 
530
                        input_report_key(input, BTN_7, (data[6] & 0x80));
 
531
                        input_report_key(input, BTN_8, (data[8] & 0x01));
 
532
                        input_report_key(input, BTN_9, (data[8] & 0x02));
 
533
                        input_report_key(input, BTN_A, (data[8] & 0x04));
 
534
                        input_report_key(input, BTN_B, (data[8] & 0x08));
 
535
                        input_report_key(input, BTN_C, (data[8] & 0x10));
 
536
                        input_report_key(input, BTN_X, (data[8] & 0x20));
 
537
                        input_report_key(input, BTN_Y, (data[8] & 0x40));
 
538
                        input_report_key(input, BTN_Z, (data[8] & 0x80));
 
539
 
 
540
                        /*
 
541
                         * Three "buttons" are available on the 24HD which are
 
542
                         * physically implemented as a touchstrip. Each button
 
543
                         * is approximately 3 bits wide with a 2 bit spacing.
 
544
                         * The raw touchstrip bits are stored at:
 
545
                         *    ((data[3] & 0x1f) << 8) | data[4])
 
546
                         */
 
547
                        input_report_key(input, KEY_PROG1, data[4] & 0x07);
 
548
                        input_report_key(input, KEY_PROG2, data[4] & 0xE0);
 
549
                        input_report_key(input, KEY_PROG3, data[3] & 0x1C);
 
550
 
 
551
                        if (data[1] & 0x80) {
 
552
                                input_report_abs(input, ABS_WHEEL, (data[1] & 0x7f));
 
553
                        } else {
 
554
                                /* Out of proximity, clear wheel value. */
 
555
                                input_report_abs(input, ABS_WHEEL, 0);
 
556
                        }
 
557
 
 
558
                        if (data[2] & 0x80) {
 
559
                                input_report_abs(input, ABS_THROTTLE, (data[2] & 0x7f));
 
560
                        } else {
 
561
                                /* Out of proximity, clear second wheel value. */
 
562
                                input_report_abs(input, ABS_THROTTLE, 0);
 
563
                        }
 
564
 
 
565
                        if (data[1] | data[2] | (data[3] & 0x1f) | data[4] | data[6] | data[8]) {
 
566
                                input_report_key(input, wacom->tool[1], 1);
 
567
                                input_report_abs(input, ABS_MISC, PAD_DEVICE_ID);
 
568
                        } else {
 
569
                                input_report_key(input, wacom->tool[1], 0);
 
570
                                input_report_abs(input, ABS_MISC, 0);
 
571
                        }
522
572
                } else {
523
573
                        if (features->type == WACOM_21UX2) {
524
574
                                input_report_key(input, BTN_0, (data[5] & 0x01));
799
849
        unsigned char *data = wacom->data;
800
850
        int i;
801
851
 
 
852
        if (data[0] != 0x02)
 
853
            return 0;
 
854
 
802
855
        for (i = 0; i < 2; i++) {
803
856
                int offset = (data[1] & 0x80) ? (8 * i) : (9 * i);
804
857
                bool touch = data[offset + 3] & 0x80;
837
890
        return 0;
838
891
}
839
892
 
 
893
static void wacom_bpt3_touch_msg(struct wacom_wac *wacom, unsigned char *data)
 
894
{
 
895
        struct input_dev *input = wacom->input;
 
896
        int slot_id = data[0] - 2;  /* data[0] is between 2 and 17 */
 
897
        bool touch = data[1] & 0x80;
 
898
 
 
899
        touch = touch && !wacom->shared->stylus_in_proximity;
 
900
 
 
901
        input_mt_slot(input, slot_id);
 
902
        input_mt_report_slot_state(input, MT_TOOL_FINGER, touch);
 
903
 
 
904
        if (touch) {
 
905
                int x = (data[2] << 4) | (data[4] >> 4);
 
906
                int y = (data[3] << 4) | (data[4] & 0x0f);
 
907
                int w = data[6];
 
908
 
 
909
                input_report_abs(input, ABS_MT_POSITION_X, x);
 
910
                input_report_abs(input, ABS_MT_POSITION_Y, y);
 
911
                input_report_abs(input, ABS_MT_TOUCH_MAJOR, w);
 
912
        }
 
913
}
 
914
 
 
915
static void wacom_bpt3_button_msg(struct wacom_wac *wacom, unsigned char *data)
 
916
{
 
917
        struct input_dev *input = wacom->input;
 
918
 
 
919
        input_report_key(input, BTN_LEFT, (data[1] & 0x08) != 0);
 
920
        input_report_key(input, BTN_FORWARD, (data[1] & 0x04) != 0);
 
921
        input_report_key(input, BTN_BACK, (data[1] & 0x02) != 0);
 
922
        input_report_key(input, BTN_RIGHT, (data[1] & 0x01) != 0);
 
923
}
 
924
 
 
925
static int wacom_bpt3_touch(struct wacom_wac *wacom)
 
926
{
 
927
        struct input_dev *input = wacom->input;
 
928
        unsigned char *data = wacom->data;
 
929
        int count = data[1] & 0x07;
 
930
        int i;
 
931
 
 
932
        if (data[0] != 0x02)
 
933
            return 0;
 
934
 
 
935
        /* data has up to 7 fixed sized 8-byte messages starting at data[2] */
 
936
        for (i = 0; i < count; i++) {
 
937
                int offset = (8 * i) + 2;
 
938
                int msg_id = data[offset];
 
939
 
 
940
                if (msg_id >= 2 && msg_id <= 17)
 
941
                        wacom_bpt3_touch_msg(wacom, data + offset);
 
942
                else if (msg_id == 128)
 
943
                        wacom_bpt3_button_msg(wacom, data + offset);
 
944
 
 
945
        }
 
946
 
 
947
        input_mt_report_pointer_emulation(input, true);
 
948
 
 
949
        input_sync(input);
 
950
 
 
951
        return 0;
 
952
}
 
953
 
840
954
static int wacom_bpt_pen(struct wacom_wac *wacom)
841
955
{
842
956
        struct input_dev *input = wacom->input;
843
957
        unsigned char *data = wacom->data;
844
958
        int prox = 0, x = 0, y = 0, p = 0, d = 0, pen = 0, btn1 = 0, btn2 = 0;
845
959
 
846
 
        /*
847
 
         * Similar to Graphire protocol, data[1] & 0x20 is proximity and
848
 
         * data[1] & 0x18 is tool ID.  0x30 is safety check to ignore
849
 
         * 2 unused tool ID's.
850
 
         */
851
 
        prox = (data[1] & 0x30) == 0x30;
 
960
        if (data[0] != 0x02)
 
961
            return 0;
 
962
 
 
963
        prox = (data[1] & 0x20) == 0x20;
852
964
 
853
965
        /*
854
966
         * All reports shared between PEN and RUBBER tool must be
912
1024
{
913
1025
        if (len == WACOM_PKGLEN_BBTOUCH)
914
1026
                return wacom_bpt_touch(wacom);
915
 
        else if (len == WACOM_PKGLEN_BBFUN)
 
1027
        else if (len == WACOM_PKGLEN_BBTOUCH3)
 
1028
                return wacom_bpt3_touch(wacom);
 
1029
        else if (len == WACOM_PKGLEN_BBFUN || len == WACOM_PKGLEN_BBPEN)
916
1030
                return wacom_bpt_pen(wacom);
917
1031
 
918
1032
        return 0;
955
1069
        case CINTIQ:
956
1070
        case WACOM_BEE:
957
1071
        case WACOM_21UX2:
 
1072
        case WACOM_24HD:
958
1073
                sync = wacom_intuos_irq(wacom_wac);
959
1074
                break;
960
1075
 
1031
1146
            features->type == BAMBOO_PT)
1032
1147
                features->quirks |= WACOM_QUIRK_MULTI_INPUT;
1033
1148
 
1034
 
        /* quirks for bamboo touch */
 
1149
        /* quirk for bamboo touch with 2 low res touches */
1035
1150
        if (features->type == BAMBOO_PT &&
1036
 
            features->device_type == BTN_TOOL_DOUBLETAP) {
 
1151
            features->pktlen == WACOM_PKGLEN_BBTOUCH) {
1037
1152
                features->x_max <<= 5;
1038
1153
                features->y_max <<= 5;
1039
1154
                features->x_fuzz <<= 5;
1110
1225
                __set_bit(INPUT_PROP_POINTER, input_dev->propbit);
1111
1226
                break;
1112
1227
 
 
1228
        case WACOM_24HD:
 
1229
                __set_bit(BTN_A, input_dev->keybit);
 
1230
                __set_bit(BTN_B, input_dev->keybit);
 
1231
                __set_bit(BTN_C, input_dev->keybit);
 
1232
                __set_bit(BTN_X, input_dev->keybit);
 
1233
                __set_bit(BTN_Y, input_dev->keybit);
 
1234
                __set_bit(BTN_Z, input_dev->keybit);
 
1235
 
 
1236
                for (i = 0; i < 10; i++)
 
1237
                        __set_bit(BTN_0 + i, input_dev->keybit);
 
1238
 
 
1239
                __set_bit(KEY_PROG1, input_dev->keybit);
 
1240
                __set_bit(KEY_PROG2, input_dev->keybit);
 
1241
                __set_bit(KEY_PROG3, input_dev->keybit);
 
1242
 
 
1243
                input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0);
 
1244
                input_set_abs_params(input_dev, ABS_THROTTLE, 0, 71, 0, 0);
 
1245
                wacom_setup_cintiq(wacom_wac);
 
1246
                break;
 
1247
 
1113
1248
        case WACOM_21UX2:
1114
1249
                __set_bit(BTN_A, input_dev->keybit);
1115
1250
                __set_bit(BTN_B, input_dev->keybit);
1240
1375
                        __set_bit(BTN_TOOL_FINGER, input_dev->keybit);
1241
1376
                        __set_bit(BTN_TOOL_DOUBLETAP, input_dev->keybit);
1242
1377
 
1243
 
                        input_mt_init_slots(input_dev, 2);
 
1378
                        if (features->pktlen == WACOM_PKGLEN_BBTOUCH3) {
 
1379
                                __set_bit(BTN_TOOL_TRIPLETAP,
 
1380
                                          input_dev->keybit);
 
1381
                                __set_bit(BTN_TOOL_QUADTAP,
 
1382
                                          input_dev->keybit);
 
1383
 
 
1384
                                input_mt_init_slots(input_dev, 16);
 
1385
 
 
1386
                                input_set_abs_params(input_dev,
 
1387
                                                     ABS_MT_TOUCH_MAJOR,
 
1388
                                                     0, 255, 0, 0);
 
1389
                        } else {
 
1390
                                input_mt_init_slots(input_dev, 2);
 
1391
                        }
 
1392
 
1244
1393
                        input_set_abs_params(input_dev, ABS_MT_POSITION_X,
1245
1394
                                             0, features->x_max,
1246
1395
                                             features->x_fuzz, 0);
1425
1574
static const struct wacom_features wacom_features_0xBC =
1426
1575
        { "Wacom Intuos4 WL",     WACOM_PKGLEN_INTUOS,    40840, 25400, 2047,
1427
1576
          63, INTUOS4, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES };
 
1577
static const struct wacom_features wacom_features_0xF4 =
 
1578
        { "Wacom Cintiq 24HD",    WACOM_PKGLEN_INTUOS,   104480, 65600, 2047,
 
1579
          63, WACOM_24HD, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES };
1428
1580
static const struct wacom_features wacom_features_0x3F =
1429
1581
        { "Wacom Cintiq 21UX",    WACOM_PKGLEN_INTUOS,    87200, 65600, 1023,
1430
1582
          63, CINTIQ, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES };
1509
1661
static struct wacom_features wacom_features_0xDB =
1510
1662
        { "Wacom Bamboo 2FG 6x8 SE", WACOM_PKGLEN_BBFUN,  21648, 13700, 1023,
1511
1663
          31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
 
1664
static const struct wacom_features wacom_features_0xDD =
 
1665
        { "Wacom Bamboo Connect", WACOM_PKGLEN_BBPEN,     14720,  9200, 1023,
 
1666
          31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
 
1667
static const struct wacom_features wacom_features_0xDE =
 
1668
        { "Wacom Bamboo 16FG 4x5", WACOM_PKGLEN_BBPEN,    14720,  9200, 1023,
 
1669
          31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
 
1670
static const struct wacom_features wacom_features_0xDF =
 
1671
        { "Wacom Bamboo 16FG 6x8", WACOM_PKGLEN_BBPEN,    21648, 13700, 1023,
 
1672
          31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
1512
1673
static const struct wacom_features wacom_features_0x6004 =
1513
1674
        { "ISD-V4",               WACOM_PKGLEN_GRAPHIRE,  12800,  8000,  255,
1514
1675
          0, TABLETPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
1604
1765
        { USB_DEVICE_WACOM(0xD8) },
1605
1766
        { USB_DEVICE_WACOM(0xDA) },
1606
1767
        { USB_DEVICE_WACOM(0xDB) },
 
1768
        { USB_DEVICE_WACOM(0xDD) },
 
1769
        { USB_DEVICE_WACOM(0xDE) },
 
1770
        { USB_DEVICE_WACOM(0xDF) },
1607
1771
        { USB_DEVICE_WACOM(0xF0) },
1608
1772
        { USB_DEVICE_WACOM(0xCC) },
1609
1773
        { USB_DEVICE_WACOM(0x90) },
1616
1780
        { USB_DEVICE_WACOM(0xE6) },
1617
1781
        { USB_DEVICE_WACOM(0xEC) },
1618
1782
        { USB_DEVICE_WACOM(0x47) },
 
1783
        { USB_DEVICE_WACOM(0xF4) },
1619
1784
        { USB_DEVICE_LENOVO(0x6004) },
1620
1785
        { }
1621
1786
};