Commit graph

301436 commits

Author SHA1 Message Date
Hemant Kumar
3ae08d2caf EHCI: HSIC: Add support for suspend, resume and URB logging
This change logs suspend, resume and URB submission and
completion events for all the endpoints based on the mask
value set by module parameter. By default logging is enabled
for ep0 and efs sync interface.

Example:
To capture 2 in endpoint events
echo -n 4 > /sys/module/ehci_hcd/parameters/ep_addr_txdbg_mask
To capture 3 out endpoint events
echo -n 8 > /sys/module/ehci_hcd/parameters/ep_addr_rxdbg_mask
To print debug log events on ep0
cat /sys/kernel/debug/ehci_hsic_msm_dbg/show_ctrl_events
To print debug log events on other endpoints
cat /sys/kernel/debug/ehci_hsic_msm_dbg/show_data_events

Change-Id: I1ae78095f0323e957ee33df17e4451f13d4a09fb
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
[sboyd: Only take core/hcd.c part]
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
2013-02-25 11:34:38 -08:00
Jack Pham
76868895ef USB: ensure parent device is resumed for child's system-resume
During a system resume, if a parent device is resumed before its
child, it may be possible that it will be runtime-suspended
immediately afterwards, as any child devices that were previously
runtime-suspended are likely still suspended. The result is that when
a child device is then resumed after the parent has gone back into
suspend, it will fail to re-awaken the parent.

Specifically in USB this is the case as a host controller would
first be resumed but would fall back into suspend because the child
device(s) had not resumed yet to affect the controller device's
power.child_count counter. This is fixed by ensuring (synchronously,
if necessary) that the parent is resumed by calling
pm_runtime_get_sync() just prior to resuming the child device.

CRs-fixed: 346643
Change-Id: I100166d9f6ee33666b68871c147cf5eaadde861f
Signed-off-by: Jack Pham <jackp@codeaurora.org>
2013-02-25 11:34:37 -08:00
Vijayavardhan Vennapusa
2210347c11 USB: core: Add support for OTG automated compliance tests
1. Add OTG PET device to TPL. OTG device shall support this
device for allowing compliance automated testing.

2. Add otg_srp_reqd filed to gadget. OTG B-device shall enable
this flag when OTG PET (Protocol and Electrical Tester) that
acts as A-device sends Set Feature TEST_MODE with wIndex high
byte value = 0x06.  OTG PET expects B-device to initiate SRP
after the end of current session.

3. Add otg_vbus_off to usb_bus.  USB core enables this flag
when OTG PET enumerates with bcdDevice[0] field in its Device
Descriptor is equal to 1.  OTG PET expects A-device to turn off
the VBUS with in 5 sec of its disconnection which allows it to
initiate SRP.

3. Add support to identify OTG PET and start HNP quickly.

Change-Id: Ib1f4d835d00ca29ff8f980c94d75a3890507dedc
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
Signed-off-by: Vijayavardhan Vennapusa <vvreddy@codeaurora.org>
2013-02-25 11:34:36 -08:00
Manu Gautam
b5c6df35f6 USB: core: Avoid second reset during HSET Test device enumeration
During enumeration of a device, USB core first resets parent
HUB's port then issues a GetDescriptor request. After this USB
core again issues a RESET followed by SetAddress and
GetDescriptor requests.
Some HSET Test devices, needed for USB-IF host compliance tests,
fail to enumerate due to change in speed after second reset.
Hence, avoid issuing a second RESET while dealing with a HSET
Test device.

Change-Id: I4084da5381677050c785b7d11763db9b3f5635a8
CRs-Fixed: 269265
Signed-off-by: Manu Gautam <mgautam@codeaurora.org>
2013-02-25 11:34:35 -08:00
Pavankumar Kondeti
9b010a4eb4 USB: core: Clear hnp_supported flag upon device disconnect
hnp_supported flag is set for a USB bus when a HNP supported device
is connected on OTG port.  This flag is used to schedule and cancel
HNP polling work.  Clear this flag upon device disconnect.  Otherwise
HNP polling work is scheduled when another device is connected on OTG
port though the device is not a OTG device.

Change-Id: Ib0cdb165a0a8e4f59464a9cf8a433377172588e1
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
2013-02-25 11:34:35 -08:00
Pavankumar Kondeti
1a3427b7b9 USB: Notify OTG about unsupported device and hnp enable failure
OTG specification mandates an explicit message like "HUB device
not supported" to be displayed to user if host does not support
HUB class peripherals.  Distinguish HUB class peripheral from
other unsupported peripherals and send the corresponding event.

Change-Id: I2b5cfa0b19d2172b21c2a4036dd57bbf1356adef
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
2013-02-25 11:34:34 -08:00
Pavankumar Kondeti
b5ea139ac0 USB: Minimize delays involved in root hub initialization during HNP
Host controller driver may register root hub during HNP while
becoming B-Host.  Remove delays involved in debouncing and
applying port power.  This helps B-device to meet TB_ACON_BSE0
timing parameter and A-device will not find bus idle for longer
than TA_BIDL_ADIS.

Change-Id: Ib5df6417b10c6bde5bf5b9fd688c13a305ce7a4d
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
2013-02-25 11:34:33 -08:00
Pavankumar Kondeti
d53ef0ba6d USB: OTG Supplement Revision 2.0 updates
ADP (Attach Detection Protocol) is introduced to detect remote
device presence with out applying power on VBUS.  A-device
performs ADP probing and applies power on VBUS when remote device
is attached.  B-device perform ADP sensing and request session
via SRP when remote device is attached. B-device can claim their
ADP capability in OTG descriptor.

HNP polling is introduced for peripheral device to notify its wish
to become host.  Host device polls (i.e execute GetStatus())
peripheral and suspend the bus when peripheral returns host_request
True.

a_alt_hnp_support feature is obsoleted and a_hnp_support feature is
limited to legacy B-devices i.e compliant to older than Rev 2.0 spec.

Change-Id: I1a3c9d35b5e77282da8a47bafd8bc0cc4e5ae1fa
Signed-off-by: Pavankumar Kondeti <pkondeti@qualcomm.com>
2013-02-25 11:34:32 -08:00
Manu Gautam
b35815c8bd USB: Retry GetPortStatus if HUB returns 2 bytes instead of 4
Internal HUB present in ISP1763A sometimes returns 2 bytes of
data in response to GetPortStatus request. This is observed during
mutiple iterations of suspend/resume with ISP1763A.
As part of workaround retry GetPortStatus request if HUB
returns 2 bytes.

Change-Id: Iae28abe0d9e082e4741e585e085d9fb9e6e7594a
Signed-off-by: Manu Gautam <mgautam@codeaurora.org>
2013-02-25 11:34:31 -08:00
Pavankumar Kondeti
89f7c298ad usb: otg: Add MSM72k OTG driver
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
2013-02-25 11:34:30 -08:00
Manu Gautam
d1f2e566d2 USB: EHCI: msm: Fix bug in accessing hcd structure during suspend
Host driver's platform_suspend/resume routines are valid only if
LINK is operating in host mode and root-hub has been registered.
Hence, check for 'rh_registered' flag of hcd to process
platform_suspend/resume further.

Change-Id: I5278bd92b30ad5b3a154b5f9f505982097f39ace
Signed-off-by: Manu Gautam <mgautam@codeaurora.org>
2013-02-25 11:34:30 -08:00
Vijayavardhan Vennapusa
8eefe71cf5 USB: Set AHB HPROT Mode to allow posted data writes
Currently writing 0x0 into AHBMODE register which means both data
transactions and QH and TD descriptors are non-posted writes to
system memory. As per HW team recommendation, should write 0x08 value
to set AHB HPROT mode into the AHBMODE register which allows posted
data writes to system memory and will improve the throughput numbers.

Change-Id: Ib44a8cfe11c6ff96ff712643227532e24548e706
Signed-off-by: Vijayavardhan Vennapusa <vvreddy@codeaurora.org>
[sboyd: Only the echi-msm.c part]
2013-02-25 11:34:29 -08:00
Vijayavardhan Vennapusa
726fcc51b2 USB: OTG: msm: Add support for SRP and HNP
This patch changes OTG driver to support different
OTG statemachine states for OTG2.0 complaince. It will
also enable to swap Host role between two OTG devices
via HNP and enable B device to request A device to start
VBUS session via SRP.

Change-Id: Ibe2519ff1570768f51e879af483a6f5c23b38d8f
Signed-off-by: Vijayavardhan Vennapusa <vvreddy@codeaurora.org>
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
[sboyd: Only ehci-msm.c part]
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
2013-02-25 11:34:28 -08:00
Pavankumar Kondeti
164416abbb USB: OTG: msm: Simplify Runtime PM usage
In current design, PM usage counter operations are scattered across
charging detection work, state machine work, interrupt handler and
resume work.  This did not give any problems for typical device mode
or host mode use cases.  But with ACA implementation, there will be
many corner cases where PM usage operations can go wrong and device
stays out of low power mode (LPM).  Hence leave PM usage counter
operations to state machine work, which knows best about the device
state.

Don't create device and host controller platform devices as children
of OTG device.  This helps OTG state machine to know about host bus
suspend and can take a decision whether low power mode is possible or
not.

Change-Id: I00474e396546d2567d09409e70591a6c9d325c06
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
[sboyd: only the ehci-msm part]
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
2013-02-25 11:34:27 -08:00
Hemant Kumar
2d6ff7ec6e EHCI: HSIC: Halt controller before driving suspend on to the bus
There can be SOFs underway after suspending the port
(setting susp bit) which leads to phy lockup or unexpected
device disconnections. Halt the controller before setting
port suspend bit to avoid such issues.

CRs-Fixed: 363920, 356212
Change-Id: I9ab3fe0556e845621d9314b66d2af955251284fb
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
2013-02-25 11:34:26 -08:00
Vijayavardhan Vennapusa
11ab4a3c27 USB: EHCI: use otg_start_hnp() to intiate HNP in ehci-hub.c
EHCI core intiates HNP by calling otg_start_hnp() API when OTG port
is put into suspend to notify OTG driver which will take care of
HNP by suspending host and kicking gadget.

Change-Id: I2982b9f49140c2dcf2a32691e74f177e8d5d08cb
Signed-off-by: Vijayavardhan Vennapusa <vvreddy@codeaurora.org>
2013-02-25 11:34:25 -08:00
Pavankumar Kondeti
966e364488 USB: EHCI: Notify HCD about HNP enabled port suspend
Introduce a new callback method for HCD to receive notification
from EHCI core that HNP enabled port is suspended.  HCD may call
otg_start_hnp() to kick OTG state machine. Typically OTG driver
starts A_AIDL_BDIS timer and wait for B-device disconnection.

Change-Id: I1dc02c3ac9cc39ce3f45a4ff05a389fc36e4e952
Signed-off-by: Pavankumar Kondeti <pkondeti@qualcomm.com>
2013-02-25 11:34:24 -08:00
Stephen Boyd
d9fd1da255 usb: Mark some functions maybe_unused
These functions were marked unused between the 35 and 38 kernel
upgrades.

Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
2013-02-25 11:34:24 -08:00
Hemant Kumar
02c8fb58ee USB: EHCI: msm: Add platform device to support HSUSB core4 in Host Mode
Liquid platform on 8064 has ehci compliant HSUSB core4 to support
GOBI module via PCIe MINI Card CONNECTOR. This patch adds platform
device instance for EHCI compliant USB Host Controller driver.

Change-Id: I0d01babc3a818b308216bb57e48522cd2b62e07c
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
2013-02-25 11:34:23 -08:00
Manu Gautam
9ed4650ef0 USB: EHCI: msm: Add support for EHCI based Host Controller
This patch adds support for EHCI compliant USB Host Controller
for Liquid on 8064.
This driver supports Host only mode and is different from ehci-msm
which relies on OTG driver for putting hardware in low pwer mode
and PHY initialization as well.

Change-Id: I84b63b2577311900a0b434f53df547bad62f6316
Signed-off-by: Manu Gautam <mgautam@codeaurora.org>
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
2013-02-25 11:34:22 -08:00
Anji jonnala
c049bff8e0 usb: ehci: Add MSM72k EHCI usb driver
This is the legacy driver.

Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
2013-02-25 11:34:21 -08:00
Vijayavardhan Vennapusa
d054d4ecbb USB: EHCI: msm: Add support for HSIC based Host Controller
This patch adds support for EHCI compliant USB Host Controller
present in MSM chips. This Controller uses an HSIC PHY which
communicates with downstream devices using STROBE/DATA lines.

HSIC is a supplement to USB 2.0 specification and is preferred
for chip-to-chip interconnect (having maximum circuit length of
10cm) as it removes the analog transceivers.

Change-Id: Id54dcc802e606e0ff7dd31bc64671a797cd8bc09
Signed-off-by: Vijayavardhan Vennapusa <vvreddy@codeaurora.org>
Signed-off-by: Manu Gautam <mgautam@codeaurora.org>
2013-02-25 11:34:20 -08:00
Vijayavardhan Vennapusa
a626c65ae3 USB: EHCI: Allow multiple ehci drivers to be compiled together
This change has been split out of "USB: EHCI: msm: Add support
for HSIC based Host Controller". It takes only the bits that
change the way how ehci drivers are registered.

Change-Id: I8491e4a52d767ea8046a82cab2589a44d0b660aa
Signed-off-by: Vijayavardhan Vennapusa <vvreddy@codeaurora.org>
Signed-off-by: Manu Gautam <mgautam@codeaurora.org>
2013-02-25 11:34:19 -08:00
Hemant Kumar
5eeeaafaa8 EHCI: HSIC: Set the interrupt threshold control value to 8ms
Modify the maximum rate at which the HSIC host controller will
issue interrupts from 125us to 8ms. This allows HSIC controller
to aggregate all the interrupts generated in 8ms which improves
the power savings without changing the overall performance of the
driver.

CRs-Fixed: 363135, 354475
Change-Id: I17034451b6ec5a55e63054f66ad2818fc1d59824
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
[sboyd: Drop msm driver changes]
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
2013-02-25 11:34:18 -08:00
Hemant Kumar
009232883c USB: EHCI: Fix suspend and resume handling
HSIC PHY stuck issue is observed if HSIC HW goes to low power
mode in the middle of resume sequence initiated by remote wakeup.
In case of USB bus resume due to remote wakeup set Run/Stop bit
right after receiving remote wakeup interrupt and do not allow
runtime suspend in the middle of remote wakeup.
Also, add correct way to update PORTSC register in driver suspend
and resume routines.

CRs-Fixed: 360555
Change-Id: I0033541042db028d85ef49907dfd37ad5a75c8aa
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
[sboyd: Only take ehci-hcd.c part]
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
2013-02-25 11:34:18 -08:00
Anji jonnala
dec611e443 USB: EHCI: Unlink the pending async queue heads explicitly in ehci_stop
Is is observed that ehci->async->qh_next ptr is not getting freed up
which is causing crash in ehci_mem_cleanup function. As a temporary
workaround unlink the pending queue heads as a part of ehci_stop.

CRs-fixed: 301134

Signed-off-by: Anji jonnala <anjir@codeaurora.org>
2013-02-25 11:34:17 -08:00
Pavankumar Kondeti
6d746582c3 USB: otg: Add support for sending events to userspace
OTG specification insists no silent failures.  Add framework
for sending OTG failures/notifications to userspace.

The following events are defined in usb_otg_event type.
OTG_EVENT_DEV_CONN_TMOUT: Device connection timeout or device
	not responing.
OTG_EVENT_NO_RESP_FOR_HNP_ENABLE: Device is not responding to
	B_HNP_ENABLE feature request.
OTG_EVENT_HUB_NOT_SUPPORTED: Host does not support HUB class
	peripherals.
OTG_EVENT_DEV_NOT_SUPPORTED: Host does not support the attached
	peripheral.
OTG_EVENT_HNP_FAILED: HNP failed due to not meeting protocol
	timings.
OTG_EVENT_NO_RESP_FOR_SRP: No Response for B-device SRP request.

This patch adds a new method called send_event in otg_transceiver
structure.  OTG driver is notified about the event via send_event
method.  It is the responsibility of OTG driver to send the event
to userspace.  Two possible methods could be sending uevents or
providing an ioctl interface.

Change-Id: I4e518be406909fc4a9641890a3131d897a2c8636
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
2013-02-25 11:34:16 -08:00
Manu Gautam
da37b0d05c usb: ehci: Add support for SINGLE_STEP_SET_FEATURE test of EHSET
Embedded High-speed Host Electrical Test or EHSET defines following
tests for a USB Host port:
1: TEST_SE0
2: TEST_J
3: TEST_K
4: TEST_PACKET
5: HS_HOST_PORT_SUSPEND_RESUME
6: SINGLE_STEP_GET_DEV_DESC
7: SINGLE_STEP_SET_FEATURE

Tests 1-4 needs support from EHCI i.e setting test control bits in
PORTSC register.
Tests 5&6 dont require any additional support from EHCI stack.
Where as 7th test requires support in EHCI and is being added in this
patch.

For SINGLE_STEP_SET_FEATURE test, first the SETUP request of GetDesc
is sent which is followed by the IN stage after a delay of 15 secs.

SINGLE_STEP_SET_FEATURE test can be initiated like any other 1-4 Test
by issuing a SetFeature request to the root hub with Test-Selector
value = 0x06.

Change-Id: I6ad2bd5fc14c31c80f0291a82fef40c2c5a9045a
Signed-off-by: Manu Gautam <mgautam@qualcomm.com>
2013-02-25 11:34:15 -08:00
Ido Shayevitz
3716282e02 usb: dwc3: Add MSM dwc3 wrapper
Add MSM USB3.0 super-speed controller.
The MSM USB3.0 controller is a wrapper of Synopsys's DesignWare
USB3.0 controller which also includes other HW units as the DBM.

The copper device-tree now includes a new device for this controller,
which will be attached to the dwc3-msm.c driver.
The dwc3-msm.c driver will be used for MSM specific operations of USB3.0
(as managing the DBM) and for now it just add in runtime a core dwc3 device
that will be attached to the dwc3/core.c driver.

Change-Id: I1e0a9144971b2de533d4d1ce7ac5f0c3584d1930
Signed-off-by: Amit Blay <ablay@codeaurora.org>
Signed-off-by: Ido Shayevitz <idos@codeaurora.org>
2013-02-25 11:34:14 -08:00
Hemant Kumar
f84eb4bbb4 usb: Add network bridge host driver for dun and rmnet
This host driver will be used to communicate with modem devices
with dial up network and RMNET interfaces. This driver works as
a bridge to pass control and data packets between the modem and
peripheral usb gadget driver. Driver currently supports
modem devices (vendor ID 0x05c6) with PIDs 0x9001

Change-Id: Id85b552b39d061528a1c3c90a354d73580c9b631
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
Signed-off-by: Jack Pham <jackp@codeaurora.org>
2013-02-25 11:34:13 -08:00
Manu Gautam
fe9ac8e31c usb: ehci: EHSET Test-Fixture device driver for host compliance
An EHSET test fixture is used to initiate test modes on an embedded
host controller while performing the usb host compliance testing.

During enumeration by the USB host this test fixture presents a VID/PID
pair and this PID value corresponds to the requested testmode.

Change-Id: I7558f9c1c37b3c65be2b358d964b295593c021d9
CRs-Fixed: 174266
Signed-off-by: Manu Gautam <mgautam@qualcomm.com>
2013-02-25 11:34:12 -08:00
Jack Pham
d7dec0fa46 usb: Add support diag host driver
USB diag host driver will be used to connect diag interface
exposed by Qualcomm devices. This driver currently supports
usb qualcomm devices with product id: 9001 and vendor id:
0x5c6. Also add simple unit test driver to test diag host
driver.

Signed-off-by: Vamsi Krishna <vskrishn@codeaurora.org>
Signed-off-by: Jack Pham <jackp@codeaurora.org>
2013-02-25 11:34:12 -08:00
Hemant Kumar
180fbd4d7d usb: serial: Fix race between write after suspend and resume
wwan serial driver sets suspend flag when it goes to suspend.
Driver puts any write request to delayed queue during suspend
and submits the delayed write requests while resuming and clears
the suspend flag after that. This creates a race condition where
write request comes between queuing the delayed write request and
clearing the suspend flag.

CRs-Fixed: 360555
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
Change-Id: Ib15b80bb7e289db66a6306b6147f058b5e78f3e5
2013-02-25 11:34:11 -08:00
Hemant Kumar
2bc85fa444 usb: qcserial: Update copyright information.
This patch changes Qualcomm copyright to CAF copyright.

Change-Id: Ib462e48775697d4ae3ad21579a1e4f834b7d5546
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
2013-02-25 11:34:10 -08:00
Vamsi Krishna
403fb2e6de usb: Increase USB buffer size to match 9x15 buffer sizes
USB S/W on 9x15 is designed to handle 65K packet size for
flashless boot and efs-sync functions. Match buffers on 8064
usb host mode driver to achieve better throughput.

Change-Id: I6f5b50d08ad4ea59e770e2a3e8ad00d944f05e54
Signed-off-by: Vamsi Krishna <vskrishn@codeaurora.org>
2013-02-25 11:34:09 -08:00
Hemant Kumar
0d39785032 usb: qcserial: Add support for PID 0x904c
Product Id 0x904c includes DIAG, SER3(System monitor), SER4(EFS sync),
DUN, CSVT, NET1, NET2, NET3, NET4 device interfaces.

Change-Id: I6d774dacbda5be5964b049ff412b78797b84c444
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
2013-02-25 11:34:08 -08:00
Stephen Boyd
e9e502437e usb: qcserial: Add efs sync interface to qcserial
Add EFS Sync interface number to qcserial to provide
generic tty interface to userspace.

Change-Id: Ia856c133c514b640070386aa6d0933439a9f531d
Signed-off-by: Vamsi Krishna <vskrishn@codeaurora.org>
2013-02-25 11:34:07 -08:00
Hemant Kumar
d0d218d915 usb: serial: Add support for circuit-switched video telephony driver
circuit switched video telephony driver provides bridge functionality
between mdm9x15 and application in userspace to send and receive control
information and data. It uses generic serial driver which exposes tty
interface to userspace.

Change-Id: I567d3ea971f3fd2f36a071d2639ee2b43b36e233
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
2013-02-25 11:34:07 -08:00
Manu Gautam
05ea6076b8 usb: host: pehci: Add USB core changes needed by PEHCI
A user can initiate host compliance tests or suspend/resume
requests over the ISP1763A USB Host controller by issuing
IOCTLs on the pehci device.
Add necessary changes in USB core to support these requests.
These changes are taken from the 1.0.6.0 version of ST-E pehci
driver present at: http://www.box.net/shared/static/o5esh7r14q.zip
along with the fixes for checkpatch errors and removal of unused
variables.

Change-Id: Ic6b175bcd3104730bac90278456e3bfbcd507801
Signed-off-by: Manu Gautam <mgautam@codeaurora.org>
2013-02-25 11:34:06 -08:00
Manu Gautam
e3c0e555c3 usb: host: pehci: Initial commit to bring in pehci driver
isp1763A is ST-E controller which communicates with MSM 8660 over
EBI2 Bus. This patch brings in the the reference driver provided
by ST-E with the following changes:
->New Makefile added to support compilation from inside kernel tree
->Remove -Werror from CFLAGS
->Fix minor compilation error because of some USB header files got
modified in b/w .28 and .35 kernel

Change-Id: Ief053d5d25848a514069302fe35d59e744ee92b5
Signed-off-by: Manu Gautam <mgautam@codeaurora.org>
2013-02-25 11:34:05 -08:00
Krishna Vanka
8676f36913 msm: cpufreq: Fix store_powersave_bias to account for sync' CPUs.
Current code assumes that all online CPUs runs their own timers to
collect CPU samples for demand based switching (dbs). But in case of
synchronous CPUs, ondemand governor registers only one timer at init
time because both CPUs are accounted in the same timer call. Hence
trying to restart/cancel dbs timers for all online CPUs is not legal
for these CPUs. This change fixes above function to restart/cancel
timers only once for group of synchronous CPUs.

Change-Id: I23f1697783a65f125679a07a076620e8fa5e62d5
Signed-off-by: Krishna Vanka <kvanka@codeaurora.org>
2013-02-25 11:34:04 -08:00
David Ng
85d448090a cpufreq: Extend ondemand powersave_bias for negative range
Original ondemand powersave_bias parameter allows value
range from 0 (no powersave) to 1000 (100% reduction in
calculated CPU frequency).  This change extends powersave_bias
into the negative range (-1 to -1000) to allow a corresponding
boost to CPU frequency.  When set at either limit (-1000 or
1000), ondemand timer is cancelled as periodic load
sampling at sampling_rate is not necessary.

Change-Id: I2ee05729ceec20c2e2a4c6d9ca05cecd16ab161a
Signed-off-by: David Ng <dave@codeaurora.org>
2013-02-25 11:34:03 -08:00
Anitha Anand
988f1224aa cpufreq : Fix crash input event handler on governor switch
When an input event and CPU1 hotplug occurs at the same
time, a race condition can happen between cpufreq and
cpu hotplug resulting in a kernel panic.
When a hotplug operation is underway on CPU1,
__cpufreq_remove_dev is called. __cpufreq_remove_dev gets
the lock, proceeds to free the policy info of the current
governor and calls the ondemand governor with a STOP event.
If an input event occurs around the same time, it waits
for __cpufreq_remove_dev to release the lock. Meanwhile,
the ondemand governor clears some of its settings, but
fails to clear its local current policy. As soon as the
input event handler acquires the lock, it now uses the
invalid ondemand current policy handle to make frequency
changes. This results in a kernel panic.

Skip making frequency changes if this condition happens.

CRs-fixed: 327622,319348
Change-Id: I78227352fc66cc3ec5ab095c45eda76a92d1ba46
Signed-off-by: Anitha Anand <anithas@codeaurora.org>
2013-02-25 11:34:02 -08:00
David Ng
64ea8edaa8 cpufreq: Fix input handler crash
When input handler is running on a CPU not in ondemand
governor, skip making CPU frequency changes.

CRs-Fixed: 299451
Change-Id: I9fe1ac3432d7b1613d1e3766e86160e4fe61d6ec
Signed-off-by: David Ng <dave@codeaurora.org>
2013-02-25 11:34:01 -08:00
Brian Steuer
cceb002c14 cpufreq: Check all online CPUs on input event
Previously, only the first CPU in an SMP system was bumped to the
maximum clock when receiving an input event. This worked fine on
uniprocessor systems or scenarios were other CPUs tended to be
powered down. In other situations, it is better to bump up the
clocks of all CPUs that are online. This will not affect the
situations mentioned above, but it will help others.

Change-Id: Id51ebefe57ada56cefb8474cdbfebe1230432680
Signed-off-by: Brian Steuer <bsteuer@codeaurora.org>
2013-02-25 11:34:01 -08:00
Brian Steuer
983a4521ab cpufreq: Use separate workqueue for input handler
Change-Id: Iabac5c8ada9342c23f40a3fd3598805738bb8a9c
Signed-off-by: Brian Steuer <bsteuer@codeaurora.org>
2013-02-25 11:34:00 -08:00
Brian Steuer
3443b279a4 cpufreq: Make sure input handler always runs on cpu0
Make sure that only a single input handle is registered for the
ondemand governor. Force the input handler to run on cpu0 so it
will not be migrated due to cpu hotplug.

Change-Id: Ic72c34355c629da01290cf1a5e81d534aaf83d86
Signed-off-by: Brian Steuer <bsteuer@codeaurora.org>
2013-02-25 11:33:59 -08:00
Tero Kristo
0e29c3a27e Cpufreq: Added input event hook to ramp up cpu frequency
This will cause switch to maximum opp immediately when user
interaction occurs, i.e. touchscreen input or keypad activity.

Change-Id: I0cfe32479ef62a967f359c1bf57f97eefde7e8f7
Signed-off-by: Tero Kristo <tero.kristo@nokia.com>
Signed-off-by: Jouni Hogander <jouni.hogander@nokia.com>
[bsteuer@quicinc.com: fixed cpu_dbs_info naming, added header]
Signed-off-by: Brian Steuer <bsteuer@codeaurora.org>
2013-02-25 11:33:58 -08:00
Praveen Chidambaram
e7bbb10673 cpufreq: Make down_differential parameter configurable.
The down_differential parameter determines the down threshold for
the governor to scale down the frequency and when made configurable
provides for a variable operating range for the governor.

Usage:
cat /sys/devices/system/cpu/cpu0/cpufreq/ondemand/down_differential
echo 30 >
/sys/devices/system/cpu/cpu0/cpufreq/ondemand/down_differential

Change-Id: Ice94b8ae961aa3df7f9582c2af2275414931faed
Signed-off-by: Brian Steuer <bsteuer@codeaurora.org>
2013-02-25 11:33:57 -08:00
Larry Bassel
fca8a06f35 fmem: add qcache implementation
Part of this code is originally from the 3.1 version of the
tmem backend zcache.

The zcache code was copied to the qcache directory and
modifications were made, notably to the memory allocation
(from a block of pre-reserved contiguous memory rather
than from system memory), and to allow tmem and qcache to
be turned on and off either from a /sys file or using
an exported API.

A higher level driver (fmem) is provided that is
the interface to other (PMEM, ION, tmem/qcache) drivers.

Change-Id: Ieda939ed1ba7c5337dd4338b9d9caffde883e82b
Signed-off-by: Larry Bassel <lbassel@codeaurora.org>
2013-02-25 11:33:57 -08:00