~ubuntu-branches/ubuntu/quantal/linux-ti-omap4/quantal

« back to all changes in this revision

Viewing changes to drivers/usb/serial/mos7840.c

  • Committer: Package Import Robot
  • Author(s): Leann Ogasawara, Paolo Pisati, Upstream Kernel Changes, Ubuntu: 3.2.0-23.36, Ubuntu: 3.2.0-22.35, Ubuntu: 3.2.0-21.34, Ubuntu: 3.2.0-20.33, Ubuntu: 3.2.0-20.32, Ubuntu: 3.2.0-19.31, Ubuntu: 3.2.0-19.30
  • Date: 2012-04-11 14:56:02 UTC
  • Revision ID: package-import@ubuntu.com-20120411145602-75ng3xbknr504ecz
Tags: 3.2.0-1412.15
[ Paolo Pisati ]

* [Config] Sync fs with master (AUFS, CODA, EXT2, LOGFS and NFS)
* [Config] Sync core subsys with master (ATA and HID)
* [Config] sync ata drivers with master
* [Config] sync input drivers with master
* [Config] Sync HID drivers with master
* [Config] Sync sensors wrt master
* [Config] Sync crypto wrt master
* [Config] Sync dangerous options wrt master
* [Config] Sync Industrial IO wrt master
* [Config] Sync backlight drivers wrt master
* [Config] Sync charger drivers wrt master
* [Config] Sync dvb drivers wrt master
* [Config] Sync pcmcia net drivers wrt master
* [Config] updateconfigs following rebase
* blend upstream hdmi detection code and TI bits
  - LP: #963512
* [Config] disable omap4 camera interface
  - LP: #924419
* rebased on 3.2.0-23.36

[ Upstream Kernel Changes ]

* coda: compilation fix

[ Ubuntu: 3.2.0-23.36 ]

* tools/hv: add basic Makefile
  - LP: #977246
* tools/hv: add basic manual pages
  - LP: #977246
* Hyper-V KVP daemon -- add to the tools package
  - LP: #977246
* SAUCE: (drop after 3.3) ALSA: HDA: Remove quirk for Gigabyte
  GA-H61M-S2PV
  - LP: #948360
* d-i: Add dm-mirror and dm-raid to md-modules
  - LP: #919281
* [Config] Fix invalid linux-headers link
  - LP: #974403
* Remove headers asm symlink entirely
  - LP: #974403
* Revert "x86/ioapic: Add register level checks to detect bogus io-apic
  entries"
  - LP: #974982
* ALSA: HDA: Realtek: Take vmaster dac from multiout dac list
  - LP: #974090
* kexec: remove KMSG_DUMP_KEXEC
  - LP: #944772
* kmsg_dump: don't run on non-error paths by default
  - LP: #944772
* pstore: Introduce get_reason_str() to pstore
  - LP: #944772

[ Ubuntu: 3.2.0-22.35 ]

* Revert "SAUCE: hotkey quirks for various Zeptro Znote and Fujitsu Amilo
  laptops"
* SAUCE: (no-up) elide some ioctl warnings which are known benign
  - LP: #972355
* SAUCE (no-up) Provide a param for allowing the BIOS to handle changing
  the brightness on AC/battery status changes.
  - LP: #949311
* SAUCE (drop after 3.4) Quirk for enabling backlight hotkeys on Samsung
  N150P
  - LP: #875893
* SAUCE: PCI: Allow pcie_aspm=force to work even when FADT indicates it
  is unsupported
  - LP: #962038
* SAUCE: (drop after 3.5) drm/i915: reinstate GM45 TV detection fix
  - LP: #638939
* SAUCE: SECCOMP: audit: always report seccomp violations
* SAUCE: SECCOMP: adjust prctl constant
* [Config] Enable CONFIG_USBIP_CORE=m
  - LP: #900384
* Rebase to v3.2.14
* [Config] Updateconfigs after rebase to v3.2.14
* d-i: Fix module name for dm-raid45
  - LP: #969248
* SAUCE: remove __initdata from vesafb_fix
  - LP: #969309
* Revert "sched: tg->se->load should be initialised to tg->shares"
* toshiba_acpi: make one-bit bitfields unsigned
  - LP: #810015
* ACPI: EC: Add ec_get_handle()
  - LP: #810015
* toshiba_acpi: Support alternate hotkey interfaces
  - LP: #810015
* toshiba_acpi: Support additional hotkey scancodes
  - LP: #810015
* toshiba_acpi: Refuse to load on machines with buggy INFO
  implementations
  - LP: #810015
* ata_piix: Add Toshiba Satellite Pro A120 to the quirks list due to
  broken suspend functionality.
  - LP: #886850
* sweep the floors and convert some .get_drvinfo routines to strlcpy
  - LP: #921793
* be2net: init (vf)_if_handle/vf_pmac_id to handle failure scenarios
  - LP: #921793
* be2net: stop checking the UE registers after an EEH error
  - LP: #921793
* be2net: don't log more than one error on detecting EEH/UE errors
  - LP: #921793
* be2net: stop issuing FW cmds if any cmd times out
  - LP: #921793
* be2net: Fix TX queue create for Lancer
  - LP: #921793
* be2net: add register dump feature for Lancer
  - LP: #921793
* be2net: Add EEPROM dump feature for Lancer
  - LP: #921793
* be2net: Fix VLAN promiscous mode for Lancer
  - LP: #921793
* be2net: Use V1 query link status command for lancer
  - LP: #921793
* be2net: Move to new SR-IOV implementation in Lancer
  - LP: #921793
* be2net: Fix error recovery paths
  - LP: #921793
* be2net: Add error handling for Lancer
  - LP: #921793
* be2net: Use new hash key
  - LP: #921793
* be2net: Fix non utilization of RX queues
  - LP: #921793
* be2net: netpoll support
  - LP: #921793
* be2net: update some counters to display via ethtool
  - LP: #921793
* be2net: workaround to fix a bug in BE
  - LP: #921793
* be2net: fix ethtool ringparam reporting
  - LP: #921793
* be2net: refactor/cleanup vf configuration code
  - LP: #921793
* be2net: Add support for Skyhawk cards
  - LP: #921793
* be2net: Fix INTx processing for Lancer
  - LP: #921793
* be2net: fix range check for set_qos for a VF
  - LP: #921793
* be2net: query link status in be_open()
  - LP: #921793
* netdev: make net_device_ops const
  - LP: #921793
* be2net: create RSS rings even in multi-channel configs
  - LP: #921793
* ethtool: Null-terminate filename passed to ethtool_ops::flash_device
  - LP: #921793
* sched: Fix nohz load accounting
  - LP: #838811
* ACPICA: Fix regression in FADT revision checks
  - LP: #883441
* asus-wmi: move WAPF variable into quirks_entry
  - LP: #969576
* eeepc-wmi: refine quirks handling
  - LP: #969576
* drm/i915: Sanitize BIOS debugging bits from PIPECONF
  - LP: #968307
* drivers: hv: Get rid of some unnecessary code
* drivers: hv: kvp: Add/cleanup connector defines
* drivers: hv: kvp: Move the contents of hv_kvp.h to hyperv.h
* net/hyperv: Convert camel cased variables in rndis_filter.c to lower
  cases
* net/hyperv: Correct the assignment in netvsc_recv_callback()
* net/hyperv: Remove the unnecessary memset in rndis_filter_send()
* tools: hv: Use hyperv.h to get the KVP definitions
* drivers: hv: Cleanup the kvp related state in hyperv.h
* drivers: hv: kvp: Cleanup the kernel/user protocol
* drivers: hv: Increase the number of VCPUs supported in the guest
* net/hyperv: Fix data corruption in rndis_filter_receive()
* net/hyperv: Add support for vlan trunking from guests
* Drivers: hv: Add new message types to enhance KVP
* net/hyperv: fix erroneous NETDEV_TX_BUSY use
* NLS: improve UTF8 -> UTF16 string conversion routine
* Drivers: hv: Support the newly introduced KVP messages in the driver
* Tools: hv: Fully support the new KVP verbs in the user level daemon
* Tools: hv: Support enumeration from all the pools
* Drivers: scsi: storvsc: Properly handle errors from the host
* net: mv643xx_eth: fix build error
  - LP: #921793
* rebase to v3.2.14

[ Ubuntu: 3.2.0-21.34 ]

* SAUCE: (drop after 3.4) asus-wmi: add scalar board brightness adj.
  support
  - LP: #961879
* SAUCE: (drop after 3.4) asus-wmi: store backlight power status for AIO
  machine
  - LP: #961880
* [Config]: enable CONFIG_DRM_LOAD_EDID_FIRMWARE
* SAUCE: AppArmor: Add the ability to mediate mount
* SAUCE: AppArmor: Add profile introspection file to interface
* SAUCE: AppArmor: basic networking rules
* SAUCE: Update aufs for build failure caused by apparmor backport
* SAUCE: AppArmor: Fix change_onexec when called from a confined task
  - LP: #963756
* Revert "SAUCE: (drop after 3.3) platform/x86: Add driver for Apple gmux
  device"
* Rebase to v3.2.13
* d-i: Fix iwl3945 driver name typo in nic-modules
* d-i: Add missing iwl* drivers to nic-modules
  - LP: #965116
* d-i: Remove obsolete bcm43xx* drivers from nic-modules
* d-i: Add brcm*mac drivers to nic-modules
* SAUCE: (drop after 3.3) apple_bl: Add register/unregister functions
* SAUCE: (drop after 3.3) platform/x86: Add driver for Apple gmux device
* Add isci to debian scsi-modules udeb
  - LP: #963306
* SAUCE: fsam7400: use UMH_WAIT_PROC consistently
  - LP: #963685
* SAUCE: disable_nx should not be in __cpuinitdata section for X86_32
  - LP: #968233
* Bluetooth: Adding USB device 13d3:3375 as an Atheros AR3012.
  - LP: #916319
* x86: Report cpb and eff_freq_ro flags correctly
  - LP: #960461
* x86/amd: Add missing feature flag for fam15h models 10h-1fh processors
  - LP: #960461
* KVM: Move cpuid code to new file
  - LP: #960466
* KVM: expose latest Intel cpu new features (BMI1/BMI2/FMA/AVX2) to guest
  - LP: #960466
* apparmor: add missing rcu_dereference()
* apparmor: fix module parameter handling
* btrfs, nfs, apparmor: don't pull mnt_namespace.h for no reason...
* switch security_path_chmod() to umode_t
* switch securityfs_create_file() to umode_t
* switch ->path_mkdir() to umode_t
* switch ->path_mknod() to umode_t
* capabilities: remove the task from capable LSM hook entirely
* switch security_path_chmod() to struct path *
* AppArmor: refactor securityfs to use structures
* AppArmor: add initial "features" directory to securityfs
* AppArmor: add "file" details to securityfs
* AppArmor: export known rlimit names/value mappings in securityfs
* AppArmor: Add mising end of structure test to caps unpacking
* AppArmor: Fix dropping of allowed operations that are force audited
* AppArmor: Fix underflow in xindex calculation
* AppArmor: fix mapping of META_READ to audit and quiet flags
* AppArmor: Fix the error case for chroot relative path name lookup
* AppArmor: Fix error returned when a path lookup is disconnected
* AppArmor: Fix oops in policy unpack auditing
* AppArmor: Add const qualifiers to generated string tables
* AppArmor: Retrieve the dentry_path for error reporting when path lookup
  fails
* AppArmor: Minor cleanup of d_namespace_path to consolidate error
  handling
* AppArmor: Update dfa matching routines.
* AppArmor: Move path failure information into aa_get_name and rename
* AppArmor: Add ability to load extended policy
* AppArmor: add const qualifiers to string arrays
* AppArmor: Fix location of const qualifier on generated string tables
* drm: allow loading an EDID as firmware to override broken monitor
* usermodehelper: use UMH_WAIT_PROC consistently
  - LP: #963685
* usermodehelper: introduce umh_complete(sub_info)
  - LP: #963685
* usermodehelper: implement UMH_KILLABLE
  - LP: #963685
* usermodehelper: kill umh_wait, renumber UMH_* constants
  - LP: #963685
* usermodehelper: ____call_usermodehelper() doesn't need do_exit()
  - LP: #963685
* kmod: introduce call_modprobe() helper
  - LP: #963685
* kmod: make __request_module() killable
  - LP: #963685
* x86, tsc: Fix SMI induced variation in quick_pit_calibrate()
  - LP: #965586
* drm/i915: Ignore LVDS on hp t5745 and hp st5747 thin client
  - LP: #911916, #911920
* drm/i915: Add Clientron E830 to the ignore LVDS list
  - LP: #907055
* rebase to v3.2.13

[ Ubuntu: 3.2.0-20.33 ]

* (pre-stable) ASPM: Fix pcie devices with non-pcie children
  - LP: #961482

[ Ubuntu: 3.2.0-20.32 ]

* SAUCE: SECCOMP: Add PR_{GET,SET}_NO_NEW_PRIVS to prevent execve from
  granting privs
* SAUCE: SECCOMP: Fix apparmor for PR_{GET,SET}_NO_NEW_PRIVS
* SAUCE: SECCOMP: seccomp: remove duplicated failure logging
* [Config] SECCOMP_FILTER=y
* seccomp: audit abnormal end to a process due to seccomp
* SAUCE: SECCOMP: sk_run_filter: add BPF_S_ANC_SECCOMP_LD_W
* SAUCE: SECCOMP: net/compat.c,linux/filter.h: share compat_sock_fprog
* SAUCE: SECCOMP: seccomp: kill the seccomp_t typedef
* SAUCE: SECCOMP: arch/x86: add syscall_get_arch to syscall.h
* SAUCE: SECCOMP: asm/syscall.h: add syscall_get_arch
* SAUCE: SECCOMP: seccomp: add system call filtering using BPF
* SAUCE: SECCOMP: seccomp: add SECCOMP_RET_ERRNO
* SAUCE: SECCOMP: signal, x86: add SIGSYS info and make it synchronous.
* SAUCE: SECCOMP: seccomp: Add SECCOMP_RET_TRAP
* SAUCE: SECCOMP: ptrace,seccomp: Add PTRACE_SECCOMP support
* SAUCE: SECCOMP: x86: Enable HAVE_ARCH_SECCOMP_FILTER
* SAUCE: SECCOMP: Documentation: prctl/seccomp_filter

[ Ubuntu: 3.2.0-19.31 ]

* d-i: Add dm-multipath and scsi device handlers
  - LP: #959749
* d-i: Move multipath modules into their own udeb
  - LP: #598251, #959749
* [Config] Auto-detect do_tools setting
* [Config] correctly specify CROSS_COMPILE for tools build
* [Config] CONFIG_DRM_PSB_CDV=n
* Rebase to v3.2.12
* powerpc/pmac: Fix SMP kernels on pre-core99 UP machines
  - LP: #959959
* rebase to v3.2.12

[ Ubuntu: 3.2.0-19.30 ]

* [Config] Fix typeo in the Hyper-V module names
* [Config] Move kernels to "Section: kernel"
  - LP: #499557
* SAUCE: AppArmor: Add ability to load extended policy
* SAUCE: AppArmor: Add the ability to mediate mount
* SAUCE: AppArmor: Add profile introspection file to interface
* SAUCE: AppArmor: basic networking rules
* [Config] Disable CONFIG_SECURITY_TOMOYO_OMIT_USERSPACE_LOADER
  - LP: #952035
* Rebase to v3.2.10
* [Config] Update configs after rebase to v3.2.10
* Rebase to v3.2.11
* [Config] Disable CONFIG_STUB_POULSBO
  - LP: #899244
* [Config] Add CONFIG_DRM_PSB check to enforcer
  - LP: #899244
* [Config] Drop non-SMP powerpc
* net/hyperv: Use the built-in macro KBUILD_MODNAME for this driver
* x86: Derandom delay_tsc for 64 bit
* Bluetooth: Fix l2cap conn failures for ssp devices
  - LP: #872044
* KVM: x86: extend "struct x86_emulate_ops" with "get_cpuid"
  - LP: #917842
  - CVE-2012-0045
* KVM: x86: fix missing checks in syscall emulation
  - LP: #917842
  - CVE-2012-0045
* rebase to v3.2.11
* rebase to v3.2.10

Show diffs side-by-side

added added

removed removed

Lines of Context:
174
174
 
175
175
#define CLK_MULTI_REGISTER         ((__u16)(0x02))
176
176
#define CLK_START_VALUE_REGISTER   ((__u16)(0x03))
 
177
#define GPIO_REGISTER              ((__u16)(0x07))
177
178
 
178
179
#define SERIAL_LCR_DLAB            ((__u16)(0x0080))
179
180
 
1103
1104
        mos7840_port->read_urb = port->read_urb;
1104
1105
 
1105
1106
        /* set up our bulk in urb */
1106
 
 
1107
 
        usb_fill_bulk_urb(mos7840_port->read_urb,
1108
 
                          serial->dev,
1109
 
                          usb_rcvbulkpipe(serial->dev,
1110
 
                                          port->bulk_in_endpointAddress),
1111
 
                          port->bulk_in_buffer,
1112
 
                          mos7840_port->read_urb->transfer_buffer_length,
1113
 
                          mos7840_bulk_in_callback, mos7840_port);
 
1107
        if ((serial->num_ports == 2)
 
1108
                && ((((__u16)port->number -
 
1109
                        (__u16)(port->serial->minor)) % 2) != 0)) {
 
1110
                usb_fill_bulk_urb(mos7840_port->read_urb,
 
1111
                        serial->dev,
 
1112
                        usb_rcvbulkpipe(serial->dev,
 
1113
                                (port->bulk_in_endpointAddress) + 2),
 
1114
                        port->bulk_in_buffer,
 
1115
                        mos7840_port->read_urb->transfer_buffer_length,
 
1116
                        mos7840_bulk_in_callback, mos7840_port);
 
1117
        } else {
 
1118
                usb_fill_bulk_urb(mos7840_port->read_urb,
 
1119
                        serial->dev,
 
1120
                        usb_rcvbulkpipe(serial->dev,
 
1121
                                port->bulk_in_endpointAddress),
 
1122
                        port->bulk_in_buffer,
 
1123
                        mos7840_port->read_urb->transfer_buffer_length,
 
1124
                        mos7840_bulk_in_callback, mos7840_port);
 
1125
        }
1114
1126
 
1115
1127
        dbg("mos7840_open: bulkin endpoint is %d",
1116
1128
            port->bulk_in_endpointAddress);
1521
1533
        memcpy(urb->transfer_buffer, current_position, transfer_size);
1522
1534
 
1523
1535
        /* fill urb with data and submit  */
1524
 
        usb_fill_bulk_urb(urb,
1525
 
                          serial->dev,
1526
 
                          usb_sndbulkpipe(serial->dev,
1527
 
                                          port->bulk_out_endpointAddress),
1528
 
                          urb->transfer_buffer,
1529
 
                          transfer_size,
1530
 
                          mos7840_bulk_out_data_callback, mos7840_port);
 
1536
        if ((serial->num_ports == 2)
 
1537
                && ((((__u16)port->number -
 
1538
                        (__u16)(port->serial->minor)) % 2) != 0)) {
 
1539
                usb_fill_bulk_urb(urb,
 
1540
                        serial->dev,
 
1541
                        usb_sndbulkpipe(serial->dev,
 
1542
                                (port->bulk_out_endpointAddress) + 2),
 
1543
                        urb->transfer_buffer,
 
1544
                        transfer_size,
 
1545
                        mos7840_bulk_out_data_callback, mos7840_port);
 
1546
        } else {
 
1547
                usb_fill_bulk_urb(urb,
 
1548
                        serial->dev,
 
1549
                        usb_sndbulkpipe(serial->dev,
 
1550
                                port->bulk_out_endpointAddress),
 
1551
                        urb->transfer_buffer,
 
1552
                        transfer_size,
 
1553
                        mos7840_bulk_out_data_callback, mos7840_port);
 
1554
        }
1531
1555
 
1532
1556
        data1 = urb->transfer_buffer;
1533
1557
        dbg("bulkout endpoint is %d", port->bulk_out_endpointAddress);
1840
1864
 
1841
1865
        } else {
1842
1866
#ifdef HW_flow_control
1843
 
                / *setting h/w flow control bit to 0 */
 
1867
                /* setting h/w flow control bit to 0 */
1844
1868
                Data = 0xb;
1845
1869
                mos7840_port->shadowMCR = Data;
1846
1870
                status = mos7840_set_uart_reg(port, MODEM_CONTROL_REGISTER,
2309
2333
 
2310
2334
static int mos7840_calc_num_ports(struct usb_serial *serial)
2311
2335
{
2312
 
        int mos7840_num_ports = 0;
2313
 
 
2314
 
        dbg("numberofendpoints: cur %d, alt %d",
2315
 
            (int)serial->interface->cur_altsetting->desc.bNumEndpoints,
2316
 
            (int)serial->interface->altsetting->desc.bNumEndpoints);
2317
 
        if (serial->interface->cur_altsetting->desc.bNumEndpoints == 5) {
2318
 
                mos7840_num_ports = serial->num_ports = 2;
2319
 
        } else if (serial->interface->cur_altsetting->desc.bNumEndpoints == 9) {
 
2336
        __u16 Data = 0x00;
 
2337
        int ret = 0;
 
2338
        int mos7840_num_ports;
 
2339
 
 
2340
        ret = usb_control_msg(serial->dev, usb_rcvctrlpipe(serial->dev, 0),
 
2341
                MCS_RDREQ, MCS_RD_RTYPE, 0, GPIO_REGISTER, &Data,
 
2342
                VENDOR_READ_LENGTH, MOS_WDR_TIMEOUT);
 
2343
 
 
2344
        if ((Data & 0x01) == 0) {
 
2345
                mos7840_num_ports = 2;
 
2346
                serial->num_bulk_in = 2;
 
2347
                serial->num_bulk_out = 2;
 
2348
                serial->num_ports = 2;
 
2349
        } else {
 
2350
                mos7840_num_ports = 4;
2320
2351
                serial->num_bulk_in = 4;
2321
2352
                serial->num_bulk_out = 4;
2322
 
                mos7840_num_ports = serial->num_ports = 4;
 
2353
                serial->num_ports = 4;
2323
2354
        }
2324
 
        dbg ("mos7840_num_ports = %d", mos7840_num_ports);
 
2355
 
2325
2356
        return mos7840_num_ports;
2326
2357
}
2327
2358