Commit Graph

29306 Commits

Author SHA1 Message Date
Anji jonnala
791188bf77 USB: OTG: Implement aggressive power management while going to LPM
USB HW can turn off the voltage regulators, OTG comparators and can
enable PHY retention mode as a part of aggressive power management while
going to LPM provided that PMIC has capability to detect the VBUS/ID
change and doesn't have any leakage currents while turning off the
regulators.
8960 doesn't have the leakage currents and PM8921 has capability to
detect VBUS and ID change. Hence Implement the aggressive power management
for 8960.
Initialize the PHY capabilities to support aggressive power management
in the probe and use it to implement aggressive power management.

Change-Id: If3e966b0c81b3588caa5ca93e9e877e4f777892c
Signed-off-by: Anji jonnala <anjir@codeaurora.org>
2013-02-25 11:36:00 -08:00
Pavankumar Kondeti
a70e231d55 USB: OTG: msm: Implement Accessory Charger Adapter (ACA) detection
Accessory Charger Adapter allows a single USB port to be attached to both
a charger and another device at the same time.  USB device when acting as
host does not have to supply VBUS power instead can draw current from
charger port.  USB device when acting as peripheral draw current from
charger port which can supply more than the standard PC.  Different
configurations are detected via Id resistance change.

Change-Id: Id2cc26c31a652eea9edf23aa57b2db9140dddb93
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
2013-02-25 11:35:52 -08:00
Pavankumar Kondeti
428d4d3c59 USB: OTG: msm: Prevent system suspend when USB is active
Prevent system suspend when USB is active to meet strict USB spec
timings by acquiring wakelock.  The wake lock is released after
putting the hardware in low power mode.

Change-Id: Ia22555a59b281f070ef5ca68bd6e02cd1672f930
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
2013-02-25 11:35:51 -08:00
Vijayavardhan
686378dc2d USB: OTG: msm: Add support PMIC ID interrupt
PHY OTG comparators can be disabled for maximum power savings.  PHY
can not generate ID interrupt in this case.  As USB id line is routed
to PM8921 on MSM8960, depend on PM8921 for ID interrupt.

Change-Id: If375274d30235f7e950e284fabc72a4d6b5bc269
Signed-off-by: Vijayavardhan <vvreddy@codeaurora.org>
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
2013-02-25 11:35:50 -08:00
Ofir Cohen
71c90e215d usb: ci13xxx_udc: Add SPS BAM-to-BAM support
Adding new support to enable USB-Peripheral
BAM-to-BAM transactions.
Changes were added to the UDC to support
"legacy/regular" USB transfers and
endless BAM-to-BAM transfers.

To avoid adding new vendor specific UDC file
to support the new feature and keep the UDC
as a generic as possiblea, USB request holds
a vendor specific data that distinguish between
the two transfer types.

USB BAM will be added in seperate commit.

Change-Id: I3211a122fe5236cda2dbe844b44f52a2b2063baf
Signed-off-by: Ofir Cohen <ofirc@codeaurora.org>
Signed-off-by: Amit Blay <ablay@codeaurora.org>
[sboyd: only take ci13xxx_udc part]
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
2013-02-25 11:35:37 -08:00
Pavankumar Kondeti
cfd5f553be USB: Add nop functions for !USB case
OTG drivers that use USB core functions like usb_add_hcd, usb_remove_hcd,
etc can be selected for gadget only mode without selecting CONFIG_USB.

Change-Id: Ie4b0c1703622cc9051ad9f50b8901f0005daeeb6
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
2013-02-25 11:35:13 -08:00
Vijayavardhan Vennapusa
45156ca78b USB: gadget: composite: Process GetDescriptor(OTG) request
If gadget is OTG capable, respond to a GetDescriptor(OTG) request
with its OTG descriptor.  This patch adds a utility to function
to find and fill the requested descriptor.

Change-Id: I5b3624b1145d46179b0c4737e82a47c68604cab4
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
Signed-off-by: Vijayavardhan Vennapusa <vvreddy@codeaurora.org>
2013-02-25 11:34:55 -08:00
Chiranjeevi Velempati
7a5110bae3 USB: gadget: Add CCID function driver
This USB CCID function driver will be a transport layer between
the userspace CCID component and the Windows Host. Data and control
commands from the Windows Host will be sent to the userspace component
and vice-versa.

Change-Id: I7f8084bff7c4faa46ef24d7bf2e773ccf5ebe9f3
Signed-off-by: Chiranjeevi Velempati <cvelempa@codeaurora.org>
2013-02-25 11:34:49 -08:00
Anna Perel
cce917a9ac usb: gadget: MBIM function driver for QCOM chipsets
This driver implements Mobile Broadband Interface Model protocol.
Control messages are transferred through QBI module
running in user space and communicating with mbim
using file operations interface android_mbim.
Data is transferred on SPS, Bam-to-Bam.

Change-Id: Ifc4b3f7e21b1a0dac377af272f9ae922ec9c7e2e
Signed-off-by: Anna Perel <aperel@codeaurora.org>
2013-02-25 11:34:48 -08:00
Stephen Boyd
d20a151d2a usb: android: Add DIAG function driver
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
2013-02-25 11:34:48 -08:00
Ofir Cohen
521828cd2c usb: gadget: Vote for SWFI when USB cable is connected
To enable better power management and entering CPU idle states while
USB cable is connected and no USB SW involvement is required
(MSM BAM2BAM mode) a new SysFS was added.
This SysFS allow controlling USB voting and gives the ability
to save power consumption while USB is active.
default behavior is high QoS. to change the new SysFS
echo high/low to /sys/class/android_usb/android0/pm_qos

Change-Id: Ia73491cfddc3968e1d04423a1750c89fab5fefeb
Signed-off-by: Ofir Cohen <ofirc@codeaurora.org>
2013-02-25 11:34:42 -08:00
Pavankumar Kondeti
a728a25822 USB: Add configuration change notification
Devices that support Accessory Charger Adapters can draw current from
the charger port even when acting as a host.  The amount of available
current is determined by subtracting the attached peripheral current
requirement from charger rating current.  Configuration change notification
helps clients (mostly OTG drivers) to determine the attached peripheral
current requirement.

Change-Id: I4e72128aa320717fc634efc6086a667e938b4d8c
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
2013-02-25 11:34:39 -08:00
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
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
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
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
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
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
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
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
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
Jordan Crouse
7433537fe2 gpu: Add MSM KGSL gpu driver
Take in the entire GPU driver as of commit
75c34ca1b4e69e96921e4153dfa9d399e5b9d2e8 in msm-3.4

Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
2013-02-25 11:33:51 -08:00
Justin Paupore
2c76b8832b regulator: Add regulator_bulk_set_voltage
Add a convenience API to set the voltage on multiple consumers
stored in a struct regulator_bulk_data[] in one API call.

Change-Id: Iaeb5ba8c357a66f1401fb1e142bb03904e8e9c7c
Signed-off-by: Justin Paupore <jpaupore@codeaurora.org>
2013-02-25 11:33:48 -08:00
Amy Maloche
2a76454f05 regulator: Add regulator_count_voltages dummy API
This is required to avoid compilation errors
when CONFIG_REGULATOR is not defined.

Change-Id: I05f51792ce9431d55d509625db30296f4a169a1c
Signed-off-by: Amy Maloche <amaloche@codeaurora.org>
2013-02-25 11:33:47 -08:00
David Collins
3cecc29edd regulator: core: Add option to suppress regulator info messages
Each call to regulator_register() results in a line being written
into the kmsg log.  regulator_init_complete() also prints a line for
each unused regulator which is automatically disabled.

Add a function named regulator_suppress_info_printing() which can
be called to disable these print statements.

Change-Id: Ic4c723b7d02a494b4e261858d699d9625da715ea
Signed-off-by: David Collins <collinsd@codeaurora.org>
2013-02-25 11:33:45 -08:00
David Collins
7066219187 regulator: Add qpnp-regulator driver
Add the qpnp-regulator driver to support regulators found in
Qualcomm plug-and-play (QPNP) PMIC chips.  QPNP chips make use of
Qualcomm's SPMI register convention.  The particular hardware
characteristics of a given regulator can be derived from the
values present in the type and subtype registers.

The qpnp-regulator driver supports probing with either device tree
device specification or with board file specified platform data.

Change-Id: I4f74431a50949763d651faf992b5d2567d05758e
Signed-off-by: David Collins <collinsd@codeaurora.org>
[sboyd: Squash in DT binding document]
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
2013-02-25 11:33:44 -08:00
Michael Bohan
1eca77b906 regulator: Add stub regulator support
Add support for a dummy driver that has an implementation
connected to no real hardware devices. Its purpose is to aid
bringup scenarios by providing clients a regulator interface
that they expect. This driver shouldn't be enabled if a real
device implementation for a particular platform already exists.

Change-Id: Ib83027b4e599ebbc3cb153b2f346bb03495bb746
Signed-off-by: Michael Bohan <mbohan@codeaurora.org>
2013-02-25 11:33:44 -08:00
Willie Ruan
23b5ee9c80 regulator: add pm8058 xo buffer driver
As a regulator driver, this xo buffer driver takes the vote from
client and controls (enable or disable) XO (crystal) buffers so
that XO clock output can be started or stopped.

Change-Id: Iccac863af2f56d66799d8fdb3320958014466d8d
Signed-off-by: Willie Ruan <wruan@codeaurora.org>
2013-02-25 11:33:43 -08:00
David Collins
eb34c731ec regulator: gpio-regulator: create a regulator driver that wraps a GPIO
Create a new regulator driver, gpio-regulator, which wraps around a
GPIO that is the enable signal for a physical regulator.

Change-Id: I541a9a1cd3a6ffe3200ffaeee9f0f62db5e65795
Signed-off-by: David Collins <collinsd@codeaurora.org>
[sboyd: Moved to msm-gpio-regulator to not conflcit with
upstream's version of essentially the same driver]
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
2013-02-25 11:33:42 -08:00
David Collins
0b8ec2a7c0 regulator: pm8xxx-regulator: add PM8XXX regulator driver
Create a PM8XXX regulator driver that can support PMIC PM8921
variants including: PM8018, PM8038, and PM8921.

Change-Id: I60d1302e4af9a4c5caa72301c904867acd2ebe0f
Signed-off-by: David Collins <collinsd@codeaurora.org>
2013-02-25 11:33:41 -08:00
Bobby Crabtree
1593d5193c regulator: pmic8901-regulator: Add support for PMIC8901 regulator
On 8x60 PMIC LDO/SMPS/LVS are controlled from the apps processor.
This driver talks directly to the PMIC over SSBI through the
PMIC8901 core driver. This driver utilizes the regulator framework
to enable, disable, and change regulator voltage levels.

Change-Id: I21c272a490a2526c2fde9fe3ef7590a57418269a
Signed-off-by: Bobby Crabtree <bobbyc@codeaurora.org>
2013-02-25 11:33:40 -08:00
Bobby Crabtree
bf02443f61 regulator: pmic8058-regulator: add support for PMIC8058 regulator
On 8x60 PMIC LDO/SMPS/LVS are controlled from the apps processor.
This driver talks directly to the PMIC over SSBI through the
PMIC8058 core driver. This driver utilizes the regulator framework
to enable, disable, and change regulator voltage levels.

Change-Id: I25e24a3d2801d345d9f3943d54e34a563b6cc21a
Signed-off-by: Bobby Crabtree <bobbyc@quicinc.com>
2013-02-25 11:33:39 -08:00
Siddartha Mohanadoss
0f2de9d0df thermal: tsens8960: Add suspend/resume for TSENS
TSENS does not operate reliably during VDD_CX minimization.

Incorrect temperature readings are reported on some instances
when Apps processor comes out of suspend. This leads the
TSENS reporting incorrect temperature during system resume.

Change-Id: I882b37fbe290477926c3a242d3092be8b950dfab
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
[davidb: only drivers/thermal]
Signed-off-by: David Brown <davidb@codeaurora.org>
2013-02-25 11:33:36 -08:00
Siddartha Mohanadoss
38cdcd9de6 mdm9615: Add calibration data for TSENS
MDM9615 has identical configuration for the number
of sensors and slope with MSM8960. Add support to
enable the TSENS for calibrated parts.

Change-Id: Ieb1f118ce916ab5a4f079b18b11541d86c3a5560
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
[davidb: only drivers/thermal]
Signed-off-by: David Brown <davidb@codeaurora.org>
2013-02-25 11:33:34 -08:00
Siddartha Mohanadoss
085efea37e thermal: msm8960_tsens: Add APQ8064 support
TSENS is used by the thermal daemon for thermal management.
On APQ8064 there are 11 TSENS sensors that can be used by the
thermal daemon to monitor the temperature across the chip.

TSENS for APQ8064 supports individual slope for each of the
sensors. The offset used in the temperature from each of the
slope is used for temperature calcuation from the ADC code.

Change-Id: I00457aff8d67ab3367882ffe1077af863b90bc49
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
Signed-off-by: David Brown <davidb@codeaurora.org>
2013-02-25 11:33:30 -08:00
Siddartha Mohanadoss
2aa28c379d thermal: msm8960_tsens: Read TSENS temperature
Add kernel API to read TSENS temperature for clients
in the kernel space. Currently the TSENS driver only
supports reading the TSENS temperature from the
thermal sys.

Split the TSENS initialization into two parts.
First is to perform the initial calibration that is
used to convert the raw ADC code to Degrees Celcius
and initialize the TSENS HW. Second is to register the
TSENS driver to the linux thermal framework and create
the temperature zones that will be accessed by the
Thermal daemon to set thresholds, read the temperature
and receive notifications.

Change-Id: Id2305a7aa755e1e9cfaecd8b5c1870ed05d9b5e9
Signed-off-by: Praveen Chidambaram <pchidamb@codeaurora.org>
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
Signed-off-by: David Brown <davidb@codeaurora.org>
2013-02-25 11:33:27 -08:00
Siddartha Mohanadoss
2aa966117d thermal: tsens: Add support for MDM9615
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
Signed-off-by: David Brown <davidb@codeaurora.org>
2013-02-25 11:33:18 -08:00
Siddartha Mohanadoss
c965b5d997 thermal: msm: Update TSENS for 8960_V2
TSENS V2 supports reading from multiple sensors and
notifiying clients when the lower/upper thresholds
are reached. The lower/upper threshold use the last
sensors threshold that are set through the thermal sysfs.
TSENS HW is enabled only when the main sensor is requested.
The TSENS block is disabled if the main senors is disabled
irrespective of any other sensors that are being enabled.
When TSENS receives notification on temperature threshold
being reached, it checks and sends events to the sensors
that are enabled and whose thresholds are above the upper
or below the lower thresholds set in the tsens threshold
register.

Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
Signed-off-by: David Brown <davidb@codeaurora.org>
2013-02-25 11:33:17 -08:00
Siddartha Mohanadoss
a25189bc72 thermal: thermal_sys: Add support for configurable trip points.
Add functionality for configurable hi, low and critical low.
Change the trip point attributes to allow userspace clients
with root access to set temperature for configurable hi and
low temperature.

Change-Id: I25c9c3bcfd58e44da5369187d1095559062f1860
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
Signed-off-by: David Brown <davidb@codeaurora.org>
2013-02-25 11:33:15 -08:00
David Collins
37855cfa03 thermal: pm8xxx: Add pm8xxx thermal management driver
Add a PMIC PM8xxx thermal management driver which handles
interrupts associated with thermal overload events and
which provides a means to read the current PMIC die
temperature.

Change-Id: I2063be9335be2971810358e82dd273e8a0acec5a
Signed-off-by: David Collins <collinsd@codeaurora.org>
2013-02-25 11:33:12 -08:00
Sagar Dharia
648766e533 slimbus: Add Device Tree support for SLIMBUS
Slave devices can be added by listing them as child of a SLIMBUS
controller of_node in the Device Tree.
It is required to specify elemental address, and name of the slave
device.

Change-Id: Ie1b2f8fe58988f0237547a84f1bbb14ce4733eff
Signed-off-by: Sagar Dharia <sdharia@codeaurora.org>
Signed-off-by: David Brown <davidb@codeaurora.org>
2013-02-25 11:33:04 -08:00
Michael Bohan
317a4316b4 of: of_spmi: Add support for spmi-dev-container binding
The spmi-dev-container binding is intended for SPMI
configurations that have multiple device nodes associated with
only one spmi_device. By default, if this flag is not specified,
each device node will create a new spmi_device.

Sometimes having multiple spmi_devices for SPMI device nodes is
superfluous. One example of this is gpios. In some architectures,
a single gpio is treated as a unique device. But from a gpio_chip
perspective, the chip is comprised of many gpios. Beyond wasting
memory allocating a unique spmi_device per gpio, the implication
of not coalescing spmi_devices is that the clients probe() routine
would be called N number of times. But this sort of behavior makes
it difficult to realize when a gpio_chip starts and stops. If we
assume that one gpio_chip represents one call to probe(), then
this problem is solved, since all gpios in that chip will be
passed as resources.

In order to support multiple device nodes per spmi_device, we
also need to extend the data structures for spmi_resources.

This change also makes an effort to cleanup some of the error
handling for illegal combinations of device bindings, as well as
adding some additional documentation.

Change-Id: If3ce2aaaa07bdf79e0d9fdedf16419e74a00fbec
Signed-off-by: Michael Bohan <mbohan@codeaurora.org>
Signed-off-by: David Brown <davidb@codeaurora.org>
2013-02-25 11:33:02 -08:00
Kenneth Heitke
b2b4c69ecd spmi: Linux driver framework for SPMI
SPMI (System Power Management Interface) is a specification
developed by the MIPI (Mobile Industry Process Interface) Alliance
optimized for the real time control of Power Management ICs (PMIC).

SPMI is a two-wire serial interface that supports up to 4 master
devices and up to 16 logical slaves.  A physical PMIC device may
consist of multiple logical slave interfaces.

The framework supports message APIs, multiple busses (1 controller
per bus) and multiple clients/slave devices per controller.

Change-Id: Ib6319047b4ab9cea6dfb0879312c4c1f63462439
Signed-off-by: Kenneth Heitke <kheitke@codeaurora.org>
2013-02-25 11:32:57 -08:00
Michael Bohan
bb75acd691 of: Add Device Tree support for SPMI
This change adds SPMI Device Tree parsing. The
of_spmi_register_devices() API should be called from the probe()
routine of each SPMI controller to parse the subtree and add the
respective SPMI devices.

The SPMI subtree is nested up to two levels deep. The first level
is the most basic and treats the address as the SPMI slave ID.
This should be used for simple devices that has no notion of
segmented SPMI address spaces.

An optional second level specifies the address as an offset
within the outer layer's slave ID. This is used to specify
multiple devices on the same slave ID that have different address
ranges. In fact, it's reasonable to specify any number of address
ranges at this level.

Devices can also specify any number of interrupts that's decoding
is done by an external interrupt device.

Sections of this code were taken from drivers/of/platform.c.

Change-Id: Ib9f06764a9bd85e3b2aab43b72aa7132885aa044
Signed-off-by: Michael Bohan <mbohan@codeaurora.org>
Signed-off-by: David Brown <davidb@codeaurora.org>
2013-02-25 11:32:57 -08:00
David Brown
3db739bbbc slimbus: Add Qualcomm Slimbus driver
Signed-off-by: David Brown <davidb@codeaurora.org>
2013-02-25 11:32:56 -08:00
Angshuman Sarkar
f15e9af3ff n_smux: Fix compilation when CONFIG_N_SMUX is undefined
Fix compilation issues when CONFIG_N_SMUX is undefined and
empty stub functions are getting defined.

Change-Id: I6a9982dac7d9558b8da533f1fc28dddac6c1f8fc
Signed-off-by: Angshuman Sarkar <angshuman@codeaurora.org>
2013-02-25 11:32:44 -08:00
Eric Holmberg
d68384d72e tty: n_smux: Add SMUX TTY Line Discipline Driver
Add new Serial Multiplexer (SMUX) driver.

This driver multiplexes multiple logical channels over a single
physical HSUART channel using the TTY Line Discipline framework.
This driver will be used in Fusion 4 for control plane, data plane
and DIAG traffic between Application processor and QSC modem.

Change-Id: Ibecf6cea872f5baf11fb93ded6124243a37a2085
Signed-off-by: Eric Holmberg <eholmber@codeaurora.org>
Signed-off-by: Angshuman Sarkar <angshuman@codeaurora.org>
Signed-off-by: Karthikeyan Ramasubramanian <kramasub@codeaurora.org>
Signed-off-by: David Brown <davidb@codeaurora.org>
2013-02-25 11:32:35 -08:00
Stephen Boyd
3668c403db rtc: Add MSM RTC driver
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
2013-02-25 11:32:34 -08:00
Ashay Jaiswal
6b6a72adc0 drivers: rtc-pm8xxx: Fix automatic wakeup of APPS due to RTC alarm.
Alarm interrupt causes automatic wakeup even when the phone is in
powerdown state.

Change-Id: If3ae30304adba4f07284a3dc496956d67a1ae1b0
Signed-off-by: Ashay Jaiswal <ashayj@codeaurora.org>
2013-02-25 11:32:33 -08:00
Abhijeet Dharmapurikar
171e735d80 power: Add pm8921 battery monitoring driver
pm8921 chip is equipped with a smart battery gauge called bms.
BMS is capable of intelligently measuring battery parameters
under various loads, the software uses these reading to
accurately determine battery capacity.

Add driver for the bms module.

Change-Id: I0655c19bc9edc6aea15fb66b4de8d647a305416f
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
2013-02-25 11:32:32 -08:00